Guard against failures when loading the narinfo signing public key

This commit is contained in:
Christopher Baines 2019-12-26 10:49:14 +00:00
parent 54b3d8d93a
commit 7342280ead

View file

@ -141,8 +141,19 @@
(assq-ref opts 'port)) (assq-ref opts 'port))
(parameterize ((%narinfo-signing-public-key (parameterize ((%narinfo-signing-public-key
(catch
'system-error
(lambda ()
(and=> (assoc-ref opts 'narinfo-signing-public-key) (and=> (assoc-ref opts 'narinfo-signing-public-key)
read-file-sexp)) read-file-sexp))
(lambda (key . args)
(simple-format
(current-error-port)
"warning: failed to load narinfo signing public key from ~A\n"
(assoc-ref opts 'narinfo-signing-private-key))
(simple-format (current-error-port)
" ~A: ~A\n"
key args))))
(%narinfo-signing-private-key (%narinfo-signing-private-key
(catch (catch
'system-error 'system-error