Enhance EVP code to generate random symmetric keys of the
[openssl.git] / crypto / evp / p_seal.c
index 37e547fe7276a1ee748456a5008f4ca34bacde18..8cc8fcb0bd058e4c4022fdceefde0e0c2e5e379f 100644 (file)
@@ -78,7 +78,7 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek
        }
        if ((npubk <= 0) || !pubk)
                return 1;
-       if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0)
+       if (EVP_CIPHER_CTX_rand_key(ctx, key) <= 0)
                return 0;
        if (EVP_CIPHER_CTX_iv_length(ctx))
                RAND_pseudo_bytes(iv,EVP_CIPHER_CTX_iv_length(ctx));