diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_alt.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_alt.c | 118 |
1 files changed, 68 insertions, 50 deletions
diff --git a/src/lib/libcrypto/x509/x509_alt.c b/src/lib/libcrypto/x509/x509_alt.c index 59fa39fa6b..8981e4c4fb 100644 --- a/src/lib/libcrypto/x509/x509_alt.c +++ b/src/lib/libcrypto/x509/x509_alt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_alt.c,v 1.16 2023/08/30 00:49:32 tb Exp $ */ | 1 | /* $OpenBSD: x509_alt.c,v 1.17 2024/07/13 15:08:58 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project. | 3 | * project. |
| 4 | */ | 4 | */ |
| @@ -74,57 +74,75 @@ static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens); | |||
| 74 | static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); | 74 | static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); |
| 75 | static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); | 75 | static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); |
| 76 | 76 | ||
| 77 | const X509V3_EXT_METHOD v3_alt[] = { | 77 | static const X509V3_EXT_METHOD x509v3_ext_subject_alt_name = { |
| 78 | { | 78 | .ext_nid = NID_subject_alt_name, |
| 79 | .ext_nid = NID_subject_alt_name, | 79 | .ext_flags = 0, |
| 80 | .ext_flags = 0, | 80 | .it = &GENERAL_NAMES_it, |
| 81 | .it = &GENERAL_NAMES_it, | 81 | .ext_new = NULL, |
| 82 | .ext_new = NULL, | 82 | .ext_free = NULL, |
| 83 | .ext_free = NULL, | 83 | .d2i = NULL, |
| 84 | .d2i = NULL, | 84 | .i2d = NULL, |
| 85 | .i2d = NULL, | 85 | .i2s = NULL, |
| 86 | .i2s = NULL, | 86 | .s2i = NULL, |
| 87 | .s2i = NULL, | 87 | .i2v = (X509V3_EXT_I2V)i2v_GENERAL_NAMES, |
| 88 | .i2v = (X509V3_EXT_I2V)i2v_GENERAL_NAMES, | 88 | .v2i = (X509V3_EXT_V2I)v2i_subject_alt, |
| 89 | .v2i = (X509V3_EXT_V2I)v2i_subject_alt, | 89 | .i2r = NULL, |
| 90 | .i2r = NULL, | 90 | .r2i = NULL, |
| 91 | .r2i = NULL, | 91 | .usr_data = NULL, |
| 92 | .usr_data = NULL, | ||
| 93 | }, | ||
| 94 | { | ||
| 95 | .ext_nid = NID_issuer_alt_name, | ||
| 96 | .ext_flags = 0, | ||
| 97 | .it = &GENERAL_NAMES_it, | ||
| 98 | .ext_new = NULL, | ||
| 99 | .ext_free = NULL, | ||
| 100 | .d2i = NULL, | ||
| 101 | .i2d = NULL, | ||
| 102 | .i2s = NULL, | ||
| 103 | .s2i = NULL, | ||
| 104 | .i2v = (X509V3_EXT_I2V)i2v_GENERAL_NAMES, | ||
| 105 | .v2i = (X509V3_EXT_V2I)v2i_issuer_alt, | ||
| 106 | .i2r = NULL, | ||
| 107 | .r2i = NULL, | ||
| 108 | .usr_data = NULL, | ||
| 109 | }, | ||
| 110 | { | ||
| 111 | .ext_nid = NID_certificate_issuer, | ||
| 112 | .ext_flags = 0, | ||
| 113 | .it = &GENERAL_NAMES_it, | ||
| 114 | .ext_new = NULL, | ||
| 115 | .ext_free = NULL, | ||
| 116 | .d2i = NULL, | ||
| 117 | .i2d = NULL, | ||
| 118 | .i2s = NULL, | ||
| 119 | .s2i = NULL, | ||
| 120 | .i2v = (X509V3_EXT_I2V)i2v_GENERAL_NAMES, | ||
| 121 | .v2i = NULL, | ||
| 122 | .i2r = NULL, | ||
| 123 | .r2i = NULL, | ||
| 124 | .usr_data = NULL, | ||
| 125 | }, | ||
| 126 | }; | 92 | }; |
| 127 | 93 | ||
| 94 | const X509V3_EXT_METHOD * | ||
| 95 | x509v3_ext_method_subject_alt_name(void) | ||
| 96 | { | ||
| 97 | return &x509v3_ext_subject_alt_name; | ||
| 98 | } | ||
| 99 | |||
| 100 | static const X509V3_EXT_METHOD x509v3_ext_issuer_alt_name = { | ||
| 101 | .ext_nid = NID_issuer_alt_name, | ||
| 102 | .ext_flags = 0, | ||
| 103 | .it = &GENERAL_NAMES_it, | ||
| 104 | .ext_new = NULL, | ||
| 105 | .ext_free = NULL, | ||
| 106 | .d2i = NULL, | ||
| 107 | .i2d = NULL, | ||
| 108 | .i2s = NULL, | ||
| 109 | .s2i = NULL, | ||
| 110 | .i2v = (X509V3_EXT_I2V)i2v_GENERAL_NAMES, | ||
| 111 | .v2i = (X509V3_EXT_V2I)v2i_issuer_alt, | ||
| 112 | .i2r = NULL, | ||
| 113 | .r2i = NULL, | ||
| 114 | .usr_data = NULL, | ||
| 115 | }; | ||
| 116 | |||
| 117 | const X509V3_EXT_METHOD * | ||
| 118 | x509v3_ext_method_issuer_alt_name(void) | ||
| 119 | { | ||
| 120 | return &x509v3_ext_issuer_alt_name; | ||
| 121 | } | ||
| 122 | |||
| 123 | static const X509V3_EXT_METHOD x509v3_ext_certificate_issuer = { | ||
| 124 | .ext_nid = NID_certificate_issuer, | ||
| 125 | .ext_flags = 0, | ||
| 126 | .it = &GENERAL_NAMES_it, | ||
| 127 | .ext_new = NULL, | ||
| 128 | .ext_free = NULL, | ||
| 129 | .d2i = NULL, | ||
| 130 | .i2d = NULL, | ||
| 131 | .i2s = NULL, | ||
| 132 | .s2i = NULL, | ||
| 133 | .i2v = (X509V3_EXT_I2V)i2v_GENERAL_NAMES, | ||
| 134 | .v2i = NULL, | ||
| 135 | .i2r = NULL, | ||
| 136 | .r2i = NULL, | ||
| 137 | .usr_data = NULL, | ||
| 138 | }; | ||
| 139 | |||
| 140 | const X509V3_EXT_METHOD * | ||
| 141 | x509v3_ext_method_certificate_issuer(void) | ||
| 142 | { | ||
| 143 | return &x509v3_ext_certificate_issuer; | ||
| 144 | } | ||
| 145 | |||
| 128 | STACK_OF(CONF_VALUE) * | 146 | STACK_OF(CONF_VALUE) * |
| 129 | i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, GENERAL_NAMES *gens, | 147 | i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, GENERAL_NAMES *gens, |
| 130 | STACK_OF(CONF_VALUE) *ret) | 148 | STACK_OF(CONF_VALUE) *ret) |
