6 years agoMerge branch 'master' into key-storage-work
Werner Koch [Tue, 12 Feb 2013 18:17:42 +0000 (19:17 +0100)]
Merge branch 'master' into key-storage-work

6 years agogpg: Implement card_store_subkey again.
NIIBE Yutaka [Wed, 6 Feb 2013 05:01:23 +0000 (14:01 +0900)]
gpg: Implement card_store_subkey again.

* 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.

6 years agoagent: Add KEYTOCARD command.
NIIBE Yutaka [Wed, 6 Feb 2013 05:00:05 +0000 (14:00 +0900)]
agent: Add KEYTOCARD command.

* 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.

6 years agoJapanese: update po and doc.
NIIBE Yutaka [Tue, 12 Feb 2013 05:14:12 +0000 (14:14 +0900)]
Japanese: update po and doc.

* doc/help.ja.txt, po/ja.po: Updated.

6 years agoscd: Rename 'keypad' to 'pinpad'.
NIIBE Yutaka [Thu, 7 Feb 2013 01:07:51 +0000 (10:07 +0900)]
scd: Rename 'keypad' to 'pinpad'.

* NEWS: Mention scd changes.

* agent/divert-scd.c (getpin_cb): Change message.

* agent/call-scd.c (inq_needpin): Change the protocol to
* 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,

* tools/gpgconf-comp.c (gc_options_scdaemon): Rename to

6 years agogpg: Add pinentry-mode feature.
Werner Koch [Thu, 7 Feb 2013 19:37:58 +0000 (20:37 +0100)]
gpg: Add pinentry-mode feature.

* 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

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

6 years agodoc: Fix description for NEED_PASSPHRASE status.
Werner Koch [Thu, 7 Feb 2013 19:18:31 +0000 (20:18 +0100)]
doc: Fix description for NEED_PASSPHRASE status.


6 years agoagent: Move a typedef to common and provide parse_pinentry_mode.
Werner Koch [Wed, 6 Feb 2013 11:49:52 +0000 (12:49 +0100)]
agent: Move a typedef to common and provide parse_pinentry_mode.

* common/agent-opt.c: New.
* common/shareddefs.h: New.
* common/ 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.

6 years agoagent: Return a better error code if no passphrase was given.
Werner Koch [Wed, 6 Feb 2013 11:42:07 +0000 (12:42 +0100)]
agent: Return a better error code if no passphrase was given.

* agent/protect.c (hash_passphrase): Handle an empty passphrase.

This is mostly useful in loopback pinentry-mode.

6 years agoscd: Fix check_keypad_request.
NIIBE Yutaka [Tue, 5 Feb 2013 05:59:29 +0000 (14:59 +0900)]
scd: Fix check_keypad_request.

* scd/app-openpgp.c (check_keypad_request): 0 means not to use pinpad.

6 years agoSCD: Add vendor specific initalization.
NIIBE Yutaka [Mon, 28 Jan 2013 02:46:40 +0000 (11:46 +0900)]
SCD: Add vendor specific initalization.

* scd/ccid-driver.c (ccid_vendor_specific_init): New.
(ccid_open_reader): Call ccid_vendor_specific_init.

6 years agoSCD: Support P=N format for login data.
NIIBE Yutaka [Sun, 13 Jan 2013 03:12:10 +0000 (12:12 +0900)]
SCD: Support P=N format for login data.

* scd/app-openpgp.c (parse_login_data): Support P=N format.

6 years agoSCD: Better interoperability.
NIIBE Yutaka [Fri, 11 Jan 2013 04:19:17 +0000 (13:19 +0900)]
SCD: Better interoperability.

* scd/apdu.c: Fill bTeoPrologue[2] field.
ccid-1.4.5 or older requires this field is filled by application.

6 years agoSCD: Defaults to use pinpad if the reader has the capability.
NIIBE Yutaka [Fri, 11 Jan 2013 01:41:38 +0000 (10:41 +0900)]
SCD: Defaults to use pinpad if the reader has the capability.

* 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.

6 years agoSCD: handle keypad request on the card.
NIIBE Yutaka [Thu, 10 Jan 2013 06:58:43 +0000 (15:58 +0900)]
SCD: handle keypad request on the card.

* 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.

6 years agoSCD: Minor fix of ccid-driver.
NIIBE Yutaka [Thu, 10 Jan 2013 06:52:24 +0000 (15:52 +0900)]
SCD: Minor fix of ccid-driver.

* scd/ccid-driver.c (VENDOR_VEGA): Fix typo.

6 years agoSCD: Add support of Covadis VEGA_ALPHA reader.
NIIBE Yutaka [Thu, 10 Jan 2013 01:49:27 +0000 (10:49 +0900)]
SCD: Add support of Covadis VEGA_ALPHA reader.

* scd/ccid-driver.c: Add 2013.
(ccid_transceive_secure): VEGA_ALPHA is same firmware as GEMPC_PINPAD.
Change bNumberMessage to 0x01, as it works better (was: 0xff).

6 years agoSCD: Support fixed length PIN input for keypad (PC/SC).
NIIBE Yutaka [Wed, 9 Jan 2013 07:40:41 +0000 (16:40 +0900)]
SCD: Support fixed length PIN input for keypad (PC/SC).

* scd/apdu.c (pcsc_keypad_verify): SUpport fixed length PIN input for
(pcsc_keypad_modify): Likewise.
* scd/ccid-driver.c (ccid_transceive_secure): Clean up.

6 years agoSCD: Support fixed length PIN input for keypad.
NIIBE Yutaka [Wed, 9 Jan 2013 07:23:55 +0000 (16:23 +0900)]
SCD: Support fixed length PIN input for keypad.

* 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):
* 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.

