aboutsummaryrefslogtreecommitdiffstats
path: root/g10/card-util.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * g10: Fix printing the keygrip with --card-status.NIIBE Yutaka2018-04-251-1/+1
| | | | | | | | | | | | | | | | | | * g10/card-util.c (current_card_status): Keygrip for Auth is 3. -- Fixes-commit: fd595c9d3642dba437fbe0f6e25d7aaaae095f94 Signed-off-by: NIIBE Yutaka <[email protected]>
* | Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2018-04-101-132/+238
|\| | | | | | | | | | | | | | | | | -- Fixed conflicts: NEWS - keep master configure.ac - merge g10/card-util.c - mostly 2.2 g10/sig-check.c - 2.2
| * gpg: Add new OpenPGP card vendor.Werner Koch2018-04-051-0/+1
| | | | | | | | | | | | -- Signed-off-by: Werner Koch <[email protected]>
| * g10: Let card-edit/key-attr show message when change.NIIBE Yutaka2018-04-051-8/+14
| | | | | | | | | | | | | | * g10/card-util.c (ask_card_rsa_keysize): Don't show message here. (ask_card_keyattr): Show message when change, also for ECC. Signed-off-by: NIIBE Yutaka <[email protected]>
| * g10: Fix card-edit/kdf-setup for single salt.NIIBE Yutaka2018-03-301-1/+3
| | | | | | | | | | | | * g10/card-util.c (gen_kdf_data): Use SALT_USER. Signed-off-by: NIIBE Yutaka <[email protected]>
| * g10,scd: Support single salt for KDF data object.NIIBE Yutaka2018-03-301-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (gen_kdf_data): Support single salt. (kdf_setup): Can have argument for single salt. * scd/app-openpgp.c (pin2hash_if_kdf): Support single salt. -- Gnuk has "admin-less" mode. To support "admin-less" mode with KDF feature, salt should be same for user and admin. Thus, I introduce a valid use of single salt. Signed-off-by: NIIBE Yutaka <[email protected]>
| * g10: Add "key-attr" command for --card-edit.NIIBE Yutaka2018-03-301-53/+52
| | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (key_attr): New explicit command. (generate_card_keys, card_generate_subkey): Don't ask key attr change. (card_edit): Add for cmdKEYATTR. -- GnuPG-bug-id: 3781 Signed-off-by: NIIBE Yutaka <[email protected]>
| * g10: Support key attribute change at --card-edit/generate.NIIBE Yutaka2018-03-291-71/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (ask_card_rsa_keysize): Drop support for magic number 25519 for ed25519/cv25519. Rename from ask_card_keyattr. (ask_card_keyattr): Support ECC, as well as RSA. (do_change_keyattr): Support ECC dropping magical number 25519. * g10/keygen.c (ask_curve): Allow call from outside, adding last arg of CURRENT. (generate_keypair): Follow the change of ask_curve. (generate_subkeypair): Likewise. -- GnuPG-bug-id: 3781 Signed-off-by: NIIBE Yutaka <[email protected]>
| * g10: check_pin_for_key_operation should be just before genkey.NIIBE Yutaka2018-03-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (generate_card_keys): Check PIN later. (card_generate_subkey): Likewise. -- Changing key attribute resets PIN authentication status. So, CHECKPIN should be after that, before key generation. Note that CHECKPIN is done for binding signature. Signed-off-by: NIIBE Yutaka <[email protected]>
* | Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2018-03-271-7/+125
|\|
| * scd: Support KDF DO setup.NIIBE Yutaka2018-03-221-1/+104
| | | | | | | | | | | | | | | | | | | | | | | | * g10/call-agent.c (learn_status_cb): Parse the capability for KDF. * g10/card-util.c (gen_kdf_data, kdf_setup): New. (card_edit): New admin command cmdKDFSETUP to call kdf_setup. * scd/app-openpgp.c (do_getattr): Emit KDF capability. -- GnuPG-bug-id: 3823 Signed-off-by: NIIBE Yutaka <[email protected]>
| * scd: Better user interaction for factory-reset.NIIBE Yutaka2018-03-161-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (factory_reset): Dummy PIN size is now 32-byte. Connect the card again at the last step. -- Before the change, a user has to quit the session to continue. Now, it is possible to type RET in the session and see if it's really done. Signed-off-by: NIIBE Yutaka <[email protected]>
* | Merge branch 'STABLE-BRANCH-2-2' into wk-masterWerner Koch2018-03-061-6/+35
|\|
| * gpg: Print the keygrip with --card-statusWerner Koch2018-03-011-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/call-agent.h (agent_card_info_s): Add fields grp1, grp2 and grp3. * g10/call-agent.c (unhexify_fpr): Allow for space as delimiter. (learn_status_cb): Parse KEYPARIINFO int the grpX fields. * g10/card-util.c (print_keygrip): New. (current_card_status): Print "grp:" records or with --with-keygrip a human readable keygrip. -- Suggested-by: Peter Lebbing <[email protected]> Signed-off-by: Werner Koch <[email protected]>
| * gpg: Update list of card vendors from masterWerner Koch2018-02-011-0/+2
| | | | | | | | | | | | -- Signed-off-by: Werner Koch <[email protected]>
| * g10: Simplify "factory-reset" procedure.NIIBE Yutaka2017-11-061-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (factory_reset): Simplify. -- In this summer, I got report about old code before this change didn't work with newer Yubikey. I got another report test version of OpenPGP card V3.3 implementation didn't work, either. Then, I confirmed that according to the OpenPGP card specification, the procedure of old code is not expected by its author. This change simplify "factory-reset" as simple. Only versions of Gnuk 1.2.2, 1.2.3, 1.2.4, won't work with this change. That's because the factory-reset feature of Gnuk was introduced by reading the implementation of GnuPG, instead of reading the specification. Gnuk 1.2.5 and later works well. All OpenPGPcard implementations I have work well (2.0, 2.1, 2.2, test version of 3). GnuPG-bug-id: 3286 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit d63b7966cdd72548c60466c620de5cd6104a779e)
| * gpg: Introduce magic value 25519 to switch a card to ECC.Werner Koch2017-11-021-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (ask_card_keyattr): Handle special value 25519. (do_change_keyattr): Allow changing to cv25519/ed25519. (generate_card_keys): Ditto. (card_generate_subkey): Ditto. -- This is kludge to make it easier for gnuk to be switched into ECC mode. This is basically the same change as commit ea09b6cded9d31a8ebd91878553c3eaa2b76e817 but without the string change in show_keysize_warning. Signed-off-by: Werner Koch <[email protected]>
| * gpg: Rename two card related functions in card-util.Werner Koch2017-11-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (ask_card_rsa_keysize): Rename to ask_card_keyattr. (do_change_rsa_keysize): Rename to do_change_keyattr. -- We want to support other algos than RSA and thus we need a better name for the functions. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f795f4529d8ab5a05db1cc1960abd34390bfae1b)
* | Add a new OpenPGP card vendor.Werner Koch2018-02-011-0/+1
| | | | | | | | --
* | gpg: Repurpose the ISO defined DO "sex" to "salutation".Werner Koch2017-11-151-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (current_card_status): String changes. (change_sex): Description change. (cmds): Add "salutation"; keep "sex" as an alias. -- Note that we can't change the used values or tags but at least the UI should show reflect the real purpose of the field. Signed-off-by: Werner Koch <[email protected]>
* | gpg: Unifiy the message for re-configuring cards.Werner Koch2017-11-021-1/+5
| | | | | | | | | | | | | | | | | | | | * g10/card-util.c (ask_card_keyattr): Print "rsaNNNN". -- This is a separate patch from the previous to avoid string changes when backporting the other patch to 2.2. Signed-off-by: Werner Koch <[email protected]>
* | gpg: Introduce magic value 25519 to switch a card to ECC.Werner Koch2017-11-021-27/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (show_keysize_warning): Slightly change the text. (ask_card_keyattr): Handle special value 25519. (do_change_keyattr): Allow changing to cv25519/ed25519. (generate_card_keys): Ditto. (card_generate_subkey): Ditto. -- This is kludge to make it easier for gnuk to be switched into ECC mode. Signed-off-by: Werner Koch <[email protected]>
* | Register another OpenPGP card vendor.Werner Koch2017-11-011-0/+1
| | | | | | | | --
* | gpg: Rename two card related functions in card-util.Werner Koch2017-11-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (ask_card_rsa_keysize): Rename to ask_card_keyattr. (do_change_rsa_keysize): Rename to do_change_keyattr. -- We want to support other algos than RSA and thus we need a better name for the functions. Signed-off-by: Werner Koch <[email protected]>
* | g10: Simplify "factory-reset" procedure.NIIBE Yutaka2017-10-301-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (factory_reset): Simplify. -- In this summer, I got report about old code before this change didn't work with newer Yubikey. I got another report test version of OpenPGP card V3.3 implementation didn't work, either. Then, I confirmed that according to the OpenPGP card specification, the procedure of old code is not expected by its author. This change simplify "factory-reset" as simple. Only versions of Gnuk 1.2.2, 1.2.3, 1.2.4, won't work with this change. That's because the factory-reset feature of Gnuk was introduced by reading the implementation of GnuPG, instead of reading the specification. Gnuk 1.2.5 and later works well. All OpenPGPcard implementations I have work well (2.0, 2.1, 2.2, test version of 3). GnuPG-bug-id: 3286 Signed-off-by: NIIBE Yutaka <[email protected]>
* | gpg: Prepare for a longer fingerprintWerner Koch2017-09-271-4/+6
|/ | | | | | | | | | | | | | | | | | * g10/card-util.c (change_cafpr): Use MAX_FINGERPRINT_LEN. * g10/cipher.c (write_header): Use snprintf. * g10/gpg.h (MAX_FINGERPRINT_LEN): Change to 32. (MAX_FORMATTED_FINGERPRINT_LEN): Change to 59 * g10/keyid.c (format_hexfingerprint): Add v5 fingerprint format. * g10/tofu.c (get_policy): Use MAX_FINGERPRINT_LEN for the buffer but keep the raw length for now. -- Note that this patch only increases the size of the buffer and adds a new formatting for v5 fingerprints. Moe work is required to fix internal data structures like those in trustdb.gpg and the tofu tables. Signed-off-by: Werner Koch <[email protected]>
* g10: Don't limit at the frontend side for card capability.NIIBE Yutaka2017-07-211-37/+12
| | | | | | | | | | | | | * g10/card-util.c (MAX_GET_DATA_FROM_FILE): New. (get_data_from_file): Use MAX_GET_DATA_FROM_FILE. (change_url, change_login, change_private_do): Don't limit. -- V3.3 card support longer data for URL, Login and Private DOs. It's scdaemon which knows that. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Pass key origin values to import functions.Werner Koch2017-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * g10/import.c (import_keys_stream): Remove this unused function. (import_keys_internal): Add arg origin. (import_keys): Ditto. (import_keys_es_stream): Ditto. (import): Ditto. (import_one): Ditto. (apply_meta_data): New stub. (import_secret_one): Pass 0 for ORIGIN. * g10/keyserver.c (keyserver_get_chunk): For now pass 0 for ORIGIN. (keyserver_fetch): Add arg origin. (keyserver_import_cert): Pass KEYORG_DANE for ORIGIN. (keyserver_import_wkd): Pass KEYORG_WKD for ORIGIN. * g10/gpg.c (main): Pass OPT.KEY_ORIGIN to import_keys and keyserver_fetch. * g10/card-util.c (fetch_url): Pass KEYORG_URL for ORIGIN. -- This is just the framework; applying the meta data will be done in another commit. GnuPG-bug-id: 3252 Signed-off-by: Werner Koch <[email protected]>
* gpg: Pass CTRL to many more functions.Werner Koch2017-03-311-10/+13
| | | | | | | | | | -- For proper operations as a server we need to avoid global variables. Thus we need to pass the session state CTRL to most functions. Quite a lot of changes but fortunately straightforward to do. Signed-off-by: Werner Koch <[email protected]>
* g10: Support specifying SERIALNO for --card-status.NIIBE Yutaka2017-03-271-5/+69
| | | | | | | | | * g10/gpg.c (main): Allow an argument for --card-status. * g10/card-util.c (current_card_status): Rename from card_status. (card_status): New, which supports multiple cards. (get_one_name): Use current_card_status. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix check of serialno.NIIBE Yutaka2017-03-151-1/+1
| | | | | | * g10/card-util.c (card_status): Fix. Signed-off-by: NIIBE Yutaka <[email protected]>
* Remove -I option to common.NIIBE Yutaka2017-03-071-4/+4
| | | | | | | | | | | | | * dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
* Clean up word replication.Yuri Chornoivan2017-02-211-1/+1
| | | | | | | | | -- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* gpg: Convey --quick option to dirmngr for --auto-key-retrieve.Werner Koch2016-10-271-1/+1
| | | | | | | | | | | | | | | | | | * g10/call-dirmngr.c (gpg_dirmngr_ks_get): Add arg 'quick'. (gpg_dirmngr_wkd_get): Ditto. * g10/keyserver.c (keyserver_get): Add arg 'quick'. (keyserver_get_chunk): Add arg 'quick'. (keyserver_import_fprint): Ditto. Change callers to pass 0 for it. (keyserver_import_keyid): Ditto. (keyserver_import_wkd): Ditto. * g10/mainproc.c (check_sig_and_print): Call the 3 fucntions with QUICK set. -- Note that this option has not yet been implemented by dirmngr. Dirmngr will simply ignore it for now. Signed-off-by: Werner Koch <[email protected]>
* scd: Use canonical curve name of libgcrypt.NIIBE Yutaka2016-10-241-1/+12
| | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (send_key_attr): Use curve instead of OID. (ecdh_params): New. (ecc_read_pubkey): Use ecdh_params. Use curve name. (ecc_writekey): Likewise. (ecc_curve): Rename from ecc_oid. (parse_algorithm_attribute): Use ecc_curve. * g10/call-agent.c (learn_status_cb): Use openpgp_is_curve_supported to intern the curve name string. * g10/card-util.c (card_status): Conver curve name to alias for print. -- Now, sdcaemon answer for KEY-ATTR is in the canonical curve name instead of the alias. Since it is used of key generation for card encryption key with backup, it should be canonical name. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Don't ask keysize for for non-RSA card.NIIBE Yutaka2016-10-211-22/+28
| | | | | | | | | | | | * g10/card-util.c (card_status): Bug fix for keyno. (ask_card_rsa_keysize, do_change_rsa_keysize): Rename. (generate_card_keys): Only ask keysize when RSA. (card_generate_subkey): Likewise. -- Co-authored-by: Arnaud Fontaine <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix regression of card-edit/fetch.NIIBE Yutaka2016-06-231-17/+7
| | | | | | | | * g10/card-util.c (fetch_url): Call keyserver_fetch instead of keyserver_import_fprint. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch2016-04-291-5/+4
| | | | Signed-off-by: Werner Koch <[email protected]>
* gpg: Add OpenPGP card vendor 0x2342.Werner Koch2016-04-261-1/+1
| | | | --
* scd: Add manufacturer id 0x000aWerner Koch2016-03-141-0/+1
| | | | | | * g10/card-util.c (get_manufacturer): Add it. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix warnings about useless assignments.Werner Koch2016-01-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/armor.c (parse_hash_header): Remove duplicate var assignment. * g10/getkey.c (cache_user_id): Ditto. * g10/keygen.c (ask_curve): Ditto. This also fixes a small memory leak. * g10/keygen.c (proc_parameter_file): Remove useless assignment or pointer increment. (generate_keypair): Ditto. * g10/getkey.c (finish_lookup, lookup): Ditto. * g10/card-util.c (change_pin): Ditto. * g10/gpg.c (main) <aVerify>: Ditto. * g10/import.c (import): Ditto. (print_import_check): Ditto * g10/keyring.c (do_copy): Ditto. * g10/tdbio.c (tdbio_read_record): Ditto. * g10/trustdb.c (tdb_update_ownertrust): Ditto. (update_validity): Ditto. * g10/server.c (cmd_passwd): Remove useless call to skip_options. -- Signed-off-by: Werner Koch <[email protected]>
* scd: Add reder information to --card-status.NIIBE Yutaka2015-11-091-0/+5
| | | | | | | | | * g10/call-agent.h, g10/call-agent.c (agent_release_card_info) g10/card-util.c (card_status): Add READER. * scd/apdu.c (close_ccid_reader, open_ccid_reader): Handle RDRNAME. (apdu_get_reader_name): New. * scd/ccid-driver.c (ccid_open_reader): Add argument to RDRNAME_P. * scd/command.c (cmd_learn): Return READER information.
* gpg: Add a new OpenPGP card vendor.Werner Koch2015-10-211-0/+1
| | | | --
* scd: support any curves defined by libgcrypt.NIIBE Yutaka2015-07-251-7/+12
| | | | | | | | | | | | | | * g10/call-agent.h (struct agent_card_info_s): Add curve field. * g10/call-agent.c (learn_status_cb): Use curve name. * g10/card-util.c (card_status): Show pubkey name. * scd/app-openpgp.c (struct app_local_s): Record OID and flags. (store_fpr): Use ALGO instead of key type. (send_key_attr): Use curve name instead of OID. (get_public_key): Clean up by OID to curve name. (ecc_writekey): Support any curves in libgcrypt. (do_genkey, do_auth, ): Follow the change. (ecc_oid): New. (parse_algorithm_attribute): Show OID here.
* scd: Format change to specify "rsa2048" for KEY-ATTR.NIIBE Yutaka2015-07-231-1/+1
| | | | | | | | | * g10/card-util.c (do_change_keysize): Put "rsa". * scd/app-openpgp.c (change_keyattr, change_keyattr_from_string): Change the command format. (rsa_writekey): Check key type. (do_writekey): Remove "ecdh" and "ecdsa" support which was available in experimental libgcrypt before 1.6.0.
* gpg: Improve 'General key info' line of --card-status.Werner Koch2015-05-071-27/+4
| | | | | | | | | | | | | | | | | * g10/keylist.c (print_pubkey_info): Print either "pub" or "sub". * g10/getkey.c (get_pubkey_byfprint): Add optional arg R_KEYBLOCK. * g10/keyid.c (keyid_from_fingerprint): Adjust for change. * g10/revoke.c (gen_desig_revoke): Adjust for change. * g10/card-util.c (card_status): Simplify by using new arg. Align card-no string. * g10/card-util.c (card_status): Remove not used GnuPG-1 code. -- This now prints "sub" if the first used card key is actually a subkey. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix keytocard.NIIBE Yutaka2015-04-031-3/+3
| | | | | | | | | | | | | | | | g10/call-agent.h (agent_scd_learn): Add FORCE option. g10/call-agent.c (agent_scd_learn): Implement FORCE option. g10/keygen.c (gen_card_key): Follow the change of option. g10/card-util.c (change_pin, card_status, factory_reset): Likewise. g10/keyedit.c (keyedit_menu): Update private key storage by agent_scd_learn. -- This is not a perfect solution since there is a possibility user unplug card before quitting 'gpg --keyedit' session. Usually, it works well. GnuPG-bug-id: 1846
* gpg: Remove unused args from a function.Werner Koch2015-01-051-1/+1
| | | | | | | * g10/keyserver.c (parse_keyserver_uri): Remove args configname and configlineno. Change all callers. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add sub-command "factory-reset" to --card-edit.Werner Koch2014-12-151-2/+170
| | | | | | | | | | | | | | | | | | * common/util.h (GPG_ERR_OBJ_TERM_STATE): New. * scd/iso7816.c (map_sw): Add this error code. * scd/app-openpgp.c (do_getattr): Return the life cycle indicator. * scd/app.c (select_application): Allow a return value of GPG_ERR_OBJ_TERM_STATE. * scd/scdaemon.c (set_debug): Print the DBG_READER value. * g10/call-agent.c (start_agent): Print a status line for the termination state. (agent_scd_learn): Make arg "info" optional. (agent_scd_apdu): New. * g10/card-util.c (send_apdu): New. (factory_reset): New. (card_edit): Add command factory-reset. Signed-off-by: Werner Koch <[email protected]>