openpgp.scm 7.9 KB

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