1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
5 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2015, 2016, 2017, 2018 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
10 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
11 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
13 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages tls)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix utils)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system perl)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system haskell)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages dns)
45 #:use-module (gnu packages guile)
46 #:use-module (gnu packages haskell)
47 #:use-module (gnu packages haskell-check)
48 #:use-module (gnu packages haskell-crypto)
49 #:use-module (gnu packages libbsd)
50 #:use-module (gnu packages libffi)
51 #:use-module (gnu packages libidn)
52 #:use-module (gnu packages linux)
53 #:use-module (gnu packages ncurses)
54 #:use-module (gnu packages nettle)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages python-crypto)
59 #:use-module (gnu packages python-web)
60 #:use-module (gnu packages texinfo)
61 #:use-module (gnu packages time)
62 #:use-module (gnu packages base)
63 #:use-module (srfi srfi-1))
65 (define-public libtasn1
72 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
76 "1jlc1iahj8k3haz28j55nzg7sgni5h41vqy461i1bpbx6668wlky"))))
77 (build-system gnu-build-system)
78 (native-inputs `(("perl" ,perl)))
79 (home-page "https://www.gnu.org/software/libtasn1/")
80 (synopsis "ASN.1 library")
82 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
83 for transmitting machine-neutral encodings of data objects in computer
84 networking, allowing for formal validation of data according to some
86 (license license:lgpl2.0+)))
94 (uri (string-append "https://lionet.info/soft/asn1c-"
98 "1fc64g45ykmv73kdndr4zdm4wxhimhrir4rxnygxvwkych5l81w0"))))
99 (build-system gnu-build-system)
102 (home-page "https://lionet.info/asn1c")
103 (synopsis "ASN.1 to C compiler")
104 (description "The ASN.1 to C compiler takes ASN.1 module
105 files and generates C++ compatible C source code. That code can be
106 used to serialize the native C structures into compact and unambiguous
107 BER/XER/PER-based data files, and deserialize the files back.
109 Various ASN.1 based formats are widely used in the industry, such as to encode
110 the X.509 certificates employed in the HTTPS handshake, to exchange control
111 data between mobile phones and cellular networks, to car-to-car communication
112 in intelligent transportation networks.")
113 (license license:bsd-2)))
115 (define-public p11-kit
122 (uri (string-append "https://github.com/p11-glue/p11-kit/releases/"
123 "download/" version "/p11-kit-" version ".tar.gz"))
126 "0hxfwnyb5yllvlsh0cj6favcph36gm94b6df7zhl7xay48zjl8gr"))))
127 (build-system gnu-build-system)
129 `(("pkg-config" ,pkg-config)))
132 ("libtasn1" ,libtasn1)))
134 `(#:configure-flags '("--without-trust-paths")))
135 (home-page "https://p11-glue.freedesktop.org/p11-kit.html")
136 (synopsis "PKCS#11 library")
138 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
139 provides a standard configuration setup for installing PKCS#11 modules
140 in such a way that they are discoverable. It also solves problems with
141 coordinating the use of PKCS#11 by different components or libraries
142 living in the same process.")
143 (license license:bsd-3)))
145 (define-public gnutls
152 ;; Note: Releases are no longer on ftp.gnu.org since the
153 ;; schism (after version 3.1.5).
154 (string-append "mirror://gnupg/gnutls/v"
155 (version-major+minor version)
156 "/gnutls-" version ".tar.xz"))
158 (search-patches "gnutls-skip-trust-store-test.patch"
159 "gnutls-skip-pkgconfig-test.patch"))
162 "0d02x28fwkkx7xzn7807nww6idchizzq3plx8sfcyiw7wzclh8mf"))))
163 (build-system gnu-build-system)
165 `(; Ensure we don't keep a reference to this buggy software.
166 #:disallowed-references (,net-tools)
169 ;; GnuTLS doesn't consult any environment variables to specify
170 ;; the location of the system-wide trust store. Instead it has a
171 ;; configure-time option. Unless specified, its configure script
172 ;; attempts to auto-detect the location by looking for common
173 ;; places in the file system, none of which are present in our
174 ;; chroot build environment. If not found, then no default trust
175 ;; store is used, so each program has to provide its own
176 ;; fallback, and users have to configure each program
177 ;; independently. This seems suboptimal.
178 "--with-default-trust-store-dir=/etc/ssl/certs"
180 ;; FIXME: Temporarily disable p11-kit support since it is not
181 ;; working on mips64el.
184 #:phases (modify-phases %standard-phases
187 (lambda* (#:key outputs #:allow-other-keys)
188 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
189 (let* ((out (assoc-ref outputs "out"))
190 (doc (assoc-ref outputs "doc"))
191 (mandir (string-append doc "/share/man/man3"))
192 (oldman (string-append out "/share/man/man3")))
194 (copy-recursively oldman mandir)
195 (delete-file-recursively oldman)
197 (outputs '("out" ;4.4 MiB
199 "doc")) ;4.1 MiB of man pages
201 `(("net-tools" ,net-tools)
202 ("pkg-config" ,pkg-config)
205 `(("guile" ,guile-2.2)))
207 ;; These are all in the 'Requires.private' field of gnutls.pc.
208 `(("libtasn1" ,libtasn1)
212 (home-page "https://www.gnu.org/software/gnutls/")
213 (synopsis "Transport layer security library")
215 "GnuTLS is a secure communications library implementing the SSL, TLS
216 and DTLS protocols. It is provided in the form of a C library to support the
217 protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
218 required structures.")
219 (license license:lgpl2.1+)
220 (properties '((ftp-server . "ftp.gnutls.org")
221 (ftp-directory . "/gcrypt/gnutls")))))
223 (define-public gnutls/guile-2.2
224 (deprecated-package "guile2.2-gnutls" gnutls))
226 (define-public gnutls/guile-2.0
227 ;; GnuTLS for Guile 2.0.
230 (name "guile2.0-gnutls")
231 (inputs `(("guile" ,guile-2.0)
232 ,@(alist-delete "guile" (package-inputs gnutls))))))
234 (define-public gnutls/dane
235 ;; GnuTLS with build libgnutls-dane, implementing DNS-based
236 ;; Authentication of Named Entities. This is required for GNS functionality
237 ;; by GNUnet and gnURL. This is done in an extra package definition
238 ;; to have the choice between GnuTLS with Dane and without Dane.
242 (inputs `(("unbound" ,unbound)
243 ,@(package-inputs gnutls)))))
245 (define-public openssl
251 (uri (list (string-append "https://www.openssl.org/source/openssl-"
253 (string-append "ftp://ftp.openssl.org/source/"
254 name "-" version ".tar.gz")
255 (string-append "ftp://ftp.openssl.org/source/old/"
256 (string-trim-right version char-set:letter)
257 "/" name "-" version ".tar.gz")))
260 "1zm82pyq5a9jm10q6iv7d3dih3xwjds4x30fqph3k317byvsn2rp"))
263 ;; Remove ELF files. 'substitute*' can't read them.
264 (delete-file "test/ssltest_old")
265 (delete-file "test/v3ext")
266 (delete-file "test/x509aux")
268 (patches (search-patches "openssl-runpath.patch"
269 "openssl-c-rehash-in.patch"))))
270 (build-system gnu-build-system)
272 "doc" ;1.5MiB of man3 pages
273 "static")) ;6MiB of .a files
274 (native-inputs `(("perl" ,perl)))
276 `(#:disallowed-references (,perl)
281 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
282 ;; so we explicitly disallow it here.
283 #:disallowed-references ,(list (canonical-package perl))
285 (modify-phases %standard-phases
287 'configure 'patch-Makefile.org
288 (lambda* (#:key outputs #:allow-other-keys)
289 ;; The default MANDIR is some unusual place. Fix that.
290 (let ((out (assoc-ref outputs "out")))
291 (patch-makefile-SHELL "Makefile.org")
292 (substitute* "Makefile.org"
293 (("^MANDIR[[:blank:]]*=.*$")
294 (string-append "MANDIR = " out "/share/man\n")))
298 (lambda* (#:key outputs #:allow-other-keys)
299 (let ((out (assoc-ref outputs "out")))
300 (apply invoke "./config"
301 "shared" ;build shared libraries
304 ;; The default for this catch-all directory is
305 ;; PREFIX/ssl. Change that to something more
307 (string-append "--openssldir=" out
308 "/share/openssl-" ,version)
310 (string-append "--prefix=" out)
312 ;; XXX FIXME: Work around a code generation bug in GCC
313 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
314 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
315 ,@(if (and (not (%current-target-system))
316 (string-prefix? "armhf" (%current-system)))
320 'install 'make-libraries-writable
321 (lambda* (#:key outputs #:allow-other-keys)
322 ;; Make libraries writable so that 'strip' does its job.
323 (let ((out (assoc-ref outputs "out")))
324 (for-each (lambda (file)
326 (find-files (string-append out "/lib")
329 (add-after 'install 'move-static-libraries
330 (lambda* (#:key outputs #:allow-other-keys)
331 ;; Move static libraries to the "static" output.
332 (let* ((out (assoc-ref outputs "out"))
333 (lib (string-append out "/lib"))
334 (static (assoc-ref outputs "static"))
335 (slib (string-append static "/lib")))
336 (for-each (lambda (file)
337 (install-file file slib)
339 (find-files lib "\\.a$"))
341 (add-after 'install 'move-man3-pages
342 (lambda* (#:key outputs #:allow-other-keys)
343 ;; Move section 3 man pages to "doc".
344 (let* ((out (assoc-ref outputs "out"))
345 (man3 (string-append out "/share/man/man3"))
346 (doc (assoc-ref outputs "doc"))
347 (target (string-append doc "/share/man/man3")))
349 (for-each (lambda (file)
351 (string-append target "/"
354 (delete-file-recursively man3)
357 'patch-source-shebangs 'patch-tests
358 (lambda* (#:key inputs native-inputs #:allow-other-keys)
359 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
360 (substitute* (find-files "test" ".*")
362 (string-append bash "/bin/sh"))
367 'install 'remove-miscellany
368 (lambda* (#:key outputs #:allow-other-keys)
369 ;; The 'misc' directory contains random undocumented shell and Perl
370 ;; scripts. Remove them to avoid retaining a reference on Perl.
371 (let ((out (assoc-ref outputs "out")))
372 (delete-file-recursively (string-append out "/share/openssl-"
376 (list (search-path-specification
377 (variable "SSL_CERT_DIR")
378 (separator #f) ;single entry
379 (files '("etc/ssl/certs")))
380 (search-path-specification
381 (variable "SSL_CERT_FILE")
383 (separator #f) ;single entry
384 (files '("etc/ssl/certs/ca-certificates.crt")))))
385 (synopsis "SSL/TLS implementation")
387 "OpenSSL is an implementation of SSL/TLS.")
388 (license license:openssl)
389 (home-page "https://www.openssl.org/")))
391 (define-public openssl-next
398 (uri (list (string-append "https://www.openssl.org/source/openssl-"
400 (string-append "ftp://ftp.openssl.org/source/"
401 name "-" version ".tar.gz")
402 (string-append "ftp://ftp.openssl.org/source/old/"
403 (string-trim-right version char-set:letter)
404 "/" name "-" version ".tar.gz")))
405 (patches (search-patches "openssl-1.1.0-c-rehash-in.patch"))
408 "1bvka2wf33w2vxv7yw578nnjqyhz2b3chvfb0l4k2ffscw950kfy"))))
410 "doc" ;1.3MiB of man3 pages
411 "static")) ; 5.5MiB of .a files
413 (substitute-keyword-arguments (package-arguments openssl)
415 `(modify-phases ,phases
416 (delete 'patch-tests) ; These two phases are not needed by
417 (delete 'patch-Makefile.org) ; OpenSSL 1.1.0.
419 ;; Override configure phase since -rpath is now a configure option.
421 (lambda* (#:key outputs #:allow-other-keys)
422 (let* ((out (assoc-ref outputs "out"))
423 (lib (string-append out "/lib")))
424 (apply invoke "./config"
425 "shared" ;build shared libraries
428 ;; The default for this catch-all directory is
429 ;; PREFIX/ssl. Change that to something more
431 (string-append "--openssldir=" out
432 "/share/openssl-" ,version)
434 (string-append "--prefix=" out)
435 (string-append "-Wl,-rpath," lib)
437 ;; XXX FIXME: Work around a code generation bug in GCC
438 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
439 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
440 ,@(if (and (not (%current-target-system))
441 (string-prefix? "armhf" (%current-system)))
445 ;; XXX: Duplicate this phase to make sure 'version' evaluates
446 ;; in the current scope and not the inherited one.
447 (replace 'remove-miscellany
448 (lambda* (#:key outputs #:allow-other-keys)
449 ;; The 'misc' directory contains random undocumented shell and Perl
450 ;; scripts. Remove them to avoid retaining a reference on Perl.
451 (let ((out (assoc-ref outputs "out")))
452 (delete-file-recursively (string-append out "/share/openssl-"
456 (define-public libressl
462 (uri (string-append "mirror://openbsd/LibreSSL/"
463 name "-" version ".tar.gz"))
466 "07yi37a2ghsgj2b4w30q1s4d2inqnix7ika1m21y57p9z71212k3"))))
467 (build-system gnu-build-system)
469 ;; Do as if 'getentropy' was missing since older Linux kernels lack it
470 ;; and libc would return ENOSYS, which is not properly handled.
471 ;; See <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00235.html>.
472 '(#:configure-flags '("ac_cv_func_getentropy=no"
473 ;; Provide a TLS-enabled netcat.
476 ;; FIXME: These two variables must designate a single file or directory
477 ;; and are not actually "search paths." In practice it works OK in
478 ;; user profiles because there's always just one item that matches the
480 (list (search-path-specification
481 (variable "SSL_CERT_DIR")
482 (files '("etc/ssl/certs")))
483 (search-path-specification
484 (variable "SSL_CERT_FILE")
485 (files '("etc/ssl/certs/ca-certificates.crt")))))
486 (home-page "https://www.libressl.org/")
487 (synopsis "SSL/TLS implementation")
488 (description "LibreSSL is a version of the TLS/crypto stack, forked from
489 OpenSSL in 2014 with the goals of modernizing the codebase, improving security,
490 and applying best practice development processes. This package also includes a
491 netcat implementation that supports TLS.")
492 ;; Files taken from OpenSSL keep their license, others are under various
493 ;; non-copyleft licenses.
494 (license (list license:openssl
495 (license:non-copyleft
497 "See COPYING in the distribution.")))))
499 (define-public python-acme
502 ;; Remember to update the hash of certbot when updating python-acme.
506 (uri (pypi-uri "acme" version))
509 "02x6f37ddldaxrxzh2wjw8wmzqchxb7gl5i4i4daysas9yzqlvi9"))))
510 (build-system python-build-system)
513 (modify-phases %standard-phases
514 (add-after 'build 'build-documentation
516 (zero? (system* "make" "-C" "docs" "man" "info"))))
517 (add-after 'install 'install-documentation
518 (lambda* (#:key outputs #:allow-other-keys)
519 (let* ((out (assoc-ref outputs "out"))
520 (man (string-append out "/share/man/man1"))
521 (info (string-append out "/info")))
522 (install-file "docs/_build/texinfo/acme-python.info" info)
523 (install-file "docs/_build/man/acme-python.1" man)
525 ;; TODO: Add optional inputs for testing.
527 `(("python-mock" ,python-mock)
529 ("python-sphinx" ,python-sphinx)
530 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
531 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
532 ("texinfo" ,texinfo)))
534 `(("python-josepy" ,python-josepy)
535 ("python-six" ,python-six)
536 ("python-requests" ,python-requests)
537 ("python-pytz" ,python-pytz)
538 ("python-pyrfc3339" ,python-pyrfc3339)
539 ("python-pyasn1" ,python-pyasn1)
540 ("python-cryptography" ,python-cryptography)
541 ("python-pyopenssl" ,python-pyopenssl)))
542 (home-page "https://github.com/certbot/certbot")
543 (synopsis "ACME protocol implementation in Python")
544 (description "ACME protocol implementation in Python")
545 (license license:asl2.0)))
547 (define-public certbot
550 ;; Certbot and python-acme are developed in the same repository, and their
551 ;; versions should remain synchronized.
552 (version (package-version python-acme))
555 (uri (pypi-uri name version))
558 "1sn4wqkp6kjj9p8maf4jnjwwvb083hgakm9i10rk9273nnqfkj76"))))
559 (build-system python-build-system)
561 `(,@(substitute-keyword-arguments (package-arguments python-acme)
563 `(modify-phases ,phases
564 (replace 'install-documentation
565 (lambda* (#:key outputs #:allow-other-keys)
566 (let* ((out (assoc-ref outputs "out"))
567 (man1 (string-append out "/share/man/man1"))
568 (man7 (string-append out "/share/man/man7"))
569 (info (string-append out "/info")))
570 (install-file "docs/_build/texinfo/Certbot.info" info)
571 (install-file "docs/_build/man/certbot.1" man1)
572 (install-file "docs/_build/man/certbot.7" man7)
574 ;; TODO: Add optional inputs for testing.
576 `(("python-nose" ,python-nose)
577 ("python-mock" ,python-mock)
579 ("python-sphinx" ,python-sphinx)
580 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
581 ("python-sphinx-repoze-autointerface" ,python-sphinx-repoze-autointerface)
582 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
583 ("texinfo" ,texinfo)))
585 `(("python-acme" ,python-acme)
586 ("python-zope-interface" ,python-zope-interface)
587 ("python-pyrfc3339" ,python-pyrfc3339)
588 ("python-pyopenssl" ,python-pyopenssl)
589 ("python-configobj" ,python-configobj)
590 ("python-configargparse" ,python-configargparse)
591 ("python-zope-component" ,python-zope-component)
592 ("python-parsedatetime" ,python-parsedatetime)
593 ("python-six" ,python-six)
594 ("python-psutil" ,python-psutil)
595 ("python-requests" ,python-requests)
596 ("python-pytz" ,python-pytz)))
597 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
598 (description "Certbot automatically receives and installs X.509 certificates
599 to enable Transport Layer Security (TLS) on servers. It interoperates with the
600 Let’s Encrypt certificate authority (CA), which issues browser-trusted
601 certificates for free.")
602 (home-page "https://certbot.eff.org/")
603 (license license:asl2.0)))
605 (define-public letsencrypt
606 (package (inherit certbot)
608 (properties `((superseded . ,certbot)))))
610 (define-public perl-net-ssleay
612 (name "perl-net-ssleay")
616 (uri (string-append "mirror://cpan/authors/id/M/MI/MIKEM/"
617 "Net-SSLeay-" version ".tar.gz"))
620 "1rf78z1macgmp6mwd7c2xq4yfw6wpf28hfwfz1d5wslqr4cwb5aq"))))
621 (build-system perl-build-system)
622 (inputs `(("openssl" ,openssl)))
625 (modify-phases %standard-phases
627 'configure 'set-ssl-prefix
628 (lambda* (#:key inputs #:allow-other-keys)
629 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
631 (synopsis "Perl extension for using OpenSSL")
633 "This module offers some high level convenience functions for accessing
634 web pages on SSL servers (for symmetry, the same API is offered for accessing
635 http servers, too), an sslcat() function for writing your own clients, and
636 finally access to the SSL api of the SSLeay/OpenSSL package so you can write
637 servers or clients for more complicated applications.")
638 (license license:perl-license)
639 (home-page "http://search.cpan.org/~mikem/Net-SSLeay-1.66/")))
641 (define-public perl-crypt-openssl-rsa
643 (name "perl-crypt-openssl-rsa")
649 "mirror://cpan/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-"
654 "1gnpvv09b2gpifwdzc5jnhama3d1a4c39lzj9hcaicsb8rvzjmsk"))))
655 (build-system perl-build-system)
657 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
658 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
659 ("openssl" ,openssl)))
660 (arguments perl-crypt-arguments)
662 "http://search.cpan.org/dist/Crypt-OpenSSL-RSA")
664 "RSA encoding and decoding, using the openSSL libraries")
665 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
666 OpenSSL libraries).")
667 (license license:perl-license)))
669 (define perl-crypt-arguments
670 `(#:phases (modify-phases %standard-phases
671 (add-before 'configure 'patch-Makefile.PL
672 (lambda* (#:key inputs #:allow-other-keys)
673 (substitute* "Makefile.PL"
674 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
675 (assoc-ref inputs "openssl")
676 "/lib -lcrypto'],")))
679 (define-public perl-crypt-openssl-bignum
681 (name "perl-crypt-openssl-bignum")
687 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
692 "1p22znbajq91lbk2k3yg12ig7hy5b4vy8igxwqkmbm4nhgxp4ki3"))))
693 (build-system perl-build-system)
694 (inputs `(("openssl" ,openssl)))
695 (arguments perl-crypt-arguments)
697 "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum")
699 "OpenSSL's multiprecision integer arithmetic in Perl")
700 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
701 arithmetic in Perl.")
702 ;; At your option either gpl1+ or the Artistic License
703 (license license:perl-license)))
705 (define-public perl-crypt-openssl-random
707 (name "perl-crypt-openssl-random")
713 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
718 "0yjcabkibrkafywvdkmd1xpi6br48skyk3l15ni176wvlg38335v"))))
719 (build-system perl-build-system)
720 (inputs `(("openssl" ,openssl)))
721 (arguments perl-crypt-arguments)
723 "http://search.cpan.org/dist/Crypt-OpenSSL-Random")
725 "OpenSSL/LibreSSL pseudo-random number generator access")
726 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
728 (license license:perl-license)))
730 (define-public acme-client
736 (uri (string-append "https://kristaps.bsd.lv/" name "/"
737 "snapshots/" name "-portable-"
741 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
742 (build-system gnu-build-system)
744 '(#:tests? #f ; no test suite
747 (string-append "PREFIX=" (assoc-ref %outputs "out")))
749 (modify-phases %standard-phases
750 (add-after 'unpack 'patch-paths
751 (lambda* (#:key inputs #:allow-other-keys)
752 (let ((pem (string-append (assoc-ref inputs "libressl")
753 "/etc/ssl/cert.pem")))
754 (substitute* "http.c"
755 (("/etc/ssl/cert.pem") pem))
757 (delete 'configure)))) ; no './configure' script
759 `(("pkg-config" ,pkg-config)))
762 ("libressl" ,libressl)))
763 (synopsis "Let's Encrypt client by the OpenBSD project")
764 (description "acme-client is a Let's Encrypt client implemented in C. It
765 uses a modular design, and attempts to secure itself by dropping privileges and
766 operating in a chroot where possible. acme-client is developed on OpenBSD and
767 then ported to the GNU / Linux environment.")
768 (home-page "https://kristaps.bsd.lv/acme-client/")
769 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
770 ;; and 'jsmn.c' are distributed under the Expat license.
771 (license (list license:isc license:expat))))
773 ;; The "-apache" variant is the upstreamed prefered variant. A "-gpl"
774 ;; variant exists in addition to the "-apache" one.
775 (define-public mbedtls-apache
777 (name "mbedtls-apache")
782 ;; XXX: The download links on the website are script redirection links
783 ;; which effectively lead to the format listed in the uri here.
784 (uri (string-append "https://tls.mbed.org/download/mbedtls-"
785 version "-apache.tgz"))
788 "1vsmgxnw7dpvma51896n63yaf9sncmf885ax2jfcg89ssin6vdmf"))
789 ;; An RFC 5114 constant was accidentally renamed in version 2.7.0.
790 ;; See https://github.com/ARMmbed/mbedtls/pull/1362.
791 (modules '((guix build utils)))
794 (substitute* "include/mbedtls/dhm.h"
795 (("#define MBEDTLS_DHM_RFC5114_MODP_P")
796 "#define MBEDTLS_DHM_RFC5114_MODP_2048_P"))
798 (build-system cmake-build-system)
801 (list "-DUSE_SHARED_MBEDTLS_LIBRARY=ON")))
804 (synopsis "Small TLS library")
806 "@code{mbed TLS}, formerly known as PolarSSL, makes it trivially easy
807 for developers to include cryptographic and SSL/TLS capabilities in their
808 (embedded) products, facilitating this functionality with a minimal
810 (home-page "https://tls.mbed.org")
811 (license license:asl2.0)))
813 (define-public ghc-tls
819 (uri (string-append "https://hackage.haskell.org/package/"
820 "tls/tls-" version ".tar.gz"))
823 "1rdidf18i781c0vdvy9yn79yh08hmcacf6fp3sgghyiy3h0wyh5l"))))
824 (build-system haskell-build-system)
826 `(("ghc-mtl" ,ghc-mtl)
827 ("ghc-cereal" ,ghc-cereal)
828 ("ghc-data-default-class" ,ghc-data-default-class)
829 ("ghc-memory" ,ghc-memory)
830 ("ghc-cryptonite" ,ghc-cryptonite)
831 ("ghc-asn1-types" ,ghc-asn1-types)
832 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
833 ("ghc-x509" ,ghc-x509)
834 ("ghc-x509-store" ,ghc-x509-store)
835 ("ghc-x509-validation" ,ghc-x509-validation)
836 ("ghc-async" ,ghc-async)
837 ("ghc-network" ,ghc-network)
838 ("ghc-hourglass" ,ghc-hourglass)))
840 `(("ghc-tasty" ,ghc-tasty)
841 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
842 ("ghc-quickcheck" ,ghc-quickcheck)))
843 (home-page "https://github.com/vincenthz/hs-tls")
845 "TLS/SSL protocol native implementation (Server and Client)")
847 "Native Haskell TLS and SSL protocol implementation for server and client.
848 This provides a high-level implementation of a sensitive security protocol,
849 eliminating a common set of security issues through the use of the advanced
850 type system, high level constructions and common Haskell features. Currently
851 implement the SSL3.0, TLS1.0, TLS1.1 and TLS1.2 protocol, and support RSA and
852 Ephemeral (Elliptic curve and regular) Diffie Hellman key exchanges, and many
854 (license license:bsd-3)))