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 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 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017, 2018 Nils Gillmann <ng0@n0.is>
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
69 (replacement libtasn1/fixed)
73 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
77 "0ls7jdq3y5fnrwg0pzhq11m21r8pshac2705bczz6mqjc8pdllv7"))
78 (patches (search-patches "libtasn1-CVE-2017-10790.patch"))))
79 (build-system gnu-build-system)
80 (native-inputs `(("perl" ,perl)))
81 (home-page "https://www.gnu.org/software/libtasn1/")
82 (synopsis "ASN.1 library")
84 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
85 for transmitting machine-neutral encodings of data objects in computer
86 networking, allowing for formal validation of data according to some
88 (license license:lgpl2.0+)))
90 (define libtasn1/fixed
94 (inherit (package-source libtasn1))
95 (patches (search-patches "libtasn1-CVE-2017-10790.patch"
96 "libtasn1-CVE-2018-6003.patch"))))))
104 (uri (string-append "https://lionet.info/soft/asn1c-"
108 "1fc64g45ykmv73kdndr4zdm4wxhimhrir4rxnygxvwkych5l81w0"))))
109 (build-system gnu-build-system)
112 (home-page "https://lionet.info/asn1c")
113 (synopsis "ASN.1 to C compiler")
114 (description "The ASN.1 to C compiler takes ASN.1 module
115 files and generates C++ compatible C source code. That code can be
116 used to serialize the native C structures into compact and unambiguous
117 BER/XER/PER-based data files, and deserialize the files back.
119 Various ASN.1 based formats are widely used in the industry, such as to encode
120 the X.509 certificates employed in the HTTPS handshake, to exchange control
121 data between mobile phones and cellular networks, to car-to-car communication
122 in intelligent transportation networks.")
123 (license license:bsd-2)))
125 (define-public p11-kit
132 (uri (string-append "https://github.com/p11-glue/p11-kit/releases/"
133 "download/" version "/p11-kit-" version ".tar.gz"))
136 "0hxfwnyb5yllvlsh0cj6favcph36gm94b6df7zhl7xay48zjl8gr"))))
137 (build-system gnu-build-system)
139 `(("pkg-config" ,pkg-config)))
142 ("libtasn1" ,libtasn1)))
144 `(#:configure-flags '("--without-trust-paths")))
145 (home-page "https://p11-glue.freedesktop.org/p11-kit.html")
146 (synopsis "PKCS#11 library")
148 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
149 provides a standard configuration setup for installing PKCS#11 modules
150 in such a way that they are discoverable. It also solves problems with
151 coordinating the use of PKCS#11 by different components or libraries
152 living in the same process.")
153 (license license:bsd-3)))
155 (define-public gnutls
162 ;; Note: Releases are no longer on ftp.gnu.org since the
163 ;; schism (after version 3.1.5).
164 (string-append "mirror://gnupg/gnutls/v"
165 (version-major+minor version)
166 "/gnutls-" version ".tar.xz"))
168 (search-patches "gnutls-skip-trust-store-test.patch"
169 "gnutls-skip-pkgconfig-test.patch"))
172 "15ihq6p0hnnhs8cnjrkj40dmlcaa1jjg8xg0g2ydbnlqs454ixbr"))))
173 (build-system gnu-build-system)
175 `(; Ensure we don't keep a reference to this buggy software.
176 #:disallowed-references (,net-tools)
179 ;; GnuTLS doesn't consult any environment variables to specify
180 ;; the location of the system-wide trust store. Instead it has a
181 ;; configure-time option. Unless specified, its configure script
182 ;; attempts to auto-detect the location by looking for common
183 ;; places in the file system, none of which are present in our
184 ;; chroot build environment. If not found, then no default trust
185 ;; store is used, so each program has to provide its own
186 ;; fallback, and users have to configure each program
187 ;; independently. This seems suboptimal.
188 "--with-default-trust-store-dir=/etc/ssl/certs"
190 ;; FIXME: Temporarily disable p11-kit support since it is not
191 ;; working on mips64el.
194 #:phases (modify-phases %standard-phases
197 (lambda* (#:key outputs #:allow-other-keys)
198 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
199 (let* ((out (assoc-ref outputs "out"))
200 (doc (assoc-ref outputs "doc"))
201 (mandir (string-append doc "/share/man/man3"))
202 (oldman (string-append out "/share/man/man3")))
204 (copy-recursively oldman mandir)
205 (delete-file-recursively oldman)
207 (outputs '("out" ;4.4 MiB
209 "doc")) ;4.1 MiB of man pages
211 `(("net-tools" ,net-tools)
212 ("pkg-config" ,pkg-config)
215 `(("guile" ,guile-2.2)))
217 ;; These are all in the 'Requires.private' field of gnutls.pc.
218 `(("libtasn1" ,libtasn1)
222 (home-page "https://www.gnu.org/software/gnutls/")
223 (synopsis "Transport layer security library")
225 "GnuTLS is a secure communications library implementing the SSL, TLS
226 and DTLS protocols. It is provided in the form of a C library to support the
227 protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
228 required structures.")
229 (license license:lgpl2.1+)
230 (properties '((ftp-server . "ftp.gnutls.org")
231 (ftp-directory . "/gcrypt/gnutls")))))
233 (define-public gnutls/guile-2.2
234 (deprecated-package "guile2.2-gnutls" gnutls))
236 (define-public gnutls/guile-2.0
237 ;; GnuTLS for Guile 2.0.
240 (name "guile2.0-gnutls")
241 (inputs `(("guile" ,guile-2.0)
242 ,@(alist-delete "guile" (package-inputs gnutls))))))
244 (define-public gnutls/dane
245 ;; GnuTLS with build libgnutls-dane, implementing DNS-based
246 ;; Authentication of Named Entities. This is required for GNS functionality
247 ;; by GNUnet and gnURL. This is done in an extra package definition
248 ;; to have the choice between GnuTLS with Dane and without Dane.
252 (inputs `(("unbound" ,unbound)
253 ,@(package-inputs gnutls)))))
255 (define-public openssl
258 (replacement openssl-1.0.2o)
262 (uri (list (string-append "https://www.openssl.org/source/openssl-"
264 (string-append "ftp://ftp.openssl.org/source/"
265 name "-" version ".tar.gz")
266 (string-append "ftp://ftp.openssl.org/source/old/"
267 (string-trim-right version char-set:letter)
268 "/" name "-" version ".tar.gz")))
271 "1zm82pyq5a9jm10q6iv7d3dih3xwjds4x30fqph3k317byvsn2rp"))
274 ;; Remove ELF files. 'substitute*' can't read them.
275 (delete-file "test/ssltest_old")
276 (delete-file "test/v3ext")
277 (delete-file "test/x509aux")
279 (patches (search-patches "openssl-runpath.patch"
280 "openssl-c-rehash-in.patch"))))
281 (build-system gnu-build-system)
283 "doc" ;1.5MiB of man3 pages
284 "static")) ;6MiB of .a files
285 (native-inputs `(("perl" ,perl)))
287 `(#:disallowed-references (,perl)
292 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
293 ;; so we explicitly disallow it here.
294 #:disallowed-references ,(list (canonical-package perl))
296 (modify-phases %standard-phases
298 'configure 'patch-Makefile.org
299 (lambda* (#:key outputs #:allow-other-keys)
300 ;; The default MANDIR is some unusual place. Fix that.
301 (let ((out (assoc-ref outputs "out")))
302 (patch-makefile-SHELL "Makefile.org")
303 (substitute* "Makefile.org"
304 (("^MANDIR[[:blank:]]*=.*$")
305 (string-append "MANDIR = " out "/share/man\n")))
309 (lambda* (#:key outputs #:allow-other-keys)
310 (let ((out (assoc-ref outputs "out")))
313 "shared" ;build shared libraries
316 ;; The default for this catch-all directory is
317 ;; PREFIX/ssl. Change that to something more
319 (string-append "--openssldir=" out
320 "/share/openssl-" ,version)
322 (string-append "--prefix=" out)
324 ;; XXX FIXME: Work around a code generation bug in GCC
325 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
326 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
327 ,@(if (and (not (%current-target-system))
328 (string-prefix? "armhf" (%current-system)))
332 'install 'make-libraries-writable
333 (lambda* (#:key outputs #:allow-other-keys)
334 ;; Make libraries writable so that 'strip' does its job.
335 (let ((out (assoc-ref outputs "out")))
336 (for-each (lambda (file)
338 (find-files (string-append out "/lib")
341 (add-after 'install 'move-static-libraries
342 (lambda* (#:key outputs #:allow-other-keys)
343 ;; Move static libraries to the "static" output.
344 (let* ((out (assoc-ref outputs "out"))
345 (lib (string-append out "/lib"))
346 (static (assoc-ref outputs "static"))
347 (slib (string-append static "/lib")))
348 (for-each (lambda (file)
349 (install-file file slib)
351 (find-files lib "\\.a$"))
353 (add-after 'install 'move-man3-pages
354 (lambda* (#:key outputs #:allow-other-keys)
355 ;; Move section 3 man pages to "doc".
356 (let* ((out (assoc-ref outputs "out"))
357 (man3 (string-append out "/share/man/man3"))
358 (doc (assoc-ref outputs "doc"))
359 (target (string-append doc "/share/man/man3")))
361 (for-each (lambda (file)
363 (string-append target "/"
366 (delete-file-recursively man3)
369 'patch-source-shebangs 'patch-tests
370 (lambda* (#:key inputs native-inputs #:allow-other-keys)
371 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
372 (substitute* (find-files "test" ".*")
374 (string-append bash "/bin/sh"))
379 'install 'remove-miscellany
380 (lambda* (#:key outputs #:allow-other-keys)
381 ;; The 'misc' directory contains random undocumented shell and Perl
382 ;; scripts. Remove them to avoid retaining a reference on Perl.
383 (let ((out (assoc-ref outputs "out")))
384 (delete-file-recursively (string-append out "/share/openssl-"
388 (list (search-path-specification
389 (variable "SSL_CERT_DIR")
390 (separator #f) ;single entry
391 (files '("etc/ssl/certs")))
392 (search-path-specification
393 (variable "SSL_CERT_FILE")
395 (separator #f) ;single entry
396 (files '("etc/ssl/certs/ca-certificates.crt")))))
397 (synopsis "SSL/TLS implementation")
399 "OpenSSL is an implementation of SSL/TLS.")
400 (license license:openssl)
401 (home-page "https://www.openssl.org/")))
403 (define openssl-1.0.2o
409 (inherit (package-source openssl))
410 (uri (list (string-append "https://www.openssl.org/source/openssl-"
412 (string-append "ftp://ftp.openssl.org/source/"
413 name "-" version ".tar.gz")
414 (string-append "ftp://ftp.openssl.org/source/old/"
415 (string-trim-right version char-set:letter)
416 "/" name "-" version ".tar.gz")))
419 "0kcy13l701054nhpbd901mz32v1kn4g311z0nifd83xs2jbmqgzc"))
420 ;; Erase the inherited snippet, which isn't applicable to
424 (define-public openssl-next
431 (uri (list (string-append "https://www.openssl.org/source/openssl-"
433 (string-append "ftp://ftp.openssl.org/source/"
434 name "-" version ".tar.gz")
435 (string-append "ftp://ftp.openssl.org/source/old/"
436 (string-trim-right version char-set:letter)
437 "/" name "-" version ".tar.gz")))
438 (patches (search-patches "openssl-1.1.0-c-rehash-in.patch"))
441 "05x509lccqjscgyi935z809pwfm708islypwhmjnb6cyvrn64daq"))))
443 "doc" ;1.3MiB of man3 pages
444 "static")) ; 5.5MiB of .a files
446 (substitute-keyword-arguments (package-arguments openssl)
448 `(modify-phases ,phases
449 (delete 'patch-tests) ; These two phases are not needed by
450 (delete 'patch-Makefile.org) ; OpenSSL 1.1.0.
452 ;; Override configure phase since -rpath is now a configure option.
454 (lambda* (#:key outputs #:allow-other-keys)
455 (let* ((out (assoc-ref outputs "out"))
456 (lib (string-append out "/lib")))
459 "shared" ;build shared libraries
462 ;; The default for this catch-all directory is
463 ;; PREFIX/ssl. Change that to something more
465 (string-append "--openssldir=" out
466 "/share/openssl-" ,version)
468 (string-append "--prefix=" out)
469 (string-append "-Wl,-rpath," lib)
471 ;; XXX FIXME: Work around a code generation bug in GCC
472 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
473 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
474 ,@(if (and (not (%current-target-system))
475 (string-prefix? "armhf" (%current-system)))
479 ;; XXX: Duplicate this phase to make sure 'version' evaluates
480 ;; in the current scope and not the inherited one.
481 (replace 'remove-miscellany
482 (lambda* (#:key outputs #:allow-other-keys)
483 ;; The 'misc' directory contains random undocumented shell and Perl
484 ;; scripts. Remove them to avoid retaining a reference on Perl.
485 (let ((out (assoc-ref outputs "out")))
486 (delete-file-recursively (string-append out "/share/openssl-"
490 (define-public libressl
496 (uri (string-append "mirror://openbsd/LibreSSL/"
497 name "-" version ".tar.gz"))
500 "1589f0kg7kj51j9hid542s4isb96s1azjaqsfprpy5s2qdwqfyli"))))
501 (build-system gnu-build-system)
503 ;; Do as if 'getentropy' was missing since older Linux kernels lack it
504 ;; and libc would return ENOSYS, which is not properly handled.
505 ;; See <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00235.html>.
506 '(#:configure-flags '("ac_cv_func_getentropy=no"
507 ;; Provide a TLS-enabled netcat.
510 ;; FIXME: These two variables must designate a single file or directory
511 ;; and are not actually "search paths." In practice it works OK in
512 ;; user profiles because there's always just one item that matches the
514 (list (search-path-specification
515 (variable "SSL_CERT_DIR")
516 (files '("etc/ssl/certs")))
517 (search-path-specification
518 (variable "SSL_CERT_FILE")
519 (files '("etc/ssl/certs/ca-certificates.crt")))))
520 (home-page "https://www.libressl.org/")
521 (synopsis "SSL/TLS implementation")
522 (description "LibreSSL is a version of the TLS/crypto stack, forked from
523 OpenSSL in 2014 with the goals of modernizing the codebase, improving security,
524 and applying best practice development processes. This package also includes a
525 netcat implementation that supports TLS.")
526 ;; Files taken from OpenSSL keep their license, others are under various
527 ;; non-copyleft licenses.
528 (license (list license:openssl
529 (license:non-copyleft
531 "See COPYING in the distribution.")))))
533 (define-public python-acme
536 ;; Remember to update the hash of certbot when updating python-acme.
540 (uri (pypi-uri "acme" version))
543 "0l257dq1i2gka6ynldidpwaz1aa726643crqqckga1w5awsndh88"))))
544 (build-system python-build-system)
547 (modify-phases %standard-phases
548 (add-after 'build 'build-documentation
550 (zero? (system* "make" "-C" "docs" "man" "info"))))
551 (add-after 'install 'install-documentation
552 (lambda* (#:key outputs #:allow-other-keys)
553 (let* ((out (assoc-ref outputs "out"))
554 (man (string-append out "/share/man/man1"))
555 (info (string-append out "/info")))
556 (install-file "docs/_build/texinfo/acme-python.info" info)
557 (install-file "docs/_build/man/acme-python.1" man)
559 ;; TODO: Add optional inputs for testing.
561 `(("python-mock" ,python-mock)
563 ("python-sphinx" ,python-sphinx)
564 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
565 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
566 ("texinfo" ,texinfo)))
568 `(("python-josepy" ,python-josepy)
569 ("python-six" ,python-six)
570 ("python-requests" ,python-requests)
571 ("python-pytz" ,python-pytz)
572 ("python-pyrfc3339" ,python-pyrfc3339)
573 ("python-pyasn1" ,python-pyasn1)
574 ("python-cryptography" ,python-cryptography)
575 ("python-pyopenssl" ,python-pyopenssl)))
576 (home-page "https://github.com/certbot/certbot")
577 (synopsis "ACME protocol implementation in Python")
578 (description "ACME protocol implementation in Python")
579 (license license:asl2.0)))
581 (define-public certbot
584 ;; Certbot and python-acme are developed in the same repository, and their
585 ;; versions should remain synchronized.
586 (version (package-version python-acme))
589 (uri (pypi-uri name version))
592 "0gh5fr61c3mj5vdkn68k17wcvri9rdj506cmmz6631i2l5flrzvc"))))
593 (build-system python-build-system)
595 `(,@(substitute-keyword-arguments (package-arguments python-acme)
597 `(modify-phases ,phases
598 (replace 'install-documentation
599 (lambda* (#:key outputs #:allow-other-keys)
600 (let* ((out (assoc-ref outputs "out"))
601 (man1 (string-append out "/share/man/man1"))
602 (man7 (string-append out "/share/man/man7"))
603 (info (string-append out "/info")))
604 (install-file "docs/_build/texinfo/Certbot.info" info)
605 (install-file "docs/_build/man/certbot.1" man1)
606 (install-file "docs/_build/man/certbot.7" man7)
608 ;; TODO: Add optional inputs for testing.
610 `(("python-nose" ,python-nose)
611 ("python-mock" ,python-mock)
613 ("python-sphinx" ,python-sphinx)
614 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
615 ("python-sphinx-repoze-autointerface" ,python-sphinx-repoze-autointerface)
616 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
617 ("texinfo" ,texinfo)))
619 `(("python-acme" ,python-acme)
620 ("python-zope-interface" ,python-zope-interface)
621 ("python-pyrfc3339" ,python-pyrfc3339)
622 ("python-pyopenssl" ,python-pyopenssl)
623 ("python-configobj" ,python-configobj)
624 ("python-configargparse" ,python-configargparse)
625 ("python-zope-component" ,python-zope-component)
626 ("python-parsedatetime" ,python-parsedatetime)
627 ("python-six" ,python-six)
628 ("python-psutil" ,python-psutil)
629 ("python-requests" ,python-requests)
630 ("python-pytz" ,python-pytz)))
631 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
632 (description "Certbot automatically receives and installs X.509 certificates
633 to enable Transport Layer Security (TLS) on servers. It interoperates with the
634 Let’s Encrypt certificate authority (CA), which issues browser-trusted
635 certificates for free.")
636 (home-page "https://certbot.eff.org/")
637 (license license:asl2.0)))
639 (define-public letsencrypt
640 (package (inherit certbot)
642 (properties `((superseded . ,certbot)))))
644 (define-public perl-net-ssleay
646 (name "perl-net-ssleay")
650 (uri (string-append "mirror://cpan/authors/id/M/MI/MIKEM/"
651 "Net-SSLeay-" version ".tar.gz"))
654 "1rf78z1macgmp6mwd7c2xq4yfw6wpf28hfwfz1d5wslqr4cwb5aq"))))
655 (build-system perl-build-system)
656 (inputs `(("openssl" ,openssl)))
659 (modify-phases %standard-phases
661 'configure 'set-ssl-prefix
662 (lambda* (#:key inputs #:allow-other-keys)
663 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
665 (synopsis "Perl extension for using OpenSSL")
667 "This module offers some high level convenience functions for accessing
668 web pages on SSL servers (for symmetry, the same API is offered for accessing
669 http servers, too), an sslcat() function for writing your own clients, and
670 finally access to the SSL api of the SSLeay/OpenSSL package so you can write
671 servers or clients for more complicated applications.")
672 (license license:perl-license)
673 (home-page "http://search.cpan.org/~mikem/Net-SSLeay-1.66/")))
675 (define-public perl-crypt-openssl-rsa
677 (name "perl-crypt-openssl-rsa")
683 "mirror://cpan/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-"
688 "1gnpvv09b2gpifwdzc5jnhama3d1a4c39lzj9hcaicsb8rvzjmsk"))))
689 (build-system perl-build-system)
691 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
692 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
693 ("openssl" ,openssl)))
694 (arguments perl-crypt-arguments)
696 "http://search.cpan.org/dist/Crypt-OpenSSL-RSA")
698 "RSA encoding and decoding, using the openSSL libraries")
699 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
700 OpenSSL libraries).")
701 (license license:perl-license)))
703 (define perl-crypt-arguments
704 `(#:phases (modify-phases %standard-phases
705 (add-before 'configure 'patch-Makefile.PL
706 (lambda* (#:key inputs #:allow-other-keys)
707 (substitute* "Makefile.PL"
708 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
709 (assoc-ref inputs "openssl")
710 "/lib -lcrypto'],")))
713 (define-public perl-crypt-openssl-bignum
715 (name "perl-crypt-openssl-bignum")
721 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
726 "1p22znbajq91lbk2k3yg12ig7hy5b4vy8igxwqkmbm4nhgxp4ki3"))))
727 (build-system perl-build-system)
728 (inputs `(("openssl" ,openssl)))
729 (arguments perl-crypt-arguments)
731 "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum")
733 "OpenSSL's multiprecision integer arithmetic in Perl")
734 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
735 arithmetic in Perl.")
736 ;; At your option either gpl1+ or the Artistic License
737 (license license:perl-license)))
739 (define-public perl-crypt-openssl-random
741 (name "perl-crypt-openssl-random")
747 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
752 "0yjcabkibrkafywvdkmd1xpi6br48skyk3l15ni176wvlg38335v"))))
753 (build-system perl-build-system)
754 (inputs `(("openssl" ,openssl)))
755 (arguments perl-crypt-arguments)
757 "http://search.cpan.org/dist/Crypt-OpenSSL-Random")
759 "OpenSSL/LibreSSL pseudo-random number generator access")
760 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
762 (license license:perl-license)))
764 (define-public acme-client
770 (uri (string-append "https://kristaps.bsd.lv/" name "/"
771 "snapshots/" name "-portable-"
775 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
776 (build-system gnu-build-system)
778 '(#:tests? #f ; no test suite
781 (string-append "PREFIX=" (assoc-ref %outputs "out")))
783 (modify-phases %standard-phases
784 (add-after 'unpack 'patch-paths
785 (lambda* (#:key inputs #:allow-other-keys)
786 (let ((pem (string-append (assoc-ref inputs "libressl")
787 "/etc/ssl/cert.pem")))
788 (substitute* "http.c"
789 (("/etc/ssl/cert.pem") pem))
791 (delete 'configure)))) ; no './configure' script
793 `(("pkg-config" ,pkg-config)))
796 ("libressl" ,libressl)))
797 (synopsis "Let's Encrypt client by the OpenBSD project")
798 (description "acme-client is a Let's Encrypt client implemented in C. It
799 uses a modular design, and attempts to secure itself by dropping privileges and
800 operating in a chroot where possible. acme-client is developed on OpenBSD and
801 then ported to the GNU / Linux environment.")
802 (home-page "https://kristaps.bsd.lv/acme-client/")
803 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
804 ;; and 'jsmn.c' are distributed under the Expat license.
805 (license (list license:isc license:expat))))
807 ;; The "-apache" variant is the upstreamed prefered variant. A "-gpl"
808 ;; variant exists in addition to the "-apache" one.
809 (define-public mbedtls-apache
811 (name "mbedtls-apache")
816 ;; XXX: The download links on the website are script redirection links
817 ;; which effectively lead to the format listed in the uri here.
818 (uri (string-append "https://tls.mbed.org/download/mbedtls-"
819 version "-apache.tgz"))
822 "1mvkqlxxvl6yp1g5g9dk4l7h3wl6149p3pfwgwzgs7xybyxw4f7x"))))
823 (build-system cmake-build-system)
826 (list "-DUSE_SHARED_MBEDTLS_LIBRARY=ON")))
829 (synopsis "Small TLS library")
831 "@code{mbed TLS}, formerly known as PolarSSL, makes it trivially easy
832 for developers to include cryptographic and SSL/TLS capabilities in their
833 (embedded) products, facilitating this functionality with a minimal
835 (home-page "https://tls.mbed.org")
836 (license license:asl2.0)))
838 (define-public ghc-tls
844 (uri (string-append "https://hackage.haskell.org/package/"
845 "tls/tls-" version ".tar.gz"))
848 "1rdidf18i781c0vdvy9yn79yh08hmcacf6fp3sgghyiy3h0wyh5l"))))
849 (build-system haskell-build-system)
851 `(("ghc-mtl" ,ghc-mtl)
852 ("ghc-cereal" ,ghc-cereal)
853 ("ghc-data-default-class" ,ghc-data-default-class)
854 ("ghc-memory" ,ghc-memory)
855 ("ghc-cryptonite" ,ghc-cryptonite)
856 ("ghc-asn1-types" ,ghc-asn1-types)
857 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
858 ("ghc-x509" ,ghc-x509)
859 ("ghc-x509-store" ,ghc-x509-store)
860 ("ghc-x509-validation" ,ghc-x509-validation)
861 ("ghc-async" ,ghc-async)
862 ("ghc-network" ,ghc-network)
863 ("ghc-hourglass" ,ghc-hourglass)))
865 `(("ghc-tasty" ,ghc-tasty)
866 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
867 ("ghc-quickcheck" ,ghc-quickcheck)))
868 (home-page "https://github.com/vincenthz/hs-tls")
870 "TLS/SSL protocol native implementation (Server and Client)")
872 "Native Haskell TLS and SSL protocol implementation for server and client.
873 This provides a high-level implementation of a sensitive security protocol,
874 eliminating a common set of security issues through the use of the advanced
875 type system, high level constructions and common Haskell features. Currently
876 implement the SSL3.0, TLS1.0, TLS1.1 and TLS1.2 protocol, and support RSA and
877 Ephemeral (Elliptic curve and regular) Diffie Hellman key exchanges, and many
879 (license license:bsd-3)))