gnupg.git
6 years agoUpdate gpg-error, libgcrypt, and ksba m4 scripts.
Werner Koch [Thu, 25 Apr 2013 11:00:16 +0000 (12:00 +0100)]
Update gpg-error, libgcrypt, and ksba m4 scripts.

* m4/gpg-error.m4: Update from libgpg-error repo.
* m4/ksba.m4: Likewise.
* m4/libgcrypt.m4: Likewise.
--

GnuPG-bug-id: 1496.
Signed-off-by: Werner Koch <wk@gnupg.org>
6 years agoUpdate Ukrainian translation.
Yuri Chornoivan [Thu, 25 Apr 2013 11:00:16 +0000 (12:00 +0100)]
Update Ukrainian translation.

6 years agoNote: Wrong author in previous commit 049b3d9.
Werner Koch [Thu, 25 Apr 2013 11:00:16 +0000 (12:00 +0100)]
Note: Wrong author in previous commit 049b3d9.

--

Magit keeps the author and date from the last commit unless reset with
a c-t.  Time for Jim's git-log-fix.

6 years agow32: Add icons and version information.
Ian Abbott [Thu, 25 Apr 2013 11:00:16 +0000 (12:00 +0100)]
w32: Add icons and version information.

* common/gnupg.ico: New.  Take from artwork/gnupg-favicon-1.ico.
* agent/gpg-agent-w32info.rc: New.
* g10/gpg-w32info.rc: New.
* scd/scdaemon-w32info.rc: New.
* sm/gpgsm-w32info.rc: New.
* tools/gpg-connect-agent-w32info.rc: New.
* common/w32info-rc.h.in: New.
* configure.ac (BUILD_REVISION, BUILD_FILEVERSION, BUILD_TIMESTAMP)
(BUILD_HOSTNAME): New.
(AC_CONFIG_FILES): Add w32info-rc.h.
* am/cmacros.am (.rc.o): New rule.
* agent/Makefile.am, common/Makefile.am, g10/Makefile.am
* scd/Makefile.am, sm/Makefile.am, tools/Makefile.am: Add stuff to
build resource files.

Signed-off-by: Werner Koch <wk@gnupg.org>
6 years agodoc: fix some Texinfo warnings.
Ian Abbott [Thu, 25 Apr 2013 11:00:16 +0000 (12:00 +0100)]
doc: fix some Texinfo warnings.

* doc/gpg.texi: Fix syntax and add missing menu entries.
* doc/gpgsm.texi: Fix subsectioning.
--

These five patches fix some warnings from Texinfo 5 by adding some
missing nodes and changing some sections to subsections, and moving an
'@end ifset' to the start of a line.  I also noticed the 'Deprecated
options' subsection didn't appear in the GPG options menu, so I added
it.  (Texinfo never warned about it because it was after the last node
in the menu.)

1) doc/gpg.texi: move '@end ifset' to start of line
2) doc/gpg.texi: Add missing node for 'Compliance options' section.
3) doc/gpg.texi: add node for 'Deprecated options' subsection.
4) doc/gpg.texi: make 'Unattended key generation' a subsection
5) doc/gpgsm.texi: fix subsectioning for Unattended Usage

(all 5 merged into one patch by wk)

6 years agoFix a typo and a wrong code indentation.
Jedi [Thu, 25 Apr 2013 07:33:33 +0000 (09:33 +0200)]
Fix a typo and a wrong code indentation.

--

Reported-by: NIIBE Yutaka <gniibe@fsij.org>
6 years agoUpdate Traditional Chinese translation.
Jedi [Wed, 24 Apr 2013 14:07:53 +0000 (16:07 +0200)]
Update Traditional Chinese translation.

--

Kudos to Jedi for this really fast update (wk).

6 years agoPoint to copies in the master branch for some doc file.
Jedi [Wed, 24 Apr 2013 11:02:38 +0000 (13:02 +0200)]
Point to copies in the master branch for some doc file.

--

6 years agoUpdate helper scripts.
Jedi [Wed, 24 Apr 2013 10:50:28 +0000 (12:50 +0200)]
Update helper scripts.

