aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into key-storage-workkey-storage-workWerner Koch2013-03-2026-259/+482
|\ | | | | | | --
| * gpg: Print indicator for unknown key capability.Werner Koch2013-03-192-0/+4
| | | | | | | | * g10/keylist.c (print_capabilities): Print '?' for unknown usage.
| * gpg: Allow setting of all zero key flagsDaniel Kahn Gillmor2013-03-191-3/+0
| | | | | | | | * g10/keygen.c (do_add_key_flags): Do not check for empty key flags.
| * gpg: Distinguish between missing and cleared key flags.Werner Koch2013-03-192-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/cipher.h (PUBKEY_USAGE_NONE): New. * g10/getkey.c (parse_key_usage): Set new flag. -- We do not want to use the default capabilities (derived from the algorithm) if any key flags are given in a signature. Thus if key flags are used in any way, the default key capabilities are never used. This allows to create a key with key flags set to all zero so it can't be used. This better reflects common sense.
| * scd: ccid-driver supporting larger APDU.NIIBE Yutaka2013-03-141-1/+1
| | | | | | | | | | | | | | | | | | * scd/ccid-driver.c (ccid_transceive_apdu_level): Support larger APDU. -- This is still ad hoc change, but it's OK. Supporting full extended APDU exchange level is not worth yet.
| * scd: fix missing close paren.NIIBE Yutaka2013-03-141-1/+1
| | | | | | | | | | | | * scd/app-openpgp.c (du_auth): Fix. --
| * scd: support ECDSA signing.NIIBE Yutaka2013-03-091-7/+24
| | | | | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (do_sign): Only prepend message digest block for RSA or do_auth. (do_auth): Remove message digest block for ECDSA. -- If we don't need to check the message digest block by SCDaemon, we don't requite the message digest block for ECDSA by gpg-agent.
| * scd: support ECDSA public key.NIIBE Yutaka2013-03-081-94/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (key_type_t): New. (CURVE_NIST_P256, CURVE_NIST_P384, CURVE_NIST_P521): New. (struct app_local_s): Change keyattr to have key_type and union. (get_ecc_key_parameters, get_curve_name): New. (send_key_attr, get_public_key): Support ECDSA. (build_privkey_template, do_writekey, do_genkey): Follow the change of the member KEY_ATTR. (parse_historical): New. (parse_algorithm_attribute): Support ECDSA. -- Add ECDSA support to OpenPGP card.
| * Update RFC references to RFC 4880Daniel Kahn Gillmor2013-03-051-2/+2
| | | | | | | | --
| * Require libgpg-error 1.11.Werner Koch2013-03-052-11/+1
| | | | | | | | | | | | * configure.ac: Require libgpg-error 1.11. * common/util.h (GPG_ERR_NO_KEYSERVER, GPG_ERR_INV_CURVE) (GPG_ERR_UNKNOWN_CURVE): Remove fallback definitions.
| * agent: pksign result conversion to sexp to upper layer.NIIBE Yutaka2013-02-284-36/+98
| | | | | | | | | | | | | | | | | | | | | | * agent/agent.h (divert_pksign): Add R_SIGLEN argument. * agent/divert-scd.c (divert_pksign): Return length at R_SIGLEN. * agent/call-scd.c (agent_card_pksign): Move composition of S-expression to... * agent/pksign.c (agent_pksign_do): ... here. -- Composing S-expression would be better to be done by SCDaemon.
| * Use has_leading_keyword in the assuan callbacks.Werner Koch2013-02-226-80/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | * agent/call-pinentry.c (inq_quality): Use has_leading_keyword. * agent/call-scd.c (inq_needpin, inq_writekey_parms): Ditto. * g10/call-agent.c (inq_writecert_parms, keyinfo_status_cb): Ditto. (inq_genkey_parms, inq_ciphertext_cb, inq_import_key_parms): Ditto. * g10/call-dirmngr.c (ks_put_inq_cb): Ditto. * sm/call-agent.c (default_inq_cb, inq_ciphertext_cb): Ditto. (inq_genkey_parms, istrusted_status_cb, learn_status_cb): Ditto. (keyinfo_status_cb, inq_import_key_parms): Ditto. * sm/call-dirmngr.c (inq_certificate, isvalid_status_cb): Ditto. (lookup_status_cb, run_command_inq_cb, run_command_status_cb): Ditto.
| * Remove some unused variables.Werner Koch2013-02-223-15/+11
| | | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_process_gpgconf_conf): Remove unused used_components. * agent/command-ssh.c (ssh_signature_encoder_ecdsa): Mark unused arg. * g13/g13.c (main): Comment variable of yet unimplemented options.
| * gpg: Fix a memory leak in batch key generationWerner Koch2013-02-222-26/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keygen.c (append_to_parameter): New. (proc_parameter_file): Use new func to extend the parameter list. * g10/passphrase.c (passphrase_to_dek_ext): Print a diagnostic of gcry_kdf_derive failed. * g10/keygen.c (proc_parameter_file): Print a diagnostic if passphrase_to_dek failed. -- Due to an improper way of using the linked list head, all memory for items allocated in proc_parameter_file was never released. If batched key generation with a passphrase and more than ~200 keys was used this exhausted the secure memory.
| * gpg: Handle the agent's NEW_PASSPHRASE inquiry.Werner Koch2013-02-221-2/+3
| | | | | | | | * g10/call-agent.c (default_inq_cb): Take care of NEW_PASSPHRASE.
| * common: Add func has_leading_keyword.Werner Koch2013-02-222-0/+25
| | | | | | | | * common/stringhelp.c (has_leading_keyword): New.
| * Remove build hacks for FreeBSD.Werner Koch2013-02-221-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac [freebsd]: Do not add /usr/local to CPPFLAGS and LDFLAGS. -- Back in ~2000 we introduced a quick hack to make building of Libgcrypt on FreeBSD easier by always adding -I/usr/local/include and -L/usr/local/lib . It turned out that this is a bad idea if one wants to build with library version which is not installed in /usr/local. The hack made was eventually (in 2003) copied from Libgcrypt to GnuPG-2.
| * agent: fix two bugs.NIIBE Yutaka2013-02-222-1/+2
| | | | | | | | | | | | | | | | * agent/command.c (cmd_keytocard): Decrement KEYDATALEN. * agent/findkey.c (agent_public_key_from_file): Increment for ELEMS. -- For ECDSA and ECDH, there are 6 elements.
| * gpg: fix keytocard and support ECC card for key attribute.NIIBE Yutaka2013-02-222-4/+10
| | | | | | | | | | | | * g10/call-agent.c (agent_keytocard): Supply PARM arg. * g10/card-util.c (card_status): Support ECC. (card_store_subkey): Don't assume RSA.
| * Update .gitignore for non-VPATH builds.Werner Koch2013-02-121-9/+19
| | | | | | | | --
* | Add code to allow for late memory cleanup.Werner Koch2013-03-203-18/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/init.c (mem_cleanup_item_t): New. (run_mem_cleanup): New. (_init_common_subsystems): Add an atexit for it. (register_mem_cleanup_func): New. * g10/kbnode.c (cleanup_registered): New. (release_unused_nodes): New. (alloc_node): Call register_mem_cleanup_func. -- It is often time consuming to figure out whether still allocated memory at process termination is fine (e.g. a cache) or a problem. To help for that register_mem_cleanup_func may now be used to cleanup such memory. The run time of the program will be longer; if that turns out to be a problem we can change the code to only run in debugging mode.
* | kbx: Remove unused macro.Werner Koch2013-03-201-6/+0
| | | | | | | | * kbx/keybox.h (KEYBOX_WITH_OPENPGP): Remove unused macro.
* | po: Autoupdates for de and fr. Update gitignore.Werner Koch2013-03-203-92/+158
| | | | | | | | --
* | gpg: Fix a memory leak in batch key generationWerner Koch2013-02-212-26/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keygen.c (append_to_parameter): New. (proc_parameter_file): Use new func to extend the parameter list. * g10/passphrase.c (passphrase_to_dek_ext): Print a diagnostic of gcry_kdf_derive failed. * g10/keygen.c (proc_parameter_file): Print a diagnostic if passphrase_to_dek failed. -- Due to an improper way of using the linked list head, all memory for items allocated in proc_parameter_file was never released. If batched key generation with a passphrase and more than ~200 keys was used this exhausted the secure memory.
* | gpg: Handle the agent's NEW_PASSPHRASE inquiry.Werner Koch2013-02-211-2/+3
| | | | | | | | * g10/call-agent.c (default_inq_cb): Take care of NEW_PASSPHRASE.
* | common: Add func has_leading_keyword.Werner Koch2013-02-212-0/+25
| | | | | | | | * common/stringhelp.c (has_leading_keyword): New.
* | Remove build hacks for FreeBSD.Werner Koch2013-02-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac [freebsd]: Do not add /usr/local to CPPFLAGS and LDFLAGS. -- Back in ~2000 we introduced a quick hack to make building of Libgcrypt on FreeBSD easier by always adding -I/usr/local/include and -L/usr/local/lib . It turned out that this is a bad idea if one wants to build with library version which is not installed in /usr/local. The hack made was eventually (in 2003) copied from Libgcrypt to GnuPG-2.
* | Update .gitignore for non-VPATH builds.Werner Koch2013-02-121-9/+19
| | | | | | | | --
* | Merge branch 'master' into key-storage-workWerner Koch2013-02-1243-5016/+6184
|\|
| * gpg: Implement card_store_subkey again.NIIBE Yutaka2013-02-123-147/+123
| | | | | | | | | | | | | | | | * g10/call-agent.h (agent_keytocard): New. * g10/call-agent.c (agent_keytocard): New. * g10/card-util.c (replace_existing_key_p): Returns 1 when replace. (card_generate_subkey): Check return value of replace_existing_key_p. (card_store_subkey): Implement again using agent_keytocard.
| * agent: Add KEYTOCARD command.NIIBE Yutaka2013-02-124-0/+197
| | | | | | | | | | | | | | | | * agent/agent.h (divert_writekey, agent_card_writekey): New. * agent/call-scd.c (inq_writekey_parms, agent_card_writekey): New. * agent/command.c (cmd_keytocard, hlp_keytocard): New. (register_commands): Add cmd_keytocard. * agent/divert-scd.c (divert_writekey): New.
| * Japanese: update po and doc.NIIBE Yutaka2013-02-122-517/+388
| | | | | | | | * doc/help.ja.txt, po/ja.po: Updated.
| * scd: Rename 'keypad' to 'pinpad'.NIIBE Yutaka2013-02-0817-130/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention scd changes. * agent/divert-scd.c (getpin_cb): Change message. * agent/call-scd.c (inq_needpin): Change the protocol to POPUPPINPADPROMPT and DISMISSPINPADPROMPT. * scd/command.c (pin_cb): Likewise. * scd/apdu.c (struct reader_table_s): Rename member functions. (check_pcsc_pinpad, pcsc_pinpad_verify, pcsc_pinpad_modify, check_ccid_pinpad, ccid_pinpad_operation, apdu_check_pinpad apdu_pinpad_verify, apdu_pinpad_modify): Rename. * scd/apdu.h (SW_HOST_NO_PINPAD, apdu_check_pinpad) (apdu_pinpad_verify, apdu_pinpad_modify): Rename. * scd/iso7816.h (iso7816_check_pinpad): Rename. * scd/iso7816.c (map_sw): Use SW_HOST_NO_PINPAD. (iso7816_check_pinpad): Rename. (iso7816_verify_kp, iso7816_change_reference_data_kp): Follow the change. * scd/ccid-driver.h (CCID_DRIVER_ERR_NO_PINPAD): Rename. * scd/ccid-driver.c (ccid_transceive_secure): Use it. * scd/app-dinsig.c (verify_pin): Follow the change. * scd/app-nks.c (verify_pin): Follow the change. * scd/app-openpgp.c (check_pinpad_request): Rename. (parse_login_data, verify_a_chv, verify_chv3, do_change_pin): Follow the change. * scd/scdaemon.c (oDisablePinpad, oEnablePinpadVarlen): Rename. * scd/scdaemon.h (opt): Rename to disable_pinpad, enable_pinpad_varlen. * tools/gpgconf-comp.c (gc_options_scdaemon): Rename to disable-pinpad.
| * gpg: Add pinentry-mode feature.Werner Koch2013-02-0710-81/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c: Include shareddefs.h. (main): Add option --pinentry-mode. * g10/options.h (struct opt): Add field pinentry_mode. * g10/passphrase.c: Include shareddefs.h. (have_static_passphrase): Take care of loopback pinentry_mode. (read_passphrase_from_fd): Ditto. (get_static_passphrase): New. (passphrase_to_dek_ext): Factor some code out to ... (emit_status_need_passphrase): new. * g10/call-agent.c (start_agent): Send the pinentry mode. (default_inq_cb): Take care of the PASSPHRASE inquiry. Return a proper error code. (agent_pksign): Add args keyid, mainkeyid and pubkey_algo. (agent_pkdecrypt): Ditto. * g10/pubkey-enc.c (get_it): Pass new args. * g10/sign.c (do_sign): Pass new args. * g10/call-agent.c (struct default_inq_parm_s): New. Change all similar structs to reference this one. Change all users and inquire callback to use this struct, instead of NULL or some undefined but not used structs. This change will help to eventually get rid of global variables. -- This new features allows to use gpg without a Pinentry. As a prerequisite the agent must be configured to allow the loopback pinentry mode (option --allow-loopback-pinentry). For example gpg2 --pinentry-mode=loopback FILE.gpg may be used to decrypt FILE.gpg while entering the passphrase on the tty. If batch is used, --passphrase et al. may be used, if --command-fd is used, the passphrase may be provided by another process. Note that there are no try-again prompts in case of a bad passphrase.
| * doc: Fix description for NEED_PASSPHRASE status.Werner Koch2013-02-071-1/+1
| | | | | | | | --
| * agent: Move a typedef to common and provide parse_pinentry_mode.Werner Koch2013-02-065-24/+128
| | | | | | | | | | | | | | | | | | * common/agent-opt.c: New. * common/shareddefs.h: New. * common/Makefile.am: Add new files. * agent/agent.h: Include shareddefs.h. (pinentry_mode_t): Factor out to shareddefs.h. * agent/command.c (option_handler): Use parse_pinentry_mode.
| * agent: Return a better error code if no passphrase was given.Werner Koch2013-02-061-1/+5
| | | | | | | | | | | | | | * agent/protect.c (hash_passphrase): Handle an empty passphrase. -- This is mostly useful in loopback pinentry-mode.
| * scd: Fix check_keypad_request.NIIBE Yutaka2013-02-051-1/+1
| | | | | | | | * scd/app-openpgp.c (check_keypad_request): 0 means not to use pinpad.
| * SCD: Add vendor specific initalization.NIIBE Yutaka2013-02-051-0/+28
| | | | | | | | | | * scd/ccid-driver.c (ccid_vendor_specific_init): New. (ccid_open_reader): Call ccid_vendor_specific_init.
| * SCD: Support P=N format for login data.NIIBE Yutaka2013-02-051-24/+24
| | | | | | | | * scd/app-openpgp.c (parse_login_data): Support P=N format.
| * SCD: Better interoperability.NIIBE Yutaka2013-02-051-2/+2
| | | | | | | | | | | | * scd/apdu.c: Fill bTeoPrologue[2] field. -- ccid-1.4.5 or older requires this field is filled by application.
| * SCD: Defaults to use pinpad if the reader has the capability.NIIBE Yutaka2013-02-051-25/+25
| | | | | | | | | | | | * scd/app-openpgp.c (struct app_local_s): Remove VARLEN. (parse_login_data): "P=0" means to disable pinpad. (check_keypad_request): Default is to use pinpad if available.
| * SCD: handle keypad request on the card.NIIBE Yutaka2013-02-051-6/+104
| | | | | | | | | | | | | | | | | | * scd/app-openpgp.c: Add 2013. (struct app_local_s): Add keypad structure. (parse_login_data): Add parsing keypad request on the card. (check_keypad_request): New. (verify_a_chv, verify_chv3, do_change_pin): Call check_keypad_request to determine use of keypad.
| * SCD: Minor fix of ccid-driver.NIIBE Yutaka2013-02-051-1/+1
| | | | | | | | * scd/ccid-driver.c (VENDOR_VEGA): Fix typo.
| * SCD: Add support of Covadis VEGA_ALPHA reader.NIIBE Yutaka2013-02-051-93/+96
| | | | | | | | | | | | | | * scd/ccid-driver.c: Add 2013. (VENDER_VEGA, VEGA_ALPHA):New. (ccid_transceive_secure): VEGA_ALPHA is same firmware as GEMPC_PINPAD. Change bNumberMessage to 0x01, as it works better (was: 0xff).
| * SCD: Support fixed length PIN input for keypad (PC/SC).NIIBE Yutaka2013-02-052-23/+19
| | | | | | | | | | | | | | * scd/apdu.c (pcsc_keypad_verify): SUpport fixed length PIN input for keypad. (pcsc_keypad_modify): Likewise. * scd/ccid-driver.c (ccid_transceive_secure): Clean up.
| * SCD: Support fixed length PIN input for keypad.NIIBE Yutaka2013-02-056-21/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/iso7816.h (struct pininfo_s): Remove MODE and add FIXEDLEN. * scd/app-dinsig.c (verify_pin): Initialize FIXEDLEN to unknown. * scd/app-nks.c (verify_pin): Likewise. * scd/app-openpgp.c (verify_a_chv, verify_chv3, do_change_pin): Likewise. * scd/apdu.c (check_pcsc_keypad): Add comment. (pcsc_keypad_verify, pcsc_keypad_modify): PC/SC driver only support readers with the feature of variable length input (yet). (apdu_check_keypad): Set FIXEDLEN. * scd/ccid-driver.c (ccid_transceive_secure): Add GEMPC_PINPAD specific settings. Support fixed length PIN input for keypad.
| * SCD: API cleanup for keypad handling.NIIBE Yutaka2013-02-0513-107/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/iso7816.h (struct pininfo_s): Rename from iso7816_pininfo_s. Change meaning of MODE. (pininfo_t): Rename from iso7816_pininfo_t. * scd/sc-copykeys.c: Include "iso7816.h". * scd/scdaemon.c, scd/command.c: Likewise. * scd/ccid-driver.c: Include "scdaemon.h" and "iso7816.h". (ccid_transceive_secure): Follow the change of PININFO_T. * scd/app.c: Include "apdu.h" after "iso7816.h". * scd/iso7816.c (iso7816_check_keypad, iso7816_verify_kp) (iso7816_change_reference_data_kp): Follow the change of API. * scd/apdu.c (struct reader_table_s): Change API of CHECK_KEYPAD, KEYPAD_VERIFY, KEYPAD_MODIFY to have arg of PININFO_T. (check_pcsc_keypad, check_ccid_keypad): Likewise. (apdu_check_keypad, apdu_keypad_verify, apdu_keypad_modify): Likewise. (pcsc_keypad_verify, pcsc_keypad_modify, ct_send_apdu) (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped, pcsc_send_apdu) (send_apdu_ccid, ccid_keypad_operation, my_rapdu_send_apdu, send_apdu) (send_le): Follow the change of API. * scd/apdu.h (apdu_check_keypad, apdu_keypad_verify) (apdu_keypad_modify): Change the API. * scd/app-dinsig.c, scd/app-nks.c, scd/app-openpgp.c: Follow the change.
| * SCD: Clean up. Remove PADLEN for keypad input.NIIBE Yutaka2013-02-056-48/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/apdu.c (struct pininfo_s): Use iso7816_pininfo_s. (struct reader_table_s): Remove last arg from check_keypad method. (check_pcsc_keypad, check_pcsc_keypad): Remove PIN_PADLEN. (pcsc_keypad_verify, pcsc_keypad_modify): Don't check PIN_PADLEN. (send_apdu_ccid, ccid_keypad_operation): Remove PIN_PADLEN. (apdu_check_keypad, apdu_keypad_verify, apdu_keypad_modify): Likewise. * scd/apdu.h (apdu_check_keypad, apdu_keypad_verify) (apdu_keypad_modify): Remove PIN_PADLEN. * scd/ccid-driver.c (ccid_transceive_secure): Remove PIN_PADLEN. * scd/ccid-driver.h (ccid_transceive_secure): Remove PIN_PADLEN. * scd/iso7816.c (iso7816_check_keypad, iso7816_verify_kp) (iso7816_change_reference_data_kp): Remove PADLEN. * scd/iso7816.h (struct iso7816_pininfo_s): Remove PADLEN, PADCHAR. -- In the OpenPGPcard specification, password comes with no padding. In GnuPG, we support keypad input for OpenPGPcard only. Thus, it is useless to try to support padding for keypad input.
| * SCD: Add option enable-keypad-varlen and support for GEMPC_PINPAD.NIIBE Yutaka2013-02-053-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | * scd/scdaemon.h (opt): Add enable_keypad_varlen. * scd/scdaemon.c (cmd_and_opt_values): Add oEnableKeypadVarlen. (opts, main): Add oEnableKeypadVarlen. * scd/ccid-driver.c (GEMPC_PINPAD): New. (ccid_transceive_secure): Add enable_varlen handling. Enable GEMPC_PINPAD. -- Note that GEMPC_PINPAD doesn't support variable length keypad input. The feature of fixed length keypad input will be added soon.