Module Name:    src
Committed By:   christos
Date:           Tue Feb 13 22:35:47 UTC 2018

Modified Files:
        src/crypto/external/bsd/openssl/dist/crypto/evp: m_sha1.c

Log Message:
Provide SHAR384 flavors: The OpenSSL SHA512_Final implementation is re-used
to implement SHA384_Final, but does the right thing by checking the internally
kept digest size. The NetBSD libc implementation provides two entry points
that write a different size digest, so if we use the SHA512_Final from here
we end up overwriting memory.

To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c:1.8 src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c:1.9
--- src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c:1.8	Thu Feb  8 16:51:28 2018
+++ src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c	Tue Feb 13 17:35:47 2018
@@ -178,6 +178,16 @@ static int init384(EVP_MD_CTX *ctx)
     return SHA384_Init(EVP_MD_CTX_md_data(ctx));
+static int update384(EVP_MD_CTX *ctx, const void *data, size_t count)
+    return SHA384_Update(EVP_MD_CTX_md_data(ctx), data, count);
+static int final384(EVP_MD_CTX *ctx, unsigned char *md)
+    return SHA384_Final(md, EVP_MD_CTX_md_data(ctx));
 static int init512(EVP_MD_CTX *ctx)
     return SHA512_Init(EVP_MD_CTX_md_data(ctx));
@@ -200,8 +210,8 @@ static const EVP_MD sha384_md = {
-    update512,
-    final512,
+    update384,
+    final384,

Reply via email to