* compile, config.guess, config.rpath, config.sub, depcomp,
* install-sh, mdate-sh, mkinstalldirs: Update to Feb 25 versions from
gnulib.

6 years agoUpdate Traditional Chinese translation.
Jedi [Wed, 24 Apr 2013 08:12:50 +0000 (10:12 +0200)]
Update Traditional Chinese translation.

--

Original translation date was 2012-05-13.  Some fuzzies fixed by wk.

6 years agoUpdate Danish translation
Joe Hansen [Thu, 1 Nov 2012 15:32:41 +0000 (11:32 -0400)]
Update Danish translation

* po/da.po: Update.

6 years agoUpdate Spanish translation.
Jaime Suarez [Wed, 24 Apr 2013 07:50:23 +0000 (09:50 +0200)]
Update Spanish translation.

6 years agoRun an update-po.
Werner Koch [Wed, 24 Apr 2013 07:42:24 +0000 (09:42 +0200)]
Run an update-po.

--

6 years agoUpdate de.po and fr.po for keypad->pinpad change.
Werner Koch [Wed, 24 Apr 2013 07:38:17 +0000 (09:38 +0200)]
Update de.po and fr.po for keypad->pinpad change.

6 years agoscd: Add pinpad support for REINER SCT cyberJack go
NIIBE Yutaka [Tue, 23 Apr 2013 23:36:31 +0000 (08:36 +0900)]
scd: Add pinpad support for REINER SCT cyberJack go

* scd/ccid-driver.c (VENDOR_REINER, CYBERJACK_GO): New.
(ccid_transceive_secure): Handle the case for VENDOR_REINER.
Original work was by Alina Friedrichsen (tiny change).
--
This is revised version which adapts changes of ccid-driver.

6 years agow32: Almost everywhere include winsock2.h before windows.h.
Werner Koch [Tue, 23 Apr 2013 16:06:46 +0000 (18:06 +0200)]
w32: Almost everywhere include winsock2.h before windows.h.

--

This is required by newer mingw toolchain versions which demand that
winsock2.h is included before windows.h.  Now, due to the use of
socket definitions in pth.h we need to include winsock2.h also in
pth.h, now pth.h is often included after an include of windows.h and
thus the compiler spits out a warning.  To avoid that we include
winsock2.h at all places the compiler complains about.

6 years agoAllow building gpgkeys_ldap with the 32 bit mingw-w64 toolchain.
Werner Koch [Tue, 23 Apr 2013 15:04:56 +0000 (17:04 +0200)]
Allow building gpgkeys_ldap with the 32 bit mingw-w64 toolchain.

* keyserver/gpgkeys_ldap.c (my_ldap_start_tls_s): Define macro
depending on compiler version.
(main): Use new macro.
--

It seems that the LDAP keyserver helper if build with the old mingw32
toolchain never worked correctly for LDAPS.  The prototype there for
ldap_start_tls_s is plainly wrong for Windows.  However, the fix here
has special support so not to break building with the old compiler.

6 years agoUpdate NEWS and README
Werner Koch [Fri, 16 Nov 2012 09:35:33 +0000 (10:35 +0100)]
Update NEWS and README

--

6 years agoFix bashism in autogen.sh.
Werner Koch [Fri, 16 Nov 2012 09:35:33 +0000 (10:35 +0100)]
Fix bashism in autogen.sh.

--

The use of options for cp is not required.  Probably c+p cruft.

6 years agoTry to use w64 toolchain for --build-w32.
Werner Koch [Fri, 16 Nov 2012 09:35:33 +0000 (10:35 +0100)]
Try to use w64 toolchain for --build-w32.

--

6 years agoFix potential heap corruption in "gpg -v --version".
Werner Koch [Sat, 15 Dec 2012 10:28:00 +0000 (11:28 +0100)]
Fix potential heap corruption in "gpg -v --version".

* g10/gpg.c (build_list): Rewrite to cope with buffer overflow in
certain locales.
--

This fixes an obvious bug in locales where the translated string is
longer than the original.  The bug could be exhibited by using
LANG=ru_RU.utf8 gpg -v --version.

