summaryrefslogtreecommitdiff
path: root/test/drbgtest.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-04-11 08:52:22 +1000
committerPauli <paul.dale@oracle.com>2019-04-11 08:52:22 +1000
commit6c7d80ab3b2a13074ca270a6d056c59ac431155a (patch)
treea44ab97f1136735d7147b377b13cd69c53f65bc2 /test/drbgtest.c
parent3a86f1db282569c538273cc48462a3fa5fcffa39 (diff)
downloadopenssl-new-6c7d80ab3b2a13074ca270a6d056c59ac431155a.tar.gz
Reseeding without derivation function is not supported in FIPS mode.
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8648)
Diffstat (limited to 'test/drbgtest.c')
-rw-r--r--test/drbgtest.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/drbgtest.c b/test/drbgtest.c
index 652b93ad6b..ca45a8fd5b 100644
--- a/test/drbgtest.c
+++ b/test/drbgtest.c
@@ -104,9 +104,12 @@ typedef struct drbg_selftest_data_st {
make_drbg_test_data(nid, 0, pr, p)
static DRBG_SELFTEST_DATA drbg_test[] = {
+#ifndef FIPS_MODE
+ /* FIPS mode doesn't support CTR DRBG without a derivation function */
make_drbg_test_data_no_df (NID_aes_128_ctr, aes_128_no_df, 0),
make_drbg_test_data_no_df (NID_aes_192_ctr, aes_192_no_df, 0),
make_drbg_test_data_no_df (NID_aes_256_ctr, aes_256_no_df, 1),
+#endif
make_drbg_test_data_use_df(NID_aes_128_ctr, aes_128_use_df, 0),
make_drbg_test_data_use_df(NID_aes_192_ctr, aes_192_use_df, 0),
make_drbg_test_data_use_df(NID_aes_256_ctr, aes_256_use_df, 1),
@@ -1107,14 +1110,16 @@ static int test_set_defaults(void)
&& TEST_int_eq(public->type, NID_sha256)
&& TEST_int_eq(public->flags, RAND_DRBG_FLAG_PUBLIC)
- /* Change DRBG defaults and change master and check again */
+ /* FIPS mode doesn't support CTR DRBG without a derivation function */
+#ifndef FIPS_MODE
+ /* Change DRBG defaults and change master and check again */
&& TEST_true(RAND_DRBG_set_defaults(NID_aes_256_ctr,
RAND_DRBG_FLAG_CTR_NO_DF))
&& TEST_true(RAND_DRBG_uninstantiate(master))
&& TEST_int_eq(master->type, NID_aes_256_ctr)
&& TEST_int_eq(master->flags,
RAND_DRBG_FLAG_MASTER|RAND_DRBG_FLAG_CTR_NO_DF)
-
+#endif
/* Reset back to the standard defaults */
&& TEST_true(RAND_DRBG_set_defaults(RAND_DRBG_TYPE,
RAND_DRBG_FLAGS