gnupg.git
7 years agoChange license for some files in common to LGPLv3+/GPLv2+.
Werner Koch [Fri, 20 Apr 2012 13:43:06 +0000 (15:43 +0200)]
Change license for some files in common to LGPLv3+/GPLv2+.

Having the LGPL on the common GnuPG code helps to share code
between GnuPG and related projects (like GPGME and Libassuan).  This
is good for interoperability and to reduces bugs.

* common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c
* common/b64enc.c, common/convert.c, common/dns-cert.c
* common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c
* common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c
* common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c
* common/helpfile.c, common/homedir.c, common/http.c, common/http.h
* common/i18n.c, common/init.c, common/init.h, common/iobuf.c
* common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h
* common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h
* common/percent.c, common/pka.c, common/pka.h, common/session-env.c
* common/session-env.h, common/sexp-parse.h, common/sexputil.c
* common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c
* common/ssh-utils.h, common/sysutils.c, common/sysutils.h
* common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h
* common/userids.c, common/userids.h, common/xasprintf.c: Change
license to LGPLv3+/GPLv2+/

7 years agofaq: Replace --list-ownerturst by --export-ownertrust.
Werner Koch [Tue, 17 Apr 2012 07:55:44 +0000 (09:55 +0200)]
faq: Replace --list-ownerturst by --export-ownertrust.

--

7 years agoFix killing PID -1.
Ben Kibbey [Tue, 10 Apr 2012 00:52:22 +0000 (20:52 -0400)]
Fix killing PID -1.

When the KILLSCD command had been sent a race condition would occur
causing PID -1 getting killed, which on Linux seems to terminate all
applications for the current user.

7 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

7 years agoMention status messages in the documentation.
Ben Kibbey [Wed, 4 Apr 2012 00:53:23 +0000 (20:53 -0400)]
Mention status messages in the documentation.

Note INQUIRE_MAXLEN.

7 years agoDocument PASSWD --preset.
Ben Kibbey [Wed, 4 Apr 2012 00:53:22 +0000 (20:53 -0400)]
Document PASSWD --preset.

7 years agoDocument GENKEY options.
Ben Kibbey [Wed, 4 Apr 2012 00:53:21 +0000 (20:53 -0400)]
Document GENKEY options.

7 years agoDocument PRESET_PASSPHRASE.
Ben Kibbey [Wed, 4 Apr 2012 00:53:20 +0000 (20:53 -0400)]
Document PRESET_PASSPHRASE.

7 years agoDocument CLEAR_PASSPHRASE.
Ben Kibbey [Wed, 4 Apr 2012 00:53:19 +0000 (20:53 -0400)]
Document CLEAR_PASSPHRASE.

And describe the --mode=normal option.

7 years agoFix timegm regression test.
Werner Koch [Tue, 27 Mar 2012 17:46:20 +0000 (19:46 +0200)]
Fix timegm regression test.

* common/t-timestuff.c (test_timegm): Change test to use January and
not February or December+1.  Bug spotted by Daniel Kahn Gillmor.

7 years agoPrint warning for arguments not considered an option.
Werner Koch [Tue, 27 Mar 2012 10:35:13 +0000 (12:35 +0200)]
Print warning for arguments not considered an option.

GnuPG requires that options are given before other arguments.  This
can sometimes be confusing.  We now print a warning if we found an
argument looking alike a long option without being preceded by the
stop option.  This is bug#1343.

* common/argparse.h (ARGPARSE_FLAG_STOP_SEEN): New.
* common/argparse.c (arg_parse): Set new flag.
* g10/gpg.c (main): Print the warning.
* agent/gpg-agent.c (main): Ditto.
* dirmngr/dirmngr.c (main): Ditto.
* g13/g13.c (main): Ditto.
* scd/scdaemon.c (main): Ditto.
* sm/gpgsm.c (main): Ditto.
* tools/gpg-connect-agent.c (main): Ditto.
* tools/gpgconf.c (main): Ditto.

7 years agoUpdate the maintenance instructions.
Werner Koch [Tue, 27 Mar 2012 09:21:33 +0000 (11:21 +0200)]
Update the maintenance instructions.

--

7 years agoAllow compress algorithm 0.
Werner Koch [Mon, 26 Mar 2012 13:52:15 +0000 (15:52 +0200)]
Allow compress algorithm 0.

* g10/mainproc.c (proc_compressed): Remove superfluous check for
compress algorithm 0.  Reported by pfandrade.  This is bug#1326.

7 years agoTypo fixes in de.po.
Werner Koch [Mon, 26 Mar 2012 13:50:13 +0000 (15:50 +0200)]
Typo fixes in de.po.

--
This is bug#1276 and http://bugs.debian.org/594343

7 years agoAdd mksamplekeys script.
Werner Koch [Mon, 26 Mar 2012 13:48:47 +0000 (15:48 +0200)]
Add mksamplekeys script.

* doc/mksamplekeys: New.
--
Note that we have the same script in the 1.4 branch.  That should be
removed and only this one shall be used.

7 years agoReplace npth_yield in busy wait by npth_usleep.
Marcus Brinkmann [Tue, 28 Feb 2012 16:26:32 +0000 (17:26 +0100)]
Replace npth_yield in busy wait by npth_usleep.

