Package: gnupg2 / 2.0.26-6+deb8u2

Metadata

Package Version Patches format
gnupg2 2.0.26-6+deb8u2 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
01 gnupg2 rename.diff | (download)

configure.ac | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

---
fix_760273.patch | (download)

doc/gnupg.info-1 | 2 1 + 1 - 0 !
doc/gpg.texi | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

---
0005 Update POT file.patch | (download)

po/gnupg2.pot | 405 208 + 197 - 0 !
1 file changed, 208 insertions(+), 197 deletions(-)

 update pot file

The 0001-warn-about-but-don-t-fail-on-scdaemon-options-in-gpg.patch
patch adds two new strings.

0006 Update PO files.patch | (download)

po/be.po | 407 207 + 200 - 0 !
po/ca.po | 410 207 + 203 - 0 !
po/cs.po | 406 207 + 199 - 0 !
po/da.po | 408 207 + 201 - 0 !
po/de.po | 403 207 + 196 - 0 !
po/el.po | 410 207 + 203 - 0 !
po/en@boldquot.po | 415 213 + 202 - 0 !
po/en@quot.po | 403 207 + 196 - 0 !
po/eo.po | 409 207 + 202 - 0 !
po/es.po | 434 207 + 227 - 0 !
po/et.po | 410 207 + 203 - 0 !
po/fi.po | 410 207 + 203 - 0 !
po/fr.po | 409 207 + 202 - 0 !
po/gl.po | 410 207 + 203 - 0 !
po/hu.po | 410 207 + 203 - 0 !
po/id.po | 410 207 + 203 - 0 !
po/it.po | 410 207 + 203 - 0 !
po/ja.po | 405 209 + 196 - 0 !
po/nb.po | 410 207 + 203 - 0 !
po/pl.po | 407 207 + 200 - 0 !
po/pt.po | 409 207 + 202 - 0 !
po/pt_BR.po | 409 207 + 202 - 0 !
po/ro.po | 412 207 + 205 - 0 !
po/ru.po | 427 207 + 220 - 0 !
po/sk.po | 410 207 + 203 - 0 !
po/sv.po | 429 207 + 222 - 0 !
po/tr.po | 427 207 + 220 - 0 !
po/uk.po | 408 207 + 201 - 0 !
po/zh_CN.po | 412 207 + 205 - 0 !
po/zh_TW.po | 409 207 + 202 - 0 !
30 files changed, 6218 insertions(+), 6130 deletions(-)

 update po files

The 0001-warn-about-but-don-t-fail-on-scdaemon-options-in-gpg.patch
patch adds two new strings, many strings lines also changed, thus the
noise in the comments.

0007 Update French translation.patch | (download)

po/fr.po | 308 156 + 152 - 0 !
1 file changed, 156 insertions(+), 152 deletions(-)

 update french translation

0008 Update Ukrainian translation.patch | (download)

po/uk.po | 79 42 + 37 - 0 !
1 file changed, 42 insertions(+), 37 deletions(-)

 update ukrainian translation

0009 Update German translation.patch | (download)

po/de.po | 11 7 + 4 - 0 !
1 file changed, 7 insertions(+), 4 deletions(-)

 update german translation

0010 Update Danish translation.patch | (download)

po/da.po | 52 30 + 22 - 0 !
1 file changed, 30 insertions(+), 22 deletions(-)

 update danish translation

0011 Update Japanese translation.patch | (download)

po/ja.po | 64 34 + 30 - 0 !
1 file changed, 34 insertions(+), 30 deletions(-)

 update japanese translation

0012 Update Chinese traditional translation.patch | (download)

po/zh_TW.po | 97 50 + 47 - 0 !
1 file changed, 50 insertions(+), 47 deletions(-)

 update chinese (traditional) translation

0013 Update Russian translation.patch | (download)

po/ru.po | 2526 1264 + 1262 - 0 !
1 file changed, 1264 insertions(+), 1262 deletions(-)

 update russian translation