6 years agoSCD: API cleanup for keypad handling.
NIIBE Yutaka [Wed, 9 Jan 2013 05:10:08 +0000 (14:10 +0900)]
SCD: API cleanup for keypad handling.

* 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,
(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

6 years agoSCD: Clean up. Remove PADLEN for keypad input.
NIIBE Yutaka [Mon, 7 Jan 2013 05:20:55 +0000 (14:20 +0900)]
SCD: Clean up.  Remove PADLEN for keypad input.

* 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):

* 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.

6 years agoSCD: Add option enable-keypad-varlen and support for GEMPC_PINPAD.
NIIBE Yutaka [Wed, 9 Jan 2013 04:24:57 +0000 (13:24 +0900)]
SCD: Add option enable-keypad-varlen and support for GEMPC_PINPAD.

* 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.
Note that GEMPC_PINPAD doesn't support variable length keypad input.
The feature of fixed length keypad input will be added soon.

6 years agoConvert doc/DETAILS to org-mode
Werner Koch [Wed, 30 Jan 2013 17:54:23 +0000 (18:54 +0100)]
Convert doc/DETAILS to org-mode

Also restructure the file and fix some obviously wrong things.

6 years agoRemove unused status codes
Werner Koch [Wed, 30 Jan 2013 17:51:56 +0000 (18:51 +0100)]
Remove unused status codes

(STATUS_SIEXPIRED): Remove unused codes.

6 years agogpg: Add status line PINENTRY_LAUNCHED.
Werner Koch [Wed, 30 Jan 2013 11:00:29 +0000 (12:00 +0100)]
gpg: Add status line PINENTRY_LAUNCHED.

* common/status.h (STATUS_PINENTRY_LAUNCHED): New.
* g10/server.c (server_local_s): Add field allow_pinentry_notify.
(option_handler): Add option "allow-pinentry-notify".
(gpg_proxy_pinentry_notify): New.
* g10/call-agent.c (default_inq_cb): Factor code out to the new

6 years agoagent: Fix a bug of handling return code from npth_join.
NIIBE Yutaka [Fri, 25 Jan 2013 05:17:29 +0000 (14:17 +0900)]
agent: Fix a bug of handling return code from npth_join.

* agent/call-pinentry.c (agent_popup_message_stop): Fix npth_join
return code.
pth_join returns TRUE (1) on success.  But npth_join (and pthread_join)
returns 0 on success, returns error number on error.

6 years agogpg: Fix honoring --cert-digest-algo when recreating a cert
Christian Aistleitner [Sun, 14 Oct 2012 18:30:20 +0000 (20:30 +0200)]
gpg: Fix honoring --cert-digest-algo when recreating a cert

* g10/sign.c (update_keysig_packet): Override original signature's
digest algo in hashed data and for hash computation.

6 years agoFix spurious cruft from configure summary output.
Werner Koch [Mon, 7 Jan 2013 08:58:35 +0000 (09:58 +0100)]
Fix spurious cruft from configure summary output.

* (build_scdaemon_extra): Remove $tmp cruft.

6 years agoSCD: Hold lock for pinpad input.
NIIBE Yutaka [Fri, 11 Jan 2013 02:18:39 +0000 (11:18 +0900)]
SCD: Hold lock for pinpad input.

* scd/apdu.c (apdu_check_keypad, apdu_keypad_verify)
(apdu_keypad_modify): Hold lock to serialize communication.

6 years agokbx: Switch from MD5 to SHA-1 for the checksum.
Werner Koch [Tue, 8 Jan 2013 17:15:49 +0000 (18:15 +0100)]
kbx: Switch from MD5 to SHA-1 for the checksum.

* kbx/keybox-blob.c (put_membuf): Use a NULL buf to store zero bytes.
(create_blob_finish): Write just the needed space.
(create_blob_finish): Switch to SHA-1.
* kbx/keybox-dump.c (print_checksum): New.
(_keybox_dump_blob): Print the checksum and the verification status.

The checksum was never used in the past.  Due to fast SHA-1
computations in modern CPUs we now use SHA-1.  Eventually we will
support a First blob flag to enable the use of a secret or public
HMAC-SHA1.  The first may be used for authentication of keyblocks and
the latter to mitigate collission attacks on SHA-1.  It is not clear
whether this will be useful at all.

6 years agokbx: Update blob specification
Werner Koch [Tue, 8 Jan 2013 16:40:56 +0000 (17:40 +0100)]
kbx: Update blob specification

Mainly formatting updates.  The only actual change is the checksum
which is now declared as SHA-1.

6 years agogpg: Cache keybox searches.
Werner Koch [Tue, 8 Jan 2013 13:44:49 +0000 (14:44 +0100)]
gpg: Cache keybox searches.

* common/iobuf.c (iobuf_seek): Fix for temp streams.
* g10/pubkey-enc.c (get_session_key, get_it): Add some log_clock calls.
* g10/keydb.c (dump_search_desc): New.
(enum_keyblock_states, struct keyblock_cache): New.
(keyblock_cache_clear): New.
(keydb_get_keyblock, keydb_search): Implement a keyblock cache.
(keydb_update_keyblock, keydb_insert_keyblock, keydb_delete_keyblock)
(keydb_rebuild_caches, keydb_search_reset): Clear the cache.

Gpg uses the key database at several places without a central
coordination.  This leads to several scans of the keybox for the same
key.  To improve that we now use a simple cache to store a retrieved
keyblock in certain cases.  In theory this caching could also be done
for old keyrings, but it is a bit more work and questionable whether
it is needed; the keybox scheme is anyway much faster than keyrings.

