projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Address a bug in the DRBG tests where the reseeding wasn't properly
[openssl.git]
/
test
/
drbgtest.c
diff --git
a/test/drbgtest.c
b/test/drbgtest.c
index 1aef1fe41a78fb97a297c35764980f2417e3ba2d..362a1d2b49919377f568845136911edbffae9a9a 100644
(file)
--- a/
test/drbgtest.c
+++ b/
test/drbgtest.c
@@
-1,7
+1,7
@@
/*
* Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved.
*
/*
* Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved.
*
- * Licensed under the
OpenSSL license
(the "License"). You may not use
+ * Licensed under the
Apache License 2.0
(the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
@@
-429,7
+429,7
@@
static int error_check(DRBG_SELFTEST_DATA *td)
*/
/* Test explicit reseed with too large additional input */
*/
/* Test explicit reseed with too large additional input */
- if (!in
it
(drbg, td, &t)
+ if (!in
stantiate
(drbg, td, &t)
|| RAND_DRBG_reseed(drbg, td->adin, drbg->max_adinlen + 1, 0) > 0)
goto err;
|| RAND_DRBG_reseed(drbg, td->adin, drbg->max_adinlen + 1, 0) > 0)
goto err;
@@
-440,7
+440,7
@@
static int error_check(DRBG_SELFTEST_DATA *td)
goto err;
/* Test explicit reseed with too much entropy */
goto err;
/* Test explicit reseed with too much entropy */
- if (!in
it
(drbg, td, &t))
+ if (!in
stantiate
(drbg, td, &t))
goto err;
t.entropylen = drbg->max_entropylen + 1;
if (!TEST_int_le(RAND_DRBG_reseed(drbg, td->adin, td->adinlen, 0), 0)
goto err;
t.entropylen = drbg->max_entropylen + 1;
if (!TEST_int_le(RAND_DRBG_reseed(drbg, td->adin, td->adinlen, 0), 0)
@@
-448,7
+448,7
@@
static int error_check(DRBG_SELFTEST_DATA *td)
goto err;
/* Test explicit reseed with too little entropy */
goto err;
/* Test explicit reseed with too little entropy */
- if (!in
it
(drbg, td, &t))
+ if (!in
stantiate
(drbg, td, &t))
goto err;
t.entropylen = drbg->min_entropylen - 1;
if (!TEST_int_le(RAND_DRBG_reseed(drbg, td->adin, td->adinlen, 0), 0)
goto err;
t.entropylen = drbg->min_entropylen - 1;
if (!TEST_int_le(RAND_DRBG_reseed(drbg, td->adin, td->adinlen, 0), 0)
@@
-839,6
+839,11
@@
typedef HANDLE thread_t;
static DWORD WINAPI thread_run(LPVOID arg)
{
run_multi_thread_test();
static DWORD WINAPI thread_run(LPVOID arg)
{
run_multi_thread_test();
+ /*
+ * Because we're linking with a static library, we must stop each
+ * thread explicitly, or so says OPENSSL_thread_stop(3)
+ */
+ OPENSSL_thread_stop();
return 0;
}
return 0;
}
@@
-860,6
+865,11
@@
typedef pthread_t thread_t;
static void *thread_run(void *arg)
{
run_multi_thread_test();
static void *thread_run(void *arg)
{
run_multi_thread_test();
+ /*
+ * Because we're linking with a static library, we must stop each
+ * thread explicitly, or so says OPENSSL_thread_stop(3)
+ */
+ OPENSSL_thread_stop();
return NULL;
}
return NULL;
}