0014 Update Polish translation.patch | (download)

po/pl.po | 2941 1470 + 1471 - 0 !
1 file changed, 1470 insertions(+), 1471 deletions(-)

 update polish translation

0015 Update Spanish translation.patch | (download)

po/es.po | 2501 1253 + 1248 - 0 !
1 file changed, 1253 insertions(+), 1248 deletions(-)

 update spanish translation

0016 New Dutch translation.patch | (download)

po/LINGUAS | 1 1 + 0 - 0 !
po/nl.po | 9425 9425 + 0 - 0 !
2 files changed, 9426 insertions(+)

 new dutch translation

0002 gpg Allow for positional parameters in the passphras.patch | (download)

g10/passphrase.c | 35 12 + 23 - 0 !
1 file changed, 12 insertions(+), 23 deletions(-)

 [patch 02/31] gpg: allow for positional parameters in the passphrase
 prompt.

* g10/passphrase.c (passphrase_get): Replace sprintf by xasprintf.
--

Without that at least the French translation does not always work
because it requires positional parameters.  Windows for example does
not support them as they are not defined by C99 but by POSIX.

0004 gpg Need to init the trustdb for import.patch | (download)

g10/trustdb.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch 04/31] gpg: need to init the trustdb for import.

* g10/trustdb.c (clear_ownertrusts): Init trustdb.

--

This was fixed in 1.4 branch in commit
23191d7851eae2217ecdac6484349849a24fd94a but was not applied to the
2.0 branch that exhibits the same problem. This is actually a hack
to fix a bug introduced with commit 2528178.

GnuPG-bug-id: 1622

0005 gpg Warn about but don t fail on scdaemon options in.patch | (download)

