| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org> |
| 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; |
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 7 | ;;; under the terms of the GNU General Public License as published by |
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 9 | ;;; your option) any later version. |
| 10 | ;;; |
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; GNU General Public License for more details. |
| 15 | ;;; |
| 16 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | (define-module (gnu packages openpgp) |
| 20 | #:use-module (guix packages) |
| 21 | #:use-module (guix download) |
| 22 | #:use-module (guix git-download) |
| 23 | #:use-module (guix build-system cmake) |
| 24 | #:use-module (guix build-system gnu) |
| 25 | #:use-module ((guix licenses) #:prefix license:) |
| 26 | #:use-module (gnu packages) |
| 27 | #:use-module (gnu packages check) |
| 28 | #:use-module (gnu packages compression) |
| 29 | #:use-module (gnu packages crypto) |
| 30 | #:use-module (gnu packages gnupg) |
| 31 | #:use-module (gnu packages multiprecision) |
| 32 | #:use-module (gnu packages pkg-config) |
| 33 | #:use-module (gnu packages python) |
| 34 | #:use-module (gnu packages web)) |
| 35 | |
| 36 | (define-public libtmcg |
| 37 | (package |
| 38 | (name "libtmcg") |
| 39 | (version "1.3.18") |
| 40 | (source (origin |
| 41 | (method url-fetch) |
| 42 | (uri (string-append "mirror://savannah/libtmcg/libTMCG-" version |
| 43 | ".tar.gz")) |
| 44 | (sha256 |
| 45 | (base32 |
| 46 | "179b5jx3mqs9hgsj8cfwk6x8qib60kw9szk9fkz6s1gl3v83mnyx")))) |
| 47 | (build-system gnu-build-system) |
| 48 | (arguments '(#:configure-flags '("--enable-silent-rules"))) |
| 49 | (inputs `(("gmp" ,gmp) |
| 50 | ("libgcrypt" ,libgcrypt))) |
| 51 | (synopsis |
| 52 | "C++ library for creating secure and fair online card games") |
| 53 | (description |
| 54 | "The library provides a sort of useful classes, algorithms, and |
| 55 | high-level protocols to support an application programmer in writing such |
| 56 | software. The most remarkable feature is the absence of a trusted third |
| 57 | party (TTP), i.e. neither a central game server nor trusted hardware |
| 58 | components are necessary. |
| 59 | |
| 60 | The corresponding cryptographic problem, actually called Mental Poker, has |
| 61 | been studied since 1979 (Shamir, Rivest, and Adleman) by many authors. |
| 62 | LibTMCG provides the first practical implementation of such protocols.") |
| 63 | (home-page "https://www.nongnu.org/libtmcg/") |
| 64 | (license license:gpl2+))) |
| 65 | |
| 66 | (define-public dkgpg |
| 67 | (package |
| 68 | (name "dkgpg") |
| 69 | (version "1.1.3") |
| 70 | (source (origin |
| 71 | (method url-fetch) |
| 72 | (uri (string-append "mirror://savannah/dkgpg/dkgpg-" version |
| 73 | ".tar.gz")) |
| 74 | (sha256 |
| 75 | (base32 |
| 76 | "1hpfg7akd5icj49i03z74hp9zj0xwl90bndn0hnw0hpb8lk7qcxg")))) |
| 77 | (build-system gnu-build-system) |
| 78 | (arguments '(#:configure-flags |
| 79 | '("--enable-silent-rules") |
| 80 | ;; https://savannah.nongnu.org/bugs/?58772 |
| 81 | #:parallel-tests? #f)) |
| 82 | (inputs `(("bzip2" ,bzip2) |
| 83 | ("gmp" ,gmp) |
| 84 | ("libgcrypt" ,libgcrypt) |
| 85 | ("libtmcg" ,libtmcg) |
| 86 | ("zlib" ,zlib))) |
| 87 | (synopsis |
| 88 | "Distributed Key Generation and Threshold Cryptography for OpenPGP") |
| 89 | (description |
| 90 | "The Distributed Privacy Guard (DKGPG) implements Distributed Key |
| 91 | Generation (DKG) and Threshold Cryptography for OpenPGP. The generated public |
| 92 | keys are compatible with the standard and thus can be used by any |
| 93 | RFC4880-compliant application (e.g. GnuPG). The main purposes of this |
| 94 | software are distributing power among multiple parties, eliminating single |
| 95 | points of failure, and increasing the difficulty of side-channel attacks on |
| 96 | private key material. |
| 97 | |
| 98 | DKGPG consists of a bunch of simple command-line programs. The current |
| 99 | implementation is in experimental state and should NOT be used in production |
| 100 | environments.") |
| 101 | (home-page "https://www.nongnu.org/dkgpg/") |
| 102 | (license license:gpl2+))) |
| 103 | |
| 104 | (define-public rnp |
| 105 | ;; Packaging the currently released version requires a large number of |
| 106 | ;; patches. For now, we package a snapshot instead. |
| 107 | (let ((commit "203224f0b1505dba17837c03da603e5b98ab125a") |
| 108 | (revision "0") |
| 109 | (last-version "0.13.1") |
| 110 | (day-of-release "2020-07-21")) |
| 111 | (package |
| 112 | (name "rnp") |
| 113 | (version (git-version last-version revision commit)) |
| 114 | (source (origin |
| 115 | (method git-fetch) |
| 116 | (uri (git-reference |
| 117 | (url "https://github.com/rnpgp/rnp") |
| 118 | (commit commit))) |
| 119 | (file-name |
| 120 | (string-append name "-" (string-take commit 7) "-checkout")) |
| 121 | (sha256 |
| 122 | (base32 |
| 123 | "1rnwhc9ys4v4mv584hmmrl0ycnqmsaigpffzm31qq337hz24zqya")) |
| 124 | (patches |
| 125 | (search-patches "rnp-unbundle-googletest.patch" |
| 126 | "rnp-disable-ruby-rnp-tests.patch" |
| 127 | "rnp-add-version.cmake.patch")))) |
| 128 | (build-system cmake-build-system) |
| 129 | (arguments `(#:configure-flags |
| 130 | '("-DBUILD_SHARED_LIBS=on" |
| 131 | "-DBUILD_TESTING=on") |
| 132 | #:phases |
| 133 | (modify-phases %standard-phases |
| 134 | (add-after 'unpack 'fixes |
| 135 | (lambda* (#:key inputs #:allow-other-keys) |
| 136 | (copy-recursively (assoc-ref inputs "googletest-source") |
| 137 | "src/tests/googletest-src") |
| 138 | (substitute* "src/tests/support.cpp" |
| 139 | (("\"cp\"") (string-append "\"" (which "cp") "\""))) |
| 140 | ;; Produce a version stamp in the format the upstream |
| 141 | ;; project uses for unreleased revisions. |
| 142 | (with-output-to-file "version.txt" |
| 143 | (lambda _ |
| 144 | (display |
| 145 | (string-append ,last-version |
| 146 | "-" ,revision |
| 147 | "-g" ,(string-take commit 7))))) |
| 148 | #t)) |
| 149 | (replace 'check |
| 150 | (lambda _ |
| 151 | ;; Some OpenPGP certificates used by the tests expire. |
| 152 | ;; To work around that, set the time to roughly the |
| 153 | ;; release date. |
| 154 | (invoke "faketime" ,day-of-release "make" "test")))))) |
| 155 | (native-inputs |
| 156 | `(("gnupg" ,gnupg) ; for tests |
| 157 | ("googletest-source" ,(package-source googletest)) ; for tests |
| 158 | ("libfaketime" ,libfaketime) ; for tests |
| 159 | ("pkg-config" ,pkg-config) |
| 160 | ("python" ,python) |
| 161 | ("python2" ,python-2.7))) |
| 162 | (inputs `(("botan" ,botan) |
| 163 | ("bzip2" ,bzip2) |
| 164 | ("json-c" ,json-c) |
| 165 | ("zlib" ,zlib))) |
| 166 | (synopsis |
| 167 | "RFC4880-compliant OpenPGP library written in C++") |
| 168 | (description |
| 169 | "Set of OpenPGP (RFC4880) tools that works on Linux, *BSD and macOS as a |
| 170 | replacement of GnuPG. It is maintained by Ribose after being forked from |
| 171 | NetPGP, itself originally written for NetBSD. |
| 172 | |
| 173 | librnp is the library used by rnp for all OpenPGP functions, useful for |
| 174 | developers to build against. It is a “real” library, not a wrapper like GPGME |
| 175 | of GnuPG.") |
| 176 | (home-page "https://www.rnpgp.com/") |
| 177 | (license |
| 178 | ;; RNP contains code written by Ribose and code derived from netpgp. |
| 179 | (list |
| 180 | ;; Ribose's BSD 2-Clause License and NetBSD's BSD 2-Clause License |
| 181 | ;; (netpgp). |
| 182 | license:bsd-2 |
| 183 | ;; Nominet UK's Apache 2.0 Licence (netpgp). |
| 184 | license:asl2.0 |
| 185 | ;; Nominet UK's BSD 3-Clause License (netpgp). |
| 186 | license:bsd-3))))) |