Using a keybox with 20000 384 bit ECDSA/ECHD keypairs and a 252 byte
sample text we get these values for encrypt and decrypt operations on
an Core i5 4*3.33Ghz system.  The option --trust-model=always is used.
Times are given in milliseconds wall time.

|           | enc | dec | dec,q |
| key 1     |  48 |  96 |    70 |
| key 10000 |  60 |  98 |    80 |
| key 20000 |  69 | 106 |    88 |
| 10 keys   | 540 | 290 |    70 |

The 10 keys test uses a mix of keys, the first one is used for
decryption but all keys are looked up so that information about are
printed.  The last column gives decryption results w/o information
printing (--quiet).

The keybox is always scanned sequentially without using any index.  By
adding an index to the keybox it will be possible to further reduce
the time required for keys stored to the end of the file.

6 years agoMake log_clock easier to read.
Werner Koch [Tue, 8 Jan 2013 13:35:27 +0000 (14:35 +0100)]
Make log_clock easier to read.

* common/logging.c (log_clock): Print in microseconds.

6 years agogpg: Remove a function wrapper.
Werner Koch [Tue, 8 Jan 2013 08:43:21 +0000 (09:43 +0100)]
gpg: Remove a function wrapper.

* g10/keydb.h (keydb_search): Remove macro.
* g10/keydb.c (keydb_search2): Rename to keydb_search.  Change all

6 years agoSCD: Support not-so-smart card readers.
NIIBE Yutaka [Tue, 8 Jan 2013 06:22:31 +0000 (15:22 +0900)]
SCD: Support not-so-smart card readers.

* scd/ccid-driver.c (struct ccid_driver_s): Add auto_voltage,
auto_param, and auto_pps.
(parse_ccid_descriptor): Set auto_voltage, auto_param, and auto_pps.
Support non-autoconf readers.
(update_param_by_atr): New.
(ccid_get_atr): Use 5V for PowerOn when auto_voltage is not supported.
Use 0x10 when nonnull_nad for SetParameters.
Call update_param_by_atr for parsing ATR, and use param for
Send PPS if reader requires it and card is negotiable.
When bNadValue in the return values of SetParameters == 0,
clear handle->nonnull_nad flag.
This change is to support more card readers by the internal driver.
Tested with 08e6:3478 Gemplus PinPad Smart Card Reader.

6 years agogpg: Set the node flags while retrieving a keyblock.
Werner Koch [Mon, 7 Jan 2013 20:14:52 +0000 (21:14 +0100)]
gpg: Set the node flags while retrieving a keyblock.

* g10/keydb.c (parse_keyblock_image): Add args PK_NO and UID_NO and
set the note flags accordingly.
(keydb_get_keyblock): Transfer PK_NO and UID_NO to parse_keyblock_image.
* kbx/keybox-search.c (blob_cmp_fpr, blob_cmp_fpr_part)
(blob_cmp_name, blob_cmp_mail): Return the key/user number.
(keybox_search): Set the key and user number into the found struct.
(keybox_get_keyblock): Add args R_PK_NO and R_UID_NO and set them from
the found struct.

getkey.c needs to know whether the correct subkey was found.  Thus we
need to set the node flags the same way we did it with the keyring

6 years agoNew function log_clock.
Werner Koch [Mon, 7 Jan 2013 15:51:24 +0000 (16:51 +0100)]
New function log_clock.

* common/logging.c (log_clock): New.
* g10/gpg.c (set_debug): Print clock debug flag.
* g10/options.h (DBG_CLOCK_VALUE, DBG_CLOCK): New.

To actually use log_clock you need to enable the code in
logginc.c:log_check() and link against librt.  --debug 4096 may then
be used to enable it at runtime.

6 years agogpg: Allow searching for user ids in a keybox.
Werner Koch [Mon, 7 Jan 2013 14:41:10 +0000 (15:41 +0100)]
gpg: Allow searching for user ids in a keybox.

* kbx/keybox-search.c (blob_cmp_name): Add arg X509 and adjust for PGP
use.  Change callers.
(blob_cmp_mail): Add arg X509 and find the mailbox offset for PGP.
Chnage callers.
(has_subject_or_alt): Rename to has_username.
(has_username): Allow blobtype PGP.
(has_mail): Ditto.

6 years agogpg: Allow generation of more than 4096 keys in one run.
Werner Koch [Mon, 7 Jan 2013 14:37:50 +0000 (15:37 +0100)]
gpg: Allow generation of more than 4096 keys in one run.

* g10/getkey.c (cache_public_key): Make room in the cache if needed.

To create the selfsigs, the key generation code makes use of the key
cache.  However, after 4096 the cache is filled up and then disabled.
Thus generating more than 4096 keys in one run was not possible.  We
now clear the first half the inserted keys every time the cache gets

6 years agoUpdate Japanese Translation.
NIIBE Yutaka [Mon, 7 Jan 2013 01:41:21 +0000 (10:41 +0900)]
Update Japanese Translation.

* po/ja.po: Fix wrong translations for designated revocation.
Reported by Hideki Saito.


6 years agoUpdate Japanese Translation.
NIIBE Yutaka [Sat, 5 Jan 2013 07:38:11 +0000 (16:38 +0900)]
Update Japanese Translation.

* po/ja.po: Fix fuzzy translations.

6 years agoUpdate Japanese Translation.
NIIBE Yutaka [Thu, 3 Jan 2013 03:03:19 +0000 (12:03 +0900)]
Update Japanese Translation.

* po/ja.po: Update with POT.

6 years agoUpdate Japanese Translation.
NIIBE Yutaka [Thu, 3 Jan 2013 02:57:44 +0000 (11:57 +0900)]
Update Japanese Translation.

* po/ja.po: Start from the new one of 2.0.