g10/gpg.c | 36 32 + 4 - 0 !
g10/main.h | 2 2 + 0 - 0 !
g10/misc.c | 14 14 + 0 - 0 !
3 files changed, 48 insertions(+), 4 deletions(-)

 [patch 05/31] gpg: warn about (but don't fail) on scdaemon options in
 gpg.conf.

* g10/gpg.c: Add config options that should belong in scdaemon.conf
* g10/main.h, g10/misc.c (obsolete_scdaemon_option): New.

--

In gpg2, the following options are only relevant for scdaemon:

 reader-port
 ctapi-driver
 pcsc-driver
 disable-ccid

but in gpg1, they are options for gpg itself.

Some users of gpg1 might have these options in their
~/.gnupg/gpg.conf, which causes gpg2 to fail hard if it reads that
config file.

gpg2 should not fail hard, though giving a warning (and suggesting a
move to scdaemon.conf) seems OK.

This patch does *not* reintroduce any documentation for these options
in gpg.texi, even to indicate that they are "dummy" options, since
scdaemon.texi contains the appropriate documentation.

Debian-bug-id: 762844

Program names factored out from obsolete_scdaemon_option to make
reuse without new translations easier. -wk

This is a backport of commit 371c2b14b0347209efd23b4e54e1981a12d7aeab
with parts of 20c6da50d4f6264d26d113d7de606971f719a0ca but without those
which would change existing translated strings. -wk

0007 doc Update the file OpenPGP.patch | (download)

doc/OpenPGP | 21 10 + 11 - 0 !
1 file changed, 10 insertions(+), 11 deletions(-)

 [patch 07/31] doc: update the file openpgp

--

It should actually be completey reworked but for now I added just a
few notes.

0008 gpg Default to SHA 256 for all signature types on RS.patch | (download)

g10/main.h | 2 1 + 1 - 0 !
g10/sign.c | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 [patch 08/31] gpg: default to sha-256 for all signature types on rsa
 keys.

* g10/main.h (DEFAULT_DIGEST_ALGO): Use SHA256 in --gnupg and SHA1 in
strict RFC or PGP modes.
* g10/sign.c (make_keysig_packet): Use DEFAULT_DIGEST_ALGO also for
RSA key signatures.
--

(Backported from commit d33246700578cddd1cb8ed8164cfbba50aba4ef3)

0009 gpg Avoid duplicate declaration of no sk comments no.patch | (download)

g10/gpg.c | 3 0 + 3 - 0 !
1 file changed, 3 deletions(-)

 [patch 09/31] gpg: avoid duplicate declaration of {no-,}sk-comments
 noops.

* g10/gpg.c: Cleanup argument parsing.

--

With c76117f8b0165fe5cec5e7f234f55f5a4cd7f0ab, the GnuPG 2.0.x branch
accidentally introduced a second (identical) argument parser for both
--sk-comments, and for --no-sk-comments.

This caused short versions (e.g. omitting the trailing "s", as gpgme
does) of either command to fail with:

   gpg: option "--sk-comment" is ambiguous

0010 gpg compress sigs and compress keys are not no ops i.patch | (download)

g10/gpg.c | 2 0 + 2 - 0 !
1 file changed, 2 deletions(-)

 [patch 10/31] gpg: --compress-sigs and --compress-keys are not no-ops
 in 2.0

* g10/gpg.c: Cleanup argument parsing.

--

c76117f8b0165fe5cec5e7f234f55f5a4cd7f0ab mistakenly marked
compress-sigs and compress-keys as no-ops on the 2.0.x branch.

These options still have an effect on the 2.0.x branch, and the
duplicate declaration also causes the gpg argument parser to fail when
shortened versions of the option are present, like:

  gpg: option "--compress-k" is ambiguous

0012 gpg Add build and runtime support for larger RSA key.patch | (download)

configure.ac | 17 17 + 0 - 0 !
doc/gpg.texi | 9 9 + 0 - 0 !
g10/gpg.c | 22 21 + 1 - 0 !
g10/keygen.c | 5 3 + 2 - 0 !
g10/options.h | 1 1 + 0 - 0 !
5 files changed, 51 insertions(+), 3 deletions(-)

 [patch 12/31] gpg: add build and runtime support for larger rsa keys

* configure.ac: Added --enable-large-secmem option.
* g10/options.h: Add opt.flags.large_rsa.
* g10/gpg.c: Contingent on configure option: adjust secmem size,
add gpg --enable-large-rsa, bound to opt.flags.large_rsa.
* g10/keygen.c: Adjust max RSA size based on opt.flags.large_rsa
* doc/gpg.texi: Document --enable-large-rsa.

--

This is a cherry-pick of 534e2876acc05f9f8d9b54c18511fe768d77dfb5 from
STABLE-BRANCH-1-4 against STABLE-BRANCH-2-0

Some older implementations built and used RSA keys up to 16Kib, but
the larger secret keys now fail when used by more recent GnuPG, due to
secure memory limitations.

Building with ./configure --enable-large-secmem will make gpg
capable of working with those secret keys, as well as permitting the
use of a new gpg option --enable-large-rsa, which let gpg generate RSA
keys up to 8Kib when used with --batch --gen-key.

Debian-bug-id: 739424

Minor edits by wk.

GnuPG-bug-id: 1732

0013 gpg Avoid using cached MD5 signature status.patch | (download)

g10/keyring.c | 24 17 + 7 - 0 !
g10/main.h | 7 4 + 3 - 0 !
g10/misc.c | 16 16 + 0 - 0 !
g10/sig-check.c | 17 5 + 12 - 0 !
4 files changed, 42 insertions(+), 22 deletions(-)

 [patch 13/31] gpg: avoid using cached md5 signature status.

* g10/sig-check.c (check_key_signature2): Avoid using a cached MD5
signature status.
* g10/keyring.c (keyring_get_keyblock): Ditto.
(write_keyblock): Ditto.

* g10/sig-check.c (do_check): Move reject warning to ...
* g10/misc.c (print_md5_rejected_note): new.
--

Modified by dkg (2015-01-04) to avoid needless whitespace transformations.


0014 gpg Show v3 key fingerprints as all zero.patch | (download)

g10/keyid.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 14/31] gpg: show v3 key fingerprints as all zero.

