diff options
author | jsing <> | 2014-10-22 13:23:05 +0000 |
---|---|---|
committer | jsing <> | 2014-10-22 13:23:05 +0000 |
commit | 70d2dbcdd5a01333cc8bb15f04f81dcb06351848 (patch) | |
tree | 24c467810ca11f3d70c7d8828c4abd7b3893cade /src/regress/lib/libcrypto/ecdsa/ecdsatest.c | |
parent | a5ae6e09eb3d7ae9cef0fc65a04c31e6478f5cb5 (diff) | |
download | openbsd-70d2dbcdd5a01333cc8bb15f04f81dcb06351848.tar.gz openbsd-70d2dbcdd5a01333cc8bb15f04f81dcb06351848.tar.bz2 openbsd-70d2dbcdd5a01333cc8bb15f04f81dcb06351848.zip |
Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes() (most
with unchecked return values).
Diffstat (limited to 'src/regress/lib/libcrypto/ecdsa/ecdsatest.c')
-rw-r--r-- | src/regress/lib/libcrypto/ecdsa/ecdsatest.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/regress/lib/libcrypto/ecdsa/ecdsatest.c b/src/regress/lib/libcrypto/ecdsa/ecdsatest.c index eadb43d652..810fef61bb 100644 --- a/src/regress/lib/libcrypto/ecdsa/ecdsatest.c +++ b/src/regress/lib/libcrypto/ecdsa/ecdsatest.c | |||
@@ -82,7 +82,6 @@ | |||
82 | #include <openssl/engine.h> | 82 | #include <openssl/engine.h> |
83 | #endif | 83 | #endif |
84 | #include <openssl/err.h> | 84 | #include <openssl/err.h> |
85 | #include <openssl/rand.h> | ||
86 | 85 | ||
87 | /* declaration of the test functions */ | 86 | /* declaration of the test functions */ |
88 | int x9_62_test_internal(BIO *out, int nid, const char *r, const char *s); | 87 | int x9_62_test_internal(BIO *out, int nid, const char *r, const char *s); |
@@ -169,12 +168,8 @@ int test_builtin(BIO *out) | |||
169 | int nid, ret = 0; | 168 | int nid, ret = 0; |
170 | 169 | ||
171 | /* fill digest values with some random data */ | 170 | /* fill digest values with some random data */ |
172 | if (!RAND_pseudo_bytes(digest, 20) || | 171 | arc4random_buf(digest, 20); |
173 | !RAND_pseudo_bytes(wrong_digest, 20)) | 172 | arc4random_buf(wrong_digest, 20); |
174 | { | ||
175 | BIO_printf(out, "ERROR: unable to get random data\n"); | ||
176 | goto builtin_err; | ||
177 | } | ||
178 | 173 | ||
179 | /* create and verify a ecdsa signature with every availble curve | 174 | /* create and verify a ecdsa signature with every availble curve |
180 | * (with ) */ | 175 | * (with ) */ |