Commit Graph

4111 Commits

Author SHA1 Message Date
Werner Koch b1653a4083 gpg: Silence a compiler warning.
* g10/parse-packet.c (enum_sig_subpkt): Replace hack.

--

GCC 5 failure reported by Kevin Locke <kevin@kevinlocke.name>

(backport from master commit 6a0c3fa19c)
2015-10-01 14:32:50 +09:00
NIIBE Yutaka fea9d4354c gpg: Improve 'General key info' line of --card-status.
* g10/keylist.c (print_pubkey_info): Print either "pub" or "sub".

--

This now prints "sub" if the first used card key is actually a subkey.

Signed-off-by: Werner Koch <wk@gnupg.org>

GnuPG-bug-id: 2079

(backported from master 874ef16e70)
2015-09-29 13:45:20 +09:00
Werner Koch 47a499eaa2
ssh: Fix fingerprint computation for 384 bit ECDSA keys.
* common/ssh-utils.c (get_fingerprint): Fix hashed string.
--

That was an obvious c+p bug which should have been caught by a test
case.

GnuPG-bug-id: 2075
Debian-bug-id: 795636

(backported from master 2167951b27)
2015-09-22 09:34:05 +02:00
NIIBE Yutaka bc829bd6af po: Update Japanese translation. 2015-09-17 17:07:29 +09:00
NIIBE Yutaka a63fddad68 scd: Fix ccid-driver timeout for OpenPGPcard v2.1.
* scd/ccid-driver.c (CCID_CMD_TIMEOUT): New.
(ccid_transceive_apdu_level, ccid_transceive): Use.

--

It is reported that key generation causes timeout with OpenPGPcard
v2.1.  Ideally, timeout value could be determined at run-time by
examining card's ATR.  Compile-time fixed value is OK for internal
CCID driver.

(cherry-picked from 2.1 6510df3a7c)
2015-09-17 11:32:24 +09:00
NIIBE Yutaka d289341371 po: Update Japanese translation. 2015-09-15 15:14:50 +09:00
NIIBE Yutaka fa3b618216 po: Update Japanese Translation. 2015-09-10 11:03:31 +09:00
NIIBE Yutaka d4a2a070b4 gpgconf: Fix scdaemon reload.
* tools/gpgconf-comp.c (scdaemon_runtime_change): Add "scd bye".

--

In GnuPG 2.0.x, it doesn't require newer libassuan which has
ASSUAN_FORCE_CLOSE feature.  We need to send "scd bye" to let
the control finish from command loop.
2015-09-10 10:00:03 +09:00
Frans Spiesschaert 1dea3746b4
po: Update Dutch translation
--
2015-09-09 15:59:01 +02:00
Werner Koch 6aa065076f
doc: Allow uploading of a 2.0 manual
--
2015-09-08 17:39:46 +02:00
Werner Koch 0a88cd186f
Post release updates.
--
2015-09-08 16:41:38 +02:00
Werner Koch 120fc69520
Release 2.0.29.
Signed-off-by: Werner Koch <wk@gnupg.org>
2015-09-08 15:59:00 +02:00
Werner Koch 88deb88741
po: Auto-update.
--
2015-09-08 15:58:28 +02:00
Werner Koch 12835e034b
po: Update German translation
--
2015-09-08 15:57:44 +02:00
Ineiev 89cce4cbbb
po: Update Russian translation.
--
2015-09-08 15:54:38 +02:00
Werner Koch 77f2964b96
gpg: Print a new FAILURE status after most commands.
* common/status.h (STATUS_FAILURE): New.
* g10/cpr.c (write_status_failure): New.
* g10/gpg.c (main): Call write_status_failure for all commands which
print an error message here.
--

This status line can be used similar to the error code returned by
commands send over the Assuan interface in gpgsm.  We don't emit them
in gpgsm because there we already have that Assuan interface to return
proper error code.  This change helps GPGME to return better error
codes.

(backported from master 9cdff09743)

Signed-off-by: Werner Koch <wk@gnupg.org>
2015-09-08 15:31:51 +02:00
Werner Koch 0b01bb7f25
gpg: Avoid cluttering stdout with trustdb info in verbose mode.
* g10/trustdb.c (validate_keys): Call dump_key_array only in debug
mode.
--

I guess that is a left-over from an early attempt to output
information on the trustdb for use by other tools.  Maybe related to
the former --list-trust-path command.  Sending it to stdout is
probably useful so we do this now only in debug mode.

Signed-off-by: Werner Koch <wk@gnupg.org>

Backported to STABLE-BRANCH-2-0 from
b03a264729 by dkg
2015-09-08 14:42:37 +02:00
Werner Koch 60b0403f3c
gpg: Obsolete --no-sig-create-check.
* g10/gpg.c (opts): Make --no-sig-create-check a NOP.
* g10/options.h (struct opt): Remove field "no_sig_create_check".
* g10/sign.c (do_sign): Do not run the create check for Libgcrypt 1.7.