* g10/keyid.c (fingerprint_from_pk): Show v3 fingerprints as all zero.
--

MD5 is considered broken for a long time now.  To make it easier for
users to notice that a listing shows a v3 key, the fingerprint is now
displayed as 16 zero bytes unless --allow-weak-digest-algos is active.

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

0015 gpg Add import option keep ownertrust.patch | (download)

doc/gpg.texi | 9 9 + 0 - 0 !
g10/import.c | 15 13 + 2 - 0 !
g10/options.h | 1 1 + 0 - 0 !
3 files changed, 23 insertions(+), 2 deletions(-)

 [patch 15/31] gpg: add import option "keep-ownertrust".

* g10/options.h (IMPORT_KEEP_OWNERTTRUST): New.
* g10/import.c (parse_import_options): Add "keep-ownertrust".
(import_one): Act upon new option.
--

This option is in particular useful to convert from a pubring.gpg to
the new pubring.kbx in GnuPG 2.1 or vice versa:

gpg1 --export | gpg2 --import-options keep-ownertrust --import

(cherry-picked from commit ffc2307843ce6c4ac3c8d99ba8c70ffa1ae28e39)

0016 gpg Make the use of verify FILE for detached sigs ha.patch | (download)

g10/main.h | 3 2 + 1 - 0 !
g10/mainproc.c | 38 38 + 0 - 0 !
g10/openfile.c | 83 56 + 27 - 0 !
g10/plaintext.c | 30 19 + 11 - 0 !
4 files changed, 115 insertions(+), 39 deletions(-)

 [patch 16/31] gpg: make the use of "--verify file" for detached sigs
 harder.

* g10/openfile.c (open_sigfile): Factor some code out to ...
(get_matching_datafile): new function.
* g10/plaintext.c (hash_datafiles): Do not try to find matching file
in batch mode.
* g10/mainproc.c (check_sig_and_print): Print a warning if a possibly
matching data file is not used by a standard signatures.
--

Allowing to use the abbreviated form for detached signatures is a long
standing bug which has only been noticed by the public with the
release of 2.1.0.  :-(

What we do is to remove the ability to check detached signature in
--batch using the one file abbreviated mode.  This should exhibit
problems in scripts which use this insecure practice.  We also print a
warning if a matching data file exists but was not considered because
the detached signature was actually a standard signature:

  gpgv: Good signature from "Werner Koch (dist sig)"
  gpgv: WARNING: not a detached signature; \
  file 'gnupg-2.1.0.tar.bz2' was NOT verified!

We can only print a warning because it is possible that a standard
signature is indeed to be verified but by coincidence a file with a
matching name is stored alongside the standard signature.

Reported-by: Simon Nicolussi (to gnupg-users on Nov 7)
Signed-off-by: Werner Koch <wk@gnupg.org>

(backported from commit 69384568f66a48eff3968bb1714aa13925580e9f)
(modified by dkg 2015-01-04 to avoid a needless whitespace change)

0018 gpg Fix a NULL deref for invalid input data.patch | (download)

g10/mainproc.c | 12 9 + 3 - 0 !
1 file changed, 9 insertions(+), 3 deletions(-)

 [patch 18/31] gpg: fix a null-deref for invalid input data.

* g10/mainproc.c (proc_encrypted): Take care of canceled passpharse
entry.
--

GnuPG-bug-id: 1761
Signed-off-by: Werner Koch <wk@gnupg.org>

(backported from commit 32e85668b82f6fbcb824eea9548970804fb41d9e)

0019 gpg Fix off by one read in the attribute subpacket p.patch | (download)

g10/parse-packet.c | 8 8 + 0 - 0 !
1 file changed, 8 insertions(+)

 [patch 19/31] gpg: fix off-by-one read in the attribute subpacket
 parser.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* g10/parse-packet.c (parse_attribute_subpkts): Check that the
attribute packet is large enough for the subpacket type.
--

Reported-by: Hanno Böck
Signed-off-by: Werner Koch <wk@gnupg.org>

(backported from commit 0988764397f99db4efef1eabcdb8072d6159af76)

0020 gpg Fix use of uninit.value in listing sig subpkts.patch | (download)

g10/parse-packet.c | 6 5 + 1 - 0 !
1 file changed, 5 insertions(+), 1 deletion(-)

 [patch 20/31] gpg: fix use of uninit.value in listing sig subpkts.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* g10/parse-packet.c (dump_sig_subpkt): Print regex subpacket
sanitized.
--

We may not use "%s" to print an arbitrary buffer.  At least "%.*s"
should have been used.  However, it is in general preferable to escape
control characters while printf user data.

Reported-by: Hanno Böck
Signed-off-by: Werner Koch <wk@gnupg.org>

(backported from commit 596ae9f5433ca3b0e01f7acbe06fd2e424c42ae8)

0031 gpg release DEK soon after its use.patch | (download)

g10/keygen.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 31/31] gpg: release dek soon after its use.

