aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/random.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-08-17random: Hash continuous areas in the csprng pool.Werner Koch1-8/+7
* cipher/random.c (mix_pool): Store the first hash at the end of the pool. -- This fixes a long standing bug (since 1998) in Libgcrypt and GnuPG. An attacker who obtains 580 bytes of the random number from the standard RNG can trivially predict the next 20 bytes of output. This bug does not affect the default generation of keys because running gpg for key creation creates at most 2 keys from the pool: For a single 4096 bit RSA key 512 byte of random are required and thus for the second key (encryption subkey), 20 bytes could be predicted from the the first key. However, the security of an OpenPGP key depends on the primary key (which was generated first) and thus the 20 predictable bytes should not be a problem. For the default key length of 2048 bit nothing will be predictable. For the former default of DSA+Elgamal key it is complicate to give an answer: For 2048 bit keys a pool of 30 non-secret candidate primes of about 300 bits each are first created. This reads at least 1140 bytes from the pool and thus parts could be predicted. At some point a 256 bit secret is read from the pool; which in the worst case might be partly predictable. The bug was found and reported by Felix Dörre and Vladimir Klebanov, Karlsruhe Institute of Technology. A paper describing the problem in detail will shortly be published. CVE-id: CVE-2016-6313 Signed-off-by: Werner Koch <[email protected]>
2016-08-17cipher: Improve readability by using a macro.Werner Koch1-2/+2
* cipher/random.c (mix_pool): Use DIGESTLEN instead of 20. Signed-off-by: Werner Koch <[email protected]>
2013-12-03Use blinding for the RSA secret operation.Werner Koch1-0/+12
* cipher/random.c (randomize_mpi): New. * g10/gpgv.c (randomize_mpi): New stub. * cipher/rsa.c (USE_BLINDING): Define macro. (secret): Implement blinding. -- GPG 1.x has never used any protection against timing attacks on the RSA secret operation. The rationale for this has been that there was no way to mount a remote timing attack on GnuPG. With the turning up of Acoustic Cryptanalysis (http://cs.tau.ac.il/~tromer/acoustic) this assumption no longer holds true and thus we need to do do something about it. Blinding seems to be a suitable mitigation to the threat of key extraction. It does not help against distinguishing used keys, though. Note that GPG 2.x uses Libgcrypt which does blinding by default. The performance penalty is negligible: Modifying the core pubkey_sign or pubkey_decrypt function to run 100 times in a loop, the entire execution times for signing or decrypting a small message using a 4K RSA key on a Thinkpad X220 are Without blinding: 5.2s (8.9s) With blinding: 5.6s (9.3s) The numbers in parentheses give the values without the recently implemented k-ary exponentiation code. Thus for the next release the user will actually experience faster signing and decryption. A drawback of blinding is that we need random numbers even for decryption (albeit at low quality). Signed-off-by: Werner Koch <[email protected]> CVE-id: CVE-2013-4576
2012-11-07Improve handling of random_seed read errors.Werner Koch1-1/+25
* cipher/random.c (read_seed_file): Distinguish between errors and short reads. -- This should help to avoid program aborts due to races. Nevertheless a better and cross-platform locking would be a more solid solution. GnuPG-bug-id: 1439
2012-11-07Remove trailing white space from one fileWerner Koch1-10/+10
--
2012-01-24Fix typos in comments.Werner Koch1-2/+2
-- Fixes provided by Gilles Espinasse.
2010-09-28Minor changes to help the VMS portWerner Koch1-3/+48
2007-10-23Switched to GPLv3.Werner Koch1-4/+2
Updated gettext.
2006-11-29Preparing an RCWerner Koch1-1/+1
2006-02-14about to release 1.4.3rc1gnupg-1.4.3rc1Werner Koch1-2/+2
2006-02-09Lock random seed fileWerner Koch1-1/+86
2005-07-27Converted all m_free to xfree etc.Werner Koch1-10/+10
2005-06-07* random.c: Fix prototype of the fast random gatherer. Noted by JoeDavid Shaw1-2/+2
Vender.
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2003-08-28* idea-stub.c, random.c; s/__MINGW32__/_WIN32/ to help building on nativeDavid Shaw1-2/+5
Windows compilers. Requested by Brian Gladman. From Werner on stable branch.
2003-08-21* random.c (getfnc_gather_random): Don't check NAME_OF_DEV_RANDOM twice.David Shaw1-1/+1
Use NAME_OF_DEV_URANDOM.
2003-05-24* bithelp.h, des.c, random.c, rndlinux.c, sha1.c, blowfish.c, elgamal.c,David Shaw1-32/+30
rijndael.c, rndunix.c, sha256.c, cast5.c, idea-stub.c, rmd160.c, rndw32.c, sha512.c, md5.c, rmd160test.c, rsa.c, tiger.c: Edit all preprocessor instructions to remove whitespace before the '#'. This is not required by C89, but there are some compilers out there that don't like it.
2003-05-15* cipher.c (setup_cipher_table): #ifdef IDEA.David Shaw1-5/+7
* random.c (fast_random_poll): Only use times() if we HAVE_TIMES. * sha512.c, tiger.c: Use the U64_C() macro to specify 64-bit constants. U64_C is defined in include/types.h and uses the correct suffix depending on the underlying type of u64. * idea-stub.c (load_module): Catch an error if the idea module file is unloadable for some reason (unreadable, bad permissions, etc.) * md.c (string_to_digest_algo): Give a warning about TIGER192 not being part of OpenPGP.
2002-11-06* rndw32.c [__CYGWIN32__]: Don't include winioctl.h - it is not requiredDavid Shaw1-11/+11
anymore. (From Werner) * random.c (read_seed_file,update_random_seed_file): Use binary mode for __CYGWIN__. (From Werner) * blowfish.c (burn_stack), cast5.c (burn_stack), des.c (burn_stack), md5.c (burn_stack), random.c (burn_stack, read_pool, fast_random_poll), rijndael.c (burn_stack), rmd160.c (burn_stack), rndegd.c (rndegd_gather_random), rndlinux.c (rndlinux_gather_random), sha1.c (burn_stack), tiger.c (burn_stack), twofish.c (burn_stack): Replace various calls to memset() with the more secure wipememory().
2002-08-30* random.c: Automagically detect the entrop gatherer whenWerner Koch1-9/+38
configure so. * rndegd.c (rndegd_connect_socket): New. Factored out from .. (rndegd_gather_random): here and call it. (do_read): Update the counter variables correctly. This was not a problem due to the way EGD works. Bug found by Christian Biere.
2002-08-03RISC OS changes due to dynload removalStefan Bellon1-0/+3
2002-08-03The big extension module removal.Werner Koch1-6/+36
2002-07-25* random.c: "warning" -> "WARNING"David Shaw1-1/+1
2002-06-29Update head to match stable 1.0David Shaw1-0/+687
2000-12-19Removed files from the HEAD revision, because they are now in anotherWerner Koch1-690/+0
repository
2000-09-18See ChangeLog: Mon Sep 18 16:35:45 CEST 2000 Werner KochWerner Koch1-1/+3
2000-07-17See ChangeLog: Mon Jul 17 16:35:47 CEST 2000 Werner KochWerner Koch1-2/+2
2000-07-14See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch1-5/+199
1999-12-08See ChangeLog: Wed Dec 8 21:58:32 CET 1999 Werner KochWerner Koch1-1/+0
1999-11-19See ChangeLog: Fri Nov 19 17:15:20 CET 1999 Werner KochWerner Koch1-3/+8
1999-11-15See ChangeLog: Mon Nov 15 21:36:02 CET 1999 Werner KochWerner Koch1-1/+0
1999-11-13See ChangeLog: Sat Nov 13 17:44:23 CET 1999 Werner KochWerner Koch1-13/+27
1999-07-02See ChangeLog: Fri Jul 2 11:45:54 CEST 1999 Werner KochWerner Koch1-6/+46
1999-05-23See ChangeLog: Sun May 23 14:20:22 CEST 1999 Werner KochWerner Koch1-0/+2
1999-05-17See ChangeLog: Mon May 17 21:54:43 CEST 1999 Werner KochWerner Koch1-1/+3
1999-04-18See ChangeLog: Sun Apr 18 10:11:28 CEST 1999 Werner KochWerner Koch1-1/+1
1999-04-06See ChangeLog: Tue Apr 6 19:58:12 CEST 1999 Werner KochWerner Koch1-2/+7
1999-02-16See ChangeLog: Tue Feb 16 14:10:02 CET 1999 Werner KochWerner Koch1-1/+1
1999-02-10See ChangeLog: Wed Feb 10 17:15:39 CET 1999 Werner KochWerner Koch1-10/+1
1999-01-12See ChangeLog: Tue Jan 12 11:17:18 CET 1999 Werner KochWerner Koch1-0/+7
1999-01-09See ChangeLog: Sat Jan 9 18:54:57 CET 1999 Werner KochWerner Koch1-3/+0
1999-01-09See ChangeLog: Sat Jan 9 16:02:23 CET 1999 Werner KochWerner Koch1-4/+0
1998-12-29See ChangeLog: Tue Dec 29 14:41:47 CET 1998 Werner KochWerner Koch1-0/+6
1998-12-23See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner KochWerner Koch1-3/+3
1998-12-14See ChangeLog: Mon Dec 14 21:18:49 CET 1998 Werner KochWerner Koch1-32/+28
1998-12-12See ChangeLog: Sat Dec 12 18:40:32 CET 1998 Werner KochWerner Koch1-0/+2
1998-12-10See ChangeLog: Thu Dec 10 20:15:36 CET 1998 Werner KochWerner Koch1-13/+44
1998-11-25Restructured the RNG source and add support for loadableWerner Koch1-7/+136
random modules.
1998-08-11bug fix releaseV0-3-4Werner Koch1-0/+2
1998-08-07chnages done at the trainWerner Koch1-33/+5