Jump to conversation
Unresolved conversations (16)
@Jakuje Jakuje Nov 14, 2017
This needs to be rewritten to something like the following, otherwise it will segfault for non-RSA keys (ECC on yubikey): ``` if (rsa && RSA_get0_key(rsa, &n, &e, NULL) && n && e && ``` I just noticed it with the version I run on Fedora.
Outdated
ssh-pkcs11.c
noloader Jakuje
@davidben davidben Oct 16, 2017
RSA_bits? (Also DSA_bits below, but you'll need to add a new compat wrapper.)
Outdated
sshkey.c
@davidben davidben Oct 16, 2017
Error-handling?
Outdated
ssh-pkcs11-client.c
@davidben davidben Oct 16, 2017
Check that `rsa_n` and `rsa_e` are NULL.
Outdated
ssh-pkcs11.c
@davidben davidben Oct 16, 2017
`pkcs11_rsa_finish` doesn't free this.
ssh-pkcs11.c
@davidben davidben Oct 16, 2017
Nit: These blocks seem over-indented (which makes the diff a little more annoying), or is that the preferred style here? Ditto with the other `case FOO: { ... }` blocks.
ssh-keygen.c
@davidben davidben Oct 16, 2017
Nit: Calling `EVP_MD_CTX_init` seems prudent? (Though it does just memset to zero.) Alternatively, this could just call `EVP_MD_CTX_create` and `EVP_MD_CTX_destroy` which exist in 1.0.x.
Outdated
libcrypto-compat.c
kroeckx
@davidben davidben Oct 16, 2017
(unused)
libcrypto-compat.h
@davidben davidben Oct 16, 2017
(unused)
libcrypto-compat.h
@davidben davidben Oct 16, 2017
(Personally I would have just made these header-only, but whatever.)
libcrypto-compat.c
@davidben davidben Oct 16, 2017
This now leaks `ret->mdctx` if `EVP_DigestInit_ex` hits a malloc failure. You want `EVP_MD_CTX_free(ret->mdctx); free(ret);` or `ssh_digest_free(ret)`.
Outdated
digest-openssl.c
@davidben davidben Oct 16, 2017
Asking `EVP_CipherInit` to copy `keylen` bytes worth of `key` before telling it what `keylen` is (`EVP_CIPHER_CTX_set_key_length`) seems kind of questionable, notably for ciphers with variable-length keys. Are you sure this works? It was probably previously in two steps so it'd all happen in the right order.
Outdated
cipher.c
davidben kroeckx
@davidben davidben Oct 16, 2017
Nit: I believe you can just omit lines 294 and 295 (after fixing the NULL-initializing above). `BN_hex2bn` just allocates things for you.
Outdated
dh.c
@davidben davidben Oct 16, 2017
This should be NULL-initialized otherwise some of the `goto err` paths below will get confused on malloc error.
Outdated
dh.c
@Jakuje Jakuje Oct 27, 2016
This is certainly wrong. In this case, you should not allocate&put&set. It should be get&put. The same for below RSA case.
Outdated
sshkey.c
kroeckx
@Jakuje Jakuje Oct 21, 2016
This is intentionally left out or like todo for future readers?
Outdated
sshkey.c
Jakuje kroeckx
Resolved conversations (0)