* g10/keygen.c (generate_subkeypair): Release DEK soon.

--

This fixes the out_of_core error in the test case of adding
RSA-4096 subkey to RSA-4096 primary key with configuration:

    s2k-cipher-algo S10

Debian-bug-id: 772780

Cherry-picked da66ad5bba4215b9ddd0cb927a89aa75355632aa from
STABLE-BRANCH-1-4 branch.

0032 scd Fix possibly inhibited checkpin of the admin pin.patch | (download)

scd/app-openpgp.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 32/56] scd: fix possibly inhibited checkpin of the admin pin.

* scd/app-openpgp.c (do_check_pin): Do not check a byte of a released
buffer.

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

0033 gpg Fix possible read of unallocated memory.patch | (download)

g10/parse-packet.c | 11 7 + 4 - 0 !
1 file changed, 7 insertions(+), 4 deletions(-)

 [patch 33/56] gpg: fix possible read of unallocated memory

* g10/parse-packet.c (can_handle_critical): Check content length
before calling can_handle_critical_notation.
--

The problem was found by Jan Bee and gniibe proposed the used fix.
Thanks.

This bug can't be exploited: Only if the announced length of the
notation is 21 or 32 a memcmp against fixed strings using that length
would be done.  The compared data is followed by the actual signature
and thus it is highly likely that not even read of unallocated memory
will happen.  Nevertheless such a bug needs to be fixed.

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

0034 gpgsm Return NULL on fail.patch | (download)

sm/gpgsm.c | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 [patch 34/56] gpgsm: return null on fail

* sm/gpgsm.c (parse_keyserver_line): Set SERVER to NULL.

--

Cherry-pick of abd5f6752d693b7f313c19604f0723ecec4d39a6.

Reported-by: Joshua Rogers <git@internot.info>

  "If something inside the ldapserver_parse_one function failed,
   'server' would be freed, then returned, leading to a
   use-after-free.  This code is likely copied from sm/gpgsm.c, which
   was also susceptible to this bug."

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

0035 doc Fix memory leak in yat2m.patch | (download)

doc/yat2m.c | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 [patch 35/56] doc: fix memory leak in yat2m.

* doc/yat2m.c (write_th): Free NAME.
--

Reported-by: Joshua Rogers <git@internot.info>

0036 gpgkey2ssh clean up varargs.patch | (download)

tools/gpgkey2ssh.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch 36/56] gpgkey2ssh: clean up varargs

* tools/gpgkey2ssh.c (key_to_blob) : ensure that va_end is called.

--

stdarg(3) says:
       Each invocation of va_start() must be matched by a
       corresponding invocation of va_end() in the same function.

Observed by Joshua Rogers <honey@internot.info>

Debian-Bug-Id: 773415

0037 avoid future chance of using uninitialized memory.patch | (download)

common/iobuf.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 37/56] avoid future chance of using uninitialized memory

* common/iobuf.c: (iobuf_open): initialize len