* dirmngr/ldap-wrapper.c (ldap_wrapper_wait_connections): Call
npth_usleep instead of npth_yield.

7 years agoCheck for lber and link dirmngr_ldap to it.
Marcus Brinkmann [Thu, 16 Feb 2012 16:51:20 +0000 (17:51 +0100)]
Check for lber and link dirmngr_ldap to it.

* configure.ac (LBER_LIBS, HAVE_LBER): New variables, check for lber.
* dirmngr/Makefile.am (dirmngr_lda_LDADD): Add $(LBER_LIBS).

7 years agoagent: Add pin length field to the shadowed private key format.
Werner Koch [Tue, 7 Feb 2012 13:17:33 +0000 (14:17 +0100)]
agent: Add pin length field to the shadowed private key format.

This is not yet fully implemented.  It will eventually allow to
support pinpad equipped readers which do not support variable length
pin lengths.
* agent/protect.c (parse_shadow_info): Add optional arg R_PINLEN and
parse pinlen info.  Change all callers to pass NULL for it.

7 years agoUse new status printing functions.
Werner Koch [Tue, 7 Feb 2012 12:51:47 +0000 (13:51 +0100)]
Use new status printing functions.

* agent/command.c (cmd_geteventcounter): Get rid of static buffers.
* scd/command.c (cmd_serialno, cmd_learn): Simplify by using
print_assuan_status.

7 years agoagent: New function agent_print_status.
Werner Koch [Tue, 7 Feb 2012 11:46:32 +0000 (12:46 +0100)]
agent: New function agent_print_status.

* common/asshelp2.c (vprint_assuan_status): New.
(print_assuan_status): Re-implement using above func.
* agent/command.c (agent_print_status): New.

7 years agoAdd an item to NEWS.
Werner Koch [Tue, 7 Feb 2012 09:20:12 +0000 (10:20 +0100)]
Add an item to NEWS.

--

7 years agopo: Add Ukrainian translation.
Werner Koch [Tue, 7 Feb 2012 09:19:16 +0000 (10:19 +0100)]
po: Add Ukrainian translation.

* po/uk.po: New.
--

Note that all but one translation are currently disabled in LINGUAS.

7 years agocommon: Replace macro based function calls by using DEFAULT_ERRSOURCE.
Werner Koch [Tue, 7 Feb 2012 09:15:57 +0000 (10:15 +0100)]
common: Replace macro based function calls by using DEFAULT_ERRSOURCE.

* common/dns-cert.h (get_dns_cert): Remove macro.
* common/dns-cert.c (_get_dns_cert): Rename to get_dns_cert.  Replace
arg ERRSOURCE by global DEFAULT_ERRSOURCE.
* common/http.h (http_parse_uri, http_raw_connect, http_open)
(http_open_document, http_wait_response): Remove macros.
* common/http.c (_http_parse_uri, _http_raw_connect, _http_open)
(_http_open_document, _http_wait_response): Remove underscore from
symbols.  Replace args ERRSOURCE by global DEFAULT_ERRSOURCE.
* common/ssh-utils.h (ssh_get_fingerprint)
(ssh_get_fingerprint_string): Remove macros.
* common/ssh-utils.h (_ssh_get_fingerprint)
(_ssh_get_fingerprint_string): Remove underscore from symbols.
Replace args ERRSOURCE by global DEFAULT_ERRSOURCE.
* common/tlv.h (parse_ber_header, parse_sexp): Remove macros.
* common/tlv.c: Include util.h.
(_parse_ber_header, _parse_sexp): Remove underscore from symbols.
Replace args ERRSOURCE by global DEFAULT_ERRSOURCE.

7 years agoAdd replacement hack for Android's broken ttyname.
Werner Koch [Mon, 6 Feb 2012 20:06:16 +0000 (21:06 +0100)]
Add replacement hack for Android's broken ttyname.

* configure.ac (HAVE_TTYNAME) [__ANDROID__]: Add hack.

7 years agoagent: Simplify printing of INQUIRE_MAXLEN.
Werner Koch [Mon, 6 Feb 2012 20:04:22 +0000 (21:04 +0100)]
agent: Simplify printing of INQUIRE_MAXLEN.

* agent/command.c: Include asshelp.h.
(cmd_pkdecrypt, cmd_genkey, cmd_preset_passphrase)
(pinentry_loopback): Use print_assuan_status for INQUIRE_MAXLEN.

7 years agocommon: Add function print_assuan_status.
Werner Koch [Mon, 6 Feb 2012 19:52:27 +0000 (20:52 +0100)]
common: Add function print_assuan_status.

* common/asshelp2.c: New.
(print_assuan_status): New function.
* common/Makefile.am (common_sources): Add asshelp2.c.

7 years agocommon: Add a global variable to for the default error source.
Werner Koch [Mon, 6 Feb 2012 19:50:47 +0000 (20:50 +0100)]
common: Add a global variable to for the default error source.

For the shared code parts it is cumbersome to pass an error sourse
variable to each function.  Its value is always a constant for a given
binary and thus a global variable makes things a lot easier than the
former macro stuff.
* common/init.c (default_errsource): New global var.
(init_common_subsystems): Rename to _init_common_subsystems.  Set
DEFAULT_ERRSOURCE.
* common/init.h: Assert value of GPG_ERR_SOURCE_DEFAULT.
(init_common_subsystems): New macro.
* common/util.h (default_errsource): Add declaration.
* kbx/keybox-defs.h: Add some GPG_ERR_SOURCE_DEFAULT trickery.

