| OLD | NEW |
| 1 /* v3_prn.c */ | 1 /* v3_prn.c */ |
| 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 */ |
| 5 /* ==================================================================== | 5 /* ==================================================================== |
| 6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 /* Main routine: print out a general extension */ | 106 /* Main routine: print out a general extension */ |
| 107 | 107 |
| 108 int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int inde
nt) | 108 int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int inde
nt) |
| 109 { | 109 { |
| 110 void *ext_str = NULL; | 110 void *ext_str = NULL; |
| 111 char *value = NULL; | 111 char *value = NULL; |
| 112 const unsigned char *p; | 112 const unsigned char *p; |
| 113 » X509V3_EXT_METHOD *method;» | 113 » const X509V3_EXT_METHOD *method;» |
| 114 STACK_OF(CONF_VALUE) *nval = NULL; | 114 STACK_OF(CONF_VALUE) *nval = NULL; |
| 115 int ok = 1; | 115 int ok = 1; |
| 116 | 116 |
| 117 if(!(method = X509V3_EXT_get(ext))) | 117 if(!(method = X509V3_EXT_get(ext))) |
| 118 return unknown_ext_print(out, ext, flag, indent, 0); | 118 return unknown_ext_print(out, ext, flag, indent, 0); |
| 119 p = ext->value->data; | 119 p = ext->value->data; |
| 120 if(method->it) ext_str = ASN1_item_d2i(NULL, &p, ext->value->length, ASN
1_ITEM_ptr(method->it)); | 120 if(method->it) ext_str = ASN1_item_d2i(NULL, &p, ext->value->length, ASN
1_ITEM_ptr(method->it)); |
| 121 else ext_str = method->d2i(NULL, &p, ext->value->length); | 121 else ext_str = method->d2i(NULL, &p, ext->value->length); |
| 122 | 122 |
| 123 if(!ext_str) return unknown_ext_print(out, ext, flag, indent, 1); | 123 if(!ext_str) return unknown_ext_print(out, ext, flag, indent, 1); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) | 225 int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) |
| 226 { | 226 { |
| 227 BIO *bio_tmp; | 227 BIO *bio_tmp; |
| 228 int ret; | 228 int ret; |
| 229 if(!(bio_tmp = BIO_new_fp(fp, BIO_NOCLOSE))) return 0; | 229 if(!(bio_tmp = BIO_new_fp(fp, BIO_NOCLOSE))) return 0; |
| 230 ret = X509V3_EXT_print(bio_tmp, ext, flag, indent); | 230 ret = X509V3_EXT_print(bio_tmp, ext, flag, indent); |
| 231 BIO_free(bio_tmp); | 231 BIO_free(bio_tmp); |
| 232 return ret; | 232 return ret; |
| 233 } | 233 } |
| 234 #endif | 234 #endif |
| OLD | NEW |