summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_eay.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_eay.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_eay.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c
index 90a3be8dd3..128269a81a 100644
--- a/src/lib/libcrypto/rsa/rsa_eay.c
+++ b/src/lib/libcrypto/rsa/rsa_eay.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_eay.c,v 1.46 2017/01/29 17:49:23 beck Exp $ */ 1/* $OpenBSD: rsa_eay.c,v 1.47 2017/04/28 22:38:51 beck 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 *
@@ -244,10 +244,8 @@ err:
244 BN_CTX_end(ctx); 244 BN_CTX_end(ctx);
245 BN_CTX_free(ctx); 245 BN_CTX_free(ctx);
246 } 246 }
247 if (buf != NULL) { 247 freezero(buf, num);
248 explicit_bzero(buf, num); 248
249 free(buf);
250 }
251 return r; 249 return r;
252} 250}
253 251
@@ -468,10 +466,8 @@ err:
468 BN_CTX_end(ctx); 466 BN_CTX_end(ctx);
469 BN_CTX_free(ctx); 467 BN_CTX_free(ctx);
470 } 468 }
471 if (buf != NULL) { 469 freezero(buf, num);
472 explicit_bzero(buf, num); 470
473 free(buf);
474 }
475 return r; 471 return r;
476} 472}
477 473
@@ -597,10 +593,8 @@ err:
597 BN_CTX_end(ctx); 593 BN_CTX_end(ctx);
598 BN_CTX_free(ctx); 594 BN_CTX_free(ctx);
599 } 595 }
600 if (buf != NULL) { 596 freezero(buf, num);
601 explicit_bzero(buf, num); 597
602 free(buf);
603 }
604 return r; 598 return r;
605} 599}
606 600
@@ -700,10 +694,8 @@ err:
700 BN_CTX_end(ctx); 694 BN_CTX_end(ctx);
701 BN_CTX_free(ctx); 695 BN_CTX_free(ctx);
702 } 696 }
703 if (buf != NULL) { 697 freezero(buf, num);
704 explicit_bzero(buf, num); 698
705 free(buf);
706 }
707 return r; 699 return r;
708} 700}
709 701