6 years agogpg: Add signature cache support to the keybox.
Werner Koch [Fri, 28 Dec 2012 16:17:56 +0000 (17:17 +0100)]
gpg: Add signature cache support to the keybox.

* g10/keydb.c (parse_keyblock_image): Add arg SIGSTATUS.
(keydb_get_keyblock): Handle it.
(build_keyblock_image): Add arg SIGSTATUS.
(keydb_insert_keyblock): Handle it.
* kbx/keybox-blob.c (pgp_create_sig_part): Add arg SIGSTATUS.
(_keybox_create_openpgp_blob): Ditto.
* kbx/kbxutil.c (import_openpgp): Adjust for above change.
* kbx/keybox.h (KEYBOX_FLAG_SIG_INFO): New.
* kbx/keybox-search.c (_keybox_get_flag_location): Handle new flag.
(keybox_get_keyblock): Add arg R_SIGSTATUS.
* kbx/keybox-update.c (keybox_insert_keyblock): Add arg SIGSTATUS.

With this change a key listing using the keybox format is now double
as fast as using a keyring.  The memory use dropped as well.  Measured
with about 1500 keys.

6 years agokbxutil: Improve format of the Sig-Expire lines.
Werner Koch [Fri, 28 Dec 2012 16:07:37 +0000 (17:07 +0100)]
kbxutil: Improve format of the Sig-Expire lines.

* kbx/keybox-dump.c (_keybox_dump_blob): Print the expirate timestamp.

6 years agogpg: First working support for keyboxes.
Werner Koch [Fri, 28 Dec 2012 13:03:16 +0000 (14:03 +0100)]
gpg: First working support for keyboxes.

* g10/getkey.c (get_pubkey_fast): Improve the assertion.
* kbx/keybox.h: Include iobuf.h.
* kbx/keybox-blob.c (keyboxblob_uid): Add field OFF.
(KEYBOX_WITH_OPENPGP): Remove use of this macro.
(pgp_create_key_part_single): New.
(pgp_temp_store_kid): Change to use the keybox-openpgp parser.
(pgp_create_key_part): Ditto.
(pgp_create_uid_part): Ditto.
(pgp_create_sig_part): Ditto.
(pgp_create_blob_keyblock): Ditto.
(_keybox_create_openpgp_blob): Ditto.
* kbx/keybox-search.c (keybox_get_keyblock): New.
* kbx/keybox-update.c (keybox_insert_keyblock): New.
* g10/keydb.c (parse_keyblock_image):
(keydb_get_keyblock): Support keybox.
(build_keyblock_image): New.
(keydb_insert_keyblock): Support keybox.

* kbx/kbxutil.c (import_openpgp, main): Add option --dry-run and print
a kbx file to stdout.

* kbx/keybox-file.c (_keybox_read_blob2): Allow keyblocks up to 10^6

Import and key listing does now work with the keybox format.  It is
still quite slow and signature caching is completely missing.

Increasing the maximum allowed length for a keyblock was required due
to a 700k keyblock which inhibited kbxutil to list the file.
kbxutil's option name --import-openpgp is not quite appropriate
because it only creates KBX blobs from OpenPGP data.

6 years agokbxutil: Print algo number and fold similar lines.
Werner Koch [Fri, 28 Dec 2012 12:45:41 +0000 (13:45 +0100)]
kbxutil: Print algo number and fold similar lines.

* kbx/keybox-defs.h (_keybox_openpgp_key_info): Add field ALGO.
* kbx/keybox-openpgp.c (parse_key): Store algo.
* kbx/kbxutil.c (dump_openpgp_key): Print algo number.
* kbx/keybox-dump.c (_keybox_dump_blob): Print identical Sig-Expire
value lines with a range of indices.

6 years agogpg: First patches to support a keybox storage backend.
Werner Koch [Thu, 27 Dec 2012 14:04:29 +0000 (15:04 +0100)]
gpg: First patches to support a keybox storage backend.

* kbx/keybox-defs.h (_keybox_write_header_blob): Move prototype to ..
* kbx/keybox.h: here.
* kbx/keybox-init.c (keybox_lock): Add dummy function
* g10/keydb.c: Include keybox.h.
(struct resource_item): Add field kb.
(maybe_create_keyring_or_box): Add error descriptions to diagnostics.
Add arg IS_BOX.  Write a header for a new keybox file.
(keydb_add_resource): No more need for the force flag.  Rename the
local variable "force" to "create".  Add URL scheme "gnupg-kbx".  Add
magic test to detect a keybox file.  Add basic support for keybox.
(keydb_new, keydb_get_resource_name, keydb_delete_keyblock)
(keydb_locate_writable, keydb_search_reset, keydb_search2): Add
support for keybox.
(lock_all, unlock_all): Ditto.
* g10/ (needed_libs): Add libkeybox.a.
(gpg2_LDADD, gpgv2_LDADD): Add KSBA_LIBS as a workaround.

* g10/gpg.c, g10/gpgv.c (main): Use new constants.

I did most of these changes back in 2011 and only cleaned them up
now.  More to follow soon.

6 years agogpg: Import only packets which are allowed in a keyblock.
Werner Koch [Thu, 20 Dec 2012 08:43:41 +0000 (09:43 +0100)]
gpg: Import only packets which are allowed in a keyblock.

* g10/import.c (valid_keyblock_packet): New.
(read_block): Store only valid packets.

A corrupted key, which for example included a mangled public key
encrypted packet, used to corrupt the keyring.  This change skips all
packets which are not allowed in a keyblock.

GnuPG-bug-id: 1455

(cherry-picked from commit f795a0d59e197455f8723c300eebf59e09853efa)