En passant we also removed the trailing white space on continued
lines.

Reported-by: Dmitry V. Levin" <ldv at altlinux.org>
(cherry picked from commit e33e74e3a4b2b4a0341f933410ddd5db7a12515e)

Note that this version uses utf8_charcount to get the indentation
mostly right.

Signed-off-by: Werner Koch <wk@gnupg.org>
6 years agoComment fixes.
Werner Koch [Fri, 16 Nov 2012 09:35:33 +0000 (10:35 +0100)]
Comment fixes.

--

Reported-by: Daniel Kahn Gillmor
6 years agoAdjust git-log-fix for cherry-picked commits.
Werner Koch [Fri, 16 Nov 2012 09:35:33 +0000 (10:35 +0100)]
Adjust git-log-fix for cherry-picked commits.

--

6 years agoSwitch to the new automagic beta numbering scheme.
Werner Koch [Fri, 16 Nov 2012 09:35:33 +0000 (10:35 +0100)]
Switch to the new automagic beta numbering scheme.

* configure.ac: Add all the required 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.

This is a backport from master including the later patch to use
rev-parse.

6 years agoUpdate docs from master.
Werner Koch [Thu, 18 Apr 2013 12:40:43 +0000 (14:40 +0200)]
Update docs from master.

* doc/gpg-agent.texi: Update from master.
* doc/gpg.texi: Ditto.
* doc/gpgsm.texi: Ditto.
* doc/gpl.texi: Ditto.
* doc/yat2m.c: Ditto.
--

(updated from commit d6798d261cbe6519ef5b3ebb474e2ad348442c0c)

6 years agoIgnore obsolete option --disable-keypad.
Werner Koch [Thu, 18 Apr 2013 12:40:43 +0000 (14:40 +0200)]
Ignore obsolete option --disable-keypad.

* scd/scdaemon.c (opts): Ignore --disable-keypad.
--

The renaming of --disable-keypad to --disable-pinpad might mess up
configuration files managed with a GUI.  The GUI does not not anymore
know about the old option and would allow the user to switch
"disable-pinpad" on.  However, a "disable-keypad" might still linger
in the conf file with gpgconf not knowing about it.  Thus the conf
file would always be rejected and manual intervention would be
required.  Ignoring the old option nicely solves the problem.

6 years agoAllow marking options as ignored.
Werner Koch [Thu, 18 Apr 2013 12:40:43 +0000 (14:40 +0200)]
Allow marking options as ignored.

* jnlib/argparse.h (ARGPARSE_OPT_IGNORE): New.
(ARGPARSE_TYPE_MASK): New, for internal use.
(ARGPARSE_ignore): New.
* jnlib/argparse.c (optfile_parse, arg_parse): Replace remaining
constants by macros.
(optfile_parse): Implement ARGPARSE_OPT_IGNORE.
(arg_parse): Exclide ignore options from --dump-options.
--

In addition to the ignore-invalid-option (commit 8ea49cf5) it is often
useful to mark options in a configuration which as NOP.  For example
options which have no more function at all but can be expected to be
found in existing conf files.  Such an option (or command) may now be
given as

  ARGPARSE_ignore (300, "obsolete-option")

The 300 is merely used as a non-valid single option name much like
group names or the 500+n values used for long options.

Signed-off-by: Werner Koch <wk@gnupg.org>
6 years agoDo not mix test result with progress lines.
Werner Koch [Thu, 5 Apr 2012 18:32:42 +0000 (20:32 +0200)]
Do not mix test result with progress lines.

This makes parsing of the results easier.  Fixes bug#1400.

* tests/openpgp/defs.inc (progress_cancel, progress_end)
(progress_new): New.
* tests/openpgp/conventional-mdc.test: Use progress functions
* tests/openpgp/conventional.test: Ditto.
* tests/openpgp/encrypt-dsa.test: Ditto.
* tests/openpgp/encrypt.test: Ditto.
* tests/openpgp/sigs.test: Ditto.
--
The new output style is now:

      > MD5 SHA1 RIPEMD160 SHA256 SHA384 SHA512 SHA224 <
  PASS: sigs.test

