Latest update.
This commit is contained in:
+57
-39
@@ -228,20 +228,23 @@ ASN1_OBJECT *OBJ_nid2obj(int n)
|
||||
return NULL;
|
||||
}
|
||||
return (ASN1_OBJECT *)&(nid_objs[n]);
|
||||
} else if (added == NULL)
|
||||
return NULL;
|
||||
else {
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return adp->obj;
|
||||
else {
|
||||
OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we've loaded config before checking for any "added" objects */
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
||||
|
||||
if (added == NULL)
|
||||
return NULL;
|
||||
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return adp->obj;
|
||||
|
||||
OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *OBJ_nid2sn(int n)
|
||||
@@ -255,20 +258,23 @@ const char *OBJ_nid2sn(int n)
|
||||
return NULL;
|
||||
}
|
||||
return nid_objs[n].sn;
|
||||
} else if (added == NULL)
|
||||
return NULL;
|
||||
else {
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return adp->obj->sn;
|
||||
else {
|
||||
OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we've loaded config before checking for any "added" objects */
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
||||
|
||||
if (added == NULL)
|
||||
return NULL;
|
||||
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return adp->obj->sn;
|
||||
|
||||
OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *OBJ_nid2ln(int n)
|
||||
@@ -282,20 +288,23 @@ const char *OBJ_nid2ln(int n)
|
||||
return NULL;
|
||||
}
|
||||
return nid_objs[n].ln;
|
||||
} else if (added == NULL)
|
||||
return NULL;
|
||||
else {
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return adp->obj->ln;
|
||||
else {
|
||||
OBJerr(OBJ_F_OBJ_NID2LN, OBJ_R_UNKNOWN_NID);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we've loaded config before checking for any "added" objects */
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
||||
|
||||
if (added == NULL)
|
||||
return NULL;
|
||||
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return adp->obj->ln;
|
||||
|
||||
OBJerr(OBJ_F_OBJ_NID2LN, OBJ_R_UNKNOWN_NID);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
|
||||
@@ -327,6 +336,9 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
|
||||
if (a->length == 0)
|
||||
return NID_undef;
|
||||
|
||||
/* Make sure we've loaded config before checking for any "added" objects */
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
||||
|
||||
if (added != NULL) {
|
||||
ad.type = ADDED_DATA;
|
||||
ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
|
||||
@@ -544,6 +556,9 @@ int OBJ_ln2nid(const char *s)
|
||||
ADDED_OBJ ad, *adp;
|
||||
const unsigned int *op;
|
||||
|
||||
/* Make sure we've loaded config before checking for any "added" objects */
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
||||
|
||||
o.ln = s;
|
||||
if (added != NULL) {
|
||||
ad.type = ADDED_LNAME;
|
||||
@@ -565,6 +580,9 @@ int OBJ_sn2nid(const char *s)
|
||||
ADDED_OBJ ad, *adp;
|
||||
const unsigned int *op;
|
||||
|
||||
/* Make sure we've loaded config before checking for any "added" objects */
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
||||
|
||||
o.sn = s;
|
||||
if (added != NULL) {
|
||||
ad.type = ADDED_SNAME;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -13,19 +13,6 @@
|
||||
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
static const ERR_STRING_DATA OBJ_str_functs[] = {
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_ADD_OBJECT, 0), "OBJ_add_object"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_ADD_SIGID, 0), "OBJ_add_sigid"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_CREATE, 0), "OBJ_create"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_DUP, 0), "OBJ_dup"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_NAME_NEW_INDEX, 0), "OBJ_NAME_new_index"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_NID2LN, 0), "OBJ_nid2ln"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_NID2OBJ, 0), "OBJ_nid2obj"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_NID2SN, 0), "OBJ_nid2sn"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_TXT2OBJ, 0), "OBJ_txt2obj"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static const ERR_STRING_DATA OBJ_str_reasons[] = {
|
||||
{ERR_PACK(ERR_LIB_OBJ, 0, OBJ_R_OID_EXISTS), "oid exists"},
|
||||
{ERR_PACK(ERR_LIB_OBJ, 0, OBJ_R_UNKNOWN_NID), "unknown nid"},
|
||||
@@ -37,10 +24,8 @@ static const ERR_STRING_DATA OBJ_str_reasons[] = {
|
||||
int ERR_load_OBJ_strings(void)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
if (ERR_func_error_string(OBJ_str_functs[0].error) == NULL) {
|
||||
ERR_load_strings_const(OBJ_str_functs);
|
||||
if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
|
||||
ERR_load_strings_const(OBJ_str_reasons);
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user