public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* cygport upgrade to use gnupg2/gpg2 if available
@ 2023-11-21  4:51 Brian Inglis
  2023-11-21  6:20 ` Brian Inglis
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Brian Inglis @ 2023-11-21  4:51 UTC (permalink / raw)
  To: Cygwin Apps

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

Hi folks,

The attached log first chunk shows that new downloads especially GnuPG and GNU 
packages may be signed with keys not recognized by old gnupg/gpg.

After applying the attached patches, which add support for the newer gpg2 from 
gnupg2 if installed, the attached log second chunk shows the new keys verified 
by gpg2 added to lib/src_prep.cygpart ___gpg_verify().

Similar code has been added to lib/pkg_pkg.cygpart __pkg_srcpkg() for check and 
definition and __gpg_sign() for use in gpg signing of Cygwin patches and files.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

[-- Attachment #2: cygport-gpg,2-prep-get-verify.log --]
[-- Type: text/plain, Size: 1232 bytes --]

>>> Preparing gpgme-1.23.1-1.x86_64
*** Info: SOURCE 1 signature follows:
gpg: Signature made 2023 Oct 27 Fri 06:41:07 MDT using ? key ID 26403ADA
gpg: Can't check signature: unknown pubkey algorithm
gpg: Signature made 2023 Nov 14 Tue 17:50:43 MST using ? key ID 19C6C8BD
gpg: Can't check signature: unknown pubkey algorithm

>>> Preparing gpgme-1.23.1-1.x86_64
*** Info: SOURCE 1 signature follows:
gpg: Signature made 2023 Oct 27 Fri 06:41:07 MDT
gpg:                using EDDSA key 6DAA6E64A76D2840571B4902528897B826403ADA
gpg: Good signature from "Werner Koch (dist signing 2020)" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 6DAA 6E64 A76D 2840 571B  4902 5288 97B8 2640 3ADA
gpg: Signature made 2023 Nov 14 Tue 17:50:43 MST
gpg:                using EDDSA key AC8E115BF73E2D8D47FA9908E98E9B2D19C6C8BD
gpg: Good signature from "Niibe Yutaka (GnuPG Release Key)" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: AC8E 115B F73E 2D8D 47FA  9908 E98E 9B2D 19C6 C8BD

[-- Attachment #3: cygport-lib-pkg_pkg-cygpart-gpg2.patch --]
[-- Type: text/plain, Size: 1223 bytes --]

--- /usr/share/cygport/lib/pkg_pkg.cygpart.orig	2023-03-08 06:07:57.000000000 -0700
+++ /usr/share/cygport/lib/pkg_pkg.cygpart	2023-11-19 21:13:16.879391200 -0700
@@ -505,7 +505,7 @@ __gpg_sign() {
 	echo "${2} signature needs to be updated";
 	rm -f ${1}.sig;
 	# we 'check_prog gpg' in __pkg_srcpkg()
-	gpg --detach-sign ${1};
+	$GPG --detach-sign ${1};
 }
 
 __squeeze_whitespace() {
@@ -563,7 +563,9 @@ __pkg_srcpkg() {
 
 	if __arg_bool SIG
 	then
-		if check_prog gpg
+		if check_prog gpg2; then GPG=gpg2; else GPG=gpg; fi
+
+		if check_prog $GPG
 		then
 			__gpg_sign ${spkgdir}/${cygportfile} "CYGPORT SCRIPT";
 
@@ -583,14 +585,15 @@ __pkg_srcpkg() {
 				__gpg_sign ${spkgdir}/${src_patchfile} "SOURCE PATCH";
 			fi
 		else
-			inform "gnupg must be installed in order to make signatures.";
+			inform "gnupg2 or gnupg must be installed in order to make signatures.";
 		fi
 	fi
 
 	cd ${spkgdir%/*};
 
 	mkdir -p ${distdir}/${PN};
-	__tar ${distdir}/${PN}/${PF}-src.tar.${TAR_COMPRESSION_EXT} ${spkgdir##*/}/ || error "Source package creation failed"
+	__tar ${distdir}/${PN}/${PF}-src.tar.${TAR_COMPRESSION_EXT} ${spkgdir##*/}/ \
+		|| error "Source package creation failed"
 	echo;
 
 	# source package hint

[-- Attachment #4: cygport-lib-src_prep-cygpart-gpg2.patch --]
[-- Type: text/plain, Size: 874 bytes --]

--- /usr/share/cygport/lib/src_prep.cygpart.orig	2023-11-19 18:51:13.284177300 -0700
+++ /usr/share/cygport/lib/src_prep.cygpart	2023-11-19 21:00:35.754036900 -0700
@@ -181,12 +181,14 @@ __gpg_verify() {
 	local _filetype=${2};
 	local _sigext=${3:-sig};
 
-	if ! check_prog gpg && ! check_prog gpg2
+	if check_prog gpg2; then GPG=gpg2; else GPG=gpg; fi
+
+	if ! check_prog $GPG
 	then
 		# display notice only once
 		if ! defined _gpg_not_found_
 		then
-			inform "gnupg or gnupg2 must be installed in order to check signatures.";
+			inform "gnupg2 or gnupg must be installed in order to check signatures.";
 			_gpg_not_found_=1
 		fi
 
@@ -195,7 +197,6 @@ __gpg_verify() {
 
 	if [ -f ${_file}.${_sigext} ]
 	then
-	    [ check_prog gpg2 ] && GPG=gpg2 || GPG=gpg
 		inform "${_filetype} signature follows:";
 		$GPG --verify ${_file}.${_sigext} ${_file} || true;
 	fi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygport upgrade to use gnupg2/gpg2 if available
  2023-11-21  4:51 cygport upgrade to use gnupg2/gpg2 if available Brian Inglis
@ 2023-11-21  6:20 ` Brian Inglis
  2023-11-21  6:58 ` ASSI
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Brian Inglis @ 2023-11-21  6:20 UTC (permalink / raw)
  To: cygwin-apps

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

On 2023-11-20 21:51, Brian Inglis via Cygwin-apps wrote:
> The attached log first chunk shows that new downloads especially GnuPG and GNU 
> packages may be signed with keys not recognized by old gnupg/gpg.
> After applying the attached patches, which add support for the newer gpg2 from 
> gnupg2 if installed, the attached log second chunk shows the new keys verified 
> by gpg2 added to lib/src_prep.cygpart ___gpg_verify().
> Similar code has been added to lib/pkg_pkg.cygpart __pkg_srcpkg() for check and 
> definition and __gpg_sign() for use in gpg signing of Cygwin patches and files.

Not sure what previous lib/src_prep.cygpart patch was generated from, but patch 
from correct sources is attached.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

[-- Attachment #2: cygport-lib-src_prep-cygpart-gpg2.patch --]
[-- Type: text/plain, Size: 851 bytes --]

--- /usr/share/cygport/lib/src_prep.cygpart.orig	2023-08-07 09:46:31.000000000 -0600
+++ /usr/share/cygport/lib/src_prep.cygpart	2023-11-20 23:15:36.349253300 -0700
@@ -181,12 +181,14 @@ __gpg_verify() {
 	local _filetype=${2};
 	local _sigext=${3:-sig};
 
-	if ! check_prog gpg
+	if check_prog gpg2; then GPG=gpg2; else GPG=gpg; fi
+
+	if ! check_prog $GPG
 	then
 		# display notice only once
 		if ! defined _gpg_not_found_
 		then
-			inform "gnupg must be installed in order to check signatures.";
+			inform "gnupg2 or gnupg must be installed in order to check signatures.";
 			_gpg_not_found_=1
 		fi
 
@@ -196,7 +198,7 @@ __gpg_verify() {
 	if [ -f ${_file}.${_sigext} ]
 	then
 		inform "${_filetype} signature follows:";
-		gpg --verify ${_file}.${_sigext} ${_file} || true;
+		$GPG --verify ${_file}.${_sigext} ${_file} || true;
 	fi
 }
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygport upgrade to use gnupg2/gpg2 if available
  2023-11-21  4:51 cygport upgrade to use gnupg2/gpg2 if available Brian Inglis
  2023-11-21  6:20 ` Brian Inglis
