Skip to contentSkip to conversation

skip RFC1991 tests with gnupg 2.1.x

PATCH In review Christian Hesse 4 participants 8 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skip RFC1991 tests with gnupg 2.1.x

---
 t/lib-gpg.sh   |  6 ++++++
 t/t7004-tag.sh | 14 +++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)
t/lib-gpg.sh +6 -0
index cd2baef..05b07c6 100755
@@ -22,6 +22,12 @@ else
 		GNUPGHOME="$(pwd)/gpghome"
 		export GNUPGHOME
 		test_set_prereq GPG
+		case "$gpg_version" in
+		'gpg (GnuPG) 2.1.'*)
+			say "Your version of gpg (2.1.x) is missing some legacy features"
+			test_set_prereq GNUPG21
+			;;
+		esac
 		;;
 	esac
 fi
t/t7004-tag.sh +7 -7
index 796e9f7..1c40967 100755
@@ -1081,7 +1081,7 @@ test_expect_success GPG \
 get_tag_header rfc1991-signed-tag $commit commit $time >expect
 echo "RFC1991 signed tag" >>expect
 echo '-----BEGIN PGP MESSAGE-----' >>expect
-test_expect_success GPG \
+test_expect_success GPG,!GNUPG21 \
 	'creating a signed tag with rfc1991' '
 	echo "rfc1991" >gpghome/gpg.conf &&
 	git tag -s -m "RFC1991 signed tag" rfc1991-signed-tag $commit &&
@@ -1095,7 +1095,7 @@ cp "$1" actual
 EOF
 chmod +x fakeeditor
 
-test_expect_success GPG \
+test_expect_success GPG,!GNUPG21 \
 	'reediting a signed tag body omits signature' '
 	echo "rfc1991" >gpghome/gpg.conf &&
 	echo "RFC1991 signed tag" >expect &&
@@ -1103,13 +1103,13 @@ test_expect_success GPG \
 	test_cmp expect actual
 '
 
-test_expect_success GPG \
+test_expect_success GPG,!GNUPG21 \
 	'verifying rfc1991 signature' '
 	echo "rfc1991" >gpghome/gpg.conf &&
 	git tag -v rfc1991-signed-tag
 '
 
-test_expect_success GPG \
+test_expect_success GPG,!GNUPG21 \
 	'list tag with rfc1991 signature' '
 	echo "rfc1991" >gpghome/gpg.conf &&
 	echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
@@ -1123,12 +1123,12 @@ test_expect_success GPG \
 
 rm -f gpghome/gpg.conf
 
-test_expect_success GPG \
+test_expect_success GPG,!GNUPG21 \
 	'verifying rfc1991 signature without --rfc1991' '
 	git tag -v rfc1991-signed-tag
 '
 
-test_expect_success GPG \
+test_expect_success GPG,!GNUPG21 \
 	'list tag with rfc1991 signature without --rfc1991' '
 	echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
 	git tag -l -n1 rfc1991-signed-tag >actual &&
@@ -1139,7 +1139,7 @@ test_expect_success GPG \
 	test_cmp expect actual
 '
 
-test_expect_success GPG \
+test_expect_success GPG,!GNUPG21 \
 	'reediting a signed tag body omits signature' '
 	echo "RFC1991 signed tag" >expect &&
 	GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
Signature · 1 line
2.1.3
#1 lore raw
Quoted 12 lines · Christian Hesse
---
 t/lib-gpg.sh   |  6 ++++++
 t/t7004-tag.sh | 14 +++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)
t/lib-gpg.sh +0 -0
index cd2baef..05b07c6 100755
@@ -22,6 +22,12 @@ else
 		GNUPGHOME="$(pwd)/gpghome"
 		export GNUPGHOME

t/lib-gpg.sh else · line 33

Quoted 10 lines
t/lib-gpg.sh +6 -0
 		test_set_prereq GPG
+		case "$gpg_version" in
+		'gpg (GnuPG) 2.1.'*)
+			say "Your version of gpg (2.1.x) is missing some legacy features"
+			test_set_prereq GNUPG21
+			;;
+		esac
 		;;
 	esac
 fi

We do not really need the GNUPG21 (and we don't need to touch the TC at all)

		case "$gpg_version" in
		'gpg (GnuPG) 2.1.'*)
			say "Your version of gpg (2.1.x) is missing some legacy features"
			;;
		*)
			test_set_prereq GPG
			;;

		esac

;;

#2 lore raw

Torsten Bögershausen schrieb am 11.12.2014 um 16:32:

Quoted 33 lines · Christian Hesse
Quoted 12 lines
---
 t/lib-gpg.sh   |  6 ++++++
 t/t7004-tag.sh | 14 +++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)
t/lib-gpg.sh +0 -0
index cd2baef..05b07c6 100755
@@ -22,6 +22,12 @@ else
 		GNUPGHOME="$(pwd)/gpghome"
 		export GNUPGHOME

t/lib-gpg.sh else · line 33

Quoted 10 lines
t/lib-gpg.sh +6 -0
 		test_set_prereq GPG
+		case "$gpg_version" in
+		'gpg (GnuPG) 2.1.'*)
+			say "Your version of gpg (2.1.x) is missing some legacy features"
+			test_set_prereq GNUPG21
+			;;
+		esac
 		;;
 	esac
 fi

We do not really need the GNUPG21 (and we don't need to touch the TC at all)

		case "$gpg_version" in
		'gpg (GnuPG) 2.1.'*)
			say "Your version of gpg (2.1.x) is missing some legacy features"
			;;
		*)
			test_set_prereq GPG
			;;

		esac
Quoted 2 lines

;;

That would disable all GPG tests, which is pretty harsh.

