diff options
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | apps/rsa.c | 1 | ||||
-rw-r--r-- | apps/speed.c | 1 | ||||
-rw-r--r-- | crypto/crmf/crmf_lib.c | 11 | ||||
-rw-r--r-- | crypto/err/err.c | 62 | ||||
-rw-r--r-- | crypto/ui/ui_lib.c | 7 | ||||
-rw-r--r-- | doc/man3/ERR_GET_LIB.pod | 3 | ||||
-rw-r--r-- | include/openssl/err.h | 82 | ||||
-rw-r--r-- | ssl/d1_lib.c | 2 | ||||
-rw-r--r-- | ssl/statem/statem.h | 4 | ||||
-rw-r--r-- | test/evp_test.c | 27 | ||||
-rw-r--r-- | test/recipes/30-test_evp_data/evppkey.txt | 11 | ||||
-rw-r--r-- | test/recipes/30-test_evp_data/evppkey_ecc.txt | 84 | ||||
-rw-r--r-- | test/sslapitest.c | 9 | ||||
-rwxr-xr-x | util/mkerr.pl | 56 |
15 files changed, 91 insertions, 273 deletions
@@ -9,6 +9,10 @@ Changes between 1.1.1 and 3.0.0 [xx XXX xxxx] + *) Removed the function names from error messages and deprecated the + xxx_F_xxx define's. + [Rich Salz] + *) Removed NextStep support and the macro OPENSSL_UNISTD [Rich Salz] diff --git a/apps/rsa.c b/apps/rsa.c index 78958e053e..7c0620c6f2 100644 --- a/apps/rsa.c +++ b/apps/rsa.c @@ -227,7 +227,6 @@ int rsa_main(int argc, char **argv) while ((err = ERR_peek_error()) != 0 && ERR_GET_LIB(err) == ERR_LIB_RSA && - ERR_GET_FUNC(err) == RSA_F_RSA_CHECK_KEY_EX && ERR_GET_REASON(err) != ERR_R_MALLOC_FAILURE) { BIO_printf(out, "RSA key error: %s\n", ERR_reason_error_string(err)); diff --git a/apps/speed.c b/apps/speed.c index 88e0069742..d71b823f2a 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -3114,7 +3114,6 @@ int speed_main(int argc, char **argv) if (error == ERR_peek_last_error() && /* oldest and latest errors match */ /* check that the error origin matches */ ERR_GET_LIB(error) == ERR_LIB_EVP && - ERR_GET_FUNC(error) == EVP_F_INT_CTX_NEW && ERR_GET_REASON(error) == EVP_R_UNSUPPORTED_ALGORITHM) ERR_get_error(); /* pop error from queue */ if (ERR_peek_error()) { diff --git a/crypto/crmf/crmf_lib.c b/crypto/crmf/crmf_lib.c index 55f1f38af8..e777a34e67 100644 --- a/crypto/crmf/crmf_lib.c +++ b/crypto/crmf/crmf_lib.c @@ -299,20 +299,20 @@ int OSSL_CRMF_MSG_set_certReqId(OSSL_CRMF_MSG *crm, int rid) } /* get ASN.1 encoded integer, return -1 on error */ -static int crmf_asn1_get_int(int func, const ASN1_INTEGER *a) +static int crmf_asn1_get_int(const ASN1_INTEGER *a) { int64_t res; if (!ASN1_INTEGER_get_int64(&res, a)) { - CRMFerr(func, ASN1_R_INVALID_NUMBER); + CRMFerr(0, ASN1_R_INVALID_NUMBER); return -1; } if (res < INT_MIN) { - CRMFerr(func, ASN1_R_TOO_SMALL); + CRMFerr(0, ASN1_R_TOO_SMALL); return -1; } if (res > INT_MAX) { - CRMFerr(func, ASN1_R_TOO_LARGE); + CRMFerr(0, ASN1_R_TOO_LARGE); return -1; } return (int)res; @@ -324,8 +324,7 @@ int OSSL_CRMF_MSG_get_certReqId(OSSL_CRMF_MSG *crm) CRMFerr(CRMF_F_OSSL_CRMF_MSG_GET_CERTREQID, CRMF_R_NULL_ARGUMENT); return -1; } - return crmf_asn1_get_int(CRMF_F_OSSL_CRMF_MSG_GET_CERTREQID, - crm->certReq->certReqId); + return crmf_asn1_get_int(crm->certReq->certReqId); } diff --git a/crypto/err/err.c b/crypto/err/err.c index 8752c11977..c161dc280c 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -71,36 +71,6 @@ static ERR_STRING_DATA ERR_str_libraries[] = { {0, NULL}, }; -static ERR_STRING_DATA ERR_str_functs[] = { - {ERR_PACK(0, SYS_F_FOPEN, 0), "fopen"}, - {ERR_PACK(0, SYS_F_CONNECT, 0), "connect"}, - {ERR_PACK(0, SYS_F_GETSERVBYNAME, 0), "getservbyname"}, - {ERR_PACK(0, SYS_F_SOCKET, 0), "socket"}, - {ERR_PACK(0, SYS_F_IOCTLSOCKET, 0), "ioctlsocket"}, - {ERR_PACK(0, SYS_F_BIND, 0), "bind"}, - {ERR_PACK(0, SYS_F_LISTEN, 0), "listen"}, - {ERR_PACK(0, SYS_F_ACCEPT, 0), "accept"}, -# ifdef OPENSSL_SYS_WINDOWS - {ERR_PACK(0, SYS_F_WSASTARTUP, 0), "WSAstartup"}, -# endif - {ERR_PACK(0, SYS_F_OPENDIR, 0), "opendir"}, - {ERR_PACK(0, SYS_F_FREAD, 0), "fread"}, - {ERR_PACK(0, SYS_F_GETADDRINFO, 0), "getaddrinfo"}, - {ERR_PACK(0, SYS_F_GETNAMEINFO, 0), "getnameinfo"}, - {ERR_PACK(0, SYS_F_SETSOCKOPT, 0), "setsockopt"}, - {ERR_PACK(0, SYS_F_GETSOCKOPT, 0), "getsockopt"}, - {ERR_PACK(0, SYS_F_GETSOCKNAME, 0), "getsockname"}, - {ERR_PACK(0, SYS_F_GETHOSTBYNAME, 0), "gethostbyname"}, - {ERR_PACK(0, SYS_F_FFLUSH, 0), "fflush"}, - {ERR_PACK(0, SYS_F_OPEN, 0), "open"}, - {ERR_PACK(0, SYS_F_CLOSE, 0), "close"}, - {ERR_PACK(0, SYS_F_IOCTL, 0), "ioctl"}, - {ERR_PACK(0, SYS_F_STAT, 0), "stat"}, - {ERR_PACK(0, SYS_F_FCNTL, 0), "fcntl"}, - {ERR_PACK(0, SYS_F_FSTAT, 0), "fstat"}, - {0, NULL}, -}; - static ERR_STRING_DATA ERR_str_reasons[] = { {ERR_R_SYS_LIB, "system lib"}, {ERR_R_BN_LIB, "BN lib"}, @@ -164,7 +134,7 @@ static unsigned long err_string_data_hash(const ERR_STRING_DATA *a) unsigned long ret, l; l = a->error; - ret = l ^ ERR_GET_LIB(l) ^ ERR_GET_FUNC(l); + ret = l ^ ERR_GET_LIB(l); return (ret ^ ret % 19 * 13); } @@ -354,8 +324,6 @@ int ERR_load_ERR_strings(void) err_load_strings(ERR_str_libraries); err_load_strings(ERR_str_reasons); - err_patch(ERR_LIB_SYS, ERR_str_functs); - err_load_strings(ERR_str_functs); build_SYS_str_reasons(); #endif return 1; @@ -588,9 +556,9 @@ static unsigned long get_error_values(int inc, int top, const char **file, void ERR_error_string_n(unsigned long e, char *buf, size_t len) { - char lsbuf[64], fsbuf[64], rsbuf[64]; - const char *ls, *fs, *rs; - unsigned long l, f, r; + char lsbuf[64], rsbuf[64]; + const char *ls, *rs; + unsigned long f = 0, l, r; if (len == 0) return; @@ -602,13 +570,6 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len) ls = lsbuf; } - fs = ERR_func_error_string(e); - f = ERR_GET_FUNC(e); - if (fs == NULL) { - BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f); - fs = fsbuf; - } - rs = ERR_reason_error_string(e); r = ERR_GET_REASON(e); if (rs == NULL) { @@ -616,7 +577,7 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len) rs = rsbuf; } - BIO_snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, fs, rs); + BIO_snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, "", rs); if (strlen(buf) == len - 1) { /* Didn't fit; use a minimal format. */ BIO_snprintf(buf, len, "err:%lx:%lx:%lx:%lx", e, l, f, r); @@ -654,18 +615,9 @@ const char *ERR_lib_error_string(unsigned long e) const char *ERR_func_error_string(unsigned long e) { - ERR_STRING_DATA d, *p; - unsigned long l, f; - - if (!RUN_ONCE(&err_string_init, do_err_strings_init)) { + if (!RUN_ONCE(&err_string_init, do_err_strings_init)) return NULL; - } - - l = ERR_GET_LIB(e); - f = ERR_GET_FUNC(e); - d.error = ERR_PACK(l, f, 0); - p = int_err_get_item(&d); - return ((p == NULL) ? NULL : p->string); + return ERR_GET_LIB(e) == ERR_LIB_SYS ? "system library" : NULL; } const char *ERR_reason_error_string(unsigned long e) diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index 8c3502e8cf..d0393511a0 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -874,13 +874,6 @@ int UI_get_result_maxsize(UI_STRING *uis) int UI_set_result(UI *ui, UI_STRING *uis, const char *result) { -#if 0 - /* - * This is placed here solely to preserve UI_F_UI_SET_RESULT - * To be removed for OpenSSL 1.2.0 - */ - UIerr(UI_F_UI_SET_RESULT, ERR_R_DISABLED); -#endif return UI_set_result_ex(ui, uis, result, strlen(result)); } diff --git a/doc/man3/ERR_GET_LIB.pod b/doc/man3/ERR_GET_LIB.pod index 6f14a09d82..2046159021 100644 --- a/doc/man3/ERR_GET_LIB.pod +++ b/doc/man3/ERR_GET_LIB.pod @@ -38,12 +38,13 @@ unique. However, when checking for sub-library specific reason codes, be sure to also compare the library number. ERR_GET_LIB(), ERR_GET_FUNC(), ERR_GET_REASON(), and ERR_FATAL_ERROR() - are macros. +are macros. =head1 RETURN VALUES The library number, function code, reason code, and whether the error is fatal, respectively. +Starting with OpenSSL 3.0.0, the function code is always set to zero. =head1 SEE ALSO diff --git a/include/openssl/err.h b/include/openssl/err.h index f601eaf2d5..2e92b38c4b 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h @@ -103,47 +103,47 @@ typedef struct err_state_st { # define ERR_LIB_USER 128 -# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define OSSL_STOREerr(f,r) ERR_PUT_error(ERR_LIB_OSSL_STORE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define CRMFerr(f,r) ERR_PUT_error(ERR_LIB_CRMF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define CMPerr(f,r) ERR_PUT_error(ERR_LIB_CMP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define SM2err(f,r) ERR_PUT_error(ERR_LIB_SM2,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define ESSerr(f,r) ERR_PUT_error(ERR_LIB_ESS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define PROPerr(f,r) ERR_PUT_error(ERR_LIB_PROP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define PROVerr(f,r) ERR_PUT_error(ERR_LIB_PROV,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define OSSL_STOREerr(f,r) ERR_PUT_error(ERR_LIB_OSSL_STORE,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define CRMFerr(f,r) ERR_PUT_error(ERR_LIB_CRMF,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define CMPerr(f,r) ERR_PUT_error(ERR_LIB_CMP,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define SM2err(f,r) ERR_PUT_error(ERR_LIB_SM2,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define ESSerr(f,r) ERR_PUT_error(ERR_LIB_ESS,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define PROPerr(f,r) ERR_PUT_error(ERR_LIB_PROP,0,(r),OPENSSL_FILE,OPENSSL_LINE) +# define PROVerr(f,r) ERR_PUT_error(ERR_LIB_PROV,0,(r),OPENSSL_FILE,OPENSSL_LINE) # define ERR_PACK(l,f,r) ( \ (((unsigned int)(l) & 0x0FF) << 24L) | \ diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index d3f681ba41..01955d7b4f 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -378,7 +378,7 @@ int dtls1_check_timeout_num(SSL *s) if (s->d1->timeout.num_alerts > DTLS1_TMO_ALERT_COUNT) { /* fail the connection, enough alerts have been sent */ - SSLfatal(s, SSL_AD_NO_ALERT, SSL_F_DTLS1_CHECK_TIMEOUT_NUM, + SSLfatal(s, SSL_AD_NO_ALERT, 0, SSL_R_READ_TIMEOUT_EXPIRED); return -1; } diff --git a/ssl/statem/statem.h b/ssl/statem/statem.h index e26a5be0e2..a9309c967d 100644 --- a/ssl/statem/statem.h +++ b/ssl/statem/statem.h @@ -136,10 +136,10 @@ void ossl_statem_fatal(SSL *s, int al, int func, int reason, const char *file, int line); # define SSL_AD_NO_ALERT -1 # ifndef OPENSSL_NO_ERR -# define SSLfatal(s, al, f, r) ossl_statem_fatal((s), (al), (f), (r), \ +# define SSLfatal(s, al, f, r) ossl_statem_fatal((s), (al), (0), (r), \ OPENSSL_FILE, OPENSSL_LINE) # else -# define SSLfatal(s, al, f, r) ossl_statem_fatal((s), (al), (f), (r), NULL, 0) +# define SSLfatal(s, al, f, r) ossl_statem_fatal((s), (al), (0), (r), NULL, 0) # endif int ossl_statem_in_error(const SSL *s); diff --git a/test/evp_test.c b/test/evp_test.c index f76929d539..7e282031a1 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -36,7 +36,6 @@ typedef struct evp_test_st { const EVP_TEST_METHOD *meth; /* method for this test */ const char *err, *aux_err; /* Error string for test */ char *expected_err; /* Expected error value of test */ - char *func; /* Expected error function string */ char *reason; /* Expected error reason string */ void *data; /* test specific data */ } EVP_TEST; @@ -2735,8 +2734,6 @@ static void clear_test(EVP_TEST *t) } OPENSSL_free(t->expected_err); t->expected_err = NULL; - OPENSSL_free(t->func); - t->func = NULL; OPENSSL_free(t->reason); t->reason = NULL; @@ -2779,10 +2776,10 @@ static int check_test_error(EVP_TEST *t) return 0; } - if (t->func == NULL && t->reason == NULL) + if (t->reason == NULL) return 1; - if (t->func == NULL || t->reason == NULL) { + if (t->reason == NULL) { TEST_info("%s:%d: Test is missing function or reason code", t->s.test_file, t->s.start); return 0; @@ -2790,25 +2787,25 @@ static int check_test_error(EVP_TEST *t) err = ERR_peek_error(); if (err == 0) { - TEST_info("%s:%d: Expected error \"%s:%s\" not set", - t->s.test_file, t->s.start, t->func, t->reason); + TEST_info("%s:%d: Expected error \"%s\" not set", + t->s.test_file, t->s.start, t->reason); return 0; } func = ERR_func_error_string(err); reason = ERR_reason_error_string(err); if (func == NULL && reason == NULL) { - TEST_info("%s:%d: Expected error \"%s:%s\", no strings available." + TEST_info("%s:%d: Expected error \"%s\", no strings available." " Assuming ok.", - t->s.test_file, t->s.start, t->func, t->reason); + t->s.test_file, t->s.start, t->reason); return 1; } - if (strcmp(func, t->func) == 0 && strcmp(reason, t->reason) == 0) + if (strcmp(reason, t->reason) == 0) return 1; - TEST_info("%s:%d: Expected error \"%s:%s\", got \"%s:%s\"", - t->s.test_file, t->s.start, t->func, t->reason, func, reason); + TEST_info("%s:%d: Expected error \"%s\", got \"%s\"", + t->s.test_file, t->s.start, t->reason, reason); return 0; } @@ -3039,11 +3036,7 @@ top: } t->expected_err = take_value(pp); } else if (strcmp(pp->key, "Function") == 0) { - if (t->func != NULL) { - TEST_info("Line %d: multiple function lines\n", t->s.curr); - return 0; - } - t->func = take_value(pp); + /* Ignore old line. */ } else if (strcmp(pp->key, "Reason") == 0) { if (t->reason != NULL) { TEST_info("Line %d: multiple reason lines", t->s.curr); diff --git a/test/recipes/30-test_evp_data/evppkey.txt b/test/recipes/30-test_evp_data/evppkey.txt index 00259b58b4..d395f15664 100644 --- a/test/recipes/30-test_evp_data/evppkey.txt +++ b/test/recipes/30-test_evp_data/evppkey.txt @@ -374,13 +374,11 @@ Result = KEYOP_ERROR # Illegal RSA key derivation Derive = RSA-2048 Result = KEYOP_INIT_ERROR -Function = EVP_PKEY_derive_init Reason = operation not supported for this keytype Sign = RSA-2048 Ctrl = rsa_mgf1_md:sha1 Result = PKEY_CTRL_INVALID -Function = pkey_rsa_ctrl Reason = invalid mgf1 md # RSA PSS key tests @@ -571,19 +569,16 @@ Result = PKEY_CTRL_ERROR # Illegal decrypt Decrypt = RSA-PSS Result = KEYOP_INIT_ERROR -Function = EVP_PKEY_decrypt_init Reason = operation not supported for this keytype # Invalid key: rejected when we try to init Verify = RSA-PSS-BAD Result = KEYOP_INIT_ERROR -Function = rsa_pss_get_param Reason = invalid salt length # Invalid key: rejected when we try to init Verify = RSA-PSS-BAD2 Result = KEYOP_INIT_ERROR -Function = pkey_pss_init Reason = invalid salt length @@ -762,12 +757,10 @@ SharedSecret=4A5D9D5BA4CE2DE1728E3BF480350F25E07E21C947D19E3376F09B3C1E161742 Sign=Alice-25519 Result = KEYOP_INIT_ERROR -Function = EVP_PKEY_sign_init Reason = operation not supported for this keytype Verify=Alice-25519 Result = KEYOP_INIT_ERROR -Function = EVP_PKEY_verify_init Reason = operation not supported for this keytype Title = X448 test vectors (from RFC7748 6.2) @@ -834,12 +827,10 @@ SharedSecret=07fff4181ac6cc95ec1c16a94a0f74d12da232ce40a77552281d282bb60c0b56fd2 Sign=Alice-448 Result = KEYOP_INIT_ERROR -Function = EVP_PKEY_sign_init Reason = operation not supported for this keytype Verify=Alice-448 Result = KEYOP_INIT_ERROR -Function = EVP_PKEY_verify_init Reason = operation not supported for this keytype @@ -17286,7 +17277,6 @@ Derive=ALICE_cf_sect283k1 PeerKey=BOB_cf_sect283k1_PUB Ctrl=ecdh_cofactor_mode:1 Result = DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title = Test keypair mismatches @@ -17830,7 +17820,6 @@ KeyGen = rsaEncryption Ctrl = rsa_keygen_bits:128 KeyName = tmprsa Result = PKEY_CTRL_INVALID -Function = pkey_rsa_ctrl Reason = key size too small # RSA-PSS with restrictions, should succeed. diff --git a/test/recipes/30-test_evp_data/evppkey_ecc.txt b/test/recipes/30-test_evp_data/evppkey_ecc.txt index 8e618c83f9..b255f772bc 100644 --- a/test/recipes/30-test_evp_data/evppkey_ecc.txt +++ b/test/recipes/30-test_evp_data/evppkey_ecc.txt @@ -623,7 +623,6 @@ Derive=BOB_cf_c2pnb163v1 PeerKey=MALICE_cf_c2pnb163v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -631,7 +630,6 @@ Derive=ALICE_cf_c2pnb163v1 PeerKey=MALICE_cf_c2pnb163v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2pnb163v2 curve tests @@ -695,7 +693,6 @@ Derive=BOB_cf_c2pnb163v2 PeerKey=MALICE_cf_c2pnb163v2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -703,7 +700,6 @@ Derive=ALICE_cf_c2pnb163v2 PeerKey=MALICE_cf_c2pnb163v2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2pnb163v3 curve tests @@ -767,7 +763,6 @@ Derive=BOB_cf_c2pnb163v3 PeerKey=MALICE_cf_c2pnb163v3_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -775,7 +770,6 @@ Derive=ALICE_cf_c2pnb163v3 PeerKey=MALICE_cf_c2pnb163v3_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2pnb176v1 curve tests @@ -839,7 +833,6 @@ Derive=BOB_cf_c2pnb176v1 PeerKey=MALICE_cf_c2pnb176v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -847,7 +840,6 @@ Derive=ALICE_cf_c2pnb176v1 PeerKey=MALICE_cf_c2pnb176v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2pnb208w1 curve tests @@ -913,7 +905,6 @@ Derive=BOB_cf_c2pnb208w1 PeerKey=MALICE_cf_c2pnb208w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -921,7 +912,6 @@ Derive=ALICE_cf_c2pnb208w1 PeerKey=MALICE_cf_c2pnb208w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2pnb272w1 curve tests @@ -987,7 +977,6 @@ Derive=BOB_cf_c2pnb272w1 PeerKey=MALICE_cf_c2pnb272w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -995,7 +984,6 @@ Derive=ALICE_cf_c2pnb272w1 PeerKey=MALICE_cf_c2pnb272w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2pnb304w1 curve tests @@ -1061,7 +1049,6 @@ Derive=BOB_cf_c2pnb304w1 PeerKey=MALICE_cf_c2pnb304w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1069,7 +1056,6 @@ Derive=ALICE_cf_c2pnb304w1 PeerKey=MALICE_cf_c2pnb304w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2pnb368w1 curve tests @@ -1138,7 +1124,6 @@ Derive=BOB_cf_c2pnb368w1 PeerKey=MALICE_cf_c2pnb368w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1146,7 +1131,6 @@ Derive=ALICE_cf_c2pnb368w1 PeerKey=MALICE_cf_c2pnb368w1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb191v1 curve tests @@ -1212,7 +1196,6 @@ Derive=BOB_cf_c2tnb191v1 PeerKey=MALICE_cf_c2tnb191v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1220,7 +1203,6 @@ Derive=ALICE_cf_c2tnb191v1 PeerKey=MALICE_cf_c2tnb191v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb191v2 curve tests @@ -1286,7 +1268,6 @@ Derive=BOB_cf_c2tnb191v2 PeerKey=MALICE_cf_c2tnb191v2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1294,7 +1275,6 @@ Derive=ALICE_cf_c2tnb191v2 PeerKey=MALICE_cf_c2tnb191v2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb191v3 curve tests @@ -1360,7 +1340,6 @@ Derive=BOB_cf_c2tnb191v3 PeerKey=MALICE_cf_c2tnb191v3_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1368,7 +1347,6 @@ Derive=ALICE_cf_c2tnb191v3 PeerKey=MALICE_cf_c2tnb191v3_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb239v1 curve tests @@ -1434,7 +1412,6 @@ Derive=BOB_cf_c2tnb239v1 PeerKey=MALICE_cf_c2tnb239v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1442,7 +1419,6 @@ Derive=ALICE_cf_c2tnb239v1 PeerKey=MALICE_cf_c2tnb239v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb239v2 curve tests @@ -1508,7 +1484,6 @@ Derive=BOB_cf_c2tnb239v2 PeerKey=MALICE_cf_c2tnb239v2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1516,7 +1491,6 @@ Derive=ALICE_cf_c2tnb239v2 PeerKey=MALICE_cf_c2tnb239v2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb239v3 curve tests @@ -1582,7 +1556,6 @@ Derive=BOB_cf_c2tnb239v3 PeerKey=MALICE_cf_c2tnb239v3_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1590,7 +1563,6 @@ Derive=ALICE_cf_c2tnb239v3 PeerKey=MALICE_cf_c2tnb239v3_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb359v1 curve tests @@ -1659,7 +1631,6 @@ Derive=BOB_cf_c2tnb359v1 PeerKey=MALICE_cf_c2tnb359v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1667,7 +1638,6 @@ Derive=ALICE_cf_c2tnb359v1 PeerKey=MALICE_cf_c2tnb359v1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=c2tnb431r1 curve tests @@ -1736,7 +1706,6 @@ Derive=BOB_cf_c2tnb431r1 PeerKey=MALICE_cf_c2tnb431r1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -1744,7 +1713,6 @@ Derive=ALICE_cf_c2tnb431r1 PeerKey=MALICE_cf_c2tnb431r1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=prime192v1 curve tests @@ -2121,7 +2089,6 @@ Derive=BOB_cf_secp112r2 PeerKey=MALICE_cf_secp112r2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -2129,7 +2096,6 @@ Derive=ALICE_cf_secp112r2 PeerKey=MALICE_cf_secp112r2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=secp128r1 curve tests @@ -2226,7 +2192,6 @@ Derive=BOB_cf_secp128r2 PeerKey=MALICE_cf_secp128r2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -2234,7 +2199,6 @@ Derive=ALICE_cf_secp128r2 PeerKey=MALICE_cf_secp128r2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=secp160k1 curve tests @@ -2651,7 +2615,6 @@ Derive=BOB_cf_sect113r1 PeerKey=MALICE_cf_sect113r1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -2659,7 +2622,6 @@ Derive=ALICE_cf_sect113r1 PeerKey=MALICE_cf_sect113r1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=sect113r2 curve tests @@ -2720,7 +2682,6 @@ Derive=BOB_cf_sect113r2 PeerKey=MALICE_cf_sect113r2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -2728,7 +2689,6 @@ Derive=ALICE_cf_sect113r2 PeerKey=MALICE_cf_sect113r2_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity Title=sect131r1 curve tests @@ -2792,7 +2752,6 @@ Derive=BOB_cf_sect131r1 PeerKey=MALICE_cf_sect131r1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates Reason=point at infinity # ECC CDH Alice with Malice peer @@ -2800,7 +2759,6 @@ Derive=ALICE_cf_sect131r1 PeerKey=MALICE_cf_sect131r1_PUB Ctrl=ecdh_cofactor_mode:1 Result=DERIVE_ERROR -Function=EC_POINT_get_affine_coordinates |