or if the test fails:

      > MD5 SHA1
  sigs.test: ooops
  FAIL: sigs.test

(cherry picked from commit f1e1387bee286c7434f0462185048872bcdb4484)

6 years agoscd: move SCDaemon to libexecdir.
NIIBE Yutaka [Mon, 1 Apr 2013 02:42:11 +0000 (11:42 +0900)]
scd: move SCDaemon to libexecdir.

* common/homedir.c (gnupg_module_name): It's now libexecdir.
* scd/Makefile.am (libexec_PROGRAMS): Add scdaemon
(bin_PROGRAMS): Remove scdaemon.

6 years agoscd: PC/SC status fix.
NIIBE Yutaka [Tue, 26 Mar 2013 03:43:24 +0000 (12:43 +0900)]
scd: PC/SC status fix.

* scd/apdu.c (pcsc_get_status_direct): Check PCSC_STATE_MUTE only when
PCSC_STATE_PRESENT.

* scd/pcsc-wrapper.c (handle_status): Ditto.

6 years agoscd: PC/SC cleanup (more).
NIIBE Yutaka [Tue, 26 Mar 2013 00:03:55 +0000 (09:03 +0900)]
scd: PC/SC cleanup (more).

* scd/apdu.c (control_pcsc_direct, control_pcsc_wrapped, control_pcsc)
(check_pcsc_pinpad, pcsc_pinpad_verify, pcsc_pinpad_modify): Use
pcsc_dword_t.

6 years agoscd: call update_card_removed only when detecting removal.
NIIBE Yutaka [Mon, 25 Mar 2013 23:43:15 +0000 (08:43 +0900)]
scd: call update_card_removed only when detecting removal.

* scd/command.c (update_reader_status_file): Add condition
ss->status == 0.

--

To reproduce the bug: (1) insert card,
  (2) run "gpg2 --card-status",
  (3) remove card, (4) invoke "gpg2 --card-edit",
  (5) invoke some command like "verify"
The last step fails (but with no error message to user).

6 years agoscd: PC/SC cleanup.
NIIBE Yutaka [Fri, 22 Mar 2013 01:41:59 +0000 (10:41 +0900)]
scd: PC/SC cleanup.

* scd/apdu.c (pcsc_dword_t): New.  It was named as DWORD (double-word)
when a word was 16-bit.
(struct reader_table_s): Fixes for types.
(struct pcsc_readerstate_s) [__APPLE__]: Enable #pragma pack(1).
Throughout: Fixes for types.

* scd/pcsc-wrapper.c: Likewise.

--

Problem reported for 1.4.x by the issue 1358.

6 years agoscd: change default value of pinpad maxlen.
NIIBE Yutaka [Thu, 21 Mar 2013 00:04:13 +0000 (09:04 +0900)]
scd: change default value of pinpad maxlen.

* scd/apdu.c (pcsc_pinpad_verify, pcsc_pinpad_modify): Default value
of maxlen for pinpad input is now 15 (was: 25).

* scd/ccid-driver.c (ccid_transceive_secure): Likewise.

--

For newer PC/SC, it is better to use FEATURE_GET_TLV_PROPERTIES to get
bMaxPINSize.

6 years agoscd: ccid-driver supporting larger APDU.
NIIBE Yutaka [Thu, 14 Mar 2013 23:34:32 +0000 (08:34 +0900)]
scd: ccid-driver supporting larger APDU.

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

6 years agoDifferentiate between success (full or partial), not-found, and failure.
David Shaw [Sun, 3 Mar 2013 01:39:48 +0000 (20:39 -0500)]
Differentiate between success (full or partial), not-found, and failure.

* keyserver/gpgkeys_hkp.c (get_key): Use curl_easy_setinfo to get the
  HTTP status code so we can tell the difference between a successful
  retrieval, a partial retrieval, a not-found, or a server failed.

6 years agoEmulate curl_easy_getinfo and CURLINFO_RESPONSE_CODE in curl-shim.
David Shaw [Sun, 3 Mar 2013 01:07:27 +0000 (20:07 -0500)]
Emulate curl_easy_getinfo and CURLINFO_RESPONSE_CODE in curl-shim.

