<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix/tests/guix-authenticate.sh, branch master</title>
<subtitle>Transactional package manager, declarative GNU/Linux distribution, reproducible deployment tool, and more! https://guix.gnu.org</subtitle>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/'/>
<entry>
<title>tests: keys: Moving to openpgp subdirectory.</title>
<updated>2026-04-10T05:55:04+00:00</updated>
<author>
<name>Nicolas Graves</name>
<email>ngraves@ngraves.fr</email>
</author>
<published>2026-03-01T16:38:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=4c7a7a1d498f4ca418a649a0b3e3a056569aec15'/>
<id>4c7a7a1d498f4ca418a649a0b3e3a056569aec15</id>
<content type='text'>
* tests/keys/*.(pub|sec): Move to tests/keys/openpgp/*.(pub|sec)
* build-aux/test-env.in: Adapt accordingly.
* Makefile.am: Likewise.
* guix/tests/gnupg.scm: Likewise.
* tests/guix-authenticate.sh: Likewise.
* tests/openpgp.scm: Likewise.

Change-Id: If8897cec9851cc51a4ebadcc5927dc0e0520b881
Reviewed-by: Danny Milosavljevic &lt;dannym@friendly-machines.com&gt;
Signed-off-by: Nguyễn Gia Phong &lt;cnx@loang.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/keys/*.(pub|sec): Move to tests/keys/openpgp/*.(pub|sec)
* build-aux/test-env.in: Adapt accordingly.
* Makefile.am: Likewise.
* guix/tests/gnupg.scm: Likewise.
* tests/guix-authenticate.sh: Likewise.
* tests/openpgp.scm: Likewise.

Change-Id: If8897cec9851cc51a4ebadcc5927dc0e0520b881
Reviewed-by: Danny Milosavljevic &lt;dannym@friendly-machines.com&gt;
Signed-off-by: Nguyễn Gia Phong &lt;cnx@loang.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>authenticate: Report failure to load keys to the daemon.</title>
<updated>2025-12-22T14:10:52+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-12-19T08:34:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=0ac2a0fd1813fb5c04b22f6443d8f8a96d3c9645'/>
<id>0ac2a0fd1813fb5c04b22f6443d8f8a96d3c9645</id>
<content type='text'>
Previously, when failing to load a signing key, ‘guix authenticate’ would
print a backtrace and exit with a non-zero code.  That, in turn, would lead
the guix-daemon child process to crash with:

  nix/libutil/serialise.cc:15: virtual nix::BufferedSink::~BufferedSink(): Assertion `!bufPos' failed.

This patch fixes it by reporting the error to the daemon as was intended.

* guix/scripts/authenticate.scm (guix-authenticate): Arrange to call
‘load-key-pair’ from within ‘with-reply’.
* tests/guix-authenticate.sh: Test it.

Fixes: guix/guix#4928
Reported-by: Rutherther &lt;rutherther@ditigal.xyz&gt;
Change-Id: I8654ad6fdfbe18c55e1e85647d0c49f408d0574a
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
Merges: #4961
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, when failing to load a signing key, ‘guix authenticate’ would
print a backtrace and exit with a non-zero code.  That, in turn, would lead
the guix-daemon child process to crash with:

  nix/libutil/serialise.cc:15: virtual nix::BufferedSink::~BufferedSink(): Assertion `!bufPos' failed.

This patch fixes it by reporting the error to the daemon as was intended.

* guix/scripts/authenticate.scm (guix-authenticate): Arrange to call
‘load-key-pair’ from within ‘with-reply’.
* tests/guix-authenticate.sh: Test it.

Fixes: guix/guix#4928
Reported-by: Rutherther &lt;rutherther@ditigal.xyz&gt;
Change-Id: I8654ad6fdfbe18c55e1e85647d0c49f408d0574a
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
Merges: #4961
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Move keys into ./tests/keys/ and add a third ed25519 key.</title>
<updated>2021-12-22T09:53:19+00:00</updated>
<author>
<name>Attila Lendvai</name>
<email>attila@lendvai.name</email>
</author>
<published>2021-12-21T21:56:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=9ebc9ca070a21ba0aeb3f61202a8071bb250ccc8'/>
<id>9ebc9ca070a21ba0aeb3f61202a8071bb250ccc8</id>
<content type='text'>
The third key will be used in an upcoming commit.

Rename public keys to .pub.

* guix/tests/gnupg.scm (%ed25519-3-public-key-file): New variable.
(%ed25519-3-secret-key-file): New variable.
(%ed25519-2-public-key-file): Renamed from %ed25519bis-public-key-file.
(%ed25519-2-secret-key-file): Renamed from %ed25519bis-secret-key-file.
* tests/keys/ed25519-3.key: New file.
* tests/keys/ed25519-3.sec: New file.

Signed-off-by: Mathieu Othacehe &lt;othacehe@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The third key will be used in an upcoming commit.

Rename public keys to .pub.

* guix/tests/gnupg.scm (%ed25519-3-public-key-file): New variable.
(%ed25519-3-secret-key-file): New variable.
(%ed25519-2-public-key-file): Renamed from %ed25519bis-public-key-file.
(%ed25519-2-secret-key-file): Renamed from %ed25519bis-secret-key-file.
* tests/keys/ed25519-3.key: New file.
* tests/keys/ed25519-3.sec: New file.

Signed-off-by: Mathieu Othacehe &lt;othacehe@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>authenticate: Encode strings as ISO-8859-1.</title>
<updated>2020-09-15T12:40:20+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2020-09-15T12:24:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=b911d6547444b5f8d17b224bafa5ee1b5aafaff5'/>
<id>b911d6547444b5f8d17b224bafa5ee1b5aafaff5</id>
<content type='text'>
Fixes &lt;https://bugs.gnu.org/43421&gt;.

* guix/scripts/authenticate.scm (read-command): Decode strings as
ISO-8859-1, not UTF-8.
(guix-authenticate)[send-reply]: Encode strings as ISO-8859-1, not
UTF-8.
* tests/guix-authenticate.sh: Add test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;https://bugs.gnu.org/43421&gt;.

* guix/scripts/authenticate.scm (read-command): Decode strings as
ISO-8859-1, not UTF-8.
(guix-authenticate)[send-reply]: Encode strings as ISO-8859-1, not
UTF-8.
* tests/guix-authenticate.sh: Add test.
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: Spawn 'guix authenticate' once for all.</title>
<updated>2020-09-14T13:42:55+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2020-09-11T10:51:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=64cf660f872fb7aaf0d2b463e45b4c756297f743'/>
<id>64cf660f872fb7aaf0d2b463e45b4c756297f743</id>
<content type='text'>
Previously, we'd spawn 'guix authenticate' once for each item that has
to be signed (when exporting) or authenticated (when importing).  Now,
we spawn it once for all and then follow a request/reply protocol.  This
reduces the wall-clock time of:

  guix archive --export -r $(guix build coreutils -d)

from 30s to 2s.

* guix/scripts/authenticate.scm (sign-with-key): Return the signature
instead of displaying it.  Raise a &amp;formatted-message instead of calling
'leave'.
(validate-signature): Likewise.
(read-command): New procedure.
(define-enumerate-type, reply-code): New macros.
(guix-authenticate)[send-reply]: New procedure.
Change to read commands from current-input-port.
* nix/libstore/local-store.cc (runAuthenticationProgram): Remove.
(authenticationAgent, readInteger, readAuthenticateReply): New
functions.
(signHash, verifySignature): Rewrite in terms of the agent.
* tests/store.scm ("import not signed"): Remove 'pk' call.
("import signed by unauthorized key"): Check the error message of C.
* tests/guix-authenticate.sh: Rewrite using the new protocol.

fixlet
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, we'd spawn 'guix authenticate' once for each item that has
to be signed (when exporting) or authenticated (when importing).  Now,
we spawn it once for all and then follow a request/reply protocol.  This
reduces the wall-clock time of:

  guix archive --export -r $(guix build coreutils -d)

from 30s to 2s.

* guix/scripts/authenticate.scm (sign-with-key): Return the signature
instead of displaying it.  Raise a &amp;formatted-message instead of calling
'leave'.
(validate-signature): Likewise.
(read-command): New procedure.
(define-enumerate-type, reply-code): New macros.
(guix-authenticate)[send-reply]: New procedure.
Change to read commands from current-input-port.
* nix/libstore/local-store.cc (runAuthenticationProgram): Remove.
(authenticationAgent, readInteger, readAuthenticateReply): New
functions.
(signHash, verifySignature): Rewrite in terms of the agent.
* tests/store.scm ("import not signed"): Remove 'pk' call.
("import signed by unauthorized key"): Check the error message of C.
* tests/guix-authenticate.sh: Rewrite using the new protocol.

fixlet
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: Simplify interface with 'guix authenticate'.</title>
<updated>2020-09-11T15:53:58+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2020-09-08T13:00:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=6dd8ffc57420ee2f6f19e79e41028e78fe9e6a7e'/>
<id>6dd8ffc57420ee2f6f19e79e41028e78fe9e6a7e</id>
<content type='text'>
There's no reason at this point to mimic the calling convention of the
'openssl' command.

* nix/libstore/local-store.cc (LocalStore::exportPath): Add only "sign"
and HASH to ARGS.  Remove 'tmpDir' and 'hashFile'.
(LocalStore::importPath): Add only "verify" and SIGNATURE to
* guix/scripts/authenticate.scm (guix-authenticate): Adjust
accordingly; remove the OpenSSL-style clauses.
(read-hash-data): Remove.
(sign-with-key): Replace 'port' with 'sha256' and adjust accordingly.
(validate-signature): Export SIGNATURE to be a canonical sexp.
* tests/guix-authenticate.sh: Adjust tests accordingly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no reason at this point to mimic the calling convention of the
'openssl' command.

* nix/libstore/local-store.cc (LocalStore::exportPath): Add only "sign"
and HASH to ARGS.  Remove 'tmpDir' and 'hashFile'.
(LocalStore::importPath): Add only "verify" and SIGNATURE to
* guix/scripts/authenticate.scm (guix-authenticate): Adjust
accordingly; remove the OpenSSL-style clauses.
(read-hash-data): Remove.
(sign-with-key): Replace 'port' with 'sha256' and adjust accordingly.
(validate-signature): Export SIGNATURE to be a canonical sexp.
* tests/guix-authenticate.sh: Adjust tests accordingly.
</pre>
</div>
</content>
</entry>
<entry>
<title>authenticate: Allow signatures with binary data to be written to stdout.</title>
<updated>2014-04-22T09:30:58+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-04-22T09:30:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=6f69588529f9898dc4f2defd21603cc4abbaca17'/>
<id>6f69588529f9898dc4f2defd21603cc4abbaca17</id>
<content type='text'>
Fixes &lt;http://bugs.gnu.org/17312&gt;.

* guix/scripts/authenticate.scm (guix-authenticate): Add calls to
  'set-port-encoding!' and 'set-port-conversion-strategy!'.  Wrap body
  in 'with-fluids' form that sets '%default-port-encoding' and
  '%default-port-conversion-strategy'.
* tests/guix-authenticate.sh: Add test.
* tests/pk-crypto.scm ("hash corrupt due to restrictive locale
  encoding"): Add reference to bug.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;http://bugs.gnu.org/17312&gt;.

* guix/scripts/authenticate.scm (guix-authenticate): Add calls to
  'set-port-encoding!' and 'set-port-conversion-strategy!'.  Wrap body
  in 'with-fluids' form that sets '%default-port-encoding' and
  '%default-port-conversion-strategy'.
* tests/guix-authenticate.sh: Add test.
* tests/pk-crypto.scm ("hash corrupt due to restrictive locale
  encoding"): Add reference to bug.
</pre>
</div>
</content>
</entry>
<entry>
<title>authenticate: Support reading the hash or key from stdin.</title>
<updated>2014-03-22T21:57:10+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-03-22T21:46:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=9b0a2233dbe8746015b97e97cef890d38fb44b0f'/>
<id>9b0a2233dbe8746015b97e97cef890d38fb44b0f</id>
<content type='text'>
* guix/scripts/authenticate.scm (guix-authenticate): Add clauses
  for ("rsautl" "-sign" "-inkey" key) and ("rsautl" "-verify" "-inkey" _
  "-pubin").
* tests/guix-authenticate.sh (hash): Add test using -sign and -verify in
  a pipeline.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/scripts/authenticate.scm (guix-authenticate): Add clauses
  for ("rsautl" "-sign" "-inkey" key) and ("rsautl" "-verify" "-inkey" _
  "-pubin").
* tests/guix-authenticate.sh (hash): Add test using -sign and -verify in
  a pipeline.
</pre>
</div>
</content>
</entry>
<entry>
<title>authenticate: Add test.</title>
<updated>2013-12-21T20:47:17+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2013-12-21T20:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=0820098d1ccf63e3e8b44df67dcb4236b78975c6'/>
<id>0820098d1ccf63e3e8b44df67dcb4236b78975c6</id>
<content type='text'>
* tests/guix-authenticate.sh: New file.
* Makefile.am (SH_TESTS): Add it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/guix-authenticate.sh: New file.
* Makefile.am (SH_TESTS): Add it.
</pre>
</div>
</content>
</entry>
</feed>
