aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-11-22 16:14:56 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-11-22 16:14:56 +0000
commit63779538167edee9f81f68046206ee7d38a95aaf (patch)
tree829bf3d4eac5865fb83575b1a81d4967c0681371 /crypto/pkcs12
parente322fa2872762b33c2574cf8b33446e522a70da7 (diff)
downloadopenssl-63779538167edee9f81f68046206ee7d38a95aaf.tar.gz
add pice of PR#2295 not committed to HEAD
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r--crypto/pkcs12/p12_key.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c
index 80e99e2150..beece95c45 100644
--- a/crypto/pkcs12/p12_key.c
+++ b/crypto/pkcs12/p12_key.c
@@ -176,8 +176,10 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
out += u;
for (j = 0; j < v; j++) B[j] = Ai[j % u];
/* Work out B + 1 first then can use B as tmp space */
- BN_bin2bn (B, v, Bpl1);
- BN_add_word (Bpl1, 1);
+ if (!BN_bin2bn (B, v, Bpl1))
+ goto err;
+ if (!BN_add_word (Bpl1, 1))
+ goto err;
for (j = 0; j < Ilen ; j+=v) {
if (!BN_bin2bn(I + j, v, Ij))
goto err;