]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- djm@cvs.openbsd.org 2014/02/02 03:44:31
authorDamien Miller <djm@mindrot.org>
Tue, 4 Feb 2014 00:25:45 +0000 (11:25 +1100)
committerDamien Miller <djm@mindrot.org>
Tue, 4 Feb 2014 00:25:45 +0000 (11:25 +1100)
     [digest-libc.c digest-openssl.c]
     convert memset of potentially-private data to explicit_bzero()

ChangeLog
digest-libc.c
digest-openssl.c

index 3e755cb9ccaebf1010671ae1bb654d5182ef36a8..bad531bf3065ed2c4df9b6c621ff753cecf22e57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,9 @@
      [ssh-ecdsa.c]
      fix memory leak; ECDSA_SIG_new() allocates 'r' and 's' for us, unlike
      DSA_SIG_new. Reported by Batz Spear; ok markus@
+   - djm@cvs.openbsd.org 2014/02/02 03:44:31
+     [digest-libc.c digest-openssl.c]
+     convert memset of potentially-private data to explicit_bzero()
 
 20140131
  - (djm) [sandbox-seccomp-filter.c sandbox-systrace.c] Allow shutdown(2)
index e1fcda71a84d7306890630e45d3627004451381d..1804b069840b460087cdfd4b8633fe646290ca40 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: digest-libc.c,v 1.1 2014/01/28 20:13:46 markus Exp $ */
+/* $OpenBSD: digest-libc.c,v 1.2 2014/02/02 03:44:31 djm Exp $ */
 /*
  * Copyright (c) 2013 Damien Miller <djm@mindrot.org>
  * Copyright (c) 2014 Markus Friedl.  All rights reserved.
@@ -209,9 +209,9 @@ ssh_digest_free(struct ssh_digest_ctx *ctx)
        if (ctx != NULL) {
                digest = ssh_digest_by_alg(ctx->alg);
                if (digest) {
-                       memset(ctx->mdctx, 0, digest->ctx_len);
+                       explicit_bzero(ctx->mdctx, digest->ctx_len);
                        free(ctx->mdctx);
-                       memset(ctx, 0, sizeof(*ctx));
+                       explicit_bzero(ctx, sizeof(*ctx));
                        free(ctx);
                }
        }
index 8d7a58f3440c0a5382187872cdbba80dc5318a0f..863d37d03b8c6f46d5fbabca302ede8e683b2325 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: digest-openssl.c,v 1.1 2014/01/28 20:13:46 markus Exp $ */
+/* $OpenBSD: digest-openssl.c,v 1.2 2014/02/02 03:44:31 djm Exp $ */
 /*
  * Copyright (c) 2013 Damien Miller <djm@mindrot.org>
  *
@@ -140,7 +140,7 @@ ssh_digest_free(struct ssh_digest_ctx *ctx)
 {
        if (ctx != NULL) {
                EVP_MD_CTX_cleanup(&ctx->mdctx);
-               memset(ctx, 0, sizeof(*ctx));
+               explicit_bzero(ctx, sizeof(*ctx));
                free(ctx);
        }
 }