Precautions against using the PRNG uninitialized: RAND_bytes() now
[openssl.git] / crypto / evp / p_seal.c
index 09b46f4b0e1045e35489f2e30dadc315aad4b557..7966545e21db6ce1d1b518abd68962918bce7360 100644 (file)
@@ -73,7 +73,7 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
        int i;
        
        if (npubk <= 0) return(0);
-       RAND_bytes(key,EVP_MAX_KEY_LENGTH);
+       if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) == -1) return(0);
        if (type->iv_len > 0)
                RAND_bytes(iv,type->iv_len);