diff options
| author | Werner Koch <[email protected]> | 2018-07-24 07:50:02 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2018-07-24 07:58:02 +0000 |
| commit | 9aa1b368efd4edf51b6d056339bffb726de5162b (patch) | |
| tree | 0184b89acc35d6c7e7616da35b23382165257b27 /g10/gpg.c | |
| parent | Register DCO fo Michael Haubenwallner. (diff) | |
| download | gnupg-9aa1b368efd4edf51b6d056339bffb726de5162b.tar.gz gnupg-9aa1b368efd4edf51b6d056339bffb726de5162b.zip | |
gpg: Use 128 MiB as default AEAD chunk size.
* g10/gpg.c (oDebugAllowLargeChunks): New.
(opts): New option --debug-allow-large-chunks.
(main): Implement that option.
--
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/gpg.c')
| -rw-r--r-- | g10/gpg.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -225,6 +225,7 @@ enum cmd_and_opt_values oDebugAll, oDebugIOLBF, oDebugSetIobufSize, + oDebugAllowLargeChunks, oStatusFD, oStatusFile, oAttributeFD, @@ -634,6 +635,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oDebugAll, "debug-all", "@"), ARGPARSE_s_n (oDebugIOLBF, "debug-iolbf", "@"), ARGPARSE_s_u (oDebugSetIobufSize, "debug-set-iobuf-size", "@"), + ARGPARSE_s_u (oDebugAllowLargeChunks, "debug-allow-large-chunks", "@"), ARGPARSE_s_i (oStatusFD, "status-fd", "@"), ARGPARSE_s_s (oStatusFile, "status-file", "@"), ARGPARSE_s_i (oAttributeFD, "attribute-fd", "@"), @@ -2347,6 +2349,7 @@ main (int argc, char **argv) static int print_dane_records; static int print_pka_records; + static int allow_large_chunks; #ifdef __riscos__ @@ -2761,6 +2764,10 @@ main (int argc, char **argv) opt_set_iobuf_size_used = 1; break; + case oDebugAllowLargeChunks: + allow_large_chunks = 1; + break; + case oStatusFD: set_status_fd ( translate_sys2libc_fd_int (pargs.r.ret_int, 1) ); break; @@ -3884,15 +3891,15 @@ main (int argc, char **argv) /* Check chunk size. Please fix also the man page if you chnage * the default. The limits are given by the specs. */ if (!opt.chunk_size) - opt.chunk_size = 30; /* Default to 1 GiB chunks. */ + opt.chunk_size = 27; /* Default to the suggested max of 128 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 > 62) + else if (opt.chunk_size > (allow_large_chunks? 62 : 27)) { - opt.chunk_size = 62; + opt.chunk_size = (allow_large_chunks? 62 : 27); log_info (_("chunk size invalid - using %d\n"), opt.chunk_size); } |
