Github messages for voidlinux
 help / color / mirror / Atom feed
From: jcgruenhage <jcgruenhage@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] gnupg: fix new yubikey firmware versions
Date: Wed, 20 Jul 2022 11:14:49 +0200	[thread overview]
Message-ID: <20220720091449.3S7mJ9CRQzPHw_a5D32GFQVhHTpYxB2LRyDaWOA1umY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-38150@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]

There is an updated pull request by jcgruenhage against master on the void-packages repository

https://github.com/jcgruenhage/void-packages gnupg-2.3.7_3
https://github.com/void-linux/void-packages/pull/38150

gnupg: fix new yubikey firmware versions
Patch has already been submitted upstream
(https://dev.gnupg.org/rGf34b9147eb3070bce80d53febaa564164cd6c977), and
was confirmed working on the linked issue

@vigoux wanted to test this, as they were running into this issue and pointed it out on IRC

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/38150.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gnupg-2.3.7_3-38150.patch --]
[-- Type: text/x-diff, Size: 5826 bytes --]

From a9c57c67f4a646f1c1924fadb891d0c1be5ef7cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?=
 <jan.christian@gruenhage.xyz>
Date: Wed, 20 Jul 2022 10:39:50 +0200
Subject: [PATCH] gnupg: fix new yubikey firmware versions