* keyserver/curl-shim.h, keyserver/curl-shim.c (curl_easy_getinfo):
  New. Return the HTTP status code for the last transfer.

6 years agoBring the fix for bug 739 on 1.4 over to 2.0 (bug 1479)
David Shaw [Thu, 28 Feb 2013 18:48:58 +0000 (13:48 -0500)]
Bring the fix for bug 739 on 1.4 over to 2.0 (bug 1479)

* http.h, http.c (http_wait_response, main): Remove
  HTTP_FLAG_NO_SHUTDOWN.

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

* doc/help.ja.txt: Update.

6 years agoJapanese: updated po and doc.
NIIBE Yutaka [Tue, 12 Feb 2013 03:56:12 +0000 (12:56 +0900)]
Japanese: updated 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
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.

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: Clean up.
NIIBE Yutaka [Tue, 5 Feb 2013 05:37:14 +0000 (14:37 +0900)]
scd: Clean up.

* apdu.h (apdu_send_simple_kp): Remove.
* apdu.c (apdu_send_simple_kp): Remove.

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.
(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).

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
keypad.
(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):
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.

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

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

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

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
SetParameters.
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 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 agoagent: kill pinentry by SIGINT, fixing a bug to be killed by SIGINT.
NIIBE Yutaka [Mon, 4 Feb 2013 00:07:22 +0000 (09:07 +0900)]
agent: kill pinentry by SIGINT, fixing a bug to be killed by SIGINT.

* agent/call-pinentry.c (atfork_cb): Reset signal mask and signal
handler for child process.
(agent_popup_message_stop): Send SIGINT (was: SIGKILL).
--
pinentry-curses should be killed by SIGINT, so that it can reset
terminal settings, but it didn't work.