6 years agogpg: Make commit 2b3cb2ee actually work
Werner Koch [Wed, 19 Dec 2012 10:47:23 +0000 (11:47 +0100)]
gpg: Make commit 2b3cb2ee actually work

* g10/sign.c (update_keysig_packet): Use digest_algo.

(cherry-picked from commit d23ec86095714d388acac14b515445fe69f019e9)

6 years agogpg: Suppress "public key already present" in quiet mode.
Werner Koch [Wed, 19 Dec 2012 10:21:26 +0000 (11:21 +0100)]
gpg: Suppress "public key already present" in quiet mode.

* g10/pkclist.c (find_and_check_key, build_pk_list): Print a
diagnostic only in non-quiet mode.

6 years agofaq: Add a section on copyright assignments
Werner Koch [Wed, 19 Dec 2012 10:05:05 +0000 (11:05 +0100)]
faq: Add a section on copyright assignments


6 years agoState that disclaimers are not anymore needed for translations.
Werner Koch [Tue, 18 Dec 2012 18:54:23 +0000 (19:54 +0100)]
State that disclaimers are not anymore needed for translations.


6 years agocommon: Add meta option ignore-invalid-option.
Werner Koch [Tue, 18 Dec 2012 17:06:41 +0000 (18:06 +0100)]
common: Add meta option ignore-invalid-option.

* common/argparse.c (iio_item_def_s, IIO_ITEM_DEF): New.
(initialize): Init field IIO_LIST.
(ignore_invalid_option_p): New.
(ignore_invalid_option_add): New.
(ignore_invalid_option_clear): New.
(optfile_parse): Implement meta option.

This option is currently of no use.  However, as soon as it has been
deployed in all stable versions of GnuPG, it will allow the use of the
same configuration file with an old and a new version of GnuPG.  For
example: If a new version implements the option "foobar", and a user
uses it in gpg.conf, an old version of gpg would bail out with the
error "invalid option".  To avoid that the following line can be put
above that option in gpg.conf

  ignore-invalid-option foobar

This meta option may be given several times or several option names
may be given as arguments (space delimited).  Note that this option is
not available on the command line.

6 years agoutf8conv.c: Add hacks for Android.
Werner Koch [Mon, 12 Nov 2012 14:38:51 +0000 (15:38 +0100)]
utf8conv.c: Add hacks for Android.

* common/utf8conv.c [HAVE_ANDROID_SYSTEM]: Do not include iconv.h.
(iconv_open, iconv_close, load_libiconv) [HAVE_ANDROID_SYSTEM]: New
dummy functions.
(set_native_charset) [HAVE_ANDROID_SYSTEM]: Force use of "utf-8".
(jnlib_iconv_open) [HAVE_ANDROID_SYSTEM]: Act the same as under W32.
(jnlib_iconv) [HAVE_ANDROID_SYSTEM]: Ditto.
(jnlib_iconv_close) [HAVE_ANDROID_SYSTEM]: Ditto.

Co-authored-by: Hans of Guardian <>
6 years agoSCD: Fix the process of writing key or generating key.
NIIBE Yutaka [Thu, 13 Dec 2012 04:36:23 +0000 (13:36 +0900)]
SCD: Fix the process of writing key or generating key.

* scd/app-openpgp.c (store_fpr): Flush KEY-FPR and KEY-TIME.

6 years agossh: Support ECDSA keys.
Werner Koch [Wed, 12 Dec 2012 17:47:21 +0000 (18:47 +0100)]
ssh: Support ECDSA keys.

* agent/command-ssh.c (SPEC_FLAG_IS_ECDSA): New.
(struct ssh_key_type_spec): Add fields CURVE_NAME and HASH_ALGO.
(ssh_key_types): Add types ecdsa-sha2-nistp{256,384,521}.
(ssh_signature_encoder_t): Add arg spec and adjust all callers.
(ssh_signature_encoder_ecdsa): New.
(sexp_key_construct, sexp_key_extract, ssh_receive_key)
(ssh_convert_key_to_blob): Support ecdsa.
(ssh_identifier_from_curve_name): New.
(ssh_send_key_public): Retrieve and pass the curve_name.
(key_secret_to_public): Ditto.
(data_sign): Add arg SPEC and change callers to pass it.
(ssh_handler_sign_request): Get the hash algo from SPEC.
* common/ssh-utils.c (get_fingerprint): Support ecdsa.

* agent/protect.c (protect_info): Add flag ECC_HACK.
(agent_protect): Allow the use of the "curve" parameter.
* agent/t-protect.c (test_agent_protect): Add a test case for ecdsa.

* agent/command-ssh.c (ssh_key_grip): Print a better error code.

The 3 standard curves are now supported in gpg-agent's ssh-agent
protocol implementation.  I tested this with all 3 curves and keys
generated by OpenSSH 5.9p1.

Using existing non-ssh generated keys will likely fail for now. To fix
this, the code should first undergo some more cleanup; then the fixes
are pretty straightforward.  And yes, the data structures are way too

6 years agossh: Rewrite a function for better maintainability
Werner Koch [Tue, 11 Dec 2012 13:50:34 +0000 (14:50 +0100)]
ssh: Rewrite a function for better maintainability

* agent/command-ssh.c (ssh_signature_encoder_dsa): Rewrite.

Using es_fopenmem instead of a preallocated buffer is safer and easier
to read.

6 years agossh: Improve key lookup for many keys.
Werner Koch [Mon, 10 Dec 2012 17:27:23 +0000 (18:27 +0100)]
ssh: Improve key lookup for many keys.

* agent/command-ssh.c: Remove dirent.h.
(control_file_s): Add struct item.
(rewind_control_file): New.
(search_control_file): Factor code out to ...
(read_control_file_item): New.
(ssh_handler_request_identities): Change to iterate over entries in

