aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/rsa.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-11-10Do not use C99 feature.Dario Niedermann1-3/+4
* cipher/rsa.c (secret): Move var decl to the beginning. -- Trivial patch; ChangeLog written by wk. Signed-off-by: Werner Koch <[email protected]>
2017-07-07rsa: Reduce secmem pressure.NIIBE Yutaka1-1/+8
* cipher/rsa.c (secret): Don't keep secmem. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-07-07rsa: Allow different build directory.NIIBE Yutaka1-1/+1
* cipher/Makefile.am (AM_CPPFLAGS): Add mpi dirs. * cipher/rsa.c: Change include file. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-07-07rsa: Add exponent blinding.Marcus Brinkmann1-4/+29
* cipher/rsa.c (secret_core_crt): Blind secret D with randomized nonce R for mpi_powm computation. -- Backport of libgcrypt 8725c99ffa41778f382ca97233183bcd687bb0ce. Signed-off-by: Marcus Brinkmann <[email protected]>
2015-09-01Obsolete option --no-sig-create-check.Werner Koch1-1/+12
* cipher/rsa.c (rsa_sign): Verify after sign. * g10/gpg.c (opts): Make --no-sig-create-check a NOP. * g10/options.h (opt): Remove field "no_sig_create_check". * g10/sign.c (do_sign): Do check only for DSA. Signed-off-by: Werner Koch <[email protected]>
2013-12-03Normalize the MPIs used as input to secret key functions.Werner Koch1-4/+18
* cipher/rsa.c (secret): Normalize the INPUT. (rsa_decrypt): Pass reduced data to secret. * cipher/elgamal.c (decrypt): Normalize A and B. * cipher/dsa.c (sign): Normalize HASH. -- mpi_normalize is in general not required because extra leading zeroes do not harm the computation. However, adding extra all zero limbs or padding with multiples of N may be useful in side-channel attacks. In particular they are used by the acoustic crypt-analysis. This is an extra pre-caution which alone would not be sufficient to mitigate the described attack. CVE-id: CVE-2013-4576 Signed-off-by: Werner Koch <[email protected]>
2013-12-03Use blinding for the RSA secret operation.Werner Koch1-17/+41
* 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
2007-10-23Switched to GPLv3.Werner Koch1-4/+2
Updated gettext.
2006-12-11Removed the use of g10defs.h.Werner Koch1-11/+11
This required some code cleanups and the introduction of a few accessor ducntions in mpi.
2006-06-28* rsa.c (generate): Use e=65537 for new RSA keys.David Shaw1-13/+9
2005-07-27Converted all m_free to xfree etc.Werner Koch1-2/+2
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2004-09-23Note: I have not fully tested the new key creation due to a pc/scWerner Koch1-1/+2
error. However the backupfile has been created successfully. * rsa.c (rsa_generate): Return the dummy list of factors only if the caller asked for it. * card_util.c (generate_card_keys): ask whether backup should be created. (card_store_subkey): Factored some code out to .. * keygen.c (save_unprotected_key_to_card): .. new function. (gen_card_key_with_backup): New. (generate_raw_key): New. (generate_keypair): New arg BACKUP_ENCRYPTION_DIR. Changed all callers. (do_generate_keypair): Divert to gen_card_key_with_backup when desired.
2003-12-17* dsa.h, dsa.c (dsa_verify), elgamal.h, elgamal.c (elg_verify), rsa.h,David Shaw1-3/+1
rsa.c (rsa_verify), pubkey.c (dummy_verify, pubkey_verify): Remove old unused code.
2003-05-24* bithelp.h, des.c, random.c, rndlinux.c, sha1.c, blowfish.c, elgamal.c,David Shaw1-6/+3
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.
2002-06-29Update head to match stable 1.0David Shaw1-0/+494
2000-12-19Removed files from the HEAD revision, because they are now in anotherWerner Koch1-468/+0
repository
2000-11-14Some configuration changesWerner Koch1-20/+20
2000-10-04See ChangeLog: Wed Oct 4 13:16:18 CEST 2000 Werner KochWerner Koch1-4/+1
2000-09-18See ChangeLog: Mon Sep 18 16:35:45 CEST 2000 Werner KochWerner Koch1-20/+116
2000-07-14See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch1-0/+375
1997-12-12added option file handlingWerner Koch1-214/+0
1997-12-09fingerprints and self signatures addedWerner Koch1-0/+16
1997-11-24ElGamal funktioniert und ist defaultWerner Koch1-4/+4
1997-11-19Output armor works, RSA keygen works.Werner Koch1-15/+22
1997-11-18initially checkinWerner Koch1-0/+191