From 762ee38d55b0d0ca2a2e744b8e59dbc9f39c68a0 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 27 Sep 2015 12:41:53 +0100 Subject: [PATCH] Use new names Reviewed-by: Rich Salz --- apps/pkcs12.c | 8 ++++---- crypto/pkcs12/p12_attr.c | 2 +- crypto/pkcs12/p12_crt.c | 2 +- crypto/pkcs12/p12_kiss.c | 10 +++++----- crypto/pkcs12/p12_npas.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/pkcs12.c b/apps/pkcs12.c index e44a999be4..8c0e7f15fa 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -647,7 +647,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, attrs = PKCS12_SAFEBAG_get0_attrs(bag); - switch (M_PKCS12_bag_type(bag)) { + switch (PKCS12_SAFEBAG_get_nid(bag)) { case NID_keyBag: if (options & INFO) BIO_printf(bio_err, "Key bag\n"); @@ -689,15 +689,15 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, BIO_printf(bio_err, "Certificate bag\n"); if (options & NOCERTS) return 1; - if (PKCS12_get_attr(bag, NID_localKeyID)) { + if (PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID)) { if (options & CACERTS) return 1; } else if (options & CLCERTS) return 1; print_attribs(out, attrs, "Bag Attributes"); - if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate) + if (PKCS12_SAFEBAG_get_bag_nid(bag) != NID_x509Certificate) return 1; - if ((x509 = PKCS12_certbag2x509(bag)) == NULL) + if ((x509 = PKCS12_SAFEBAG_get1_cert(bag)) == NULL) return 0; dump_cert_text(out, x509); PEM_write_bio_X509(out, x509); diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index 454db9e46e..fba35cd63b 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -130,7 +130,7 @@ char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag) { ASN1_TYPE *atype; - if ((atype = PKCS12_get_attr(bag, NID_friendlyName)) == NULL) + if ((atype = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName)) == NULL) return NULL; if (atype->type != V_ASN1_BMPSTRING) return NULL; diff --git a/crypto/pkcs12/p12_crt.c b/crypto/pkcs12/p12_crt.c index c4632a9b95..71f8561352 100644 --- a/crypto/pkcs12/p12_crt.c +++ b/crypto/pkcs12/p12_crt.c @@ -189,7 +189,7 @@ PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert) int keyidlen = -1; /* Add user certificate */ - if ((bag = PKCS12_x5092certbag(cert)) == NULL) + if ((bag = PKCS12_SAFEBAG_new_cert(cert)) == NULL) goto err; /* diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c index 9a71581513..ec59d83c8f 100644 --- a/crypto/pkcs12/p12_kiss.c +++ b/crypto/pkcs12/p12_kiss.c @@ -227,13 +227,13 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, ASN1_BMPSTRING *fname = NULL; ASN1_OCTET_STRING *lkid = NULL; - if ((attrib = PKCS12_get_attr(bag, NID_friendlyName))) + if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName))) fname = attrib->value.bmpstring; - if ((attrib = PKCS12_get_attr(bag, NID_localKeyID))) + if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID))) lkid = attrib->value.octet_string; - switch (PKCS12_bag_type(bag)) { + switch (PKCS12_SAFEBAG_get_nid(bag)) { case NID_keyBag: if (!pkey || *pkey) return 1; @@ -254,9 +254,9 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, break; case NID_certBag: - if (PKCS12_cert_bag_type(bag) != NID_x509Certificate) + if (PKCS12_SAFEBAG_get_bag_nid(bag) != NID_x509Certificate) return 1; - if ((x509 = PKCS12_certbag2x509(bag)) == NULL) + if ((x509 = PKCS12_SAFEBAG_get1_cert(bag)) == NULL) return 0; if (lkid && !X509_keyid_set1(x509, lkid->data, lkid->length)) { X509_free(x509); diff --git a/crypto/pkcs12/p12_npas.c b/crypto/pkcs12/p12_npas.c index 2bd25e47ef..f2fc12f752 100644 --- a/crypto/pkcs12/p12_npas.c +++ b/crypto/pkcs12/p12_npas.c @@ -203,7 +203,7 @@ static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass) X509_SIG *p8new; int p8_nid, p8_saltlen, p8_iter; - if (PKCS12_bag_type(bag) != NID_pkcs8ShroudedKeyBag) + if (PKCS12_SAFEBAG_get_nid(bag) != NID_pkcs8ShroudedKeyBag) return 1; if ((p8 = PKCS8_decrypt(bag->value.shkeybag, oldpass, -1)) == NULL) -- 2.25.1