Deprecate all xxx_F_ defines.
Removed some places that tested for a specific function.
Use empty field for the function names in output.
Update documentation.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9058)
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]
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));
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()) {
}
/* 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;
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);
}
{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"},
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);
}
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;
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;
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) {
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);
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)
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));
}
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
# 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) | \
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;
}
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);
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;
}
OPENSSL_free(t->expected_err);
t->expected_err = NULL;
- OPENSSL_free(t->func);
- t->func = NULL;
OPENSSL_free(t->reason);
t->reason = NULL;
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;
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;
}
}
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);
# 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
# 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
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)
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
PeerKey=MALICE_cf_sect131r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect131r2 curve tests
PeerKey=MALICE_cf_sect131r2_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
PeerKey=MALICE_cf_sect131r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect163k1 curve tests
PeerKey=MALICE_cf_sect163k1_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
PeerKey=MALICE_cf_sect163k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect163r1 curve tests
PeerKey=MALICE_cf_sect163r1_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
PeerKey=MALICE_cf_sect163r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect163r2 curve tests
PeerKey=MALICE_cf_sect163r2_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
PeerKey=MALICE_cf_sect163r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect193r1 curve tests
PeerKey=MALICE_cf_sect193r1_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
PeerKey=MALICE_cf_sect193r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect193r2 curve tests
PeerKey=MALICE_cf_sect193r2_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
PeerKey=MALICE_cf_sect193r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect233k1 curve tests
PeerKey=MALICE_cf_sect233k1_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
PeerKey=MALICE_cf_sect233k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect233r1 curve tests
PeerKey=MALICE_cf_sect233r1_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
PeerKey=MALICE_cf_sect233r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect239k1 curve tests
PeerKey=MALICE_cf_sect239k1_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
PeerKey=MALICE_cf_sect239k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect283k1 curve tests
PeerKey=MALICE_cf_sect283k1_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
PeerKey=MALICE_cf_sect283k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect283r1 curve tests
PeerKey=MALICE_cf_sect283r1_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
PeerKey=MALICE_cf_sect283r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect409k1 curve tests
PeerKey=MALICE_cf_sect409k1_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
PeerKey=MALICE_cf_sect409k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect409r1 curve tests
PeerKey=MALICE_cf_sect409r1_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
PeerKey=MALICE_cf_sect409r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect571k1 curve tests
PeerKey=MALICE_cf_sect571k1_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
PeerKey=MALICE_cf_sect571k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect571r1 curve tests
PeerKey=MALICE_cf_sect571r1_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
PeerKey=MALICE_cf_sect571r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls10 curve tests
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls10_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
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls10_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls11 curve tests
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls11_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
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls11_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls12 curve tests
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls1_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
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls3 curve tests
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls3_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
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls4 curve tests
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls4_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
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls4_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls5 curve tests
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls5_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
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls5_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
-Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls6 curve tests
int kexch_groups_size = 0;
int max_version = TLS1_3_VERSION;
int want_err = SSL_ERROR_NONE;
- int expected_err_func = 0;
int expected_err_reason = 0;
switch (idx) {
if (!TEST_true(create_ssl_connection(serverssl, clientssl, want_err))) {
/* Fail only if no error is expected in handshake */
- if (expected_err_func == 0)
+ if (expected_err_reason == 0)
goto end;
}
/* Fail if expected error is not happening for failure testcases */
- if (expected_err_func) {
+ if (expected_err_reason != 0) {
unsigned long err_code = ERR_get_error();
+
ERR_print_errors_fp(stdout);
- if (TEST_int_eq(ERR_GET_FUNC(err_code), expected_err_func)
- && TEST_int_eq(ERR_GET_REASON(err_code), expected_err_reason))
+ if (TEST_int_eq(ERR_GET_REASON(err_code), expected_err_reason))
testresult = 1;
goto end;
}
}
# Data parsed out of the config and state files.
+# We always map function-code values to zero, so items marked below with
+# an asterisk could eventually be removed. TODO(4.0)
my %hinc; # lib -> header
my %libinc; # header -> lib
my %cskip; # error_file -> lib
my %errorfile; # lib -> error file name
-my %fmax; # lib -> max assigned function code
+my %fmax; # lib -> max assigned function code*
my %rmax; # lib -> max assigned reason code
-my %fassigned; # lib -> colon-separated list of assigned function codes
+my %fassigned; # lib -> colon-separated list of assigned function codes*
my %rassigned; # lib -> colon-separated list of assigned reason codes
-my %fnew; # lib -> count of new function codes
+my %fnew; # lib -> count of new function codes*
my %rnew; # lib -> count of new reason codes
my %rextra; # "extra" reason code -> lib
my %rcodes; # reason-name -> value
-my %ftrans; # old name -> #define-friendly name (all caps)
-my %fcodes; # function-name -> value
+my %ftrans; # old name -> #define-friendly name (all caps)*
+my %fcodes; # function-name -> value*
my $statefile; # state file with assigned reason and function codes
my %strings; # define -> text
#ifndef HEADER_${lib}ERR_H
# define HEADER_${lib}ERR_H
-# ifndef HEADER_SYMHACKS_H
-# include <openssl/symhacks.h>
-# endif
+# include <openssl/opensslconf.h>
+# include <openssl/symhacks.h>
+
EOF
if ( $internal ) {
EOF
} else {
print OUT <<"EOF";
-# define ${lib}err(f, r) ERR_${lib}_error((f), (r), OPENSSL_FILE, OPENSSL_LINE)
+# define ${lib}err(f, r) ERR_${lib}_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
EOF
if ( ! $static ) {
}
print OUT "\n/*\n * $lib function codes.\n */\n";
+ print OUT "# if !OPENSSL_API_3\n";
foreach my $i ( @function ) {
my $z = 48 - length($i);
$z = 0 if $z < 0;
$fassigned{$lib} .= "$findcode:";
print STDERR "New Function code $i\n" if $debug;
}
- printf OUT "#${indent}define $i%s $fcodes{$i}\n", " " x $z;
+ printf OUT "#${indent} define $i%s 0\n", " " x $z;
}
+ print OUT "# endif\n";
print OUT "\n/*\n * $lib reason codes.\n */\n";
foreach my $i ( @reasons ) {
#ifndef OPENSSL_NO_ERR
-static ${const}ERR_STRING_DATA ${lib}_str_functs[] = {
-EOF
-
- # Add each function code: if a function name is found then use it.
- foreach my $i ( @function ) {
- my $fn;
- if ( exists $strings{$i} and $strings{$i} ne '' ) {
- $fn = $strings{$i};
- $fn = "" if $fn eq '*';
- } else {
- $i =~ /^${lib}_F_(\S+)$/;
- $fn = $1;
- $fn = $ftrans{$fn} if exists $ftrans{$fn};
- $strings{$i} = $fn;
- }
- my $short = " {ERR_PACK($pack_lib, $i, 0), \"$fn\"},";
- if ( length($short) <= 80 ) {
- print OUT "$short\n";
- } else {
- print OUT " {ERR_PACK($pack_lib, $i, 0),\n \"$fn\"},\n";
- }
- }
- print OUT <<"EOF";
- {0, NULL}
-};
-
static ${const}ERR_STRING_DATA ${lib}_str_reasons[] = {
EOF
int ERR_load_${lib}_strings(void)
{
#ifndef OPENSSL_NO_ERR
- if (ERR_func_error_string(${lib}_str_functs[0].error) == NULL) {
- ERR_load_strings_const(${lib}_str_functs);
+ if (ERR_func_error_string(${lib}_str_reasons[0].error) == NULL)
ERR_load_strings_const(${lib}_str_reasons);
- }
#endif
return 1;
}
if (!error_loaded) {
#ifndef OPENSSL_NO_ERR
- ERR_load_strings(lib_code, ${lib}_str_functs);
ERR_load_strings(lib_code, ${lib}_str_reasons);
#endif
error_loaded = 1;
{
if (error_loaded) {
#ifndef OPENSSL_NO_ERR
- ERR_unload_strings(lib_code, ${lib}_str_functs);
ERR_unload_strings(lib_code, ${lib}_str_reasons);
#endif
error_loaded = 0;