--

In iobuf_open, IOBUFCTRL_DESC and IOBUFCTRL_INIT commands are invoked
(via file_filter()) on fcx, passing in a pointer to an uninitialized
len.

With these two commands, file_filter doesn't actually do anything with
the value of len, so there's no actual risk of use of uninitialized
memory in the code as it stands.

However, some static analysis tools might flag this situation with a
warning, and initializing the value doesn't hurt anything, so i think
this trivial cleanup is warranted.

Debian-Bug-Id: 773469

0038 scd Avoid double free on error condition in scd.patch | (download)

scd/command.c | 6 2 + 4 - 0 !
1 file changed, 2 insertions(+), 4 deletions(-)

 [patch 38/56] scd: avoid double-free on error condition in scd

* scd/command.c (cmd_readkey): avoid double-free of cert

--

When ksba_cert_new() fails, cert will be double-freed.

Debian-Bug-Id: 773471

Original patch changed by wk to do the free only at leave.

0039 sm Avoid double free on iconv failure.patch | (download)

agent/minip12.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch 39/56] sm: avoid double-free on iconv failure

* sm/minip12.c: (p12_build) if jnlib_iconv_open fails, avoid
double-free of pwbuf.

--

Observed by Joshua Rogers <honey@internot.info>, who proposed a
0040 tools Free variable before return.patch | (download)

tools/gpgconf-comp.c | 5 4 + 1 - 0 !
1 file changed, 4 insertions(+), 1 deletion(-)

 [patch 40/56] tools: free variable before return

* tools/gpgconf-comp.c: Free 'dest_filename' before it is returned
upon error.
--

Signed-off-by: Joshua Rogers <git@internot.info>

0041 gpgconf Fix validity check for UINT32 values.patch | (download)

tools/gpgconf-comp.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 41/56] gpgconf: fix validity check for uint32 values.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* tools/gpgconf-comp.c (option_check_validity): Enable check for
UINT32.
--

Reported-by: Günther Noack <gnoack@google.com>

This is actually a bug which inhibited the checking of values of type
UINT32.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 3f6abb57a7b5e54b593c5775c8f7a07d61119705)

0042 Remove incorrect expression leading to errors.patch | (download)

scd/ccid-driver.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 42/56] remove incorrect expression leading to errors.

* scd/ccid-driver.c (send_escape_cmd): Fix setting of 'rc'.
--

Variable 'rc' in send_escape_cmd was overwritten before it was
returned, leading to incorrect computation.

Signed-off-by: Joshua Rogers <git@internot.info>

[Log entry reformatted - wk]

0047 gpg Allow predefined names as answer to the keygen.a.patch | (download)

doc/DETAILS | 28 28 + 0 - 0 !
g10/keygen.c | 22 12 + 10 - 0 !
2 files changed, 40 insertions(+), 10 deletions(-)

 [patch 47/56] gpg: allow predefined names as answer to the
 keygen.algo prompt.

* g10/keygen.c (ask_algo): Add list of strings.

--
Signed-off-by: Werner Koch <wk@gnupg.org>
(backported from commit b1d5ed6ac842469afcb84868d0f6641dc286a6c7)

0048 Avoid double close in unusual dotlock situations.patch | (download)

jnlib/dotlock.c | 58 32 + 26 - 0 !
1 file changed, 32 insertions(+), 26 deletions(-)

 [patch 48/56] avoid double-close in unusual dotlock situations.

* jnlib/dotlock.c (create_dotlock): Avoid double close due to EINTR.
--

close(2) says:

  close() should not be retried after an EINTR since this may cause a
  reused descriptor from another thread to be closed.

(backported from commit 628b111fa679612e23c0d46505b1ecbbf091897d)

Debian-Bug-Id: 773423
Signed-off-by: Werner Koch <wk@gnupg.org>

0049 gpg Limit the size of key packets to a sensible valu.patch | (download)

