aboutsummaryrefslogtreecommitdiffstats
path: root/agent (follow)
Commit message (Collapse)AuthorAgeFilesLines
* common: Add support for the new extended private key format.Justus Winter2016-04-212-9/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | * agent/findkey.c (write_extended_private_key): New function. (agent_write_private_key): Detect if an existing file is in extended format and update the key within if it is. (read_key_file): Handle the new format. * agent/keyformat.txt: Document the new format. * common/Makefile.am: Add the new files. * common/private-keys.c: New file. * common/private-keys.h: Likewise. * common/t-private-keys.c: Likewise. * common/util.h (alphap, alnump): New macros. * tests/migrations: Add test demonstrating that we can cope with the new format. -- GnuPG 2.3+ will use a new format to store private keys that is both more flexible and easier to read and edit by human beings. The new format stores name,value-pairs using the common mail and http header convention. This patch adds the parser and support code and prepares GnuPG 2.1 for the new format. Signed-off-by: Justus Winter <[email protected]>
* agent: Convert key format document to org.Justus Winter2016-04-211-47/+32
| | | | | | * agent/keyformat.txt: Convert to org mode. Signed-off-by: Justus Winter <[email protected]>
* agent: Sanitize permissions of the private key directory.Justus Winter2016-04-201-0/+4
| | | | | | | | | | | | | * agent/gpg-agent.c (create_private_keys_directory): Set permissions. * common/sysutils.c (modestr_to_mode): New function. (gnupg_mkdir): Use new function. (gnupg_chmod): New function. * common/sysutils.h (gnupg_chmod): New prototype. * tests/migrations/from-classic.test: Test migration with existing directory. GnuPG-bug-id: 2312 Signed-off-by: Justus Winter <[email protected]>
* agent: Fix regression due to recent commit 4159567.Werner Koch2016-04-141-2/+4
| | | | | | | | | | | | | | * agent/protect.c (do_encryption): Fix CBC hashing. -- The buggy code included an extra closing parenthesis before the (protected-at) term in the CBC hashing. We now do it by explicitly hashing the protected stuff and append the rest of the expression instead of a fixed closing parenthesis. Note that the OCB hashing only differs that it does no include the protected part. Fixes-commit: 4159567f7ed7a1139fdc3a6c92988e1648ad84ab Signed-off-by: Werner Koch <[email protected]>
* agent: Allow gpg-protect-tool to handle openpgp-native protection.Werner Koch2016-04-142-14/+97
| | | | | | | | | | | | | | | * agent/protect-tool.c (read_and_unprotect): Add arg ctrl and pass to agent_unprotect. (main): Allocate a simple CTRL object and pass it to read_and_unprotect. (convert_from_openpgp_native): Remove stub. (agent_key_available, agent_get_cache): New stubs. (agent_askpin): New emulation for the one in call-pinentry.c. (agent_write_private_key): New to dump key. * agent/Makefile.am (gpg_protect_tool_SOURCES): Add cvt-openpgp.c -- Signed-off-by: Werner Koch <[email protected]>
* agent: Implement new protection mode openpgp-s2k3-ocb-aes.Werner Koch2016-04-129-138/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/protect.c (agent_protect): Add arg use_ocb. Change all caller to pass -1 for default. * agent/protect-tool.c: New option --debug-use-ocb. (oDebugUseOCB): New. (opt_debug_use_ocb): New. (main): Set option. (read_and_protect): Implement option. * agent/protect.c (OCB_MODE_SUPPORTED): New macro. (PROT_DEFAULT_TO_OCB): New macro. (do_encryption): Add args use_ocb, hashbegin, hashlen, timestamp_exp, and timestamp_exp_len. Implement OCB. (agent_protect): Change to support OCB. (do_decryption): Add new args is_ocb, aadhole_begin, and aadhole_len. Implement OCB. (merge_lists): Allow NULL for sha1hash. (agent_unprotect): Change to support OCB. (agent_private_key_type): Remove debug output. -- Instead of using the old OpenPGP way of appending a hash of the plaintext and encrypt that along with the plaintext, the new scheme uses a proper authenticated encryption mode. See keyformat.txt for a description. Libgcrypt 1.7 is required. This mode is not yet enabled because there would be no way to return to an older GnuPG version. To test the new scheme use gpg-protect-tool: ./gpg-protect-tool -av -P abc -p --debug-use-ocb <plain.key >prot.key ./gpg-protect-tool -av -P abc -u <prot.key Any key from the private key storage should work. Signed-off-by: Werner Koch <[email protected]>
* doc: Note that the persistant passphrase format is unimplemented.Werner Koch2016-04-121-0/+2
| | | | --
* indent: Help Emacs not to get confused by conditional compilation.Werner Koch2016-04-121-1/+3
| | | | | | | | * agent/protect.c (calibrate_get_time) [W32]: Use separate function calls for W32 and W32CE. -- Signed-off-by: Werner Koch <[email protected]>
* agent: allow removal of the shadowed key.NIIBE Yutaka2016-03-161-1/+1
| | | | | | | | * agent/findkey.c (agent_delete_key): Remove the key when asked. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* common: Consolidate Assuan server argument handling.Justus Winter2016-03-021-80/+1
| | | | | | | | | | | | | | | * common/Makefile.am (common_sources): Add new files. * common/server-help.c: New file. * common/server-help.h: Likewise. * agent/command.c: Drop argument handling primitives in favor of using the consolidated ones. * dirmngr/server.c: Likewise. * g10/server.c: Likewise. * g13/server.c: Likewise. * scd/command.c: Likewise. * sm/server.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* agent: Send PROGRESS status lines to the client.Werner Koch2016-01-253-0/+134
| | | | | | | | | | | | | | | * agent/gpg-agent.c (struct progress_dispatch_s): New. (progress_dispatch_list): New. (main): Register libgcrypt pogress handler. (agent_libgcrypt_progress_cb): New. (agent_set_progress_cb): New. (unregister_progress_cb): New. (agent_deinit_default_ctrl): Call unregister. * agent/command.c (progress_cb): New. (start_command_handler): Register progress callback. -- Signed-off-by: Werner Koch <[email protected]>
* agent: New option --pinentry-timeoutWerner Koch2016-01-203-0/+23
| | | | | | | | | | | | | * agent/gpg-agent.c (oPinentryTimeout): New. (opts): Add new option. (parse_rereadable_options): PArse that option. (main): Tell gpgconf about this option. * agent/call-pinentry.c (start_pinentry): Send option to Pinentry. * tools/gpgconf-comp.c (gc_options_gpg_agent): Add Option. -- GnuPG-bug-id: 2222 Signed-off-by: Werner Koch <[email protected]>
* ssh: Accept OpenSSH *cert-v01 key variants.Werner Koch2016-01-121-38/+136
| | | | | | | | | | | | | | | | | | | | | * agent/command-ssh.c (SPEC_FLAG_WITH_CERT): New. (ssh_key_types): Add OpenSSH cert types. (stream_read_string): Allow a dummy read. (ssh_receive_mpint_list): Pass SPEC by reference. (ssh_receive_mpint_list): New arg CERT and use it. (ssh_receive_key): Read certificate into an estream object and modify parser to make use of that object. -- This is a first step to support certificate via the agent. The only effect of this change is the removal of an error message parsing the certificate. Note that ssh-add sends the private key anyway first and only then follows with the certificate+private key. What we need to implement next is a way to store the certificate in the agent and return it on request. Signed-off-by: Werner Koch <[email protected]>
* common: New put_membuf_cb to replace static membuf_data_cb.Werner Koch2016-01-081-17/+5
| | | | | | | | | | | | * common/membuf.c (put_membuf_cb): New. * agent/call-scd.c (membuf_data_cb): Remove. Change callers to use put_membuf_cb. * common/get-passphrase.c (membuf_data_cb): Ditto. * g10/call-agent.c (membuf_data_cb): Ditto. * sm/call-agent.c (membuf_data_cb): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
* agent: Typo fix for help text.Werner Koch2016-01-051-1/+1
| | | | --
* agent: Fix RSA verification for card.NIIBE Yutaka2016-01-051-6/+5
| | | | | | | | | | * agent/pksign.c (agent_pksign_do): Use S-exp of public key, instead of shadowed key. -- Reported-by: Justus Winter Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: IMPORT_KEY with --force option fix.NIIBE Yutaka2015-12-243-6/+7
| | | | | | | | | * agent/cvt-openpgp.c (convert_from_openpgp_main): Add an option not to check existing key. (convert_from_openpgp): Ditto. (convert_from_openpgp_native): Call convert_from_openpgp_main with dontcare_exist=0. * agent/command.c (cmd_import_key): Call with dontcare_exist=force.
* agent: Support --force option for IMPORT_KEY.NIIBE Yutaka2015-12-241-5/+7
| | | | * agent/command.c (cmd_keywrap_key): New option --force.
* agent: Improve error handling.Justus Winter2015-12-111-1/+2
| | | | | | * agent/pksign.c (agent_pksign_do): Improve error handling. Signed-off-by: Justus Winter <[email protected]>
* agent: Fix typo.Justus Winter2015-12-111-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* build: Require at least Libassuan 2.4.1.Werner Koch2015-12-021-16/+0
| | | | | | | | | | | | | | | * configure.ac (NEED_LIBASSUAN_VERSION): Set to 2.4.1. * agent/gpg-agent.c (create_server_socket): Remove check for libassuan >= 2.3.0 and >= 2.1.4. (main): Remove check for libassuan >= 2.1.4. * scd/scdaemon.c (create_server_socket): Remove check for libassuan >= 2.1.4. * dirmngr/dirmngr.c (set_tor_mode): Remove check for libassuan >= 2.3.0. * dirmngr/http.c (http_raw_connect, send_request): Remove checks for libassuan >= 2.3.0. Signed-off-by: Werner Koch <[email protected]>
* Silence unused variable or parameter warnings.Werner Koch2015-11-272-1/+4
| | | | --
* common: Extend utf8_charcount to include the string's length.Neal H. Walfield2015-11-231-1/+1
| | | | | | | | * common/stringhelp.c (utf8_charcount): Take additional parameter, len. Process at most LEN bytes. -- Signed-off-by: Neal H. Walfield <[email protected]>
* agent: Improve error handling.Justus Winter2015-11-191-1/+1
| | | | | | | | | | | * agent/trustlist.c (istrusted_internal): Initialize 'err'. -- There is a plausible path of execution so that a branch condition uses the uninitialized value. Found using the Clang Static Analyzer. Signed-off-by: Justus Winter <[email protected]>
* Fix typos found using codespell.Justus Winter2015-11-179-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/cache.c: Fix typos. * agent/call-pinentry.c: Likewise. * agent/call-scd.c: Likewise. * agent/command-ssh.c: Likewise. * agent/command.c: Likewise. * agent/divert-scd.c: Likewise. * agent/findkey.c: Likewise. * agent/gpg-agent.c: Likewise. * agent/w32main.c: Likewise. * common/argparse.c: Likewise. * common/audit.c: Likewise. * common/audit.h: Likewise. * common/convert.c: Likewise. * common/dotlock.c: Likewise. * common/exechelp-posix.c: Likewise. * common/exechelp-w32.c: Likewise. * common/exechelp-w32ce.c: Likewise. * common/exechelp.h: Likewise. * common/helpfile.c: Likewise. * common/i18n.h: Likewise. * common/iobuf.c: Likewise. * common/iobuf.h: Likewise. * common/localename.c: Likewise. * common/logging.c: Likewise. * common/openpgp-oid.c: Likewise. * common/session-env.c: Likewise. * common/sexputil.c: Likewise. * common/sysutils.c: Likewise. * common/t-sexputil.c: Likewise. * common/ttyio.c: Likewise. * common/util.h: Likewise. * dirmngr/cdblib.c: Likewise. * dirmngr/certcache.c: Likewise. * dirmngr/crlcache.c: Likewise. * dirmngr/dirmngr-client.c: Likewise. * dirmngr/dirmngr.c: Likewise. * dirmngr/dirmngr_ldap.c: Likewise. * dirmngr/dns-stuff.c: Likewise. * dirmngr/http.c: Likewise. * dirmngr/ks-engine-hkp.c: Likewise. * dirmngr/ks-engine-ldap.c: Likewise. * dirmngr/ldap-wrapper.c: Likewise. * dirmngr/ldap.c: Likewise. * dirmngr/misc.c: Likewise. * dirmngr/ocsp.c: Likewise. * dirmngr/validate.c: Likewise. * g10/encrypt.c: Likewise. * g10/getkey.c: Likewise. * g10/gpg.c: Likewise. * g10/gpgv.c: Likewise. * g10/import.c: Likewise. * g10/keydb.c: Likewise. * g10/keydb.h: Likewise. * g10/keygen.c: Likewise. * g10/keyid.c: Likewise. * g10/keylist.c: Likewise. * g10/keyring.c: Likewise. * g10/mainproc.c: Likewise. * g10/misc.c: Likewise. * g10/options.h: Likewise. * g10/packet.h: Likewise. * g10/parse-packet.c: Likewise. * g10/pkclist.c: Likewise. * g10/pkglue.c: Likewise. * g10/plaintext.c: Likewise. * g10/server.c: Likewise. * g10/sig-check.c: Likewise. * g10/sqlite.c: Likewise. * g10/tdbio.c: Likewise. * g10/test-stubs.c: Likewise. * g10/tofu.c: Likewise. * g10/trust.c: Likewise. * g10/trustdb.c: Likewise. * g13/create.c: Likewise. * g13/mountinfo.c: Likewise. * kbx/keybox-blob.c: Likewise. * kbx/keybox-file.c: Likewise. * kbx/keybox-init.c: Likewise. * kbx/keybox-search-desc.h: Likewise. * kbx/keybox-search.c: Likewise. * kbx/keybox-update.c: Likewise. * scd/apdu.c: Likewise. * scd/app-openpgp.c: Likewise. * scd/app-p15.c: Likewise. * scd/app.c: Likewise. * scd/ccid-driver.c: Likewise. * scd/command.c: Likewise. * scd/iso7816.c: Likewise. * sm/base64.c: Likewise. * sm/call-agent.c: Likewise. * sm/call-dirmngr.c: Likewise. * sm/certchain.c: Likewise. * sm/gpgsm.c: Likewise. * sm/import.c: Likewise. * sm/keydb.c: Likewise. * sm/minip12.c: Likewise. * sm/qualified.c: Likewise. * sm/server.c: Likewise. * tools/gpg-check-pattern.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgkey2ssh.c: Likewise. * tools/gpgparsemail.c: Likewise. * tools/gpgtar.c: Likewise. * tools/rfc822parse.c: Likewise. * tools/symcryptrun.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* Fix typosDaniel Kahn Gillmor2015-10-281-1/+1
| | | | --
* agent: Clarify agent's KEYWRAP_KEY description.Daniel Kahn Gillmor2015-10-281-1/+1
| | | | | | -- Signed-Off-By: Daniel Kahn Gillmor <[email protected]>
* agent: simplify agent_get_passphrase.NIIBE Yutaka2015-10-091-8/+2
| | | | * agent/call-pinentry.c (agent_get_passphrase): Simplify.
* agent: fix agent_askpin.NIIBE Yutaka2015-10-091-1/+1
| | | | * agent/call-pinentry.c (agent_askpin): Fix off-by-one error.
* agent: Fix function return type for check_cb and agent_askpin.NIIBE Yutaka2015-10-096-21/+23
| | | | | | | | | | | | * agent/call-pinentry.c (unlock_pinentry): Return gpg_error_t. (start_pinentry, setup_qualitybar): Likewise. (agent_askpin): Fix return value check of check_cb. * agent/command-ssh.c (reenter_compare_cb): Return gpg_error_t. (ssh_identity_register): Fix return value check of agent_askpin. * agent/cvt-openpgp.c (try_do_unprotect_cb): Return gpg_error_t. * agent/findkey.c (try_unprotect_cb): Likewise. * agent/genkey.c (reenter_compare_cb): Return gpg_error_t. (agent_ask_new_passphrase): Fix return value check of agent_askpin.
* agent: Fix verification of signature for smartcard.NIIBE Yutaka2015-10-061-1/+10
| | | | | | | | | * agent/pksign.c (agent_pksign_do): Use public key smartcard. -- Since gcry_pk_verify can't handle shadowed private key, public key SEXP should be prepared for smartcard.
* agent: Fix non-allocation for pinentry_loopback.NIIBE Yutaka2015-10-051-4/+2
| | | | | * agent/call-pinentry.c (agent_get_passphrase): Don't allocate, it will be allocated by pinentry_loopback.
* scd: Use Assuan macro instead of a number constant.Werner Koch2015-10-021-3/+4
| | | | --
* agent: Fix alignment problem with the second passphrase struct.Werner Koch2015-10-022-5/+23
| | | | | | | | | | | | | | | | | | | | * agent/genkey.c (agent_ask_new_passphrase): Use a separate malloc for PI2. Check return value of the malloc function. * agent/command-ssh.c (ssh_identity_register): Use a separate malloc for PI2. Wipe PI2. -- For whatever stupid reasons I once allocated only one memory area and split that into PI and PI2. This is actually a common pattern with malloc but here we used a made up object size and do not take the extra alignment required into account. One of these not yet hit by a (sig)bus PC/VAX hacker bugs. Instead of trying to fix the alignment, it is better to use a second calloc for the second struct. GnuPG-bug-id: 2112 Signed-off-by: Werner Koch <[email protected]>
* agent: RSA signature verification by gpg-agent.NIIBE Yutaka2015-09-291-3/+39
| | | | | | | | | | | | * g10/sign.c (do_sign): Let verify signature by gpg-agent. * agent/pksign.c (agent_pksign_do): Call gcry_pk_verify for RSA. -- RSA signature verification should be done to prevent attacks against RSA CRT implementations and not to return invalid signature to adversary. Newer libgcrypt does so. For older libgcrypt and smartcards, gpg-agent does signature verification.
* agent: Fix importing ECC key.NIIBE Yutaka2015-09-191-99/+11
| | | | | | | | | * agent/cvt-openpgp.c (convert_from_openpgp_main): Only encrypted parameters are stored as opaque. (apply_protection): ARRAY members are all normal, non-opaque MPI. (extract_private_key): Get public key as normal, non-opaque MPI. Remove support of ECC key with '(flags param)'. Remove support of "ecdsa" and "ecdh" keys of our experiment.
* agent: New option --pinentry-invisible-char.Werner Koch2015-09-163-2/+29
| | | | | | | | | | * agent/gpg-agent.c (oPinentryInvisibleChar): New. (opts): Add option. (parse_rereadable_options): Set option. * agent/agent.h (opt): Add field pinentry_invisible_char. * agent/call-pinentry.c (start_pinentry): Pass option to pinentry. Signed-off-by: Werner Koch <[email protected]>
* agent: Fix registering SSH Key of Ed25519.NIIBE Yutaka2015-09-161-6/+8
| | | | | | | | * agent/command-ssh.c (stream_read_string): Add the prefix of 0x40. -- GnuPG-bug-id: 2096
* agent: Protect commit 135b1e3 against misbehaving Libgcrypt.Werner Koch2015-09-011-1/+1
| | | | | | * agent/command-ssh.c (ssh_key_to_blob): Check DATALEN. Signed-off-by: Werner Koch <[email protected]>
* agent: Fix SSH public key for EdDSA.NIIBE Yutaka2015-08-311-0/+5
| | | | * agent/command-ssh.c (ssh_key_to_blob): Remove the prefix 0x40.
* agent: Raise the maximum password length. Don't hard code it.Neal H. Walfield2015-08-245-12/+17
| | | | | | | | | | | | | * agent/agent.h (MAX_PASSPHRASE_LEN): Define. * agent/command-ssh.c (ssh_identity_register): Use it instead of a hard-coded literal. * agent/cvt-openpgp.c (convert_from_openpgp_main): Likewise. * agent/findkey.c (unprotect): Likewise. * agent/genkey.c (agent_ask_new_passphrase): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>. GnuPG-bug-id: 2038
* Fix pinentry loopback and passphrase contraints.Ben Kibbey2015-08-162-0/+6
| | | | | | | | | | | * agent/command.c (cmd_get_passphrase): Don't repeat passphrase for pinentry loopback mode. * agent/genkey.c (check_passphrase_constraints): Immediately return when pinentry mode is loopback. -- Fixes endless loop when inquiring a passphrase with pinentry-mode=loopback that may not satisfy passphrase contraints.
* agent: fix ECC key handling.NIIBE Yutaka2015-08-101-38/+20
| | | | | * agent/cvt-openpgp.c (get_keygrip, convert_secret_key) (convert_transfer_key): CURVE is the name of curve.
* agent: Add option --force to the DELETE_KEY command.Werner Koch2015-08-073-52/+58
| | | | | | | * agent/findkey.c (agent_delete_key): Add arg "force". * agent/command.c (cmd_delete_key): Add option --force. Signed-off-by: Werner Koch <[email protected]>
* Curve25519 support.NIIBE Yutaka2015-08-061-32/+59
| | | | | | | | | | | | | | | | | | | | | | | | * agent/cvt-openpgp.c (get_keygrip): Handle Curve25519. (convert_secret_key, convert_transfer_key): Ditto. * common/openpgp-oid.c (oidtable): Add Curve25519. (oid_crv25519, openpgp_oid_is_crv25519): New. * common/util.h (openpgp_oid_is_crv25519): New. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Handle the case with Montgomery curve which uses x-only coordinate. * g10/keygen.c (gen_ecc): Handle Curve25519. (ask_curve): Change the API and second arg is to return subkey algo. (generate_keypair, generate_subkeypair): Follow chage of ask_curve. * g10/keyid.c (keygrip_from_pk): Handle Curve25519. * g10/pkglue.c (pk_encrypt): Handle Curve25519. * g10/pubkey-enc.c (get_it): Handle the case with Montgomery curve. * scd/app-openpgp.c (ECC_FLAG_DJB_TWEAK): New. (send_key_attr): Work with general ECC, Ed25519, and Curve25519. (get_public_key): Likewise. (ecc_writekey): Handle flag_djb_tweak. -- When libgcrypt has Curve25519, GnuPG now supports Curve25519.
* Replace GNUPG_GCC_A_ macros by GPGRT_ATTR_ macros.Werner Koch2015-07-261-3/+4
| | | | | | | | | | | | | * common/util.h: Provide replacement for GPGRT_ATTR_ macros when using libgpg-error < 1.20. * common/mischelp.h: Ditto. * common/types.h: Ditto. -- Given that libgpg-error is a dependency of all GnuPG related libraries it is better to define such macros at only one place instead of having similar macros at a lot of places. For now we need repalcement macros, though.
* agent: Support non-NLS build.NIIBE Yutaka2015-07-101-0/+4
| | | | | | | | | | * agent/agent.h: Use ENABLE_NLS and define L_() macro. -- GnuPG-bug-id: 2032 This is a fix for e76d4c05b24211f3981ab69cddb3fccc17d21e0e.
* agent: Unset INSIDE_EMACS on gpg-agent startupDaiki Ueno2015-07-011-0/+5
| | | | | | | | | | | * agent/gpg-agent.c (main): Unset INSIDE_EMACS envvar. -- The variable is set only temporarily when gpg is called from Emacs, keeping it during the session makes no sense. Signed-off-by: Daiki Ueno <[email protected]>
* Flag the L_() function with attribute format_arg.Werner Koch2015-06-302-2/+7
| | | | | | | | | | | | * agent/agent.h (LunderscorePROTO): New. * common/util.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. * common/i18n.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. Use for i18n_localegettext. Expand LunderscorePROTO. * agent/genkey.c (check_passphrase_constraints): Use xtryasprintf again to keep the old translations. -- Signed-off-by: Werner Koch <[email protected]>
* agent: Use different translation func for Pinentry strings.Werner Koch2015-06-307-104/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * po/Makevars (XGETTEXT_OPTIONS): Add keyword "L_". * common/i18n.c (i18n_localegettext): New stub. * common/i18n.h: Expand the LunderscoreIMPL macro. * agent/agent.h (L_): New. (LunderscoreIMPL): New. * agent/call-pinentry.c (setup_qualitybar): Add arg ctrl anc change caller. * agent/findkey.c (try_unprotect_cb): Add local var ctrl. * agent/genkey.c (check_passphrase_constraints): Replace xtryasprintf by xtrystrdup to avoid gcc warning. Unfortinately this changes the string. (agent_ask_new_passphrase): Cleanup the use of initial_errtext. -- Static strings in gpg-agent need to be translated according to the locale set by the caller. This is required so that a gpg-agent can be started in one locale and a gpg can be run in another. If we don't do this the static strings (prompt, buttons) are not or in the wrong locale translated while dynamic strings (e.g. key description) uses the locale of gpg. This is only the first part of the change the actual local switching still needs to be implemented. Debian-bug-id: 788983 Signed-off-by: Werner Koch <[email protected]>