diff options
| author | Werner Koch <[email protected]> | 2026-09-11 11:13:02 +0200 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2026-09-11 11:13:02 +0200 |
| commit | 6803ce215ce5c2e9b0fcafd35afe4ffec75ba718 (patch) | |
| tree | 36b9cf98e6eb0c7eab89a1da2f0da7be0a9f0871 /sm | |
| parent | gpgconf,w32: Show more registry key of GpgOL. (diff) | |
| parent | gpg: Implictly set allow-9980 in de-vs compliance mode. (diff) | |
| download | gnupg-6803ce215ce5c2e9b0fcafd35afe4ffec75ba718.tar.gz gnupg-6803ce215ce5c2e9b0fcafd35afe4ffec75ba718.zip | |
Merge branch 'wk/rfc9980'
--
After 25 years the NSA could even convince GnuPG that their idea of
using complex algorithm is better for someones(tm) security. But
fortunately there is no need to enable it. Thus all guards of pretty
good and gnu privacy won't enable --compliance=fips|de-vs or use the
option --allow-9980.
Diffstat (limited to 'sm')
| -rw-r--r-- | sm/decrypt.c | 2 | ||||
| -rw-r--r-- | sm/gpgsm.c | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/sm/decrypt.c b/sm/decrypt.c index b4dbceb35..6138326d6 100644 --- a/sm/decrypt.c +++ b/sm/decrypt.c @@ -559,7 +559,7 @@ ecdh_derive_kek (unsigned char *kek_key, unsigned int kek_len, if (err) return err; - err = gnupg_ecc_kem_kdf (kek_key, kek_len, 0, hash_algo, + err = gnupg_ecc_kem_kdf (kek_key, kek_len, GCRY_KDF_X963_KDF, hash_algo, secret, secretlen, (char *)kdf_params, kdf_params_len); return err; diff --git a/sm/gpgsm.c b/sm/gpgsm.c index a4c222b55..c4442f5da 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -110,6 +110,7 @@ enum cmd_and_opt_values { oDebugNoChainValidation, oDebugIgnoreExpiration, oDebugForceECDHSHA1KDF, + oDebugNoLibgcrypt, oLogFile, oNoLogFile, oAuditLog, @@ -297,6 +298,7 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_n (oDebugNoChainValidation, "debug-no-chain-validation", "@"), ARGPARSE_s_n (oDebugIgnoreExpiration, "debug-ignore-expiration", "@"), ARGPARSE_s_n (oDebugForceECDHSHA1KDF, "debug-force-ecdh-sha1kdf", "@"), + ARGPARSE_s_n (oDebugNoLibgcrypt, "debug-no-libgcrypt", "@"), ARGPARSE_s_s (oLogFile, "log-file", N_("|FILE|write server mode logs to FILE")), ARGPARSE_s_n (oNoLogFile, "no-log-file", "@"), @@ -562,8 +564,16 @@ static unsigned int parent_cache_stats; #define DEFAULT_CIPHER_ALGO "AES256-CBC" #define DEFAULT_CIPHER_ALGO_DE_VS "AES256-GCM" -/* A flag to track whether --cipher-algo was used. */ -static int cipher_algo_option_seen; +/* + * Collection of options used only in this module. + */ +static struct { + /* A flag to track whether --cipher-algo was used. */ + unsigned int cipher_algo_option_seen; + /* Do not enable Libgcrypt debugging. */ + unsigned int no_libgcrypt_debug; +} mopt; + static char *build_list (const char *text, const char *(*mapf)(int), int (*chkf)(int)); @@ -824,9 +834,9 @@ set_debug (void) if (opt.debug) opt.quiet = 0; - if (opt.debug & DBG_MPI_VALUE) + if ((opt.debug & DBG_MPI_VALUE) && !mopt.no_libgcrypt_debug) gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 2); - if (opt.debug & DBG_CRYPTO_VALUE ) + if ((opt.debug & DBG_CRYPTO_VALUE) && !mopt.no_libgcrypt_debug) gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1); gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose); @@ -1330,6 +1340,7 @@ main ( int argc, char **argv) case oDebugNoChainValidation: opt.no_chain_validation = 1; break; case oDebugIgnoreExpiration: opt.ignore_expiration = 1; break; case oDebugForceECDHSHA1KDF: opt.force_ecdh_sha1kdf = 1; break; + case oDebugNoLibgcrypt: mopt.no_libgcrypt_debug = 1; break; case oCompatibilityFlags: if (parse_compatibility_flags (pargs.r.ret_str, &opt.compat_flags, @@ -1468,7 +1479,7 @@ main ( int argc, char **argv) case oCipherAlgo: opt.def_cipher_algoid = pargs.r.ret_str; - cipher_algo_option_seen = 1; + mopt.cipher_algo_option_seen = 1; break; case oDisableCipherAlgo: @@ -1732,7 +1743,7 @@ main ( int argc, char **argv) /* In de-vs mode switch the default cipher. */ - if (!cipher_algo_option_seen && opt.compliance == CO_DE_VS) + if (!mopt.cipher_algo_option_seen && opt.compliance == CO_DE_VS) opt.def_cipher_algoid = DEFAULT_CIPHER_ALGO_DE_VS; /* Must do this after dropping setuid, because the mapping functions |
