diff options
| author | jsing <> | 2014-10-22 13:23:05 +0000 |
|---|---|---|
| committer | jsing <> | 2014-10-22 13:23:05 +0000 |
| commit | b0c3f49ebc6b8add9382cff4b18ebda7cf7fbe1e (patch) | |
| tree | 24c467810ca11f3d70c7d8828c4abd7b3893cade /src/regress/lib/libcrypto/ecdsa/ecdsatest.c | |
| parent | 311161c3e8905e2f6faa5ace63ff65e16548c561 (diff) | |
| download | openbsd-b0c3f49ebc6b8add9382cff4b18ebda7cf7fbe1e.tar.gz openbsd-b0c3f49ebc6b8add9382cff4b18ebda7cf7fbe1e.tar.bz2 openbsd-b0c3f49ebc6b8add9382cff4b18ebda7cf7fbe1e.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 ) */ |
