aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/pkcs12/p12_key.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-02-13 09:48:21 +0100
committermarha <marha@users.sourceforge.net>2013-02-13 09:51:39 +0100
commitaaf21968deb85b635cb6aa6544df233ea5981346 (patch)
tree450a73e83a174325e6a69ad69eb4011c2eb7df8c /openssl/crypto/pkcs12/p12_key.c
parent8add148a4cf71b8bdab05a6b7e14824b5062da5e (diff)
downloadvcxsrv-aaf21968deb85b635cb6aa6544df233ea5981346.tar.gz
vcxsrv-aaf21968deb85b635cb6aa6544df233ea5981346.tar.bz2
vcxsrv-aaf21968deb85b635cb6aa6544df233ea5981346.zip
Update to following packages:
openssl-1.0.1e freetype-2.4.11
Diffstat (limited to 'openssl/crypto/pkcs12/p12_key.c')
-rw-r--r--openssl/crypto/pkcs12/p12_key.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/openssl/crypto/pkcs12/p12_key.c b/openssl/crypto/pkcs12/p12_key.c
index c55c7b60b..61d58502f 100644
--- a/openssl/crypto/pkcs12/p12_key.c
+++ b/openssl/crypto/pkcs12/p12_key.c
@@ -176,24 +176,32 @@ 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 */
- if (!BN_bin2bn (B, v, Bpl1)) goto err;
- if (!BN_add_word (Bpl1, 1)) goto err;
+ 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;
- if (!BN_add (Ij, Ij, Bpl1)) goto err;
- BN_bn2bin (Ij, B);
+ if (!BN_bin2bn(I + j, v, Ij))
+ goto err;
+ if (!BN_add(Ij, Ij, Bpl1))
+ goto err;
+ if (!BN_bn2bin(Ij, B))
+ goto err;
Ijlen = BN_num_bytes (Ij);
/* If more than 2^(v*8) - 1 cut off MSB */
if (Ijlen > v) {
- BN_bn2bin (Ij, B);
+ if (!BN_bn2bin (Ij, B))
+ goto err;
memcpy (I + j, B + 1, v);
#ifndef PKCS12_BROKEN_KEYGEN
/* If less than v bytes pad with zeroes */
} else if (Ijlen < v) {
memset(I + j, 0, v - Ijlen);
- BN_bn2bin(Ij, I + j + v - Ijlen);
+ if (!BN_bn2bin(Ij, I + j + v - Ijlen))
+ goto err;
#endif
- } else BN_bn2bin (Ij, I + j);
+ } else if (!BN_bn2bin (Ij, I + j))
+ goto err;
}
}