summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_sign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_sign.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_sign.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_sign.c b/src/lib/libcrypto/rsa/rsa_sign.c
index 818b88c604..6e9e869f0a 100644
--- a/src/lib/libcrypto/rsa/rsa_sign.c
+++ b/src/lib/libcrypto/rsa/rsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_sign.c,v 1.28 2017/04/28 22:46:40 beck Exp $ */ 1/* $OpenBSD: rsa_sign.c,v 1.29 2017/05/02 03:59:45 deraadt Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -135,10 +135,8 @@ RSA_sign(int type, const unsigned char *m, unsigned int m_len,
135 else 135 else
136 *siglen = i; 136 *siglen = i;
137 137
138 if (type != NID_md5_sha1) { 138 if (type != NID_md5_sha1)
139 explicit_bzero(tmps, (unsigned int)j + 1); 139 freezero(tmps, (unsigned int)j + 1);
140 free(tmps);
141 }
142 return (ret); 140 return (ret);
143} 141}
144 142
@@ -232,12 +230,8 @@ int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len,
232 ret = 1; 230 ret = 1;
233 } 231 }
234err: 232err:
235 if (sig != NULL) 233 X509_SIG_free(sig);
236 X509_SIG_free(sig); 234 freezero(s, (unsigned int)siglen);
237 if (s != NULL) {
238 explicit_bzero(s, (unsigned int)siglen);
239 free(s);
240 }
241 return ret; 235 return ret;
242} 236}
243 237