Signed-off-by: Werner Koch <wk@gnupg.org>
2015-09-01 07:43:54 +02:00
NIIBE Yutaka 80521c3ff9 g10: fix --card-status creating stub.
* g10/getkey.c (get_seckeyblock_byfprint): Require exact match.
2015-08-12 10:23:40 +09:00
Werner Koch 35d3ced4fd
sm: Revert to use SHA-1 for CSR generation.
* sm/certreqgen.c (create_request): Revert to use SHA-1 but change to
set it only at one place.
--

Regression-due-to: bdf439035d
Signed-off-by: Werner Koch <wk@gnupg.org>
2015-07-27 11:37:18 +02:00
Neal H. Walfield 376417ab63 Don't segfault if the first 'auto-key-locate' option is 'clear'.
* g10/getkey.c (free_akl): If AKL is NULL, just return.

--
Backported from f2ee673c99.  Note:
unlike in 2.1, in 2.0 this bug is not (currently) triggered since
parse_auto_key_locate doesn't recognize "clear".

Signed-off-by: Neal H. Walfield <neal@g10code.com>.
Reported-by: Sami Farin.
GnuPG-bug-id: 2045
2015-07-16 11:36:31 +02:00
NIIBE Yutaka 022719695e scd: pinpad workaround for PC/SC implementations.
* scd/adpu.c (pcsc_pinpad_verify, pcsc_pinpad_modify): Bigger buffer
for TPDU card reader.

--

(backport from 2.1 commit 5e1d2fe655)

GnuPG-bug-id: 2003, 2004

This is needed for PC/SC on Debian Jessie.  Note that it's not only
for Cherry ST-2000, but also, for any TPDU card readers.
2015-06-23 10:48:04 +09:00
NIIBE Yutaka 9200bf1bab scd: Fix Cherry ST-2000 support for pinpad input.
* scd/apdu.c (pcsc_vendor_specific_init): Set pinmax to 15.
* scd/ccid-driver.c (ccid_transceive_secure): Add zero for the
template of APDU.

--

(backport from 2.1 commit 444e9232aa)

GnuPG-bug-id: 2003, 2004
2015-06-23 10:46:44 +09:00
Werner Koch be34857939
gpg: Print PGP-2 fingerprint instead of all zeroes.
* g10/keyid.c (fingerprint_from_pk): Allow PGP-2 fingerprints.
* g10/keylist.c (print_fingerprint): Print a warning after a PGP-2
fingerprint.
--

Printing all zeroes for a PGP-2 (v3 key) fingerprint has the problem
that frontends (or the user) may use that fingerprint to lookup a key
and gpg will return all PGP2 keys.  They may then show a different
PGP-2 key than the one actually used for a signature.  This is worse
than displaying a weak fingerprint.

GnuPG-bug-id: 2000
Signed-off-by: Werner Koch <wk@gnupg.org>
2015-06-17 08:38:48 +02:00
NIIBE Yutaka e2eba81fae po: Update Japanese Translation. 2015-06-16 12:52:19 +09:00
NIIBE Yutaka 2371553af1 g10: Fix a race condition initially creating trustdb.
* g10/tdbio.c (take_write_lock, release_write_lock): New.
(put_record_into_cache, tdbio_sync, tdbio_end_transaction): Use
new lock functions.
(tdbio_set_dbname): Fix the race.
(open_db): Don't call create_dotlock.

--

(backported from commit fe5c6edaed)

GnuPG-bug-id: 1675
2015-06-15 14:26:56 +09:00
NIIBE Yutaka c30bcdeac0 po:Update Japanese translation. 2015-06-15 13:58:07 +09:00
Werner Koch 0de9aedf3e
doc: Replace "conventional encryption" by "symmetric encryption".
--

Suggested-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2015-06-02 17:47:10 +02:00
Werner Koch 8a2134b8d5
gpg: Consider that gcry_mpi_get_opaque may return NULL.
* g10/seckey-cert.c (do_check): Handle a NULL opaque MPI.
--

This patch extends b2d9d10 for secret keys.  The problem is that we
changed the semantics so that opaque MPIs may be NULL with a bit
length.  This patch is not required in GnuPG 2 because we do not use
secret keys there.

Signed-off-by: Werner Koch <wk@gnupg.org>
2015-06-02 17:41:30 +02:00
Daniel Kahn Gillmor b2d9d105f7
gpg: Fix segv due to NULL value stored as opaque MPI (BRANCH 2.0)
* g10/build-packet.c (do_secret_key): Check for NULL return from
gcry_mpi_get_opaque.
* g10/keyid.c (hash_public_key): Ditto.
--

