[git] GnuPG - branch, master, updated. gnupg-2.1.16-26-g47b8b9e
by Justus Winter
cvs at cvs.gnupg.org
Mon Nov 28 13:52:03 CET 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via 47b8b9e2ce5af7fba117ae0b00e10bec414dcfb0 (commit)
via 4db9a425644dccaf81b51ebc97b32a9cc21941a4 (commit)
via cc1d21342659a7def5d662d0547579f9e0d3b109 (commit)
from b89e63e5c326af71470124b410e6429cbd2b5c43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 47b8b9e2ce5af7fba117ae0b00e10bec414dcfb0
Author: Justus Winter <justus at g10code.com>
Date: Mon Nov 28 13:47:07 2016 +0100
tests: Add test for the ssh key export.
* tests/openpgp/Makefile.am (XTESTS): Add new test.
(sample_keys): Add new files.
* tests/openpgp/samplekeys/authenticate-only.pub.asc: New file.
* tests/openpgp/samplekeys/authenticate-only.sec.asc: Likewise.
* tests/openpgp/ssh-export.scm: Likewise.
GnuPG-bug-id: 2848
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index 532cdb3..3cdf3d1 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -81,6 +81,7 @@ XTESTS = \
default-key.scm \
export.scm \
ssh-import.scm \
+ ssh-export.scm \
quick-key-manipulation.scm \
key-selection.scm \
issue2015.scm \
@@ -186,7 +187,9 @@ sample_keys = samplekeys/README \
samplekeys/ssh-ecdsa.key \
samplekeys/ssh-ed25519.key \
samplekeys/ssh-rsa.key \
- samplekeys/issue2346.gpg
+ samplekeys/issue2346.gpg \
+ samplekeys/authenticate-only.pub.asc \
+ samplekeys/authenticate-only.sec.asc
sample_msgs = samplemsgs/issue2419.asc
diff --git a/tests/openpgp/samplekeys/authenticate-only.pub.asc b/tests/openpgp/samplekeys/authenticate-only.pub.asc
new file mode 100644
index 0000000..a08a003
--- /dev/null
+++ b/tests/openpgp/samplekeys/authenticate-only.pub.asc
@@ -0,0 +1,31 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mQENBFg8F68BCAC5VS/59Nrg5mw+wEAnk/vi0CGI+K5rGTmyAruy/aiS4kYfUJiE
+Pq/JZYCeNQ9GTbJN5M+Fiv1bhw6xeEfl4FAC/A0Uo39fvUSLJH2V+8lT3GxXt8KR
+Yx8MvotvoKiG1DRvgnwRh1qibX6+htJahPwHDViUuFz0ZeEPWiCwuoMOELmiTsuE
+VZbQsv08BwCOzIc3M8s63TtwMCUe+MBhqfRjEu6/Gt7miuGGVFXB96ao2O9u1HsR
+7cUjgVQp6JwGLgIIijjy167Ms+fKZetqA9tzu1C1SAtNYiqmAUoqGG1YEjS7oApo
+AKmHD+LGCMUPg5d6bhw+NyHjDAFWJEYv3kG3ABEBAAG0NVRlc3QgS2V5IChkbyBu
+b3QgdXNlKSA8YXV0aGVudGljYXRlLW9ubHlAZXhhbXBsZS5vcmc+iQFOBBMBCAA4
+FiEEkn7zd/0aG295XkDAKoeRfY/7pJ8FAlg8F68CGwEFCwkIBwIGFQgJCgsCBBYC
+AwECHgECF4AACgkQKoeRfY/7pJ9+zAf9FVZknDCWCNY42+RIR36fq2l1Gs8KfMsX
+rNXtfYPtLqioP8fz2LE0LoudSsZMLVygonPG0ZAxdIUHXcFdUqPrEzs4fEyR4xae
+OSxui2Q/u6+9bi7eilYYzVNRWkuyx2TrRQZEjMXMnuJcWptGbRWs/ipRUZBHWfLl
+2udLl+0TRIL7hni06xVCHbwE5szcLoyzzvIowGVADXFqeG7nty7uRNZNAD+ZWMH2
+J0vspZlUSVi7z1VygzDI3U42SMJmVqnRmICsB3QLI8Ns4nxWXO2z8fheSFcrP+LA
+cY3W6JgnLCzvyuogxnWmd4fzr1iB3E2Hcy/sr0cgQ5wtuseQRhmTlrkBDQRYPBfZ
+AQgAtKcbBYrIqh3cRTqyZjMxw492RVQoFawYmpr1bQ4HphVGnT4IhJZQ4DAm1JJZ
+QjzwDQiZMc1wD9Om6UC/g8gUBuFCpLCobwBzjH4an/G3Cfa8zGz5ANAROo5i5T1j
+vgoFEFdVue/GpAmMNixz+0ItQBh9jiOC6IYk1yyv/OsTzsj6AHnH0XiDpGoTNkca
+tb6Mu1VcXTMNf620Mxj6c7WE7awxL6MwKIa7XQSgXaO+JnbB+5Szz1wZ1ZhlnDp3
+KOurlfcXIbZirEaqmRByb+V21Dj3icXOJEj1RUbyVNqBS8rhw17kSxcehw/6ZAMW
+ehDmhXO98VVUknS0Mf+OJBi2JwARAQABiQE2BBgBCAAgFiEEkn7zd/0aG295XkDA
+KoeRfY/7pJ8FAlg8F9kCGyAACgkQKoeRfY/7pJ+sawf/eSjxxAglAdolF9lK070u
+VmMgq4GFPqJ3RqJPUFjwEFFSYLXkiALnMGXDSmOfPqCQ4c+PWwumFhKCz4MXVDD8
+x6mi9Z+HlEwIMaCnckrSTuQ5OgwO/6vkhz42OcgMZ3WQnWfNVM8jbNP9vX1vroPe
+HLFaPGy9KJMM0Z/hlCIIeyK/a90zWlT5UMfRoqNQRbY/iiYdmpvf69I9PobGVbo/
+7ahZTumPWwjiGOztNXeuo5UUaAVVxMQBYKp2w3wil2sHzYfTfYUSMyh+oUFx4Xlz
+WF3bLzsafRaeuK1h5+JuvIcimvU5zWZtn0hOpiIXpZOoJvvM9r5D4ZRT5UX2blQ8
+Pw==
+=vt5C
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/tests/openpgp/samplekeys/authenticate-only.sec.asc b/tests/openpgp/samplekeys/authenticate-only.sec.asc
new file mode 100644
index 0000000..109a7a1
--- /dev/null
+++ b/tests/openpgp/samplekeys/authenticate-only.sec.asc
@@ -0,0 +1,60 @@
+-----BEGIN PGP PRIVATE KEY BLOCK-----
+
+lQPGBFg8F68BCAC5VS/59Nrg5mw+wEAnk/vi0CGI+K5rGTmyAruy/aiS4kYfUJiE
+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n6xrB/95KPHECCUB2iUX2UrT
+vS5WYyCrgYU+ondGok9QWPAQUVJgteSIAucwZcNKY58+oJDhz49bC6YWEoLPgxdU
+MPzHqaL1n4eUTAgxoKdyStJO5Dk6DA7/q+SHPjY5yAxndZCdZ81UzyNs0/29fW+u
+g94csVo8bL0okwzRn+GUIgh7Ir9r3TNaVPlQx9Gio1BFtj+KJh2am9/r0j0+hsZV
+uj/tqFlO6Y9bCOIY7O01d66jlRRoBVXExAFgqnbDfCKXawfNh9N9hRIzKH6hQXHh
+eXNYXdsvOxp9Fp64rWHn4m68hyKa9TnNZm2fSE6mIhelk6gm+8z2vkPhlFPlRfZu
+VDw/
+=vLFX
+-----END PGP PRIVATE KEY BLOCK-----
diff --git a/tests/openpgp/ssh-export.scm b/tests/openpgp/ssh-export.scm
new file mode 100755
index 0000000..322620e
--- /dev/null
+++ b/tests/openpgp/ssh-export.scm
@@ -0,0 +1,52 @@
+#!/usr/bin/env gpgscm
+
+;; Copyright (C) 2016 g10 Code GmbH
+;;
+;; This file is part of GnuPG.
+;;
+;; GnuPG is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GnuPG is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+(load (with-path "defs.scm"))
+(setup-environment)
+
+(define key
+ `(,(in-srcdir "samplekeys" "authenticate-only.sec.asc")
+ "927EF377FD1A1B6F795E40C02A87917D8FFBA49F"
+ "72360FDB6380212D5DAF2FA9E51185A9253C496D"
+ "ssh-rsa"))
+
+(define :file car)
+(define :fpr cadr)
+(define :subkey-fpr caddr)
+(define :kind cadddr)
+
+;; Return true if a-str and b-str share a suffix of length n.
+(define (string-common-suffix? n a-str b-str)
+ (let ((a-len (string-length a-str))
+ (b-len (string-length b-str)))
+ (if (> n (min a-len b-len))
+ #f
+ (string=? (substring a-str (- a-len n) a-len)
+ (substring b-str (- b-len n) b-len)))))
+
+(info "Checking ssh export...")
+(call-check `(, at GPG --yes --import ,(:file key)))
+
+(let* ((result (call-check `(, at GPG --export-ssh-key ,(:fpr key))))
+ ;; XXX: We should split at any whitespace here.
+ (parts (string-split (string-trim char-whitespace? result) #\space)))
+ (assert (string=? (car parts) (:kind key)))
+ ;; XXX: We should not use a short keyid as the comment when
+ ;; exporting an ssh key.
+ (assert (string-common-suffix? 8 (caddr parts) (:subkey-fpr key))))
commit 4db9a425644dccaf81b51ebc97b32a9cc21941a4
Author: Justus Winter <justus at g10code.com>
Date: Mon Nov 28 13:36:56 2016 +0100
g10: Fix iteration over getkey results.
* g10/getkey.c (getkey_next): Only ask 'lookup' for the exact match if
our caller requested the key. Fixes a crash in 'lookup'.
GnuPG-bug-id: 2848
Fixes-commit: 1d03cc77e1706f7da653153ad4b58c61e4fd2573
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/g10/getkey.c b/g10/getkey.c
index 68e6a1b..6eec087 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -2178,7 +2178,7 @@ getkey_next (getkey_ctx_t ctx, PKT_public_key *pk, kbnode_t *ret_keyblock)
if (pk && ret_keyblock == NULL)
ret_keyblock = &keyblock;
- rc = lookup (ctx, ret_keyblock, &found_key, ctx->want_secret);
+ rc = lookup (ctx, ret_keyblock, pk ? &found_key : NULL, ctx->want_secret);
if (!rc && pk)
{
log_assert (found_key);
commit cc1d21342659a7def5d662d0547579f9e0d3b109
Author: Justus Winter <justus at g10code.com>
Date: Mon Nov 28 12:36:33 2016 +0100
tests: Rename ssh test.
* tests/openpgp/ssh.scm: Rename to 'ssh-import.scm'.
* tests/openpgp/Makefile (XTESTS): Likewise.
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index 8f565b3..532cdb3 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -80,7 +80,7 @@ XTESTS = \
use-exact-key.scm \
default-key.scm \
export.scm \
- ssh.scm \
+ ssh-import.scm \
quick-key-manipulation.scm \
key-selection.scm \
issue2015.scm \
diff --git a/tests/openpgp/ssh.scm b/tests/openpgp/ssh-import.scm
similarity index 100%
rename from tests/openpgp/ssh.scm
rename to tests/openpgp/ssh-import.scm
-----------------------------------------------------------------------
Summary of changes:
g10/getkey.c | 2 +-
tests/openpgp/Makefile.am | 7 ++-
tests/openpgp/samplekeys/authenticate-only.pub.asc | 31 +++++++++++
tests/openpgp/samplekeys/authenticate-only.sec.asc | 60 ++++++++++++++++++++++
tests/openpgp/ssh-export.scm | 52 +++++++++++++++++++
tests/openpgp/{ssh.scm => ssh-import.scm} | 0
6 files changed, 149 insertions(+), 3 deletions(-)
create mode 100644 tests/openpgp/samplekeys/authenticate-only.pub.asc
create mode 100644 tests/openpgp/samplekeys/authenticate-only.sec.asc
create mode 100755 tests/openpgp/ssh-export.scm
rename tests/openpgp/{ssh.scm => ssh-import.scm} (100%)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list