summaryrefslogtreecommitdiff
path: root/src/regress/lib/libcrypto/bn/mont
diff options
context:
space:
mode:
authorjsing <>2014-10-22 13:23:05 +0000
committerjsing <>2014-10-22 13:23:05 +0000
commit70d2dbcdd5a01333cc8bb15f04f81dcb06351848 (patch)
tree24c467810ca11f3d70c7d8828c4abd7b3893cade /src/regress/lib/libcrypto/bn/mont
parenta5ae6e09eb3d7ae9cef0fc65a04c31e6478f5cb5 (diff)
downloadopenbsd-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/bn/mont')
-rw-r--r--src/regress/lib/libcrypto/bn/mont/mont.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/bn/mont/mont.c b/src/regress/lib/libcrypto/bn/mont/mont.c
index 2a60c022c3..30d5317b64 100644
--- a/src/regress/lib/libcrypto/bn/mont/mont.c
+++ b/src/regress/lib/libcrypto/bn/mont/mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mont.c,v 1.1 2014/06/20 10:38:22 miod Exp $ */ 1/* $OpenBSD: mont.c,v 1.2 2014/10/22 13:23:05 jsing Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014 Miodrag Vallat. 4 * Copyright (c) 2014 Miodrag Vallat.
@@ -25,7 +25,6 @@
25#include <openssl/crypto.h> 25#include <openssl/crypto.h>
26#include <openssl/dh.h> 26#include <openssl/dh.h>
27#include <openssl/err.h> 27#include <openssl/err.h>
28#include <openssl/rand.h>
29 28
30/* 29/*
31 * Test for proper bn_mul_mont behaviour when operands are of vastly different 30 * Test for proper bn_mul_mont behaviour when operands are of vastly different
@@ -39,7 +38,7 @@ main(int argc, char *argv[])
39 unsigned char *key, r[32 + 16 * 8]; 38 unsigned char *key, r[32 + 16 * 8];
40 size_t privsz; 39 size_t privsz;
41 40
42 RAND_bytes(r, sizeof r); 41 arc4random_buf(r, sizeof(r));
43 42
44 for (privsz = 32; privsz <= sizeof(r); privsz += 8) { 43 for (privsz = 32; privsz <= sizeof(r); privsz += 8) {
45 dh = DH_new(); 44 dh = DH_new();