This is a backport of 76c8122adf from
master to the STABLE-BRANCH-2-0

On the STABLE-BRANCH-2-0, we may also want to patch g10/seckey-cert.c,
but that has not been done in this patch.

This fix extends commmit 0835d2f44e.

  gpg2 --export --no-default-keyring --keyring TESTDATA

With TESTDATA being below after unpacking.

-----BEGIN PGP ARMORED FILE-----

mBMEhdkMmS8BcX8F//8F5voEhQAQmBMEnAAAZwAAo4D/f/8EhQAAAIAEnP8EhQAQ
iBMEnP8AAAAABf8jIID///8EhQYQmBMEnIUAEIgTBKT/AAAAAAUAACCA/f//BIUA
EJgTBJx/AP8ABPPzBJx/AP8ABPPz
=2yE0
-----END PGP ARMORED FILE-----

Reported-by: Jodie Cunningham
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2015-06-02 17:22:27 +02:00
Werner Koch 9dcf345a84
doc: Typo fix for "Creation-Date".
--

Debian-bug-id: 760273

This has already been fixed in master.
2015-06-02 17:20:56 +02:00
Werner Koch 03fb2db9f8
Post release updates
--

The fuzzy entries of ru.po are not in the release.  Does not matter.
2015-06-02 15:12:04 +02:00
Werner Koch 58126e86ea
Release 2.0.28 2015-06-02 14:31:13 +02:00
Werner Koch a186f98583
po: Auto-update
--
2015-06-02 14:30:36 +02:00
Ineiev beb61549de
po: Update Russian translation
--

This pacth was missed for 2.0.27.
I fixed a typo in the PO-Revision-Date.
  - wk
2015-06-02 13:24:22 +02:00
Werner Koch 279ec5687b
po: Update the German translation
--
2015-06-02 13:15:13 +02:00
Werner Koch b1b52f7bd9
po: Fix a LF mismatch in ja.po.
--
2015-06-02 13:06:08 +02:00
Werner Koch ef0741ac54
agent: Make --allow-external-password-cache work.
* agent/call-pinentry.c (start_pinentry): Remove first instance of
sending the option.
--

That option to tell Pinentry about an external password cache was send
twice and the first one unconditionally.

Signed-off-by: Werner Koch <wk@gnupg.org>
2015-06-02 10:36:50 +02:00
Werner Koch 3d3a58b796
agent: Add strings for use by future Pinentry versions.
* agent/call-pinentry.c (start_pinentry): Add more strings.
--

We do this so that translations of these strings will be available at
the time a pinentry implements features which require these strings.

Signed-off-by: Werner Koch <wk@gnupg.org>

This is a backport from master
commit 02d5e12054
without the mode flag in the table.
2015-06-02 10:32:34 +02:00
Werner Koch 78e0a30fb1
agent: Cleanup caching code for command GET_PASSPHRASE.
* agent/command.c (cmd_get_passphrase): Read from the user cache.
--

We used to read the passphrase with mode CACHE_MODE_NORMAL but we put
it into the cache with CACHE_MODE_USER.  However, agent_get_cache does
not yet distinguish between them and thus this does not change
anything.

(backported from commit 23d2ef83cd)
2015-05-20 16:20:24 +02:00
Neal H. Walfield dde8ddffd3 agent: Backport changes from 2.1 to support an external password manager.
* agent/agent.h (agent_askpin): Add arguments keyinfo and cache_mode.
Update callers.
(agent_get_passphrase): Likewise.
(agent_clear_passphrase): New function.
(opt): Add field allow_external_cache.
* agent/call-pinentry.c (start_pinentry): Send "OPTION
allow-external-password-cache" to the pinentry.
(PINENTRY_STATUS_PASSWORD_FROM_CACHE): New constant.
(pinentry_status_cb): New function.
(agent_askpin): Add arguments keyinfo and cache_mode.  If KEYINFO and
CACHE_MODE describe a cachable key, then send SETKEYINFO to the
pinentry.  Pass PINENTRY_STATUS_CB to the "GETPIN" invocation.  If the
passphrase was incorrect and PINENTRY_STATUS_PASSWORD_FROM_CACHE is
set, decrement PININFO->FAILED_TRIES.
(agent_get_passphrase): Add arguments keyinfo and cache_mode.  If
KEYINFO and CACHE_MODE describe a cachable key, then send SETKEYINFO
to the pinentry.
(agent_clear_passphrase): New function.
* agent/call-pinentry.c (start_pinentry): Act upon new var,
allow_external_cache.
* agent/command.c (cmd_clear_passphrase): Call agent_clear_passphrase.
* agent/gpg-agent.c (oNoAllowExternalCache): New.
(opts): Add option --no-allow-external-cache.
(parse_rereadable_options): Set this option.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>

