From 71c1d5280cdeba90cfd1230f5f376a7e89b93694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 18 Jan 2015 22:19:04 +0100 Subject: [PATCH] nar: Read archive signatures as Latin-1 strings. Fixes . Reported by Mark H Weaver . * guix/nar.scm (restore-one-item): Use 'read-latin1-string' to read the signature. --- guix/nar.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/nar.scm b/guix/nar.scm index bab727e65d..43e5210752 100644 --- a/guix/nar.scm +++ b/guix/nar.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -211,7 +211,9 @@ s-expression")) (_ "importing file or directory '~a'...~%") file) - (let ((sig (and has-sig? (read-string port)))) + ;; The signature may contain characters that are meant to be + ;; interpreted as bytes in a 'char *', so read them as a ISO-8859-1. + (let ((sig (and has-sig? (read-latin1-string port)))) (when verify-signature? (if sig (begin