If gpg 2.1 is the future of gpg (which I don't know), which should rather prepare for that and make our tests independent of the version. Is gpg 2.1 stable enough to cater for its special needs?

Michael

#3 lore raw

Michael J Gruber <[email protected]> on Thu, 2014/12/11 17:54:

Quoted 34 lines

Torsten Bögershausen schrieb am 11.12.2014 um 16:32:

Quoted 33 lines · Christian Hesse
Quoted 17 lines
---
 t/lib-gpg.sh   |  6 ++++++
 t/t7004-tag.sh | 14 +++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)
t/lib-gpg.sh +3 -0
index cd2baef..05b07c6 100755
@@ -22,6 +22,12 @@ else
 		GNUPGHOME="$(pwd)/gpghome"
 		export GNUPGHOME
 		test_set_prereq GPG
+		case "$gpg_version" in
+		'gpg (GnuPG) 2.1.'*)
+			say "Your version of gpg (2.1.x) is missing

some legacy features"

t/lib-gpg.sh else · line 33

Quoted 6 lines
t/lib-gpg.sh +3 -0
+			test_set_prereq GNUPG21
+			;;
+		esac
 		;;
 	esac
 fi

We do not really need the GNUPG21 (and we don't need to touch the TC at all) case "$gpg_version" in

		'gpg (GnuPG) 2.1.'*)
			say "Your version of gpg (2.1.x) is missing some
legacy features" ;;
		*)
			test_set_prereq GPG
			;;
Quoted 5 lines
Quoted 3 lines

esac
;;

That would disable all GPG tests, which is pretty harsh.

Agreed. ;)

It's just six tests we have to disable. Everything else works just perfectly.

Quoted 3 lines

If gpg 2.1 is the future of gpg (which I don't know), which should rather prepare for that and make our tests independent of the version. Is gpg 2.1 stable enough to cater for its special needs?

GnuPG 2.0.x is still the official stable, 2.1.x is the "modern" branch. Looks like the decision about whether or not 2.1.x will be stable has not been made yet.

Though "official stable" is to be read as "absolutely rock solid stable" IMHO. That is what enterprise distributions should use.
The modern branch is stable for daily use but has some experimental features. Arch Linux for example already uses it [0], so stability can not be that bad. ;)

However... Even if GnuPG 2.2.x (or whatever future release) will become next
stable: It will not reintroduce support for rfc1991. So applying my patch is the way to go. (And version 2 of the patch even simplifies things and makes it more generic.)

[0] https://www.archlinux.org/packages/?name=gnupg

Signature · 2 lines
Best Regards,
Chris
#4 lore raw
Quoted 2 lines · Christian Hesse

However... Even if GnuPG 2.2.x (or whatever future release) will become next
stable: It will not reintroduce support for rfc1991.

How certain are we about the deprecation?

It also would make us feel safer if we did not have to depend on the version or keyfile format (which would not have anything to do with the decision to support or not to support rfc1991 format) to check if the feature is supported, but that is a separate issue.

#5 lore raw

Junio C Hamano <[email protected]> on Thu, 2014/12/11 15:10:

Quoted 6 lines
Quoted 2 lines · Christian Hesse

However... Even if GnuPG 2.2.x (or whatever future release) will become next stable: It will not reintroduce support for rfc1991.

How certain are we about the deprecation?

The sixth beta of GnuPG [0] had this change:

* gpg: Removed the option --pgp2 and --rfc1991 and the ability to create PGP-2 compatible messages.

Quoted 4 lines

It also would make us feel safer if we did not have to depend on the version or keyfile format (which would not have anything to do with the decision to support or not to support rfc1991 format) to check if the feature is supported, but that is a separate issue.

Changed in next version.

[0] http://lists.gnupg.org/pipermail/gnupg-announce/2014q3/000354.html

Signature · 2 lines
Best regards,
Chris
#6 lore raw

Christian Hesse <[email protected]> on Fri, 2014/12/12 09:35:

Quoted 6 lines

Junio C Hamano <[email protected]> on Thu, 2014/12/11 15:10:

Quoted 5 lines
Quoted 2 lines · Christian Hesse

However... Even if GnuPG 2.2.x (or whatever future release) will become next stable: It will not reintroduce support for rfc1991.

Quoted 6 lines
Quoted 1 line

How certain are we about the deprecation?

The sixth beta of GnuPG [0] had this change:

* gpg: Removed the option --pgp2 and --rfc1991 and the ability to create PGP-2 compatible messages.

This is the corresponding commit:

http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=2b8d8369d59249b89526c18c5ac276e6445dc35e

Signature · 2 lines
Best regards,
Chris
#7 lore raw

Christian Hesse schrieb am 12.12.2014 um 10:54:

Quoted 9 lines

Christian Hesse <[email protected]> on Fri, 2014/12/12 09:35:

Quoted 8 lines

Junio C Hamano <[email protected]> on Thu, 2014/12/11 15:10:

Quoted 6 lines
Quoted 2 lines · Christian Hesse

However... Even if GnuPG 2.2.x (or whatever future release) will become next stable: It will not reintroduce support for rfc1991.

How certain are we about the deprecation?

Quoted 9 lines
Quoted 4 lines

The sixth beta of GnuPG [0] had this change:

* gpg: Removed the option --pgp2 and --rfc1991 and the ability to create PGP-2 compatible messages.

This is the corresponding commit:

http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=2b8d8369d59249b89526c18c5ac276e6445dc35e

So, in fact, gpg2.1 removes support for creating pgp2 (rfc1991) signatures only. That is: We could put an armor exported signature into our test suite, test verification against that signature, and restrict the test for creation of that signature by gpg version (or skip it completely).

Michael