7 years agoAlso let GENKEY and PKDECRYPT send the INQUIRE_MAXLEN status message.
Ben Kibbey [Fri, 3 Feb 2012 22:50:22 +0000 (17:50 -0500)]
Also let GENKEY and PKDECRYPT send the INQUIRE_MAXLEN status message.

* agent/command.c (cmd_pkdecrypt): Send the INQUIRE_MAXLEN status
message before doing the inquire.
(cmd_genkey): Ditto.

7 years agoInform the client of the preset passphrase length.
Ben Kibbey [Thu, 2 Feb 2012 02:38:13 +0000 (21:38 -0500)]
Inform the client of the preset passphrase length.

* agent/command.c (cmd_preset_passphrase): Send the INQUIRE_MAXLEN
status message before inquiring the passphrase.

7 years agoHonor --cert-digest-algo when recreating a cert.
David Shaw [Wed, 1 Feb 2012 02:30:05 +0000 (21:30 -0500)]
Honor --cert-digest-algo when recreating a cert.

* g10/sign.c (update_keysig_packet): Honor --cert-digest-algo when
  recreating a cert.

This is used by various things in --edit-key like setpref, primary,
etc.  Suggested by Christian Aistleitner.

7 years agogl: Add support for Android to stdint.h replacement.
Werner Koch [Fri, 27 Jan 2012 16:29:57 +0000 (17:29 +0100)]
gl: Add support for Android to stdint.h replacement.

* gl/stdint_.h: When included from Bionic <sys/types.h>, just include
the system's <stdint.h>.

7 years agogpg-connect-tool: Take the string "true" as a true condition.
Werner Koch [Fri, 27 Jan 2012 14:40:24 +0000 (15:40 +0100)]
gpg-connect-tool: Take the string "true" as a true condition.

* tools/gpg-connect-agent.c (main): Handle strings "true" and "yes" in
conditions as expected.

7 years agoReturn GPG_ERR_CARD_NOT_PRESENT when pinentry-mode=loopback.
Ben Kibbey [Thu, 26 Jan 2012 00:16:33 +0000 (19:16 -0500)]
Return GPG_ERR_CARD_NOT_PRESENT when pinentry-mode=loopback.

Since there isn't a way to prompt the user to insert the smartcard when
pinentry-mode=loopback, return GPG_ERR_CARD_NOT_PRESENT instead of
GPG_ERR_NO_PIN_ENTRY.

* agent/divert-scd.c (ask_for_card): Return GPG_ERR_CARD_NOT_PRESENT
when pinentry-mode=loopback.

7 years agoAlso check for GPG_ERR_ASS_CANCELED during an inquire.
Ben Kibbey [Wed, 25 Jan 2012 23:14:51 +0000 (18:14 -0500)]
Also check for GPG_ERR_ASS_CANCELED during an inquire.

Fix pinentry-mode=loopback when cancelling an inquire from scdaemon.
This is similar to commit 4f21f8d but for both protocol command
cancellation and pinentry cancellation.

* agent/call-scd.c (agent_card_pkdecrypt): Check for
GPG_ERR_ASS_CANCELED.
(agent_card_pksign): Ditto.

7 years agonPth is now a hard requirement for GnuPG.
Werner Koch [Wed, 25 Jan 2012 14:48:01 +0000 (15:48 +0100)]
nPth is now a hard requirement for GnuPG.

* configure.ac: Remove cruft to allow building without npth.
--

Previous versions of GnuPG allowed to build a subset of it without
support of Pth.  Meanwhile gpg-agent is a requirement even for gpg and
thus it does not make any sense to allow such a restricted build.

7 years agoRequire libassuan 2.1.0.
Werner Koch [Wed, 25 Jan 2012 14:01:19 +0000 (15:01 +0100)]
Require libassuan 2.1.0.

* configure.ac (NEED_LIBASSUAN_VERSION): Set to 2.1.0.  This is due to
the npth changes.
--
Note that libassuan 2.1.0 has not yet been released.

7 years agoFix strerror vs. gpg_strerror usage.
Werner Koch [Wed, 25 Jan 2012 13:59:01 +0000 (14:59 +0100)]
Fix strerror vs. gpg_strerror usage.

This bug was introduced by the migration to npth.
* agent/gpg-agent.c (handle_connections): Use strerror.

7 years agoRe-indent overlong lines.
Werner Koch [Wed, 25 Jan 2012 13:44:34 +0000 (14:44 +0100)]
Re-indent overlong lines.

--

7 years agoAdd missing variable.
Werner Koch [Wed, 25 Jan 2012 11:11:41 +0000 (12:11 +0100)]
Add missing variable.

* agent/gpg-agent.c (handle_connections) [!W32]: Add missing variable.

7 years agoPort LDAP wrapper to NPTH.
Marcus Brinkmann [Tue, 24 Jan 2012 16:37:01 +0000 (17:37 +0100)]
Port LDAP wrapper to NPTH.

* agent/gpg-agent.c (handle_connections): Handle error.
* dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c: Port to NPTH.

7 years agoPort Windows code to NPTH.
Marcus Brinkmann [Thu, 19 Jan 2012 21:27:44 +0000 (22:27 +0100)]
Port Windows code to NPTH.