g10/parse-packet.c | 21 18 + 3 - 0 !
1 file changed, 18 insertions(+), 3 deletions(-)

 [patch 49/56] gpg: limit the size of key packets to a sensible value.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* g10/parse-packet.c (MAX_KEY_PACKET_LENGTH): New.
(MAX_UID_PACKET_LENGTH): New.
(MAX_COMMENT_PACKET_LENGTH): New.
(MAX_ATTR_PACKET_LENGTH): New.
(parse_key): Limit the size of a key packet to 256k.
(parse_user_id): Use macro for the packet size limit.
(parse_attribute): Ditto.
(parse_comment): Ditto.
--

Without that it is possible to force gpg to allocate large amounts of
memory by using a bad encoded MPI.  This would be an too easy DoS.
Another way to mitigate would be to change the MPI read function to
allocate memory dynamically while reading the MPI.  However, that
complicates and possibly slows down the code.  A too large key packet
is in any case a sign for broken data and thus gpg should not use it.

Reported-by: Hanno Böck
GnuPG-bug-id: 1823
Signed-off-by: Werner Koch <wk@gnupg.org>

(back ported from commit 382ba4b137b42d5f25a7e256bb7c053ee5ac7b64)

0050 kbx Fix resource leak.patch | (download)

kbx/keybox-update.c | 37 32 + 5 - 0 !
1 file changed, 32 insertions(+), 5 deletions(-)

 [patch 50/56] kbx: fix resource leak.

* kbx/keybox-update.c (blob_filecopy): Fix resource leak.  On error
return, 'fp' and 'newfp' was never closed.

--

Signed-off-by: Joshua Rogers <git@internot.info>

[Log entry reformatted, and added more fixes - gniibe]

(cherry picked from commit 7db6c82cec49b7c56c403a8ea98364086baf75f3)

0051 gpg Fix a NULL deref due to empty ring trust packets.patch | (download)

g10/parse-packet.c | 8 5 + 3 - 0 !
1 file changed, 5 insertions(+), 3 deletions(-)

 [patch 51/56] gpg: fix a null-deref due to empty ring trust packets.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* g10/parse-packet.c (parse_trust): Always allocate a packet.
--

Reported-by: Hanno Böck <hanno@hboeck.de>
Signed-off-by: Werner Koch <wk@gnupg.org>

(back ported from commit 39978487863066e59bb657f5fe4e8baab510da7e)

0052 gpg Fix a NULL deref in export due to invalid packet.patch | (download)

g10/build-packet.c | 3 2 + 1 - 0 !
1 file changed, 2 insertions(+), 1 deletion(-)

 [patch 52/56] gpg: fix a null-deref in export due to invalid packet
 lengths.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* g10/build-packet.c (write_fake_data): Take care of a NULL stored as
opaque MPI.
--

Reported-by: Hanno Böck <hanno@hboeck.de>

(back ported from commit 0835d2f44ef62eab51fce6a927908f544e01cf8f)

0053 gpg Prevent an invalid memory read using a garbled k.patch | (download)

g10/keyring.c | 24 21 + 3 - 0 !
1 file changed, 21 insertions(+), 3 deletions(-)

 [patch 53/56] gpg: prevent an invalid memory read using a garbled
 keyring.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* g10/keyring.c (keyring_get_keyblock): Whitelist allowed packet
types.
--

The keyring DB code did not reject packets which don't belong into a
keyring.  If for example the keyblock contains a literal data packet
it is expected that the processing code stops at the data packet and
reads from the input stream which is referenced from the data packets.
Obviously the keyring processing code does not and cannot do that.
However, when exporting this messes up the IOBUF and leads to an
invalid read of sizeof (int).

We now skip all packets which are not allowed in a keyring.

Reported-by: Hanno Böck <hanno@hboeck.de>

(back ported from commit f0f71a721ccd7ab9e40b8b6b028b59632c0cc648)

0054 doc Change remaining http links to gnupg.org to http.patch | (download)