Formerly we scanned the private key directory for matches of entries
in sshcontrol.  This patch changes it to scan the sshcontrol file and
thus considers only keys configured there.  The rationale for this is
that it is common to have only a few ssh keys but many private keys.
Even if that assumption does not hold true, the scanning of the
sshcontrol file is faster than reading the directory and only then
scanning the ssh control for each directory entry.

6 years agossh: Cleanup sshcontrol file access code.
Werner Koch [Mon, 10 Dec 2012 15:39:12 +0000 (16:39 +0100)]
ssh: Cleanup sshcontrol file access code.

* agent/command-ssh.c (SSH_CONTROL_FILE_NAME): New macro to replace
the direct use of the string.
(struct control_file_s, control_file_t): New.
(open_control_file, close_control_file): New.  Use them instead of
using fopen/fclose directly.

6 years agoagent: Add envvar "gnupg_SSH_AUTH_SOCK_by"
Werner Koch [Mon, 10 Dec 2012 13:45:26 +0000 (14:45 +0100)]
agent: Add envvar "gnupg_SSH_AUTH_SOCK_by"

* agent/gpg-agent.c (main): Pass new envar gnupg_SSH_AUTH_SOCK_by to
an invoked process.

This environment variable is useful for debugging if
--use-standard-socket is used (which is the default since 2.1).
Commonly you should have this in your init script (e.g. ~/.bashrc):

    unset GPG_AGENT_INFO
    unset SSH_AGENT_PID
    export SSH_AUTH_SOCK

The problem is that gpg-agent won't be able to override the
SSH_AUTH_SOCK envvar if gpg-agent has been invoked as

  gpg-agent --enable-ssh-support --daemon /bin/bash

To fix this you should instead use this code in the init script:

  if [ ${gnupg_SSH_AUTH_SOCK_by:-0} -ne $$ ]; then
    export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"

This will work in all cases and thus allows to start gpg-agent for
testing purposes with a different homedir and use this gpg-agent as an
ssh-agent.  Example:

  GNUPGHOME=$(pwd) gpg-agent --enable-ssh-support --daemon /bin/bash

gnupg_SSH_AUTH_SOCK_by is set to the PID of the exec-ed process and
thus will work safely if called recursively.

6 years agoconfig: Update npth.m4.
Werner Koch [Mon, 10 Dec 2012 08:40:40 +0000 (09:40 +0100)]
config: Update npth.m4.

* m4/npth.m4: Take from current npth master.

6 years agoRevert SCD changes of 2010-05-03.
NIIBE Yutaka [Tue, 4 Dec 2012 05:37:56 +0000 (14:37 +0900)]
Revert SCD changes of 2010-05-03.

* scd/apdu.c (pcsc_no_service): Remove.
(open_pcsc_reader_direct, open_pcsc_reader_wrapped): Remove
pcsc_no_service support.
(apdu_open_reader): Remove R_NO_SERVICE.
* scd/apdu.h (apdu_open_reader): Remove R_NO_SERVICE.
* scd/command.c (reader_disabled): Remove.
(get_current_reader): Follow the change of R_NO_SERVICE.
(open_card, cmd_serialno, scd_command_handler): Remove reader_disabled
* scd/sc-copykeys.c (main): Follow the change of R_NO_SERVICE.
Daemon should handle all possible cases.  Even if such a difficult
case like reader_disabled, it should not exit.

6 years agoDon't keep opening unavailable card reader.
NIIBE Yutaka [Thu, 22 Nov 2012 07:04:51 +0000 (16:04 +0900)]
Don't keep opening unavailable card reader.

* scd/command.c (update_reader_status_file): Don't call

This fix has a impact that the insertion of a card reader will not be
detected upon the insertion, but will be deferred until user tries to
access his card.

6 years agoRefresh sample keys
David Shaw [Fri, 30 Nov 2012 17:47:49 +0000 (12:47 -0500)]
Refresh sample keys

6 years agoAdjust awk to not add trailing whitespace.
David Shaw [Fri, 30 Nov 2012 17:43:34 +0000 (12:43 -0500)]
Adjust awk to not add trailing whitespace.

* mksamplekeys: Tweak awk script to not add trailing whitespace to
  blank lines (makes git pre-commit hook unhappy)

6 years agoThe keyserver search menu should honor --keyid-format
David Shaw [Thu, 29 Nov 2012 17:00:46 +0000 (12:00 -0500)]
The keyserver search menu should honor --keyid-format

* keyserver.c (print_keyrec): Honor --keyid-format when getting back
  full fingerprints from the keyserver (the comment in the code was
  correct, the code was not).

6 years agoFix printing of ECC algo names in hkp keyserver listings.
Werner Koch [Tue, 27 Nov 2012 15:51:09 +0000 (16:51 +0100)]
Fix printing of ECC algo names in hkp keyserver listings.

* g10/keyserver.c (print_keyrec): Map OpenPGP algorithm ids.

6 years agoCheck for inet_addr() in -lnsl.
Ben Kibbey [Thu, 22 Nov 2012 22:17:33 +0000 (17:17 -0500)]
Check for inet_addr() in -lnsl.

* Check for inet_addr() in libnsl.

OpenSolaris/OpenIndiana requires this.

6 years agoDo not use a broken ttyname.
Werner Koch [Tue, 20 Nov 2012 18:01:13 +0000 (19:01 +0100)]
Do not use a broken ttyname.

* (HAVE_BROKEN_TTYNAME): New ac_define set for Android
* common/util.h (gnupg_ttyname): New macro.  Change all callers of
ttyname to use this macro instead.
(ttyname) [W32]: Rename to _gnupg_ttyname and use also if
* common/simple-pwquery.c (agent_send_all_options): Keep on using
ttyname unless HAVE_BROKEN_TTYNAME is set.  This is because this file
may be used standalone.