* agent/gpg-agent.c (get_agent_ssh_socket_name): Use
INVALID_HANDLE_VALUE instead of 0.
(handle_signal) [!HAVE_W32_SYSTEM]: Don't define.
(handle_connections): Port Windows code to NPTH.
* dirmngr/dirmngr.c (handle_connections): Port Windows code to NPTH.
* g13/g13.c (handle_connections): Port Windows code to NPTH.
* scd/scdaemon.c (handle_connections): Port Windows code to NPTH.

7 years agoPort to npth.
Marcus Brinkmann [Tue, 3 Jan 2012 21:12:37 +0000 (22:12 +0100)]
Port to npth.

* configure.ac: Don't check for PTH but for NPTH.
(AH_BOTTOM): Remove PTH_SYSCALL_SOFT.
(have_pth): Rename to ...
(have_npth): ... this.
(USE_GNU_NPTH): Rename to ...
(USE_GNU_PTH): ... this.
* m4/npth.m4: New file.
* agent/Makefile.am, agent/cache.c, agent/call-pinentry.c,
agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c,
agent/trustlist.c, common/Makefile.am, common/estream.c,
common/exechelp-posix.c, common/exechelp-w32.c,
common/exechelp-w32ce.c, common/http.c, common/init.c,
common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c,
dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c,
dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am,
g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am,
scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c,
scd/scdaemon.c, tools/Makefile.am: Port to npth.

7 years agoRequire gitlog-to-changelog to be installed.
Werner Koch [Wed, 25 Jan 2012 11:11:41 +0000 (12:11 +0100)]
Require gitlog-to-changelog to be installed.

* Makefile.am (GITLOG_TO_CHANGELOG): New.
(gen-ChangeLog): Use installed version of gitlog-to-changelog.
--

In case an appropriate version of gitlog-to-changelog is not in the
PATH, it is possible to override it using something like:

  make distcheck GITLOG_TO_CHANGELOG=/foo/bar/my-gitlog-to-changelog

7 years agoExtend gitlog-to-changelog option --tear-off.
Werner Koch [Wed, 25 Jan 2012 10:58:54 +0000 (11:58 +0100)]
Extend gitlog-to-changelog option --tear-off.

--
It is now possible to suppress git log entries from being copied to
the ChangeLog by using the option --tear-off and having a "--" line
as the first line in the body (like this very log entry).

Note that the GnuPG master branch is the canonical source for our
version of the gitlog-to-changelog script.

7 years agoChanges to --min-cert-level should cause a trustdb rebuild (issue 1366)
David Shaw [Fri, 20 Jan 2012 03:33:51 +0000 (22:33 -0500)]
Changes to --min-cert-level should cause a trustdb rebuild (issue 1366)

* g10/gpgv.c, g10/trustdb.c (read_trust_options): Add min_cert_level

* g10/trustdb.c (check_trustdb_stale): Request a rebuild if
  pending_check_trustdb is true (set when we detect a trustdb
  parameter has changed).

* g10/keylist.c (public_key_list): Use 'l' in the "tru" with-colons
  listing for min_cert_level not matching.

* g10/tdbio.c (tdbio_update_version_record, create_version_record,
  tdbio_db_matches_options, tdbio_dump_record, tdbio_read_record,
  tdbio_write_record): Add a byte for min_cert_level in the tdbio
  version record.

7 years agoestream: Fix unclean usage of realloc.
Werner Koch [Fri, 20 Jan 2012 13:27:36 +0000 (14:27 +0100)]
estream: Fix unclean usage of realloc.

* common/estream-printf.c (_ESTREAM_PRINTF_MALLOC): Remove.
(_ESTREAM_PRINTF_FREE): Remove.
(_ESTREAM_PRINTF_REALLOC): New.
(fixed_realloc) [!_ESTREAM_PRINTF_REALLOC]): New.
(estream_vasprintf): Use my_printf_realloc instead of my_printf_malloc
and my_printf_free.
(dynamic_buffer_out): Use my_printf_realloc instead of realloc.
--

This bug will never happen in current GnuPG/Libgcrypt because we use
the standard memory allocation functions via Libgcrypt.  However, when
used in other environments it would mess up the heap for an asprintf
with an output length larger than ~512 bytes.

7 years agoDo not copy default merge commit log entries into the ChangeLog.
Werner Koch [Fri, 20 Jan 2012 10:08:06 +0000 (11:08 +0100)]
Do not copy default merge commit log entries into the ChangeLog.

* scripts/gitlog-to-changelog: Skip merge commits.

7 years agoAdd the INQUIRE_MAXLEN status message.
Ben Kibbey [Wed, 18 Jan 2012 00:49:10 +0000 (19:49 -0500)]
Add the INQUIRE_MAXLEN status message.

This status message is used to inform the client of the maximum length
of an inquired passphrase and is used in pinentry-mode=loopback.

* agent/command.c (pinentry_loopback): Send the INQUIRE_MAXLEN status
message before doing the inquire.

7 years agoyat2m: don't dereference pointer to freed memory
Jim Meyering [Sat, 14 Jan 2012 21:34:58 +0000 (22:34 +0100)]
yat2m: don't dereference pointer to freed memory

* doc/yat2m.c (top_parse_file): Correct macrolist-freeing loop.