6 years agogpg: Fix honoring --cert-digest-algo when recreating a cert
Christian Aistleitner [Sun, 14 Oct 2012 18:31:41 +0000 (20:31 +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 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 agogpg: Detect Keybox files and print a diagnostic.
Werner Koch [Thu, 3 Jan 2013 19:19:23 +0000 (20:19 +0100)]
gpg: Detect Keybox files and print a diagnostic.

* g10/keydb.c (KEYDB_RESOURCE_TYPE_KEYBOX): New.
(keydb_add_resource): Handle scheme "gnupg-kbx:".  Detect Keybox
magic.  Print wanrning note for Keybox.
(keydb_new, keydb_release, keydb_get_resource_name)
(lock_all, unlock_all, keydb_get_keyblock)
(keydb_update_keyblock, keydb_insert_keyblock, keydb_delete_keyblock)
(keydb_locate_writable, keydb_rebuild_caches, keydb_search_reset)
(keydb_search2): Ignore Keybox type in switches.
* g10/gpg.h (G10ERR_UNSUPPORTED): Map to correct gpg-error value.
--

GnuPG 2.1 will support Keybox files in GPG and thus users might see
weird error messages if they accidentally use a keybox file with 2.0.
Better print a note here.

6 years agoRemove trailing white space from some files.
Werner Koch [Thu, 3 Jan 2013 19:11:54 +0000 (20:11 +0100)]
Remove trailing white space from some files.

--

6 years agoUpdate Japanese Translation
NIIBE Yutaka [Sat, 29 Dec 2012 15:24:20 +0000 (00:24 +0900)]
Update Japanese Translation

* po/ja.po: Fix terms and expressions.

6 years agoUpdate Japanese Translation
NIIBE Yutaka [Sat, 29 Dec 2012 11:52:38 +0000 (20:52 +0900)]
Update Japanese Translation

* po/ja.po: Translate all untranslated messages.

6 years agoUpdate Japanese Translation
NIIBE Yutaka [Thu, 27 Dec 2012 07:06:52 +0000 (16:06 +0900)]
Update Japanese Translation

* po/ja.po: Fix all fuzzy translations.  Fill some of unstanslated
messages.

6 years agoUpdate Japanese Translation
NIIBE Yutaka [Thu, 27 Dec 2012 07:02:28 +0000 (16:02 +0900)]
Update Japanese Translation

* po/ja.po: Remove old entries.

6 years agoUpdate Japanese Translation
NIIBE Yutaka [Thu, 27 Dec 2012 06:57:44 +0000 (15:57 +0900)]
Update Japanese Translation

* po/ja.po: Fix headers.  Update by msgmerge -U ja.po gnupg2.pot.

6 years agoUpdate Japanese tranlation
NIIBE Yutaka [Thu, 27 Dec 2012 06:45:53 +0000 (15:45 +0900)]
Update Japanese tranlation

* po/ja.po: Change the encoding to UTF-8 (was: EUC-JP).

6 years agoMake sure srvcount is initialized.
David Shaw [Thu, 20 Dec 2012 23:12:29 +0000 (18:12 -0500)]
Make sure srvcount is initialized.

* keyserver/gpgkeys_hkp.c (srv_replace): Initialize srvcount.

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 3a4b96e665fa639772854058737ee3d54ba0694e)

6 years agoFixed indentation and indented cpp directives
Werner Koch [Wed, 19 Dec 2012 14:30:17 +0000 (15:30 +0100)]
Fixed indentation and indented cpp directives

--

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

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

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 (build_pk_list): Print two diagnostics only in
non-quiet mode.
--

(back-ported from commit 8325d616593187ff227853de0295e3269b96edcb)

6 years agoRemove trailing white space from a file
Werner Koch [Wed, 19 Dec 2012 10:21:26 +0000 (11:21 +0100)]
Remove trailing white space from a file

--

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 agojnlib: Add meta option ignore-invalid-option.
Werner Koch [Tue, 18 Dec 2012 17:06:41 +0000 (18:06 +0100)]
jnlib: Add meta option ignore-invalid-option.

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

(cherry-picked from commit 41d564333d35c923f473aa90625d91f8fe18cd0b)

6 years agoNo point in defaulting try-dns-srv to on if we don't have SRV support.
David Shaw [Tue, 18 Dec 2012 05:08:51 +0000 (00:08 -0500)]
No point in defaulting try-dns-srv to on if we don't have SRV support.

* keyserver/gpgkeys_hkp.c (main): Only default try-dns-srv to on if we
  have SRV support in the first place.

6 years agoIssue 1447: Pass proper Host header and SNI when SRV is used with curl.
David Shaw [Tue, 18 Dec 2012 04:52:15 +0000 (23:52 -0500)]
Issue 1447: Pass proper Host header and SNI when SRV is used with curl.

* configure.ac: Check for inet_ntop.

* m4/libcurl.m4: Provide a #define for the version of the curl
  library.

* keyserver/gpgkeys_hkp.c (main, srv_replace): Call getaddrinfo() on
  each target.  Once we find one that resolves to an address (whether
  IPv4 or IPv6), pass it into libcurl via CURLOPT_RESOLVE using the
  SRV name as the "host".  Force the HTTP Host header to be the same.

6 years agoPart of issue 1447: Pass proper Host header when SRV is used.
David Shaw [Sat, 15 Dec 2012 15:35:19 +0000 (10:35 -0500)]
Part of issue 1447: Pass proper Host header when SRV is used.

* common/http.c (send_request, connect_server): Set proper Host header
  (no :port, host is that of the SRV) when SRV is used in the
  curl-shim.

6 years agoFix issue 1446: honor ports given in SRV responses.
David Shaw [Sat, 15 Dec 2012 15:11:11 +0000 (10:11 -0500)]
Fix issue 1446: honor ports given in SRV responses.

* common/http.c (send_request, connect_server, http_open): Use a
  struct srv instead of a single srvtag so we can pass the chosen host
  and port back to the caller.
  (connect_server): Use the proper port in the HAVE_GETADDRINFO case.

* keyserver/curl-shim.c (curl_easy_perform): Use struct srv and log
  chosen host and port.

* keyserver/gpgkeys_hkp.c (main): Properly take the port given by SRV.

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 agoRevert SCD changes of 2010-05-03 (scd/ChangeLog 2010-03-17).
NIIBE Yutaka [Fri, 7 Dec 2012 01:31:37 +0000 (10:31 +0900)]
Revert SCD changes of 2010-05-03 (scd/ChangeLog 2010-03-17).

* 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_reader_slot): Follow the change of R_NO_SERVICE.
(open_card, cmd_serialno, scd_command_handler): Remove reader_disabled
support.
* 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
get_reader_slot.

