diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/pkcs12/p12_add.c | 4 | ||||
-rw-r--r-- | crypto/pkcs12/p12_attr.c | 5 | ||||
-rw-r--r-- | crypto/pkcs12/p12_kiss.c | 6 | ||||
-rw-r--r-- | crypto/pkcs12/p12_mutl.c | 2 | ||||
-rw-r--r-- | crypto/pkcs12/p12_sbag.c | 27 |
5 files changed, 27 insertions, 17 deletions
diff --git a/crypto/pkcs12/p12_add.c b/crypto/pkcs12/p12_add.c index 8a5ad2068d..193ed8097d 100644 --- a/crypto/pkcs12/p12_add.c +++ b/crypto/pkcs12/p12_add.c @@ -138,7 +138,7 @@ STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, p7->d.encrypted->enc_data->enc_data, 1); } -PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, +PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, const char *pass, int passlen) { return PKCS8_decrypt(bag->value.shkeybag, pass, passlen); @@ -152,7 +152,7 @@ int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes) return 0; } -STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12) +STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12) { if (!PKCS7_type_is_data(p12->authsafes)) { PKCS12err(PKCS12_F_PKCS12_UNPACK_AUTHSAFES, diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index 58935c154f..a16231f074 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -76,7 +76,7 @@ ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs, char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag) { - ASN1_TYPE *atype; + const ASN1_TYPE *atype; if ((atype = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName)) == NULL) return NULL; @@ -86,7 +86,8 @@ char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag) atype->value.bmpstring->length); } -STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(PKCS12_SAFEBAG *bag) +const STACK_OF(X509_ATTRIBUTE) * +PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag) { return bag->attrib; } diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c index ea7e0c94ef..62f5d1ec17 100644 --- a/crypto/pkcs12/p12_kiss.c +++ b/crypto/pkcs12/p12_kiss.c @@ -16,7 +16,7 @@ static int parse_pk12(PKCS12 *p12, const char *pass, int passlen, EVP_PKEY **pkey, STACK_OF(X509) *ocerts); -static int parse_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass, +static int parse_bags(const STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass, int passlen, EVP_PKEY **pkey, STACK_OF(X509) *ocerts); static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, @@ -157,7 +157,7 @@ static int parse_pk12(PKCS12 *p12, const char *pass, int passlen, return 1; } -static int parse_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass, +static int parse_bags(const STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass, int passlen, EVP_PKEY **pkey, STACK_OF(X509) *ocerts) { int i; @@ -174,7 +174,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, { PKCS8_PRIV_KEY_INFO *p8; X509 *x509; - ASN1_TYPE *attrib; + const ASN1_TYPE *attrib; ASN1_BMPSTRING *fname = NULL; ASN1_OCTET_STRING *lkid = NULL; diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c index 87c40ee46e..d608a5c02c 100644 --- a/crypto/pkcs12/p12_mutl.c +++ b/crypto/pkcs12/p12_mutl.c @@ -15,7 +15,7 @@ # include <openssl/pkcs12.h> # include "p12_lcl.h" -int PKCS12_mac_present(PKCS12 *p12) +int PKCS12_mac_present(const PKCS12 *p12) { return p12->mac ? 1 : 0; } diff --git a/crypto/pkcs12/p12_sbag.c b/crypto/pkcs12/p12_sbag.c index c8564b4168..4a3d259930 100644 --- a/crypto/pkcs12/p12_sbag.c +++ b/crypto/pkcs12/p12_sbag.c @@ -12,7 +12,15 @@ #include <openssl/pkcs12.h> #include "p12_lcl.h" -ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(PKCS12_SAFEBAG *bag, int attr_nid) +#if OPENSSL_API_COMPAT < 0x10100000L +ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag, int attr_nid) +{ + return PKCS12_get_attr_gen(bag->attrib, attr_nid); +} +#endif + +const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag, + int attr_nid) { return PKCS12_get_attr_gen(bag->attrib, attr_nid); } @@ -22,38 +30,39 @@ ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid) return PKCS12_get_attr_gen(PKCS8_pkey_get0_attrs(p8), attr_nid); } -PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(PKCS12_SAFEBAG *bag) +const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag) { if (PKCS12_SAFEBAG_get_nid(bag) != NID_keyBag) return NULL; return bag->value.keybag; } -X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(PKCS12_SAFEBAG *bag) +const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag) { if (OBJ_obj2nid(bag->type) != NID_pkcs8ShroudedKeyBag) return NULL; return bag->value.shkeybag; } -STACK_OF(PKCS12_SAFEBAG) *PKCS12_SAFEBAG_get0_safes(PKCS12_SAFEBAG *bag) +const STACK_OF(PKCS12_SAFEBAG) * +PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag) { if (OBJ_obj2nid(bag->type) != NID_safeContentsBag) return NULL; return bag->value.safes; } -ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(PKCS12_SAFEBAG *bag) +const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag) { return bag->type; } -int PKCS12_SAFEBAG_get_nid(PKCS12_SAFEBAG *bag) +int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag) { return OBJ_obj2nid(bag->type); } -int PKCS12_SAFEBAG_get_bag_nid(PKCS12_SAFEBAG *bag) +int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag) { int btype = PKCS12_SAFEBAG_get_nid(bag); @@ -62,7 +71,7 @@ int PKCS12_SAFEBAG_get_bag_nid(PKCS12_SAFEBAG *bag) return OBJ_obj2nid(bag->value.bag->type); } -X509 *PKCS12_SAFEBAG_get1_cert(PKCS12_SAFEBAG *bag) +X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag) { if (PKCS12_SAFEBAG_get_nid(bag) != NID_certBag) return NULL; @@ -72,7 +81,7 @@ X509 *PKCS12_SAFEBAG_get1_cert(PKCS12_SAFEBAG *bag) ASN1_ITEM_rptr(X509)); } -X509_CRL *PKCS12_SAFEBAG_get1_crl(PKCS12_SAFEBAG *bag) +X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag) { if (PKCS12_SAFEBAG_get_nid(bag) != NID_crlBag) return NULL; |