diff options
author | Pauli <pauli@openssl.org> | 2021-05-31 16:31:18 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-06-01 18:13:56 +1000 |
commit | 28cab20916731c188180628330de27f6ce5f684e (patch) | |
tree | f85f272ab8aba403ab10401af29deeda217f0138 /crypto/pkcs12 | |
parent | dfefa4c16424cb3628b2a75b53c11e0be5247baa (diff) |
crypto: updates to pass size_t to RAND_bytes_ex()
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15540)
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r-- | crypto/pkcs12/p12_mutl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c index 041711d7d4..be4ed16ab7 100644 --- a/crypto/pkcs12/p12_mutl.c +++ b/crypto/pkcs12/p12_mutl.c @@ -259,8 +259,10 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, } p12->mac->salt->length = saltlen; if (!salt) { + if (saltlen < 0) + return 0; if (RAND_bytes_ex(p12->authsafes->ctx.libctx, p12->mac->salt->data, - saltlen, 0) <= 0) + (size_t)saltlen, 0) <= 0) return 0; } else memcpy(p12->mac->salt->data, salt, saltlen); |