Based on commits:

3a9305439b
e201c20f25
d7293cb317
56b5c9f94f
d3b5cad234
2180845959
2015-05-19 15:32:54 +02:00
NIIBE Yutaka 80b6d614b7 g10: detects public key encryption packet error properly.
g10/mainproc.c (proc_pubkey_enc): Only allow relevant algorithms for
encryption.

--

(backport from 2.1 commit c771963140)
2015-05-19 10:43:33 +09:00
NIIBE Yutaka 76e2aa739c g10: Improve handling of no corresponding public key.
* g10/getkey.c (get_seckey): Return G10ERR_NO_PUBKEY when it's not
exact match.

--

(ported from 1.4 commit b3fd30451a)

In the situation of corrupted .gnupg/ where only private subkey is
available but no corresponding public key of the subkey, the code
returned public primary key which caused mysterious error (for a
user).  This fix detects an error earlier.

GnuPG-bug-id: 1422
Debian-Bug-Id: #638619
2015-05-19 10:25:22 +09:00
Werner Koch be13627345
gpg-connect-agent: Fix quoting of internal percent+ function.
* tools/gpg-connect-agent.c (get_var_ext) <percent, percent+): Also
escape '+'.
--

GnuPG-bug-id: 1841
Signed-off-by: Werner Koch <wk@gnupg.org>
2015-05-11 19:40:19 +02:00
NIIBE Yutaka 3f9f33bbcb scd: PC/SC reader selection by partial string match.
* scd/apdu.c (open_pcsc_reader_direct): Partial string match.
* scd/pcsc-wrapper.c (handle_open): Likewise.

--

(backport from 2.1 commit 01a2a61bc4)

The card reader name by PC/SC service might include USB bus,
which varies (on some platform like GNU/Linux).  Thus, it's
better to match partial string.

Original patch was submitted by anstein.  I changed it to fallback to
the first reader if no match found.

GnuPG-bug-id: 1618, 1930
2015-05-01 14:16:28 +09:00
NIIBE Yutaka 43429c7869 g10: fix cmp_public_key and cmp_secret_keys.
* g10/free-packet.c (cmp_public_keys, cmp_secret_keys): Compare opaque
data at the first entry of the array when it's unknown algo.
* configure.ac (NEED_LIBGCRYPT_VERSION): Require 1.5.0.

--

GnuPG-bug-id: 1962
2015-04-30 17:02:42 +09:00
Werner Koch c8c88bdd98 gpg: Emit status line NEWSIG before signature verification starts.
* g10/mainproc.c (check_sig_and_print): Emit STATUS_NEWSIG.
--

gpgsm does this for a long time but somehow it never made it into gpg.

Signed-off-by: Werner Koch <wk@gnupg.org>
(backported from 2.1 commit e7ddaad0fd)
2015-04-16 09:03:31 +09:00
NIIBE Yutaka 05f32c702e scd: better handling of extended APDU.
* scd/apdu.c (send_le): Bug fix for not append Z when lc<0&&le<0.
* scd/app-common.h (struct app_ctx_s): Use bit fields for flags.
* scd/ccid-driver.c (CCID_MAX_BUF): New.  Only for OpenPGPcard.
(struct ccid_driver_s): New field of max_ccid_msglen.
 Remove ifsd field.
(parse_ccid_descriptor): Initialize max_ccid_msglen.
(ccid_transceive_apdu_level): Implement sending extended APDU in
chain of CCID message.

--

With this patch, we won't need PC/SC library/service any more.
GnuPG-bug-id: 1947
(backported from 2.1 commit 971d558e86)
2015-04-15 16:09:08 +09:00
Werner Koch 93910b5b8d gpgparsemail: Fix last commit (3f2bdac)
* tools/rfc822parse.c (parse_field): Replace break by goto.
--

Brown paper bag bug: Changing an IF to a WHILE inside another loop
requires to fix the inner break.

Reported-by: Hanno Böck
Signed-off-by: Werner Koch <wk@gnupg.org>
(backported from 2.1 commit 9433661419)
2015-04-15 16:08:32 +09:00
Werner Koch de7f7b98df gpgparsemail: Fix case of zero length continuation lines.
* tools/rfc822parse.c (parse_field): Loop after continuation line.
--

Using header lines like

  Name:[lf]
  [space][lf]
  [lf]

resulted in running into the "(s2 = strchr (delimiters2, *s)" branch
and inserting a new token for the empty continuation line.  This also
led to one byte read after the string which is what Hanno figured.
The new code should handle empty continuation lines correct.

Reported-by: Hanno Böck
Signed-off-by: Werner Koch <wk@gnupg.org>
(backported from 2.1 commit 3fbeba64a8)
2015-04-15 16:07:56 +09:00