Don't use a ssl specific DRBG anymore
[openssl.git] / crypto / evp / evp_enc.c
index 9832e562b2da8a79427bba896c28201588e8d555..cc710435e744f559299ab91bf6ad9ac1b3c1bb37 100644 (file)
@@ -579,14 +579,6 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
 {
     int ret;
 
 {
     int ret;
 
-    if (type == EVP_CTRL_GET_DRBG) {
-        *(RAND_DRBG **)ptr = ctx->drbg;
-        return 1;
-    }
-    if (type == EVP_CTRL_SET_DRBG) {
-        ctx->drbg = ptr;
-        return 1;
-    }
     if (!ctx->cipher) {
         EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_NO_CIPHER_SET);
         return 0;
     if (!ctx->cipher) {
         EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_NO_CIPHER_SET);
         return 0;
@@ -610,12 +602,8 @@ int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key)
 {
     if (ctx->cipher->flags & EVP_CIPH_RAND_KEY)
         return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_RAND_KEY, 0, key);
 {
     if (ctx->cipher->flags & EVP_CIPH_RAND_KEY)
         return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_RAND_KEY, 0, key);
-    if (ctx->drbg) {
-        if (RAND_DRBG_bytes(ctx->drbg, key, ctx->key_len) == 0)
-            return 0;
-    } else if (RAND_bytes(key, ctx->key_len) <= 0) {
+    if (RAND_bytes(key, ctx->key_len) <= 0)
         return 0;
         return 0;
-    }
     return 1;
 }
 
     return 1;
 }