aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-01-31gpg: Make "--list-options show-sig-subpackets=n,m" work again.Werner Koch1-4/+11
* g10/gpg.c (parse_list_options): Set value for show-sig-subpackets. -- Fixes-commit: 811cfa34cb3e7166f0cf1f94565504dee21cd9f5 and thus a regression in 2.4.0
2023-01-30gpg: For readibility use macro instead of integers in key-clean.Werner Koch1-34/+42
* g10/key-clean.c (NF_USABLE, NF_CONSIDER): New. (NF_PROCESSED, NF_REVOC, NF_NOKEY): New.
2023-01-20gpg: Replace --override-compliance-check by a real fix.Werner Koch3-25/+3
* common/compliance.c (gnupg_pk_is_allowed): Handle EdDSA. * g10/gpg.c (oOverrideComplianceCheck): Remove. (opts): Turn --override-compliance-check into a dummy option. * g10/options.h (opt): Remove override_compliance_check. * g10/sig-check.c (check_key_verify_compliance): Remove use of that option. -- The introduction of --override-compliance-check actually hid the real cause for the signature verification problem in de-vs mode for the Ed25519 key. The real fix is to handle the EdDSA algorithm in gnupg_pk_is_allowed. Fixes-commit: fb26e144adfd93051501d58f5d0d4f8826ddf436 GnuPG-bug-id: 5655
2023-01-20gpg: Do not require --status-fd along with --require-compliance.Werner Koch1-1/+1
* g10/mainproc.c (check_sig_and_print): Do not check whether status is enabled when checking compliance.
2023-01-19gpg: Detect already compressed data also when using a pipe.Werner Koch4-7/+49
* common/iobuf.c (file_filter_ctx_t): Add fields for the peek feature. (file_filter): Implement peeking. (iobuf_ioctl): Add new IOBUF_IOCTL_PEEK. * common/iobuf.h (IOBUF_IOCTL_PEEK, IOBUFCTRL_PEEK): New. * common/miscellaneous.c (is_file_compressed): Rewrite. Detect PDF. * g10/encrypt.c (encrypt_simple): Peek before detecting compression. (encrypt_crypt): Ditto. * g10/sign.c (sign_file): Also detect already compressed data. * g10/options.h (opt): Add explicit_compress_option. * g10/gpg.c (main): Set opt.explicit_compress_option for -z. -- Note that this patch also introduces a compression check for signing which was never done in the past. GnuPG-bug-id: 6332
2022-12-16gpg: Fix a typo in a rarely shown diagnosticWerner Koch1-2/+1
--
2022-12-16gpg: Do not continue the export after a cancel for the primary key.Werner Koch1-1/+10
* g10/export.c (do_export_one_keyblock): Handle a cancel for the primary key special. -- GnuPG-bug-id: 6093
2022-12-16gpg: Replace use of PRIu64 in log_debugWerner Koch2-8/+10
* g10/cipher-aead.c (do_flush): Use %llu and a cast. * g10/decrypt-data.c (aead_underflow): Ditto. -- Fixes-commit: b2cedc108d5cabb07f496c31c11c9cba6f328f76 We don't use the system's printf but the one implemented by us (gpgrt's estream-printf) thus the PRIu64 may or may not be correct. We can't do much about the -Wformat errors due to our different implementation.
2022-12-16doc: Typo fixesWerner Koch1-1/+1
-- Reported-by: Andreas Metzler GnuPG-bug-id: 6309
2022-12-09build: Remove Windows CE support.NIIBE Yutaka1-6/+4
* agent/Makefile.am [HAVE_W32CE_SYSTEM]: Remove. * am/cmacros.am [HAVE_W32CE_SYSTEM]: Remove. * autogen.sh: Remove W32ce_ variables. * configure.ac: Likewise. * dirmngr/Makefile.am (extra_bin_ldflags): Remove. * g10/Makefile.am [HAVE_W32CE_SYSTEM]: Remove. * kbx/Makefile.am: Likewise. * sm/Makefile.am (extra_bin_ldflags): Remove. * tools/Makefile.am (extra_bin_ldflags): Remove. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-12-06wkd: Do not send/install/mirror expired user ids.Werner Koch1-2/+2
* tools/gpg-wks.h (struct uidinfo_list_s): Add fields expired and revoked. * tools/wks-util.c (append_to_uidinfo_list): Add args expired and revoked. (set_expired_revoked): New. (wks_list_key): Set expired and revoked. (wks_cmd_install_key): Skip expired uids. * tools/gpg-wks-client.c (command_check): Print flags. (command_send): Ignore expired keys. (mirror_one_key): Ditto. * g10/export.c (do_export_stream): Silence warning. -- GnuPG-bug-id: 6292
2022-12-02gpg: New export option "mode1003".Werner Koch8-25/+276
* agent/command.c (cmd_export_key): Add option --mode1003. (command_has_option): Ditto. * g10/build-packet.c (do_key): Implement mode 1003. * g10/parse-packet.c (parse_key): Ditto. * g10/options.h (EXPORT_MODE1003): New.o * g10/call-agent.c (agent_export_key): Add arg mode1003. * g10/export.c (parse_export_options): Add "mode1003" (secret_key_to_mode1003): New. (receive_seckey_from_agent): Add arg mode1003. (do_export_one_keyblock): Pass option down. -- This option allows to export a secret key in GnuPG's native format. Thus no re-encryption is required and further the public key parameters are also authenticated if a protection passphrase has been used. Note that --import is not yet able to handle this new mode. Although old version of GnuPG will bail out with "invalid packet" if a mode1003 exported secret key is seen.
2022-12-02gpg: Remove a mostly duplicated function.Werner Koch3-81/+36
* g10/export.c (receive_seckey_from_agent): Add arg r_key. (do_export_one_keyblock): Pass NULL for new arg. (receive_raw_seckey_from_agent): Remove. (export_secret_ssh_key): Use receive_seckey_from_agent. * g10/keygen.c (card_store_key_with_backup): Pass NULL for new arg.
2022-12-01tests: Support semihosted environment.NIIBE Yutaka1-3/+4
* Makefile.am (check-all): Add EXEEXT. * agent/all-tests.scm: Append EXEEXT. * common/all-tests.scm: Likewise. * g10/all-tests.scm: Likewise. * g13/all-tests.scm: Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-28gpg: New export-filter export-revocsWerner Koch2-6/+119
* g10/options.h (EXPORT_REVOCS): New. * g10/export.c (export_select_filter): New. (struct export_filter_attic_s): Add field. (cleanup_export_globals): Cleanup. (parse_export_options): Add option "export-revocs". (parse_and_set_export_filter): Parse the select type. (do_export_revocs): New. (do_export_stream): Add a way to select things for export.
2022-11-28gpg: Fix double-free in gpg --card-edit.NIIBE Yutaka1-1/+0
* g10/card-util.c (change_name): Don't free ISONAME here. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-28gpg: Make --require-compliance work with out --status-fdWerner Koch1-1/+1
* g10/mainproc.c (proc_encrypted): Set complaince_de_vs also if require-compliance is set. -- Without this fix require-compliance would fail if no --status-fd was used.
2022-11-25gpg: New option --list-filterWerner Koch6-12/+165
* g10/gpg.c (oListFilter): New. (opts): Add --list-filter. (main): Parse oListFilter. * g10/keylist.c: Include init.h and recsel.h. (struct list_filter_s, list_filter): New. (release_list_filter): New. (cleanup_keylist_globals): New. (parse_and_set_list_filter): New. (list_keyblock): Implement --list-filter type "select". * g10/import.c (impex_filter_getval): Add scope support and new property names "key-size", "algostr", "origin", "lastupd", and "url". -- This option is pretty useful to select keys based on their properties. The scope thing can be sued to limit a selection to just the primary key or to subkeys. For example: gpg -k --list-filter 'select=revoked-f && sub/algostr=ed25519' Lists all non-revoked keys with an ed25519 (signing)-subkey.
2022-11-10gpg: Fix verification of cleartext signatures with overlong lines.Werner Koch1-5/+24
* g10/armor.c (fake_packet): Indicate truncated lines by inserting a formfeed. (armor_filter): Replace assert by log_assert. -- Reported-by: Demi Marie Obenour GnuPG-bug-id: T6272
2022-11-09gpg: Move w32_system function.NIIBE Yutaka3-117/+108
* g10/exec.h (w32_system): Not exposed. * g10/exec.c (w32_system): Move to ... * g10/photoid.c: here. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-04gpg: New option --quick-update-pref.Werner Koch4-10/+65
* g10/gpg.c (aQuickUpdatePref): New. (opts): Add --quick-update-pref. (main): Implement. * g10/keyedit.c (keyedit_quick_update_pref): New. (menu_set_preferences): Add arg 'unattended' and adjust caller. -- This new quick command is in particular useful to update existing keys so that they can be used with OCB mode.
2022-11-04gpg: New list-options show-pref and show-pref-verbose.Werner Koch5-150/+181
* g10/options.h (LIST_SHOW_PREF): New. (LIST_SHOW_PREF_VERBOSE): New. * g10/gpg.c (parse_list_options): Add new options. * g10/keyedit.c (show_prefs): Factor code out to ... * g10/keylist.c (show_preferences): new. (list_keyblock_print): Call show_preferences.
2022-11-02gpg: Make --list-packets work w/o --no-armor for plain OCB packets.Werner Koch1-0/+1
* g10/armor.c (is_armored): Add PKT_ENCRYPTED_AEAD. -- With this fix it is now possible to feed a vanilla packet of type 20 without first forcing gpg to assume binary mode.
2022-10-31gpg: Merge --rfc4880bis features into --gnupgWerner Koch2-50/+15
* g10/gpg.c (oRFC4880bis): Remove. (opts): Make --rfc4880bis a Noop. (compliance_options): Make rfc4880bis to gnupg. (set_compliance_option): Remove rfc4880bis stuff. (main): Ditto. Note that this now activates the --mimemode option. * g10/keygen.c (keygen_set_std_prefs): Remove rfc4880bis protection. (keygen_upd_std_prefs): Always announce support for v5 keys. (read_parameter_file): Activate the v4 and v5 keywords. --
2022-10-31gpg: Allow only OCB for AEAD encryption.Werner Koch7-117/+8
* g10/gpg.c (opts): New option--force-ocb as alias for force-aead. Turn --aead-algo and --personal-aead-preferences into dummy options. (build_list_md_test_algo, build_list_aead_algo_name): Remove. (my_strusage): Remove output of AEAD algos. (main): Remove code from the --aead options. * g10/encrypt.c (encrypt_seskey): Make file local. (use_aead): Remove requirement for rfc4880bis. Always return AEAD_ALGO_OCB. * g10/main.h (DEFAULT_AEAD_ALGO): Removed unused macro. * g10/misc.c (default_aead_algo): Remove. * g10/pkclist.c (select_aead_from_pklist): Return AEAD_ALGO_OCB or 0. (select_algo_from_prefs): Remove personal AEAD algo setting. * g10/keygen.c (keygen_set_std_prefs): Remove AEAD preference option parsing. * g10/options.h (opt): Remove def_aead_algo and personal_aead_prefs. -- Due to the meanwhile expired patent on OCB there is no more reason for using EAX. Thus we forcefully use OCB if the AEAD feature flag is set on a key.
2022-10-31gpg: New option --compatibility-flagsWerner Koch2-1/+27
* g10/gpg.c (oCompatibilityFlags): New. (opts): Add option. (compatibility_flags): New list. (main): Set flags and print help. * g10/options.h (opt): Add field compatibility_flags. -- No flags are yet defined but it is good to have the framework.
2022-10-28gpg: Fix trusted introducer for user-ids with only the mbox.Werner Koch1-19/+31
* g10/trustdb.c (check_regexp): Kludge to match user-ids with only an mbox. -- (Also re-indented the function) GnuPG-bug-id: 6238
2022-10-28gpg: Import stray revocation certificates.Werner Koch3-13/+65
* g10/kbnode.c (new_kbnode2): New. * g10/import.c (delete_inv_parts): New arg r_otherrevsigs to store misplaced revocations. (import_revoke_cert): Allow to pass an entire list. (import_one): Import revocations found by delete_inv_parts. -- It might be useful to distribute revocations of old keys along with new keys. This is in particicualrr useful for WKD stored keys. This patch allows to put unrelated standalone revocations into a key. For example they can simply appended to a keyblock. Right now it is a bit inaesthetic to see diagnostics about misplaced or bad revocation signatures.
2022-10-18gpg: Move NETLIBS after GPG_ERROR_LIBS.NIIBE Yutaka1-6/+6
* g10/Makefile.am (LDADD): Remove NETLIBS. (gpg_LDADD, gpgv_LDADD): Add NETLIBS after GPG_ERROR_LIBS. ((t_keydb_LDADD, t_keydb_get_keyblock_LDADD): Likewise. (t_stutter_LDADD): Likewise. -- Forward port 2.2 commit of: b26bb03ed96f380ad603f7ad902862625233c931 GnuPG-bug-id: 6244 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-10-14gpg: Use GCRY_KDF_ONESTEP_KDF with newer libgcrypt in future.NIIBE Yutaka1-0/+23
* g10/ecdh.c (derive_kek): Use GCRY_KDF_ONESTEP_KDF. -- This change is not yet enabled. We will be able to use the code when we update NEED_LIBGCRYPT_VERSION to 1.11.0. Before the update, gpg compiled with libgcrypt 1.11.0 can't work with older libgcrypt runtime. GnuPG-bug-id: 5964 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-10-07gpg: Fix wrong use of FD2INT with iobuf_fdopen_nc.NIIBE Yutaka2-3/+3
* g10/decrypt.c (decrypt_message_fd): Use INPUT_FD directly. * g10/encrypt.c (encrypt_crypt): Use FILEFD directly. -- Before 8402815d, original code was with iobuf_open_fd_or_name, which used gnupg_fd_t for the file descriptor (FD2INT was relevant at that time). After the change, because it's not gnupg_fd_t but int, use of FD2INT is irrelevant. Fixes-commit: 8402815d8e0e04a44362968f88b3d484d2395402 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-09-30gpg: Show just keyserver and port with --send-keys.Werner Koch1-0/+25
* g10/call-dirmngr.c (ks_status_cb): Mangle the keyserver url
2022-09-29gpg: Avoid to emit a compliance mode line if libgcrypt is non-compliant.Werner Koch1-2/+7
* g10/encrypt.c (check_encryption_compliance): Check gcrypt compliance before emitting an ENCRYPTION_COMPLIANCE_MODE status. -- GnuPG-bug-id: 6221 Ported-from: 07c6743148d4abd30fb8bf08b07eb9755fdfff2d
2022-09-29gpg: Fix assertion failure due to errors in encrypt_filter.Werner Koch2-1/+5
* common/iobuf.c (iobuf_copy): Use log_assert. Explicitly cast error return value. * g10/build-packet.c (do_plaintext): Check for iobuf_copy error. * g10/encrypt.c (encrypt_filter): Immediately set header_okay. -- The second fix avoids repeated error message about non-compliant keys. Updates-commit: a51067a21f688086bd8e44234a88ae367582cc76 Ported-from: aa0c942521d89f4f0aac90bacaf8a7a7cefc88d8 GnuPG-bug-id: 6174
2022-09-29gpg: Make --require-compliance work for -seWerner Koch1-156/+146
* g10/encrypt.c (encrypt_crypt, encrypt_filter): Factor common code out to ... (create_dek_with_warnings): new (check_encryption_compliance): and new. * g10/encrypt.c (encrypt_filter): Add the compliance check. -- GnuPG-bug-id: 6174 Ported-from: f88cb12f8e3c1234a094d09e2505d3a3eec4cbfe
2022-09-28gpg: Silence some diagnostics.Werner Koch2-8/+11
* g10/parse-packet.c (enum_sig_subpkt): Show "buffer shorter than subpacket" only in debug mode. (parse_signature): Show "signature packet without timestamp / keyid" only in souble verbose mode. * g10/sig-check.c (check_signature_metadata_validity): Use ISO timestamp in UTC for the signature expired note. -- I have seen to many of these diagnostics and in particular the first one seems to be a connected to the others. Thus it does not make sense to show them in standard verbose mode. The ISO timestamp is much easier to read than than the localized timestamp and switching from localtime to UTC should not harm.
2022-09-26gpg: Don't consider unknown keys as non-compliant while decrypting.Werner Koch1-4/+4
* g10/mainproc.c (proc_encrypted): Change compliance logic. -- For the description of the proplem see https://dev.gnupg.org/T6205#163306 GnuPG-bug-id: 6205
2022-09-16dirmngr:dns,doc,gpg: Fix for noreturn for C11.NIIBE Yutaka1-1/+1
* dirmngr/dns.c: Use __noreturn__. * doc/yat2m.c: Likewise. * g10/main.h: Likewise. -- GnuPG-bug-id: 4002 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-09-14agent,dirmngr,gpg,scd: Clean up for modern compiler.NIIBE Yutaka2-0/+3
* agent/protect.c (agent_get_shadow_info_type): It's a write only variable, useful for debugging. * g10/key-check.c (key_check_all_keysigs): Likewise. * g10/keyedit.c (show_basic_key_info, menu_expire): Likewise. * scd/app-sc-hsm.c (read_ef_prkd): Likewise. * dirmngr/crlfetch.c (fetch_next_ksba_cert): Initialize the vars. * dirmngr/ks-action.c (ks_action_help): Remove unused variables. * dirmngr/server.c (make_keyserver_item): Likewise. * dirmngr/validate.c (check_cert_sig): Initialize the variable. * scd/app-p15.c (select_and_read_record): Likewise. * tests/gpgscm/scheme.c (scheme_init_new): A function with no args. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-09-13gpg,common,scd,sm: Function prototype fixes for modern compiler.NIIBE Yutaka6-13/+13
* common/gettime.c (gnupg_get_time): It has no arguments. * common/signal.c (gnupg_block_all_signals): Likewise. (gnupg_unblock_all_signals): Likewise. * common/utf8conv.c (get_native_charset): Likewise. * g10/cpr.c (is_status_enabled, cpr_enabled): Likewise. * g10/getkey.c (getkey_disable_caches): Likewise. * g10/keygen.c (ask_expiredate): Likewise. * g10/passphrase.c (have_static_passphrase): Likewise. (get_last_passphrase): Likewise. * g10/tdbio.c (tdbio_is_dirty, tdbio_sync): Likewise. (tdbio_get_dbname, open_db, tdbio_db_matches_options): Likewise. (tdbio_read_nextcheck): Likewise. * g10/trustdb.c (how_to_fix_the_trustdb): Likewise. * scd/scdaemon.c (scd_get_socket_name): Likewise. * sm/passphrase.c (have_static_passphrase): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-09-07gpg: Support key flags for RENC, TIME, and GROUP.Werner Koch6-3/+53
* g10/packet.h (PUBKEY_USAGE_RENC): New. (PUBKEY_USAGE_TIME): New. (PUBKEY_USAGE_GROUP): New. * g10/getkey.c (parse_key_usage): Set the new key flags. * g10/keyedit.c (show_key_with_all_names_colon): Show the new key flags. * g10/keyid.c (usagestr_from_pk): Ditto * g10/keylist.c (print_capabilities): Ditto. * g10/keygen.c (parse_usagestr): Parse line and set new flags. (quickgen_set_para): Show flags. -- See draft-koch-openpgp-2015-rfc4880bis-00 for the current version. Actually these flags have been in the draft for years now. This patch is a first step to make use of them.
2022-08-22common: New common option no-autostart.Werner Koch1-0/+2
* common/comopt.c (opts): Add "no-autostart". (parse_comopt): Set it. * common/comopt.h (comopt): Add no_autostart. * g10/gpg.c (main): Take care of the new option. * sm/gpgsm.c (main): Ditto. * tools/gpg-connect-agent.c (INCLUDED_BY_MAIN_MODULE): Add. (main): Parse common options and handle new option. * tools/gpg-card.c (main): Ditto. (cmd_yubikey): Fix minor error reporting issue. * common/util.h (GNUPG_MODULE_NAME_CARD): New const. * common/homedir.c (gnupg_module_name): Support it. -- Having a global option makes it easier to use disable autostart on a server which is required to use a remote gpg-agent reliable.
2022-08-16gpg: Fix --card-status to handle lowercase APPTYPEsWerner Koch1-6/+6
* g10/card-util.c (current_card_status): Use ascii_strcasecmp.
2022-08-12gpg: Improve --edit-key setpref.Werner Koch1-5/+17
* g10/keygen.c (keygen_set_std_prefs): Allow extra spaces before preference elements. Detect the bracketed versions of the strings. Ignore "aead". -- This allows to c+p the list shown by pref with out remove the brackets.
2022-08-09gpg: Emit an ERROR status if --quick-set-primary-uid failsIngo Klöcker1-3/+9
* g10/keyedit.c (keyedit_quick_set_primary): Issue a status error. -- This allows GpgME to detect and report a failure if setting the primary user ID of a key failed. GnuPG-bug-id: 6126
2022-08-08gpg: Look up user ID to mark as primary by UID hashIngo Klöcker1-25/+22
* g10/keyedit.c (find_userid_by_namehash, find_userid): Add argument want_valid. Skip invalid user IDs if valid is wanted. (keyedit_quick_revuid): Ask find_userid() for any matching user ID. (keyedit_quick_set_primary): Use find_userid() to find the user ID to mark as primary. * tests/openpgp/quick-key-manipulation.scm: Change second call of the quick-set-primary-uid test to specify the user ID by its hash. -- This makes it possible to specify the user ID to mark as primary via its UID hash when calling --quick-set-primary-uid. GnuPG-bug-id: 6126
2022-08-04gpg: Fix wrong error message for keytocard.Werner Koch1-3/+1
* g10/call-agent.c (agent_keytocard): Emit SC_OP_FAILURE. -- GnuPG-bug-id: 6122
2022-08-02gpg: Make symmetric + pubkey encryption de-vs compliant.Werner Koch1-5/+47
* g10/mainproc.c (proc_encrypted): Make symmetric + pubkey encryption de-vs compliant. * g10/mainproc.c (struct symlist_item): New. (struct mainproc_context): Add field symenc_list. (release_list): Free that list. (proc_symkey_enc): Record infos from symmetric session packet. (proc_encrypted): Check symkey packet algos -- The original check was too strong because it is in fact compliant to encrypt with a symmetric key and and public key. Thus decryption should issue a compliance status. In addition we now check that the cipher algorithms used to symmetrically encrypt the session key are all compliant. This is similar to our check for all public key encrypted session key packets. GnuPG-bug-id: 6119 Fixes-commit: b03fab09e188f7bb10237d4f20455e4026737e4e Backported from 2.2 Signed-off-by: Werner Koch <[email protected]>
2022-07-28gpg: For de-vs use SHA-256 instead of SHA-1 as implicit preference.Werner Koch1-2/+10
* g10/pkclist.c (select_algo_from_prefs): Change implicit hash algorithm. -- GnuPG-bug-id: 6043
2022-07-05gpg,build: Fix message for newer gettext.NIIBE Yutaka1-1/+3
* g10/keyserver.c (keyserver_refresh): Use ngettext. -- Signed-off-by: NIIBE Yutaka <[email protected]>