7 years agogpg-agent: fix lc-messages handling not to change Xauthority setting
Jim Meyering [Sat, 14 Jan 2012 21:20:39 +0000 (22:20 +0100)]
gpg-agent: fix lc-messages handling not to change Xauthority setting

* agent/gpg-agent.c (main): Supply omitted "break" statement for
lc-messages option.  Otherwise, control would fall through to the
following oXauthority case and use the same value there.

7 years agoFix indentation.
Werner Koch [Sun, 15 Jan 2012 11:37:33 +0000 (12:37 +0100)]
Fix indentation.

7 years agoFix scdaemon pinentry inquire cancelation.
Ben Kibbey [Sat, 14 Jan 2012 14:57:31 +0000 (09:57 -0500)]
Fix scdaemon pinentry inquire cancelation.

Similar to commit 29af488 but also fixes PKDECRYPT and PKSIGN.

* agent/call-scd.c (agent_card_pkdecrypt): Check for GPG_ERR_CANCELED
when returning from the PKDECRYPT operation of scdaemon and cancel the
inquire.
(agent_card_pksign): Ditto.
(cancel_inquire): New.

7 years agogpg: Fix segv with RSA_S keys.
Werner Koch [Wed, 11 Jan 2012 19:15:47 +0000 (20:15 +0100)]
gpg: Fix segv with RSA_S keys.

* g10/misc.c (pubkey_get_npkey, pubkey_get_nskey)
(pubkey_get_nsig, pubkey_get_nenc): Map all RSA algo ids to
GCRY_PK_RSA.
--

The problem is that Libgcrypt has no more support for the alternate
RSA ids and thus if asking for the number of parameters, they will
return zero.  Now, this leads to packing the key parameters into an
opaque MPI but because the algorithm id is actually known to GPG, it
assumes valid RSA parameters.

An example key with RSA_S is 0x5434509D.

7 years agoestream: Avoid printing leading zeroes by %p on 32 bit systems.
Werner Koch [Wed, 11 Jan 2012 16:06:17 +0000 (17:06 +0100)]
estream: Avoid printing leading zeroes by %p on 32 bit systems.

* common/estream-printf.c (pr_pointer): Synchronize definition of
AULONG with its use.

7 years agoRefresh sample keys
David Shaw [Tue, 10 Jan 2012 15:32:03 +0000 (10:32 -0500)]
Refresh sample keys

7 years agoAdapt HKP fix for fingerprint/long keyid retrievals for dirmngr
David Shaw [Tue, 10 Jan 2012 15:23:54 +0000 (10:23 -0500)]
Adapt HKP fix for fingerprint/long keyid retrievals for dirmngr

* dirmngr/ks-engine-hkp.c (ks_hkp_get): Use the longest valid keyid form

7 years agogpg: Make the double space in the middle of a fingerprint optional.
Werner Koch [Fri, 6 Jan 2012 14:17:49 +0000 (15:17 +0100)]
gpg: Make the double space in the middle of a fingerprint optional.

This change might help to c+p a fingerprint from an HTML page without
being enclosed in a "pre" tag.
* common/userids.c (classify_user_id): Skip a second blank in the
middle of a fingerprint.

7 years agogpg: Allow use of a standard space separated fingerprint.
Werner Koch [Fri, 6 Jan 2012 12:33:10 +0000 (13:33 +0100)]
gpg: Allow use of a standard space separated fingerprint.

* common/userids.c (classify_user_id): Check for space separated GPG
fingerprint.

7 years agoMerge ccid_driver_improvement branch.
NIIBE Yutaka [Fri, 6 Jan 2012 04:50:21 +0000 (13:50 +0900)]
Merge ccid_driver_improvement branch.

* scd/apdu.c (ccid_keypad_operation): Rename from ccid_keypad_verify.
(open_ccid_reader): Use ccid_keypad_operation for verify and modify.

* scd/ccid-driver.c (VENDOR_VASCO, VASCO_920): New.
(ccid_transceive_apdu_level): Permit sending packet where
apdulen <= 289.  Support receiving packets in a chain.
(ccid_transceive_secure): Maximum is 15 for VASCO DIGIPASS 920.
Support keypad_modify method such as CHANGE_REFERENCE_DATA: 0x24.

7 years agoSilence gcc warning.
Marcus Brinkmann [Tue, 3 Jan 2012 16:38:24 +0000 (17:38 +0100)]
Silence gcc warning.

* sm/call-dirmngr.c (get_cached_cert): Make sure buflen is initialized.

7 years agoRevert last change, add comment about link() return values.
Marcus Brinkmann [Tue, 3 Jan 2012 16:32:41 +0000 (17:32 +0100)]
Revert last change, add comment about link() return values.

* common/dotlock.c (use_hardlinks_p, dotlock_take_unix): Do not check
return value of link().

7 years agoFix compiler warnings.
Marcus Brinkmann [Tue, 3 Jan 2012 16:08:01 +0000 (17:08 +0100)]
Fix compiler warnings.

* common/dotlock.c (use_hardlinks_p, dotlock_take_unix): Check return
value of link().
* g13/g13.c: Make sure err is initialized.
* scd/scdaemon.c (main) [!USE_GCRY_THREAD_CBS]: Do not define ERR.

