From ad3dabc9fb64372ffcb31916b32506956a89eea9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 27 Aug 2021 12:05:50 +0200 Subject: [PATCH] gpg: Change default and max AEAD chunk size to 4 MiB -- This is per OpenPGP WG design team decision from 2021-08-13 (raising a new wall after exactly 60 years ;-) Signed-off-by: Werner Koch --- doc/gpg.texi | 2 +- g10/gpg.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/gpg.texi b/doc/gpg.texi index 81dab5952..5919366d8 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -2391,7 +2391,7 @@ receiving side can check for transmission errors or tampering at the end of each chunk and does not need to delay this until all data has been received. The used chunk size is 2^@var{n} byte. The lowest allowed value for @var{n} is 6 (64 byte) and the largest is the -default of 27 which creates chunks not larger than 128 MiB. +default of 22 which creates chunks not larger than 4 MiB. @item --input-size-hint @var{n} @opindex input-size-hint diff --git a/g10/gpg.c b/g10/gpg.c index 54f7eb542..f3d645d4a 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -3974,15 +3974,15 @@ main (int argc, char **argv) /* Check chunk size. Please fix also the man page if you change * the default. The limits are given by the specs. */ if (!opt.chunk_size) - opt.chunk_size = 27; /* Default to the suggested max of 128 MiB. */ + opt.chunk_size = 22; /* Default to the suggested max of 4 MiB. */ else if (opt.chunk_size < 6) { opt.chunk_size = 6; log_info (_("chunk size invalid - using %d\n"), opt.chunk_size); } - else if (opt.chunk_size > (allow_large_chunks? 62 : 27)) + else if (opt.chunk_size > (allow_large_chunks? 62 : 22)) { - opt.chunk_size = (allow_large_chunks? 62 : 27); + opt.chunk_size = (allow_large_chunks? 62 : 22); log_info (_("chunk size invalid - using %d\n"), opt.chunk_size); }