diff options
author | djm <> | 2008-09-06 12:17:54 +0000 |
---|---|---|
committer | djm <> | 2008-09-06 12:17:54 +0000 |
commit | 38ce604e3cc97706b876b0525ddff0121115456d (patch) | |
tree | 7ccc28afe1789ea3dbedf72365f955d5b8e105b5 /src/lib/libcrypto/err | |
parent | 12867252827c8efaa8ddd1fa3b3d6e321e2bcdef (diff) | |
download | openbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.gz openbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.bz2 openbsd-38ce604e3cc97706b876b0525ddff0121115456d.zip |
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/err')
-rw-r--r-- | src/lib/libcrypto/err/err.c | 86 | ||||
-rw-r--r-- | src/lib/libcrypto/err/err.h | 28 | ||||
-rw-r--r-- | src/lib/libcrypto/err/err_all.c | 25 | ||||
-rw-r--r-- | src/lib/libcrypto/err/err_prn.c | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/err/openssl.ec | 7 |
5 files changed, 122 insertions, 33 deletions
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 53687d79ab..b6ff070e8f 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c | |||
@@ -112,9 +112,9 @@ | |||
112 | #include <stdio.h> | 112 | #include <stdio.h> |
113 | #include <stdarg.h> | 113 | #include <stdarg.h> |
114 | #include <string.h> | 114 | #include <string.h> |
115 | #include "cryptlib.h" | ||
115 | #include <openssl/lhash.h> | 116 | #include <openssl/lhash.h> |
116 | #include <openssl/crypto.h> | 117 | #include <openssl/crypto.h> |
117 | #include "cryptlib.h" | ||
118 | #include <openssl/buffer.h> | 118 | #include <openssl/buffer.h> |
119 | #include <openssl/bio.h> | 119 | #include <openssl/bio.h> |
120 | #include <openssl/err.h> | 120 | #include <openssl/err.h> |
@@ -149,7 +149,7 @@ static ERR_STRING_DATA ERR_str_libraries[]= | |||
149 | {ERR_PACK(ERR_LIB_DSO,0,0) ,"DSO support routines"}, | 149 | {ERR_PACK(ERR_LIB_DSO,0,0) ,"DSO support routines"}, |
150 | {ERR_PACK(ERR_LIB_ENGINE,0,0) ,"engine routines"}, | 150 | {ERR_PACK(ERR_LIB_ENGINE,0,0) ,"engine routines"}, |
151 | {ERR_PACK(ERR_LIB_OCSP,0,0) ,"OCSP routines"}, | 151 | {ERR_PACK(ERR_LIB_OCSP,0,0) ,"OCSP routines"}, |
152 | {ERR_PACK(ERR_LIB_FIPS,0,0) ,"FIPS routines"}, | 152 | {ERR_PACK(ERR_LIB_CMS,0,0) ,"CMS routines"}, |
153 | {0,NULL}, | 153 | {0,NULL}, |
154 | }; | 154 | }; |
155 | 155 | ||
@@ -168,7 +168,6 @@ static ERR_STRING_DATA ERR_str_functs[]= | |||
168 | #endif | 168 | #endif |
169 | {ERR_PACK(0,SYS_F_OPENDIR,0), "opendir"}, | 169 | {ERR_PACK(0,SYS_F_OPENDIR,0), "opendir"}, |
170 | {ERR_PACK(0,SYS_F_FREAD,0), "fread"}, | 170 | {ERR_PACK(0,SYS_F_FREAD,0), "fread"}, |
171 | {ERR_PACK(0,SYS_F_GETADDRINFO,0), "getaddrinfo"}, | ||
172 | {0,NULL}, | 171 | {0,NULL}, |
173 | }; | 172 | }; |
174 | 173 | ||
@@ -210,6 +209,7 @@ static ERR_STRING_DATA ERR_str_reasons[]= | |||
210 | {ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED ,"called a function you should not call"}, | 209 | {ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED ,"called a function you should not call"}, |
211 | {ERR_R_PASSED_NULL_PARAMETER ,"passed a null parameter"}, | 210 | {ERR_R_PASSED_NULL_PARAMETER ,"passed a null parameter"}, |
212 | {ERR_R_INTERNAL_ERROR ,"internal error"}, | 211 | {ERR_R_INTERNAL_ERROR ,"internal error"}, |
212 | {ERR_R_DISABLED ,"called a function that was disabled at compile-time"}, | ||
213 | 213 | ||
214 | {0,NULL}, | 214 | {0,NULL}, |
215 | }; | 215 | }; |
@@ -542,16 +542,27 @@ static ERR_STRING_DATA SYS_str_reasons[NUM_SYS_STR_REASONS + 1]; | |||
542 | * will be returned for SYSerr(), which always gets an errno | 542 | * will be returned for SYSerr(), which always gets an errno |
543 | * value and never one of those 'standard' reason codes. */ | 543 | * value and never one of those 'standard' reason codes. */ |
544 | 544 | ||
545 | static void build_SYS_str_reasons() | 545 | static void build_SYS_str_reasons(void) |
546 | { | 546 | { |
547 | /* OPENSSL_malloc cannot be used here, use static storage instead */ | 547 | /* OPENSSL_malloc cannot be used here, use static storage instead */ |
548 | static char strerror_tab[NUM_SYS_STR_REASONS][LEN_SYS_STR_REASON]; | 548 | static char strerror_tab[NUM_SYS_STR_REASONS][LEN_SYS_STR_REASON]; |
549 | int i; | 549 | int i; |
550 | static int init = 1; | 550 | static int init = 1; |
551 | 551 | ||
552 | if (!init) return; | 552 | CRYPTO_r_lock(CRYPTO_LOCK_ERR); |
553 | 553 | if (!init) | |
554 | { | ||
555 | CRYPTO_r_unlock(CRYPTO_LOCK_ERR); | ||
556 | return; | ||
557 | } | ||
558 | |||
559 | CRYPTO_r_unlock(CRYPTO_LOCK_ERR); | ||
554 | CRYPTO_w_lock(CRYPTO_LOCK_ERR); | 560 | CRYPTO_w_lock(CRYPTO_LOCK_ERR); |
561 | if (!init) | ||
562 | { | ||
563 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); | ||
564 | return; | ||
565 | } | ||
555 | 566 | ||
556 | for (i = 1; i <= NUM_SYS_STR_REASONS; i++) | 567 | for (i = 1; i <= NUM_SYS_STR_REASONS; i++) |
557 | { | 568 | { |
@@ -583,13 +594,24 @@ static void build_SYS_str_reasons() | |||
583 | #endif | 594 | #endif |
584 | 595 | ||
585 | #define err_clear_data(p,i) \ | 596 | #define err_clear_data(p,i) \ |
597 | do { \ | ||
586 | if (((p)->err_data[i] != NULL) && \ | 598 | if (((p)->err_data[i] != NULL) && \ |
587 | (p)->err_data_flags[i] & ERR_TXT_MALLOCED) \ | 599 | (p)->err_data_flags[i] & ERR_TXT_MALLOCED) \ |
588 | { \ | 600 | { \ |
589 | OPENSSL_free((p)->err_data[i]); \ | 601 | OPENSSL_free((p)->err_data[i]); \ |
590 | (p)->err_data[i]=NULL; \ | 602 | (p)->err_data[i]=NULL; \ |
591 | } \ | 603 | } \ |
592 | (p)->err_data_flags[i]=0; | 604 | (p)->err_data_flags[i]=0; \ |
605 | } while(0) | ||
606 | |||
607 | #define err_clear(p,i) \ | ||
608 | do { \ | ||
609 | (p)->err_flags[i]=0; \ | ||
610 | (p)->err_buffer[i]=0; \ | ||
611 | err_clear_data(p,i); \ | ||
612 | (p)->err_file[i]=NULL; \ | ||
613 | (p)->err_line[i]= -1; \ | ||
614 | } while(0) | ||
593 | 615 | ||
594 | static void ERR_STATE_free(ERR_STATE *s) | 616 | static void ERR_STATE_free(ERR_STATE *s) |
595 | { | 617 | { |
@@ -682,6 +704,7 @@ void ERR_put_error(int lib, int func, int reason, const char *file, | |||
682 | es->top=(es->top+1)%ERR_NUM_ERRORS; | 704 | es->top=(es->top+1)%ERR_NUM_ERRORS; |
683 | if (es->top == es->bottom) | 705 | if (es->top == es->bottom) |
684 | es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; | 706 | es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; |
707 | es->err_flags[es->top]=0; | ||
685 | es->err_buffer[es->top]=ERR_PACK(lib,func,reason); | 708 | es->err_buffer[es->top]=ERR_PACK(lib,func,reason); |
686 | es->err_file[es->top]=file; | 709 | es->err_file[es->top]=file; |
687 | es->err_line[es->top]=line; | 710 | es->err_line[es->top]=line; |
@@ -697,10 +720,7 @@ void ERR_clear_error(void) | |||
697 | 720 | ||
698 | for (i=0; i<ERR_NUM_ERRORS; i++) | 721 | for (i=0; i<ERR_NUM_ERRORS; i++) |
699 | { | 722 | { |
700 | es->err_buffer[i]=0; | 723 | err_clear(es,i); |
701 | err_clear_data(es,i); | ||
702 | es->err_file[i]=NULL; | ||
703 | es->err_line[i]= -1; | ||
704 | } | 724 | } |
705 | es->top=es->bottom=0; | 725 | es->top=es->bottom=0; |
706 | } | 726 | } |
@@ -937,7 +957,7 @@ static unsigned long err_hash(const void *a_void) | |||
937 | { | 957 | { |
938 | unsigned long ret,l; | 958 | unsigned long ret,l; |
939 | 959 | ||
940 | l=((ERR_STRING_DATA *)a_void)->error; | 960 | l=((const ERR_STRING_DATA *)a_void)->error; |
941 | ret=l^ERR_GET_LIB(l)^ERR_GET_FUNC(l); | 961 | ret=l^ERR_GET_LIB(l)^ERR_GET_FUNC(l); |
942 | return(ret^ret%19*13); | 962 | return(ret^ret%19*13); |
943 | } | 963 | } |
@@ -945,21 +965,21 @@ static unsigned long err_hash(const void *a_void) | |||
945 | /* static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b) */ | 965 | /* static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b) */ |
946 | static int err_cmp(const void *a_void, const void *b_void) | 966 | static int err_cmp(const void *a_void, const void *b_void) |
947 | { | 967 | { |
948 | return((int)(((ERR_STRING_DATA *)a_void)->error - | 968 | return((int)(((const ERR_STRING_DATA *)a_void)->error - |
949 | ((ERR_STRING_DATA *)b_void)->error)); | 969 | ((const ERR_STRING_DATA *)b_void)->error)); |
950 | } | 970 | } |
951 | 971 | ||
952 | /* static unsigned long pid_hash(ERR_STATE *a) */ | 972 | /* static unsigned long pid_hash(ERR_STATE *a) */ |
953 | static unsigned long pid_hash(const void *a_void) | 973 | static unsigned long pid_hash(const void *a_void) |
954 | { | 974 | { |
955 | return(((ERR_STATE *)a_void)->pid*13); | 975 | return(((const ERR_STATE *)a_void)->pid*13); |
956 | } | 976 | } |
957 | 977 | ||
958 | /* static int pid_cmp(ERR_STATE *a, ERR_STATE *b) */ | 978 | /* static int pid_cmp(ERR_STATE *a, ERR_STATE *b) */ |
959 | static int pid_cmp(const void *a_void, const void *b_void) | 979 | static int pid_cmp(const void *a_void, const void *b_void) |
960 | { | 980 | { |
961 | return((int)((long)((ERR_STATE *)a_void)->pid - | 981 | return((int)((long)((const ERR_STATE *)a_void)->pid - |
962 | (long)((ERR_STATE *)b_void)->pid)); | 982 | (long)((const ERR_STATE *)b_void)->pid)); |
963 | } | 983 | } |
964 | 984 | ||
965 | void ERR_remove_state(unsigned long pid) | 985 | void ERR_remove_state(unsigned long pid) |
@@ -1069,7 +1089,7 @@ void ERR_add_error_data(int num, ...) | |||
1069 | else | 1089 | else |
1070 | str=p; | 1090 | str=p; |
1071 | } | 1091 | } |
1072 | BUF_strlcat(str,a,s+1); | 1092 | BUF_strlcat(str,a,(size_t)s+1); |
1073 | } | 1093 | } |
1074 | } | 1094 | } |
1075 | ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); | 1095 | ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); |
@@ -1077,3 +1097,33 @@ void ERR_add_error_data(int num, ...) | |||
1077 | err: | 1097 | err: |
1078 | va_end(args); | 1098 | va_end(args); |
1079 | } | 1099 | } |
1100 | |||
1101 | int ERR_set_mark(void) | ||
1102 | { | ||
1103 | ERR_STATE *es; | ||
1104 | |||
1105 | es=ERR_get_state(); | ||
1106 | |||
1107 | if (es->bottom == es->top) return 0; | ||
1108 | es->err_flags[es->top]|=ERR_FLAG_MARK; | ||
1109 | return 1; | ||
1110 | } | ||
1111 | |||
1112 | int ERR_pop_to_mark(void) | ||
1113 | { | ||
1114 | ERR_STATE *es; | ||
1115 | |||
1116 | es=ERR_get_state(); | ||
1117 | |||
1118 | while(es->bottom != es->top | ||
1119 | && (es->err_flags[es->top] & ERR_FLAG_MARK) == 0) | ||
1120 | { | ||
1121 | err_clear(es,es->top); | ||
1122 | es->top-=1; | ||
1123 | if (es->top == -1) es->top=ERR_NUM_ERRORS-1; | ||
1124 | } | ||
1125 | |||
1126 | if (es->bottom == es->top) return 0; | ||
1127 | es->err_flags[es->top]&=~ERR_FLAG_MARK; | ||
1128 | return 1; | ||
1129 | } | ||
diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h index 2efa18866a..bf28fce492 100644 --- a/src/lib/libcrypto/err/err.h +++ b/src/lib/libcrypto/err/err.h | |||
@@ -59,11 +59,14 @@ | |||
59 | #ifndef HEADER_ERR_H | 59 | #ifndef HEADER_ERR_H |
60 | #define HEADER_ERR_H | 60 | #define HEADER_ERR_H |
61 | 61 | ||
62 | #include <openssl/e_os2.h> | ||
63 | |||
62 | #ifndef OPENSSL_NO_FP_API | 64 | #ifndef OPENSSL_NO_FP_API |
63 | #include <stdio.h> | 65 | #include <stdio.h> |
64 | #include <stdlib.h> | 66 | #include <stdlib.h> |
65 | #endif | 67 | #endif |
66 | 68 | ||
69 | #include <openssl/ossl_typ.h> | ||
67 | #ifndef OPENSSL_NO_BIO | 70 | #ifndef OPENSSL_NO_BIO |
68 | #include <openssl/bio.h> | 71 | #include <openssl/bio.h> |
69 | #endif | 72 | #endif |
@@ -86,10 +89,13 @@ extern "C" { | |||
86 | #define ERR_TXT_MALLOCED 0x01 | 89 | #define ERR_TXT_MALLOCED 0x01 |
87 | #define ERR_TXT_STRING 0x02 | 90 | #define ERR_TXT_STRING 0x02 |
88 | 91 | ||
92 | #define ERR_FLAG_MARK 0x01 | ||
93 | |||
89 | #define ERR_NUM_ERRORS 16 | 94 | #define ERR_NUM_ERRORS 16 |
90 | typedef struct err_state_st | 95 | typedef struct err_state_st |
91 | { | 96 | { |
92 | unsigned long pid; | 97 | unsigned long pid; |
98 | int err_flags[ERR_NUM_ERRORS]; | ||
93 | unsigned long err_buffer[ERR_NUM_ERRORS]; | 99 | unsigned long err_buffer[ERR_NUM_ERRORS]; |
94 | char *err_data[ERR_NUM_ERRORS]; | 100 | char *err_data[ERR_NUM_ERRORS]; |
95 | int err_data_flags[ERR_NUM_ERRORS]; | 101 | int err_data_flags[ERR_NUM_ERRORS]; |
@@ -131,7 +137,10 @@ typedef struct err_state_st | |||
131 | #define ERR_LIB_OCSP 39 | 137 | #define ERR_LIB_OCSP 39 |
132 | #define ERR_LIB_UI 40 | 138 | #define ERR_LIB_UI 40 |
133 | #define ERR_LIB_COMP 41 | 139 | #define ERR_LIB_COMP 41 |
134 | #define ERR_LIB_FIPS 42 | 140 | #define ERR_LIB_ECDSA 42 |
141 | #define ERR_LIB_ECDH 43 | ||
142 | #define ERR_LIB_STORE 44 | ||
143 | #define ERR_LIB_CMS 45 | ||
135 | 144 | ||
136 | #define ERR_LIB_USER 128 | 145 | #define ERR_LIB_USER 128 |
137 | 146 | ||
@@ -160,7 +169,10 @@ typedef struct err_state_st | |||
160 | #define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) | 169 | #define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) |
161 | #define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) | 170 | #define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) |
162 | #define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) | 171 | #define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) |
163 | #define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) | 172 | #define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) |
173 | #define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) | ||
174 | #define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) | ||
175 | #define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) | ||
164 | 176 | ||
165 | /* Borland C seems too stupid to be able to shift and do longs in | 177 | /* Borland C seems too stupid to be able to shift and do longs in |
166 | * the pre-processor :-( */ | 178 | * the pre-processor :-( */ |
@@ -185,7 +197,6 @@ typedef struct err_state_st | |||
185 | #define SYS_F_WSASTARTUP 9 /* Winsock stuff */ | 197 | #define SYS_F_WSASTARTUP 9 /* Winsock stuff */ |
186 | #define SYS_F_OPENDIR 10 | 198 | #define SYS_F_OPENDIR 10 |
187 | #define SYS_F_FREAD 11 | 199 | #define SYS_F_FREAD 11 |
188 | #define SYS_F_GETADDRINFO 12 | ||
189 | 200 | ||
190 | 201 | ||
191 | /* reasons */ | 202 | /* reasons */ |
@@ -214,6 +225,9 @@ typedef struct err_state_st | |||
214 | #define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */ | 225 | #define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */ |
215 | #define ERR_R_UI_LIB ERR_LIB_UI /* 40 */ | 226 | #define ERR_R_UI_LIB ERR_LIB_UI /* 40 */ |
216 | #define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */ | 227 | #define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */ |
228 | #define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */ | ||
229 | #define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */ | ||
230 | #define ERR_R_STORE_LIB ERR_LIB_STORE /* 44 */ | ||
217 | 231 | ||
218 | #define ERR_R_NESTED_ASN1_ERROR 58 | 232 | #define ERR_R_NESTED_ASN1_ERROR 58 |
219 | #define ERR_R_BAD_ASN1_OBJECT_HEADER 59 | 233 | #define ERR_R_BAD_ASN1_OBJECT_HEADER 59 |
@@ -228,6 +242,7 @@ typedef struct err_state_st | |||
228 | #define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) | 242 | #define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) |
229 | #define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) | 243 | #define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) |
230 | #define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) | 244 | #define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) |
245 | #define ERR_R_DISABLED (5|ERR_R_FATAL) | ||
231 | 246 | ||
232 | /* 99 is the maximum possible ERR_R_... code, higher values | 247 | /* 99 is the maximum possible ERR_R_... code, higher values |
233 | * are reserved for the individual libraries */ | 248 | * are reserved for the individual libraries */ |
@@ -286,8 +301,11 @@ void ERR_release_err_state_table(LHASH **hash); | |||
286 | 301 | ||
287 | int ERR_get_next_error_library(void); | 302 | int ERR_get_next_error_library(void); |
288 | 303 | ||
289 | /* This opaque type encapsulates the low-level error-state functions */ | 304 | int ERR_set_mark(void); |
290 | typedef struct st_ERR_FNS ERR_FNS; | 305 | int ERR_pop_to_mark(void); |
306 | |||
307 | /* Already defined in ossl_typ.h */ | ||
308 | /* typedef struct st_ERR_FNS ERR_FNS; */ | ||
291 | /* An application can use this function and provide the return value to loaded | 309 | /* An application can use this function and provide the return value to loaded |
292 | * modules that should use the application's ERR state/functionality */ | 310 | * modules that should use the application's ERR state/functionality */ |
293 | const ERR_FNS *ERR_get_implementation(void); | 311 | const ERR_FNS *ERR_get_implementation(void); |
diff --git a/src/lib/libcrypto/err/err_all.c b/src/lib/libcrypto/err/err_all.c index 4dc9300892..5813060ce2 100644 --- a/src/lib/libcrypto/err/err_all.c +++ b/src/lib/libcrypto/err/err_all.c | |||
@@ -73,6 +73,12 @@ | |||
73 | #ifndef OPENSSL_NO_DSA | 73 | #ifndef OPENSSL_NO_DSA |
74 | #include <openssl/dsa.h> | 74 | #include <openssl/dsa.h> |
75 | #endif | 75 | #endif |
76 | #ifndef OPENSSL_NO_ECDSA | ||
77 | #include <openssl/ecdsa.h> | ||
78 | #endif | ||
79 | #ifndef OPENSSL_NO_ECDH | ||
80 | #include <openssl/ecdh.h> | ||
81 | #endif | ||
76 | #include <openssl/evp.h> | 82 | #include <openssl/evp.h> |
77 | #include <openssl/objects.h> | 83 | #include <openssl/objects.h> |
78 | #include <openssl/pem2.h> | 84 | #include <openssl/pem2.h> |
@@ -85,16 +91,15 @@ | |||
85 | #ifndef OPENSSL_NO_ENGINE | 91 | #ifndef OPENSSL_NO_ENGINE |
86 | #include <openssl/engine.h> | 92 | #include <openssl/engine.h> |
87 | #endif | 93 | #endif |
94 | #include <openssl/ui.h> | ||
88 | #include <openssl/ocsp.h> | 95 | #include <openssl/ocsp.h> |
89 | #include <openssl/err.h> | 96 | #include <openssl/err.h> |
90 | #include <openssl/fips.h> | 97 | #ifndef OPENSSL_NO_CMS |
98 | #include <openssl/cms.h> | ||
99 | #endif | ||
91 | 100 | ||
92 | void ERR_load_crypto_strings(void) | 101 | void ERR_load_crypto_strings(void) |
93 | { | 102 | { |
94 | static int done=0; | ||
95 | |||
96 | if (done) return; | ||
97 | done=1; | ||
98 | #ifndef OPENSSL_NO_ERR | 103 | #ifndef OPENSSL_NO_ERR |
99 | ERR_load_ERR_strings(); /* include error strings for SYSerr */ | 104 | ERR_load_ERR_strings(); /* include error strings for SYSerr */ |
100 | ERR_load_BN_strings(); | 105 | ERR_load_BN_strings(); |
@@ -118,6 +123,12 @@ void ERR_load_crypto_strings(void) | |||
118 | #ifndef OPENSSL_NO_EC | 123 | #ifndef OPENSSL_NO_EC |
119 | ERR_load_EC_strings(); | 124 | ERR_load_EC_strings(); |
120 | #endif | 125 | #endif |
126 | #ifndef OPENSSL_NO_ECDSA | ||
127 | ERR_load_ECDSA_strings(); | ||
128 | #endif | ||
129 | #ifndef OPENSSL_NO_ECDH | ||
130 | ERR_load_ECDH_strings(); | ||
131 | #endif | ||
121 | /* skip ERR_load_SSL_strings() because it is not in this library */ | 132 | /* skip ERR_load_SSL_strings() because it is not in this library */ |
122 | ERR_load_BIO_strings(); | 133 | ERR_load_BIO_strings(); |
123 | ERR_load_PKCS7_strings(); | 134 | ERR_load_PKCS7_strings(); |
@@ -130,8 +141,8 @@ void ERR_load_crypto_strings(void) | |||
130 | #endif | 141 | #endif |
131 | ERR_load_OCSP_strings(); | 142 | ERR_load_OCSP_strings(); |
132 | ERR_load_UI_strings(); | 143 | ERR_load_UI_strings(); |
144 | #ifndef OPENSSL_NO_CMS | ||
145 | ERR_load_CMS_strings(); | ||
133 | #endif | 146 | #endif |
134 | #ifdef OPENSSL_FIPS | ||
135 | ERR_load_FIPS_strings(); | ||
136 | #endif | 147 | #endif |
137 | } | 148 | } |
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c index 81e34bd6ce..2224a901e5 100644 --- a/src/lib/libcrypto/err/err_prn.c +++ b/src/lib/libcrypto/err/err_prn.c | |||
@@ -57,9 +57,9 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | ||
60 | #include <openssl/lhash.h> | 61 | #include <openssl/lhash.h> |
61 | #include <openssl/crypto.h> | 62 | #include <openssl/crypto.h> |
62 | #include "cryptlib.h" | ||
63 | #include <openssl/buffer.h> | 63 | #include <openssl/buffer.h> |
64 | #include <openssl/err.h> | 64 | #include <openssl/err.h> |
65 | 65 | ||
@@ -86,7 +86,12 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), | |||
86 | #ifndef OPENSSL_NO_FP_API | 86 | #ifndef OPENSSL_NO_FP_API |
87 | static int print_fp(const char *str, size_t len, void *fp) | 87 | static int print_fp(const char *str, size_t len, void *fp) |
88 | { | 88 | { |
89 | return fprintf((FILE *)fp, "%s", str); | 89 | BIO bio; |
90 | |||
91 | BIO_set(&bio,BIO_s_file()); | ||
92 | BIO_set_fp(&bio,fp,BIO_NOCLOSE); | ||
93 | |||
94 | return BIO_printf(&bio, "%s", str); | ||
90 | } | 95 | } |
91 | void ERR_print_errors_fp(FILE *fp) | 96 | void ERR_print_errors_fp(FILE *fp) |
92 | { | 97 | { |
diff --git a/src/lib/libcrypto/err/openssl.ec b/src/lib/libcrypto/err/openssl.ec index f8cd6937e7..1938f081ac 100644 --- a/src/lib/libcrypto/err/openssl.ec +++ b/src/lib/libcrypto/err/openssl.ec | |||
@@ -27,11 +27,16 @@ L DSO crypto/dso/dso.h crypto/dso/dso_err.c | |||
27 | L ENGINE crypto/engine/engine.h crypto/engine/eng_err.c | 27 | L ENGINE crypto/engine/engine.h crypto/engine/eng_err.c |
28 | L OCSP crypto/ocsp/ocsp.h crypto/ocsp/ocsp_err.c | 28 | L OCSP crypto/ocsp/ocsp.h crypto/ocsp/ocsp_err.c |
29 | L UI crypto/ui/ui.h crypto/ui/ui_err.c | 29 | L UI crypto/ui/ui.h crypto/ui/ui_err.c |
30 | L FIPS fips-1.0/fips.h fips-1.0/fips_err.h | 30 | L COMP crypto/comp/comp.h crypto/comp/comp_err.c |
31 | L ECDSA crypto/ecdsa/ecdsa.h crypto/ecdsa/ecs_err.c | ||
32 | L ECDH crypto/ecdh/ecdh.h crypto/ecdh/ech_err.c | ||
33 | L STORE crypto/store/store.h crypto/store/str_err.c | ||
34 | L CMS crypto/cms/cms.h crypto/cms/cms_err.c | ||
31 | 35 | ||
32 | # additional header files to be scanned for function names | 36 | # additional header files to be scanned for function names |
33 | L NONE crypto/x509/x509_vfy.h NONE | 37 | L NONE crypto/x509/x509_vfy.h NONE |
34 | L NONE crypto/ec/ec_lcl.h NONE | 38 | L NONE crypto/ec/ec_lcl.h NONE |
39 | L NONE crypto/cms/cms_lcl.h NONE | ||
35 | 40 | ||
36 | 41 | ||
37 | F RSAREF_F_RSA_BN2BIN | 42 | F RSAREF_F_RSA_BN2BIN |