gnupg.git
3 years agog10: Add const qualifier.
NIIBE Yutaka [Wed, 16 Mar 2016 02:52:41 +0000 (11:52 +0900)]
g10: Add const qualifier.

* g10/gpgcompose.c (show_help): Those are strings not to be modified.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agogpg: Do not rely on a certain evaluation order.
Werner Koch [Tue, 15 Mar 2016 08:22:24 +0000 (09:22 +0100)]
gpg: Do not rely on a certain evaluation order.

* g10/keyedit.c (print_and_check_one_sig): Call check_key_signature
before derefing IS_SELFSIG.
--

Fixes-commit: 5fbd80579aea0f75ca1d2700515c5b8747a75c7d
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoscd: Add manufacturer id 0x000a
Werner Koch [Mon, 14 Mar 2016 16:49:36 +0000 (17:49 +0100)]
scd: Add manufacturer id 0x000a

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

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog10: Silence message if --quiet is given.
Kevin J. McCarthy [Thu, 10 Mar 2016 11:41:06 +0000 (12:41 +0100)]
g10: Silence message if --quiet is given.

* g10/getkey.c (parse_def_secret_key): Silence message if --quiet is
given.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: Add a new test.
Neal H. Walfield [Tue, 8 Mar 2016 13:08:15 +0000 (14:08 +0100)]
gpg: Add a new test.

* g10/Makefile.am (EXTRA_DIST): Add t-stutter-data.asc.
(module_tests): Add t-stutter.
(t_stutter_SOURCES): New variable.
(t_stutter_LDADD): New variable.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Add a test to check that the Mister and Zuccerato attack described in
"An Attack on CFB Mode Encryption As Used by OpenPGP" works.

3 years agosm: Implement pinentry loopback and reading passphrases from fd.
Justus Winter [Mon, 7 Mar 2016 17:09:41 +0000 (18:09 +0100)]
sm: Implement pinentry loopback and reading passphrases from fd.

* doc/gpgsm.texi: Document '--pinentry-mode' and '--passphrase-fd'.
* sm/Makefile.am (gpgsm_SOURCES): Add new files
* sm/call-agent.c (struct default_inq_parm_s): New definition.
(start_agent): Pass in the pinentry mode.
(default_inq_cb): Handle 'PASSPHRASE' and 'NEW_PASSPHRASE' inquiries.
Adapt all call sites to the new callback cookie.
* sm/gpgsm.c (cmd_and_opt_values): Add new values.
(opts): Add new options.
(main): Handle new options.
* sm/gpgsm.h (struct opt): Add field 'pinentry_mode'.
* sm/passphrase.c: New file.
* sm/passphrase.h: Likewise.

GnuPG-bug-id: 1970
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agosm: Remove unused argument '--fixed-passphrase'.
Justus Winter [Mon, 7 Mar 2016 12:32:35 +0000 (13:32 +0100)]
sm: Remove unused argument '--fixed-passphrase'.

* doc/gpgsm.texi: Drop description.
* sm/gpgsm.c (cmd_and_opt_values): Drop enum value.
(opts): Drop argument.
(main): Drop argument handling.
* sm/gpgsm.h (struct opt): Drop field 'fixed_passphrase'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agokbx: Avoid undefined behavior.
Justus Winter [Mon, 7 Mar 2016 13:25:38 +0000 (14:25 +0100)]
kbx: Avoid undefined behavior.

* kbx/keybox-file.c (_keybox_read_blob2): Cast to unsigned int before
shifting.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoscd: Bug fix for a device with multiple interfaces.
NIIBE Yutaka [Mon, 7 Mar 2016 11:12:38 +0000 (20:12 +0900)]
scd: Bug fix for a device with multiple interfaces.

* scd/ccid-driver.c (scan_or_find_usb_device): Use IFC_NO when
accessing interface information.

--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agobuild: Make libusb a hard requirement if the ccid driver is requested.
Justus Winter [Fri, 4 Mar 2016 14:03:26 +0000 (15:03 +0100)]
build: Make libusb a hard requirement if the ccid driver is requested.

* configure.ac: Print an error message and die if the internal ccid
driver is requested but no suitable libusb is found.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agog10: Drop superfluous declaration.
Justus Winter [Fri, 4 Mar 2016 12:33:04 +0000 (13:33 +0100)]
g10: Drop superfluous declaration.

* g10/main.h (disable_core_dumps): Drop declaration.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agog10: Guard code against errors.
Justus Winter [Fri, 4 Mar 2016 12:29:45 +0000 (13:29 +0100)]
g10: Guard code against errors.

* g10/keygen.c (do_generate_keypair): Check for errors, in which case
'pri_psk' is NULL.

Fixes-commit: bf9d1248
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodoc: Drop superfluous 'is'.
Justus Winter [Fri, 4 Mar 2016 12:09:11 +0000 (13:09 +0100)]
doc: Drop superfluous 'is'.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Add more missing CFLAGS.
Justus Winter [Thu, 3 Mar 2016 12:47:42 +0000 (13:47 +0100)]
dirmngr: Add more missing CFLAGS.

* dirmngr/Makefile.am (t_ldap_parse_uri_CFLAGS): Add
'GCRYPT_CFLAGS'.
(t_dns_stuff_CFLAGS): Likewise.

GnuPG-bug-id: 2235
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Skip gpgtar test if it has not been built.
Justus Winter [Thu, 3 Mar 2016 11:22:30 +0000 (12:22 +0100)]
tests/openpgp: Skip gpgtar test if it has not been built.

