Codebase list openssl / 59f124f
Fix: drbgtest fails when tests are executed in random order [extended tests] The test_rand_reseed assumed that the global DRBGs were not used previously. This assumption is false when the tests are executed in random order (OPENSSL_TEST_RAND_ORDER). So we uninstantiate them first and add a test for the first instantiation. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5680) Dr. Matthias St. Pierre authored 6 years ago Matt Caswell committed 6 years ago
1 changed file(s) with 17 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
690690 || !TEST_ptr_eq(private->parent, master))
691691 return 0;
692692
693 /* uninstantiate the three global DRBGs */
694 RAND_DRBG_uninstantiate(private);
695 RAND_DRBG_uninstantiate(public);
696 RAND_DRBG_uninstantiate(master);
697
698
693699 /* Install hooks for the following tests */
694700 hook_drbg(master, &master_ctx);
695701 hook_drbg(public, &public_ctx);
696702 hook_drbg(private, &private_ctx);
697703
698 /*
699 * Test initial state of shared DRBs
704
705 /*
706 * Test initial seeding of shared DRBGs
707 */
708 if (!TEST_true(test_drbg_reseed(1, master, public, private, 1, 1, 1)))
709 goto error;
710 reset_drbg_hook_ctx();
711
712
713 /*
714 * Test initial state of shared DRBGs
700715 */
701716 if (!TEST_true(test_drbg_reseed(1, master, public, private, 0, 0, 0)))
702717 goto error;