summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pkcs12/p12_npas.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_npas.c')
-rw-r--r--src/lib/libcrypto/pkcs12/p12_npas.c20
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
68static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass); 68static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass);
69static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, 69static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass,
70 char *newpass); 70 const char *newpass);
71static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass); 71static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass,
72 const char *newpass);
72static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); 73static 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
78int 79int
79PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass) 80PKCS12_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
105static int 106static int
106newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) 107newpass_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
191static int 192static int
192newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, char *newpass) 193newpass_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
206static int 208static int
207newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass) 209newpass_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;