* tests/openpgp/gpgtar.test: Check if executable exists.

GnuPG-bug-id: 2261
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: Add new program gpgcompose.
Neal H. Walfield [Wed, 2 Mar 2016 15:00:44 +0000 (16:00 +0100)]
gpg: Add new program gpgcompose.

* g10/packet.h: Include "util.h".
* g10/encrypt.c (encrypt_seskey): Don't mark as static.
* g10/gpgcompose.c: New file.
* g10/Makefile.am (noinst_PROGRAMS): Add gpgcompose.
(gpg2_SOURCES): Split everything but gpg.c into...
(gpg_sources): ... this new variable.
(gpgcompose_SOURCES): New variable.
(gpgcompose_LDADD): Likewise.
(gpgcompose_LDFLAGS): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: More robustly detect valid non-armored OpenPGP messages.
Neal H. Walfield [Wed, 2 Mar 2016 14:47:01 +0000 (15:47 +0100)]
gpg: More robustly detect valid non-armored OpenPGP messages.

* g10/armor.c (is_armored): More robustly detect valid non-armored
OpenPGP messages.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Provide a function for mapping packet types to strings.
Neal H. Walfield [Wed, 2 Mar 2016 14:45:39 +0000 (15:45 +0100)]
common: Provide a function for mapping packet types to strings.

* common/openpgpdefs.h (pkttype_str): New function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Rename pop_filter to iobuf_pop_filter and export it.
Neal H. Walfield [Wed, 2 Mar 2016 14:42:18 +0000 (15:42 +0100)]
gpg: Rename pop_filter to iobuf_pop_filter and export it.

* common/iobuf.c (pop_filter): Rename from this...
(iobuf_pop_filter): ... to this.  Don't mark it as static.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Split write_pubkey_enc_from_list.
Neal H. Walfield [Wed, 2 Mar 2016 14:38:16 +0000 (15:38 +0100)]
gpg: Split write_pubkey_enc_from_list.

* g10/encrypt.c (write_pubkey_enc_from_list): Split the body of this
function out into...
(write_pubkey_enc): ... this new function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Allow the caller to write the contents of a plaintext packet.
Neal H. Walfield [Wed, 2 Mar 2016 14:35:39 +0000 (15:35 +0100)]
gpg: Allow the caller to write the contents of a plaintext packet.

* g10/build-packet.c (do_plaintext): Change the semantics such that if
PT->BUF is NULL, it is the caller's responsibility to write the
content (and disable partial body length mode, if appropriate).

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Add a new function for creating binary notations.
Neal H. Walfield [Mon, 29 Feb 2016 13:12:57 +0000 (14:12 +0100)]
gpg: Add a new function for creating binary notations.

* g10/build-packet.c (blob_to_notation): New function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Refactor the printing of binary notations.
Neal H. Walfield [Mon, 29 Feb 2016 13:09:43 +0000 (14:09 +0100)]
gpg: Refactor the printing of binary notations.

* g10/build-packet.c (sig_to_notation): Break printing of binary
notations into...
(notation_value_to_human_readable_string): ... this new function.
Provide a small preview of the binary data substituting non-printable
characters with '?'.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agotests/openpgp: Make tests more portable.
Uldis Anšmits [Wed, 2 Mar 2016 16:55:56 +0000 (17:55 +0100)]
tests/openpgp: Make tests more portable.

* tests/openpgp/default-key.test: Avoid 'grep -q'.
* tests/openpgp/gpgtar.test: Avoid 'grep -qe' and 'diff -q'.
* tests/openpgp/use-exact-key.test: Avoid 'grep -q'.

GnuPG-bug-id: 2262
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Update README.
Justus Winter [Wed, 2 Mar 2016 13:27:30 +0000 (14:27 +0100)]
common: Update README.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Consolidate Assuan server argument handling.
Justus Winter [Wed, 2 Mar 2016 13:14:33 +0000 (14:14 +0100)]
common: Consolidate Assuan server argument handling.

* 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 <justus@g10code.com>
3 years agodirmngr: Add missing CFLAGS.
Justus Winter [Tue, 1 Mar 2016 14:07:29 +0000 (15:07 +0100)]
dirmngr: Add missing CFLAGS.

* dirmngr/Makefile.am (t_ldap_parse_uri_CFLAGS): Add
'GPG_ERROR_CFLAGS'.
(t_dns_stuff_CFLAGS): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools: Drop superfluous include.
Justus Winter [Tue, 1 Mar 2016 13:51:35 +0000 (14:51 +0100)]
tools: Drop superfluous include.

* tools/gpgtar.c: Do not include unused 'npth.h'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: Prettify a 2 octet hex output.
Werner Koch [Fri, 26 Feb 2016 10:41:18 +0000 (11:41 +0100)]
gpg: Prettify a 2 octet hex output.

* g10/sig-check.c (check_key_signature2): Wrap line and use %02x.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Show debugging info if a sig with an unsupported sig class is used.
Neal H. Walfield [Thu, 25 Feb 2016 20:22:55 +0000 (21:22 +0100)]
gpg: Show debugging info if a sig with an unsupported sig class is used.

