diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-10-20 05:50:23 +0400 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-10-20 05:50:23 +0400 |
commit | 08e9c1af6c26f74ef7f7524be4b89241ff232a8c (patch) | |
tree | 7fe3f66fdfb1f20a5bfcbbf98369032374f3a79b /crypto/pkcs12/p12_kiss.c | |
parent | 023c8d0b0aec445b680ef5aea2bd2154adb59974 (diff) |
Replace the macros in asn1.h with function equivalents. Also make UTF8Strings
tolerated in certificates.
Diffstat (limited to 'crypto/pkcs12/p12_kiss.c')
-rw-r--r-- | crypto/pkcs12/p12_kiss.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c index 767e1303da..08a60556e0 100644 --- a/crypto/pkcs12/p12_kiss.c +++ b/crypto/pkcs12/p12_kiss.c @@ -139,16 +139,16 @@ static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen, sk_pop_free (asafes, PKCS7_free); return 0; } - if (!parse_bags (bags, pass, passlen, pkey, cert, ca, + if (!parse_bags(bags, pass, passlen, pkey, cert, ca, &keyid, &keymatch)) { - sk_pop_free (bags, PKCS12_SAFEBAG_free); - sk_pop_free (asafes, PKCS7_free); + sk_pop_free(bags, PKCS12_SAFEBAG_free); + sk_pop_free(asafes, PKCS7_free); return 0; } - sk_pop_free (bags, PKCS12_SAFEBAG_free); + sk_pop_free(bags, PKCS12_SAFEBAG_free); } - sk_pop_free (asafes, PKCS7_free); - if (keyid) ASN1_OCTET_STRING_free (keyid); + sk_pop_free(asafes, PKCS7_free); + if (keyid) M_ASN1_OCTET_STRING_free(keyid); return 1; } @@ -158,8 +158,8 @@ static int parse_bags (STACK *bags, const char *pass, int passlen, ASN1_OCTET_STRING **keyid, char *keymatch) { int i; - for (i = 0; i < sk_num (bags); i++) { - if (!parse_bag ((PKCS12_SAFEBAG *)sk_value (bags, i), + for (i = 0; i < sk_num(bags); i++) { + if (!parse_bag((PKCS12_SAFEBAG *)sk_value (bags, i), pass, passlen, pkey, cert, ca, keyid, keymatch)) return 0; } @@ -170,7 +170,7 @@ static int parse_bags (STACK *bags, const char *pass, int passlen, #define MATCH_CERT 0x2 #define MATCH_ALL 0x3 -static int parse_bag (PKCS12_SAFEBAG *bag, const char *pass, int passlen, +static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, EVP_PKEY **pkey, X509 **cert, STACK **ca, ASN1_OCTET_STRING **keyid, char *keymatch) @@ -187,9 +187,9 @@ static int parse_bag (PKCS12_SAFEBAG *bag, const char *pass, int passlen, /* Check for any local key id matching (if needed) */ if (lkey && ((*keymatch & MATCH_ALL) != MATCH_ALL)) { if (*keyid) { - if (ASN1_OCTET_STRING_cmp (*keyid, lkey)) lkey = NULL; + if (M_ASN1_OCTET_STRING_cmp(*keyid, lkey)) lkey = NULL; } else { - if (!(*keyid = ASN1_OCTET_STRING_dup (lkey))) { + if (!(*keyid = M_ASN1_OCTET_STRING_dup(lkey))) { PKCS12err(PKCS12_F_PARSE_BAGS,ERR_R_MALLOC_FAILURE); return 0; } @@ -200,16 +200,16 @@ static int parse_bag (PKCS12_SAFEBAG *bag, const char *pass, int passlen, { case NID_keyBag: if (!lkey || !pkey) return 1; - if (!(*pkey = EVP_PKCS82PKEY (bag->value.keybag))) return 0; + if (!(*pkey = EVP_PKCS82PKEY(bag->value.keybag))) return 0; *keymatch |= MATCH_KEY; break; case NID_pkcs8ShroudedKeyBag: if (!lkey || !pkey) return 1; - if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen))) + if (!(p8 = M_PKCS12_decrypt_skey(bag, pass, passlen))) return 0; - *pkey = EVP_PKCS82PKEY (p8); - PKCS8_PRIV_KEY_INFO_free (p8); + *pkey = EVP_PKCS82PKEY(p8); + PKCS8_PRIV_KEY_INFO_free(p8); if (!(*pkey)) return 0; *keymatch |= MATCH_KEY; break; |