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