diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-06-08 00:01:33 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-06-15 13:22:38 -0400 |
commit | 82af00fbddc7b48f292e8e278eebb57a192c549e (patch) | |
tree | 68639da6c9c7d419be23b599cb87c5dddad92e0d | |
parent | 159b9a4d170743910da4faeda3e900b023820cc9 (diff) |
Constify PKCS12_create, PKCS12_add_key, PKCS12_add_safe.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1215)
-rw-r--r-- | crypto/pkcs12/p12_crt.c | 6 | ||||
-rw-r--r-- | doc/crypto/PKCS12_create.pod | 5 | ||||
-rw-r--r-- | include/openssl/pkcs12.h | 10 |
3 files changed, 11 insertions, 10 deletions
diff --git a/crypto/pkcs12/p12_crt.c b/crypto/pkcs12/p12_crt.c index ca4dd539eb..10cf8dd589 100644 --- a/crypto/pkcs12/p12_crt.c +++ b/crypto/pkcs12/p12_crt.c @@ -28,7 +28,7 @@ static int copy_bag_attr(PKCS12_SAFEBAG *bag, EVP_PKEY *pkey, int nid) return 1; } -PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, +PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter, int keytype) { @@ -170,7 +170,7 @@ PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert) PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, int key_usage, int iter, - int nid_key, char *pass) + int nid_key, const char *pass) { PKCS12_SAFEBAG *bag = NULL; @@ -203,7 +203,7 @@ PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, } int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, - int nid_safe, int iter, char *pass) + int nid_safe, int iter, const char *pass) { PKCS7 *p7 = NULL; int free_safes = 0; diff --git a/doc/crypto/PKCS12_create.pod b/doc/crypto/PKCS12_create.pod index 6408af1ed1..0a43b96c31 100644 --- a/doc/crypto/PKCS12_create.pod +++ b/doc/crypto/PKCS12_create.pod @@ -8,8 +8,9 @@ PKCS12_create - create a PKCS#12 structure #include <openssl/pkcs12.h> - PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca, - int nid_key, int nid_cert, int iter, int mac_iter, int keytype); + PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, STACK_OF(X509) *ca, + int nid_key, int nid_cert, int iter, int mac_iter, int keytype); =head1 DESCRIPTION diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h index 848267c9a2..37d02aef25 100644 --- a/include/openssl/pkcs12.h +++ b/include/openssl/pkcs12.h @@ -188,16 +188,16 @@ DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES) void PKCS12_PBE_add(void); int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); -PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, - STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, - int mac_iter, int keytype); +PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, + int iter, int mac_iter, int keytype); PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, int key_usage, int iter, - int key_nid, char *pass); + int key_nid, const char *pass); int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, - int safe_nid, int iter, char *pass); + int safe_nid, int iter, const char *pass); PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); |