case NID_camellia_256_ctr:
case NID_camellia_192_ctr:
case NID_camellia_128_ctr:
+ case NID_des_ede3_cbc:
+ case NID_des_ede3_ecb:
+ case NID_des_ede3_ofb64:
+ case NID_des_ede3_cfb64:
+ case NID_des_ede3_cfb8:
+ case NID_des_ede3_cfb1:
+ case NID_des_ede_cbc:
+ case NID_des_ede_ecb:
+ case NID_des_ede_ofb64:
+ case NID_des_ede_cfb64:
+ case NID_desx_cbc:
+ case NID_id_smime_alg_CMS3DESwrap:
break;
default:
goto legacy;
params[0] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_KEYLEN, &arg);
break;
case EVP_CTRL_RAND_KEY: /* Used by DES */
+ set_params = 0;
+ params[0] =
+ OSSL_PARAM_construct_octet_string(OSSL_CIPHER_PARAM_RANDOM_KEY,
+ ptr, (size_t)arg);
+ break;
+
case EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS: /* Used by DASYNC */
case EVP_CTRL_INIT: /* TODO(3.0) Purely legacy, no provider counterpart */
default:
return NULL;
}
-#if !defined(FIPS_MODE)
-/* TODO(3.0): No support for RAND yet in the FIPS module */
int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key)
{
- int kl;
if (ctx->cipher->flags & EVP_CIPH_RAND_KEY)
return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_RAND_KEY, 0, key);
- kl = EVP_CIPHER_CTX_key_length(ctx);
- if (kl <= 0 || RAND_priv_bytes(key, kl) <= 0)
- return 0;
- return 1;
+
+#ifdef FIPS_MODE
+ return 0;
+#else
+ {
+ int kl;
+
+ kl = EVP_CIPHER_CTX_key_length(ctx);
+ if (kl <= 0 || RAND_priv_bytes(key, kl) <= 0)
+ return 0;
+ return 1;
+ }
+#endif /* FIPS_MODE */
}
-#endif
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
{