7 years agoFix last change: Only set gcrypt thread callback for older versions.
Marcus Brinkmann [Tue, 3 Jan 2012 15:50:52 +0000 (16:50 +0100)]
Fix last change: Only set gcrypt thread callback for older versions.

* dirmngr/dirmngr.c, g13/g13.c: Rename FIX_GCRY_PTH_INIT to
USE_GCRY_THREAD_CBS.

7 years agoTerminate csh commands with a semicolon also for dirmngr.
Werner Koch [Tue, 3 Jan 2012 10:14:14 +0000 (11:14 +0100)]
Terminate csh commands with a semicolon also for dirmngr.

* dirmngr/dirmngr.c (main): Terminate csh style output with a semicolon.

7 years agoTerminate csh commands with a semicolon.
Werner Koch [Tue, 3 Jan 2012 10:13:30 +0000 (11:13 +0100)]
Terminate csh commands with a semicolon.

Fixes bug#1386.

* agent/gpg-agent.c (main): Terminate csh style output with a semicolon.
* scd/scdaemon.c: Ditto.

7 years agoOnly set gcrypt thread callback for older version of gcrypt.
Marcus Brinkmann [Mon, 2 Jan 2012 21:15:00 +0000 (22:15 +0100)]
Only set gcrypt thread callback for older version of gcrypt.

* agent/gpg-agent.c, dirmngr/dirmngr.c, g13/g13.c, scd/scdaemon.c
(USE_GCRY_THREAD_CBS): New macro, defined if
GCRY_THREAD_OPTION_VERSION is 0.
(fixed_gcry_pth_init) [!USE_GCRY_THREAD_CBS]: Don't define.
(main) [!USE_GCRY_THREAD_CBS]: Do not install thread callbacks.

7 years agoUse the longest key ID available when talking to a HKP server.
David Shaw [Wed, 28 Dec 2011 21:41:31 +0000 (16:41 -0500)]
Use the longest key ID available when talking to a HKP server.

This is issue 1340.  Now that PKSD is dead, and SKS supports long key
IDs, this is safe to do.  Patch from Daniel Kahn Gillmor
<dkg@fifthhorseman.net>.

7 years agoPost-release version number update
Werner Koch [Tue, 20 Dec 2011 16:10:28 +0000 (17:10 +0100)]
Post-release version number update

7 years agoRelease 2.1.0beta3. gnupg-2.1.0beta3
Werner Koch [Tue, 20 Dec 2011 15:46:18 +0000 (16:46 +0100)]
Release 2.1.0beta3.

7 years agoPrepare for the beta3 release.
Werner Koch [Tue, 20 Dec 2011 14:55:43 +0000 (15:55 +0100)]
Prepare for the beta3 release.

7 years agopo: Update the German translation.
Werner Koch [Tue, 20 Dec 2011 14:54:43 +0000 (15:54 +0100)]
po: Update the German translation.

7 years agoAdd the STEED Self-Signing Nonthority certificate.
Werner Koch [Tue, 20 Dec 2011 14:35:42 +0000 (15:35 +0100)]
Add the STEED Self-Signing Nonthority certificate.

* doc/com-certs.pem: Install it when creating a keybox.

7 years agofaq: Add section on US export restrictions.
Werner Koch [Tue, 20 Dec 2011 10:13:40 +0000 (11:13 +0100)]
faq: Add section on US export restrictions.

7 years agoRequire Libassuan 2.0.3
Werner Koch [Tue, 20 Dec 2011 10:12:21 +0000 (11:12 +0100)]
Require Libassuan 2.0.3

* configure.ac: Require Libassuan 2.0.3.
* agent/call-scd.c (ASSUAN_CONVEY_COMMENTS): Remove macro replacement.
* agent/command.c (cmd_killagent) [ASSUAN_FORCE_CLOSE]: Remove
dependency.
(cmd_killagent) [ASSUAN_FORCE_CLOSE]: Ditto.
* scd/command.c (cmd_killscd) [ASSUAN_FORCE_CLOSE]: Ditto.

7 years agoAdd error log and debug log for pcsc_keypad_verify and pcsc_keypad_modify.
NIIBE Yutaka [Tue, 20 Dec 2011 04:34:27 +0000 (13:34 +0900)]
Add error log and debug log for pcsc_keypad_verify and pcsc_keypad_modify.

* scd/apdu.c (pcsc_keypad_verify): Add debug log and error log.
(pcsc_keypad_modify): Likewise.

7 years agoscd: Fix for card change returning GPG_ERR_CARD_RESET.
Werner Koch [Mon, 19 Dec 2011 17:26:47 +0000 (18:26 +0100)]
scd: Fix for card change returning GPG_ERR_CARD_RESET.

* scd/apdu.c (apdu_connect): Do not test for zero atrlen.
--
When gpg-agent prompts for insertion of a card this error would be
returned.

Co-authored-by: Ben Kibbey <bjk@luxsci.net>
7 years agoDon't kill pinentry by SIGKILL but let it quit by SIGINT.
NIIBE Yutaka [Fri, 16 Dec 2011 00:07:56 +0000 (09:07 +0900)]
Don't kill pinentry by SIGKILL but let it quit by SIGINT.

* agent/call-pinentry.c (agent_popup_message_stop): To pinentry, send
SIGINT (was: SIGKILL).

