diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-04-16 12:08:04 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-04-16 12:08:04 +0000 |
commit | 3100886f32816cb3c2201c48e53318eb5881e941 (patch) | |
tree | fceff79a71b278fd644771a6017e34e629944745 /lib/libcrypto/x509 | |
parent | 6f0a4299a9cc05acf85d164f476848b5b7697b9b (diff) |
Shuffle ext_cmp() and ext_list_free() up a bit
Diffstat (limited to 'lib/libcrypto/x509')
-rw-r--r-- | lib/libcrypto/x509/x509_lib.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/lib/libcrypto/x509/x509_lib.c b/lib/libcrypto/x509/x509_lib.c index 57b2b2cb420..cd97b33207c 100644 --- a/lib/libcrypto/x509/x509_lib.c +++ b/lib/libcrypto/x509/x509_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_lib.c,v 1.11 2023/04/16 12:05:31 tb Exp $ */ +/* $OpenBSD: x509_lib.c,v 1.12 2023/04/16 12:08:03 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -67,10 +67,6 @@ static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL; -static int ext_cmp(const X509V3_EXT_METHOD * const *a, - const X509V3_EXT_METHOD * const *b); -static void ext_list_free(X509V3_EXT_METHOD *ext); - extern X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku; extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo; extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id; @@ -147,6 +143,12 @@ static const X509V3_EXT_METHOD *standard_exts[] = { #define STANDARD_EXTENSION_COUNT (sizeof(standard_exts) / sizeof(standard_exts[0])) +static int +ext_cmp(const X509V3_EXT_METHOD * const *a, const X509V3_EXT_METHOD * const *b) +{ + return ((*a)->ext_nid - (*b)->ext_nid); +} + int X509V3_EXT_add(X509V3_EXT_METHOD *ext) { @@ -163,12 +165,6 @@ X509V3_EXT_add(X509V3_EXT_METHOD *ext) LCRYPTO_ALIAS(X509V3_EXT_add); static int -ext_cmp(const X509V3_EXT_METHOD * const *a, const X509V3_EXT_METHOD * const *b) -{ - return ((*a)->ext_nid - (*b)->ext_nid); -} - -static int ext_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) { const X509V3_EXT_METHOD * const *a = a_; @@ -252,6 +248,13 @@ X509V3_EXT_add_alias(int nid_to, int nid_from) } LCRYPTO_ALIAS(X509V3_EXT_add_alias); +static void +ext_list_free(X509V3_EXT_METHOD *ext) +{ + if (ext->ext_flags & X509V3_EXT_DYNAMIC) + free(ext); +} + void X509V3_EXT_cleanup(void) { @@ -260,13 +263,6 @@ X509V3_EXT_cleanup(void) } LCRYPTO_ALIAS(X509V3_EXT_cleanup); -static void -ext_list_free(X509V3_EXT_METHOD *ext) -{ - if (ext->ext_flags & X509V3_EXT_DYNAMIC) - free(ext); -} - int X509V3_add_standard_extensions(void) { |