1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

bignum: Make bignum_free safer

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Aris Adamantiadis
2016-01-01 19:16:49 +01:00
committed by Andreas Schneider
parent c3dac948c9
commit db9da99a36
9 changed files with 51 additions and 41 deletions

View File

@@ -1036,7 +1036,7 @@ ssh_signature pki_do_sign(const ssh_key privkey, const unsigned char *hash,
sig->ecdsa_sig.s = bignum_new();
if (sig->ecdsa_sig.s == NULL) {
bignum_free(sig->ecdsa_sig.r);
bignum_safe_free(sig->ecdsa_sig.r);
return NULL;
}
@@ -1094,7 +1094,7 @@ ssh_signature pki_do_sign_sessionid(const ssh_key key, const unsigned char
sig->ecdsa_sig.s = bignum_new();
if (sig->ecdsa_sig.s == NULL) {
bignum_free(sig->ecdsa_sig.r);
bignum_safe_free(sig->ecdsa_sig.r);
return NULL;
}