* g10/sig-check.c (check_key_signature2): If SIG->CLASS is
unsupported, show some debugging information.  Don't use BUG to fail.
Just return GPG_ERR_BAD_SIGNATURE.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: More carefully encode a packet's length.
Neal H. Walfield [Thu, 25 Feb 2016 20:20:32 +0000 (21:20 +0100)]
gpg: More carefully encode a packet's length.

* g10/build-packet.c (write_header2): Make sure the length bits are
cleared.  Fail if HDRLEN is set and the specified length can't be
encoded in the available space.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Avoid directly twiddling bits.
Neal H. Walfield [Thu, 25 Feb 2016 20:16:41 +0000 (21:16 +0100)]
gpg: Avoid directly twiddling bits.

* g10/build-packet.c (do_plaintext): Use ctb_new_format_p to check the
packet's format.
(write_header2): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Improve documentation and comments related to OpenPGP packets.
Neal H. Walfield [Thu, 25 Feb 2016 20:08:56 +0000 (21:08 +0100)]
gpg: Improve documentation and comments related to OpenPGP packets.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Add some asserts.
Neal H. Walfield [Thu, 25 Feb 2016 14:19:04 +0000 (15:19 +0100)]
gpg: Add some asserts.

* g10/build-packet.c (ctb_new_format_p): New function.
(ctb_pkttype): New function.
(do_user_id): Add some asserts.
(do_key): Likewise.
(do_symkey_enc): Likewise.
(do_pubkey_enc): Likewise.
(do_plaintext): Likewise.
(do_encrypted): Likewise.
(do_encrypted_mdc): Likewise.
(do_compressed): Likewise.
(do_signature): Likewise.
(do_signature): Likewise.
(write_header2): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Avoid an unnecessary copy.
Neal H. Walfield [Thu, 25 Feb 2016 13:51:55 +0000 (14:51 +0100)]
gpg: Avoid an unnecessary copy.

* g10/build-packet.c (sig_to_notation): Avoid an unnecessary copy of
the data: the size of the packet is fixed.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Reduce buffer size.
Neal H. Walfield [Tue, 23 Feb 2016 21:39:58 +0000 (22:39 +0100)]
common: Reduce buffer size.

* common/iobuf.c (iobuf_copy): Change buffer size from 1 MB to 32 KB.

--
Change suggested by Werner based on the observation that other buffers
are of a similar size.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Improve a function's documentation and comments.
Neal H. Walfield [Tue, 23 Feb 2016 20:28:24 +0000 (21:28 +0100)]
common: Improve a function's documentation and comments.

* common/iobuf.c (iobuf_set_partial_body_length_mode): Fix
documentation and comment.  Add an assert.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Add log_assert.
Neal H. Walfield [Tue, 23 Feb 2016 20:14:21 +0000 (21:14 +0100)]
common: Add log_assert.

* common/logging.h (log_assert): New macro.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Use higher-level functions.
Neal H. Walfield [Tue, 23 Feb 2016 20:07:09 +0000 (21:07 +0100)]
gpg: Use higher-level functions.

* g10/build-packet.c (do_symkey_enc): Use iobuf_write instead of
iobuf_put in a loop.  Use iobuf_copy instead of iobuf_read and
iobuf_write in a loop.  Move the memory wiping from here...
* common/iobuf.c (iobuf_copy): ... to here.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Check for an error before reading.
Neal H. Walfield [Tue, 23 Feb 2016 20:04:29 +0000 (21:04 +0100)]
common: Check for an error before reading.

* common/iobuf.c (iobuf_copy): If DEST has a pending error, don't
start copying.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: More accurately name function.
Neal H. Walfield [Tue, 23 Feb 2016 19:36:07 +0000 (20:36 +0100)]
common: More accurately name function.

* common/iobuf.c (iobuf_set_partial_block_mode): Rename from this...
(iobuf_set_partial_body_length_mode): ... to this.  Update callers.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agog13: Add commands --suspend and --remove.
Werner Koch [Tue, 23 Feb 2016 13:32:46 +0000 (14:32 +0100)]
g13: Add commands --suspend and --remove.

* g13/g13.c (aSuspend, aResume): New.
(opts): Add commands --suspend and --resume.
(main): Implement dummy command aUmount.  Implement commands aResume
and aSuspend.
* g13/sh-cmd.c (cmd_suspend): New.
(cmd_resume): New.
(register_commands): Add commands RESUME and SUSPEND.
* g13/server.c (cmd_suspend): New.
(cmd_resume): New.
(register_commands): Add commands RESUME and SUSPEND.
* g13/be-dmcrypt.c (be_dmcrypt_suspend_container): New.
(be_dmcrypt_resume_container): New.
* g13/backend.c (be_suspend_container): New.
(be_resume_container): New.
* g13/suspend.c, g13/suspend.h: New.
* g13/mount.c (parse_header, read_keyblob_prefix, read_keyblob)
(decrypt_keyblob, g13_is_container): Move to ...
* g13/keyblob.c: new file.
(keyblob_read): Rename to g13_keyblob_read and make global.
(keyblob_decrypt): Rename to g13_keyblob_decrypt and make global.
* g13/sh-dmcrypt.c (check_blockdev): Add arg expect_busy.
(sh_dmcrypt_suspend_container): New.
(sh_dmcrypt_resume_container): New.
* g13/call-syshelp.c (call_syshelp_run_suspend): New.
(call_syshelp_run_resume): New.
--

