summaryrefslogtreecommitdiff
path: root/lib/libcrypto/x509
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2017-01-29 17:49:24 +0000
committerBob Beck <beck@cvs.openbsd.org>2017-01-29 17:49:24 +0000
commitc95f3b2c0c39020aafaffd84899a33ece0210769 (patch)
tree6d6e55f6c8b4047319196f43823ad30170dfe061 /lib/libcrypto/x509
parentb8dd3a8e12bfab2c15794994bc5bdc1397125536 (diff)
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
Diffstat (limited to 'lib/libcrypto/x509')
-rw-r--r--lib/libcrypto/x509/by_dir.c24
-rw-r--r--lib/libcrypto/x509/by_file.c27
-rw-r--r--lib/libcrypto/x509/by_mem.c4
-rw-r--r--lib/libcrypto/x509/x509_att.c22
-rw-r--r--lib/libcrypto/x509/x509_cmp.c11
-rw-r--r--lib/libcrypto/x509/x509_err.c48
-rw-r--r--lib/libcrypto/x509/x509_lu.c21
-rw-r--r--lib/libcrypto/x509/x509_obj.c4
-rw-r--r--lib/libcrypto/x509/x509_r2x.c4
-rw-r--r--lib/libcrypto/x509/x509_req.c19
-rw-r--r--lib/libcrypto/x509/x509_trs.c10
-rw-r--r--lib/libcrypto/x509/x509_v3.c12
-rw-r--r--lib/libcrypto/x509/x509_vfy.c48
-rw-r--r--lib/libcrypto/x509/x509name.c13
-rw-r--r--lib/libcrypto/x509/x509spki.c9
15 files changed, 98 insertions, 178 deletions
diff --git a/lib/libcrypto/x509/by_dir.c b/lib/libcrypto/x509/by_dir.c
index 7b7d14a9505..01a302b538a 100644
--- a/lib/libcrypto/x509/by_dir.c
+++ b/lib/libcrypto/x509/by_dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: by_dir.c,v 1.37 2015/04/11 16:03:21 deraadt Exp $ */
+/* $OpenBSD: by_dir.c,v 1.38 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -133,7 +133,7 @@ dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,
ret = add_cert_dir(ld, X509_get_default_cert_dir(),
X509_FILETYPE_PEM);
if (!ret) {
- X509err(X509_F_DIR_CTRL, X509_R_LOADING_CERT_DIR);
+ X509error(X509_R_LOADING_CERT_DIR);
}
} else
ret = add_cert_dir(ld, argp, (int)argl);
@@ -205,7 +205,7 @@ add_cert_dir(BY_DIR *ctx, const char *dir, int type)
ptrdiff_t len;
if (dir == NULL || !*dir) {
- X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);
+ X509error(X509_R_INVALID_DIRECTORY);
return 0;
}
@@ -230,25 +230,25 @@ add_cert_dir(BY_DIR *ctx, const char *dir, int type)
if (ctx->dirs == NULL) {
ctx->dirs = sk_BY_DIR_ENTRY_new_null();
if (!ctx->dirs) {
- X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
}
ent = malloc(sizeof(BY_DIR_ENTRY));
if (!ent) {
- X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
ent->dir_type = type;
ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
ent->dir = strndup(ss, (size_t)len);
if (!ent->dir || !ent->hashes) {
- X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
by_dir_entry_free(ent);
return 0;
}
if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
- X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
by_dir_entry_free(ent);
return 0;
}
@@ -294,12 +294,12 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
stmp.data.crl = &data.crl.st_crl;
postfix="r";
} else {
- X509err(X509_F_GET_CERT_BY_SUBJECT, X509_R_WRONG_LOOKUP_TYPE);
+ X509error(X509_R_WRONG_LOOKUP_TYPE);
goto finish;
}
if ((b = BUF_MEM_new()) == NULL) {
- X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_BUF_LIB);
+ X509error(ERR_R_BUF_LIB);
goto finish;
}
@@ -313,7 +313,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i);
j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1;
if (!BUF_MEM_grow(b, j)) {
- X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
goto finish;
}
if (type == X509_LU_CRL && ent->hashes) {
@@ -381,7 +381,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
if (!hent) {
hent = malloc(sizeof(BY_DIR_HASH));
if (!hent) {
- X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
ok = 0;
goto finish;
@@ -389,7 +389,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
hent->hash = h;
hent->suffix = k;
if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) {
- X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
free(hent);
ok = 0;
diff --git a/lib/libcrypto/x509/by_file.c b/lib/libcrypto/x509/by_file.c
index 377b3b0a8b8..b2c8ef6cfaf 100644
--- a/lib/libcrypto/x509/by_file.c
+++ b/lib/libcrypto/x509/by_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: by_file.c,v 1.20 2016/03/11 07:08:45 mmcc Exp $ */
+/* $OpenBSD: by_file.c,v 1.21 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -102,8 +102,7 @@ by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,
X509_get_default_cert_file(),
X509_FILETYPE_PEM) != 0);
if (!ok) {
- X509err(X509_F_BY_FILE_CTRL,
- X509_R_LOADING_DEFAULTS);
+ X509error(X509_R_LOADING_DEFAULTS);
}
} else {
if (argl == X509_FILETYPE_PEM)
@@ -131,7 +130,7 @@ X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
in = BIO_new(BIO_s_file_internal());
if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) {
- X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_SYS_LIB);
+ X509error(ERR_R_SYS_LIB);
goto err;
}
@@ -144,8 +143,7 @@ X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
ERR_clear_error();
break;
} else {
- X509err(X509_F_X509_LOAD_CERT_FILE,
- ERR_R_PEM_LIB);
+ X509error(ERR_R_PEM_LIB);
goto err;
}
}
@@ -160,7 +158,7 @@ X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
} else if (type == X509_FILETYPE_ASN1) {
x = d2i_X509_bio(in, NULL);
if (x == NULL) {
- X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_ASN1_LIB);
+ X509error(ERR_R_ASN1_LIB);
goto err;
}
i = X509_STORE_add_cert(ctx->store_ctx, x);
@@ -168,7 +166,7 @@ X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
goto err;
ret = i;
} else {
- X509err(X509_F_X509_LOAD_CERT_FILE, X509_R_BAD_X509_FILETYPE);
+ X509error(X509_R_BAD_X509_FILETYPE);
goto err;
}
err:
@@ -190,7 +188,7 @@ X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
in = BIO_new(BIO_s_file_internal());
if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) {
- X509err(X509_F_X509_LOAD_CRL_FILE, ERR_R_SYS_LIB);
+ X509error(ERR_R_SYS_LIB);
goto err;
}
@@ -203,8 +201,7 @@ X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
ERR_clear_error();
break;
} else {
- X509err(X509_F_X509_LOAD_CRL_FILE,
- ERR_R_PEM_LIB);
+ X509error(ERR_R_PEM_LIB);
goto err;
}
}
@@ -219,7 +216,7 @@ X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
} else if (type == X509_FILETYPE_ASN1) {
x = d2i_X509_CRL_bio(in, NULL);
if (x == NULL) {
- X509err(X509_F_X509_LOAD_CRL_FILE, ERR_R_ASN1_LIB);
+ X509error(ERR_R_ASN1_LIB);
goto err;
}
i = X509_STORE_add_crl(ctx->store_ctx, x);
@@ -227,7 +224,7 @@ X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
goto err;
ret = i;
} else {
- X509err(X509_F_X509_LOAD_CRL_FILE, X509_R_BAD_X509_FILETYPE);
+ X509error(X509_R_BAD_X509_FILETYPE);
goto err;
}
err:
@@ -248,13 +245,13 @@ X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type)
return X509_load_cert_file(ctx, file, type);
in = BIO_new_file(file, "r");
if (!in) {
- X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_SYS_LIB);
+ X509error(ERR_R_SYS_LIB);
return 0;
}
inf = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL);
BIO_free(in);
if (!inf) {
- X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_PEM_LIB);
+ X509error(ERR_R_PEM_LIB);
return 0;
}
for (i = 0; i < sk_X509_INFO_num(inf); i++) {
diff --git a/lib/libcrypto/x509/by_mem.c b/lib/libcrypto/x509/by_mem.c
index ecab813406d..34d4040d848 100644
--- a/lib/libcrypto/x509/by_mem.c
+++ b/lib/libcrypto/x509/by_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: by_mem.c,v 1.3 2015/02/05 01:33:22 reyk Exp $ */
+/* $OpenBSD: by_mem.c,v 1.4 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -129,7 +129,7 @@ by_mem_ctrl(X509_LOOKUP *lu, int cmd, const char *buf,
ok = count != 0;
done:
if (count == 0)
- X509err(X509_F_X509_LOAD_CERT_CRL_FILE,ERR_R_PEM_LIB);
+ X509error(ERR_R_PEM_LIB);
if (inf != NULL)
sk_X509_INFO_pop_free(inf, X509_INFO_free);
if (in != NULL)
diff --git a/lib/libcrypto/x509/x509_att.c b/lib/libcrypto/x509/x509_att.c
index ab11e79b0af..7304118eb33 100644
--- a/lib/libcrypto/x509/x509_att.c
+++ b/lib/libcrypto/x509/x509_att.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_att.c,v 1.14 2016/03/21 04:05:33 mmcc Exp $ */
+/* $OpenBSD: x509_att.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -131,7 +131,7 @@ X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr)
STACK_OF(X509_ATTRIBUTE) *sk = NULL;
if (x == NULL) {
- X509err(X509_F_X509AT_ADD1_ATTR, ERR_R_PASSED_NULL_PARAMETER);
+ X509error(ERR_R_PASSED_NULL_PARAMETER);
return (NULL);
}
@@ -150,7 +150,7 @@ X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr)
return (sk);
err:
- X509err(X509_F_X509AT_ADD1_ATTR, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
err2:
if (new_attr != NULL)
X509_ATTRIBUTE_free(new_attr);
@@ -231,8 +231,7 @@ X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype,
obj = OBJ_nid2obj(nid);
if (obj == NULL) {
- X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_NID,
- X509_R_UNKNOWN_NID);
+ X509error(X509_R_UNKNOWN_NID);
return (NULL);
}
ret = X509_ATTRIBUTE_create_by_OBJ(attr, obj, atrtype, data, len);
@@ -249,8 +248,7 @@ X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, const ASN1_OBJECT *obj,
if ((attr == NULL) || (*attr == NULL)) {
if ((ret = X509_ATTRIBUTE_new()) == NULL) {
- X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ,
- ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return (NULL);
}
} else
@@ -280,8 +278,7 @@ X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, const char *atrname,
obj = OBJ_txt2obj(atrname, 0);
if (obj == NULL) {
- X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_TXT,
- X509_R_INVALID_FIELD_NAME);
+ X509error(X509_R_INVALID_FIELD_NAME);
ERR_asprintf_error_data("name=%s", atrname);
return (NULL);
}
@@ -314,8 +311,7 @@ X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data,
stmp = ASN1_STRING_set_by_NID(NULL, data, len, attrtype,
OBJ_obj2nid(attr->object));
if (!stmp) {
- X509err(X509_F_X509_ATTRIBUTE_SET1_DATA,
- ERR_R_ASN1_LIB);
+ X509error(ERR_R_ASN1_LIB);
return 0;
}
atype = stmp->type;
@@ -352,7 +348,7 @@ X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data,
err:
ASN1_TYPE_free(ttmp);
ASN1_STRING_free(stmp);
- X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
@@ -383,7 +379,7 @@ X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, void *data)
if (!ttmp)
return NULL;
if (atrtype != ASN1_TYPE_get(ttmp)){
- X509err(X509_F_X509_ATTRIBUTE_GET0_DATA, X509_R_WRONG_TYPE);
+ X509error(X509_R_WRONG_TYPE);
return NULL;
}
return ttmp->value.ptr;
diff --git a/lib/libcrypto/x509/x509_cmp.c b/lib/libcrypto/x509/x509_cmp.c
index 407e1e07adb..72fbef15446 100644
--- a/lib/libcrypto/x509/x509_cmp.c
+++ b/lib/libcrypto/x509/x509_cmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_cmp.c,v 1.26 2015/07/29 14:58:34 jsing Exp $ */
+/* $OpenBSD: x509_cmp.c,v 1.27 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -351,16 +351,13 @@ X509_check_private_key(X509 *x, EVP_PKEY *k)
case 1:
break;
case 0:
- X509err(X509_F_X509_CHECK_PRIVATE_KEY,
- X509_R_KEY_VALUES_MISMATCH);
+ X509error(X509_R_KEY_VALUES_MISMATCH);
break;
case -1:
- X509err(X509_F_X509_CHECK_PRIVATE_KEY,
- X509_R_KEY_TYPE_MISMATCH);
+ X509error(X509_R_KEY_TYPE_MISMATCH);
break;
case -2:
- X509err(X509_F_X509_CHECK_PRIVATE_KEY,
- X509_R_UNKNOWN_KEY_TYPE);
+ X509error(X509_R_UNKNOWN_KEY_TYPE);
}
EVP_PKEY_free(xk);
if (ret > 0)
diff --git a/lib/libcrypto/x509/x509_err.c b/lib/libcrypto/x509/x509_err.c
index 6a15ac9fd09..3b321376ad0 100644
--- a/lib/libcrypto/x509/x509_err.c
+++ b/lib/libcrypto/x509/x509_err.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_err.c,v 1.12 2014/07/10 22:45:58 jsing Exp $ */
+/* $OpenBSD: x509_err.c,v 1.13 2017/01/29 17:49:23 beck Exp $ */
/* ====================================================================
* Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved.
*
@@ -72,51 +72,7 @@
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_X509,0,reason)
static ERR_STRING_DATA X509_str_functs[] = {
- {ERR_FUNC(X509_F_ADD_CERT_DIR), "ADD_CERT_DIR"},
- {ERR_FUNC(X509_F_BY_FILE_CTRL), "BY_FILE_CTRL"},
- {ERR_FUNC(X509_F_CHECK_POLICY), "CHECK_POLICY"},
- {ERR_FUNC(X509_F_DIR_CTRL), "DIR_CTRL"},
- {ERR_FUNC(X509_F_GET_CERT_BY_SUBJECT), "GET_CERT_BY_SUBJECT"},
- {ERR_FUNC(X509_F_NETSCAPE_SPKI_B64_DECODE), "NETSCAPE_SPKI_b64_decode"},
- {ERR_FUNC(X509_F_NETSCAPE_SPKI_B64_ENCODE), "NETSCAPE_SPKI_b64_encode"},
- {ERR_FUNC(X509_F_X509AT_ADD1_ATTR), "X509at_add1_attr"},
- {ERR_FUNC(X509_F_X509V3_ADD_EXT), "X509v3_add_ext"},
- {ERR_FUNC(X509_F_X509_ATTRIBUTE_CREATE_BY_NID), "X509_ATTRIBUTE_create_by_NID"},
- {ERR_FUNC(X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ), "X509_ATTRIBUTE_create_by_OBJ"},
- {ERR_FUNC(X509_F_X509_ATTRIBUTE_CREATE_BY_TXT), "X509_ATTRIBUTE_create_by_txt"},
- {ERR_FUNC(X509_F_X509_ATTRIBUTE_GET0_DATA), "X509_ATTRIBUTE_get0_data"},
- {ERR_FUNC(X509_F_X509_ATTRIBUTE_SET1_DATA), "X509_ATTRIBUTE_set1_data"},
- {ERR_FUNC(X509_F_X509_CHECK_PRIVATE_KEY), "X509_check_private_key"},
- {ERR_FUNC(X509_F_X509_CRL_PRINT_FP), "X509_CRL_print_fp"},
- {ERR_FUNC(X509_F_X509_EXTENSION_CREATE_BY_NID), "X509_EXTENSION_create_by_NID"},
- {ERR_FUNC(X509_F_X509_EXTENSION_CREATE_BY_OBJ), "X509_EXTENSION_create_by_OBJ"},
- {ERR_FUNC(X509_F_X509_GET_PUBKEY_PARAMETERS), "X509_get_pubkey_parameters"},
- {ERR_FUNC(X509_F_X509_LOAD_CERT_CRL_FILE), "X509_load_cert_crl_file"},
- {ERR_FUNC(X509_F_X509_LOAD_CERT_FILE), "X509_load_cert_file"},
- {ERR_FUNC(X509_F_X509_LOAD_CRL_FILE), "X509_load_crl_file"},
- {ERR_FUNC(X509_F_X509_NAME_ADD_ENTRY), "X509_NAME_add_entry"},
- {ERR_FUNC(X509_F_X509_NAME_ENTRY_CREATE_BY_NID), "X509_NAME_ENTRY_create_by_NID"},
- {ERR_FUNC(X509_F_X509_NAME_ENTRY_CREATE_BY_TXT), "X509_NAME_ENTRY_create_by_txt"},
- {ERR_FUNC(X509_F_X509_NAME_ENTRY_SET_OBJECT), "X509_NAME_ENTRY_set_object"},
- {ERR_FUNC(X509_F_X509_NAME_ONELINE), "X509_NAME_oneline"},
- {ERR_FUNC(X509_F_X509_NAME_PRINT), "X509_NAME_print"},
- {ERR_FUNC(X509_F_X509_PRINT_EX_FP), "X509_print_ex_fp"},
- {ERR_FUNC(X509_F_X509_PUBKEY_GET), "X509_PUBKEY_get"},
- {ERR_FUNC(X509_F_X509_PUBKEY_SET), "X509_PUBKEY_set"},
- {ERR_FUNC(X509_F_X509_REQ_CHECK_PRIVATE_KEY), "X509_REQ_check_private_key"},
- {ERR_FUNC(X509_F_X509_REQ_PRINT_EX), "X509_REQ_print_ex"},
- {ERR_FUNC(X509_F_X509_REQ_PRINT_FP), "X509_REQ_print_fp"},
- {ERR_FUNC(X509_F_X509_REQ_TO_X509), "X509_REQ_to_X509"},
- {ERR_FUNC(X509_F_X509_STORE_ADD_CERT), "X509_STORE_add_cert"},
- {ERR_FUNC(X509_F_X509_STORE_ADD_CRL), "X509_STORE_add_crl"},
- {ERR_FUNC(X509_F_X509_STORE_CTX_GET1_ISSUER), "X509_STORE_CTX_get1_issuer"},
- {ERR_FUNC(X509_F_X509_STORE_CTX_INIT), "X509_STORE_CTX_init"},
- {ERR_FUNC(X509_F_X509_STORE_CTX_NEW), "X509_STORE_CTX_new"},
- {ERR_FUNC(X509_F_X509_STORE_CTX_PURPOSE_INHERIT), "X509_STORE_CTX_purpose_inherit"},
- {ERR_FUNC(X509_F_X509_TO_X509_REQ), "X509_to_X509_REQ"},
- {ERR_FUNC(X509_F_X509_TRUST_ADD), "X509_TRUST_add"},
- {ERR_FUNC(X509_F_X509_TRUST_SET), "X509_TRUST_set"},
- {ERR_FUNC(X509_F_X509_VERIFY_CERT), "X509_verify_cert"},
+ {ERR_FUNC(0xfff), "CRYPTO_internal"},
{0, NULL}
};
diff --git a/lib/libcrypto/x509/x509_lu.c b/lib/libcrypto/x509/x509_lu.c
index d8d0bb41476..6cde29fefcf 100644
--- a/lib/libcrypto/x509/x509_lu.c
+++ b/lib/libcrypto/x509/x509_lu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_lu.c,v 1.22 2016/11/13 08:47:54 miod Exp $ */
+/* $OpenBSD: x509_lu.c,v 1.23 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -349,7 +349,7 @@ X509_STORE_add_cert(X509_STORE *ctx, X509 *x)
return 0;
obj = malloc(sizeof(X509_OBJECT));
if (obj == NULL) {
- X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
obj->type = X509_LU_X509;
@@ -360,13 +360,11 @@ X509_STORE_add_cert(X509_STORE *ctx, X509 *x)
X509_OBJECT_up_ref_count(obj);
if (X509_OBJECT_retrieve_match(ctx->objs, obj)) {
- X509err(X509_F_X509_STORE_ADD_CERT,
- X509_R_CERT_ALREADY_IN_HASH_TABLE);
+ X509error(X509_R_CERT_ALREADY_IN_HASH_TABLE);
ret = 0;
} else {
if (sk_X509_OBJECT_push(ctx->objs, obj) == 0) {
- X509err(X509_F_X509_STORE_ADD_CERT,
- ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
ret = 0;
}
}
@@ -394,7 +392,7 @@ X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)
return 0;
obj = malloc(sizeof(X509_OBJECT));
if (obj == NULL) {
- X509err(X509_F_X509_STORE_ADD_CRL, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
obj->type = X509_LU_CRL;
@@ -405,13 +403,11 @@ X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)
X509_OBJECT_up_ref_count(obj);
if (X509_OBJECT_retrieve_match(ctx->objs, obj)) {
- X509err(X509_F_X509_STORE_ADD_CRL,
- X509_R_CERT_ALREADY_IN_HASH_TABLE);
+ X509error(X509_R_CERT_ALREADY_IN_HASH_TABLE);
ret = 0;
} else {
if (sk_X509_OBJECT_push(ctx->objs, obj) == 0) {
- X509err(X509_F_X509_STORE_ADD_CRL,
- ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
ret = 0;
}
}
@@ -678,8 +674,7 @@ X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
if (ok != X509_LU_X509) {
if (ok == X509_LU_RETRY) {
X509_OBJECT_free_contents(&obj);
- X509err(X509_F_X509_STORE_CTX_GET1_ISSUER,
- X509_R_SHOULD_RETRY);
+ X509error(X509_R_SHOULD_RETRY);
return -1;
} else if (ok != X509_LU_FAIL) {
X509_OBJECT_free_contents(&obj);
diff --git a/lib/libcrypto/x509/x509_obj.c b/lib/libcrypto/x509/x509_obj.c
index f7f2a380a11..b34f25b0134 100644
--- a/lib/libcrypto/x509/x509_obj.c
+++ b/lib/libcrypto/x509/x509_obj.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_obj.c,v 1.16 2014/07/11 08:44:49 jsing Exp $ */
+/* $OpenBSD: x509_obj.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -172,7 +172,7 @@ X509_NAME_oneline(X509_NAME *a, char *buf, int len)
return (p);
err:
- X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
if (b != NULL)
BUF_MEM_free(b);
return (NULL);
diff --git a/lib/libcrypto/x509/x509_r2x.c b/lib/libcrypto/x509/x509_r2x.c
index 76faa29b7f2..525163bc3e5 100644
--- a/lib/libcrypto/x509/x509_r2x.c
+++ b/lib/libcrypto/x509/x509_r2x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_r2x.c,v 1.10 2015/09/30 17:30:16 jsing Exp $ */
+/* $OpenBSD: x509_r2x.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -74,7 +74,7 @@ X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
X509_NAME *xn;
if ((ret = X509_new()) == NULL) {
- X509err(X509_F_X509_REQ_TO_X509, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
goto err;
}
diff --git a/lib/libcrypto/x509/x509_req.c b/lib/libcrypto/x509/x509_req.c
index e6fc3c5df8d..f87b35c706f 100644
--- a/lib/libcrypto/x509/x509_req.c
+++ b/lib/libcrypto/x509/x509_req.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_req.c,v 1.19 2016/12/30 15:24:51 jsing Exp $ */
+/* $OpenBSD: x509_req.c,v 1.20 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -80,7 +80,7 @@ X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
ret = X509_REQ_new();
if (ret == NULL) {
- X509err(X509_F_X509_TO_X509_REQ, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -133,31 +133,26 @@ X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
ok = 1;
break;
case 0:
- X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY,
- X509_R_KEY_VALUES_MISMATCH);
+ X509error(X509_R_KEY_VALUES_MISMATCH);
break;
case -1:
- X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY,
- X509_R_KEY_TYPE_MISMATCH);
+ X509error(X509_R_KEY_TYPE_MISMATCH);
break;
case -2:
#ifndef OPENSSL_NO_EC
if (k->type == EVP_PKEY_EC) {
- X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY,
- ERR_R_EC_LIB);
+ X509error(ERR_R_EC_LIB);
break;
}
#endif
#ifndef OPENSSL_NO_DH
if (k->type == EVP_PKEY_DH) {
/* No idea */
- X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY,
- X509_R_CANT_CHECK_DH_KEY);
+ X509error(X509_R_CANT_CHECK_DH_KEY);
break;
}
#endif
- X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY,
- X509_R_UNKNOWN_KEY_TYPE);
+ X509error(X509_R_UNKNOWN_KEY_TYPE);
}
EVP_PKEY_free(xk);
diff --git a/lib/libcrypto/x509/x509_trs.c b/lib/libcrypto/x509/x509_trs.c
index 5be7abdf08f..9af74de1ca9 100644
--- a/lib/libcrypto/x509/x509_trs.c
+++ b/lib/libcrypto/x509/x509_trs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_trs.c,v 1.21 2016/11/06 10:31:34 beck Exp $ */
+/* $OpenBSD: x509_trs.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -178,7 +178,7 @@ int
X509_TRUST_set(int *t, int trust)
{
if (X509_TRUST_get_by_id(trust) == -1) {
- X509err(X509_F_X509_TRUST_SET, X509_R_INVALID_TRUST);
+ X509error(X509_R_INVALID_TRUST);
return 0;
}
*t = trust;
@@ -202,14 +202,14 @@ X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
/* Need a new entry */
if (idx == -1) {
if (!(trtmp = malloc(sizeof(X509_TRUST)))) {
- X509err(X509_F_X509_TRUST_ADD, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
trtmp->flags = X509_TRUST_DYNAMIC;
} else {
trtmp = X509_TRUST_get0(idx);
if (trtmp == NULL) {
- X509err(X509_F_X509_TRUST_ADD, X509_R_INVALID_TRUST);
+ X509error(X509_R_INVALID_TRUST);
return 0;
}
}
@@ -246,7 +246,7 @@ err:
free(name_dup);
if (idx == -1)
free(trtmp);
- X509err(X509_F_X509_TRUST_ADD, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
diff --git a/lib/libcrypto/x509/x509_v3.c b/lib/libcrypto/x509/x509_v3.c
index d9ec9c8c14b..446ef319f8a 100644
--- a/lib/libcrypto/x509/x509_v3.c
+++ b/lib/libcrypto/x509/x509_v3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_v3.c,v 1.13 2016/03/21 04:05:33 mmcc Exp $ */
+/* $OpenBSD: x509_v3.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -156,7 +156,7 @@ X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc)
STACK_OF(X509_EXTENSION) *sk = NULL;
if (x == NULL) {
- X509err(X509_F_X509V3_ADD_EXT, ERR_R_PASSED_NULL_PARAMETER);
+ X509error(ERR_R_PASSED_NULL_PARAMETER);
goto err2;
}
@@ -181,7 +181,7 @@ X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc)
return (sk);
err:
- X509err(X509_F_X509V3_ADD_EXT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
err2:
if (new_ex != NULL)
X509_EXTENSION_free(new_ex);
@@ -199,8 +199,7 @@ X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit,
obj = OBJ_nid2obj(nid);
if (obj == NULL) {
- X509err(X509_F_X509_EXTENSION_CREATE_BY_NID,
- X509_R_UNKNOWN_NID);
+ X509error(X509_R_UNKNOWN_NID);
return (NULL);
}
ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data);
@@ -217,8 +216,7 @@ X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, ASN1_OBJECT *obj, int crit,
if ((ex == NULL) || (*ex == NULL)) {
if ((ret = X509_EXTENSION_new()) == NULL) {
- X509err(X509_F_X509_EXTENSION_CREATE_BY_OBJ,
- ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return (NULL);
}
} else
diff --git a/lib/libcrypto/x509/x509_vfy.c b/lib/libcrypto/x509/x509_vfy.c
index 9dba97bbf8a..b81387a2373 100644
--- a/lib/libcrypto/x509/x509_vfy.c
+++ b/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_vfy.c,v 1.59 2017/01/21 01:09:54 beck Exp $ */
+/* $OpenBSD: x509_vfy.c,v 1.60 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -228,8 +228,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
STACK_OF(X509) *sktmp = NULL;
if (ctx->cert == NULL) {
- X509err(X509_F_X509_VERIFY_CERT,
- X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);
+ X509error(X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);
ctx->error = X509_V_ERR_INVALID_CALL;
return -1;
}
@@ -238,8 +237,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
* This X509_STORE_CTX has already been used to verify
* a cert. We cannot do another one.
*/
- X509err(X509_F_X509_VERIFY_CERT,
- ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+ X509error(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
ctx->error = X509_V_ERR_INVALID_CALL;
return -1;
}
@@ -247,8 +245,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
/*
* This X509_STORE_CTX has not been properly initialized.
*/
- X509err(X509_F_X509_VERIFY_CERT,
- ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+ X509error(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
ctx->error = X509_V_ERR_INVALID_CALL;
return -1;
}
@@ -262,7 +259,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
*/
ctx->chain = sk_X509_new_null();
if (ctx->chain == NULL || !sk_X509_push(ctx->chain, ctx->cert)) {
- X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
ctx->error = X509_V_ERR_OUT_OF_MEM;
goto end;
}
@@ -272,7 +269,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
/* We use a temporary STACK so we can chop and hack at it */
if (ctx->untrusted != NULL &&
(sktmp = sk_X509_dup(ctx->untrusted)) == NULL) {
- X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
ctx->error = X509_V_ERR_OUT_OF_MEM;
goto end;
}
@@ -316,8 +313,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
xtmp = find_issuer(ctx, sktmp, x);
if (xtmp != NULL) {
if (!sk_X509_push(ctx->chain, xtmp)) {
- X509err(X509_F_X509_VERIFY_CERT,
- ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
ctx->error = X509_V_ERR_OUT_OF_MEM;
ok = 0;
goto end;
@@ -415,8 +411,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
x = xtmp;
if (!sk_X509_push(ctx->chain, x)) {
X509_free(xtmp);
- X509err(X509_F_X509_VERIFY_CERT,
- ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
ctx->error = X509_V_ERR_OUT_OF_MEM;
ok = 0;
goto end;
@@ -488,7 +483,7 @@ X509_verify_cert(X509_STORE_CTX *ctx)
} else {
if (!sk_X509_push(ctx->chain, chain_ss)) {
X509_free(chain_ss);
- X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
num++;
@@ -1669,7 +1664,7 @@ check_policy(X509_STORE_CTX *ctx)
ret = X509_policy_check(&ctx->tree, &ctx->explicit_policy, ctx->chain,
ctx->param->policies, ctx->param->flags);
if (ret == 0) {
- X509err(X509_F_CHECK_POLICY, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
/* Invalid or inconsistent extensions */
@@ -1941,8 +1936,7 @@ X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
for (i = 0; i < sk_X509_num(chain); i++) {
ktmp = X509_get_pubkey(sk_X509_value(chain, i));
if (ktmp == NULL) {
- X509err(X509_F_X509_GET_PUBKEY_PARAMETERS,
- X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY);
+ X509error(X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY);
return 0;
}
if (!EVP_PKEY_missing_parameters(ktmp))
@@ -1953,8 +1947,7 @@ X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
}
}
if (ktmp == NULL) {
- X509err(X509_F_X509_GET_PUBKEY_PARAMETERS,
- X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN);
+ X509error(X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN);
return 0;
}
@@ -2109,16 +2102,14 @@ X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
X509_PURPOSE *ptmp;
idx = X509_PURPOSE_get_by_id(purpose);
if (idx == -1) {
- X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT,
- X509_R_UNKNOWN_PURPOSE_ID);
+ X509error(X509_R_UNKNOWN_PURPOSE_ID);
return 0;
}
ptmp = X509_PURPOSE_get0(idx);
if (ptmp->trust == X509_TRUST_DEFAULT) {
idx = X509_PURPOSE_get_by_id(def_purpose);
if (idx == -1) {
- X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT,
- X509_R_UNKNOWN_PURPOSE_ID);
+ X509error(X509_R_UNKNOWN_PURPOSE_ID);
return 0;
}
ptmp = X509_PURPOSE_get0(idx);
@@ -2130,8 +2121,7 @@ X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
if (trust) {
idx = X509_TRUST_get_by_id(trust);
if (idx == -1) {
- X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT,
- X509_R_UNKNOWN_TRUST_ID);
+ X509error(X509_R_UNKNOWN_TRUST_ID);
return 0;
}
}
@@ -2150,7 +2140,7 @@ X509_STORE_CTX_new(void)
ctx = calloc(1, sizeof(X509_STORE_CTX));
if (!ctx) {
- X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return NULL;
}
return ctx;
@@ -2258,7 +2248,7 @@ X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
ctx->param = X509_VERIFY_PARAM_new();
if (!ctx->param) {
- X509err(X509_F_X509_STORE_CTX_INIT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
@@ -2275,13 +2265,13 @@ X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
X509_VERIFY_PARAM_lookup("default"));
if (param_ret == 0) {
- X509err(X509_F_X509_STORE_CTX_INIT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
if (CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx,
&(ctx->ex_data)) == 0) {
- X509err(X509_F_X509_STORE_CTX_INIT, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return 0;
}
return 1;
diff --git a/lib/libcrypto/x509/x509name.c b/lib/libcrypto/x509/x509name.c
index 14634013cf7..ef242ce0a5d 100644
--- a/lib/libcrypto/x509/x509name.c
+++ b/lib/libcrypto/x509/x509name.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509name.c,v 1.13 2014/09/29 04:17:24 miod Exp $ */
+/* $OpenBSD: x509name.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -275,7 +275,7 @@ X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set)
goto err;
new_name->set = set;
if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) {
- X509err(X509_F_X509_NAME_ADD_ENTRY, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
goto err;
}
if (inc) {
@@ -300,8 +300,7 @@ X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
obj = OBJ_txt2obj(field, 0);
if (obj == NULL) {
- X509err(X509_F_X509_NAME_ENTRY_CREATE_BY_TXT,
- X509_R_INVALID_FIELD_NAME);
+ X509error(X509_R_INVALID_FIELD_NAME);
ERR_asprintf_error_data("name=%s", field);
return (NULL);
}
@@ -319,8 +318,7 @@ X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,
obj = OBJ_nid2obj(nid);
if (obj == NULL) {
- X509err(X509_F_X509_NAME_ENTRY_CREATE_BY_NID,
- X509_R_UNKNOWN_NID);
+ X509error(X509_R_UNKNOWN_NID);
return (NULL);
}
nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len);
@@ -359,8 +357,7 @@ int
X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj)
{
if ((ne == NULL) || (obj == NULL)) {
- X509err(X509_F_X509_NAME_ENTRY_SET_OBJECT,
- ERR_R_PASSED_NULL_PARAMETER);
+ X509error(ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
ASN1_OBJECT_free(ne->object);
diff --git a/lib/libcrypto/x509/x509spki.c b/lib/libcrypto/x509/x509spki.c
index cd29a8138a9..3a1c37cd864 100644
--- a/lib/libcrypto/x509/x509spki.c
+++ b/lib/libcrypto/x509/x509spki.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509spki.c,v 1.12 2014/07/11 08:44:49 jsing Exp $ */
+/* $OpenBSD: x509spki.c,v 1.13 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -91,13 +91,12 @@ NETSCAPE_SPKI_b64_decode(const char *str, int len)
if (len <= 0)
len = strlen(str);
if (!(spki_der = malloc(len + 1))) {
- X509err(X509_F_NETSCAPE_SPKI_B64_DECODE, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
return NULL;
}
spki_len = EVP_DecodeBlock(spki_der, (const unsigned char *)str, len);
if (spki_len < 0) {
- X509err(X509_F_NETSCAPE_SPKI_B64_DECODE,
- X509_R_BASE64_DECODE_ERROR);
+ X509error(X509_R_BASE64_DECODE_ERROR);
free(spki_der);
return NULL;
}
@@ -119,7 +118,7 @@ NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
der_spki = malloc(der_len);
b64_str = reallocarray(NULL, der_len, 2);
if (!der_spki || !b64_str) {
- X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
+ X509error(ERR_R_MALLOC_FAILURE);
free(der_spki);
free(b64_str);
return NULL;