6 years agoFix non-portable use of chmod in
Werner Koch [Fri, 16 Nov 2012 09:36:53 +0000 (10:36 +0100)]
Fix non-portable use of chmod in

* Remove option -c from chmod.

6 years agoImprove parsing of the GIT revision number.
Werner Koch [Fri, 16 Nov 2012 09:35:33 +0000 (10:35 +0100)]
Improve parsing of the GIT revision number.

* (mmm4_revision): Use git rev-parse.

6 years agoAdd an OpenPGP card vendor.
Werner Koch [Thu, 15 Nov 2012 13:34:20 +0000 (14:34 +0100)]
Add an OpenPGP card vendor.

* g10/card-util.c (get_manufacturer): Add Yubico.

6 years agoFix description of validity flag 'n'.
Werner Koch [Sat, 10 Nov 2012 10:34:21 +0000 (11:34 +0100)]
Fix description of validity flag 'n'.

Thanks to Hauke Laging for spotting this.

6 years agoagent: Use wipememory instead of memset in one place.
Werner Koch [Tue, 6 Nov 2012 17:51:47 +0000 (18:51 +0100)]
agent: Use wipememory instead of memset in one place.

* agent/command.c (clear_outbuf): Use wipememory.  Suggested by Ben

6 years agoAllow decryption with card keys > 3072 bits
Werner Koch [Tue, 6 Nov 2012 11:02:25 +0000 (12:02 +0100)]
Allow decryption with card keys > 3072 bits

* scd/command.c (MAXLEN_SETDATA): New.
(cmd_setdata): Add option --append.
* agent/call-scd.c (agent_card_pkdecrypt): Use new option for long

* scd/app-openpgp.c (struct app_local_s): Add field manufacturer.
(app_select_openpgp): Store manufacturer.
(do_decipher): Print a note for broken cards.


Please note that I was not able to run a full test because I only have
broken cards (S/N < 346) available.

6 years agoagent: Fix wrong use of gcry_sexp_build_array
NIIBE Yutaka [Wed, 31 Oct 2012 07:09:06 +0000 (16:09 +0900)]
agent: Fix wrong use of gcry_sexp_build_array

* findkey.c (agent_public_key_from_file): Fix use of

A test case leading to a segv in Libgcrypt is

  gpg-connect-agent \
    "READKEY 9277C5875C8AFFCB727661C18BE4E0A0DEED9260" /bye

The keygrip was created by "monkeysphere s", which has a comment.

gcry_sexp_build_array expects pointers to the arguments which is quite
surprising.  Probably ARG_NEXT was accidentally implemented wrongly.
Anyway, we can't do anything about it and thus need to fix the check
the users of this function.

Some-comments-by: Werner Koch <>
6 years agoSCD: Upon error, open_pcsc_reader_wrapped does same as _direct.
NIIBE Yutaka [Wed, 31 Oct 2012 02:05:55 +0000 (11:05 +0900)]
SCD: Upon error, open_pcsc_reader_wrapped does same as _direct.

* scd/apdu.c (PCSC_E_NO_SERVICE): New.
(open_pcsc_reader_direct): Use PCSC_E_NO_SERVICE.
(open_pcsc_reader_wrapped): Set pcsc_no_service.

6 years agoUpdate and enable French translation
Werner Koch [Fri, 24 Aug 2012 15:42:36 +0000 (17:42 +0200)]
Update and enable French translation

* po/fr.po: Update.
* po/LINGUAS: Enable fr.

6 years agoAdd POT file to .gitignore
Werner Koch [Fri, 24 Aug 2012 15:41:21 +0000 (17:41 +0200)]
Add POT file to .gitignore


6 years agoUpdate German translation
Werner Koch [Fri, 24 Aug 2012 08:20:16 +0000 (10:20 +0200)]
Update German translation

Actually only updates due to typo fixes in the English source.

6 years agoFix typos spotted during translations
David Prévot [Wed, 22 Aug 2012 16:54:38 +0000 (12:54 -0400)]
Fix typos spotted during translations

