From: joshua Date: Sat, 30 Mar 2024 05:14:12 +0000 (+0000) Subject: Hide symbols in aes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1bda457611754fc651cf5bcf94e5e07a54616eeb;p=openbsd Hide symbols in aes ok jsing --- diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 5862beeeb04..a9ac044b715 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -2614,3 +2614,17 @@ _libre_Camellia_cfb1_encrypt _libre_Camellia_cfb8_encrypt _libre_Camellia_ofb128_encrypt _libre_Camellia_ctr128_encrypt +_libre_AES_set_encrypt_key +_libre_AES_set_decrypt_key +_libre_AES_encrypt +_libre_AES_decrypt +_libre_AES_ecb_encrypt +_libre_AES_cbc_encrypt +_libre_AES_cfb128_encrypt +_libre_AES_cfb1_encrypt +_libre_AES_cfb8_encrypt +_libre_AES_ofb128_encrypt +_libre_AES_ctr128_encrypt +_libre_AES_ige_encrypt +_libre_AES_wrap_key +_libre_AES_unwrap_key diff --git a/lib/libcrypto/aes/aes.c b/lib/libcrypto/aes/aes.c index 9b25a21f4cb..4d040ea5f7e 100644 --- a/lib/libcrypto/aes/aes.c +++ b/lib/libcrypto/aes/aes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes.c,v 1.2 2024/03/28 12:52:58 jsing Exp $ */ +/* $OpenBSD: aes.c,v 1.3 2024/03/30 05:14:12 joshua Exp $ */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * @@ -83,6 +83,7 @@ AES_cbc_encrypt(const unsigned char *in, unsigned char *out, { aes_cbc_encrypt_internal(in, out, len, key, ivec, enc); } +LCRYPTO_ALIAS(AES_cbc_encrypt); /* * The input and output encrypted as though 128bit cfb mode is being @@ -97,6 +98,7 @@ AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc, (block128_f)AES_encrypt); } +LCRYPTO_ALIAS(AES_cfb128_encrypt); /* N.B. This expects the input to be packed, MS bit first */ void @@ -106,6 +108,7 @@ AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, size_t length, CRYPTO_cfb128_1_encrypt(in, out, length, key, ivec, num, enc, (block128_f)AES_encrypt); } +LCRYPTO_ALIAS(AES_cfb1_encrypt); void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, size_t length, @@ -114,6 +117,7 @@ AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, size_t length, CRYPTO_cfb128_8_encrypt(in, out, length, key, ivec, num, enc, (block128_f)AES_encrypt); } +LCRYPTO_ALIAS(AES_cfb8_encrypt); void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, @@ -123,6 +127,7 @@ AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, CRYPTO_ctr128_encrypt(in, out, length, key, ivec, ecount_buf, num, (block128_f)AES_encrypt); } +LCRYPTO_ALIAS(AES_ctr128_encrypt); void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, @@ -133,6 +138,7 @@ AES_ecb_encrypt(const unsigned char *in, unsigned char *out, else AES_decrypt(in, out, key); } +LCRYPTO_ALIAS(AES_ecb_encrypt); void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, @@ -141,6 +147,7 @@ AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, CRYPTO_ofb128_encrypt(in, out, length, key, ivec, num, (block128_f)AES_encrypt); } +LCRYPTO_ALIAS(AES_ofb128_encrypt); int AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, @@ -176,6 +183,7 @@ AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, memcpy(out, A, 8); return inlen + 8; } +LCRYPTO_ALIAS(AES_wrap_key); int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, @@ -213,3 +221,4 @@ AES_unwrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, } return inlen; } +LCRYPTO_ALIAS(AES_unwrap_key); diff --git a/lib/libcrypto/aes/aes_core.c b/lib/libcrypto/aes/aes_core.c index 23211dfcd07..335b1dba541 100644 --- a/lib/libcrypto/aes/aes_core.c +++ b/lib/libcrypto/aes/aes_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_core.c,v 1.22 2024/03/29 11:19:01 jsing Exp $ */ +/* $OpenBSD: aes_core.c,v 1.23 2024/03/30 05:14:12 joshua Exp $ */ /** * rijndael-alg-fst.c * @@ -746,6 +746,7 @@ AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { return aes_set_encrypt_key_internal(userKey, bits, key); } +LCRYPTO_ALIAS(AES_set_encrypt_key); #ifdef HAVE_AES_SET_DECRYPT_KEY_INTERNAL int aes_set_decrypt_key_internal(const unsigned char *userKey, const int bits, @@ -818,6 +819,7 @@ AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { return aes_set_decrypt_key_internal(userKey, bits, key); } +LCRYPTO_ALIAS(AES_set_decrypt_key); #ifdef HAVE_AES_ENCRYPT_INTERNAL void aes_encrypt_internal(const unsigned char *in, unsigned char *out, @@ -1020,6 +1022,7 @@ AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) { return aes_encrypt_internal(in, out, key); } +LCRYPTO_ALIAS(AES_encrypt); #ifdef HAVE_AES_DECRYPT_INTERNAL void aes_decrypt_internal(const unsigned char *in, unsigned char *out, @@ -1222,3 +1225,4 @@ AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) { return aes_decrypt_internal(in, out, key); } +LCRYPTO_ALIAS(AES_decrypt); diff --git a/lib/libcrypto/aes/aes_ige.c b/lib/libcrypto/aes/aes_ige.c index ef7d7662fd9..1a6fcfcfbfc 100644 --- a/lib/libcrypto/aes/aes_ige.c +++ b/lib/libcrypto/aes/aes_ige.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_ige.c,v 1.9 2022/11/26 16:08:50 tb Exp $ */ +/* $OpenBSD: aes_ige.c,v 1.10 2024/03/30 05:14:12 joshua Exp $ */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * @@ -192,3 +192,4 @@ AES_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length, } } } +LCRYPTO_ALIAS(AES_ige_encrypt); diff --git a/lib/libcrypto/hidden/openssl/aes.h b/lib/libcrypto/hidden/openssl/aes.h new file mode 100644 index 00000000000..0ec5a8d544e --- /dev/null +++ b/lib/libcrypto/hidden/openssl/aes.h @@ -0,0 +1,43 @@ +/* $OpenBSD: aes.h,v 1.1 2024/03/30 05:14:12 joshua Exp $ */ +/* + * Copyright (c) 2024 Joshua Sing + * + * 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_AES_H +#define _LIBCRYPTO_AES_H + +#ifndef _MSC_VER +#include_next +#else +#include "../include/openssl/aes.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(AES_set_encrypt_key); +LCRYPTO_USED(AES_set_decrypt_key); +LCRYPTO_USED(AES_encrypt); +LCRYPTO_USED(AES_decrypt); +LCRYPTO_USED(AES_ecb_encrypt); +LCRYPTO_USED(AES_cbc_encrypt); +LCRYPTO_USED(AES_cfb128_encrypt); +LCRYPTO_USED(AES_cfb1_encrypt); +LCRYPTO_USED(AES_cfb8_encrypt); +LCRYPTO_USED(AES_ofb128_encrypt); +LCRYPTO_USED(AES_ctr128_encrypt); +LCRYPTO_USED(AES_ige_encrypt); +LCRYPTO_USED(AES_wrap_key); +LCRYPTO_USED(AES_unwrap_key); + +#endif /* _LIBCRYPTO_AES_H */