diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_utl.c')
| -rw-r--r-- | src/lib/libcrypto/pkcs12/p12_utl.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_utl.c b/src/lib/libcrypto/pkcs12/p12_utl.c index 5c15720e21..4fe557f626 100644 --- a/src/lib/libcrypto/pkcs12/p12_utl.c +++ b/src/lib/libcrypto/pkcs12/p12_utl.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: p12_utl.c,v 1.18 2022/08/20 09:16:18 tb Exp $ */ | 1 | /* $OpenBSD: p12_utl.c,v 1.19 2022/09/11 17:30:13 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 | */ |
| @@ -149,46 +149,3 @@ d2i_PKCS12_fp(FILE *fp, PKCS12 **p12) | |||
| 149 | { | 149 | { |
| 150 | return ASN1_item_d2i_fp(&PKCS12_it, fp, p12); | 150 | return ASN1_item_d2i_fp(&PKCS12_it, fp, p12); |
| 151 | } | 151 | } |
| 152 | |||
| 153 | #if !defined(LIBRESSL_NEXT_API) | ||
| 154 | #undef PKCS12_x5092certbag | ||
| 155 | #undef PKCS12_x509crl2certbag | ||
| 156 | #undef PKCS12_certbag2x509 | ||
| 157 | #undef PKCS12_certbag2x509crl | ||
| 158 | |||
| 159 | PKCS12_SAFEBAG * | ||
| 160 | PKCS12_x5092certbag(X509 *x509) | ||
| 161 | { | ||
| 162 | return PKCS12_item_pack_safebag(x509, &X509_it, | ||
| 163 | NID_x509Certificate, NID_certBag); | ||
| 164 | } | ||
| 165 | |||
| 166 | PKCS12_SAFEBAG * | ||
| 167 | PKCS12_x509crl2certbag(X509_CRL *crl) | ||
| 168 | { | ||
| 169 | return PKCS12_item_pack_safebag(crl, &X509_CRL_it, | ||
| 170 | NID_x509Crl, NID_crlBag); | ||
| 171 | } | ||
| 172 | |||
| 173 | X509 * | ||
| 174 | PKCS12_certbag2x509(PKCS12_SAFEBAG *bag) | ||
| 175 | { | ||
| 176 | if (OBJ_obj2nid(bag->type) != NID_certBag) | ||
| 177 | return NULL; | ||
| 178 | if (OBJ_obj2nid(bag->value.bag->type) != NID_x509Certificate) | ||
| 179 | return NULL; | ||
| 180 | return ASN1_item_unpack(bag->value.bag->value.octet, | ||
| 181 | &X509_it); | ||
| 182 | } | ||
| 183 | |||
| 184 | X509_CRL * | ||
| 185 | PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag) | ||
| 186 | { | ||
| 187 | if (OBJ_obj2nid(bag->type) != NID_crlBag) | ||
| 188 | return NULL; | ||
| 189 | if (OBJ_obj2nid(bag->value.bag->type) != NID_x509Crl) | ||
| 190 | return NULL; | ||
| 191 | return ASN1_item_unpack(bag->value.bag->value.octet, | ||
| 192 | &X509_CRL_it); | ||
| 193 | } | ||
| 194 | #endif | ||
