summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12/p12_npas.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2005-05-11 03:45:39 +0000
committerBodo Möller <bodo@openssl.org>2005-05-11 03:45:39 +0000
commit8afca8d9c60c3d7db6f9bc94a97c77f016fc139d (patch)
treedf6c0046c8ebb68825940173c750ae0fb37f0f0c /crypto/pkcs12/p12_npas.c
parent35e8510e60ef0b033b304289db28a3cb19c6cbdd (diff)
Fix more error codes.
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
Diffstat (limited to 'crypto/pkcs12/p12_npas.c')
-rw-r--r--crypto/pkcs12/p12_npas.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/crypto/pkcs12/p12_npas.c b/crypto/pkcs12/p12_npas.c
index e62d497c6f..48eacc5c49 100644
--- a/crypto/pkcs12/p12_npas.c
+++ b/crypto/pkcs12/p12_npas.c
@@ -77,28 +77,26 @@ static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen);
int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass)
{
+ /* Check for NULL PKCS12 structure */
-/* Check for NULL PKCS12 structure */
-
-if(!p12) {
- PKCS12err(PKCS12_F_PKCS12_NEWPASS,PKCS12_R_INVALID_NULL_PKCS12_POINTER);
- return 0;
-}
-
-/* Check the mac */
-
-if (!PKCS12_verify_mac(p12, oldpass, -1)) {
- PKCS12err(PKCS12_F_PKCS12_NEWPASS,PKCS12_R_MAC_VERIFY_FAILURE);
- return 0;
-}
+ if(!p12) {
+ PKCS12err(PKCS12_F_PKCS12_NEWPASS,PKCS12_R_INVALID_NULL_PKCS12_POINTER);
+ return 0;
+ }
-if (!newpass_p12(p12, oldpass, newpass)) {
- PKCS12err(PKCS12_F_PKCS12_NEWPASS,PKCS12_R_PARSE_ERROR);
- return 0;
-}
+ /* Check the mac */
+
+ if (!PKCS12_verify_mac(p12, oldpass, -1)) {
+ PKCS12err(PKCS12_F_PKCS12_NEWPASS,PKCS12_R_MAC_VERIFY_FAILURE);
+ return 0;
+ }
-return 1;
+ if (!newpass_p12(p12, oldpass, newpass)) {
+ PKCS12err(PKCS12_F_PKCS12_NEWPASS,PKCS12_R_PARSE_ERROR);
+ return 0;
+ }
+ return 1;
}
/* Parse the outer PKCS#12 structure */