[pacman-dev] [PATCH v2] repo-add: Reject armored signatures

Johannes Löthberg johannes at kyriasis.com
Tue May 26 15:16:33 UTC 2015


Pacman cannot handle armored signatures, so make repo-add error out if
one is detected.

Signed-off-by: Johannes Löthberg <johannes at kyriasis.com>
---
Now beheaded.

 scripts/repo-add.sh.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 7e242ce..076e987 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -364,6 +364,11 @@ db_write_entry() {
 
 	# compute base64'd PGP signature
 	if [[ -f "$pkgfile.sig" ]]; then
+		if grep -q 'BEGIN PGP SIGNATURE' "$pkgfile.sig"; then
+			error "$(gettext "Armored package signature '%s' found, \
+unarmored signatures required.")" "$pkgfile.sig"
+			return 1
+		fi
 		pgpsigsize=$(@SIZECMD@ -L "$pkgfile.sig")
 		if (( pgpsigsize > 16384 )); then
 			error "$(gettext "Invalid package signature file '%s'.")" "$pkgfile.sig"
-- 
2.4.1


More information about the pacman-dev mailing list