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 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
69 (replacement libtasn1/fixed)
73 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
77 "0ls7jdq3y5fnrwg0pzhq11m21r8pshac2705bczz6mqjc8pdllv7"))))
78 (build-system gnu-build-system)
79 (native-inputs `(("perl" ,perl)))
80 (home-page "https://www.gnu.org/software/libtasn1/")
81 (synopsis "ASN.1 library")
83 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
84 for transmitting machine-neutral encodings of data objects in computer
85 networking, allowing for formal validation of data according to some
87 (license license:lgpl2.0+)))
89 (define libtasn1/fixed
93 (inherit (package-source libtasn1))
94 (patches (search-patches "libtasn1-CVE-2017-10790.patch"))))))
102 (uri (string-append "https://lionet.info/soft/asn1c-"
106 "1fc64g45ykmv73kdndr4zdm4wxhimhrir4rxnygxvwkych5l81w0"))))
107 (build-system gnu-build-system)
110 (home-page "https://lionet.info/asn1c")
111 (synopsis "ASN.1 to C compiler")
112 (description "The ASN.1 to C compiler takes ASN.1 module
113 files and generates C++ compatible C source code. That code can be
114 used to serialize the native C structures into compact and unambiguous
115 BER/XER/PER-based data files, and deserialize the files back.
117 Various ASN.1 based formats are widely used in the industry, such as to encode
118 the X.509 certificates employed in the HTTPS handshake, to exchange control
119 data between mobile phones and cellular networks, to car-to-car communication
120 in intelligent transportation networks.")
121 (license license:bsd-2)))
123 (define-public p11-kit
130 (uri (string-append "https://github.com/p11-glue/p11-kit/releases/"
131 "download/" version "/p11-kit-" version ".tar.gz"))
134 "0qyvnkb5hfi94wv3bn67y20hcbbvynvjwxpk7k9sh1si6ff69hg1"))))
135 (build-system gnu-build-system)
137 `(("pkg-config" ,pkg-config)))
140 ("libtasn1" ,libtasn1)))
142 `(#:configure-flags '("--without-trust-paths")))
143 (home-page "https://p11-glue.freedesktop.org/p11-kit.html")
144 (synopsis "PKCS#11 library")
146 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
147 provides a standard configuration setup for installing PKCS#11 modules
148 in such a way that they are discoverable. It also solves problems with
149 coordinating the use of PKCS#11 by different components or libraries
150 living in the same process.")
151 (license license:bsd-3)))
154 ;; TODO Add net-tools-for-tests to #:disallowed-references when we can afford
155 ;; rebuild GnuTLS (i.e. core-updates).
156 (define-public gnutls
163 ;; Note: Releases are no longer on ftp.gnu.org since the
164 ;; schism (after version 3.1.5).
165 (string-append "mirror://gnupg/gnutls/v"
166 (version-major+minor version)
167 "/gnutls-" version ".tar.xz"))
169 (search-patches "gnutls-skip-trust-store-test.patch"
170 "gnutls-skip-pkgconfig-test.patch"))
173 "15ihq6p0hnnhs8cnjrkj40dmlcaa1jjg8xg0g2ydbnlqs454ixbr"))))
174 (build-system gnu-build-system)
178 ;; GnuTLS doesn't consult any environment variables to specify
179 ;; the location of the system-wide trust store. Instead it has a
180 ;; configure-time option. Unless specified, its configure script
181 ;; attempts to auto-detect the location by looking for common
182 ;; places in the file system, none of which are present in our
183 ;; chroot build environment. If not found, then no default trust
184 ;; store is used, so each program has to provide its own
185 ;; fallback, and users have to configure each program
186 ;; independently. This seems suboptimal.
187 "--with-default-trust-store-dir=/etc/ssl/certs"
189 ;; FIXME: Temporarily disable p11-kit support since it is not
190 ;; working on mips64el.
193 #:phases (modify-phases %standard-phases
196 (lambda* (#:key outputs #:allow-other-keys)
197 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
198 (let* ((out (assoc-ref outputs "out"))
199 (doc (assoc-ref outputs "doc"))
200 (mandir (string-append doc "/share/man/man3"))
201 (oldman (string-append out "/share/man/man3")))
203 (copy-recursively oldman mandir)
204 (delete-file-recursively oldman)
206 (outputs '("out" ;4.4 MiB
208 "doc")) ;4.1 MiB of man pages
210 `(("net-tools" ,net-tools-for-tests)
211 ("pkg-config" ,pkg-config)
214 `(("guile" ,guile-2.2)))
216 ;; These are all in the 'Requires.private' field of gnutls.pc.
217 `(("libtasn1" ,libtasn1)
221 (home-page "https://www.gnu.org/software/gnutls/")
222 (synopsis "Transport layer security library")
224 "GnuTLS is a secure communications library implementing the SSL, TLS
225 and DTLS protocols. It is provided in the form of a C library to support the
226 protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
227 required structures.")
228 (license license:lgpl2.1+)
229 (properties '((ftp-server . "ftp.gnutls.org")
230 (ftp-directory . "/gcrypt/gnutls")))))
232 (define-public gnutls/guile-2.2
233 (deprecated-package "guile2.2-gnutls" gnutls))
235 (define-public gnutls/guile-2.0
236 ;; GnuTLS for Guile 2.0.
239 (name "guile2.0-gnutls")
240 (inputs `(("guile" ,guile-2.0)
241 ,@(alist-delete "guile" (package-inputs gnutls))))))
243 (define-public gnutls/dane
244 ;; GnuTLS with build libgnutls-dane, implementing DNS-based
245 ;; Authentication of Named Entities. This is required for GNS functionality
246 ;; by GNUnet and gnURL. This is done in an extra package definition
247 ;; to have the choice between GnuTLS with Dane and without Dane.
251 (inputs `(("unbound" ,unbound)
252 ,@(package-inputs gnutls)))))
254 (define-public openssl
258 (replacement openssl-1.0.2n)
261 (uri (list (string-append "ftp://ftp.openssl.org/source/"
262 name "-" version ".tar.gz")
263 (string-append "ftp://ftp.openssl.org/source/old/"
264 (string-trim-right version char-set:letter)
265 "/" name "-" version ".tar.gz")))
268 "037kvpisc6qh5dkppcwbm5bg2q800xh2hma3vghz8xcycmdij1yf"))
271 ;; Remove ELF files. 'substitute*' can't read them.
272 (delete-file "test/ssltest_old")
273 (delete-file "test/v3ext")
274 (delete-file "test/x509aux")
276 (patches (search-patches "openssl-runpath.patch"
277 "openssl-c-rehash-in.patch"))))
278 (build-system gnu-build-system)
280 "doc" ;1.5MiB of man3 pages
281 "static")) ;6MiB of .a files
282 (native-inputs `(("perl" ,perl)))
284 `(#:disallowed-references (,perl)
289 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
290 ;; so we explicitly disallow it here.
291 #:disallowed-references ,(list (canonical-package perl))
293 (modify-phases %standard-phases
295 'configure 'patch-Makefile.org
296 (lambda* (#:key outputs #:allow-other-keys)
297 ;; The default MANDIR is some unusual place. Fix that.
298 (let ((out (assoc-ref outputs "out")))
299 (patch-makefile-SHELL "Makefile.org")
300 (substitute* "Makefile.org"
301 (("^MANDIR[[:blank:]]*=.*$")
302 (string-append "MANDIR = " out "/share/man\n")))
306 (lambda* (#:key outputs #:allow-other-keys)
307 (let ((out (assoc-ref outputs "out")))
310 "shared" ;build shared libraries
313 ;; The default for this catch-all directory is
314 ;; PREFIX/ssl. Change that to something more
316 (string-append "--openssldir=" out
317 "/share/openssl-" ,version)
319 (string-append "--prefix=" out)
321 ;; XXX FIXME: Work around a code generation bug in GCC
322 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
323 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
324 ,@(if (and (not (%current-target-system))
325 (string-prefix? "armhf" (%current-system)))
329 'install 'make-libraries-writable
330 (lambda* (#:key outputs #:allow-other-keys)
331 ;; Make libraries writable so that 'strip' does its job.
332 (let ((out (assoc-ref outputs "out")))
333 (for-each (lambda (file)
335 (find-files (string-append out "/lib")
338 (add-after 'install 'move-static-libraries
339 (lambda* (#:key outputs #:allow-other-keys)
340 ;; Move static libraries to the "static" output.
341 (let* ((out (assoc-ref outputs "out"))
342 (lib (string-append out "/lib"))
343 (static (assoc-ref outputs "static"))
344 (slib (string-append static "/lib")))
345 (for-each (lambda (file)
346 (install-file file slib)
348 (find-files lib "\\.a$"))
350 (add-after 'install 'move-man3-pages
351 (lambda* (#:key outputs #:allow-other-keys)
352 ;; Move section 3 man pages to "doc".
353 (let* ((out (assoc-ref outputs "out"))
354 (man3 (string-append out "/share/man/man3"))
355 (doc (assoc-ref outputs "doc"))
356 (target (string-append doc "/share/man/man3")))
358 (for-each (lambda (file)
360 (string-append target "/"
363 (delete-file-recursively man3)
366 'patch-source-shebangs 'patch-tests
367 (lambda* (#:key inputs native-inputs #:allow-other-keys)
368 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
369 (substitute* (find-files "test" ".*")
371 (string-append bash "/bin/sh"))
376 'install 'remove-miscellany
377 (lambda* (#:key outputs #:allow-other-keys)
378 ;; The 'misc' directory contains random undocumented shell and Perl
379 ;; scripts. Remove them to avoid retaining a reference on Perl.
380 (let ((out (assoc-ref outputs "out")))
381 (delete-file-recursively (string-append out "/share/openssl-"
385 ;; FIXME: These two variables must designate a single file or directory
386 ;; and are not actually "search paths." In practice it works OK in user
387 ;; profiles because there's always just one item that matches the
389 (list (search-path-specification
390 (variable "SSL_CERT_DIR")
391 (files '("etc/ssl/certs")))
392 (search-path-specification
393 (variable "SSL_CERT_FILE")
394 (files '("etc/ssl/certs/ca-certificates.crt")))))
395 (synopsis "SSL/TLS implementation")
397 "OpenSSL is an implementation of SSL/TLS.")
398 (license license:openssl)
399 (home-page "https://www.openssl.org/")))
401 ;; Fixes CVE-2017-3735, CVE-2017-3736, CVE-2017-3737, and CVE-2017-3738.
402 ;; See <https://www.openssl.org/news/cl102.txt>.
403 (define-public openssl-1.0.2n
408 (inherit (package-source openssl))
409 (uri (list (string-append "https://www.openssl.org/source/openssl-"
411 (string-append "ftp://ftp.openssl.org/source/openssl-"
413 (string-append "ftp://ftp.openssl.org/source/old/"
414 (string-trim-right version char-set:letter)
415 "/openssl-" version ".tar.gz")))
418 "1zm82pyq5a9jm10q6iv7d3dih3xwjds4x30fqph3k317byvsn2rp"))))))
420 (define-public openssl-next
427 (uri (list (string-append "https://www.openssl.org/source/openssl-"
429 (string-append "ftp://ftp.openssl.org/source/"
430 name "-" version ".tar.gz")
431 (string-append "ftp://ftp.openssl.org/source/old/"
432 (string-trim-right version char-set:letter)
433 "/" name "-" version ".tar.gz")))
434 (patches (search-patches "openssl-1.1.0-c-rehash-in.patch"))
437 "1bvka2wf33w2vxv7yw578nnjqyhz2b3chvfb0l4k2ffscw950kfy"))))
439 "doc" ;1.3MiB of man3 pages
440 "static")) ; 5.5MiB of .a files
442 (substitute-keyword-arguments (package-arguments openssl)
444 `(modify-phases ,phases
445 (delete 'patch-tests) ; These two phases are not needed by
446 (delete 'patch-Makefile.org) ; OpenSSL 1.1.0.
448 ;; Override configure phase since -rpath is now a configure option.
450 (lambda* (#:key outputs #:allow-other-keys)
451 (let* ((out (assoc-ref outputs "out"))
452 (lib (string-append out "/lib")))
455 "shared" ;build shared libraries
458 ;; The default for this catch-all directory is
459 ;; PREFIX/ssl. Change that to something more
461 (string-append "--openssldir=" out
462 "/share/openssl-" ,version)
464 (string-append "--prefix=" out)
465 (string-append "-Wl,-rpath," lib)
467 ;; XXX FIXME: Work around a code generation bug in GCC
468 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
469 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
470 ,@(if (and (not (%current-target-system))
471 (string-prefix? "armhf" (%current-system)))
475 ;; XXX: Duplicate this phase to make sure 'version' evaluates
476 ;; in the current scope and not the inherited one.
477 (replace 'remove-miscellany
478 (lambda* (#:key outputs #:allow-other-keys)
479 ;; The 'misc' directory contains random undocumented shell and Perl
480 ;; scripts. Remove them to avoid retaining a reference on Perl.
481 (let ((out (assoc-ref outputs "out")))
482 (delete-file-recursively (string-append out "/share/openssl-"
486 (define-public libressl
492 (uri (string-append "mirror://openbsd/LibreSSL/"
493 name "-" version ".tar.gz"))
496 "07yi37a2ghsgj2b4w30q1s4d2inqnix7ika1m21y57p9z71212k3"))))
497 (build-system gnu-build-system)
499 ;; Do as if 'getentropy' was missing since older Linux kernels lack it
500 ;; and libc would return ENOSYS, which is not properly handled.
501 ;; See <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00235.html>.
502 '(#:configure-flags '("ac_cv_func_getentropy=no"
503 ;; Provide a TLS-enabled netcat.
506 ;; FIXME: These two variables must designate a single file or directory
507 ;; and are not actually "search paths." In practice it works OK in
508 ;; user profiles because there's always just one item that matches the
510 (list (search-path-specification
511 (variable "SSL_CERT_DIR")
512 (files '("etc/ssl/certs")))
513 (search-path-specification
514 (variable "SSL_CERT_FILE")
515 (files '("etc/ssl/certs/ca-certificates.crt")))))
516 (home-page "https://www.libressl.org/")
517 (synopsis "SSL/TLS implementation")
518 (description "LibreSSL is a version of the TLS/crypto stack, forked from
519 OpenSSL in 2014 with the goals of modernizing the codebase, improving security,
520 and applying best practice development processes. This package also includes a
521 netcat implementation that supports TLS.")
522 ;; Files taken from OpenSSL keep their license, others are under various
523 ;; non-copyleft licenses.
524 (license (list license:openssl
525 (license:non-copyleft
527 "See COPYING in the distribution.")))))
529 (define-public python-acme
532 ;; Remember to update the hash of certbot when updating python-acme.
536 (uri (pypi-uri "acme" version))
539 "1md3llp6640dviv9bzyy7qzn3szxil38645cjqcg7hlcdknil4j5"))))
540 (build-system python-build-system)
543 (modify-phases %standard-phases
544 (add-after 'build 'build-documentation
546 (zero? (system* "make" "-C" "docs" "man" "info"))))
547 (add-after 'install 'install-documentation
548 (lambda* (#:key outputs #:allow-other-keys)
549 (let* ((out (assoc-ref outputs "out"))
550 (man (string-append out "/share/man/man1"))
551 (info (string-append out "/info")))
552 (install-file "docs/_build/texinfo/acme-python.info" info)
553 (install-file "docs/_build/man/acme-python.1" man)
555 ;; TODO: Add optional inputs for testing.
557 `(("python-mock" ,python-mock-2)
559 ("python-sphinx" ,python-sphinx)
560 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
561 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
562 ("texinfo" ,texinfo)))
564 `(("python-six" ,python-six)
565 ("python-requests" ,python-requests)
566 ("python-pytz" ,python-pytz)
567 ("python-pyrfc3339" ,python-pyrfc3339)
568 ("python-pyasn1" ,python-pyasn1)
569 ("python-cryptography" ,python-cryptography)
570 ("python-pyopenssl" ,python-pyopenssl)))
571 (home-page "https://github.com/certbot/certbot")
572 (synopsis "ACME protocol implementation in Python")
573 (description "ACME protocol implementation in Python")
574 (license license:asl2.0)))
576 (define-public certbot
579 ;; Certbot and python-acme are developed in the same repository, and their
580 ;; versions should remain synchronized.
581 (version (package-version python-acme))
584 (uri (pypi-uri name version))
587 "126y6jg1nyd8js2jchl4dbmpg507hawaxnyw7510qh7vcidm1gya"))))
588 (build-system python-build-system)
590 `(,@(substitute-keyword-arguments (package-arguments python-acme)
592 `(modify-phases ,phases
593 (replace 'install-documentation
594 (lambda* (#:key outputs #:allow-other-keys)
595 (let* ((out (assoc-ref outputs "out"))
596 (man1 (string-append out "/share/man/man1"))
597 (man7 (string-append out "/share/man/man7"))
598 (info (string-append out "/info")))
599 (install-file "docs/_build/texinfo/Certbot.info" info)
600 (install-file "docs/_build/man/certbot.1" man1)
601 (install-file "docs/_build/man/certbot.7" man7)
603 ;; TODO: Add optional inputs for testing.
605 `(("python-nose" ,python-nose)
606 ("python-mock" ,python-mock-2)
608 ("python-sphinx" ,python-sphinx)
609 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
610 ("python-sphinx-repoze-autointerface" ,python-sphinx-repoze-autointerface)
611 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
612 ("texinfo" ,texinfo)))
614 `(("python-acme" ,python-acme)
615 ("python-zope-interface" ,python-zope-interface)
616 ("python-pyrfc3339" ,python-pyrfc3339)
617 ("python-pyopenssl" ,python-pyopenssl)
618 ("python-configobj" ,python-configobj)
619 ("python-configargparse" ,python-configargparse)
620 ("python-zope-component" ,python-zope-component)
621 ("python-parsedatetime" ,python-parsedatetime)
622 ("python-six" ,python-six)
623 ("python-psutil" ,python-psutil)
624 ("python-requests" ,python-requests)
625 ("python-pytz" ,python-pytz)))
626 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
627 (description "Certbot automatically receives and installs X.509 certificates
628 to enable Transport Layer Security (TLS) on servers. It interoperates with the
629 Let’s Encrypt certificate authority (CA), which issues browser-trusted
630 certificates for free.")
631 (home-page "https://certbot.eff.org/")
632 (license license:asl2.0)))
634 (define-public letsencrypt
635 (package (inherit certbot)
637 (properties `((superseded . ,certbot)))))
639 (define-public perl-net-ssleay
641 (name "perl-net-ssleay")
645 (uri (string-append "mirror://cpan/authors/id/M/MI/MIKEM/"
646 "Net-SSLeay-" version ".tar.gz"))
649 "0z8vya34g88bc41kx955sv7y4niwbbywji8liqbl52v29qbvdjq0"))))
650 (build-system perl-build-system)
651 (inputs `(("openssl" ,openssl)))
654 (modify-phases %standard-phases
656 'configure 'set-ssl-prefix
657 (lambda* (#:key inputs #:allow-other-keys)
658 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
660 (synopsis "Perl extension for using OpenSSL")
662 "This module offers some high level convenience functions for accessing
663 web pages on SSL servers (for symmetry, the same API is offered for accessing
664 http servers, too), an sslcat() function for writing your own clients, and
665 finally access to the SSL api of the SSLeay/OpenSSL package so you can write
666 servers or clients for more complicated applications.")
667 (license license:perl-license)
668 (home-page "http://search.cpan.org/~mikem/Net-SSLeay-1.66/")))
670 (define-public perl-crypt-openssl-rsa
672 (name "perl-crypt-openssl-rsa")
678 "mirror://cpan/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-"
683 "1gnpvv09b2gpifwdzc5jnhama3d1a4c39lzj9hcaicsb8rvzjmsk"))))
684 (build-system perl-build-system)
686 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
687 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
688 ("openssl" ,openssl)))
689 (arguments perl-crypt-arguments)
691 "http://search.cpan.org/dist/Crypt-OpenSSL-RSA")
693 "RSA encoding and decoding, using the openSSL libraries")
694 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
695 OpenSSL libraries).")
696 (license license:perl-license)))
698 (define perl-crypt-arguments
699 `(#:phases (modify-phases %standard-phases
700 (add-before 'configure 'patch-Makefile.PL
701 (lambda* (#:key inputs #:allow-other-keys)
702 (substitute* "Makefile.PL"
703 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
704 (assoc-ref inputs "openssl")
705 "/lib -lcrypto'],")))
708 (define-public perl-crypt-openssl-bignum
710 (name "perl-crypt-openssl-bignum")
716 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
721 "1p22znbajq91lbk2k3yg12ig7hy5b4vy8igxwqkmbm4nhgxp4ki3"))))
722 (build-system perl-build-system)
723 (inputs `(("openssl" ,openssl)))
724 (arguments perl-crypt-arguments)
726 "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum")
728 "OpenSSL's multiprecision integer arithmetic in Perl")
729 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
730 arithmetic in Perl.")
731 ;; At your option either gpl1+ or the Artistic License
732 (license license:perl-license)))
734 (define-public perl-crypt-openssl-random
736 (name "perl-crypt-openssl-random")
742 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
747 "0yjcabkibrkafywvdkmd1xpi6br48skyk3l15ni176wvlg38335v"))))
748 (build-system perl-build-system)
749 (inputs `(("openssl" ,openssl)))
750 (arguments perl-crypt-arguments)
752 "http://search.cpan.org/dist/Crypt-OpenSSL-Random")
754 "OpenSSL/LibreSSL pseudo-random number generator access")
755 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
757 (license license:perl-license)))
759 (define-public acme-client
765 (uri (string-append "https://kristaps.bsd.lv/" name "/"
766 "snapshots/" name "-portable-"
770 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
771 (build-system gnu-build-system)
773 '(#:tests? #f ; no test suite
776 (string-append "PREFIX=" (assoc-ref %outputs "out")))
778 (modify-phases %standard-phases
779 (add-after 'unpack 'patch-paths
780 (lambda* (#:key inputs #:allow-other-keys)
781 (let ((pem (string-append (assoc-ref inputs "libressl")
782 "/etc/ssl/cert.pem")))
783 (substitute* "http.c"
784 (("/etc/ssl/cert.pem") pem))
786 (delete 'configure)))) ; no './configure' script
788 `(("pkg-config" ,pkg-config)))
791 ("libressl" ,libressl)))
792 (synopsis "Let's Encrypt client by the OpenBSD project")
793 (description "acme-client is a Let's Encrypt client implemented in C. It
794 uses a modular design, and attempts to secure itself by dropping privileges and
795 operating in a chroot where possible. acme-client is developed on OpenBSD and
796 then ported to the GNU / Linux environment.")
797 (home-page "https://kristaps.bsd.lv/acme-client/")
798 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
799 ;; and 'jsmn.c' are distributed under the Expat license.
800 (license (list license:isc license:expat))))
802 ;; The "-apache" variant is the upstreamed prefered variant. A "-gpl"
803 ;; variant exists in addition to the "-apache" one.
804 (define-public mbedtls-apache
806 (name "mbedtls-apache")
811 ;; XXX: The download links on the website are script redirection links
812 ;; which effectively lead to the format listed in the uri here.
813 (uri (string-append "https://tls.mbed.org/download/mbedtls-"
814 version "-apache.tgz"))
817 "11wnj34rfqxjggmdgf042i49lr6civgbqwv2p7p8bn6k2919vg4r"))))
818 (build-system cmake-build-system)
821 (list "-DUSE_SHARED_MBEDTLS_LIBRARY=ON")))
824 (synopsis "Small TLS library")
826 "@code{mbed TLS}, formerly known as PolarSSL, makes it trivially easy
827 for developers to include cryptographic and SSL/TLS capabilities in their
828 (embedded) products, facilitating this functionality with a minimal
830 (home-page "https://tls.mbed.org")
831 (license license:asl2.0)))
833 (define-public ghc-tls
839 (uri (string-append "https://hackage.haskell.org/package/"
840 "tls/tls-" version ".tar.gz"))
843 "1rdidf18i781c0vdvy9yn79yh08hmcacf6fp3sgghyiy3h0wyh5l"))))
844 (build-system haskell-build-system)
846 `(("ghc-mtl" ,ghc-mtl)
847 ("ghc-cereal" ,ghc-cereal)
848 ("ghc-data-default-class" ,ghc-data-default-class)
849 ("ghc-memory" ,ghc-memory)
850 ("ghc-cryptonite" ,ghc-cryptonite)
851 ("ghc-asn1-types" ,ghc-asn1-types)
852 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
853 ("ghc-x509" ,ghc-x509)
854 ("ghc-x509-store" ,ghc-x509-store)
855 ("ghc-x509-validation" ,ghc-x509-validation)
856 ("ghc-async" ,ghc-async)
857 ("ghc-network" ,ghc-network)
858 ("ghc-hourglass" ,ghc-hourglass)))
860 `(("ghc-tasty" ,ghc-tasty)
861 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
862 ("ghc-quickcheck" ,ghc-quickcheck)))
863 (home-page "https://github.com/vincenthz/hs-tls")
865 "TLS/SSL protocol native implementation (Server and Client)")
867 "Native Haskell TLS and SSL protocol implementation for server and client.
868 This provides a high-level implementation of a sensitive security protocol,
869 eliminating a common set of security issues through the use of the advanced
870 type system, high level constructions and common Haskell features. Currently
871 implement the SSL3.0, TLS1.0, TLS1.1 and TLS1.2 protocol, and support RSA and
872 Ephemeral (Elliptic curve and regular) Diffie Hellman key exchanges, and many
874 (license license:bsd-3)))