@ 2023-11-21  6:58 ` ASSI
       [not found] ` <655c551b.0c0a0220.6dce4.7613SMTPIN_ADDED_BROKEN@mx.google.com>
       [not found] ` <38451.4474005968$1700549918@news.gmane.org>
  3 siblings, 0 replies; 6+ messages in thread
From: ASSI @ 2023-11-21  6:58 UTC (permalink / raw)
  To: cygwin-apps

Brian Inglis via Cygwin-apps writes:
> After applying the attached patches, which add support for the newer
> gpg2 from gnupg2 if installed, the attached log second chunk shows the
> new keys verified by gpg2 added to lib/src_prep.cygpart
> ___gpg_verify().
>
> Similar code has been added to lib/pkg_pkg.cygpart __pkg_srcpkg() for
> check and definition and __gpg_sign() for use in gpg signing of Cygwin
> patches and files.


We should just switch to gpg2 an require that, there is no point in
trying to use GPG 1.x anymore.

https://repo.or.cz/cygport/rpm-style.git/commitdiff/84279e484726a68cc8f08e7c9126bef13d9510d7


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygport upgrade to use gnupg2/gpg2 if available
       [not found] ` <655c551b.0c0a0220.6dce4.7613SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2023-11-24 21:29   ` Marco Atzeri
  2023-11-24 22:01     ` Brian Inglis
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Atzeri @ 2023-11-24 21:29 UTC (permalink / raw)
  To: cygwin-apps

