summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_cert.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2017-01-26 10:40:21 +0000
committerbeck <beck@openbsd.org>2017-01-26 10:40:21 +0000
commitc37c9edfef0160532e31e5d5ada0f7781b5704ec (patch)
tree8908d6759fe63c8c13e26f076c1b158713415580 /lib/libssl/ssl_cert.c
parentMerge the single two line function from ssl_err2.c into ssl_err.c. (diff)
downloadwireguard-openbsd-c37c9edfef0160532e31e5d5ada0f7781b5704ec.tar.xz
wireguard-openbsd-c37c9edfef0160532e31e5d5ada0f7781b5704ec.zip
Send the error function codes to rot in the depths of hell where they belong
We leave a single funciton code (0xFFF) to say "SSL_internal" so the public API will not break, and we replace all internal use of the two argument SSL_err() with the internal only SSL_error() that only takes a reason code. ok jsing@
Diffstat (limited to 'lib/libssl/ssl_cert.c')
-rw-r--r--lib/libssl/ssl_cert.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/libssl/ssl_cert.c b/lib/libssl/ssl_cert.c
index 218a55c1978..4f714f751ac 100644
--- a/lib/libssl/ssl_cert.c
+++ b/lib/libssl/ssl_cert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_cert.c,v 1.60 2017/01/24 15:04:12 jsing Exp $ */
+/* $OpenBSD: ssl_cert.c,v 1.61 2017/01/26 10:40:21 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -178,7 +178,7 @@ ssl_cert_new(void)
ret = calloc(1, sizeof(CERT));
if (ret == NULL) {
- SSLerr(SSL_F_SSL_CERT_NEW, ERR_R_MALLOC_FAILURE);
+ SSLerror(ERR_R_MALLOC_FAILURE);
return (NULL);
}
ret->key = &(ret->pkeys[SSL_PKEY_RSA_ENC]);
@@ -195,7 +195,7 @@ ssl_cert_dup(CERT *cert)
ret = calloc(1, sizeof(CERT));
if (ret == NULL) {
- SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE);
+ SSLerror(ERR_R_MALLOC_FAILURE);
return (NULL);
}
@@ -212,13 +212,13 @@ ssl_cert_dup(CERT *cert)
if (cert->dh_tmp != NULL) {
ret->dh_tmp = DHparams_dup(cert->dh_tmp);
if (ret->dh_tmp == NULL) {
- SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_DH_LIB);
+ SSLerror(ERR_R_DH_LIB);
goto err;
}
if (cert->dh_tmp->priv_key) {
BIGNUM *b = BN_dup(cert->dh_tmp->priv_key);
if (!b) {
- SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_BN_LIB);
+ SSLerror(ERR_R_BN_LIB);
goto err;
}
ret->dh_tmp->priv_key = b;
@@ -226,7 +226,7 @@ ssl_cert_dup(CERT *cert)
if (cert->dh_tmp->pub_key) {
BIGNUM *b = BN_dup(cert->dh_tmp->pub_key);
if (!b) {
- SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_BN_LIB);
+ SSLerror(ERR_R_BN_LIB);
goto err;
}
ret->dh_tmp->pub_key = b;
@@ -238,7 +238,7 @@ ssl_cert_dup(CERT *cert)
if (cert->ecdh_tmp) {
ret->ecdh_tmp = EC_KEY_dup(cert->ecdh_tmp);
if (ret->ecdh_tmp == NULL) {
- SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_EC_LIB);
+ SSLerror(ERR_R_EC_LIB);
goto err;
}
}
@@ -284,7 +284,7 @@ ssl_cert_dup(CERT *cert)
default:
/* Can't happen. */
- SSLerr(SSL_F_SSL_CERT_DUP, SSL_R_LIBRARY_BUG);
+ SSLerror(SSL_R_LIBRARY_BUG);
}
}
}
@@ -354,12 +354,12 @@ ssl_cert_inst(CERT **o)
*/
if (o == NULL) {
- SSLerr(SSL_F_SSL_CERT_INST, ERR_R_PASSED_NULL_PARAMETER);
+ SSLerror(ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
if (*o == NULL) {
if ((*o = ssl_cert_new()) == NULL) {
- SSLerr(SSL_F_SSL_CERT_INST, ERR_R_MALLOC_FAILURE);
+ SSLerror(ERR_R_MALLOC_FAILURE);
return (0);
}
}
@@ -374,7 +374,7 @@ ssl_sess_cert_new(void)
ret = calloc(1, sizeof *ret);
if (ret == NULL) {
- SSLerr(SSL_F_SSL_SESS_CERT_NEW, ERR_R_MALLOC_FAILURE);
+ SSLerror(ERR_R_MALLOC_FAILURE);
return NULL;
}
ret->peer_key = &(ret->peer_pkeys[SSL_PKEY_RSA_ENC]);
@@ -418,7 +418,7 @@ ssl_verify_cert_chain(SSL *s, STACK_OF(X509) *sk)
x = sk_X509_value(sk, 0);
if (!X509_STORE_CTX_init(&ctx, s->ctx->cert_store, x, sk)) {
- SSLerr(SSL_F_SSL_VERIFY_CERT_CHAIN, ERR_R_X509_LIB);
+ SSLerror(ERR_R_X509_LIB);
return (0);
}
X509_STORE_CTX_set_ex_data(&ctx,
@@ -574,7 +574,7 @@ SSL_load_client_CA_file(const char *file)
in = BIO_new(BIO_s_file_internal());
if ((sk == NULL) || (in == NULL)) {
- SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_MALLOC_FAILURE);
+ SSLerror(ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -587,7 +587,7 @@ SSL_load_client_CA_file(const char *file)
if (ret == NULL) {
ret = sk_X509_NAME_new_null();
if (ret == NULL) {
- SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE,
+ SSLerror(
ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -643,7 +643,7 @@ SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
in = BIO_new(BIO_s_file_internal());
if (in == NULL) {
- SSLerr(SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK,
+ SSLerror(
ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -713,7 +713,7 @@ SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, const char *dir)
if (!ret) {
SYSerr(SYS_F_OPENDIR, errno);
ERR_asprintf_error_data("opendir ('%s')", dir);
- SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK, ERR_R_SYS_LIB);
+ SSLerror(ERR_R_SYS_LIB);
}
return ret;
}