Skip to content

Instantly share code, notes, and snippets.

@Yawning
Created July 10, 2014 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Yawning/330f55df5638577dd5cd to your computer and use it in GitHub Desktop.
Save Yawning/330f55df5638577dd5cd to your computer and use it in GitHub Desktop.
gpg2 patch to support RSA keys > 16384 bits
diff -uNr gnupg-2.0.22/g10/gpg.c gnupg-2.0.22-large-keys/g10/gpg.c
--- gnupg-2.0.22/g10/gpg.c 2013-10-04 12:32:53.000000000 +0000
+++ gnupg-2.0.22-large-keys/g10/gpg.c 2013-10-26 22:14:18.933010862 +0000
@@ -2050,7 +2050,7 @@
#endif
/* Initialize the secure memory. */
- if (!gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0))
+ if (!gcry_control (GCRYCTL_INIT_SECMEM, 131072, 0))
got_secmem = 1;
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
/* There should be no way to get to this spot while still carrying
diff -uNr gnupg-2.0.22/g10/keygen.c gnupg-2.0.22-large-keys/g10/keygen.c
--- gnupg-2.0.22/g10/keygen.c 2013-10-04 13:00:22.000000000 +0000
+++ gnupg-2.0.22-large-keys/g10/keygen.c 2013-10-26 22:14:47.506343401 +0000
@@ -1771,7 +1771,7 @@
static unsigned
ask_keysize (int algo, unsigned int primary_keysize)
{
- unsigned int nbits, min, def = DEFAULT_STD_KEYSIZE, max=4096;
+ unsigned int nbits, min, def = DEFAULT_STD_KEYSIZE, max=65536;
int for_subkey = !!primary_keysize;
int autocomp = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment