From 1c988a667e8e6b6affbc349fca2c7ef8a6542121 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 31 Aug 2024 10:09:15 +0000 Subject: [PATCH] Remove ERR_add_{,v}data() Another unused bit of legacy API... ok beck jsing --- lib/libcrypto/Symbols.list | 2 -- lib/libcrypto/err/err.c | 33 +----------------------------- lib/libcrypto/err/err.h | 4 +--- lib/libcrypto/hidden/openssl/err.h | 4 +--- 4 files changed, 3 insertions(+), 40 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 9405613b186..3c14b481ad4 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -1006,8 +1006,6 @@ ENGINE_new ENGINE_register_all_complete ENGINE_set_default ENGINE_set_default_RSA -ERR_add_error_data -ERR_add_error_vdata ERR_asprintf_error_data ERR_clear_error ERR_error_string diff --git a/lib/libcrypto/err/err.c b/lib/libcrypto/err/err.c index e40b52f5ecf..d8ad4f8bab1 100644 --- a/lib/libcrypto/err/err.c +++ b/lib/libcrypto/err/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.62 2024/07/09 07:17:13 beck Exp $ */ +/* $OpenBSD: err.c,v 1.63 2024/08/31 10:09:15 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1130,37 +1130,6 @@ ERR_asprintf_error_data(char * format, ...) } LCRYPTO_ALIAS(ERR_asprintf_error_data); -void -ERR_add_error_vdata(int num, va_list args) -{ - char format[129]; - char *errbuf; - int i; - - format[0] = '\0'; - for (i = 0; i < num; i++) { - if (strlcat(format, "%s", sizeof(format)) >= sizeof(format)) { - ERR_set_error_data("too many errors", ERR_TXT_STRING); - return; - } - } - if (vasprintf(&errbuf, format, args) == -1) - ERR_set_error_data("malloc failed", ERR_TXT_STRING); - else - ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING); -} -LCRYPTO_ALIAS(ERR_add_error_vdata); - -void -ERR_add_error_data(int num, ...) -{ - va_list args; - va_start(args, num); - ERR_add_error_vdata(num, args); - va_end(args); -} -LCRYPTO_ALIAS(ERR_add_error_data); - int ERR_set_mark(void) { diff --git a/lib/libcrypto/err/err.h b/lib/libcrypto/err/err.h index 9f64dd2797b..66bd54deec0 100644 --- a/lib/libcrypto/err/err.h +++ b/lib/libcrypto/err/err.h @@ -1,4 +1,4 @@ -/* $OpenBSD: err.h,v 1.34 2024/07/09 07:17:13 beck Exp $ */ +/* $OpenBSD: err.h,v 1.35 2024/08/31 10:09:15 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -374,8 +374,6 @@ void ERR_print_errors_fp(FILE *fp); void ERR_print_errors(BIO *bp); #endif void ERR_asprintf_error_data(char * format, ...); -void ERR_add_error_data(int num, ...); -void ERR_add_error_vdata(int num, va_list args); void ERR_load_strings(int lib, ERR_STRING_DATA *str); void ERR_unload_strings(int lib, ERR_STRING_DATA *str); void ERR_load_ERR_strings(void); diff --git a/lib/libcrypto/hidden/openssl/err.h b/lib/libcrypto/hidden/openssl/err.h index 5a5893f8137..026c18a5458 100644 --- a/lib/libcrypto/hidden/openssl/err.h +++ b/lib/libcrypto/hidden/openssl/err.h @@ -1,4 +1,4 @@ -/* $OpenBSD: err.h,v 1.6 2024/07/09 07:17:13 beck Exp $ */ +/* $OpenBSD: err.h,v 1.7 2024/08/31 10:09:15 tb Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -56,7 +56,5 @@ LCRYPTO_USED(ERR_remove_state); LCRYPTO_USED(ERR_get_next_error_library); LCRYPTO_USED(ERR_set_mark); LCRYPTO_USED(ERR_pop_to_mark); -LCRYPTO_UNUSED(ERR_add_error_data); -LCRYPTO_UNUSED(ERR_add_error_vdata); #endif /* _LIBCRYPTO_ERR_H */ -- 2.20.1