projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f2599d
)
Return bignum '0' when BN_rand is asked for a 0 bit random number.
author
Bodo Möller
<bodo@openssl.org>
Sun, 2 Jul 2000 19:42:19 +0000
(19:42 +0000)
committer
Bodo Möller
<bodo@openssl.org>
Sun, 2 Jul 2000 19:42:19 +0000
(19:42 +0000)
crypto/bn/bn_rand.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_rand.c
b/crypto/bn/bn_rand.c
index b1163f7ec44172078a4a15564862db72ed752233..21ecbc04ed0aa53e88a22a8f0e5b9935b4704b13 100644
(file)
--- a/
crypto/bn/bn_rand.c
+++ b/
crypto/bn/bn_rand.c
@@
-68,6
+68,12
@@
static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
int ret=0,bit,bytes,mask;
time_t tim;
+ if (bits == 0)
+ {
+ BN_zero(rnd);
+ return 1;
+ }
+
bytes=(bits+7)/8;
bit=(bits-1)%8;
mask=0xff<<bit;