doc/gpg.texi | 2 1 + 1 - 0 !
g10/misc.c | 2 1 + 1 - 0 !
g10/sig-check.c | 2 1 + 1 - 0 !
3 files changed, 3 insertions(+), 3 deletions(-)

 [patch 54/56] doc: change remaining http links to gnupg.org to https

--
GnuPG-bug-id: 1830

0056 Use inline functions to convert buffer data to scala.patch | (download)

common/iobuf.c | 3 2 + 1 - 0 !
g10/build-packet.c | 6 3 + 3 - 0 !
g10/getkey.c | 17 9 + 8 - 0 !
g10/keygen.c | 14 6 + 8 - 0 !
g10/keyid.c | 32 13 + 19 - 0 !
g10/main.h | 1 0 + 1 - 0 !
g10/misc.c | 11 0 + 11 - 0 !
g10/parse-packet.c | 39 20 + 19 - 0 !
g10/tdbio.c | 20 10 + 10 - 0 !
g10/trustdb.c | 2 1 + 1 - 0 !
include/host2net.h | 100 85 + 15 - 0 !
kbx/keybox-dump.c | 13 3 + 10 - 0 !
kbx/keybox-openpgp.c | 7 3 + 4 - 0 !
kbx/keybox-search.c | 13 3 + 10 - 0 !
kbx/keybox-update.c | 9 4 + 5 - 0 !
scd/apdu.c | 39 17 + 22 - 0 !
scd/app-openpgp.c | 3 2 + 1 - 0 !
scd/ccid-driver.c | 3 2 + 1 - 0 !
scd/pcsc-wrapper.c | 5 3 + 2 - 0 !
tools/ccidmon.c | 2 1 + 1 - 0 !
20 files changed, 187 insertions(+), 152 deletions(-)

 [patch] use inline functions to convert buffer data to scalars.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* include/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--

This fixes sign extension on shift problems.  Hanno Böck found a case
with an invalid read due to this problem.  To fix that almost all uses
of "<< 24" and "<< 8" are changed by this patch to use an inline
function from host2net.h.

(back ported from commit 2183683bd633818dd031b090b5530951de76f392)

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

0057 gpg Fix segv due to NULL value stored as opaque MPI.patch | (download)

g10/build-packet.c | 6 4 + 2 - 0 !
g10/keyid.c | 16 10 + 6 - 0 !
2 files changed, 14 insertions(+), 8 deletions(-)

 [patch] 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 76c8122adfed0f0f443cce7bda702ba2b39661b3 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 0835d2f44ef62eab51fce6a927908f544e01cf8f.

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

With TESTDATA being below after unpacking.


0058 gpgv Tweak default options for extra security.patch | (download)

g10/gpgv.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch 1/2] gpgv: tweak default options for extra security.

* g10/gpgv.c (main): Set opt.no_sig _cache, so that it doesn't depend on
cached status.  Similarly, set opt.flags.require_cross_cert for backsig
validation for subkey signature.

--

(backport of master
commit e32c575e0f3704e7563048eea6d26844bdfc494b)

It is common that an organization distributes binary keyrings with
signature cache (Tag 12, Trust Packet) and people use gpgv to validate
signature with such keyrings.  In such a use case, it is possible that
the key validation itself is skipped.

For the purpose of gpgv validation of signatures, we should not depend
on signature cache in keyrings (if any), but we should validate the key
by its self signature for primary key, and back signature for subkey.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

0059 g10 Fix checking key for signature validation.patch | (download)

g10/sig-check.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 [patch 2/2] g10: fix checking key for signature validation.

* g10/sig-check.c (signature_check2): Not only subkey, but also primary
key should have flags.valid=1.

--

(backport of master
commit 6f284e6ed63f514b15fe610f490ffcefc87a2164)

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

0060 gpg Sanitize diagnostic with the original file name.patch | (download)

g10/mainproc.c | 6 5 + 1 - 0 !
1 file changed, 5 insertions(+), 1 deletion(-)

 gpg: sanitize diagnostic with the original file name.