diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-12-08 19:09:35 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-12-08 19:09:35 +0000 |
commit | 9d6b1ce6441c7cc6aed344f02d9f676ab5e04217 (patch) | |
tree | 7329435a21d3289cb3caad6d3d6c065f484373e1 /crypto/pkcs12 | |
parent | 66ebbb6a56bc1688fa37878e4feec985b0c260d7 (diff) | |
download | openssl-new-9d6b1ce6441c7cc6aed344f02d9f676ab5e04217.tar.gz |
Merge from the ASN1 branch of new ASN1 code
to main trunk.
Lets see if the makes it to openssl-cvs :-)
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r-- | crypto/pkcs12/Makefile.ssl | 117 | ||||
-rw-r--r-- | crypto/pkcs12/p12_asn.c | 114 | ||||
-rw-r--r-- | crypto/pkcs12/p12_attr.c | 6 | ||||
-rw-r--r-- | crypto/pkcs12/pkcs12.h | 25 |
4 files changed, 150 insertions, 112 deletions
diff --git a/crypto/pkcs12/Makefile.ssl b/crypto/pkcs12/Makefile.ssl index 4ed1b2654f..794185354e 100644 --- a/crypto/pkcs12/Makefile.ssl +++ b/crypto/pkcs12/Makefile.ssl @@ -22,12 +22,12 @@ TEST= APPS= LIB=$(TOP)/libcrypto.a -LIBSRC= p12_add.c p12_attr.c p12_bags.c p12_crpt.c p12_crt.c p12_decr.c \ - p12_init.c p12_key.c p12_kiss.c p12_lib.c p12_mac.c p12_mutl.c\ - p12_sbag.c p12_utl.c p12_npas.c pk12err.c -LIBOBJ= p12_add.o p12_attr.o p12_bags.o p12_crpt.o p12_crt.o p12_decr.o \ - p12_init.o p12_key.o p12_kiss.o p12_lib.o p12_mac.o p12_mutl.o\ - p12_sbag.o p12_utl.o p12_npas.o pk12err.o +LIBSRC= p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c p12_decr.c \ + p12_init.c p12_key.c p12_kiss.c p12_mutl.c\ + p12_utl.c p12_npas.c pk12err.c +LIBOBJ= p12_add.o p12_asn.o p12_attr.o p12_crpt.o p12_crt.o p12_decr.o \ + p12_init.o p12_key.o p12_kiss.o p12_mutl.o\ + p12_utl.o p12_npas.o pk12err.o SRC= $(LIBSRC) @@ -105,6 +105,27 @@ p12_add.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h p12_add.o: ../../include/openssl/sha.h ../../include/openssl/stack.h p12_add.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h p12_add.o: ../../include/openssl/x509_vfy.h ../cryptlib.h +p12_asn.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h +p12_asn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h +p12_asn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +p12_asn.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h +p12_asn.o: ../../include/openssl/des.h ../../include/openssl/dh.h +p12_asn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h +p12_asn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +p12_asn.o: ../../include/openssl/evp.h ../../include/openssl/idea.h +p12_asn.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h +p12_asn.o: ../../include/openssl/md4.h ../../include/openssl/md5.h +p12_asn.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h +p12_asn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +p12_asn.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h +p12_asn.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h +p12_asn.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +p12_asn.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h +p12_asn.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +p12_asn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +p12_asn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +p12_asn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h +p12_asn.o: ../cryptlib.h p12_attr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h p12_attr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h p12_attr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h @@ -126,27 +147,6 @@ p12_attr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h p12_attr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h p12_attr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h p12_attr.o: ../cryptlib.h -p12_bags.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h -p12_bags.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -p12_bags.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -p12_bags.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -p12_bags.o: ../../include/openssl/des.h ../../include/openssl/dh.h -p12_bags.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -p12_bags.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -p12_bags.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -p12_bags.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -p12_bags.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -p12_bags.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -p12_bags.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -p12_bags.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h -p12_bags.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -p12_bags.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -p12_bags.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -p12_bags.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -p12_bags.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -p12_bags.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -p12_bags.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -p12_bags.o: ../cryptlib.h p12_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h p12_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h p12_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h @@ -271,48 +271,6 @@ p12_kiss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h p12_kiss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h p12_kiss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h p12_kiss.o: ../cryptlib.h -p12_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h -p12_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -p12_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -p12_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -p12_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h -p12_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -p12_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -p12_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -p12_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -p12_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -p12_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -p12_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -p12_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h -p12_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -p12_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -p12_lib.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -p12_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -p12_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -p12_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -p12_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -p12_lib.o: ../cryptlib.h -p12_mac.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h -p12_mac.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -p12_mac.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -p12_mac.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -p12_mac.o: ../../include/openssl/des.h ../../include/openssl/dh.h -p12_mac.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -p12_mac.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -p12_mac.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -p12_mac.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -p12_mac.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -p12_mac.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -p12_mac.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -p12_mac.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h -p12_mac.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -p12_mac.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -p12_mac.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -p12_mac.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -p12_mac.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -p12_mac.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -p12_mac.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -p12_mac.o: ../cryptlib.h p12_mutl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h p12_mutl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h p12_mutl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h @@ -354,27 +312,6 @@ p12_npas.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h p12_npas.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h p12_npas.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h p12_npas.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -p12_sbag.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h -p12_sbag.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -p12_sbag.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -p12_sbag.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -p12_sbag.o: ../../include/openssl/des.h ../../include/openssl/dh.h -p12_sbag.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -p12_sbag.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -p12_sbag.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -p12_sbag.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -p12_sbag.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -p12_sbag.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -p12_sbag.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -p12_sbag.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h -p12_sbag.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -p12_sbag.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -p12_sbag.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -p12_sbag.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -p12_sbag.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -p12_sbag.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -p12_sbag.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -p12_sbag.o: ../cryptlib.h p12_utl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h p12_utl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h p12_utl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h diff --git a/crypto/pkcs12/p12_asn.c b/crypto/pkcs12/p12_asn.c new file mode 100644 index 0000000000..cbee7336d9 --- /dev/null +++ b/crypto/pkcs12/p12_asn.c @@ -0,0 +1,114 @@ +/* p12_asn.c */ +/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#include <stdio.h> +#include "cryptlib.h" +#include <openssl/asn1t.h> +#include <openssl/pkcs12.h> + +/* PKCS#12 ASN1 module */ + +ASN1_SEQUENCE(PKCS12) = { + ASN1_SIMPLE(PKCS12, version, ASN1_INTEGER), + ASN1_SIMPLE(PKCS12, authsafes, PKCS7), + ASN1_OPT(PKCS12, mac, PKCS12_MAC_DATA) +} ASN1_SEQUENCE_END(PKCS12); + +IMPLEMENT_ASN1_FUNCTIONS(PKCS12) + +ASN1_SEQUENCE(PKCS12_MAC_DATA) = { + ASN1_SIMPLE(PKCS12_MAC_DATA, dinfo, X509_SIG), + ASN1_SIMPLE(PKCS12_MAC_DATA, salt, ASN1_OCTET_STRING), + ASN1_OPT(PKCS12_MAC_DATA, iter, ASN1_INTEGER) +} ASN1_SEQUENCE_END(PKCS12_MAC_DATA); + +IMPLEMENT_ASN1_FUNCTIONS(PKCS12_MAC_DATA) + +ASN1_ADB_TEMPLATE(bag_default) = ASN1_EXP(PKCS12_BAGS, value.other, ASN1_ANY, 0); + +ASN1_ADB(PKCS12_BAGS) = { + ADB_ENTRY(NID_x509Certificate, ASN1_EXP(PKCS12_BAGS, value.x509cert, ASN1_OCTET_STRING, 0)), + ADB_ENTRY(NID_x509Certificate, ASN1_EXP(PKCS12_BAGS, value.x509crl, ASN1_OCTET_STRING, 0)), + ADB_ENTRY(NID_x509Certificate, ASN1_EXP(PKCS12_BAGS, value.sdsicert, ASN1_IA5STRING, 0)), +} ASN1_ADB_END(PKCS12_BAGS, 0, type, 0, &bag_default_tt, NULL); + +ASN1_SEQUENCE(PKCS12_BAGS) = { + ASN1_SIMPLE(PKCS12_BAGS, type, ASN1_OBJECT), + ASN1_ADB_OBJECT(PKCS12_BAGS), +} ASN1_SEQUENCE_END(PKCS12_BAGS); + +IMPLEMENT_ASN1_FUNCTIONS(PKCS12_BAGS) + +ASN1_ADB_TEMPLATE(safebag_default) = ASN1_EXP(PKCS12_SAFEBAG, value.other, ASN1_ANY, 0); + +ASN1_ADB(PKCS12_SAFEBAG) = { + ADB_ENTRY(NID_keyBag, ASN1_EXP(PKCS12_SAFEBAG, value.keybag, PKCS8_PRIV_KEY_INFO, 0)), + ADB_ENTRY(NID_pkcs8ShroudedKeyBag, ASN1_EXP(PKCS12_SAFEBAG, value.keybag, X509_SIG, 0)), + ADB_ENTRY(NID_safeContentsBag, ASN1_EXP_SET_OF(PKCS12_SAFEBAG, value.safes, PKCS12_SAFEBAG, 0)), + ADB_ENTRY(NID_certBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)), + ADB_ENTRY(NID_crlBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)), + ADB_ENTRY(NID_secretBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)) +} ASN1_ADB_END(PKCS12_SAFEBAG, 0, type, 0, &safebag_default_tt, NULL); + +ASN1_SEQUENCE(PKCS12_SAFEBAG) = { + ASN1_SIMPLE(PKCS12_SAFEBAG, type, ASN1_OBJECT), + ASN1_ADB_OBJECT(PKCS12_SAFEBAG), + ASN1_SET_OF_OPT(PKCS12_SAFEBAG, attrib, X509_ATTRIBUTE) +} ASN1_SEQUENCE_END(PKCS12_SAFEBAG); + +IMPLEMENT_ASN1_FUNCTIONS(PKCS12_SAFEBAG) diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index f1a210b5d2..64bf4173fc 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -92,7 +92,7 @@ int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name, return 0; } sk_ASN1_TYPE_push (attrib->value.set,keyid); - attrib->set = 1; + attrib->single = 0; if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) { PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); return 0; @@ -134,7 +134,7 @@ int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage) return 0; } sk_ASN1_TYPE_push (attrib->value.set,keyid); - attrib->set = 1; + attrib->single = 0; if (!p8->attributes && !(p8->attributes = sk_X509_ATTRIBUTE_new_null ())) { PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); @@ -201,7 +201,7 @@ int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag, return 0; } sk_ASN1_TYPE_push (attrib->value.set,fname); - attrib->set = 1; + attrib->single = 0; if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) { PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, ERR_R_MALLOC_FAILURE); diff --git a/crypto/pkcs12/pkcs12.h b/crypto/pkcs12/pkcs12.h index 502fceff95..d58a140017 100644 --- a/crypto/pkcs12/pkcs12.h +++ b/crypto/pkcs12/pkcs12.h @@ -120,7 +120,6 @@ union { ASN1_TYPE *other; }value; STACK_OF(X509_ATTRIBUTE) *attrib; -ASN1_TYPE *rest; } PKCS12_SAFEBAG; DECLARE_STACK_OF(PKCS12_SAFEBAG) @@ -249,24 +248,12 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, EVP_MD *md_type); unsigned char *asc2uni(const char *asc, unsigned char **uni, int *unilen); char *uni2asc(unsigned char *uni, int unilen); -int i2d_PKCS12_BAGS(PKCS12_BAGS *a, unsigned char **pp); -PKCS12_BAGS *PKCS12_BAGS_new(void); -PKCS12_BAGS *d2i_PKCS12_BAGS(PKCS12_BAGS **a, unsigned char **pp, long length); -void PKCS12_BAGS_free(PKCS12_BAGS *a); -int i2d_PKCS12(PKCS12 *a, unsigned char **pp); -PKCS12 *d2i_PKCS12(PKCS12 **a, unsigned char **pp, long length); -PKCS12 *PKCS12_new(void); -void PKCS12_free(PKCS12 *a); -int i2d_PKCS12_MAC_DATA(PKCS12_MAC_DATA *a, unsigned char **pp); -PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void); -PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(PKCS12_MAC_DATA **a, unsigned char **pp, - long length); -void PKCS12_MAC_DATA_free(PKCS12_MAC_DATA *a); -int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp); -PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void); -PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp, - long length); -void PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a); + +DECLARE_ASN1_FUNCTIONS(PKCS12) +DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) +DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) +DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS) + void ERR_load_PKCS12_strings(void); void PKCS12_PBE_add(void); int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, |