guix-devel/guix/scripts
Ludovic Courtès cdea30e061 substitute-binary: Defer narinfo authentication and authorization checks.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Catch 'gcry-error' around 'string->canonical-sexp' call, and re-raise
  as a SRFI-35 &message and &nar-signature-error.
  (narinfo-maker): Handle when SIGNATURE is #f or an invalid canonical
  sexp.
  (&nar-signature-error, &nar-invalid-hash-error): New variables.
  (assert-valid-signature): Use them.  Expect 'signature' to be a
  canonical sexp.
  (read-narinfo): Remove authentication and authorization checks.
  (%signature-line-rx): New variable.
  (assert-valid-narinfo, valid-narinfo?): New procedures.
  (guix-substitute-binary): Wrap body in 'with-error-handling'.
  [valid?]: New procedure.
  <--query>: Show only store items of narinfos that match
  'valid-narinfo?'.
  <--substitute>: Call 'assert-valid-narinfo'.
* tests/substitute-binary.scm (test-error*): Use 'test-equal'.
  (%keypair): Remove.
  (%public-key, %private-key): Load from signing-key.{pub,sec}.
  (signature-body): Add #:public-key parameter.
  (call-with-narinfo): New procedure.
  (with-narinfo): New macro.
  ("corrupt signature data", "unauthorized public key", "invalid
  signature"): Make the first argument to 'assert-valid-signature' a
  canonical sexp.
  ("invalid hash", "valid read-narinfo", "valid write-narinfo"):
  Remove.
  ("query narinfo with invalid hash", "query narinfo signed with
  authorized key", "query narinfo signed with unauthorized key",
  "substitute, invalid hash", "substitute, unauthorized key"): New
  tests.
2014-03-30 22:32:11 +02:00
..
archive.scm pk-crypto: Don't use Ed25519 when libgcrypt is older than 1.6.0. 2014-03-20 23:06:47 +01:00
authenticate.scm authenticate: Support reading the hash or key from stdin. 2014-03-22 22:57:10 +01:00
build.scm guix build: Support '--with-source' along with '-e'. 2014-03-13 19:21:49 +01:00
download.scm Use `port-sha256' and `open-sha256-port'. 2013-07-03 01:18:24 +02:00
gc.scm guix gc: Add `--requisites'. 2013-06-13 22:15:41 +02:00
hash.scm guix hash: Add '--recursive'. 2014-02-21 23:49:52 +01:00
import.scm ui: Add `args-fold*' and use it. 2013-04-27 16:46:39 +02:00
offload.scm offload: Remove erroneous 'close-pipe' call. 2014-03-26 16:27:46 +01:00
package.scm guix package: Use the common build options from (guix scripts build). 2014-03-01 18:29:29 +01:00
pull.scm pull: Move build code to (guix build pull). 2013-12-16 23:26:48 +01:00
refresh.scm guix refresh: Keep only the newest versions of packages as upgrade candidates. 2013-07-11 19:56:30 +02:00
substitute-binary.scm substitute-binary: Defer narinfo authentication and authorization checks. 2014-03-30 22:32:11 +02:00
system.scm gnu: Introduce the (gnu services ...) modules. 2014-02-19 20:58:24 +01:00