diff options
Diffstat (limited to 'guile/email-key-rotation/srs.scm')
-rw-r--r-- | guile/email-key-rotation/srs.scm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/guile/email-key-rotation/srs.scm b/guile/email-key-rotation/srs.scm index aadfc7d..d9d2f64 100644 --- a/guile/email-key-rotation/srs.scm +++ b/guile/email-key-rotation/srs.scm @@ -2,6 +2,7 @@ #:use-module ((email-key-rotation openssl) #:prefix openssl:) #:use-module (ice-9 exceptions) #:use-module (ice-9 match) + #:use-module (ice-9 i18n) #:use-module (srfi srfi-9 gnu) #:use-module (sxml match) #:export (<key> @@ -15,6 +16,8 @@ write-private-opensmtpd-config) #:declarative? #t) +(define (G_ msg) (gettext msg "email-key-rotation")) + (define-immutable-record-type <key> (make-key current-secret expired-secret) key? @@ -30,7 +33,7 @@ (make-exception-with-origin 'sxml->key) (make-exception-with-irritants (list sxml)) (make-exception-with-message - "cannot read the XML fragment as a SRS key.") + (G_ "cannot read the XML fragment as a SRS key.")) exn))) (lambda () (sxml-match @@ -51,7 +54,7 @@ (make-exception-with-origin 'key->sxml) (make-exception-with-irritants (list key)) (make-exception-with-message - "when converting a SRS key to SXML:") + (G_ "when converting a SRS key to SXML:")) exn))) (lambda () (match key @@ -68,7 +71,7 @@ (make-exception (make-exception-with-origin 'initialize) (make-exception-with-message - "when initializing a new SRS key:") + (G_ "when initializing a new SRS key:")) exn))) (lambda () (make-key (openssl:random-hex 32) @@ -82,7 +85,7 @@ (make-exception-with-origin 'rotate) (make-exception-with-irritants (list key)) (make-exception-with-message - "when rotating a SRS key:") + (G_ "when rotating a SRS key:")) exn))) (lambda () (match key @@ -98,7 +101,7 @@ (make-exception-with-origin 'write-private-opensmtpd-config) (make-exception-with-irritants (list key port)) (make-exception-with-message - "when saving a private SRS key:") + (G_ "when saving a private SRS key:")) exn))) (lambda () (unless (port? port) @@ -106,15 +109,15 @@ (make-exception (make-error) (make-exception-with-message - "the port to write must be a port object.")))) + (G_ "the port to write must be a port object."))))) (when (file-port? port) (chmod port #o600)) (seek port 0 SEEK_SET) (match key (($ <key> current expired) (begin - (format port "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n -srs key ~s\n" + (format port (G_ "# GENERATED AUTOMATICALLY, DO NOT EDIT!\n")) + (format port "srs key ~s\n" current) (when expired (format port "srs key backup ~s\n" |