summaryrefslogtreecommitdiff
path: root/src/global.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-08-28 09:40:39 +0000
committerWerner Koch <wk@gnupg.org>2006-08-28 09:40:39 +0000
commit9dba89cde740d7c518a73b869d07d6247e0e7488 (patch)
treef3f15bc215c20a02b6fb9f5c5691825aa3e48ec9 /src/global.c
parent5681a844ea16e74ededb45db7e9665b4ffd29045 (diff)
downloadlibgcrypt-9dba89cde740d7c518a73b869d07d6247e0e7488.tar.gz
Fixed a problem with shifting MPIs by 0.
Add a way to check whether the RNG is in fake mode.
Diffstat (limited to 'src/global.c')
-rw-r--r--src/global.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/global.c b/src/global.c
index f2faeb86..46a12be7 100644
--- a/src/global.c
+++ b/src/global.c
@@ -219,6 +219,13 @@ gcry_control (enum gcry_ctl_cmds cmd, ...)
_gcry_quick_random_gen (1);
break;
+ case GCRYCTL_FAKED_RANDOM_P:
+ /* Return an error if the RNG is faked one (i.e. enabled by
+ ENABLE_QUICK_RANDOM. */
+ if (_gcry_random_is_faked ())
+ err = GPG_ERR_GENERAL;
+ break;
+
case GCRYCTL_DUMP_RANDOM_STATS:
_gcry_random_dump_stats ();
break;
@@ -329,7 +336,7 @@ gcry_control (enum gcry_ctl_cmds cmd, ...)
case GCRYCTL_FAST_POLL:
/* We need to do make sure that the random pool is really
- initialized so that the poll fucntion is not a NOP. */
+ initialized so that the poll function is not a NOP. */
_gcry_random_initialize (1);
_gcry_fast_random_poll ();
break;