gnu: tcpdump: Fetch source from tcpdump.org.
[jackhill/guix/guix.git] / gnu / packages / tls.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
3c0f7910 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
80cc3a0a 3;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
29a7c98a 4;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
cc2b77df 5;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
9fd0838b 6;;; Copyright © 2015 David Thompson <davet@gnu.org>
12433a21 7;;; Copyright © 2015, 2016 Leo Famulari <leo@famulari.name>
df0625ab 8;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
3ea110b7 9;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
679b535b 10;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
375cef6c 11;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
7543f865 12;;;
233e7676 13;;; This file is part of GNU Guix.
7543f865 14;;;
233e7676 15;;; GNU Guix is free software; you can redistribute it and/or modify it
7543f865
LC
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
233e7676 20;;; GNU Guix is distributed in the hope that it will be useful, but
7543f865
LC
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
233e7676 26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
7543f865 27
a7fd7b68 28(define-module (gnu packages tls)
e9aa8d0c 29 #:use-module ((guix licenses) #:prefix license:)
7543f865
LC
30 #:use-module (guix packages)
31 #:use-module (guix download)
29a7c98a 32 #:use-module (guix utils)
7543f865 33 #:use-module (guix build-system gnu)
cc2b77df 34 #:use-module (guix build-system perl)
7890e3ba 35 #:use-module (guix build-system python)
f61e0e79 36 #:use-module (gnu packages compression)
013ce67b 37 #:use-module (gnu packages)
1ffa7090 38 #:use-module (gnu packages guile)
0581c273 39 #:use-module (gnu packages libbsd)
27e86bed 40 #:use-module (gnu packages libffi)
866f469e 41 #:use-module (gnu packages libidn)
5d4c90ae 42 #:use-module (gnu packages linux)
7890e3ba 43 #:use-module (gnu packages ncurses)
27e86bed 44 #:use-module (gnu packages nettle)
1ffa7090 45 #:use-module (gnu packages perl)
27e86bed 46 #:use-module (gnu packages pkg-config)
7890e3ba 47 #:use-module (gnu packages python)
a31f4d35 48 #:use-module (gnu packages texinfo)
079f013b
LC
49 #:use-module (gnu packages base)
50 #:use-module (srfi srfi-1))
7543f865
LC
51
52(define-public libtasn1
53 (package
54 (name "libtasn1")
12433a21 55 (version "4.9")
7543f865
LC
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
60 version ".tar.gz"))
61 (sha256
62 (base32
12433a21 63 "0869cp6jx7cajgv6cnddsh3vc7bimmdkdjn80y1jpb4iss7plvsg"))))
7543f865 64 (build-system gnu-build-system)
3ea110b7 65 (native-inputs `(("perl" ,perl)))
7543f865 66 (home-page "http://www.gnu.org/software/libtasn1/")
f50d2669 67 (synopsis "ASN.1 library")
7543f865 68 (description
79c311b8
LC
69 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
70for transmitting machine-neutral encodings of data objects in computer
a22dc0c4
LC
71networking, allowing for formal validation of data according to some
72specifications.")
e9aa8d0c 73 (license license:lgpl2.0+)))
7543f865 74
375cef6c
HG
75(define-public asn1c
76 (package
77 (name "asn1c")
78 (version "0.9.27")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "https://lionet.info/soft/asn1c-"
82 version ".tar.gz"))
83 (sha256
84 (base32
85 "17nvn2kzvlryasr9dzqg6gs27b9lvqpval0k31pb64bjqbhn8pq2"))))
86 (build-system gnu-build-system)
87 (native-inputs
88 `(("perl" ,perl)))
89 (home-page "https://lionet.info/asn1c")
90 (synopsis "ASN.1 to C compiler")
91 (description "The ASN.1 to C compiler takes ASN.1 module
92files and generates C++ compatible C source code. That code can be
93used to serialize the native C structures into compact and unambiguous
94BER/XER/PER-based data files, and deserialize the files back.
95
96Various ASN.1 based formats are widely used in the industry, such as to encode
97the X.509 certificates employed in the HTTPS handshake, to exchange control
98data between mobile phones and cellular networks, to car-to-car communication
99in intelligent transportation networks.")
100 (license license:bsd-2)))
101
27e86bed
AE
102(define-public p11-kit
103 (package
104 (name "p11-kit")
2b11b9ab 105 (version "0.23.2")
27e86bed
AE
106 (source
107 (origin
108 (method url-fetch)
5cc3096c 109 (uri (string-append "https://p11-glue.freedesktop.org/releases/p11-kit-"
27e86bed
AE
110 version ".tar.gz"))
111 (sha256
112 (base32
2b11b9ab 113 "1w7szm190phlkg7qx05ychlj2dbvkgkhx9gw6dx4d5rw62l6wwms"))
27e86bed
AE
114 (modules '((guix build utils))) ; for substitute*
115 (snippet
116 '(begin
117 ;; Drop one test that fails, also when trying to compile manually.
118 ;; Reported upstream at
119 ;; https://bugs.freedesktop.org/show_bug.cgi?id=89027
120 (substitute* "Makefile.in"
121 (("test-module\\$\\(EXEEXT\\) ") ""))))))
122 (build-system gnu-build-system)
123 (native-inputs
124 `(("pkg-config" ,pkg-config)))
125 (inputs
126 `(("libffi" ,libffi)
127 ("libtasn1" ,libtasn1)))
128 (arguments
129 `(#:configure-flags '("--without-trust-paths")))
130 (home-page "http://p11-glue.freedesktop.org/p11-kit.html")
131 (synopsis "PKCS#11 library")
132 (description
133 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
134provides a standard configuration setup for installing PKCS#11 modules
135in such a way that they are discoverable. It also solves problems with
136coordinating the use of PKCS#11 by different components or libraries
137living in the same process.")
e9aa8d0c 138 (license license:bsd-3)))
27e86bed 139
7543f865
LC
140(define-public gnutls
141 (package
142 (name "gnutls")
ce0b822e 143 (version "3.5.4")
3c0f7910 144 (replacement gnutls-3.5.8)
d7d408d5
LC
145 (source (origin
146 (method url-fetch)
147 (uri
148 ;; Note: Releases are no longer on ftp.gnu.org since the
149 ;; schism (after version 3.1.5).
d93627e4 150 (string-append "mirror://gnupg/gnutls/v"
29a7c98a 151 (version-major+minor version)
d93627e4 152 "/gnutls-" version ".tar.xz"))
d7d408d5
LC
153 (sha256
154 (base32
ce0b822e 155 "1sx8p7v452s9m854r2c5pvcd1k15a3caiv5h35fhrxz0691h2f2f"))))
7543f865 156 (build-system gnu-build-system)
b94ae0b8
AK
157 (arguments
158 '(#:configure-flags
159 (list (string-append "--with-guile-site-dir="
160 (assoc-ref %outputs "out")
aa7c7f21
MW
161 "/share/guile/site/2.0")
162 ;; GnuTLS doesn't consult any environment variables to specify
163 ;; the location of the system-wide trust store. Instead it has a
164 ;; configure-time option. Unless specified, its configure script
165 ;; attempts to auto-detect the location by looking for common
8f65585b 166 ;; places in the file system, none of which are present in our
aa7c7f21
MW
167 ;; chroot build environment. If not found, then no default trust
168 ;; store is used, so each program has to provide its own
169 ;; fallback, and users have to configure each program
170 ;; independently. This seems suboptimal.
866f469e
MW
171 "--with-default-trust-store-dir=/etc/ssl/certs"
172
173 ;; FIXME: Temporarily disable p11-kit support since it is not
174 ;; working on mips64el.
606c6380
LC
175 "--without-p11-kit")
176
177 #:phases (modify-phases %standard-phases
178 (add-after
179 'install 'move-doc
180 (lambda* (#:key outputs #:allow-other-keys)
181 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
182 (let* ((out (assoc-ref outputs "out"))
183 (doc (assoc-ref outputs "doc"))
9cdce047 184 (mandir (string-append doc "/share/man/man3"))
606c6380
LC
185 (oldman (string-append out "/share/man/man3")))
186 (mkdir-p mandir)
187 (copy-recursively oldman mandir)
188 (delete-file-recursively oldman)
189 #t))))))
190 (outputs '("out" ;4.4 MiB
191 "debug"
192 "doc")) ;4.1 MiB of man pages
a1db0975 193 (native-inputs
5d4c90ae
LF
194 `(("net-tools" ,net-tools)
195 ("pkg-config" ,pkg-config)
d2fcfd3d 196 ("which" ,which)))
7543f865
LC
197 (inputs
198 `(("guile" ,guile-2.0)
0cb9b456 199 ("perl" ,perl)))
7543f865 200 (propagated-inputs
d2fcfd3d 201 ;; These are all in the 'Requires.private' field of gnutls.pc.
7543f865 202 `(("libtasn1" ,libtasn1)
866f469e
MW
203 ("libidn" ,libidn)
204 ("nettle" ,nettle)
f61e0e79 205 ("zlib" ,zlib)))
c19700c3 206 (home-page "https://www.gnu.org/software/gnutls/")
f50d2669 207 (synopsis "Transport layer security library")
7543f865 208 (description
a22dc0c4 209 "GnuTLS is a secure communications library implementing the SSL, TLS
79c311b8 210and DTLS protocols. It is provided in the form of a C library to support the
a22dc0c4
LC
211protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
212required structures.")
63e8bb12
LC
213 (license license:lgpl2.1+)
214 (properties '((ftp-server . "ftp.gnutls.org")
215 (ftp-directory . "/gcrypt/gnutls")))))
cc2b77df 216
3c0f7910
LC
217(define gnutls-3.5.8 ;fixes GNUTLS-SA-2017-{1,2}
218 (package
219 (inherit gnutls)
220 (version "3.5.8")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append "mirror://gnupg/gnutls/v"
224 (version-major+minor version)
225 "/gnutls-" version ".tar.xz"))
226 (sha256
227 (base32
228 "1zyl2z63s68hx1dpxqx0lykmlf3rwrzlrf44sq3h7dvjmr1z55qf"))))
229 (replacement #f)))
230
079f013b
LC
231(define-public gnutls/guile-2.2
232 ;; GnuTLS for Guile 2.2. This is supported by GnuTLS >= 3.5.5.
233 (package
234 (inherit gnutls-3.5.8)
235 (name "guile2.2-gnutls")
236 (arguments
237 ;; Remove '--with-guile-site-dir=…/2.0'.
238 (substitute-keyword-arguments (package-arguments gnutls-3.5.8)
239 ((#:configure-flags flags)
240 `(cdr ,flags))))
241 (inputs `(("guile" ,guile-next)
242 ,@(alist-delete "guile" (package-inputs gnutls-3.5.8))))))
243
cc2b77df
AE
244(define-public openssl
245 (package
246 (name "openssl")
544db93c 247 (replacement openssl-1.0.2k)
1d8de185 248 (version "1.0.2j")
cc2b77df 249 (source (origin
4cff124b
LC
250 (method url-fetch)
251 (uri (list (string-append "ftp://ftp.openssl.org/source/"
252 name "-" version ".tar.gz")
253 (string-append "ftp://ftp.openssl.org/source/old/"
254 (string-trim-right version char-set:letter)
255 "/" name "-" version ".tar.gz")))
256 (sha256
257 (base32
1d8de185 258 "0cf4ar97ijfc7mg35zdgpad6x8ivkdx9qii6mz35khi1ps9g5bz7"))
fc1adab1 259 (patches (search-patches "openssl-runpath.patch"
1d8de185 260 "openssl-c-rehash-in.patch"))))
cc2b77df 261 (build-system gnu-build-system)
8c78aeb7 262 (outputs '("out"
a909b576 263 "doc" ;1.5MiB of man3 pages
8c78aeb7 264 "static")) ;6MiB of .a files
cc2b77df
AE
265 (native-inputs `(("perl" ,perl)))
266 (arguments
d03781c3
LC
267 `(#:disallowed-references (,perl)
268 #:parallel-build? #f
cc2b77df
AE
269 #:parallel-tests? #f
270 #:test-target "test"
8c9ec203
LF
271
272 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
273 ;; so we explicitly disallow it here.
274 #:disallowed-references ,(list (canonical-package perl))
cc2b77df 275 #:phases
b6cb1358 276 (modify-phases %standard-phases
4fb254a3 277 (add-before
86c8f1da 278 'configure 'patch-Makefile.org
4fb254a3
LC
279 (lambda* (#:key outputs #:allow-other-keys)
280 ;; The default MANDIR is some unusual place. Fix that.
281 (let ((out (assoc-ref outputs "out")))
86c8f1da 282 (patch-makefile-SHELL "Makefile.org")
4fb254a3
LC
283 (substitute* "Makefile.org"
284 (("^MANDIR[[:blank:]]*=.*$")
285 (string-append "MANDIR = " out "/share/man\n")))
286 #t)))
b6cb1358
LC
287 (replace
288 'configure
289 (lambda* (#:key outputs #:allow-other-keys)
290 (let ((out (assoc-ref outputs "out")))
291 (zero?
292 (system* "./config"
293 "shared" ;build shared libraries
294 "--libdir=lib"
4fb254a3
LC
295
296 ;; The default for this catch-all directory is
297 ;; PREFIX/ssl. Change that to something more
298 ;; conventional.
299 (string-append "--openssldir=" out
300 "/share/openssl-" ,version)
301
b6cb1358
LC
302 (string-append "--prefix=" out)
303
304 ;; XXX FIXME: Work around a code generation bug in GCC
305 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
306 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
307 ,@(if (and (not (%current-target-system))
308 (string-prefix? "armhf" (%current-system)))
309 '("-mfpu=vfpv3")
310 '()))))))
fe8199a8
LC
311 (add-after
312 'install 'make-libraries-writable
313 (lambda* (#:key outputs #:allow-other-keys)
314 ;; Make libraries writable so that 'strip' does its job.
315 (let ((out (assoc-ref outputs "out")))
316 (for-each (lambda (file)
317 (chmod file #o644))
318 (find-files (string-append out "/lib")
319 "\\.so"))
320 #t)))
8c78aeb7
LC
321 (add-after 'install 'move-static-libraries
322 (lambda* (#:key outputs #:allow-other-keys)
323 ;; Move static libraries to the "static" output.
324 (let* ((out (assoc-ref outputs "out"))
325 (lib (string-append out "/lib"))
326 (static (assoc-ref outputs "static"))
327 (slib (string-append static "/lib")))
328 (mkdir-p slib)
329 (for-each (lambda (file)
330 (install-file file slib)
331 (delete-file file))
332 (find-files lib "\\.a$"))
333 #t)))
a909b576
LC
334 (add-after 'install 'move-man3-pages
335 (lambda* (#:key outputs #:allow-other-keys)
336 ;; Move section 3 man pages to "doc".
337 (let* ((out (assoc-ref outputs "out"))
338 (man3 (string-append out "/share/man/man3"))
339 (doc (assoc-ref outputs "doc"))
340 (target (string-append doc "/share/man/man3")))
341 (mkdir-p target)
342 (for-each (lambda (file)
343 (rename-file file
344 (string-append target "/"
345 (basename file))))
346 (find-files man3))
5c838ec9 347 (delete-file-recursively man3)
a909b576 348 #t)))
b6cb1358
LC
349 (add-before
350 'patch-source-shebangs 'patch-tests
351 (lambda* (#:key inputs native-inputs #:allow-other-keys)
352 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
353 (substitute* (find-files "test" ".*")
354 (("/bin/sh")
355 (string-append bash "/bin/bash"))
356 (("/bin/rm")
86c8f1da
MW
357 "rm"))
358 #t)))
784d6e91
LC
359 (add-after
360 'install 'remove-miscellany
361 (lambda* (#:key outputs #:allow-other-keys)
362 ;; The 'misc' directory contains random undocumented shell and Perl
363 ;; scripts. Remove them to avoid retaining a reference on Perl.
364 (let ((out (assoc-ref outputs "out")))
365 (delete-file-recursively (string-append out "/share/openssl-"
366 ,version "/misc"))
367 #t))))))
cc2b77df
AE
368 (native-search-paths
369 ;; FIXME: These two variables must designate a single file or directory
370 ;; and are not actually "search paths." In practice it works OK in user
371 ;; profiles because there's always just one item that matches the
372 ;; specification.
373 (list (search-path-specification
374 (variable "SSL_CERT_DIR")
375 (files '("etc/ssl/certs")))
376 (search-path-specification
377 (variable "SSL_CERT_FILE")
378 (files '("etc/ssl/certs/ca-certificates.crt")))))
379 (synopsis "SSL/TLS implementation")
380 (description
e881752c 381 "OpenSSL is an implementation of SSL/TLS.")
e9aa8d0c 382 (license license:openssl)
cc2b77df
AE
383 (home-page "http://www.openssl.org/")))
384
544db93c
LF
385(define openssl-1.0.2k
386 (package
387 (inherit openssl)
388 (name "openssl")
389 (version "1.0.2k")
390 (source
391 (origin
392 (method url-fetch)
393 (uri (list (string-append "ftp://ftp.openssl.org/source/"
394 name "-" version ".tar.gz")
395 (string-append "ftp://ftp.openssl.org/source/old/"
396 (string-trim-right version char-set:letter)
397 "/" name "-" version ".tar.gz")))
398 (sha256
399 (base32
400 "1h6qi35w6hv6rd73p4cdgdzg732pdrfgpp37cgwz1v9a3z37ffbb"))
401 (patches (search-patches "openssl-runpath.patch"
402 "openssl-c-rehash-in.patch"))))))
403
763899f0
LF
404(define-public openssl-next
405 (package
406 (inherit openssl)
544db93c 407 (replacement #f)
763899f0 408 (name "openssl")
70852355 409 (version "1.1.0d")
763899f0
LF
410 (source (origin
411 (method url-fetch)
412 (uri (list (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")))
417 (patches (search-patches "openssl-1.1.0-c-rehash-in.patch"))
418 (sha256
419 (base32
70852355 420 "1pv0zql3r73qpjini90hn29l28d65b7i777zav0larbmi6gbnpkx"))))
763899f0
LF
421 (outputs '("out"
422 "doc" ;1.3MiB of man3 pages
423 "static")) ; 5.5MiB of .a files
424 (arguments
425 (substitute-keyword-arguments (package-arguments openssl)
426 ((#:phases phases)
427 `(modify-phases ,phases
428 (delete 'patch-tests) ; These two phases are not needed by
429 (delete 'patch-Makefile.org) ; OpenSSL 1.1.0.
430
fc184fe2
MB
431 ;; Override configure phase since -rpath is now a configure option.
432 (replace 'configure
763899f0 433 (lambda* (#:key outputs #:allow-other-keys)
fc184fe2
MB
434 (let* ((out (assoc-ref outputs "out"))
435 (lib (string-append out "/lib")))
436 (zero?
437 (system* "./config"
438 "shared" ;build shared libraries
439 "--libdir=lib"
440
441 ;; The default for this catch-all directory is
442 ;; PREFIX/ssl. Change that to something more
443 ;; conventional.
444 (string-append "--openssldir=" out
445 "/share/openssl-" ,version)
446
447 (string-append "--prefix=" out)
448 (string-append "-Wl,-rpath," lib)
449
450 ;; XXX FIXME: Work around a code generation bug in GCC
451 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
452 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
453 ,@(if (and (not (%current-target-system))
454 (string-prefix? "armhf" (%current-system)))
455 '("-mfpu=vfpv3")
456 '()))))))
457
458 ;; XXX: Duplicate this phase to make sure 'version' evaluates
459 ;; in the current scope and not the inherited one.
460 (replace 'remove-miscellany
461 (lambda* (#:key outputs #:allow-other-keys)
462 ;; The 'misc' directory contains random undocumented shell and Perl
463 ;; scripts. Remove them to avoid retaining a reference on Perl.
464 (let ((out (assoc-ref outputs "out")))
465 (delete-file-recursively (string-append out "/share/openssl-"
466 ,version "/misc"))
763899f0
LF
467 #t)))))))))
468
cb6a802c
AE
469(define-public libressl
470 (package
471 (name "libressl")
a7c9b062 472 (version "2.5.0")
cb6a802c
AE
473 (source
474 (origin
475 (method url-fetch)
476 (uri (string-append
477 "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-"
478 version ".tar.gz"))
1a957c21
LF
479 (sha256
480 (base32
a7c9b062 481 "1bkfvapi4z826slycmicvs7hwgk4l82gd8w6nqvznldbammvyll6"))))
cb6a802c
AE
482 (build-system gnu-build-system)
483 (native-search-paths
484 ;; FIXME: These two variables must designate a single file or directory
485 ;; and are not actually "search paths." In practice it works OK in
486 ;; user profiles because there's always just one item that matches the
487 ;; specification.
488 (list (search-path-specification
489 (variable "SSL_CERT_DIR")
490 (files '("etc/ssl/certs")))
491 (search-path-specification
492 (variable "SSL_CERT_FILE")
493 (files '("etc/ssl/certs/ca-certificates.crt")))))
494 (home-page "http://www.libressl.org/")
495 (synopsis "SSL/TLS implementation")
496 (description "LibreSSL is a version of the TLS/crypto stack forked
497from OpenSSL in 2014, with the goals of modernizing the codebase, improving
498security, and applying best practice development processes.")
499 ;; Files taken from OpenSSL keep their license, others are under various
500 ;; non-copyleft licenses.
501 (license (list license:openssl
502 (license:non-copyleft
503 "file://COPYING"
504 "See COPYING in the distribution.")))))
505
6cefd53d 506(define-public python-acme
7890e3ba 507 (package
6cefd53d 508 (name "python-acme")
d338ff58 509 (version "0.10.2")
7890e3ba 510 (source (origin
9495cf9a 511 (method url-fetch)
f349d36e 512 (uri (pypi-uri "acme" version))
7890e3ba 513 (sha256
df0625ab 514 (base32
d338ff58 515 "0y6y8d66yvwdcby96g0dlqqwy72b81yh6hws4va8r7w4aribcrb4"))))
7890e3ba
LF
516 (build-system python-build-system)
517 (arguments
6cefd53d 518 `(#:phases
9bee9d87 519 (modify-phases %standard-phases
50a7963a
LF
520 (add-after 'install 'docs
521 (lambda* (#:key outputs #:allow-other-keys)
522 (let* ((out (assoc-ref outputs "out"))
523 (man (string-append out "/share/man/man1"))
524 (info (string-append out "/info")))
525 (and (zero? (system* "make" "-C" "docs" "man" "info"))
526 (install-file "docs/_build/texinfo/acme-python.info" info)
527 (install-file "docs/_build/man/acme-python.1" man)
528 #t)))))))
529 ;; TODO: Add optional inputs for testing.
7890e3ba 530 (native-inputs
6cefd53d 531 `(("python-mock" ,python-mock)
50a7963a
LF
532 ;; For documentation
533 ("python-sphinx" ,python-sphinx)
534 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
535 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
50a7963a 536 ("texinfo" ,texinfo)))
7890e3ba 537 (propagated-inputs
6cefd53d
LF
538 `(("python-ndg-httpsclient" ,python-ndg-httpsclient)
539 ("python-werkzeug" ,python-werkzeug)
540 ("python-six" ,python-six)
541 ("python-requests" ,python-requests)
542 ("python-pytz" ,python-pytz)
543 ("python-pyrfc3339" ,python-pyrfc3339)
544 ("python-pyasn1" ,python-pyasn1)
545 ("python-cryptography" ,python-cryptography)
546 ("python-pyopenssl" ,python-pyopenssl)))
7890e3ba
LF
547 (home-page "https://github.com/letsencrypt/letsencrypt")
548 (synopsis "ACME protocol implementation in Python")
549 (description "ACME protocol implementation in Python")
550 (license license:asl2.0)))
551
6cefd53d
LF
552(define-public python2-acme
553 (package-with-python2 python-acme))
554
9495cf9a 555(define-public certbot
9fd0838b 556 (package
9495cf9a 557 (name "certbot")
80968df0 558 (version "0.10.2")
9fd0838b
DT
559 (source (origin
560 (method url-fetch)
f349d36e 561 (uri (pypi-uri name version))
9fd0838b
DT
562 (sha256
563 (base32
80968df0 564 "0c8nidbbq8p4rjhcrw31saw04n5rz4zgr08chbch17gw03hrqwik"))))
9fd0838b
DT
565 (build-system python-build-system)
566 (arguments
f9263d9a
LF
567 `(#:python ,python-2
568 #:phases
569 (modify-phases %standard-phases
234d0b69 570 (add-after 'build 'docs
f9263d9a
LF
571 (lambda* (#:key outputs #:allow-other-keys)
572 (let* ((out (assoc-ref outputs "out"))
573 (man1 (string-append out "/share/man/man1"))
574 (man7 (string-append out "/share/man/man7"))
575 (info (string-append out "/info")))
f9263d9a
LF
576 (and
577 (zero? (system* "make" "-C" "docs" "man" "info"))
9495cf9a
LF
578 (install-file "docs/_build/texinfo/Certbot.info" info)
579 (install-file "docs/_build/man/certbot.1" man1)
580 (install-file "docs/_build/man/certbot.7" man7)
f9263d9a
LF
581 #t)))))))
582 ;; TODO: Add optional inputs for testing.
9fd0838b
DT
583 (native-inputs
584 `(("python2-nose" ,python2-nose)
f9263d9a
LF
585 ("python2-mock" ,python2-mock)
586 ;; For documentation
587 ("python2-sphinx" ,python2-sphinx)
588 ("python2-sphinx-rtd-theme" ,python2-sphinx-rtd-theme)
589 ("python2-sphinx-repoze-autointerface" ,python2-sphinx-repoze-autointerface)
590 ("python2-sphinxcontrib-programoutput" ,python2-sphinxcontrib-programoutput)
591 ("texinfo" ,texinfo)))
9fd0838b 592 (propagated-inputs
6cefd53d 593 `(("python2-acme" ,python2-acme)
9fd0838b
DT
594 ("python2-zope-interface" ,python2-zope-interface)
595 ("python2-pythondialog" ,python2-pythondialog)
596 ("python2-pyrfc3339" ,python2-pyrfc3339)
597 ("python2-pyopenssl" ,python2-pyopenssl)
598 ("python2-configobj" ,python2-configobj)
599 ("python2-configargparse" ,python2-configargparse)
600 ("python2-zope-component" ,python2-zope-component)
601 ("python2-parsedatetime" ,python2-parsedatetime)
602 ("python2-six" ,python2-six)
603 ("python2-psutil" ,python2-psutil)
604 ("python2-requests" ,python2-requests)
605 ("python2-pytz" ,python2-pytz)))
d8a1be63 606 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
80968df0
TGR
607 (description "Certbot automatically receives and installs X.509 certificates
608to enable Transport Layer Security (TLS) on servers. It interoperates with the
609Let’s Encrypt certificate authority (CA), which issues browser-trusted
610certificates for free.")
24778368 611 (home-page "https://certbot.eff.org/")
9fd0838b
DT
612 (license license:asl2.0)))
613
9495cf9a
LF
614(define-public letsencrypt
615 (package (inherit certbot)
56ab55d1
LF
616 (name "letsencrypt")
617 (properties `((superseded . ,certbot)))))
9495cf9a 618
cc2b77df
AE
619(define-public perl-net-ssleay
620 (package
621 (name "perl-net-ssleay")
622 (version "1.68")
623 (source (origin
624 (method url-fetch)
625 (uri (string-append "mirror://cpan/authors/id/M/MI/MIKEM/"
626 "Net-SSLeay-" version ".tar.gz"))
627 (sha256
628 (base32
1084ec08 629 "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p"))))
cc2b77df 630 (build-system perl-build-system)
1084ec08
MW
631 (native-inputs
632 `(("patch" ,patch)
633 ("patch/disable-ede-test"
634 ,(search-patch "perl-net-ssleay-disable-ede-test.patch"))))
cc2b77df
AE
635 (inputs `(("openssl" ,openssl)))
636 (arguments
1084ec08
MW
637 `(#:phases
638 (modify-phases %standard-phases
639 (add-after
640 'unpack 'apply-patch
641 (lambda* (#:key inputs #:allow-other-keys)
642 ;; XXX We apply this patch here instead of in the 'origin' because
643 ;; this package's build system fails badly when the source file
644 ;; times are zeroed.
645 ;; XXX Try removing this patch for perl-net-ssleay > 1.68
646 (zero? (system* "patch" "--force" "-p1" "-i"
647 (assoc-ref inputs "patch/disable-ede-test")))))
648 (add-before
649 'configure 'set-ssl-prefix
650 (lambda* (#:key inputs #:allow-other-keys)
651 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
652 #t)))))
cc2b77df
AE
653 (synopsis "Perl extension for using OpenSSL")
654 (description
655 "This module offers some high level convenience functions for accessing
656web pages on SSL servers (for symmetry, the same API is offered for accessing
657http servers, too), an sslcat() function for writing your own clients, and
658finally access to the SSL api of the SSLeay/OpenSSL package so you can write
659servers or clients for more complicated applications.")
660 (license (package-license perl))
661 (home-page "http://search.cpan.org/~mikem/Net-SSLeay-1.66/")))
4532c0c0
DM
662
663(define-public perl-crypt-openssl-rsa
664 (package
665 (name "perl-crypt-openssl-rsa")
666 (version "0.28")
667 (source
668 (origin
669 (method url-fetch)
670 (uri (string-append
671 "mirror://cpan/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-"
672 version
673 ".tar.gz"))
674 (sha256
675 (base32
676 "1gnpvv09b2gpifwdzc5jnhama3d1a4c39lzj9hcaicsb8rvzjmsk"))))
677 (build-system perl-build-system)
678 (inputs
679 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
680 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
681 ("openssl" ,openssl)))
682 (arguments perl-crypt-arguments)
683 (home-page
684 "http://search.cpan.org/dist/Crypt-OpenSSL-RSA")
685 (synopsis
686 "RSA encoding and decoding, using the openSSL libraries")
687 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
688OpenSSL libraries).")
689 (license (package-license perl))))
adff71ca
DM
690
691(define perl-crypt-arguments
692 `(#:phases (modify-phases %standard-phases
693 (add-before 'configure 'patch-Makefile.PL
694 (lambda* (#:key inputs #:allow-other-keys)
695 (substitute* "Makefile.PL"
696 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
697 (assoc-ref inputs "openssl")
698 "/lib -lcrypto'],")))
699 #t)))))
700
701(define-public perl-crypt-openssl-bignum
702 (package
703 (name "perl-crypt-openssl-bignum")
704 (version "0.06")
705 (source
706 (origin
707 (method url-fetch)
708 (uri (string-append
709 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
710 version
711 ".tar.gz"))
712 (sha256
713 (base32
714 "05yzrdglrrzp191krf77zrwfkmzrfwrsrx1vyskbj94522lszk67"))))
715 (build-system perl-build-system)
716 (inputs `(("openssl" ,openssl)))
717 (arguments perl-crypt-arguments)
718 (home-page
719 "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum")
720 (synopsis
721 "OpenSSL's multiprecision integer arithmetic in Perl")
722 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
723arithmetic in Perl.")
724 ;; At your option either gpl1+ or the Artistic License
725 (license (package-license perl))))
cccb4d26
DM
726
727(define-public perl-crypt-openssl-random
728 (package
729 (name "perl-crypt-openssl-random")
730 (version "0.11")
731 (source
732 (origin
733 (method url-fetch)
734 (uri (string-append
735 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
736 version
737 ".tar.gz"))
738 (sha256
739 (base32
740 "0yjcabkibrkafywvdkmd1xpi6br48skyk3l15ni176wvlg38335v"))))
741 (build-system perl-build-system)
742 (inputs `(("openssl" ,openssl)))
743 (arguments perl-crypt-arguments)
744 (home-page
745 "http://search.cpan.org/dist/Crypt-OpenSSL-Random")
746 (synopsis
747 "OpenSSL/LibreSSL pseudo-random number generator access")
748 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
749number generator")
750 (license (package-license perl))))
0581c273
LF
751
752(define-public acme-client
753 (package
754 (name "acme-client")
4a6b2a21 755 (version "0.1.16")
0581c273
LF
756 (source (origin
757 (method url-fetch)
758 (uri (string-append "https://kristaps.bsd.lv/" name "/"
759 "snapshots/" name "-portable-"
760 version ".tgz"))
761 (sha256
762 (base32
4a6b2a21 763 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
0581c273
LF
764 (build-system gnu-build-system)
765 (arguments
766 '(#:tests? #f ; no test suite
767 #:make-flags
768 (list "CC=gcc"
769 (string-append "PREFIX=" (assoc-ref %outputs "out")))
770 #:phases
771 (modify-phases %standard-phases
7c1a7bf4
LF
772 (add-after 'unpack 'patch-paths
773 (lambda* (#:key inputs #:allow-other-keys)
774 (let ((pem (string-append (assoc-ref inputs "libressl")
775 "/etc/ssl/cert.pem")))
776 (substitute* "http.c"
777 (("/etc/ssl/cert.pem") pem))
778 #t)))
0581c273 779 (delete 'configure)))) ; no './configure' script
4b569a4f
LF
780 (native-inputs
781 `(("pkg-config" ,pkg-config)))
0581c273
LF
782 (inputs
783 `(("libbsd" ,libbsd)
784 ("libressl" ,libressl)))
785 (synopsis "Let's Encrypt client by the OpenBSD project")
786 (description "acme-client is a Let's Encrypt client implemented in C. It
787uses a modular design, and attempts to secure itself by dropping privileges and
788operating in a chroot where possible. acme-client is developed on OpenBSD and
789then ported to the GNU / Linux environment.")
790 (home-page "https://kristaps.bsd.lv/acme-client/")
791 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
792 ;; and 'jsmn.c' are distributed under the Expat license.
793 (license (list license:isc license:expat))))