* agent/genkey.c: s/to to/to/
* sm/*.c: s/failed to allocated/failed to allocate/
* sm/certlist.c, ./dirmngr/validate.c: s/should have not/should not have/
* g10/seskey.c: missing closing parenthesis
* dirmngr/crlcache.c: s/may has/may have/

Consistency fix:

* g10/gpg.c, kbx/kbxutil.c, sm/gpgsm.c: uppercase after Syntax
* dirmngr/dirmngr_ldap: no period in Syntax
* dirmngr/dirmngr-client.c: infinitive for option description:
s/certificates are expected/expect certificates/

6 years agoActually show translators comments in PO files
David Prévot [Wed, 22 Aug 2012 16:54:37 +0000 (12:54 -0400)]
Actually show translators comments in PO files


6 years agoKeep previous msgids of translated messages
David Prévot [Wed, 22 Aug 2012 16:54:36 +0000 (12:54 -0400)]
Keep previous msgids of translated messages

* po/ Use --previous with msgmerge.

6 years agoFix build system for Android by disabling tests since its x-compiled
Hans-Christoph Steiner [Fri, 17 Aug 2012 02:43:15 +0000 (22:43 -0400)]
Fix build system for Android by disabling tests since its x-compiled

(AH_BOTTOM) [__ANDROID__]: Do not re-define ttyname.
* Depend tests on new RUN_TESTS conditional.

6 years agoFix left over use of jnlib on some platforms
Werner Koch [Fri, 24 Aug 2012 07:29:56 +0000 (09:29 +0200)]
Fix left over use of jnlib on some platforms

* tools/watchgnupg.c: Take mischelp.h from common/ and not jnlib/.


Also fixed in some comments.

6 years agoFix incorrect description of --delete-secret-key
Werner Koch [Thu, 9 Aug 2012 12:45:18 +0000 (14:45 +0200)]
Fix incorrect description of --delete-secret-key


This is bug#1429.

6 years agoscd: handle reader/token removal.
NIIBE Yutaka [Sun, 24 Jun 2012 01:45:49 +0000 (10:45 +0900)]
scd: handle reader/token removal.

* scd/apdu.c (pcsc_error_to_sw): PCSC_E_UNKNOWN_READER means

6 years agoChange all quotes in strings and comments to the new GNU standard.
Werner Koch [Tue, 5 Jun 2012 17:29:22 +0000 (19:29 +0200)]
Change all quotes in strings and comments to the new GNU standard.

The asymmetric quotes used by GNU in the past (`...') don't render
nicely on modern systems.  We now use two \x27 characters ('...').

The proper solution would be to use the correct Unicode symmetric
quotes here.  However this has the disadvantage that the system
requires Unicode support.  We don't want that today.  If Unicode is
available a generated po file can be used to output proper quotes.  A
simple sed script like the one used for en@quote is sufficient to
change them.

The changes have been done by applying

  sed -i "s/\`\([^'\`]*\)'/'\1'/g"

to most files and fixing obvious problems by hand.  The msgid strings in
the po files were fixed with a similar command.

6 years agoPrint the hash algorithm in colon mode key listing.
Werner Koch [Thu, 24 May 2012 08:13:39 +0000 (10:13 +0200)]
Print the hash algorithm in colon mode key listing.

* g10/keylist.c (list_keyblock_colon): Print digest_algo.

6 years agoFix type conflict warning.
Werner Koch [Thu, 24 May 2012 08:11:49 +0000 (10:11 +0200)]
Fix type conflict warning.

* g10/keylist.c: Change min_cert_level to a byte.

6 years agoSwitch to the new automagic beta numbering scheme.
Werner Koch [Fri, 11 May 2012 08:20:29 +0000 (10:20 +0200)]
Switch to the new automagic beta numbering scheme.

* Add all the require m4 magic.

This also removes the hack to allow custom version numbers which are
not considered a development version.  A custom version number can be
done anyway by simply setting the version to it and tag the release
with it.

6 years agoAdd tweaks for the not anymore patented IDEA algorithm.
Werner Koch [Tue, 8 May 2012 16:18:32 +0000 (18:18 +0200)]
Add tweaks for the not anymore patented IDEA algorithm.

* g10/keygen.c (keygen_set_std_prefs): Include IDEA only in PGP2
compatibility mode.
* g10/misc.c (idea_cipher_warn): Remove.  Also remove all callers.
* common/status.h (STATUS_RSA_OR_IDEA): Remove.  Do not emit this
status anymore.

To keep the number of actually used algorithms low, we want to support
IDEA only in a basically read-only way (unless --pgp2 is used during
key generation).  It does not make sense to suggest the use of this
old 64 bit blocksize algorithm.  However, there is old data available
where it might be helpful to have IDEA available.

6 years agoAlways require libksba.
Werner Koch [Tue, 8 May 2012 12:33:34 +0000 (14:33 +0200)]
Always require libksba.

The extra test for libksba and possible trouble building GnuPG without
ksba is not anymore worth the trouble.

6 years agopo: Update de.po.
Werner Koch [Tue, 8 May 2012 13:18:26 +0000 (15:18 +0200)]
po: Update de.po.

* po/de.po: Update.

6 years agocommon: Remove generated files only during maintainer-clean.
Werner Koch [Tue, 8 May 2012 13:14:58 +0000 (15:14 +0200)]
common: Remove generated files only during maintainer-clean.


In general this is not required because automake does this for files
in BUILT_SOURCES anyway.  However, having them in CLEANFILES is wrong.
This is bug#1398.

6 years agoagent: Fix deadlock in trustlist due to the switch to npth.
Werner Koch [Mon, 30 Apr 2012 12:37:36 +0000 (14:37 +0200)]
agent: Fix deadlock in trustlist due to the switch to npth.

* agent/trustlist.c (clear_trusttable): New.
(agent_reload_trustlist): Use new function.
(read_trustfiles): Require to be called with lock held.
(agent_istrusted): Factor all code out to ...
(istrusted_internal): new.  Add ALREADY_LOCKED arg.  Make sure the
table islocked.  Do not print TRUSTLISTFLAG stati if called internally.
(agent_marktrusted): Replace calls to agent_reload_trustlist by
explicit code.

In contrast to pth, npth does not use recursive mutexes by default.
However, the code in trustlist.c assumed recursive locks and thus we
had to rework it.

6 years agomake DNS and URI fields work in gpgsm --gen-key.
NIIBE Yutaka [Thu, 26 Apr 2012 08:23:39 +0000 (10:23 +0200)]
make DNS and URI fields work in gpgsm --gen-key.

* sm/certreqgen-ui.c (gpgsm_gencertreq_tty): Actually set mb_uri and
mb_dns.avoid buffer strncpy-induced buffer overrun

6 years agoavoid buffer strncpy-induced buffer overrun
Jim Meyering [Wed, 25 Apr 2012 15:42:53 +0000 (17:42 +0200)]
avoid buffer strncpy-induced buffer overrun

* dirmngr/crlcache.c (open_dir): Ensure that both this_update
and next_update member strings are NUL-terminated.

6 years agoremove doubled words in a comment
Jim Meyering [Wed, 25 Apr 2012 15:40:48 +0000 (17:40 +0200)]
remove doubled words in a comment