Go to the documentation of this file.
70 #include "../asn1/internal.h"
71 #include "../internal.h"
72 #include "../lhash/internal.h"
89 static
unsigned global_next_nid =
NUM_NID;
91 static
int obj_next_nid(
void) {
95 ret = global_next_nid++;
103 unsigned char *
data = NULL;
104 char *sn = NULL, *ln = NULL;
120 r->ln =
r->sn = NULL;
126 if (
o->data != NULL) {
132 r->length =
o->length;
169 ret =
a->length -
b->length;
200 if (
a->length <
b->length) {
202 }
else if (
a->length >
b->length) {
218 if (global_added_by_data != NULL) {
221 match = lh_ASN1_OBJECT_retrieve(global_added_by_data,
obj);
232 if (nid_ptr == NULL) {
256 const char *
name = (
const char *)
key;
264 if (global_added_by_short_name != NULL) {
267 template.sn = short_name;
268 match = lh_ASN1_OBJECT_retrieve(global_added_by_short_name, &
template);
280 if (nid_ptr == NULL) {
291 const char *
name = (
const char *)
key;
299 if (global_added_by_long_name != NULL) {
302 template.ln = long_name;
303 match = lh_ASN1_OBJECT_retrieve(global_added_by_long_name, &
template);
314 if (nid_ptr == NULL) {
354 if (global_added_by_nid != NULL) {
358 match = lh_ASN1_OBJECT_retrieve(global_added_by_nid, &
template);
391 const char *short_name,
392 const char *long_name) {
405 len, short_name, long_name);
411 if (!dont_search_names) {
435 int always_return_oid) {
442 if (!always_return_oid) {
475 return a->nid -
b->nid;
483 int i =
a->length -
b->length;
495 return strcmp(
a->sn,
b->sn);
503 return strcmp(
a->ln,
b->ln);
516 if (global_added_by_nid == NULL) {
528 ok = lh_ASN1_OBJECT_insert(global_added_by_nid, &old_object,
obj);
530 ok &= lh_ASN1_OBJECT_insert(global_added_by_data, &old_object,
obj);
532 if (
obj->
sn != NULL) {
533 ok &= lh_ASN1_OBJECT_insert(global_added_by_short_name, &old_object,
obj);
535 if (
obj->
ln != NULL) {
536 ok &= lh_ASN1_OBJECT_insert(global_added_by_long_name, &old_object,
obj);
543 int OBJ_create(
const char *
oid,
const char *short_name,
const char *long_name) {
#define ASN1_OBJECT_FLAG_DYNAMIC_DATA
OPENSSL_EXPORT const ASN1_OBJECT * obj
#define CRYPTO_STATIC_MUTEX_INIT
static uint32_t hash_short_name(const ASN1_OBJECT *obj)
static struct CRYPTO_STATIC_MUTEX global_added_lock
static std::function< Slot &(Slot *)> element
static int OPENSSL_memcmp(const void *s1, const void *s2, size_t n)
static const ASN1_OBJECT kObjects[NUM_NID]
static int cmp_short_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
#define CRYPTO_STATIC_MUTEX_unlock_write
static ASN1_OBJECT * create_object_with_text_oid(int(*get_nid)(void), const char *oid, const char *short_name, const char *long_name)
int OBJ_txt2nid(const char *s)
#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS
#define OPENSSL_PUT_ERROR(library, reason)
unsigned char match[65280+2]
#define OPENSSL_ARRAY_SIZE(array)
static uint32_t hash_long_name(const ASN1_OBJECT *obj)
static int cmp_data(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
const uint8_t * OBJ_get0_data(const ASN1_OBJECT *obj)
static uint32_t hash_data(const ASN1_OBJECT *obj)
static void * OPENSSL_memset(void *dst, int c, size_t n)
static int short_name_cmp(const void *key, const void *element)
static const uint16_t kNIDsInOIDOrder[]
static uint32_t hash_nid(const ASN1_OBJECT *obj)
#define ASN1_OBJECT_FLAG_DYNAMIC
int OBJ_sn2nid(const char *short_name)
static int obj_cmp(const void *key, const void *element)
int OBJ_cbs2nid(const CBS *cbs)
int OBJ_obj2nid(const ASN1_OBJECT *obj)
#define CRYPTO_STATIC_MUTEX_unlock_read
static LHASH_OF(ASN1_OBJECT)
const unsigned char * data
#define CRYPTO_STATIC_MUTEX_lock_write
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
static int obj_add_object(ASN1_OBJECT *obj)
#define OBJ_R_UNKNOWN_NID
int OBJ_obj2txt(char *out, int out_len, const ASN1_OBJECT *obj, int always_return_oid)
const char * OBJ_nid2sn(int nid)
const char * OBJ_nid2ln(int nid)
#define OBJ_R_INVALID_OID_STRING
#define CBB_add_asn1_oid_from_text
int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
static int long_name_cmp(const void *key, const void *element)
ASN1_OBJECT * OBJ_nid2obj(int nid)
static int strlcpy_int(char *dst, const char *src, int dst_size)
#define CBS_asn1_oid_to_text
#define DEFINE_LHASH_OF(type)
UniquePtr< SSL_SESSION > ret
ASN1_OBJECT * OBJ_dup(const ASN1_OBJECT *o)
int OBJ_create(const char *oid, const char *short_name, const char *long_name)
#define CRYPTO_STATIC_MUTEX_lock_read
ASN1_OBJECT * OBJ_txt2obj(const char *s, int dont_search_names)
static int cmp_nid(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
OPENSSL_EXPORT int OBJ_nid2cbb(CBB *out, int nid)
static int cmp_long_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
size_t OBJ_length(const ASN1_OBJECT *obj)
int OBJ_ln2nid(const char *long_name)
#define ASN1_OBJECT_create
static const uint16_t kNIDsInLongNameOrder[]
static const uint16_t kNIDsInShortNameOrder[]
#define ERR_R_MALLOC_FAILURE
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:43