On 21.11.2023 07:58, ASSI via Cygwin-apps wrote:
> Brian Inglis via Cygwin-apps writes:
>> After applying the attached patches, which add support for the newer
>> gpg2 from gnupg2 if installed, the attached log second chunk shows the
>> new keys verified by gpg2 added to lib/src_prep.cygpart
>> ___gpg_verify().
>>
>> Similar code has been added to lib/pkg_pkg.cygpart __pkg_srcpkg() for
>> check and definition and __gpg_sign() for use in gpg signing of Cygwin
>> patches and files.
> 
> 
> We should just switch to gpg2 an require that, there is no point in
> trying to use GPG 1.x anymore.
> 
> https://repo.or.cz/cygport/rpm-style.git/commitdiff/84279e484726a68cc8f08e7c9126bef13d9510d7
> 
> 
> Regards,
> Achim.

should I just retire gpg 1.x and stop having gpg2 as different binary name ?


$ for i in /usr/bin/gpg* ; do echo -n $i " : " ; cygcheck -f $i ; done
/usr/bin/gpg.exe  : gnupg-1.4.23-1
/usr/bin/gpg2.exe  : gnupg2-2.2.35-2
/usr/bin/gpg-agent.exe  : gnupg2-2.2.35-2
/usr/bin/gpgconf.exe  : gnupg2-2.2.35-2
/usr/bin/gpg-connect-agent.exe  : gnupg2-2.2.35-2
/usr/bin/gpg-error.exe  : libgpg-error-devel-1.47-1
/usr/bin/gpgme-config  : libgpgme-devel-1.9.0-1
/usr/bin/gpgme-tool.exe  : libgpgme-devel-1.9.0-1
/usr/bin/gpgparsemail.exe  : gnupg2-2.2.35-2
/usr/bin/gpgrt-config  : libgpg-error-devel-1.47-1
/usr/bin/gpgscm.exe  : gnupg2-2.2.35-2
/usr/bin/gpgsm.exe  : gnupg2-2.2.35-2
/usr/bin/gpgsplit.exe  : gnupg-1.4.23-1
gnupg2-2.2.35-2
/usr/bin/gpgtar.exe  : gnupg2-2.2.35-2
/usr/bin/gpgv.exe  : gnupg-1.4.23-1
/usr/bin/gpgv2.exe  : gnupg2-2.2.35-2
/usr/bin/gpg-wks-server.exe  : gnupg2-2.2.35-2
/usr/bin/gpg-zip  : gnupg-1.4.23-1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygport upgrade to use gnupg2/gpg2 if available
  2023-11-24 21:29   ` Marco Atzeri
@ 2023-11-24 22:01     ` Brian Inglis
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Inglis @ 2023-11-24 22:01 UTC (permalink / raw)
  To: cygwin-apps

On 2023-11-24 14:29, Marco Atzeri via Cygwin-apps wrote:
> On 21.11.2023 07:58, ASSI via Cygwin-apps wrote:
>> Brian Inglis via Cygwin-apps writes:
>>> After applying the attached patches, which add support for the newer
>>> gpg2 from gnupg2 if installed, the attached log second chunk shows the
>>> new keys verified by gpg2 added to lib/src_prep.cygpart
>>> ___gpg_verify().
>>> Similar code has been added to lib/pkg_pkg.cygpart __pkg_srcpkg() for
>>> check and definition and __gpg_sign() for use in gpg signing of Cygwin
>>> patches and files.
>> We should just switch to gpg2 an require that, there is no point in
>> trying to use GPG 1.x anymore.
>> https://repo.or.cz/cygport/rpm-style.git/commitdiff/84279e484726a68cc8f08e7c9126bef13d9510d7

++1?

> should I just retire gpg 1.x and stop having gpg2 as different binary name ?

Or obsolete 1 with 2 and add compatibility symlinks or scripts?

Keep names separate so easy to check.

