summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/err
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/err')
-rw-r--r--src/lib/libcrypto/err/err.c35
-rw-r--r--src/lib/libcrypto/err/err_all.c3
-rw-r--r--src/lib/libcrypto/err/err_prn.c5
3 files changed, 40 insertions, 3 deletions
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index 365eae0e90..c513e45f9b 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err.c,v 1.52 2023/04/09 19:10:23 tb Exp $ */ 1/* $OpenBSD: err.c,v 1.53 2023/07/07 13:54:45 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -308,6 +308,7 @@ ERR_get_implementation(void)
308 err_fns_check(); 308 err_fns_check();
309 return err_fns; 309 return err_fns;
310} 310}
311LCRYPTO_ALIAS(ERR_get_implementation);
311 312
312int 313int
313ERR_set_implementation(const ERR_FNS *fns) 314ERR_set_implementation(const ERR_FNS *fns)
@@ -324,6 +325,7 @@ ERR_set_implementation(const ERR_FNS *fns)
324 CRYPTO_w_unlock(CRYPTO_LOCK_ERR); 325 CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
325 return ret; 326 return ret;
326} 327}
328LCRYPTO_ALIAS(ERR_set_implementation);
327 329
328/* These are the callbacks provided to "lh_new()" when creating the LHASH tables 330/* These are the callbacks provided to "lh_new()" when creating the LHASH tables
329 * internal to the "err_defaults" implementation. */ 331 * internal to the "err_defaults" implementation. */
@@ -685,6 +687,7 @@ ERR_load_ERR_strings(void)
685 687
686 (void) pthread_once(&once, ERR_load_ERR_strings_internal); 688 (void) pthread_once(&once, ERR_load_ERR_strings_internal);
687} 689}
690LCRYPTO_ALIAS(ERR_load_ERR_strings);
688 691
689static void 692static void
690err_load_strings(int lib, ERR_STRING_DATA *str) 693err_load_strings(int lib, ERR_STRING_DATA *str)
@@ -703,6 +706,7 @@ ERR_load_strings(int lib, ERR_STRING_DATA *str)
703 ERR_load_ERR_strings(); 706 ERR_load_ERR_strings();
704 err_load_strings(lib, str); 707 err_load_strings(lib, str);
705} 708}
709LCRYPTO_ALIAS(ERR_load_strings);
706 710
707void 711void
708ERR_unload_strings(int lib, ERR_STRING_DATA *str) 712ERR_unload_strings(int lib, ERR_STRING_DATA *str)
@@ -717,6 +721,7 @@ ERR_unload_strings(int lib, ERR_STRING_DATA *str)
717 str++; 721 str++;
718 } 722 }
719} 723}
724LCRYPTO_ALIAS(ERR_unload_strings);
720 725
721void 726void
722ERR_free_strings(void) 727ERR_free_strings(void)
@@ -727,6 +732,7 @@ ERR_free_strings(void)
727 err_fns_check(); 732 err_fns_check();
728 ERRFN(err_del)(); 733 ERRFN(err_del)();
729} 734}
735LCRYPTO_ALIAS(ERR_free_strings);
730 736
731/********************************************************/ 737/********************************************************/
732 738
@@ -748,6 +754,7 @@ ERR_put_error(int lib, int func, int reason, const char *file, int line)
748 err_clear_data(es, es->top); 754 err_clear_data(es, es->top);
749 errno = save_errno; 755 errno = save_errno;
750} 756}
757LCRYPTO_ALIAS(ERR_put_error);
751 758
752void 759void
753ERR_clear_error(void) 760ERR_clear_error(void)
@@ -762,6 +769,7 @@ ERR_clear_error(void)
762 } 769 }
763 es->top = es->bottom = 0; 770 es->top = es->bottom = 0;
764} 771}
772LCRYPTO_ALIAS(ERR_clear_error);
765 773
766 774
767unsigned long 775unsigned long
@@ -769,12 +777,14 @@ ERR_get_error(void)
769{ 777{
770 return (get_error_values(1, 0, NULL, NULL, NULL, NULL)); 778 return (get_error_values(1, 0, NULL, NULL, NULL, NULL));
771} 779}
780LCRYPTO_ALIAS(ERR_get_error);
772 781
773unsigned long 782unsigned long
774ERR_get_error_line(const char **file, int *line) 783ERR_get_error_line(const char **file, int *line)
775{ 784{
776 return (get_error_values(1, 0, file, line, NULL, NULL)); 785 return (get_error_values(1, 0, file, line, NULL, NULL));
777} 786}
787LCRYPTO_ALIAS(ERR_get_error_line);
778 788
779unsigned long 789unsigned long
780ERR_get_error_line_data(const char **file, int *line, 790ERR_get_error_line_data(const char **file, int *line,
@@ -782,6 +792,7 @@ ERR_get_error_line_data(const char **file, int *line,
782{ 792{
783 return (get_error_values(1, 0, file, line, data, flags)); 793 return (get_error_values(1, 0, file, line, data, flags));
784} 794}
795LCRYPTO_ALIAS(ERR_get_error_line_data);
785 796
786 797
787unsigned long 798unsigned long
@@ -789,12 +800,14 @@ ERR_peek_error(void)
789{ 800{
790 return (get_error_values(0, 0, NULL, NULL, NULL, NULL)); 801 return (get_error_values(0, 0, NULL, NULL, NULL, NULL));
791} 802}
803LCRYPTO_ALIAS(ERR_peek_error);
792 804
793unsigned long 805unsigned long
794ERR_peek_error_line(const char **file, int *line) 806ERR_peek_error_line(const char **file, int *line)
795{ 807{
796 return (get_error_values(0, 0, file, line, NULL, NULL)); 808 return (get_error_values(0, 0, file, line, NULL, NULL));
797} 809}
810LCRYPTO_ALIAS(ERR_peek_error_line);
798 811
799unsigned long 812unsigned long
800ERR_peek_error_line_data(const char **file, int *line, 813ERR_peek_error_line_data(const char **file, int *line,
@@ -802,18 +815,21 @@ ERR_peek_error_line_data(const char **file, int *line,
802{ 815{
803 return (get_error_values(0, 0, file, line, data, flags)); 816 return (get_error_values(0, 0, file, line, data, flags));
804} 817}
818LCRYPTO_ALIAS(ERR_peek_error_line_data);
805 819
806unsigned long 820unsigned long
807ERR_peek_last_error(void) 821ERR_peek_last_error(void)
808{ 822{
809 return (get_error_values(0, 1, NULL, NULL, NULL, NULL)); 823 return (get_error_values(0, 1, NULL, NULL, NULL, NULL));
810} 824}
825LCRYPTO_ALIAS(ERR_peek_last_error);
811 826
812unsigned long 827unsigned long
813ERR_peek_last_error_line(const char **file, int *line) 828ERR_peek_last_error_line(const char **file, int *line)
814{ 829{
815 return (get_error_values(0, 1, file, line, NULL, NULL)); 830 return (get_error_values(0, 1, file, line, NULL, NULL));
816} 831}
832LCRYPTO_ALIAS(ERR_peek_last_error_line);
817 833
818unsigned long 834unsigned long
819ERR_peek_last_error_line_data(const char **file, int *line, 835ERR_peek_last_error_line_data(const char **file, int *line,
@@ -821,6 +837,7 @@ ERR_peek_last_error_line_data(const char **file, int *line,
821{ 837{
822 return (get_error_values(0, 1, file, line, data, flags)); 838 return (get_error_values(0, 1, file, line, data, flags));
823} 839}
840LCRYPTO_ALIAS(ERR_peek_last_error_line_data);
824 841
825static unsigned long 842static unsigned long
826get_error_values(int inc, int top, const char **file, int *line, 843get_error_values(int inc, int top, const char **file, int *line,
@@ -942,6 +959,7 @@ ERR_error_string_n(unsigned long e, char *buf, size_t len)
942 } 959 }
943 } 960 }
944} 961}
962LCRYPTO_ALIAS(ERR_error_string_n);
945 963
946/* BAD for multi-threading: uses a local buffer if ret == NULL */ 964/* BAD for multi-threading: uses a local buffer if ret == NULL */
947/* ERR_error_string_n should be used instead for ret != NULL 965/* ERR_error_string_n should be used instead for ret != NULL
@@ -957,6 +975,7 @@ ERR_error_string(unsigned long e, char *ret)
957 975
958 return ret; 976 return ret;
959} 977}
978LCRYPTO_ALIAS(ERR_error_string);
960 979
961LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void) 980LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void)
962{ 981{
@@ -976,6 +995,7 @@ ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash)
976 err_fns_check(); 995 err_fns_check();
977 ERRFN(thread_release)(hash); 996 ERRFN(thread_release)(hash);
978} 997}
998LCRYPTO_ALIAS(ERR_release_err_state_table);
979 999
980const char * 1000const char *
981ERR_lib_error_string(unsigned long e) 1001ERR_lib_error_string(unsigned long e)
@@ -992,6 +1012,7 @@ ERR_lib_error_string(unsigned long e)
992 p = ERRFN(err_get_item)(&d); 1012 p = ERRFN(err_get_item)(&d);
993 return ((p == NULL) ? NULL : p->string); 1013 return ((p == NULL) ? NULL : p->string);
994} 1014}
1015LCRYPTO_ALIAS(ERR_lib_error_string);
995 1016
996const char * 1017const char *
997ERR_func_error_string(unsigned long e) 1018ERR_func_error_string(unsigned long e)
@@ -1006,6 +1027,7 @@ ERR_func_error_string(unsigned long e)
1006 p = ERRFN(err_get_item)(&d); 1027 p = ERRFN(err_get_item)(&d);
1007 return ((p == NULL) ? NULL : p->string); 1028 return ((p == NULL) ? NULL : p->string);
1008} 1029}
1030LCRYPTO_ALIAS(ERR_func_error_string);
1009 1031
1010const char * 1032const char *
1011ERR_reason_error_string(unsigned long e) 1033ERR_reason_error_string(unsigned long e)
@@ -1024,6 +1046,7 @@ ERR_reason_error_string(unsigned long e)
1024 } 1046 }
1025 return ((p == NULL) ? NULL : p->string); 1047 return ((p == NULL) ? NULL : p->string);
1026} 1048}
1049LCRYPTO_ALIAS(ERR_reason_error_string);
1027 1050
1028void 1051void
1029ERR_remove_thread_state(const CRYPTO_THREADID *id) 1052ERR_remove_thread_state(const CRYPTO_THREADID *id)
@@ -1039,12 +1062,14 @@ ERR_remove_thread_state(const CRYPTO_THREADID *id)
1039 * items reaches zero. */ 1062 * items reaches zero. */
1040 ERRFN(thread_del_item)(&tmp); 1063 ERRFN(thread_del_item)(&tmp);
1041} 1064}
1065LCRYPTO_ALIAS(ERR_remove_thread_state);
1042 1066
1043void 1067void
1044ERR_remove_state(unsigned long pid) 1068ERR_remove_state(unsigned long pid)
1045{ 1069{
1046 ERR_remove_thread_state(NULL); 1070 ERR_remove_thread_state(NULL);
1047} 1071}
1072LCRYPTO_ALIAS(ERR_remove_state);
1048 1073
1049ERR_STATE * 1074ERR_STATE *
1050ERR_get_state(void) 1075ERR_get_state(void)
@@ -1084,6 +1109,7 @@ ERR_get_state(void)
1084 } 1109 }
1085 return ret; 1110 return ret;
1086} 1111}
1112LCRYPTO_ALIAS(ERR_get_state);
1087 1113
1088int 1114int
1089ERR_get_next_error_library(void) 1115ERR_get_next_error_library(void)
@@ -1091,6 +1117,7 @@ ERR_get_next_error_library(void)
1091 err_fns_check(); 1117 err_fns_check();
1092 return ERRFN(get_next_lib)(); 1118 return ERRFN(get_next_lib)();
1093} 1119}
1120LCRYPTO_ALIAS(ERR_get_next_error_library);
1094 1121
1095void 1122void
1096ERR_set_error_data(char *data, int flags) 1123ERR_set_error_data(char *data, int flags)
@@ -1108,6 +1135,7 @@ ERR_set_error_data(char *data, int flags)
1108 es->err_data[i] = data; 1135 es->err_data[i] = data;
1109 es->err_data_flags[i] = flags; 1136 es->err_data_flags[i] = flags;
1110} 1137}
1138LCRYPTO_ALIAS(ERR_set_error_data);
1111 1139
1112void 1140void
1113ERR_asprintf_error_data(char * format, ...) 1141ERR_asprintf_error_data(char * format, ...)
@@ -1124,6 +1152,7 @@ ERR_asprintf_error_data(char * format, ...)
1124 else 1152 else
1125 ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING); 1153 ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING);
1126} 1154}
1155LCRYPTO_ALIAS(ERR_asprintf_error_data);
1127 1156
1128void 1157void
1129ERR_add_error_vdata(int num, va_list args) 1158ERR_add_error_vdata(int num, va_list args)
@@ -1144,6 +1173,7 @@ ERR_add_error_vdata(int num, va_list args)
1144 else 1173 else
1145 ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING); 1174 ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING);
1146} 1175}
1176LCRYPTO_ALIAS(ERR_add_error_vdata);
1147 1177
1148void 1178void
1149ERR_add_error_data(int num, ...) 1179ERR_add_error_data(int num, ...)
@@ -1153,6 +1183,7 @@ ERR_add_error_data(int num, ...)
1153 ERR_add_error_vdata(num, args); 1183 ERR_add_error_vdata(num, args);
1154 va_end(args); 1184 va_end(args);
1155} 1185}
1186LCRYPTO_ALIAS(ERR_add_error_data);
1156 1187
1157int 1188int
1158ERR_set_mark(void) 1189ERR_set_mark(void)
@@ -1166,6 +1197,7 @@ ERR_set_mark(void)
1166 es->err_flags[es->top] |= ERR_FLAG_MARK; 1197 es->err_flags[es->top] |= ERR_FLAG_MARK;
1167 return 1; 1198 return 1;
1168} 1199}
1200LCRYPTO_ALIAS(ERR_set_mark);
1169 1201
1170int 1202int
1171ERR_pop_to_mark(void) 1203ERR_pop_to_mark(void)
@@ -1187,6 +1219,7 @@ ERR_pop_to_mark(void)
1187 es->err_flags[es->top]&=~ERR_FLAG_MARK; 1219 es->err_flags[es->top]&=~ERR_FLAG_MARK;
1188 return 1; 1220 return 1;
1189} 1221}
1222LCRYPTO_ALIAS(ERR_pop_to_mark);
1190 1223
1191void 1224void
1192err_clear_last_constant_time(int clear) 1225err_clear_last_constant_time(int clear)
diff --git a/src/lib/libcrypto/err/err_all.c b/src/lib/libcrypto/err/err_all.c
index 9a46e93c24..12a0fcd329 100644
--- a/src/lib/libcrypto/err/err_all.c
+++ b/src/lib/libcrypto/err/err_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err_all.c,v 1.28 2023/06/11 05:35:43 tb Exp $ */ 1/* $OpenBSD: err_all.c,v 1.29 2023/07/07 13:54:45 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -174,3 +174,4 @@ ERR_load_crypto_strings(void)
174 static pthread_once_t loaded = PTHREAD_ONCE_INIT; 174 static pthread_once_t loaded = PTHREAD_ONCE_INIT;
175 (void) pthread_once(&loaded, ERR_load_crypto_strings_internal); 175 (void) pthread_once(&loaded, ERR_load_crypto_strings_internal);
176} 176}
177LCRYPTO_ALIAS(ERR_load_crypto_strings);
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c
index 6b5c455f06..d60cfdcb92 100644
--- a/src/lib/libcrypto/err/err_prn.c
+++ b/src/lib/libcrypto/err/err_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err_prn.c,v 1.19 2022/01/07 09:02:18 tb Exp $ */ 1/* $OpenBSD: err_prn.c,v 1.20 2023/07/07 13:54:45 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -88,6 +88,7 @@ ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u)
88 break; /* abort outputting the error report */ 88 break; /* abort outputting the error report */
89 } 89 }
90} 90}
91LCRYPTO_ALIAS(ERR_print_errors_cb);
91 92
92static int 93static int
93print_fp(const char *str, size_t len, void *fp) 94print_fp(const char *str, size_t len, void *fp)
@@ -105,6 +106,7 @@ ERR_print_errors_fp(FILE *fp)
105{ 106{
106 ERR_print_errors_cb(print_fp, fp); 107 ERR_print_errors_cb(print_fp, fp);
107} 108}
109LCRYPTO_ALIAS(ERR_print_errors_fp);
108 110
109static int 111static int
110print_bio(const char *str, size_t len, void *bp) 112print_bio(const char *str, size_t len, void *bp)
@@ -117,3 +119,4 @@ ERR_print_errors(BIO *bp)
117{ 119{
118 ERR_print_errors_cb(print_bio, bp); 120 ERR_print_errors_cb(print_bio, bp);
119} 121}
122LCRYPTO_ALIAS(ERR_print_errors);