diff options
Diffstat (limited to 'g10/gpg.c')
-rw-r--r-- | g10/gpg.c | 68 |
1 files changed, 5 insertions, 63 deletions
@@ -254,7 +254,6 @@ enum cmd_and_opt_values oRFC2440Text, oNoRFC2440Text, oCipherAlgo, - oAEADAlgo, oDigestAlgo, oCertDigestAlgo, oCompressAlgo, @@ -383,7 +382,6 @@ enum cmd_and_opt_values oDefaultPreferenceList, oDefaultKeyserverURL, oPersonalCipherPreferences, - oPersonalAEADPreferences, oPersonalDigestPreferences, oPersonalCompressPreferences, oAgentProgram, @@ -675,7 +673,6 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_n (oEnableDSA2, "enable-dsa2", "@"), ARGPARSE_s_n (oDisableDSA2, "disable-dsa2", "@"), ARGPARSE_s_s (oPersonalCipherPreferences, "personal-cipher-preferences","@"), - ARGPARSE_s_s (oPersonalAEADPreferences, "personal-aead-preferences","@"), ARGPARSE_s_s (oPersonalDigestPreferences, "personal-digest-preferences","@"), ARGPARSE_s_s (oPersonalCompressPreferences, "personal-compress-preferences", "@"), @@ -855,7 +852,8 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_s (oS2KDigest, "s2k-digest-algo", "@"), ARGPARSE_s_s (oS2KCipher, "s2k-cipher-algo", "@"), ARGPARSE_s_i (oS2KCount, "s2k-count", "@"), - ARGPARSE_s_n (oForceAEAD, "force-aead", "@"), + ARGPARSE_s_n (oForceAEAD, "force-ocb", "@"), + ARGPARSE_s_n (oForceAEAD, "force-aead", "@"), /*(old name)*/ ARGPARSE_s_n (oRequireCrossCert, "require-backsigs", "@"), ARGPARSE_s_n (oRequireCrossCert, "require-cross-certification", "@"), ARGPARSE_s_n (oNoRequireCrossCert, "no-require-backsigs", "@"), @@ -876,7 +874,6 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_s (oDisableCipherAlgo, "disable-cipher-algo", "@"), ARGPARSE_s_s (oDisablePubkeyAlgo, "disable-pubkey-algo", "@"), ARGPARSE_s_s (oCipherAlgo, "cipher-algo", "@"), - ARGPARSE_s_s (oAEADAlgo, "aead-algo", "@"), ARGPARSE_s_s (oDigestAlgo, "digest-algo", "@"), ARGPARSE_s_s (oCertDigestAlgo, "cert-digest-algo", "@"), ARGPARSE_s_n (oOverrideComplianceCheck, "override-compliance-check", "@"), @@ -928,8 +925,6 @@ static gpgrt_opt_t opts[] = { /* Aliases. I constantly mistype these, and assume other people do as well. */ ARGPARSE_s_s (oPersonalCipherPreferences, "personal-cipher-prefs", "@"), - ARGPARSE_s_s (oPersonalAEADPreferences, "personal-aead-prefs", "@"), - ARGPARSE_s_s (oPersonalDigestPreferences, "personal-digest-prefs", "@"), ARGPARSE_s_s (oPersonalCompressPreferences, "personal-compress-prefs", "@"), /* These two are aliases to help users of the PGP command line @@ -972,6 +967,8 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_n (oNoop, "allow-multisig-verification", "@"), ARGPARSE_s_n (oNoop, "allow-multiple-messages", "@"), ARGPARSE_s_n (oNoop, "no-allow-multiple-messages", "@"), + ARGPARSE_s_s (oNoop, "aead-algo", "@"), + ARGPARSE_s_s (oNoop, "personal-aead-preferences","@"), ARGPARSE_group (302, N_( @@ -1113,18 +1110,6 @@ build_list_cipher_algo_name (int algo) } static int -build_list_aead_test_algo (int algo) -{ - return openpgp_aead_test_algo (algo); -} - -static const char * -build_list_aead_algo_name (int algo) -{ - return openpgp_aead_algo_name (algo); -} - -static int build_list_md_test_algo (int algo) { /* By default we do not accept MD5 based signatures. To avoid @@ -1145,7 +1130,7 @@ build_list_md_algo_name (int algo) static const char * my_strusage( int level ) { - static char *digests, *pubkeys, *ciphers, *zips, *aeads, *ver_gcry; + static char *digests, *pubkeys, *ciphers, *zips, *ver_gcry; const char *p; switch( level ) { @@ -1207,13 +1192,6 @@ my_strusage( int level ) build_list_cipher_test_algo ); p = ciphers; break; - case 36: - if (!aeads) - aeads = build_list ("AEAD: ", 'A', - build_list_aead_algo_name, - build_list_aead_test_algo); - p = aeads; - break; case 37: if( !digests ) digests = build_list(_("Hash: "), 'H', @@ -2251,7 +2229,6 @@ set_compliance_option (enum cmd_and_opt_values option) opt.escape_from = 1; opt.not_dash_escaped = 0; opt.def_cipher_algo = 0; - opt.def_aead_algo = 0; opt.def_digest_algo = 0; opt.cert_digest_algo = 0; opt.compress_algo = -1; @@ -2273,7 +2250,6 @@ set_compliance_option (enum cmd_and_opt_values option) opt.escape_from = 1; opt.not_dash_escaped = 0; opt.def_cipher_algo = 0; - opt.def_aead_algo = 0; opt.def_digest_algo = 0; opt.cert_digest_algo = 0; opt.compress_algo = -1; @@ -2291,7 +2267,6 @@ set_compliance_option (enum cmd_and_opt_values option) opt.escape_from = 0; opt.not_dash_escaped = 0; opt.def_cipher_algo = 0; - opt.def_aead_algo = 0; opt.def_digest_algo = 0; opt.cert_digest_algo = 0; opt.compress_algo = -1; @@ -2310,7 +2285,6 @@ set_compliance_option (enum cmd_and_opt_values option) case oDE_VS: set_compliance_option (oOpenPGP); opt.compliance = CO_DE_VS; - opt.def_aead_algo = 0; /* We divert here from the backward compatible rfc4880 algos. */ opt.s2k_digest_algo = DIGEST_ALGO_SHA256; opt.s2k_cipher_algo = CIPHER_ALGO_AES256; @@ -2391,14 +2365,12 @@ main (int argc, char **argv) const char *trustdb_name = NULL; #endif /*!NO_TRUST_MODELS*/ char *def_cipher_string = NULL; - char *def_aead_string = NULL; char *def_digest_string = NULL; char *compress_algo_string = NULL; char *cert_digest_string = NULL; char *s2k_cipher_string = NULL; char *s2k_digest_string = NULL; char *pers_cipher_list = NULL; - char *pers_aead_list = NULL; char *pers_digest_list = NULL; char *pers_compress_list = NULL; int eyes_only=0; @@ -2464,7 +2436,6 @@ main (int argc, char **argv) opt.bz2_compress_level = -1; /* defaults to standard compress level */ /* note: if you change these lines, look at oOpenPGP */ opt.def_cipher_algo = 0; - opt.def_aead_algo = 0; opt.def_digest_algo = 0; opt.cert_digest_algo = 0; opt.compress_algo = -1; /* defaults to DEFAULT_COMPRESS_ALGO */ @@ -3287,9 +3258,6 @@ main (int argc, char **argv) case oCipherAlgo: def_cipher_string = xstrdup(pargs.r.ret_str); break; - case oAEADAlgo: - def_aead_string = xstrdup (pargs.r.ret_str); - break; case oDigestAlgo: def_digest_string = xstrdup(pargs.r.ret_str); break; @@ -3571,9 +3539,6 @@ main (int argc, char **argv) case oPersonalCipherPreferences: pers_cipher_list=pargs.r.ret_str; break; - case oPersonalAEADPreferences: - pers_aead_list = pargs.r.ret_str; - break; case oPersonalDigestPreferences: pers_digest_list=pargs.r.ret_str; break; @@ -3964,13 +3929,6 @@ main (int argc, char **argv) if ( openpgp_cipher_test_algo (opt.def_cipher_algo) ) log_error(_("selected cipher algorithm is invalid\n")); } - if (def_aead_string) - { - opt.def_aead_algo = string_to_aead_algo (def_aead_string); - xfree (def_aead_string); def_aead_string = NULL; - if (openpgp_aead_test_algo (opt.def_aead_algo)) - log_error(_("selected AEAD algorithm is invalid\n")); - } if( def_digest_string ) { opt.def_digest_algo = string_to_digest_algo (def_digest_string); xfree(def_digest_string); def_digest_string = NULL; @@ -4031,9 +3989,6 @@ main (int argc, char **argv) keygen_set_std_prefs(pers_cipher_list,PREFTYPE_SYM)) log_error(_("invalid personal cipher preferences\n")); - if (pers_aead_list && keygen_set_std_prefs (pers_aead_list, PREFTYPE_AEAD)) - log_error(_("invalid personal AEAD preferences\n")); - if(pers_digest_list && keygen_set_std_prefs(pers_digest_list,PREFTYPE_HASH)) log_error(_("invalid personal digest preferences\n")); @@ -4118,12 +4073,6 @@ main (int argc, char **argv) badalg = openpgp_cipher_algo_name (opt.def_cipher_algo); badtype = PREFTYPE_SYM; } - else if(opt.def_aead_algo - && !algo_available(PREFTYPE_AEAD, opt.def_aead_algo, NULL)) - { - badalg = openpgp_aead_algo_name (opt.def_aead_algo); - badtype = PREFTYPE_AEAD; - } else if(opt.def_digest_algo && !algo_available(PREFTYPE_HASH,opt.def_digest_algo,NULL)) { @@ -4153,12 +4102,6 @@ main (int argc, char **argv) badalg, gnupg_compliance_option_string (opt.compliance)); break; - case PREFTYPE_AEAD: - log_info (_("AEAD algorithm '%s'" - " may not be used in %s mode\n"), - badalg, - gnupg_compliance_option_string (opt.compliance)); - break; case PREFTYPE_HASH: log_info (_("digest algorithm '%s'" " may not be used in %s mode\n"), @@ -4184,7 +4127,6 @@ main (int argc, char **argv) * is not. This is us being nice to the user informing her early * that the chosen algorithms are not available. We also check * and enforce this right before the actual operation. */ - /* FIXME: We also need to check the AEAD algo. */ if (opt.def_cipher_algo && ! gnupg_cipher_is_allowed (opt.compliance, cmd == aEncr |