diff options
author | Jon Simons <jon@jonsimons.org> | 2014-10-05 05:59:54 -0700 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-12-05 10:42:32 +0100 |
commit | 4745d652b5e71c27fd891edfe690162c0b8d3005 (patch) | |
tree | 42eaa0d31af549788f8f9c91716f8c23a1336fab /include/libssh | |
parent | a48711ae7ef890c94e2a824afb899df385c406ee (diff) | |
download | libssh-4745d652b5e71c27fd891edfe690162c0b8d3005.tar.gz libssh-4745d652b5e71c27fd891edfe690162c0b8d3005.tar.xz libssh-4745d652b5e71c27fd891edfe690162c0b8d3005.zip |
pki_crypto.c: plug ecdsa_sig->[r,s] bignum leaks
Per ecdsa(3ssl), ECDSA_SIG_new does allocate its 'r' and 's' bignum fields.
Fix a bug where the initial 'r' and 's' bignums were being overwritten with
newly-allocated bignums, resulting in a memory leak.
BUG: https://red.libssh.org/issues/175
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh')
-rw-r--r-- | include/libssh/bignum.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/libssh/bignum.h b/include/libssh/bignum.h index e5f2a472..61786c84 100644 --- a/include/libssh/bignum.h +++ b/include/libssh/bignum.h @@ -25,6 +25,7 @@ #include "libssh/libgcrypt.h" bignum make_string_bn(ssh_string string); +void make_string_bn_inplace(ssh_string string, bignum bnout); ssh_string make_bignum_string(bignum num); void ssh_print_bignum(const char *which,bignum num); |