aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-12-22experiment: Handle S=0 in EdDSA by SOS("0").gniibe/v5/448NIIBE Yutaka2-15/+33
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-12-14experiment: Fix for signature R+S in OpenPGP R part.NIIBE Yutaka2-7/+14
This fix also allows having only OpenPGP R part, and OpenPGP S part == NULL. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2021-11-25experiment: Rename the names of functions.NIIBE Yutaka6-16/+16
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-27experiment: Fix importing new448 secret key.NIIBE Yutaka2-6/+2
-- Because secret key may be encrypted one, it can be only fixed up (removing the prefix) at gpg-agent side. Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-22experiment: Support exporting new 448 key (public/secret).NIIBE Yutaka3-5/+21
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-22experiment: Support importing new 448 secret keys.NIIBE Yutaka1-2/+11
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-21experiment: Fix keygrip and signature for 448.NIIBE Yutaka2-5/+6
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-21experiment: Also support new ECDH encryption with 448.NIIBE Yutaka2-42/+8
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-21experiment: Fix ECC key handling.NIIBE Yutaka3-10/+9
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-21experiment: Support keygen for new Ed448/X448 keys.NIIBE Yutaka1-0/+49
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-21experiment: Generate new Ed448 signature.NIIBE Yutaka1-2/+69
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-08experiment: Fix keygrip computation for new 448 key on gpg-agent.NIIBE Yutaka2-12/+18
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-08gpg: Support MPI(0) by sos_read and mpi_print.NIIBE Yutaka2-2/+5
* g10/misc.c (mpi_print): Handle the case for MPI(0). * g10/parse-packet.c (sos_read): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2021-10-08experiment: Try to support new 448 key and signature.NIIBE Yutaka3-7/+56
-- Keygrip computation is still wrong, need to fix soon. Signed-off-by: NIIBE Yutaka <[email protected]>
2021-09-29gpg: Handle backsig for v5 signature.NIIBE Yutaka1-6/+8
* g10/getkey.c (merge_selfsigs_subkey): Check v5 signature correctly. -- GnuPG-bug-id: 5628 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-09-29gpg: Ed448 and X448 are only for v5 (for subkey).NIIBE Yutaka1-1/+6
* g10/keygen.c (generate_subkeypair): Specify KEYGEN_FLAG_CREATE_V5_KEY for Ed448 or X448 key. -- Reported-by: William Holmes Fixes-commit: 36355394d865f5760075e62267d70f7a7d5dd671 GnuPG-bug-id: 5609 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-09-28gpg: Skip the packet when not used for AEAD.NIIBE Yutaka1-0/+1
* g10/free-packet.c (free_packet): Add the case for case PKT_ENCRYPTED_AEAD. -- GnuPG-bug-id: 5464 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-09-14gpg: Print a warning when importing a bad cv25519 secret key.Werner Koch1-1/+17
* g10/import.c (transfer_secret_keys): Add simple check. -- Note that the requirement for a set high bit is not yet checked. GnuPG-bug-id: 5464
2021-09-14Update release signing keys.Werner Koch1-0/+0
-- These are now # ------------------------ >8 ------------------------ pub rsa3072 2017-03-17 [SC] [expires: 2027-03-15] 5B80C5754298F0CB55D8ED6ABCEF7E294B092E28 sig R BCEF7E294B092E28 2017-03-17 Andre Heinecke (Release Signing Key) uid Andre Heinecke (Release Signing Key) sig 3 BCEF7E294B092E28 2017-03-17 Andre Heinecke (Release Signing Key) sig 1FDF723CF462B6B1 2017-03-17 Andre Heinecke <[email protected]> pub ed25519 2020-08-24 [SC] [expires: 2030-06-30] 6DAA6E64A76D2840571B4902528897B826403ADA uid Werner Koch (dist signing 2020) sig 3 528897B826403ADA 2020-08-24 Werner Koch (dist signing 2020) sig 249B39D24F25E3B6 2020-08-24 Werner Koch (dist sig) sig 63113AE866587D0A 2020-08-24 [email protected] sig E3FDFF218E45B72B 2020-08-24 Werner Koch (wheatstone commit signing) sig F2AD85AC1E42B367 2020-08-24 Werner Koch <[email protected]> pub ed25519 2021-05-19 [SC] [expires: 2027-04-04] AC8E115BF73E2D8D47FA9908E98E9B2D19C6C8BD uid Niibe Yutaka (GnuPG Release Key) sig 3 E98E9B2D19C6C8BD 2021-05-19 Niibe Yutaka (GnuPG Release Key) sig 00B45EBD4CA7BABE 2021-09-14 NIIBE Yutaka <[email protected]> sig E267B052364F028D 2021-09-14 NIIBE Yutaka <[email protected]>
2021-08-28gpg: Print a note about the obsolete option --secret-keyring.Werner Koch1-1/+1
-- GnuPG-bug-id: 2749
2021-08-27gpg: Change default and max AEAD chunk size to 4 MiBWerner Koch1-3/+3
-- 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 <[email protected]>
2021-08-24gpg: Report the status of NO_SECKEY for decryption.NIIBE Yutaka1-2/+2
* g10/mainproc.c (proc_encrypted): Fix the condition to report NO_SECKEY even when the key was not considered by get_session_key. -- GnuPG-bug-id: 5562 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-08-19gpg: Return SUCCESS/FAILURE status also for --card-edit/name.Werner Koch1-3/+8
* g10/card-util.c (change_name): Call write_sc_op_status. -- Reported-by: Joey Berkovitz
2021-06-25gpg: Let --fetch-key return an exit code on failure.Werner Koch2-4/+20
* g10/keyserver.c (keyserver_fetch): Return an error code. * g10/gpg.c (main) <aFetchKeys>: Return 1 in case of no data. -- GnuPG-bug-id: 5376
2021-06-16gpg,sm: Simplify keyserver spec parsing.Werner Koch4-276/+26
* common/keyserver.h: Remove. * sm/gpgsm.h (struct keyserver_spec): Remove. (opt): Change keyserver to a strlist_t. * sm/gpgsm.c (keyserver_list_free): Remove. (parse_keyserver_line): Remove. (main): Store keyserver in an strlist. * sm/call-dirmngr.c (prepare_dirmngr): Adjust for the strlist. Avoid an ambiguity in dirmngr by adding a prefix if needed. * g10/options.h (struct keyserver_spec): Move definition from keyserver.h to here. Remove most fields. * g10/keyserver.c (free_keyserver_spec): Adjust. (cmp_keyserver_spec): Adjust. (parse_keyserver_uri): Simplify. (keyidlist): Remove fakev3 arg which does not make any sense because we don't even support v3 keys. -- We now rely on the dirmngr to parse the keyserver specs. Thus a bad specification will not be caught immediately. However, even before that dirmngr had stricter tests. Signed-off-by: Werner Koch <[email protected]> Ported-from: 9f586700ec4ceac97fd47cd799878a8847342ffa
2021-06-03gpg: Support KEYGRIP search with traditional keyring.NIIBE Yutaka1-3/+13
* g10/keyring.c (keyring_search): Handle KEYDB_SEARCH_MODE_KEYGRIP. -- GnuPG-bug-id: 5469 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-05-27gpg: Ed448 and X448 are only for v5 for --full-gen-key.NIIBE Yutaka1-1/+24
* g10/keygen.c (generate_keypair): Set pVERSION = 5, pSUBVERSION = 5, when it's Ed448 or X448. -- Fixes-commit: 36355394d865f5760075e62267d70f7a7d5dd671 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-05-25gpg: Partial fix for Unicode problem in output files.Werner Koch1-1/+1
* g10/openfile.c (overwrite_filep): Use gnupg_access. -- As said, this is just an obvious but partial fix. We need to review things for the output module. Signed-off-by: Werner Koch <[email protected]>
2021-05-21common: Annotate leaked memory in homedir.cWerner Koch1-1/+1
* g10/trustdb.c (how_to_fix_the_trustdb): Use gnupg_homedir. * common/homedir.c (standard_homedir): Annotate leaked memory. (gnupg_daemon_rootdir): Ditto. (gnupg_socketdir): Ditto. (gnupg_sysconfdir): Ditto. (gnupg_bindir): Ditto. (gnupg_libdir): Ditto. (gnupg_datadir): Ditto. (gnupg_localedir): Ditto. (gnupg_cachedir): Ditto. (gpg_agent_socket_name): Ditto. (dirmngr_socket_name): Ditto. (keyboxd_socket_name): Ditto. (get_default_pinentry_name): Ditto. (gnupg_module_name): Ditto. (default_homedir): Ditto. Make static. Signed-off-by: Werner Koch <[email protected]>
2021-05-20g10: Avoid memory leaksJakub Jelen3-18/+30
* g10/call-agent.c (card_keyinfo_cb): free keyinfo. Restructure to avoid backward gotos. * g10/keyedit.c (menu_set_keyserver_url): properly enclose the block * g10/keygen.c (gen_card_key): free pk and pkt -- Signed-off-by: Jakub Jelen <[email protected]> GnuPG-bug-id: 5393 Additional changes: - Restructure to avoid backward gotos. Signed-off-by: Werner Koch <[email protected]>
2021-05-20g10: Fix memory leaksJakub Jelen10-12/+50
* g10/card-util.c (change_pin): free answer on errors (ask_card_keyattr): free answer on error * g10/cpr.c (do_get_from_fd): free string * g10/gpg.c (check_permissions): free dir on weird error * g10/import.c (append_new_uid): release knode * g10/keyedit.c (menu_set_keyserver_url): free answer (menu_set_keyserver_url): free user * g10/keygen.c (print_status_key_not_created): move allocation after sanity check (ask_expire_interval): free answer (card_store_key_with_backup): goto leave instaed of return * g10/keyserver.c (parse_keyserver_uri): goto fail instead of return * g10/revoke.c (gen_desig_revoke): release kdbhd (gen_desig_revoke): free answer * g10/tofu.c (ask_about_binding): free sqerr and response * g10/trustdb.c (ask_ownertrust): free pk -- Signed-off-by: Jakub Jelen <[email protected]> Further changes: * g10/card-util.c (change_pin): Do not set answer to NULL. * g10/keyedit.c(menu_set_keyserver_url): Use !func() pattern. Signed-off-by: Werner Koch <[email protected]> GnuPG-bug-id: 5393
2021-05-19gpg: Improve speed of secret key listing.Werner Koch5-19/+101
* agent/command.c (cmd_keyinfo): Factor some code out to ... (get_keyinfo_on_cards): ... new. (cmd_havekey): Add --list mode. * g10/gpg.h (struct server_control_s): Add new caching vars. * g10/gpg.c (gpg_deinit_default_ctrl): Release cache. * g10/call-agent.c (agent_probe_any_secret_key): Init and try to use the keygrip cache. (agent_genkey): Clear the cache. (agent_import_key): Ditto. * g10/keylist.c (list_all, list_one): Pass ctrl to agent_probe_any_secret_key. * g10/getkey.c (lookup): Ditto. -- With this change we first ask the agent for a list of all secret keygrips and use that list instead of asking the agent for each public key. Speeds up my "gpg -K" with a lot of secret and public keys by more than 25%. Signed-off-by: Werner Koch <[email protected]>
2021-05-18gpg: Fix sending an OpenPGP key with umlaut to an LDAP keyserver.Werner Koch1-75/+21
* g10/call-dirmngr.c (record_output): Rewrite. -- Thou shalt not percent-escape for C-unescaping. Fixes-commit: 51341badb623927f2a358588c725a356fc77dbe7 Signed-off-by: Werner Koch <[email protected]>
2021-05-17gpg: Use a more descriptive prompt for symmetric decryption.Werner Koch7-17/+33
* g10/keydb.h (GETPASSWORD_FLAG_SYMDECRYPT): New. (passphrase_to_dek_ext): Remove this obsolete prototype. * g10/passphrase.c (passphrase_get): Add arg flags. Use new flag value. (passphrase_to_dek): Add arg flags and pass it on. * g10/mainproc.c (proc_symkey_enc): Use new flag. * sm/decrypt.c (pwri_decrypt): Use "passphrase". -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 03f83bcda5d1f8d8246bcc1afc603b7f74d0626b) Note that we keep on using the term "passphrase" although "password" would be better. There are however so many occurance of this and given it is a bike shedding topic we fix that in the PO files. Signed-off-by: Werner Koch <[email protected]>
2021-05-11A few minor code cleanups and typo fixes.Werner Koch2-2/+6
* agent/command-ssh.c (ssh_handler_request_identities): Remove double check of ERR. * g10/getkey.c (get_pubkey_byname): Remove double use of break. * g10/pkglue.c (pk_encrypt): Handle possible NULL-ptr access due to failed malloc. Signed-off-by: Werner Koch <[email protected]>
2021-05-11gpg: Fix allocation for EXTRAHASH.NIIBE Yutaka1-1/+1
* g10/sign.c (clearsign_file): Fix the size to allocate. -- GnuPG-bug-id: 5430 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-04-26gpg: Fix mailbox based search via AKL keyserver method.Werner Koch5-13/+11
* g10/keyserver.c (keyserver_import_name): Rename to ... (keyserver_import_mbox): this. And use mail search mode. * g10/getkey.c (get_pubkey_byname): Change the two callers. -- In contrast to a search via keyserver_import_ntds the older keyserver_import_name used a full match of the provided name despite that it is only called with an addr-spec (mbox). Due to the mode the pattern send to dirmngr was prefixed with a '=' and thus dirmngr used an exact search;. This did only work for provided user ids like "[email protected]" but not for "<[email protected]>" or "Foo <[email protected]>". The old code dates back to 2010. Signed-off-by: Werner Koch <[email protected]>
2021-04-26gpg: Do not use import-clean for LDAP keyserver imports.Werner Koch3-8/+23
* g10/options.h (opts): New field expl_import_only. * g10/import.c (parse_import_options): Set it. * g10/keyserver.c (keyserver_get_chunk): Add special options for LDAP. -- I can be assumed that configured LDAP servers are somehow curated and not affected by rogue key signatures as the HKP servers are. Thus we don't clean the key anymore so that key certifications are kept even if the public key has not yet been imported. See-commit: 6c26e593df51475921410ac97e9227df6b258618 GnuPG-bug-id: 5387
2021-04-25gpg: Auto import keys specified with --trusted-keys.Werner Koch3-1/+41
* g10/getkey.c (get_pubkey_with_ldap_fallback): New. * g10/trustdb.c (verify_own_keys): Use it.
2021-04-23gpg: Replace an obsolete trustdb function.Werner Koch4-19/+7
* g10/trustdb.c (tdb_register_trusted_keyid): Make static. (tdb_register_trusted_key): Replace register_trusted_keyid by tdb_register_trusted_key. * g10/keygen.c (do_generate_keypair): Ditto. * g10/trust.c (register_trusted_keyid): Remove.
2021-04-23gpg: Allow decryption w/o public key but with correct card inserted.Werner Koch2-0/+51
* agent/command.c (cmd_readkey): Add option --no-data and special handling for $SIGNKEYID and $AUTHKEYID. * g10/call-agent.c (agent_scd_getattr): Create shadow keys for KEY-FPR output. * g10/skclist.c (enum_secret_keys): Automagically get a missing public key for the current card. Signed-off-by: Werner Koch <[email protected]>
2021-04-21gpg: Allow fingerprint based lookup with --locate-external-key.Werner Koch6-39/+162
* g10/keyserver.c (keyserver_import_fprint_ntds): New. * g10/getkey.c (get_pubkey_byname): Detect an attempt to search by fingerprint in no_local mode. -- See the man page. For testing use gpg --auto-key-locate local,wkd,keyserver --locate-external-key \ FINGERPRINT with at least one LDAP keyserver given in dirmngr.conf. On Windows "ntds" may be used instead or in addtion to "keyserver". Signed-off-by: Werner Koch <[email protected]>
2021-04-21keyboxd: Fix searching for exact mail addresses.Werner Koch1-1/+2
* kbx/kbxserver.c (cmd_search): Use the openpgp hack for calling classify_user_id. * kbx/backend-sqlite.c (run_select_statement): Remove angle brackets in exact addrspec mode. * g10/call-keyboxd.c (keydb_search): Do not duplicate the left angle bracket. * sm/keydb.c (keydb_search): Ditto. -- Note that the openpgp hack flag of classify_user_id is actually a misnomer because we actually hack a round a problem in gpgsm. And it is only over there that we don't set it there. In keyboxd the flag should be set. And we need to remove the angle brackets of course because that is how we create the addrspec column values. Signed-off-by: Werner Koch <[email protected]>
2021-04-21gpg,sm: Ignore the log-file option from common.conf.Werner Koch1-6/+0
* g10/gpg.c (main): Don't use the default log file from common.conf. * sm/gpgsm.c (main): Ditto. -- That was acutally not intended and contradicts the description in doc/example/common.conf. Signed-off-by: Werner Koch <[email protected]>
2021-04-19gpg: Fix showpref to list AEAD feature.Damien Goutte-Gattat via Gnupg-devel1-1/+1
* g10/keyedit.c (show_prefs): Show 'AEAD' if flags.aead is set. -- The terse 'pref' command in the key editor correctly shows '[aead]' if the uid->flags.aead is set, but the more verbose 'showpref' command does not, due to an inverted condition check. Signed-off-by: Damien Goutte-Gattat <[email protected]>
2021-04-19gpg,gpgsm: Move use-keyboxd to the new conf file common.confWerner Koch1-0/+31
* common/comopt.c, common/comopt.h: New. * common/Makefile.am: Add them. * g10/gpg.c: Include comopt.h. (main): Also parse common.conf. * sm/gpgsm.c: Include comopt.h. (main): Set a flag for the --no-logfile option. Parse common.conf. * tools/gpgconf-comp.c (known_options_gpg): Remove "use-keyboxd", add pseudo option "use_keyboxd". (known_pseudo_options_gpg): Add pseudo option "use_keyboxd". (known_options_gpgsm): Remove "use-keyboxd". * tests/openpgp/defs.scm (create-gpghome): Create common.conf. * doc/examples/common.conf: New. -- Note that --use-keybox still works but prints a warning. We will eventually remove this option becuase it was marked as an experimental feature anyway. It would be too confusing if gpg and gpgsm use different key storages. Further, other components (e.g. dirmngr or gpg-wks-client) which call gpg or gpgsm need to be aware that the keyboxd is used and pass that option on the command line. Now that common.conf is always read (even if --no-options is used) those tools will work instantly.
2021-04-16gpg: Lookup a missing public key of the current card via LDAP.Werner Koch8-36/+77
* g10/getkey.c (get_seckey_default_or_card): Lookup a missing public key from the current card via LDAP. * g10/call-dirmngr.c: Include keyserver-intetnal.h. (gpg_dirmngr_ks_get): Rename arg quick into flags. Take care of the new LDAP flag. * g10/keyserver-internal.h (KEYSERVER_IMPORT_FLAG_QUICK): New. Replace the use of the value 1 for the former quick arg. (KEYSERVER_IMPORT_FLAG_LDAP): New. * g10/keyserver.c (keyserver_get_chunk): Increase the reserved line length. * dirmngr/ks-action.c (ks_action_get): Add arg ldap_only. * dirmngr/server.c (cmd_ks_get): Add option --ldap. -- This change makes it easy to start working with gnupg: Just insert the smartcard or token provided to you and the first time you sign a message the public key associated with the current card will be imported and everything is set without any configuration. This works only with an LDAP directory because it can be expected that the public key has been put into the LDAP during card personalization. Of course an LDAP server needs to be configured; in a Windows AD domain this can be a mere "keyserver ldap:///" in dirmngr.conf. Other configured keyservers are ignored. Requirements for the card driver: The $SIGNKEYID attribute must exists and a query for the KEY-FPR attribute needs to return the OpenPGP fingerprint for that key. This is currently supported for OpenPGP cards and certain PKCS#15 cards. Signed-off-by: Werner Koch <[email protected]>
2021-04-13gpg: Do not use self-sigs-only for LDAP keyserver imports.Werner Koch3-3/+27
* dirmngr/ks-engine-ldap.c (ks_ldap_get): Print a SOURCE status. * g10/options.h (opts): New field expl_import_self_sigs_only. * g10/import.c (parse_import_options): Set it. * g10/keyserver.c (keyserver_get_chunk): Add special options for LDAP. -- I can be assumed that configured LDAP servers are somehow curated and not affected by rogue key signatures as the HKP servers are. Thus we can allow the import of key signature from LDAP keyservers by default. GnuPG-bug-id: 5387
2021-04-12gpg: Minor restructuring of a function.Werner Koch2-32/+41
-- This is for easier reading and future changing.
2021-04-08gpg: Ed448 and X448 are only for v5.NIIBE Yutaka1-3/+23
* g10/keygen.c (parse_key_parameter_part): Generate with version 5 packet, when it's Ed448 or X448. -- Signed-off-by: NIIBE Yutaka <[email protected]>