diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-03-29 22:18:54 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-03-29 22:18:54 +0000 |
commit | bc37a6b81c9a5e295481a1dd9ee572a4bddbf5ec (patch) | |
tree | 370def1e5b4597f6ac908edb421bfad02b98feea /crypto/pkcs12 | |
parent | ee0508d4114e2b2291953a7d4c81a09b624b8821 (diff) |
Remove deleted PKCS#12 functions from pkcs12.h, get rid of object creation
kludge, remove CRs from ssl_ciph.c and update Win32 functions for PKCS#12
code. It might compile under Win32 now ...
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r-- | crypto/pkcs12/p12_add.c | 16 | ||||
-rw-r--r-- | crypto/pkcs12/p12_attr.c | 6 | ||||
-rw-r--r-- | crypto/pkcs12/p12_init.c | 2 | ||||
-rw-r--r-- | crypto/pkcs12/p12_mutl.c | 3 | ||||
-rw-r--r-- | crypto/pkcs12/p12_utl.c | 11 | ||||
-rw-r--r-- | crypto/pkcs12/pkcs12.h | 11 |
6 files changed, 12 insertions, 37 deletions
diff --git a/crypto/pkcs12/p12_add.c b/crypto/pkcs12/p12_add.c index 9e3522caeb..1a8eadd011 100644 --- a/crypto/pkcs12/p12_add.c +++ b/crypto/pkcs12/p12_add.c @@ -75,7 +75,7 @@ int nid2; PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); return NULL; } - M_ASN1_OBJECT_set(bag->type, nid1); + bag->type = OBJ_nid2obj(nid1); if (!ASN1_pack_string(obj, i2d, &bag->value.octet)) { PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); return NULL; @@ -85,7 +85,7 @@ int nid2; return NULL; } safebag->value.bag = bag; - M_ASN1_OBJECT_set(safebag->type, nid2); + safebag->type = OBJ_nid2obj(nid2); return safebag; } @@ -99,7 +99,7 @@ PKCS8_PRIV_KEY_INFO *p8; PKCS12err(PKCS12_F_PKCS12_MAKE_SAFEBAG, ERR_R_MALLOC_FAILURE); return NULL; } - M_ASN1_OBJECT_set(bag->type, NID_keyBag); + bag->type = OBJ_nid2obj(NID_keyBag); bag->value.keybag = p8; return bag; } @@ -123,7 +123,7 @@ PKCS8_PRIV_KEY_INFO *p8; return NULL; } - M_ASN1_OBJECT_set(bag->type, NID_pkcs8ShroudedKeyBag); + bag->type = OBJ_nid2obj(NID_pkcs8ShroudedKeyBag); if (!(bag->value.shkeybag = PKCS8_encrypt(pbe_nid, pass, passlen, salt, saltlen, iter, p8))) { PKCS12err(PKCS12_F_PKCS12_MAKE_SHKEYBAG, ERR_R_MALLOC_FAILURE); @@ -142,7 +142,7 @@ STACK *sk; PKCS12err(PKCS12_F_PKCS12_PACK_P7_DATA, ERR_R_MALLOC_FAILURE); return NULL; } - M_ASN1_OBJECT_set(p7->type, NID_pkcs7_data); + p7->type = OBJ_nid2obj(NID_pkcs7_data); if (!(p7->d.data = ASN1_OCTET_STRING_new())) { PKCS12err(PKCS12_F_PKCS12_PACK_P7_DATA, ERR_R_MALLOC_FAILURE); return NULL; @@ -174,15 +174,13 @@ STACK *bags; PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); return NULL; } - /* The next bit may end up in PKCS7_set_type eventually */ - M_ASN1_OBJECT_set(p7->type, NID_pkcs7_encrypted); + p7->type = OBJ_nid2obj(NID_pkcs7_encrypted); if (!(p7->d.encrypted = PKCS7_ENCRYPT_new ())) { PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); return NULL; } ASN1_INTEGER_set (p7->d.encrypted->version, 0); - M_ASN1_OBJECT_set(p7->d.encrypted->enc_data->content_type, - NID_pkcs7_data); + p7->d.encrypted->enc_data->content_type = OBJ_nid2obj(NID_pkcs7_data); if (!(pbe = PKCS5_pbe_set (pbe_nid, iter, salt, saltlen))) { PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); return NULL; diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index 49b9a88db4..f534745dc9 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -88,7 +88,7 @@ int namelen; PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); return 0; } - M_ASN1_OBJECT_set(attrib->object, NID_localKeyID); + attrib->object = OBJ_nid2obj(NID_localKeyID); if (!(attrib->value.set = sk_new(NULL))) { PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); return 0; @@ -132,7 +132,7 @@ int usage; PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); return 0; } - M_ASN1_OBJECT_set(attrib->object, NID_key_usage); + attrib->object = OBJ_nid2obj(NID_key_usage); if (!(attrib->value.set = sk_new(NULL))) { PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); return 0; @@ -196,7 +196,7 @@ int namelen; PKCS12err(PKCS12_F_ADD_FRIENDLYNAME_UNI,ERR_R_MALLOC_FAILURE); return 0; } - M_ASN1_OBJECT_set(attrib->object, NID_friendlyName); + attrib->object = OBJ_nid2obj(NID_friendlyName); if (!(attrib->value.set = sk_new(NULL))) { PKCS12err(PKCS12_F_ADD_FRIENDLYNAME,ERR_R_MALLOC_FAILURE); return 0; diff --git a/crypto/pkcs12/p12_init.c b/crypto/pkcs12/p12_init.c index f6846a8dec..6ec6fb478b 100644 --- a/crypto/pkcs12/p12_init.c +++ b/crypto/pkcs12/p12_init.c @@ -79,7 +79,7 @@ int mode; PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE); return NULL; } - M_ASN1_OBJECT_set(pkcs12->authsafes->type, mode); + pkcs12->authsafes->type = OBJ_nid2obj(mode); switch (mode) { case NID_pkcs7_data: if (!(pkcs12->authsafes->d.data = diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c index d5c2f732d5..9acd6ce316 100644 --- a/crypto/pkcs12/p12_mutl.c +++ b/crypto/pkcs12/p12_mutl.c @@ -173,8 +173,7 @@ EVP_MD *md_type; } if (!salt) RAND_bytes (p12->mac->salt->data, saltlen); else memcpy (p12->mac->salt->data, salt, saltlen); - M_ASN1_OBJECT_set(p12->mac->dinfo->algor->algorithm, - EVP_MD_type(md_type)); + p12->mac->dinfo->algor->algorithm = OBJ_nid2obj(EVP_MD_type(md_type)); if (!(p12->mac->dinfo->algor->parameter = ASN1_TYPE_new())) { PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE); return 0; diff --git a/crypto/pkcs12/p12_utl.c b/crypto/pkcs12/p12_utl.c index 1404dbc6a5..990fb7c469 100644 --- a/crypto/pkcs12/p12_utl.c +++ b/crypto/pkcs12/p12_utl.c @@ -95,17 +95,6 @@ int unilen; return asctmp; } -/* Tag an object type onto an error code */ - -void PKCS12_add_obj_error (obj) -ASN1_OBJECT *obj; -{ - char obj_tmp[80]; - if (!obj) strcpy (obj_tmp, "NULL"); - else i2t_ASN1_OBJECT(obj_tmp, 80, obj); - ERR_add_error_data(2, "TYPE=", obj_tmp); -} - int i2d_PKCS12_bio(bp, p12) BIO *bp; PKCS12 *p12; diff --git a/crypto/pkcs12/pkcs12.h b/crypto/pkcs12/pkcs12.h index 1f03e2b084..6e9ee78bd3 100644 --- a/crypto/pkcs12/pkcs12.h +++ b/crypto/pkcs12/pkcs12.h @@ -188,11 +188,6 @@ ASN1_seq_unpack((p12)->authsafes->d.data->data, \ #define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) -#define M_ASN1_OBJECT_set(obj, nid) \ -{\ -ASN1_OBJECT_free(obj); \ -obj = OBJ_nid2obj((nid));\ -} #ifndef NOPROTO PKCS12_SAFEBAG *PKCS12_pack_safebag(char *obj, int (*i2d)(), int nid1, int nid2); @@ -221,7 +216,6 @@ int PKCS12_set_mac(PKCS12 *p12, unsigned char *pass, int passlen, unsigned char int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, EVP_MD *md_type); unsigned char *asc2uni(unsigned char *asc, unsigned char **uni, int *unilen); char *uni2asc(unsigned char *uni, int unilen); -void PKCS12_add_obj_error(ASN1_OBJECT *obj); 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); @@ -239,8 +233,6 @@ 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); void ERR_load_PKCS12_strings(void); -void ERR_PKCS12_error(int function, int reason, char *file, int line); -void PKCS12_add_obj(void); void PKCS12_PBE_add(void); int PKCS12_parse(PKCS12 *p12, char *pass, EVP_PKEY **pkey, X509 **cert, STACK **ca); PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, STACK *ca, int nid_key, int nid_cert, int iter, int mac_iter, int keytype); @@ -273,7 +265,6 @@ int PKCS12_set_mac(); int PKCS12_setup_mac(); unsigned char *asc2uni(); char *uni2asc(); -void PKCS12_add_obj_error(); int i2d_PKCS12_BAGS(); PKCS12_BAGS *PKCS12_BAGS_new(); PKCS12_BAGS *d2i_PKCS12_BAGS(); @@ -291,8 +282,6 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(); PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(); void PKCS12_SAFEBAG_free(); void ERR_load_PKCS12_strings(); -void ERR_PKCS12_error (); -void PKCS12_add_obj(); void PKCS12_PBE_add(); int PKCS8_add_keyusage(); ASN1_TYPE *PKCS12_get_attr_gen(); |