The --suspend command can be used before a hibernate operation to make
the encrypted partition inaccessible and wipe the key from the memory.
Before --suspend is called a sync(1) should be run to make sure that
their are no dirty buffers (dmsetup, as called by g13, actually does
this for you but it does not harm to do it anyway.  After the
partition has been suspended a

  echo 3 >proc/sys/vm/drop_caches

required to flush all caches which may still have content from the
encrypted partition.

The --resume command reverses the effect of the suspend but to do this
it needs to decrypt again.  Now, if the .gnupg directory lives on the
encrypted partition this will be problematic because due to the
suspend all processes accessing data on the encrypted partition will
be put into an uninterruptible sleep (ps(1) shows a state of 'D').
This needs to be avoided.  A workaround is to have a separate GnuPG
home directory (say, "~/.gnupg-fallback") with only the public keys
required to decrypt the partition along with a properly setup
conf files.  A

  GNUPGHOME=$(pwd)/.gnupg-fallback g13 --resume

should then be able to resume the encrypted partition using the
private key stored on a smartcard.

The implementation is pretty basic right now but useful to me.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Run mount after dmsetup.
Werner Koch [Mon, 22 Feb 2016 09:56:27 +0000 (10:56 +0100)]
g13: Run mount after dmsetup.

* g13/g13-syshelp.c (main): Reject userids with a slash.
* g13/sh-dmcrypt.c (sh_dmcrypt_mount_container): Run mount if a
mountpoint is known.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests/openpgp: Qualify executables with extension.
Justus Winter [Tue, 12 Jan 2016 10:43:06 +0000 (11:43 +0100)]
tests/openpgp: Qualify executables with extension.

* tests/openpgp/Makefile.am (required_pgms): Qualify executables with
'$EXEEXT'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Reimplement 'pinentry.sh' in c.
Justus Winter [Fri, 22 Jan 2016 10:47:58 +0000 (11:47 +0100)]
tests/openpgp: Reimplement 'pinentry.sh' in c.

* tests/openpgp/Makefile.am: Build new program.
* tests/openpgp/defs.inc: Use the new program.
* tests/openpgp/fake-pinentry.c: New file.
--
Building an executable that does not require an interpreter makes it
easier to use on Windows.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Avoid dependency on source files.
Justus Winter [Fri, 22 Jan 2016 11:10:57 +0000 (12:10 +0100)]
tests/openpgp: Avoid dependency on source files.

* tests/openpgp/plain-largeo.asc: New file.
* tests/openpgp/version.test: Dearmor the new file instead of relying
on the source being present.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Fix file removal.
Justus Winter [Fri, 22 Jan 2016 11:06:06 +0000 (12:06 +0100)]
tests/openpgp: Fix file removal.

* tests/openpgp/version.test: Fix file removal.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Provide a way to wait for multiple processes.
Justus Winter [Thu, 14 Jan 2016 17:20:14 +0000 (18:20 +0100)]
common/exechelp: Provide a way to wait for multiple processes.

* common/exechelp-posix.c (gnupg_wait_process): Generalize to
'gnupg_wait_processes'.
* common/exechelp-w32.c (gnupg_wait_process): Likewise.
* common/exechelp-w32ce.c (gnupg_wait_process): New function stub.
* common/exechelp.h (gnupg_wait_process): New prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Add general pipe function.
Justus Winter [Thu, 14 Jan 2016 13:14:25 +0000 (14:14 +0100)]
common/exechelp: Add general pipe function.

* common/exechelp-posix.c (gnupg_create_pipe): New function.
* common/exechelp-w32.c (INHERIT_{READ,WRITE,BOTH}): New macros.
(create_inheritable_pipe): Generalize so that both ends can be
inherited.
(do_create_pipe): Rename argument accordingly.
(gnupg_create_{in,out}bound_pipe): Use new flags.
(gnupg_create_pipe): New function.
(gnupg_spawn_process): Use new flags.
* common/exechelp-w32ce.c (gnupg_create_pipe): New stub.
* common/exechelp.h (gnupg_create_pipe): New prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Mute the Windows version.
Justus Winter [Thu, 4 Feb 2016 16:03:48 +0000 (17:03 +0100)]
common/exechelp: Mute the Windows version.

* common/exechelp-w32.c (gnupg_wait_process): Do not print an error if
the exit code can be returned.  This makes the Windows version behave
like the POSIX version.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Avoid magic numbers.
Justus Winter [Mon, 25 Jan 2016 16:45:19 +0000 (17:45 +0100)]
common/exechelp: Avoid magic numbers.

* common/exechelp-w32.c (do_create_pipe): Use symbolic names.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Disable debugging by default.
Justus Winter [Tue, 26 Jan 2016 11:43:40 +0000 (12:43 +0100)]
common/exechelp: Disable debugging by default.

* common/exechelp-w32.c (DEBUG_W32_SPAWN): Set to 0.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix handle leak.
Justus Winter [Fri, 22 Jan 2016 10:11:55 +0000 (11:11 +0100)]
common/exechelp: Fix handle leak.

* common/exechelp-w32.c (gnupg_spawn_process_detached): Close process
handle.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix opening the 'nul' device.
Justus Winter [Wed, 20 Jan 2016 11:13:35 +0000 (12:13 +0100)]
common/exechelp: Fix opening the 'nul' device.

* common/exechelp-w32.c (gnupg_spawn_process): Fix opening the 'nul'
device.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix error handling.
Justus Winter [Tue, 19 Jan 2016 12:09:06 +0000 (13:09 +0100)]
common/exechelp: Fix error handling.

* common/exechelp-w32.c (gnupg_spawn_process): Close the right handle.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix pipe creation.
Justus Winter [Tue, 19 Jan 2016 11:45:04 +0000 (12:45 +0100)]
common/exechelp: Fix pipe creation.

* common/exechelp-w32.c (gnupg_spawn_process): Fix the creation of the
input pipe.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/mk-tdata: Fix data generation on Windows.
Justus Winter [Fri, 22 Jan 2016 10:45:00 +0000 (11:45 +0100)]
tools/mk-tdata: Fix data generation on Windows.

* tools/mk-tdata.c (main): Set stdout to binary mode to avoid newline
conversion.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: Systematically detect and fix signatures that are out of order.
Neal H. Walfield [Fri, 19 Feb 2016 14:52:08 +0000 (15:52 +0100)]
gpg: Systematically detect and fix signatures that are out of order.

* g10/keyedit.c (sig_comparison): New function.
(fix_key_signature_order): Merge functionality into...
(check_all_keysigs): ... this function.  Rewrite to eliminate
duplicates and use a systematic approach to detecting and moving
signatures that are out of order instead of a heuristic.
(fix_keyblock): Don't call fix_key_signature_order.  Call
check_all_keysigs instead after collapsing the uids.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2236

3 years agogpg: Split check_key_signature2.
Neal H. Walfield [Fri, 19 Feb 2016 14:30:03 +0000 (15:30 +0100)]
gpg: Split check_key_signature2.

* g10/sig-check.c (hash_uid_node): Rename from this...
(hash_uid_packet): ... to this.  Take a PKT_user_id instead of a
KBNODE.
(check_key_signature2): Split the basic signature checking
functionality into...
(check_signature_over_key_or_uid): ... this new function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Split print_and_check_one_sig.
Neal H. Walfield [Fri, 19 Feb 2016 14:13:22 +0000 (15:13 +0100)]
gpg: Split print_and_check_one_sig.

* g10/keyedit.c (print_and_check_one_sig): Split the print
functionality into...
(print_one_sig): ... this new function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Split the function check_signature_end.
Neal H. Walfield [Fri, 19 Feb 2016 13:10:09 +0000 (14:10 +0100)]
gpg: Split the function check_signature_end.

* g10/sig-check.c (check_signature_end): Break the basic signature
check into...
(check_signature_end_simple): ... this new function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Use format_keyid rather than manually formatting the keyid.
Neal H. Walfield [Fri, 19 Feb 2016 13:59:19 +0000 (14:59 +0100)]
gpg: Use format_keyid rather than manually formatting the keyid.

* g10/keyedit.c (menu_addrevoker): Use format_keyid rather than
manually formatting the keyid.
* g10/keygen.c (card_write_key_to_backup_file): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Initialize the primary key when generating a key.
Neal H. Walfield [Fri, 19 Feb 2016 13:53:29 +0000 (14:53 +0100)]
gpg: Initialize the primary key when generating a key.

* g10/keygen.c (do_generate_keypair): Initialize
pri_psk->flags.primary, pri_psk->keyid and pri_psk->main_keyid.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.
Neal H. Walfield [Fri, 19 Feb 2016 13:48:56 +0000 (14:48 +0100)]
gpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.

* g10/keydb.h (keyid_cmp): New function.
* g10/keyid.c (pk_keyid): New function.
(pk_main_keyid): New function.
(keyid_copy): New function.
(pk_keyid_str): New function.
* g10/packet.h (PKT_public_key): Update comments for main_keyid and
keyid.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Before accessing pk->keyid, it is necessary to call keyid_from_pk (pk,
NULL) to ensure that pk->keyid is valid.  Because it is easy to forget
to do this, these accessor functions take care of it.

3 years agogpgparsemail: Allow weirdly-mixed pkcs7 signatures.
Daniel Kahn Gillmor [Mon, 8 Feb 2016 20:44:07 +0000 (15:44 -0500)]
gpgparsemail: Allow weirdly-mixed pkcs7 signatures.

* tools/gpgparsemail.c: Add and check info->signing_protocol_2.

--
Some mailers in the wild will generate messages that have the a weird
structure where they use the x- prefix in one part and drop it in
another.

For example, the main MIME part as a whole has:

Content-Type: multipart/signed;
   protocol="application/x-pkcs7-signature"

but the signature sub-part has:

  Content-Type: application/pkcs7-signature

(or vice versa, where the x- prefix is in the sub-part but not the
protocol= section on the main MIME object)

This change also avoids allocating strings for these comparisons,
since the const strings in question are already available in the built
executable, and no dynamic labels are needed.

===
- 2 lines reformatted to keep them below 90 cols. - wk

3 years agogpg: Clean up dangling agent_open and agent_closed declarations.
Daniel Kahn Gillmor [Thu, 11 Feb 2016 12:08:55 +0000 (07:08 -0500)]
gpg: Clean up dangling agent_open and agent_closed declarations.

* g10/keydb.h: Remove agent_open, agent_close declarations/
* g10/migrate.c: #include <unistd.h> for access()

--
agent_open() is only defined statically in common/simple-pw-query.c,
it is neither used nor referenced anywhere else.  agent_close doesn't
exist anywhere.  The removal of these declarations removes an
unecessary inclusion of libassuan.h.

migrate.c was relying on keydb.h -> libassuan.h -> unistd.h for the
declaration of access(), so we now handle that explicitly instead.

3 years agow32: Make scdaemon build again due to libusb problem.
Werner Koch [Tue, 16 Feb 2016 15:47:22 +0000 (16:47 +0100)]
w32: Make scdaemon build again due to libusb problem.

* configure.ac: Add hack to disable libusb for Windows.  Also use
$host instead of $target in the switch
 --

The new test for libusb does not support cross-compiling.  As a quick
workaround we disable libusb for Windows because we can't use it anyway.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Do not error out if gpgconf is not installed.
Werner Koch [Tue, 16 Feb 2016 15:07:44 +0000 (16:07 +0100)]
w32: Do not error out if gpgconf is not installed.

* common/homedir.c (check_portable_app): Remove error message.
--

It is sometimes useful to install just gpgv and no other parts.  Our
test for a portable application returned an error if gpgconf is not
installed.  That error is not required but was merely a debug aid.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Make ASCII armor decoding more robust to encoding errors.
Neal H. Walfield [Sun, 14 Feb 2016 15:00:10 +0000 (16:00 +0100)]
gpg: Make ASCII armor decoding more robust to encoding errors.

* g10/armor.c (radix64_read): If the = is followed by the string "3D",
check if the following four characters are valid radix 64 and are
followed by a new line.  If so, warn and ignore the '3D'.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2250

3 years agodoc: Add a gnupg-module-overview picture.
Werner Koch [Tue, 16 Feb 2016 11:58:53 +0000 (12:58 +0100)]
doc: Add a gnupg-module-overview picture.

* doc/gnupg-module-overview.svg: New.
* doc/debugging.texi (Component interaction): New.
* doc/Makefile.am (EXTRA_DIST): Add PNG and PDF versions of
gnupg-module-overview.svg.  Remove two eps files.
(BUILT_SOURCES): Add gnupg-module-overview.pdf and .png.  Remove
gnupg-card-architecture.epsl
(gnupg_TEXINFOS): Add gnupg-module-overview.svg
(gnupg.dvi): New.
(DISTCLEANFILES): Remove build eps files.
--

Many thanks to Emanuel Schütze for helping with the redesign of the
module overview.  The original file has been used by mere for years in
talks but was never a proper part of GnuPG.

The EPS files have been removed due to their size.  Thus to build the
"dvi" target the convert tool is required.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon, g10: Fix indentation to silence GCC-6.
NIIBE Yutaka [Mon, 15 Feb 2016 02:05:29 +0000 (11:05 +0900)]
common, g10: Fix indentation to silence GCC-6.

* common/iobuf.c (iobuf_ioctl): Fix.
* g10/encrypt.c (encrypt_filter): Likewise.
* g10/keyring.c (prepare_search): Likewise.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agodirmngr: fix for memory alignment.
NIIBE Yutaka [Mon, 15 Feb 2016 01:55:34 +0000 (10:55 +0900)]
dirmngr: fix for memory alignment.

* dirmngr/dns-stuff.c (get_dns_cert): Cast through void *.
(getsrv, get_dns_cname): Make sure it's aligned for HEADER.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agoPut asterisks in front of two function descriptions.
Werner Koch [Sun, 14 Feb 2016 15:11:06 +0000 (16:11 +0100)]
Put asterisks in front of two function descriptions.

--

This helps visual impaired hackers to easier read comments and also
helps use when looking at a printout.

3 years agogpg: Add hidden key-edit subcommand "change-usage".
Werner Koch [Sun, 14 Feb 2016 14:50:12 +0000 (15:50 +0100)]
gpg: Add hidden key-edit subcommand "change-usage".

* g10/keyedit.c (cmdCHANGEUSAGE): New.
(cmds): Add command "change-usage".
(keyedit_menu): Handle that command.
(menu_changeusage): New.
* g10/keygen.c (keygen_add_key_flags): New.
(ask_key_flags): Add optional arg current.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Improve API documentation.
Neal H. Walfield [Wed, 3 Feb 2016 13:23:51 +0000 (14:23 +0100)]
gpg: Improve API documentation.

* g10/seskey.c (make_session_key): Improve documentation.
(encode_session_key): Improve documentation.
* g10/encrypt.c (encrypt_seskey): Remove gratuitous initialization.
* g10/dek.h (DEK): Improve documenation.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Fix calc_header_length when LEN is 0 and improve documentation.
Neal H. Walfield [Tue, 2 Feb 2016 19:05:45 +0000 (20:05 +0100)]
gpg: Fix calc_header_length when LEN is 0 and improve documentation.

* g10/build-packet.c (calc_header_length): Return the correct haeder
size when LEN is 0.  Fix documentation.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2240

3 years agogpg: Fix format_keyid when dynamically allocating the buffer.
Neal H. Walfield [Sun, 7 Feb 2016 23:31:35 +0000 (00:31 +0100)]
gpg: Fix format_keyid when dynamically allocating the buffer.

* g10/keyid.c (format_keyid): Return a char *, not a const char *.  If
BUFFER is NULL, then set LEN to the static buffer's size.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Fix comment.
Neal H. Walfield [Sun, 7 Feb 2016 23:30:10 +0000 (00:30 +0100)]
common: Fix comment.

* common/iobuf.c (iobuf_flush_temp): Fix comment.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agog13: Require a confirmation before g13 is used for DM-Crypt.
Werner Koch [Sat, 13 Feb 2016 16:30:14 +0000 (17:30 +0100)]
g13: Require a confirmation before g13 is used for DM-Crypt.

* g13/g13-syshelp.c (g13_syshelp_i_know_what_i_am_doing):
* g13/sh-dmcrypt.c (sh_dmcrypt_create_container): Call it.
(sh_dmcrypt_mount_container): Call it.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Second chunk of code to support dm-crypt.
Werner Koch [Sat, 13 Feb 2016 16:01:45 +0000 (17:01 +0100)]
g13: Second chunk of code to support dm-crypt.

* g13/be-dmcrypt.c, g13/be-dmcrypt.h: New.
* g13/Makefile.am (g13_SOURCES): Add them.
* g13/backend.c: Include be-dmcrypt.h and call-syshelp.h.
(no_such_backend): Rename to _no_such_backend and provide replacement
macro.
(be_is_supported_conttype): Support DM-Crypt.
(be_take_lock_for_create): Call set_segvice for DM-Crypt.
(be_create_new_keys): Make it a dummy for DM-Crypt.
(be_create_container): Call be_dmcrypt_create_container.
(be_mount_container): call be_dmcrypt_mount_container.
* g13/g13-syshelp.c (main): Enable verbose mode.
* g13/g13tuple.c (get_tupledesc_data): New.
* g13/g13tuple.h (unref_tupledesc): New.
* g13/g13.h (server_control_): Add field "recipients".
* g13/g13.c (main): Fix setting of recipients via cmdline.
(g13_deinit_default_ctrl): Release recipients list.
(g13_request_shutdown): New.  Replace all direct update of
shutdown_pending by calls this function.
* g13/server.c (server_local_s): Remove field recipients which is now
part of CTRL.
(reset_notify, cmd_recipient, cmd_create): Adjust for this change.
* g13/create.c (encrypt_keyblob): Rename to g13_encrypt_keyblob.
(g13_create_container): Support DM-Crypt.
* g13/mount.c (parse_header): Allow for meta data copies.
(g13_mount_container): Support DM-Crypt.
* g13/sh-cmd.c (cmd_create): Make it work.
(cmd_mount): New.
* g13/sh-dmcrypt.c (sh_dmcrypt_create_container): Make it work.
(sh_dmcrypt_mount_container): New.
--

With this patch we can now create an encrypted partition and partly
mount it (i.e. setup keys and create the mapped device). We do not yet
create a file system or mount that file system

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Improve dump_keyblob.
Werner Koch [Thu, 11 Feb 2016 12:57:35 +0000 (13:57 +0100)]
g13: Improve dump_keyblob.

* g13/g13tuple.c: Include keyblob.h.
(find_tuple_uint): Factor code out to ...
(convert_uint): new.
(all_printable): New.
* g13/mount.c (dump_keyblob: Move and rename to ...
* g13/g13tuple.c (dump_tupledesc): here.  Revamp and pretyy print uint
values.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Define 3 new tags.
Werner Koch [Thu, 11 Feb 2016 12:59:19 +0000 (13:59 +0100)]
g13: Define 3 new tags.

* g13/keyblob.h (KEYBLOB_TAG_CONT_NSEC): New.
(KEYBLOB_TAG_ENC_NSEC): New.
(KEYBLOB_TAG_ENC_OFF): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Rename utils.c to g13tuple.c
Werner Koch [Thu, 11 Feb 2016 12:32:30 +0000 (13:32 +0100)]
g13: Rename utils.c to g13tuple.c

* g13/utils.c: Rename to g13tuple.c.
* g13/utils.h: Rename to g13tuple.h.  Change all users.
* g13/Makefile.am: Adjust accordingly
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Add functions to handle uint in a keyblob.
Werner Koch [Wed, 10 Feb 2016 19:44:19 +0000 (20:44 +0100)]
g13: Add functions to handle uint in a keyblob.

* g13/utils.c (append_tuple_uint): New.
(find_tuple_uint): New.
* g13/t-utils.c: New.
* g13/Makefile.am (noinst_PROGRAMS, TESTS): New.
(module_tests, t_common_ldadd): New.
(t_utils_SOURCES, t_utils_LDADD): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Re-factor high level create code.
Werner Koch [Tue, 2 Feb 2016 08:03:37 +0000 (09:03 +0100)]
g13: Re-factor high level create code.

* g13/create.c (g13_create_container): Factor some code out to ...
* g13/backend.c (be_take_lock_for_create): new.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Return an error for non-existing device.
Werner Koch [Tue, 2 Feb 2016 17:18:31 +0000 (18:18 +0100)]
g13: Return an error for non-existing device.

* g13/sh-cmd.c (cmd_device): Set ERR.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Fix releasing of a syshelp context.
Werner Koch [Mon, 14 Dec 2015 09:42:27 +0000 (10:42 +0100)]
g13: Fix releasing of a syshelp context.

* g13/call-syshelp.c (call_syshelp_release): Allow a NULL arg.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Switch over to common/exectool.c.
Werner Koch [Mon, 14 Dec 2015 09:16:46 +0000 (10:16 +0100)]
g13: Switch over to common/exectool.c.

* g13/sh-exectool.c: Remove.  It has been replaced by common/exectool.c.
* g13/Makefile.am (g13_syshelp_SOURCES): Remove sh-exectool.c
* g13/sh-blockdev.c: Include exectool.h.  Change sh_exec_tool to
gnupg_exec-tool.
* g13/sh-dmcrypt.c: Ditto.
--

With commit 2ae07f826aa551db8adf714158fce962790a6b54 the exectool code
was moved from a g13 feature branch to common/ so that it could be
used by gpgtar.  With this patch we finally remove the original code
and use the one in common/.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Make gnupg_exec_tool conform to spec.
Werner Koch [Tue, 2 Feb 2016 17:18:31 +0000 (18:18 +0100)]
common: Make gnupg_exec_tool conform to spec.

* common/exectool.c (gnupg_exec_tool): Allocate extra byte.  Allow
zero length read.  Append hidden byte.  Release memory on error.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: First chunk of code to support dm-crypt.
Werner Koch [Wed, 21 Oct 2015 06:38:10 +0000 (08:38 +0200)]
g13: First chunk of code to support dm-crypt.

* g13/call-syshelp.c, g13/call-syshelp.h: New.
* g13/g13-syshelp.c, g13/g13-syshelp.h: New.
* g13/sh-cmd.c: New.
* g13/sh-blockdev.c: New.
* g13/sh-exectool.c: New.
* g13/sh-dmcrypt.c: New.
* g13/Makefile.am (sbin_PROGRAMS): Add g13-syshelp.c
(g13_syshelp_SOURCES): New.
(g13_syshelp_LDADD): New.

* g13/g13.c (opts): Add option --type.
(g13_deinit_default_ctrl): New.
(main): Implement that option.  Call g13_deinit_default_ctrl.
* g13/g13.h (struct call_syshelp_s): New declaration.
(server_control_s): Add field syshelp_local.
* g13/keyblob.h (KEYBLOB_TAG_CREATED): New.
(KEYBLOB_TAG_ALGOSTR): New.
(KEYBLOB_TAG_HDRCOPY): New.
* g13/backend.c (be_parse_conttype_name): New.
(be_get_detached_name): Add CONTTYPE_DM_CRYPT.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests: Remove some harmless warnings in regression tests.
Werner Koch [Mon, 1 Feb 2016 16:58:19 +0000 (17:58 +0100)]
tests: Remove some harmless warnings in regression tests.

* tests/openpgp/gpg-agent.conf.tmpl: Remove --use-standard-socket.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Change simple_query to ignore status messages.
Neal H. Walfield [Fri, 12 Feb 2016 21:12:21 +0000 (22:12 +0100)]
common: Change simple_query to ignore status messages.

* common/simple-pwquery.c (simple_query): Ignore status messages.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2229

3 years agog10: Make sure to have the directory for trustdb.
NIIBE Yutaka [Fri, 12 Feb 2016 01:10:33 +0000 (10:10 +0900)]
g10: Make sure to have the directory for trustdb.

* g10/tdbio.c (tdbio_set_dbname): Return earlier if !CREATE.  Check
the directory and create it if none before calling take_write_lock.

--

Thanks to Marc Deslauriers for the bug report and his patch.

GnuPG-bug-id: 2246

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agodoc: Note that rngd can also be used to quickly generate insecure keys.
Neal H. Walfield [Tue, 2 Feb 2016 10:50:08 +0000 (11:50 +0100)]
doc: Note that rngd can also be used to quickly generate insecure keys.

* doc/gpg-agent.texi (Agent Options): Add comment to the description
of --debug-quick-random that rngd can also be used to quickly generate
key.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agoscd: Fix size_t/int mismatch in libusb
Werner Koch [Wed, 27 Jan 2016 13:31:13 +0000 (14:31 +0100)]
scd: Fix size_t/int mismatch in libusb

* scd/ccid-driver.c (bulk_in, abort_cmd, ccid_poll): Change msglen to
int.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoscd: Fix detection of libusb.
Werner Koch [Wed, 27 Jan 2016 13:23:19 +0000 (14:23 +0100)]
scd: Fix detection of libusb.

* configure.ac (HAVE_LIBUSB): Clear if no header file was found.
(LIBUSB_LIBS): Ditto.
--

This allows to use commit d0d9708 when libusb is installed without the
header files.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Shorten the --tofu-policy help text
Werner Koch [Wed, 27 Jan 2016 12:58:20 +0000 (13:58 +0100)]
gpg: Shorten the --tofu-policy help text

--

Using "help" as value lists the options.  Not having the current
options in the help text also makes it easier to keep translations
clean.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Build fix for FreeBSD (EAI macros)
Werner Koch [Wed, 27 Jan 2016 12:55:31 +0000 (13:55 +0100)]
dirmngr: Build fix for FreeBSD (EAI macros)

* dirmngr/dns-stuff.c (map_eai_to_gpg_error): Map EAI_NODATA and
EAI_ADDRFAMILY only if defined.
--

Reported-by: Christoph Moench-Tegeder <cmt@burggraben.net>
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodoc: Typo fixes
Ineiev [Wed, 27 Jan 2016 09:42:16 +0000 (10:42 +0100)]
doc: Typo fixes

--

3 years agoscd: Migrate to new API of libusb 1.0.
NIIBE Yutaka [Wed, 27 Jan 2016 03:24:05 +0000 (12:24 +0900)]
scd: Migrate to new API of libusb 1.0.

* configure.ac (LIBUSB_CPPFLAGS): New.
* scd/Makefile.am (AM_CPPFLAGS): Add LIBUSB_CPPFLAGS.
* scd/ccid-driver.c: Use libusb 1.0 API.
--

Changes are straightforward, not use any new features.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>