From: beck Date: Sat, 8 Jul 2023 12:24:10 +0000 (+0000) Subject: Hide symbols in sha X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=65be244d5a3593968357bc5e04f492147dd244dc;p=openbsd Hide symbols in sha ok tb@ --- diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 66de59acdb7..bc50302981d 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -2389,3 +2389,26 @@ _libre_BN_get_rfc3526_prime_4096 _libre_BN_get_rfc3526_prime_6144 _libre_BN_get_rfc3526_prime_8192 _libre_ERR_load_BN_strings +_libre_SHA1_Init +_libre_SHA1_Update +_libre_SHA1_Final +_libre_SHA1 +_libre_SHA1_Transform +_libre_SHA224_Init +_libre_SHA224_Update +_libre_SHA224_Final +_libre_SHA224 +_libre_SHA256_Init +_libre_SHA256_Update +_libre_SHA256_Final +_libre_SHA256 +_libre_SHA256_Transform +_libre_SHA384_Init +_libre_SHA384_Update +_libre_SHA384_Final +_libre_SHA384 +_libre_SHA512_Init +_libre_SHA512_Update +_libre_SHA512_Final +_libre_SHA512 +_libre_SHA512_Transform diff --git a/lib/libcrypto/hidden/openssl/sha.h b/lib/libcrypto/hidden/openssl/sha.h new file mode 100644 index 00000000000..ee58793205d --- /dev/null +++ b/lib/libcrypto/hidden/openssl/sha.h @@ -0,0 +1,52 @@ +/* $OpenBSD: sha.h,v 1.1 2023/07/08 12:24:10 beck Exp $ */ +/* + * Copyright (c) 2023 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBCRYPTO_SHA_H +#define _LIBCRYPTO_SHA_H + +#ifndef _MSC_VER +#include_next +#else +#include "../include/openssl/sha.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(SHA1_Init); +LCRYPTO_USED(SHA1_Update); +LCRYPTO_USED(SHA1_Final); +LCRYPTO_USED(SHA1); +LCRYPTO_USED(SHA1_Transform); +LCRYPTO_USED(SHA224_Init); +LCRYPTO_USED(SHA224_Update); +LCRYPTO_USED(SHA224_Final); +LCRYPTO_USED(SHA224); +LCRYPTO_USED(SHA256_Init); +LCRYPTO_USED(SHA256_Update); +LCRYPTO_USED(SHA256_Final); +LCRYPTO_USED(SHA256); +LCRYPTO_USED(SHA256_Transform); +LCRYPTO_USED(SHA384_Init); +LCRYPTO_USED(SHA384_Update); +LCRYPTO_USED(SHA384_Final); +LCRYPTO_USED(SHA384); +LCRYPTO_USED(SHA512_Init); +LCRYPTO_USED(SHA512_Update); +LCRYPTO_USED(SHA512_Final); +LCRYPTO_USED(SHA512); +LCRYPTO_USED(SHA512_Transform); + +#endif /* _LIBCRYPTO_SHA_H */ diff --git a/lib/libcrypto/sha/sha1.c b/lib/libcrypto/sha/sha1.c index 77830e2c682..6e35d797b5c 100644 --- a/lib/libcrypto/sha/sha1.c +++ b/lib/libcrypto/sha/sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1.c,v 1.10 2023/07/08 07:58:25 jsing Exp $ */ +/* $OpenBSD: sha1.c,v 1.11 2023/07/08 12:24:10 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -344,6 +344,7 @@ SHA1_Init(SHA_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA1_Init); int SHA1_Update(SHA_CTX *c, const void *data_, size_t len) @@ -398,12 +399,14 @@ SHA1_Update(SHA_CTX *c, const void *data_, size_t len) } return 1; } +LCRYPTO_ALIAS(SHA1_Update); void SHA1_Transform(SHA_CTX *c, const unsigned char *data) { sha1_block_data_order(c, data, 1); } +LCRYPTO_ALIAS(SHA1_Transform); int SHA1_Final(unsigned char *md, SHA_CTX *c) @@ -448,6 +451,7 @@ SHA1_Final(unsigned char *md, SHA_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA1_Final); unsigned char * SHA1(const unsigned char *d, size_t n, unsigned char *md) @@ -467,5 +471,6 @@ SHA1(const unsigned char *d, size_t n, unsigned char *md) return (md); } +LCRYPTO_ALIAS(SHA1); #endif diff --git a/lib/libcrypto/sha/sha256.c b/lib/libcrypto/sha/sha256.c index 80578f9ab66..0d0c4231ef6 100644 --- a/lib/libcrypto/sha/sha256.c +++ b/lib/libcrypto/sha/sha256.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha256.c,v 1.26 2023/07/07 15:06:50 jsing Exp $ */ +/* $OpenBSD: sha256.c,v 1.27 2023/07/08 12:24:10 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. * @@ -248,18 +248,21 @@ SHA224_Init(SHA256_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA224_Init); int SHA224_Update(SHA256_CTX *c, const void *data, size_t len) { return SHA256_Update(c, data, len); } +LCRYPTO_ALIAS(SHA224_Update); int SHA224_Final(unsigned char *md, SHA256_CTX *c) { return SHA256_Final(md, c); } +LCRYPTO_ALIAS(SHA224_Final); unsigned char * SHA224(const unsigned char *d, size_t n, unsigned char *md) @@ -278,6 +281,7 @@ SHA224(const unsigned char *d, size_t n, unsigned char *md) return (md); } +LCRYPTO_ALIAS(SHA224); int SHA256_Init(SHA256_CTX *c) @@ -297,6 +301,7 @@ SHA256_Init(SHA256_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA256_Init); int SHA256_Update(SHA256_CTX *c, const void *data_, size_t len) @@ -351,12 +356,14 @@ SHA256_Update(SHA256_CTX *c, const void *data_, size_t len) } return 1; } +LCRYPTO_ALIAS(SHA256_Update); void SHA256_Transform(SHA256_CTX *c, const unsigned char *data) { sha256_block_data_order(c, data, 1); } +LCRYPTO_ALIAS(SHA256_Transform); int SHA256_Final(unsigned char *md, SHA256_CTX *c) @@ -417,6 +424,7 @@ SHA256_Final(unsigned char *md, SHA256_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA256_Final); unsigned char * SHA256(const unsigned char *d, size_t n, unsigned char *md) @@ -435,5 +443,6 @@ SHA256(const unsigned char *d, size_t n, unsigned char *md) return (md); } +LCRYPTO_ALIAS(SHA256); #endif /* OPENSSL_NO_SHA256 */ diff --git a/lib/libcrypto/sha/sha512.c b/lib/libcrypto/sha/sha512.c index 6dc91cb0f5f..360a5c29fbe 100644 --- a/lib/libcrypto/sha/sha512.c +++ b/lib/libcrypto/sha/sha512.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha512.c,v 1.40 2023/07/02 14:57:58 jsing Exp $ */ +/* $OpenBSD: sha512.c,v 1.41 2023/07/08 12:24:10 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. * @@ -325,18 +325,21 @@ SHA384_Init(SHA512_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA384_Init); int SHA384_Update(SHA512_CTX *c, const void *data, size_t len) { return SHA512_Update(c, data, len); } +LCRYPTO_ALIAS(SHA384_Update); int SHA384_Final(unsigned char *md, SHA512_CTX *c) { return SHA512_Final(md, c); } +LCRYPTO_ALIAS(SHA384_Final); unsigned char * SHA384(const unsigned char *d, size_t n, unsigned char *md) @@ -355,6 +358,7 @@ SHA384(const unsigned char *d, size_t n, unsigned char *md) return (md); } +LCRYPTO_ALIAS(SHA384); int SHA512_Init(SHA512_CTX *c) @@ -374,12 +378,14 @@ SHA512_Init(SHA512_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA512_Init); void SHA512_Transform(SHA512_CTX *c, const unsigned char *data) { sha512_block_data_order(c, data, 1); } +LCRYPTO_ALIAS(SHA512_Transform); int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) @@ -428,6 +434,7 @@ SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) return 1; } +LCRYPTO_ALIAS(SHA512_Update); int SHA512_Final(unsigned char *md, SHA512_CTX *c) @@ -485,6 +492,7 @@ SHA512_Final(unsigned char *md, SHA512_CTX *c) return 1; } +LCRYPTO_ALIAS(SHA512_Final); unsigned char * SHA512(const unsigned char *d, size_t n, unsigned char *md) @@ -503,6 +511,7 @@ SHA512(const unsigned char *d, size_t n, unsigned char *md) return (md); } +LCRYPTO_ALIAS(SHA512); int SHA512_224_Init(SHA512_CTX *c)