;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (test-pki) #:use-module (guix pki) #:use-module (gcrypt pk-crypto) #:use-module (gcrypt hash) #:use-module (rnrs io ports) #:use-module (srfi srfi-64)) ;; Test the (guix pki) module. (define %public-key (call-with-input-file %public-key-file (compose string->canonical-sexp get-string-all))) (define %secret-key (call-with-input-file %private-key-file (compose string->canonical-sexp get-string-all))) (define %alternate-secret-key (string->canonical-sexp " (key-data (public-key (rsa (n #00FDBF170366AC43B7D95CF9085565C566FB1F21B17C0A36E68F35ABB500E7851E00B40D7B04C8CD25903371F38E4C298FACEFFC4C97E913B536A0672BAF99D04515AE98A1A56627CD7EB02502FCFBEEA21AF13CC1A853192AD6409B9EFBD9F549BDE32BD890AE01F9A221E81FEE1C407090550647790E0D60775B855E181C2FB5#) (e #010001#))) (private-key (rsa (n #00FDBF170366AC43B7D95CF9085565C566FB1F21B17C0A36E68F35ABB500E7851E00B40D7B04C8CD25903371F38E4C298FACEFFC4C97E913B536A0672BAF99D04515AE98A1A56627CD7EB02502FCFBEEA21AF13CC1A853192AD6409B9EFBD9F549BDE32BD890AE01F9A221E81FEE1C407090550647790E0D60775B855E181C2FB5#) (e #010001#) (d #2790250C2E74C2FD3;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2022 Mathieu Othacehe <othacehe@gnu.org> ;;; Copyright © 2023 Oleg Pykhalov <go.wigust@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu image) #:use-module (guix platform) #:use-module (guix records) #:use-module (guix diagnostics) #:use-module (guix i18n) #:use-module (srfi srfi-1) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:export (partition partition? partition-device partition-size partition-offset partition-file-system partition-file-system-options partition-label partition-uuid partition-flags partition-initializer image image? image-name image-format image-platform image-size image-max-layers image-operating-system image-partition-table-type image-partitions image-compression? image-volatile-root? image-shared-store? image-shared-network? image-substitutable? image-type image-type? image-type-name image-type-constructor os->image os+platform->image)) ;;; ;;; Sanitizers. ;;; ;; Image and partition sizes can be either be a size in bytes or the 'guess ;; symbol denoting that the size should be estimated by Guix, according to the ;; image content. (define-with-syntax-properties (validate-size (value properties)) (unless (and value (or (eq? value 'guess) (integer? value))) (raise (make-compound-condition (condition (&error-location (location (source-properties->location properties)))) (formatted-message (G_ "size (~a) can only be 'guess or a numeric expression ~%") value 'field)))) value) ;;; ;;; Partition record. ;;; ;; The partition offset should be a bytes count as an integer. (define-with-syntax-properties (validate-partition-offset (value properties)) (unless (and value (integer? value)) (raise (make-compound-condition (condition (&error-location (location (source-properties->location properties)))) (formatted-message (G_ "the partition offset (~a) can only be a \ numeric expression ~%") value 'field)))) value) ;; The