Patch has already been submitted upstream
(https://dev.gnupg.org/rGf34b9147eb3070bce80d53febaa564164cd6c977), and
was confirmed working on the linked issue
---
 ...csclite-library-on-musl-libc-as-well.patch | 26 +++++++++
 ...ix-workaround-for-Yubikey-heuristics.patch | 58 +++++++++++++++++++
 .../patches/use-versioned-pcsclite.patch      | 11 ----
 srcpkgs/gnupg/template                        |  2 +-
 4 files changed, 85 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/gnupg/patches/0001-use-versioned-pcsclite-library-on-musl-libc-as-well.patch
 create mode 100644 srcpkgs/gnupg/patches/0002-scd-openpgp-Fix-workaround-for-Yubikey-heuristics.patch
 delete mode 100644 srcpkgs/gnupg/patches/use-versioned-pcsclite.patch

diff --git a/srcpkgs/gnupg/patches/0001-use-versioned-pcsclite-library-on-musl-libc-as-well.patch b/srcpkgs/gnupg/patches/0001-use-versioned-pcsclite-library-on-musl-libc-as-well.patch
new file mode 100644
index 000000000000..23bc690b9dcb
--- /dev/null
+++ b/srcpkgs/gnupg/patches/0001-use-versioned-pcsclite-library-on-musl-libc-as-well.patch
@@ -0,0 +1,26 @@
+From 94b3bedd1ed56d70168dfd09594d2f0d8d6dea96 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
+ <congdanhqx@gmail.com>
+Date: Sun, 29 Sep 2019 12:32:46 +0700
+Subject: [PATCH 1/2] use versioned pcsclite library on musl-libc as well
+
+---
+ scd/scdaemon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scd/scdaemon.c b/scd/scdaemon.c
+index 6d068d3d3..2f2586452 100644
+--- a/scd/scdaemon.c
++++ b/scd/scdaemon.c
+@@ -207,7 +207,7 @@ static struct debug_flags_s debug_flags [] =
+ #define DEFAULT_PCSC_DRIVER "winscard.dll"
+ #elif defined(__APPLE__)
+ #define DEFAULT_PCSC_DRIVER "/System/Library/Frameworks/PCSC.framework/PCSC"
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+ #define DEFAULT_PCSC_DRIVER "libpcsclite.so.1"
+ #else
+ #define DEFAULT_PCSC_DRIVER "libpcsclite.so"
+-- 
+2.37.1
+
diff --git a/srcpkgs/gnupg/patches/0002-scd-openpgp-Fix-workaround-for-Yubikey-heuristics.patch b/srcpkgs/gnupg/patches/0002-scd-openpgp-Fix-workaround-for-Yubikey-heuristics.patch
new file mode 100644
index 000000000000..b6cdf2bb35ae
--- /dev/null
+++ b/srcpkgs/gnupg/patches/0002-scd-openpgp-Fix-workaround-for-Yubikey-heuristics.patch
@@ -0,0 +1,58 @@
+From 65255fd387b57bae83c5c08d1534ae58dbb5c264 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gniibe@fsij.org>
+Date: Wed, 13 Jul 2022 03:40:00 +0200
+Subject: [PATCH 2/2] scd:openpgp: Fix workaround for Yubikey heuristics.
+
+* scd/app-openpgp.c (parse_algorithm_attribute): Handle the case
+of firmware 5.4, too.
+
+GnuPG-bug-id: T6070
+Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
+---
+ scd/app-openpgp.c | 29 +++++++++++++++++++++--------
+ 1 file changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
+index 8bb346a86..4667416df 100644
+--- a/scd/app-openpgp.c
++++ b/scd/app-openpgp.c
+@@ -6259,15 +6259,28 @@ parse_algorithm_attribute (app_t app, int keyno)
+       app->app_local->keyattr[keyno].ecc.algo = *buffer;
+       app->app_local->keyattr[keyno].ecc.flags = 0;
+ 
+-      if (APP_CARD(app)->cardtype == CARDTYPE_YUBIKEY
+-	  || buffer[buflen-1] == 0x00 || buffer[buflen-1] == 0xff)
+-        { /* Found "pubkey required"-byte for private key template.  */
+-          oidlen--;
+-          if (buffer[buflen-1] == 0xff)
+-            app->app_local->keyattr[keyno].ecc.flags |= ECC_FLAG_PUBKEY;
++      if (APP_CARD(app)->cardtype == CARDTYPE_YUBIKEY)
++        {
++          /* Yubikey implementations vary.
++           * Firmware version 5.2 returns "pubkey required"-byte with
++           * 0x00, but after removal and second time insertion, it
++           * returns bogus value there.
++           * Firmware version 5.4 returns none.
++           */
++          curve = ecc_curve (buffer + 1, oidlen);
++          if (!curve)
++            curve = ecc_curve (buffer + 1, oidlen - 1);
++        }
++      else
++        {
++          if (buffer[buflen-1] == 0x00 || buffer[buflen-1] == 0xff)
++            { /* Found "pubkey required"-byte for private key template.  */
++              oidlen--;
++              if (buffer[buflen-1] == 0xff)
++                app->app_local->keyattr[keyno].ecc.flags |= ECC_FLAG_PUBKEY;
++            }
++          curve = ecc_curve (buffer + 1, oidlen);
+         }
+-
+-      curve = ecc_curve (buffer + 1, oidlen);
+ 
+       if (!curve)
+         {
+-- 
+2.37.1
+
diff --git a/srcpkgs/gnupg/patches/use-versioned-pcsclite.patch b/srcpkgs/gnupg/patches/use-versioned-pcsclite.patch
deleted file mode 100644
index 6a9c70d1b104..000000000000
--- a/srcpkgs/gnupg/patches/use-versioned-pcsclite.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/scd/scdaemon.c	2019-09-29 12:18:47.810111976 +0700
-+++ b/scd/scdaemon.c	2019-09-29 12:20:38.079117234 +0700
-@@ -189,7 +189,7 @@
- #define DEFAULT_PCSC_DRIVER "winscard.dll"
- #elif defined(__APPLE__)
- #define DEFAULT_PCSC_DRIVER "/System/Library/Frameworks/PCSC.framework/PCSC"
--#elif defined(__GLIBC__)
-+#elif defined(__linux__)
- #define DEFAULT_PCSC_DRIVER "libpcsclite.so.1"
- #else
- #define DEFAULT_PCSC_DRIVER "libpcsclite.so"
diff --git a/srcpkgs/gnupg/template b/srcpkgs/gnupg/template
index 79a37000021c..d43787470fff 100644
--- a/srcpkgs/gnupg/template
+++ b/srcpkgs/gnupg/template
@@ -1,7 +1,7 @@
 # Template file for 'gnupg'
 pkgname=gnupg
 version=2.3.7
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="$(vopt_enable ldap)
  --with-libgcrypt-prefix=${XBPS_CROSS_BASE}/usr

  parent reply	other threads:[~2022-07-20  9:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20  8:42 [PR PATCH] " jcgruenhage
2022-07-20  8:56 ` vigoux
2022-07-20  8:59 ` jcgruenhage
2022-07-20  9:14 ` jcgruenhage [this message]
2022-07-20 12:42 ` [PR PATCH] [Merged]: " leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220720091449.3S7mJ9CRQzPHw_a5D32GFQVhHTpYxB2LRyDaWOA1umY@z \
    --to=jcgruenhage@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).