7 years agoMerge fix for issue 1331 from 1.4.
David Shaw [Thu, 15 Dec 2011 21:46:28 +0000 (16:46 -0500)]
Merge fix for issue 1331 from 1.4.

* photoid.c (generate_photo_id): Check for the JPEG magic numbers
instead of JFIF since some programs generate an EXIF header first.

7 years agoscd: Prefer application Geldkarte over DINSIG.
Werner Koch [Thu, 15 Dec 2011 20:45:35 +0000 (21:45 +0100)]
scd: Prefer application Geldkarte over DINSIG.

* scd/app.c (select_application): Reorder application tests.
--

Although the DINSIG application is available on most German cards, it
is in reality not used.  Thus showing the Geldkarte application is
more desirable for a good user experience.

7 years agoscd: Add option --dump-atr to command APDU.
Werner Koch [Thu, 15 Dec 2011 13:47:04 +0000 (14:47 +0100)]
scd: Add option --dump-atr to command APDU.

* scd/atr.c: Rewrite.
* scd/Makefile.am (scdaemon_SOURCES): Add atr.c and atr.h.
* scd/command.c (cmd_apdu): Add option --dump-atr.

7 years agoestream: New function es_fclose_snatch.
Werner Koch [Thu, 15 Dec 2011 13:45:08 +0000 (14:45 +0100)]
estream: New function es_fclose_snatch.

* common/estream.c (cookie_ioctl_function_t): New type.
(es_fclose_snatch): New function.
(COOKIE_IOCTL_SNATCH_BUFFER): New constant.
(struct estream_internal): Add field FUNC_IOCTL.
(es_initialize): Clear FUNC_IOCTL.
(es_func_mem_ioctl): New function.
(es_fopenmem, es_fopenmem_init): Init FUNC_IOCTL.

7 years agoscd: Skip S/N reading for the "undefined" application.
Werner Koch [Wed, 14 Dec 2011 17:56:10 +0000 (18:56 +0100)]
scd: Skip S/N reading for the "undefined" application.

* scd/app.c (select_application): Skip serial number reading.

7 years agoscd: Add more status word values for documentation.
Werner Koch [Wed, 14 Dec 2011 17:48:47 +0000 (18:48 +0100)]
scd: Add more status word values for documentation.

7 years agoscd: Add the "undefined" stub application.
Werner Koch [Wed, 14 Dec 2011 16:00:50 +0000 (17:00 +0100)]
scd: Add the "undefined" stub application.

* scd/app.c (select_application): Implement the "undefined"
application.

7 years agoagent: Pass comment lines from scd verbatim thru gpg-agent.
Werner Koch [Wed, 14 Dec 2011 14:42:28 +0000 (15:42 +0100)]
agent: Pass comment lines from scd verbatim thru gpg-agent.

* agent/call-scd.c (pass_status_thru): Pass comment lines verbatim.
* tools/gpg-connect-agent.c (help_cmd_p): New.
(main): Treat an "SCD HELP" the same as "HELP".

7 years agoscd: Fix resetting and closing of the reader.
Werner Koch [Wed, 14 Dec 2011 09:30:01 +0000 (10:30 +0100)]
scd: Fix resetting and closing of the reader.

* scd/command.c (update_card_removed): Do no act on an invalid VRDR.
(do_reset): Ignore apdu_reset error codes for no and inactive card.
Close the reader before setting the slot to -1.
(update_reader_status_file): Notify the application before closing the
reader.
--

With this change the scd now works as it did in the past.  In
particular there is no more endless loop trying to open the reader by
the update_reader_status_file ticker function.  That bug basically
blocked all card operations until the scdaemon was killed.

7 years agoscd: Add debug option for reader function calls.
Werner Koch [Wed, 14 Dec 2011 09:21:15 +0000 (10:21 +0100)]
scd: Add debug option for reader function calls.

* scd/scdaemon.h (DBG_READER_VALUE, DBG_READER): New.
* scd/apdu.c (apdu_open_reader, apdu_close_reader)
(apdu_shutdown_reader, apdu_connect, apdu_disconnect)
(apdu_reset, apdu_get_atr, apdu_get_status): Add debug code.
(apdu_activate): Remove this unused function.

7 years agoscd: New option --debug-assuan-log-cats.
Werner Koch [Tue, 13 Dec 2011 16:59:00 +0000 (17:59 +0100)]
scd: New option --debug-assuan-log-cats.

* scd/scdaemon.c (oDebugAssuanLogCats): New.
(opts): Add option --debug-assuan-log-cats.
(main): Implement option.
* common/asshelp.c (set_libassuan_log_cats): New.

--

The old way of setting the logging categories with an environment
variable is awkward if sdaemon is spawned from a running gpg-agent.

7 years agoscd: Introduce a virtual reader table.
Werner Koch [Tue, 13 Dec 2011 15:55:42 +0000 (16:55 +0100)]
scd: Introduce a virtual reader table.

The vreader table makes the code more clear by explicitly talking
about APDU slots and reader indices.  It also accommodates for future
extensions.

