ssl/s3_pkt.c: detect RAND_bytes error in multi-block.
[openssl.git] / crypto / evp / e_aes_cbc_hmac_sha1.c
index 0b6f292f62015f537be23830155884ee8b51c856..6ece66f27a16d651a9b1f1a86b79dbb494cc7abb 100644 (file)
@@ -212,7 +212,8 @@ static size_t tls1_1_multi_block_encrypt(EVP_AES_HMAC_SHA1 *key,
        u64             seqnum;
 #endif
 
-       RAND_bytes((IVs=blocks[0].c),16*x4);    /* ask for IVs in bulk */
+       if (RAND_bytes((IVs=blocks[0].c),16*x4)<=0)     /* ask for IVs in bulk */
+               return 0;
 
        ctx = (SHA1_MB_CTX *)(storage+32-((size_t)storage%32)); /* align */