Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/dist/include/openssl Provide the...



details:   https://anonhg.NetBSD.org/src/rev/2cdab408d206
branches:  trunk
changeset: 829823:2cdab408d206
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Feb 13 22:32:10 2018 +0000

description:
Provide the means to use the libc sha2 internally instead of the openssl
implementation; this does not really matter since their structs are larger
than ours, but it helps when we want to verify that we are not using any
of the openssl code.

diffstat:

 crypto/external/bsd/openssl/dist/include/openssl/sha.h |  13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 9cd5a2eb972b -r 2cdab408d206 crypto/external/bsd/openssl/dist/include/openssl/sha.h
--- a/crypto/external/bsd/openssl/dist/include/openssl/sha.h    Tue Feb 13 22:29:14 2018 +0000
+++ b/crypto/external/bsd/openssl/dist/include/openssl/sha.h    Tue Feb 13 22:32:10 2018 +0000
@@ -10,6 +10,10 @@
 #ifndef HEADER_SHA_H
 # define HEADER_SHA_H
 
+#ifdef USE_LIBC_SHA2
+# include <sha2.h>
+#endif
+
 # include <openssl/e_os2.h>
 # include <stddef.h>
 
@@ -44,6 +48,7 @@
 unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
 void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
 
+#ifndef USE_LIBC_SHA2
 # define SHA256_CBLOCK   (SHA_LBLOCK*4)/* SHA-256 treats input data as a
                                         * contiguous array of 32 bit wide
                                         * big-endian values. */
@@ -112,6 +117,14 @@
 unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
 void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
 
+#else
+#define SHA256_CBLOCK 64
+#define SHA512_CBLOCK 128
+unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
+unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
+unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
+#endif
+
 #ifdef  __cplusplus
 }
 #endif



Home | Main Index | Thread Index | Old Index