diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_npas.c')
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_npas.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_npas.c b/src/lib/libcrypto/pkcs12/p12_npas.c index 63b3df17ad..d6b12edab3 100644 --- a/src/lib/libcrypto/pkcs12/p12_npas.c +++ b/src/lib/libcrypto/pkcs12/p12_npas.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: p12_npas.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: p12_npas.c,v 1.13 2018/05/13 14:22:34 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -65,10 +65,11 @@ | |||
65 | 65 | ||
66 | /* PKCS#12 password change routine */ | 66 | /* PKCS#12 password change routine */ |
67 | 67 | ||
68 | static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass); | 68 | static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass); |
69 | static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, | 69 | static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass, |
70 | char *newpass); | 70 | const char *newpass); |
71 | static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass); | 71 | static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, |
72 | const char *newpass); | ||
72 | static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); | 73 | static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); |
73 | 74 | ||
74 | /* | 75 | /* |
@@ -76,7 +77,7 @@ static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); | |||
76 | */ | 77 | */ |
77 | 78 | ||
78 | int | 79 | int |
79 | PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass) | 80 | PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass) |
80 | { | 81 | { |
81 | /* Check for NULL PKCS12 structure */ | 82 | /* Check for NULL PKCS12 structure */ |
82 | 83 | ||
@@ -103,7 +104,7 @@ PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass) | |||
103 | /* Parse the outer PKCS#12 structure */ | 104 | /* Parse the outer PKCS#12 structure */ |
104 | 105 | ||
105 | static int | 106 | static int |
106 | newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) | 107 | newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass) |
107 | { | 108 | { |
108 | STACK_OF(PKCS7) *asafes, *newsafes; | 109 | STACK_OF(PKCS7) *asafes, *newsafes; |
109 | STACK_OF(PKCS12_SAFEBAG) *bags; | 110 | STACK_OF(PKCS12_SAFEBAG) *bags; |
@@ -189,7 +190,8 @@ err: | |||
189 | 190 | ||
190 | 191 | ||
191 | static int | 192 | static int |
192 | newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, char *newpass) | 193 | newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass, |
194 | const char *newpass) | ||
193 | { | 195 | { |
194 | int i; | 196 | int i; |
195 | 197 | ||
@@ -204,7 +206,7 @@ newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, char *newpass) | |||
204 | /* Change password of safebag: only needs handle shrouded keybags */ | 206 | /* Change password of safebag: only needs handle shrouded keybags */ |
205 | 207 | ||
206 | static int | 208 | static int |
207 | newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass) | 209 | newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, const char *newpass) |
208 | { | 210 | { |
209 | PKCS8_PRIV_KEY_INFO *p8; | 211 | PKCS8_PRIV_KEY_INFO *p8; |
210 | X509_SIG *p8new; | 212 | X509_SIG *p8new; |