diff options
Diffstat (limited to 'src/lib/libcrypto')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_prn.c | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/src/lib/libcrypto/x509/x509_prn.c b/src/lib/libcrypto/x509/x509_prn.c index fb502c67ff..8e98d798cd 100644 --- a/src/lib/libcrypto/x509/x509_prn.c +++ b/src/lib/libcrypto/x509/x509_prn.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_prn.c,v 1.9 2026/05/16 06:30:53 tb Exp $ */ | 1 | /* $OpenBSD: x509_prn.c,v 1.10 2026/05/16 07:10:30 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 1999. | 3 | * project 1999. |
| 4 | */ | 4 | */ |
| @@ -66,9 +66,6 @@ | |||
| 66 | 66 | ||
| 67 | /* Extension printing routines */ | 67 | /* Extension printing routines */ |
| 68 | 68 | ||
| 69 | static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, | ||
| 70 | int indent, int supported); | ||
| 71 | |||
| 72 | /* Print out a name+value stack */ | 69 | /* Print out a name+value stack */ |
| 73 | 70 | ||
| 74 | void | 71 | void |
| @@ -102,6 +99,30 @@ X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml) | |||
| 102 | } | 99 | } |
| 103 | LCRYPTO_ALIAS(X509V3_EXT_val_prn); | 100 | LCRYPTO_ALIAS(X509V3_EXT_val_prn); |
| 104 | 101 | ||
| 102 | static int | ||
| 103 | unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, | ||
| 104 | int indent, int supported) | ||
| 105 | { | ||
| 106 | switch (flag & X509V3_EXT_UNKNOWN_MASK) { | ||
| 107 | case X509V3_EXT_DEFAULT: | ||
| 108 | return 0; | ||
| 109 | case X509V3_EXT_ERROR_UNKNOWN: | ||
| 110 | if (supported) | ||
| 111 | BIO_printf(out, "%*s<Parse Error>", indent, ""); | ||
| 112 | else | ||
| 113 | BIO_printf(out, "%*s<Not Supported>", indent, ""); | ||
| 114 | return 1; | ||
| 115 | case X509V3_EXT_PARSE_UNKNOWN: | ||
| 116 | return ASN1_parse_dump(out, | ||
| 117 | ext->value->data, ext->value->length, indent, -1) > 0; | ||
| 118 | case X509V3_EXT_DUMP_UNKNOWN: | ||
| 119 | return BIO_dump_indent(out, (const char *)ext->value->data, | ||
| 120 | ext->value->length, indent) > 0; | ||
| 121 | default: | ||
| 122 | return 1; | ||
| 123 | } | ||
| 124 | } | ||
| 125 | |||
| 105 | /* Main routine: print out a general extension */ | 126 | /* Main routine: print out a general extension */ |
| 106 | 127 | ||
| 107 | int | 128 | int |
| @@ -192,31 +213,6 @@ X509V3_extensions_print(BIO *bp, const char *title, | |||
| 192 | } | 213 | } |
| 193 | LCRYPTO_ALIAS(X509V3_extensions_print); | 214 | LCRYPTO_ALIAS(X509V3_extensions_print); |
| 194 | 215 | ||
| 195 | static int | ||
| 196 | unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, | ||
| 197 | int indent, int supported) | ||
| 198 | { | ||
| 199 | switch (flag & X509V3_EXT_UNKNOWN_MASK) { | ||
| 200 | case X509V3_EXT_DEFAULT: | ||
| 201 | return 0; | ||
| 202 | case X509V3_EXT_ERROR_UNKNOWN: | ||
| 203 | if (supported) | ||
| 204 | BIO_printf(out, "%*s<Parse Error>", indent, ""); | ||
| 205 | else | ||
| 206 | BIO_printf(out, "%*s<Not Supported>", indent, ""); | ||
| 207 | return 1; | ||
| 208 | case X509V3_EXT_PARSE_UNKNOWN: | ||
| 209 | return ASN1_parse_dump(out, | ||
| 210 | ext->value->data, ext->value->length, indent, -1) > 0; | ||
| 211 | case X509V3_EXT_DUMP_UNKNOWN: | ||
| 212 | return BIO_dump_indent(out, (const char *)ext->value->data, | ||
| 213 | ext->value->length, indent) > 0; | ||
| 214 | default: | ||
| 215 | return 1; | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | |||
| 220 | int | 216 | int |
| 221 | X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) | 217 | X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) |
| 222 | { | 218 | { |
