From 1f5fb509335da2eee4bf3442afed1d995dc4ec88 Mon Sep 17 00:00:00 2001 From: beck Date: Sat, 8 Jul 2023 11:28:03 +0000 Subject: [PATCH] Hide symbols in txt_db ok tb@ --- lib/libcrypto/Symbols.namespace | 6 +++++ lib/libcrypto/hidden/openssl/txt_db.h | 35 +++++++++++++++++++++++++++ lib/libcrypto/txt_db/txt_db.c | 8 +++++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 lib/libcrypto/hidden/openssl/txt_db.h diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index b134de290e4..2c5ec993c22 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -2249,3 +2249,9 @@ _libre_MD4_Update _libre_MD4_Final _libre_MD4 _libre_MD4_Transform +_libre_TXT_DB_read +_libre_TXT_DB_write +_libre_TXT_DB_create_index +_libre_TXT_DB_free +_libre_TXT_DB_get_by_index +_libre_TXT_DB_insert diff --git a/lib/libcrypto/hidden/openssl/txt_db.h b/lib/libcrypto/hidden/openssl/txt_db.h new file mode 100644 index 00000000000..f93dbc67d21 --- /dev/null +++ b/lib/libcrypto/hidden/openssl/txt_db.h @@ -0,0 +1,35 @@ +/* $OpenBSD: txt_db.h,v 1.1 2023/07/08 11:28:03 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_TXT_DB_H +#define _LIBCRYPTO_TXT_DB_H + +#ifndef _MSC_VER +#include_next +#else +#include "../include/openssl/txt_db.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(TXT_DB_read); +LCRYPTO_USED(TXT_DB_write); +LCRYPTO_USED(TXT_DB_create_index); +LCRYPTO_USED(TXT_DB_free); +LCRYPTO_USED(TXT_DB_get_by_index); +LCRYPTO_USED(TXT_DB_insert); + +#endif /* _LIBCRYPTO_TXT_DB_H */ diff --git a/lib/libcrypto/txt_db/txt_db.c b/lib/libcrypto/txt_db/txt_db.c index 26df76a9c2a..7d1f82c49d0 100644 --- a/lib/libcrypto/txt_db/txt_db.c +++ b/lib/libcrypto/txt_db/txt_db.c @@ -1,4 +1,4 @@ -/* $OpenBSD: txt_db.c,v 1.18 2014/07/11 08:44:49 jsing Exp $ */ +/* $OpenBSD: txt_db.c,v 1.19 2023/07/08 11:28:03 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -184,6 +184,7 @@ err: } else return (ret); } +LCRYPTO_ALIAS(TXT_DB_read); OPENSSL_STRING * TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value) @@ -204,6 +205,7 @@ TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value) db->error = DB_ERROR_OK; return (ret); } +LCRYPTO_ALIAS(TXT_DB_get_by_index); int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *), @@ -241,6 +243,7 @@ TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *), db->qual[field] = qual; return (1); } +LCRYPTO_ALIAS(TXT_DB_create_index); long TXT_DB_write(BIO *out, TXT_DB *db) @@ -291,6 +294,7 @@ err: BUF_MEM_free(buf); return (ret); } +LCRYPTO_ALIAS(TXT_DB_write); int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row) @@ -329,6 +333,7 @@ TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row) err: return (0); } +LCRYPTO_ALIAS(TXT_DB_insert); void TXT_DB_free(TXT_DB *db) @@ -370,3 +375,4 @@ TXT_DB_free(TXT_DB *db) } free(db); } +LCRYPTO_ALIAS(TXT_DB_free); -- 2.20.1