summaryrefslogtreecommitdiffstats
path: root/crypto/x509
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509')
-rw-r--r--crypto/x509/by_dir.c26
-rw-r--r--crypto/x509/by_file.c30
-rw-r--r--crypto/x509/pcy_cache.c8
-rw-r--r--crypto/x509/pcy_data.c4
-rw-r--r--crypto/x509/pcy_node.c10
-rw-r--r--crypto/x509/pcy_tree.c4
-rw-r--r--crypto/x509/t_crl.c2
-rw-r--r--crypto/x509/t_req.c6
-rw-r--r--crypto/x509/t_x509.c4
-rw-r--r--crypto/x509/v3_addr.c37
-rw-r--r--crypto/x509/v3_akey.c13
-rw-r--r--crypto/x509/v3_alt.c40
-rw-r--r--crypto/x509/v3_asid.c46
-rw-r--r--crypto/x509/v3_bcons.c4
-rw-r--r--crypto/x509/v3_bitst.c7
-rw-r--r--crypto/x509/v3_conf.c27
-rw-r--r--crypto/x509/v3_cpols.c46
-rw-r--r--crypto/x509/v3_crld.c17
-rw-r--r--crypto/x509/v3_extku.c4
-rw-r--r--crypto/x509/v3_ia5.c7
-rw-r--r--crypto/x509/v3_info.c14
-rw-r--r--crypto/x509/v3_ist.c14
-rw-r--r--crypto/x509/v3_lib.c15
-rw-r--r--crypto/x509/v3_ncons.c4
-rw-r--r--crypto/x509/v3_pci.c40
-rw-r--r--crypto/x509/v3_pcons.c7
-rw-r--r--crypto/x509/v3_pmaps.c8
-rw-r--r--crypto/x509/v3_purp.c18
-rw-r--r--crypto/x509/v3_skey.c10
-rw-r--r--crypto/x509/v3_sxnet.c17
-rw-r--r--crypto/x509/v3_tlsf.c6
-rw-r--r--crypto/x509/v3_utf8.c10
-rw-r--r--crypto/x509/v3_utl.c36
-rw-r--r--crypto/x509/x509_att.c17
-rw-r--r--crypto/x509/x509_cmp.c12
-rw-r--r--crypto/x509/x509_lu.c26
-rw-r--r--crypto/x509/x509_meth.c2
-rw-r--r--crypto/x509/x509_obj.c6
-rw-r--r--crypto/x509/x509_r2x.c2
-rw-r--r--crypto/x509/x509_req.c14
-rw-r--r--crypto/x509/x509_set.c6
-rw-r--r--crypto/x509/x509_trs.c10
-rw-r--r--crypto/x509/x509_v3.c9
-rw-r--r--crypto/x509/x509_vfy.c77
-rw-r--r--crypto/x509/x509_vpm.c2
-rw-r--r--crypto/x509/x509name.c9
-rw-r--r--crypto/x509/x509spki.c6
-rw-r--r--crypto/x509/x_all.c6
-rw-r--r--crypto/x509/x_crl.c4
-rw-r--r--crypto/x509/x_name.c20
-rw-r--r--crypto/x509/x_pubkey.c27
-rw-r--r--crypto/x509/x_x509.c2
52 files changed, 369 insertions, 429 deletions
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c
index b67b6c5648..a13aa82403 100644
--- a/crypto/x509/by_dir.c
+++ b/crypto/x509/by_dir.c
@@ -87,7 +87,7 @@ static int 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);
+ ERR_raise(ERR_LIB_X509, X509_R_LOADING_CERT_DIR);
}
} else
ret = add_cert_dir(ld, argp, (int)argl);
@@ -101,19 +101,19 @@ static int new_dir(X509_LOOKUP *lu)
BY_DIR *a = OPENSSL_malloc(sizeof(*a));
if (a == NULL) {
- X509err(X509_F_NEW_DIR, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
return 0;
}
if ((a->buffer = BUF_MEM_new()) == NULL) {
- X509err(X509_F_NEW_DIR, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
goto err;
}
a->dirs = NULL;
a->lock = CRYPTO_THREAD_lock_new();
if (a->lock == NULL) {
BUF_MEM_free(a->buffer);
- X509err(X509_F_NEW_DIR, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
goto err;
}
lu->method_data = a;
@@ -163,7 +163,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
const char *s, *ss, *p;
if (dir == NULL || *dir == '\0') {
- X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);
+ ERR_raise(ERR_LIB_X509, X509_R_INVALID_DIRECTORY);
return 0;
}
@@ -188,13 +188,13 @@ static int 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);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
return 0;
}
}
ent = OPENSSL_malloc(sizeof(*ent));
if (ent == NULL) {
- X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
return 0;
}
ent->dir_type = type;
@@ -206,7 +206,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
}
if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
by_dir_entry_free(ent);
- X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
return 0;
}
}
@@ -243,12 +243,12 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
stmp.data.crl = &data.crl;
postfix = "r";
} else {
- X509err(0, X509_R_WRONG_LOOKUP_TYPE);
+ ERR_raise(ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE);
goto finish;
}
if ((b = BUF_MEM_new()) == NULL) {
- X509err(0, ERR_R_BUF_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
goto finish;
}
@@ -263,7 +263,7 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
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(0, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
goto finish;
}
if (type == X509_LU_CRL && ent->hashes) {
@@ -360,7 +360,7 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
hent = OPENSSL_malloc(sizeof(*hent));
if (hent == NULL) {
CRYPTO_THREAD_unlock(ctx->lock);
- X509err(0, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
ok = 0;
goto finish;
}
@@ -369,7 +369,7 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) {
CRYPTO_THREAD_unlock(ctx->lock);
OPENSSL_free(hent);
- X509err(0, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
ok = 0;
goto finish;
}
diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c
index 16d2971731..eed902b649 100644
--- a/crypto/x509/by_file.c
+++ b/crypto/x509/by_file.c
@@ -65,7 +65,7 @@ static int by_file_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argp,
X509_FILETYPE_PEM, libctx, propq) != 0);
if (!ok) {
- X509err(0, X509_R_LOADING_DEFAULTS);
+ ERR_raise(ERR_LIB_X509, X509_R_LOADING_DEFAULTS);
}
} else {
if (argl == X509_FILETYPE_PEM)
@@ -97,17 +97,17 @@ int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
in = BIO_new(BIO_s_file());
if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) {
- X509err(0, ERR_R_SYS_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_SYS_LIB);
goto err;
}
if (type != X509_FILETYPE_PEM && type != X509_FILETYPE_ASN1) {
- X509err(0, X509_R_BAD_X509_FILETYPE);
+ ERR_raise(ERR_LIB_X509, X509_R_BAD_X509_FILETYPE);
goto err;
}
x = X509_new_ex(libctx, propq);
if (x == NULL) {
- X509err(0, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -119,7 +119,7 @@ int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
ERR_clear_error();
break;
} else {
- X509err(0, ERR_R_PEM_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_PEM_LIB);
goto err;
}
}
@@ -133,7 +133,7 @@ int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
ret = count;
} else if (type == X509_FILETYPE_ASN1) {
if (d2i_X509_bio(in, &x) == NULL) {
- X509err(0, ERR_R_ASN1_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
goto err;
}
i = X509_STORE_add_cert(ctx->store_ctx, x);
@@ -142,7 +142,7 @@ int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
ret = i;
}
if (ret == 0)
- X509err(0, X509_R_NO_CERTIFICATE_FOUND);
+ ERR_raise(ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND);
err:
X509_free(x);
BIO_free(in);
@@ -164,7 +164,7 @@ int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
in = BIO_new(BIO_s_file());
if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) {
- X509err(X509_F_X509_LOAD_CRL_FILE, ERR_R_SYS_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_SYS_LIB);
goto err;
}
@@ -177,7 +177,7 @@ int 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);
+ ERR_raise(ERR_LIB_X509, ERR_R_PEM_LIB);
goto err;
}
}
@@ -192,7 +192,7 @@ int 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);
+ ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
goto err;
}
i = X509_STORE_add_crl(ctx->store_ctx, x);
@@ -200,11 +200,11 @@ int 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);
+ ERR_raise(ERR_LIB_X509, X509_R_BAD_X509_FILETYPE);
goto err;
}
if (ret == 0)
- X509err(X509_F_X509_LOAD_CRL_FILE, X509_R_NO_CRL_FOUND);
+ ERR_raise(ERR_LIB_X509, X509_R_NO_CRL_FOUND);
err:
X509_CRL_free(x);
BIO_free(in);
@@ -223,13 +223,13 @@ int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
return X509_load_cert_file_ex(ctx, file, type, libctx, propq);
in = BIO_new_file(file, "r");
if (!in) {
- X509err(0, ERR_R_SYS_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_SYS_LIB);
return 0;
}
inf = PEM_X509_INFO_read_bio_ex(in, NULL, NULL, "", libctx, propq);
BIO_free(in);
if (!inf) {
- X509err(0, ERR_R_PEM_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_PEM_LIB);
return 0;
}
for (i = 0; i < sk_X509_INFO_num(inf); i++) {
@@ -246,7 +246,7 @@ int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
}
}
if (count == 0)
- X509err(0, X509_R_NO_CERTIFICATE_OR_CRL_FOUND);
+ ERR_raise(ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND);
err:
sk_X509_INFO_pop_free(inf, X509_INFO_free);
return count;
diff --git a/crypto/x509/pcy_cache.c b/crypto/x509/pcy_cache.c
index 608ccfeb1c..cc7aaba1e9 100644
--- a/crypto/x509/pcy_cache.c
+++ b/crypto/x509/pcy_cache.c
@@ -35,14 +35,14 @@ static int policy_cache_create(X509 *x,
goto bad_policy;
cache->data = sk_X509_POLICY_DATA_new(policy_data_cmp);
if (cache->data == NULL) {
- X509V3err(X509V3_F_POLICY_CACHE_CREATE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto just_cleanup;
}
for (i = 0; i < num; i++) {
policy = sk_POLICYINFO_value(policies, i);
data = policy_data_new(policy, NULL, crit);
if (data == NULL) {
- X509V3err(X509V3_F_POLICY_CACHE_CREATE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto just_cleanup;
}
/*
@@ -58,7 +58,7 @@ static int policy_cache_create(X509 *x,
ret = -1;
goto bad_policy;
} else if (!sk_X509_POLICY_DATA_push(cache->data, data)) {
- X509V3err(X509V3_F_POLICY_CACHE_CREATE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto bad_policy;
}
data = NULL;
@@ -91,7 +91,7 @@ static int policy_cache_new(X509 *x)
return 1;
cache = OPENSSL_malloc(sizeof(*cache));
if (cache == NULL) {
- X509V3err(X509V3_F_POLICY_CACHE_NEW, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
return 0;
}
cache->anyPolicy = NULL;
diff --git a/crypto/x509/pcy_data.c b/crypto/x509/pcy_data.c
index 9499f94dff..584ac1c2dd 100644
--- a/crypto/x509/pcy_data.c
+++ b/crypto/x509/pcy_data.c
@@ -52,14 +52,14 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy,
ret = OPENSSL_zalloc(sizeof(*ret));
if (ret == NULL) {
ASN1_OBJECT_free(id);
- X509V3err(X509V3_F_POLICY_DATA_NEW, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
return NULL;
}
ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
if (ret->expected_policy_set == NULL) {
OPENSSL_free(ret);
ASN1_OBJECT_free(id);
- X509V3err(X509V3_F_POLICY_DATA_NEW, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
return NULL;
}
diff --git a/crypto/x509/pcy_node.c b/crypto/x509/pcy_node.c
index d2b43814bd..75207e0a10 100644
--- a/crypto/x509/pcy_node.c
+++ b/crypto/x509/pcy_node.c
@@ -65,7 +65,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
node = OPENSSL_zalloc(sizeof(*node));
if (node == NULL) {
- X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
return NULL;
}
node->data = data;
@@ -80,11 +80,11 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
if (level->nodes == NULL)
level->nodes = policy_node_cmp_new();
if (level->nodes == NULL) {
- X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto node_error;
}
if (!sk_X509_POLICY_NODE_push(level->nodes, node)) {
- X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto node_error;
}
}
@@ -94,11 +94,11 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
if (tree->extra_data == NULL)
tree->extra_data = sk_X509_POLICY_DATA_new_null();
if (tree->extra_data == NULL){
- X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto node_error;
}
if (!sk_X509_POLICY_DATA_push(tree->extra_data, data)) {
- X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto node_error;
}
}
diff --git a/crypto/x509/pcy_tree.c b/crypto/x509/pcy_tree.c
index 3ee30745d2..12cfb627fe 100644
--- a/crypto/x509/pcy_tree.c
+++ b/crypto/x509/pcy_tree.c
@@ -159,7 +159,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
/* If we get this far initialize the tree */
if ((tree = OPENSSL_zalloc(sizeof(*tree))) == NULL) {
- X509V3err(X509V3_F_TREE_INIT, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
return X509_PCY_TREE_INTERNAL;
}
@@ -172,7 +172,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
*/
if ((tree->levels = OPENSSL_zalloc(sizeof(*tree->levels)*(n+1))) == NULL) {
OPENSSL_free(tree);
- X509V3err(X509V3_F_TREE_INIT, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
return X509_PCY_TREE_INTERNAL;
}
tree->nlevel = n+1;
diff --git a/crypto/x509/t_crl.c b/crypto/x509/t_crl.c
index 44be2f237b..b9bffbb0c6 100644
--- a/crypto/x509/t_crl.c
+++ b/crypto/x509/t_crl.c
@@ -22,7 +22,7 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
int ret;
if ((b = BIO_new(BIO_s_file())) == NULL) {
- X509err(X509_F_X509_CRL_PRINT_FP, ERR_R_BUF_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
return 0;
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
diff --git a/crypto/x509/t_req.c b/crypto/x509/t_req.c
index abcca0a8f5..1f50a0a1e2 100644
--- a/crypto/x509/t_req.c
+++ b/crypto/x509/t_req.c
@@ -24,7 +24,7 @@ int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
int ret;
if ((b = BIO_new(BIO_s_file())) == NULL) {
- X509err(X509_F_X509_REQ_PRINT_FP, ERR_R_BUF_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
return 0;
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
@@ -128,7 +128,7 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
ii = 0;
count = X509_ATTRIBUTE_count(a);
if (count == 0) {
- X509err(X509_F_X509_REQ_PRINT_EX, X509_R_INVALID_ATTRIBUTES);
+ ERR_raise(ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES);
return 0;
}
get_next:
@@ -204,7 +204,7 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
return 1;
err:
- X509err(X509_F_X509_REQ_PRINT_EX, ERR_R_BUF_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
return 0;
}
diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c
index 2d0ccd8a68..9636756b66 100644
--- a/crypto/x509/t_x509.c
+++ b/crypto/x509/t_x509.c
@@ -30,7 +30,7 @@ int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag,
int ret;
if ((b = BIO_new(BIO_s_file())) == NULL) {
- X509err(X509_F_X509_PRINT_EX_FP, ERR_R_BUF_LIB);
+ ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
return 0;
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
@@ -509,7 +509,7 @@ int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx)
BIO_printf(bio, "Certs in trust store:\n");
print_store_certs(bio, X509_STORE_CTX_get0_store(ctx));
}
- X509err(0, X509_R_CERTIFICATE_VERIFICATION_FAILED);
+ ERR_raise(ERR_LIB_X509, X509_R_CERTIFICATE_VERIFICATION_FAILED);
ERR_add_error_mem_bio("\n", bio);
BIO_free(bio);
}
diff --git a/crypto/x509/v3_addr.c b/crypto/x509/v3_addr.c
index 7d4e99be5a..ae4978409b 100644
--- a/crypto/x509/v3_addr.c
+++ b/crypto/x509/v3_addr.c
@@ -897,7 +897,7 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
int i;
if ((addr = sk_IPAddressFamily_new(IPAddressFamily_cmp)) == NULL) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
return NULL;
}
@@ -919,7 +919,7 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
afi = IANA_AFI_IPV6;
safi = &safi_;
} else {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
+ ERR_raise(ERR_LIB_X509V3,
X509V3_R_EXTENSION_NAME_ERROR);
ERR_add_error_data(1, val->name);
goto err;
@@ -944,7 +944,7 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
*safi = strtoul(val->value, &t, 0);
t += strspn(t, " \t");
if (*safi > 0xFF || *t++ != ':') {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_SAFI);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_SAFI);
X509V3_conf_add_error_name_value(val);
goto err;
}
@@ -954,7 +954,7 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
s = OPENSSL_strdup(val->value);
}
if (s == NULL) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -964,8 +964,7 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
*/
if (strcmp(s, "inherit") == 0) {
if (!X509v3_addr_add_inherit(addr, afi, safi)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_INVALID_INHERITANCE);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE);
X509V3_conf_add_error_name_value(val);
goto err;
}
@@ -980,7 +979,7 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
s[i1] = '\0';
if (a2i_ipadd(min, s) != length) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_IPADDRESS);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS);
X509V3_conf_add_error_name_value(val);
goto err;
}
@@ -989,13 +988,12 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
case '/':
prefixlen = (int)strtoul(s + i2, &t, 10);
if (t == s + i2 || *t != '\0') {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_add_error_name_value(val);
goto err;
}
if (!X509v3_addr_add_prefix(addr, afi, safi, min, prefixlen)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto err;
}
break;
@@ -1003,37 +1001,33 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
i1 = i2 + strspn(s + i2, " \t");
i2 = i1 + strspn(s + i1, addr_chars);
if (i1 == i2 || s[i2] != '\0') {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_add_error_name_value(val);
goto err;
}
if (a2i_ipadd(max, s + i1) != length) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_INVALID_IPADDRESS);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS);
X509V3_conf_add_error_name_value(val);
goto err;
}
if (memcmp(min, max, length_from_afi(afi)) > 0) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_add_error_name_value(val);
goto err;
}
if (!X509v3_addr_add_range(addr, afi, safi, min, max)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto err;
}
break;
case '\0':
if (!X509v3_addr_add_prefix(addr, afi, safi, min, length * 8)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
goto err;
}
break;
default:
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_add_error_name_value(val);
goto err;