--
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 agoUpdate sample keys
David Shaw [Fri, 30 Nov 2012 18:14:09 +0000 (13:14 -0500)]
Update sample keys

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 16:35:16 +0000 (17:35 +0100)]
Fix printing of ECC algo names in hkp keyserver listings.

* g10/misc.c (map_pk_openpgp_to_gcry): New.
* g10/keyserver.c (print_keyrec): Map OpenPGP algorithm ids.
--

Although we don't have support for ECC, we want to print a proper
algorithm name in keyserver listings.  This will only work while using
a ECC enabled Libgcrypt.  Problem reported by Kristian Fiskerstrand.

6 years agoAllow decryption with card keys > 3072 bit
Werner Koch [Tue, 6 Nov 2012 13:39:22 +0000 (14:39 +0100)]
Allow decryption with card keys > 3072 bit

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

* 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 agoRemove trailing white space from some files
Werner Koch [Tue, 6 Nov 2012 13:34:32 +0000 (14:34 +0100)]
Remove trailing white space from some files

--

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

--
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 <wk@gnupg.org>
6 years agoSCD: Upon error, open_pcsc_reader_wrapped does same as _direct.
NIIBE Yutaka [Wed, 31 Oct 2012 02:02:58 +0000 (11:02 +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 French translation
Werner Koch [Fri, 24 Aug 2012 15:36:55 +0000 (17:36 +0200)]
Update French translation

* po/fr.po: Update.

6 years agoFix German translation and msgmerge other po files
Werner Koch [Fri, 24 Aug 2012 09:30:41 +0000 (11:30 +0200)]
Fix German translation and msgmerge other po files

--

6 years agoFix typos spotted during translations
David Prévot [Wed, 22 Aug 2012 16:53:57 +0000 (12:53 -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: s/should have not/should not have/

Consistency fix:

* g10/gpg.c, kbx/kbxutil.c, sm/gpgsm.c: uppercase after Syntax

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

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

* po/Makefile.in.in: Use --previous with msgmerge.

6 years agoscd: Add forgotten VENDOR_FSIJ to ccid-driver.
NIIBE Yutaka [Fri, 20 Jul 2012 07:34:07 +0000 (16:34 +0900)]
scd: Add forgotten VENDOR_FSIJ to ccid-driver.

* scd/ccid-driver.c (ccid_transceive_secure): Handle VENDOR_FSIJ.

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

6 years agoscd: Fix updating slot status.
NIIBE Yutaka [Fri, 22 Jun 2012 01:51:12 +0000 (10:51 +0900)]
scd: Fix updating slot status.
* scd/comman.c (do_reset): Let clear card_removed flag.

6 years agoscd: acquire lock in new_reader_slot.
NIIBE Yutaka [Mon, 18 Jun 2012 06:08:01 +0000 (15:08 +0900)]
scd: acquire lock in new_reader_slot.

* scd/apdu.c (new_reader_slot): Acquire lock.
  (open_ct_reader, open_pcsc_reader_direct, open_pcsc_reader_wrapped)
  (open_ccid_reader, open_rapdu_reader): Release lock.

--
Fixes a test case of:
   No libpcsclite1 installed.
   Run gpg-agent
   Run command "gpg-connect-agent learn /bye" with no card/token
   Sometimes it fails: ERR 100663356 Not supported <SCD>
   While it should be always: ERR 100663404 Card error <SCD>

6 years agoscd: move lock_slot, trylock_slot, unlock_slot functions.
NIIBE Yutaka [Mon, 18 Jun 2012 05:52:53 +0000 (14:52 +0900)]
scd: move lock_slot, trylock_slot, unlock_slot functions.

* scd/apdu.c (lock_slot, trylock_slot, unlock_slot): Move.

--
This is for upcoming changes.