* scd/scdaemon.h (server_control_s): Remove READER_SLOT.
* scd/scdaemon.c (scd_init_default_ctrl): Do not init READER_SLOT.
* scd/app.c (check_application_conflict): Add arg SLOT.
* scd/command.c (slot_status_s): Rename to vreader_s.
(server_local_s): Add field VREADER_IDX as replacement for
the READER_SLOT in server_control_s.  Change all users.
(slot_table): Rename to vreader_table.  Change all users.
(vreader_slot): New.
(do_reset, cmd_apdu): Map vreader to apdu slot.
(get_reader_slot): Rename to get_current_reader.  Return -1 on error.
(open_card): Map vreader toapdu slot.  Pass slot to
check_application_conflict.
(scd_command_handler): Init VREADER_IDX.
(update_reader_status_file): Reset SLOT field on error.

7 years agoscd: Retry command SERIALNO for an inactive card.
Werner Koch [Mon, 12 Dec 2011 20:02:54 +0000 (21:02 +0100)]
scd: Retry command SERIALNO for an inactive card.

* scd/command.c (cmd_serialno): Retry once for an inactive card.

7 years agoFix detection of card removal and insertion.
Werner Koch [Mon, 12 Dec 2011 19:34:12 +0000 (20:34 +0100)]
Fix detection of card removal and insertion.

* scd/apdu.c (apdu_connect): Return status codes for no card available
and inactive card.
* scd/command.c (TEST_CARD_REMOVAL): Also test for GPG_ERR_CARD_RESET.
(open_card): Map apdu_connect status to GPG_ERR_CARD_RESET.

7 years agogitlog-to-changelog: New option --tear-off.
Werner Koch [Mon, 12 Dec 2011 19:28:58 +0000 (20:28 +0100)]
gitlog-to-changelog: New option --tear-off.

* scripts/gitlog-to-changelog: Add option --tear-off.
* Makefile.am (gen-ChangeLog): Use that option.

7 years agogpgsm: Add new validation model "steed".
Werner Koch [Wed, 7 Dec 2011 15:15:15 +0000 (16:15 +0100)]
gpgsm: Add new validation model "steed".

* sm/gpgsm.h (VALIDATE_FLAG_STEED): New.
* sm/gpgsm.c (gpgsm_parse_validation_model): Add model "steed".
* sm/server.c (option_handler): Allow validation model "steed".
* sm/certlist.c (gpgsm_cert_has_well_known_private_key): New.
* sm/certchain.c (do_validate_chain): Handle the
well-known-private-key attribute.  Support the "steed" model.
(gpgsm_validate_chain): Ditto.
* sm/verify.c (gpgsm_verify): Return "steed" in the trust status line.
* sm/keylist.c (list_cert_colon): Print the new 'w' flag.
--

This is the first part of changes to implement the STEED proposal as
described at http://g10code.com/steed.html .  The idea for X.509 is
not to use plain self-signed certificates but certificates signed by a
dummy CA (i.e. one for which the private key is known).  Having a
single CA as an indication for the use of STEED might help other X.509
implementations to implement STEED.

7 years agoCorrect punctuation in the ChangeLog summary line.
Werner Koch [Wed, 7 Dec 2011 10:07:21 +0000 (11:07 +0100)]
Correct punctuation in the ChangeLog summary line.

* Makefile.am (gen-ChangeLog): Supply --append-dot.

7 years agoAllow comments which will not show up in the ChangeLog
Werner Koch [Wed, 7 Dec 2011 10:01:39 +0000 (11:01 +0100)]
Allow comments which will not show up in the ChangeLog

* scripts/gitlog-to-changelog: Ignore lines after a "--" line.

--
The first line with two dashes at the start of a line (optionally
followed by white space) stops copying the commit log lines to the
ChangeLog entry in "make dist".  This is useful to allow adding
comments to the log which are not useful in a ChangeLog.

7 years agogpgsm: Allow specification of an AuthorityKeyIdentifier.
Werner Koch [Tue, 6 Dec 2011 20:43:18 +0000 (21:43 +0100)]
gpgsm: Allow specification of an AuthorityKeyIdentifier.

* sm/certreqgen.c (pAUTHKEYID): New.
(read_parameters): Add keyword Authority-Key-Id.
(proc_parameters): Check its value.
(create_request): Insert an Authority-Key-Id.

7 years agogpgsm: Allow arbitrary extensions for cert creation.
Werner Koch [Tue, 6 Dec 2011 18:57:27 +0000 (19:57 +0100)]
gpgsm: Allow arbitrary extensions for cert creation.

* sm/certreqgen.c (pSUBJKEYID, pEXTENSION): New.
(read_parameters): Add new keywords.
(proc_parameters): Check values of new keywords.
(create_request): Add SubjectKeyId and extensions.
(parse_parameter_usage): Support "cert" and the encrypt alias "encr".

7 years agogpgsm: Fix storing of the serial number
Werner Koch [Tue, 6 Dec 2011 15:45:46 +0000 (16:45 +0100)]
gpgsm: Fix storing of the serial number

* sm/certreqgen.c (create_request): Fix hex-bin conversion.

7 years agoFix last change.
Werner Koch [Mon, 5 Dec 2011 14:14:47 +0000 (15:14 +0100)]
Fix last change.

* agent/command.c (start_command_handler): Remove use of removed var.

7 years agoAmend the agent code with more comments.
Werner Koch [Mon, 5 Dec 2011 09:54:59 +0000 (10:54 +0100)]
Amend the agent code with more comments.

* agent/command.c (server_local_s): Remove unused field MESSAGE_FD.