> $ for i in /usr/bin/gpg* ; do echo -n $i " : " ; cygcheck -f $i ; done
> /usr/bin/gpg.exe  : gnupg-1.4.23-1
> /usr/bin/gpg2.exe  : gnupg2-2.2.35-2
> /usr/bin/gpg-agent.exe  : gnupg2-2.2.35-2
> /usr/bin/gpgconf.exe  : gnupg2-2.2.35-2
> /usr/bin/gpg-connect-agent.exe  : gnupg2-2.2.35-2
> /usr/bin/gpg-error.exe  : libgpg-error-devel-1.47-1
> /usr/bin/gpgme-config  : libgpgme-devel-1.9.0-1
> /usr/bin/gpgme-tool.exe  : libgpgme-devel-1.9.0-1
> /usr/bin/gpgparsemail.exe  : gnupg2-2.2.35-2
> /usr/bin/gpgrt-config  : libgpg-error-devel-1.47-1
> /usr/bin/gpgscm.exe  : gnupg2-2.2.35-2
> /usr/bin/gpgsm.exe  : gnupg2-2.2.35-2
> /usr/bin/gpgsplit.exe  : gnupg-1.4.23-1
> gnupg2-2.2.35-2
> /usr/bin/gpgtar.exe  : gnupg2-2.2.35-2
> /usr/bin/gpgv.exe  : gnupg-1.4.23-1
> /usr/bin/gpgv2.exe  : gnupg2-2.2.35-2
> /usr/bin/gpg-wks-server.exe  : gnupg2-2.2.35-2
> /usr/bin/gpg-zip  : gnupg-1.4.23-1

gpg-zip is only in 1, gpgsplit is in 1 *AND* 2, but likely 2 is installed over 
1, and a lot of new stuff is in 2:

$ cygcheck -l gnupg | grep bin/
/usr/bin/gpg-zip
/usr/bin/gpg.exe
/usr/bin/gpgsplit.exe
/usr/bin/gpgv.exe
$ cygcheck -l gnupg2 | grep bin/
/usr/bin/dirmngr-client.exe
/usr/bin/dirmngr.exe
/usr/bin/gpg-agent.exe
/usr/bin/gpg-connect-agent.exe
/usr/bin/gpg-wks-server.exe
/usr/bin/gpg2.exe
/usr/bin/gpgconf.exe
/usr/bin/gpgparsemail.exe
/usr/bin/gpgscm.exe
/usr/bin/gpgsm.exe
/usr/bin/gpgsplit.exe
/usr/bin/gpgtar.exe
/usr/bin/gpgv2.exe
/usr/bin/kbxutil.exe
/usr/bin/watchgnupg.exe
/usr/sbin/addgnupghome
/usr/sbin/applygnupgdefaults

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygport upgrade to use gnupg2/gpg2 if available
       [not found] ` <38451.4474005968$1700549918@news.gmane.org>
@ 2023-11-26 14:40   ` Jon Turney
  0 siblings, 0 replies; 6+ messages in thread
From: Jon Turney @ 2023-11-26 14:40 UTC (permalink / raw)
  To: cygwin-apps

On 21/11/2023 06:58, ASSI via Cygwin-apps wrote:
> Brian Inglis via Cygwin-apps writes:
>> After applying the attached patches, which add support for the newer
>> gpg2 from gnupg2 if installed, the attached log second chunk shows the
>> new keys verified by gpg2 added to lib/src_prep.cygpart
>> ___gpg_verify().
>>
>> Similar code has been added to lib/pkg_pkg.cygpart __pkg_srcpkg() for
>> check and definition and __gpg_sign() for use in gpg signing of Cygwin
>> patches and files.
> 
> 
> We should just switch to gpg2 an require that, there is no point in
> trying to use GPG 1.x anymore.
> 
> https://repo.or.cz/cygport/rpm-style.git/commitdiff/84279e484726a68cc8f08e7c9126bef13d9510d7

I think this is the correct patch, so I'll probably apply this.

But yeah, I think gpg2 obsoleting gpg, with compatibility symlinks is 
probably the right thing to do.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-26 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21  4:51 cygport upgrade to use gnupg2/gpg2 if available Brian Inglis
2023-11-21  6:20 ` Brian Inglis
2023-11-21  6:58 ` ASSI
     [not found] ` <655c551b.0c0a0220.6dce4.7613SMTPIN_ADDED_BROKEN@mx.google.com>
2023-11-24 21:29   ` Marco Atzeri
2023-11-24 22:01     ` Brian Inglis
     [not found] ` <38451.4474005968$1700549918@news.gmane.org>
2023-11-26 14:40   ` Jon Turney

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 read-only IMAP folder(s) and NNTP newsgroup(s).