| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | (define-module (gnu packages certs)
|
| 24 | #:use-module ((guix licenses) #:prefix license:)
|
| 25 | #:use-module (guix packages)
|
| 26 | #:use-module (guix utils)
|
| 27 | #:use-module (guix download)
|
| 28 | #:use-module (guix gexp)
|
| 29 | #:use-module (guix git-download)
|
| 30 | #:use-module (guix build-system copy)
|
| 31 | #:use-module (guix build-system gnu)
|
| 32 | #:use-module (guix build-system trivial)
|
| 33 | #:use-module (guix build-system go)
|
| 34 | #:use-module (gnu packages)
|
| 35 | #:use-module (gnu packages nss)
|
| 36 | #:use-module (gnu packages curl)
|
| 37 | #:use-module (gnu packages python)
|
| 38 | #:use-module (gnu packages perl)
|
| 39 | #:use-module (gnu packages golang-crypto)
|
| 40 | #:use-module (gnu packages golang-build)
|
| 41 | #:use-module (gnu packages tls))
|
| 42 |
|
| 43 | (define-public certdata2pem
|
| 44 | (let ((revision "1")
|
| 45 | (commit "4c576f350f44186d439179f63d5be19f710a73f5"))
|
| 46 | (package
|
| 47 | (name "certdata2pem")
|
| 48 | (version "0.0.0") |
| 49 | (source (origin
|
| 50 | (method url-fetch)
|
| 51 | (uri (string-append
|
| 52 | "https://raw.githubusercontent.com/sabotage-linux/sabotage/"
|
| 53 | commit "/KEEP/certdata2pem.c"))
|
| 54 | (sha256
|
| 55 | (base32
|
| 56 | "1rywp29q4l1cs2baplkbcravxqs4kw2cys4yifhfznbc210pskq6"))))
|
| 57 | (build-system gnu-build-system)
|
| 58 | (arguments
|
| 59 | `(#:phases (modify-phases %standard-phases
|
| 60 | (delete 'configure)
|
| 61 | (add-before 'build 'fix-extension
|
| 62 | (lambda _
|
| 63 | (substitute* "certdata2pem.c"
|
| 64 | (("\\.crt")
|
| 65 | ".pem"))))
|
| 66 | (replace 'build
|
| 67 | (lambda _
|
| 68 | (invoke ,(cc-for-target) "certdata2pem.c"
|
| 69 | "-o" "certdata2pem")))
|
| 70 | (delete 'check) |
| 71 | (replace 'install
|
| 72 | (lambda* (#:key outputs #:allow-other-keys)
|
| 73 | (let ((out (assoc-ref outputs "out")))
|
| 74 | (install-file "certdata2pem"
|
| 75 | (string-append out "/bin"))))))))
|
| 76 | (home-page "https://github.com/sabotage-linux/")
|
| 77 | (synopsis "Utility to split TLS certificates data into multiple PEM files")
|
| 78 | (description "This is a C version of the certdata2pem Python utility
|
| 79 | that was originally contributed to Debian.")
|
| 80 | (license license:isc))))
|
| 81 |
|
| 82 | (define-public desec-certbot-hook
|
| 83 | (let ((commit "68da7abc0793602fd336962a7e2348b57c5d6fd6")
|
| 84 | (revision "0"))
|
| 85 | (package
|
| 86 | (name "desec-certbot-hook")
|
| 87 | (version
|
| 88 | (git-version "0" revision commit))
|
| 89 | (source
|
| 90 | (origin
|
| 91 | (method git-fetch)
|
| 92 | (uri
|
| 93 | (git-reference
|
| 94 | (url "https://github.com/desec-io/desec-certbot-hook")
|
| 95 | (commit commit)))
|
| 96 | (file-name (git-file-name name version))
|
| 97 | (sha256
|
| 98 | (base32 "0qjqk6i85b1y7fgzcx74r4gn2i4dkjza34hkzp6kyn9hrb8f2gv2"))))
|
| 99 | (build-system copy-build-system)
|
| 100 | (arguments
|
| 101 | `(#:phases
|
| 102 | (modify-phases %standard-phases
|
| 103 | (add-after 'unpack 'patch-script
|
| 104 | (lambda* (#:key inputs #:allow-other-keys)
|
| 105 | (substitute* "hook.sh"
|
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | (("\\$\\(pwd\\)")
|
| 111 | "/etc/desec")
|
| 112 | |
| 113 | (("curl")
|
| 114 | (string-append (assoc-ref inputs "curl")
|
| 115 | "/bin/curl"))))))
|
| 116 | #:install-plan
|
| 117 | '(("." "etc/desec" #:include ("hook.sh")))))
|
| 118 | (inputs
|
| 119 | (list curl))
|
| 120 | (synopsis "Certbot DNS challenge automatization for deSEC")
|
| 121 | (description "The deSEC can be used to obtain certificates with certbot
|
| 122 | DNS ownership verification. With the help of this hook script, you can obtain
|
| 123 | your Let's Encrypt certificate using certbot with authorization provided by the
|
| 124 | DNS challenge mechanism, that is, you will not need a running web server or any
|
| 125 | port forwarding to your local machine.")
|
| 126 | (home-page "https://desec.io")
|
| 127 | (license license:expat))))
|
| 128 |
|
| 129 | (define-public le-certs
|
| 130 | (package
|
| 131 | (name "le-certs")
|
| 132 | (version "1")
|
| 133 | (source #f)
|
| 134 | (build-system trivial-build-system)
|
| 135 | (arguments
|
| 136 | '(#:modules ((guix build utils))
|
| 137 | #:builder
|
| 138 | (begin
|
| 139 | (use-modules (guix build utils))
|
| 140 | (let ((root-rsa (assoc-ref %build-inputs "isrgrootx1.pem"))
|
| 141 | (root-ecdsa (assoc-ref %build-inputs "isrgrootx2.pem"))
|
| 142 | (intermediate-rsa (assoc-ref %build-inputs "letsencryptauthorityr3.pem"))
|
| 143 | (intermediate-ecdsa (assoc-ref %build-inputs "letsencryptauthoritye1.pem"))
|
| 144 | (backup-rsa (assoc-ref %build-inputs "letsencryptauthorityr4.pem"))
|
| 145 | (backup-ecdsa (assoc-ref %build-inputs "letsencryptauthoritye2.pem"))
|
| 146 | (out (string-append (assoc-ref %outputs "out") "/etc/ssl/certs"))
|
| 147 | (openssl (assoc-ref %build-inputs "openssl"))
|
| 148 | (perl (assoc-ref %build-inputs "perl")))
|
| 149 | (mkdir-p out)
|
| 150 | (for-each
|
| 151 | (lambda (cert)
|
| 152 | (copy-file cert (string-append out "/"
|
| 153 | (strip-store-file-name cert))))
|
| 154 | (list root-rsa root-ecdsa
|
| 155 | intermediate-rsa intermediate-ecdsa
|
| 156 | backup-rsa backup-ecdsa))
|
| 157 |
|
| 158 | |
| 159 | |
| 160 | (chdir (string-append %output "/etc/ssl/certs"))
|
| 161 | (invoke (string-append perl "/bin/perl")
|
| 162 | (string-append openssl "/bin/c_rehash")
|
| 163 | ".")))))
|
| 164 | (native-inputs
|
| 165 | (list openssl perl)) |
| 166 | (inputs
|
| 167 | `( |
| 168 | ("isrgrootx1.pem"
|
| 169 | ,(origin
|
| 170 | (method url-fetch)
|
| 171 | (uri "https://letsencrypt.org/certs/isrgrootx1.pem")
|
| 172 | (sha256
|
| 173 | (base32
|
| 174 | "1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92"))))
|
| 175 | |
| 176 | |
| 177 | ("isrgrootx2.pem"
|
| 178 | ,(origin
|
| 179 | (method url-fetch)
|
| 180 | (uri "https://letsencrypt.org/certs/isrg-root-x2.pem")
|
| 181 | (sha256
|
| 182 | (base32
|
| 183 | "04xh8912nwkghqydbqvvmslpqbcafgxgjh9qnn0z2vgy24g8hgd1"))))
|
| 184 | |
| 185 | |
| 186 | ("letsencryptauthorityr3.pem"
|
| 187 | ,(origin
|
| 188 | (method url-fetch)
|
| 189 | (uri "https://letsencrypt.org/certs/lets-encrypt-r3.pem")
|
| 190 | (sha256
|
| 191 | (base32
|
| 192 | "0clxry49rx6qd3pgbzknpgzywbg3j96zy0227wwjnwivqj7inzhp"))))
|
| 193 | |
| 194 | |
| 195 | ("letsencryptauthoritye1.pem"
|
| 196 | ,(origin
|
| 197 | (method url-fetch)
|
| 198 | (uri "https://letsencrypt.org/certs/lets-encrypt-e1.pem")
|
| 199 | (sha256
|
| 200 | (base32
|
| 201 | "1zwrc6dlk1qig0z23x6x7fib14rrw41ccbf2ds0rw75zccc59xx0"))))
|
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | ("letsencryptauthorityr4.pem"
|
| 207 | ,(origin
|
| 208 | (method url-fetch)
|
| 209 | (uri "https://letsencrypt.org/certs/lets-encrypt-r4.pem")
|
| 210 | (sha256
|
| 211 | (base32
|
| 212 | "09bzxzbwb9x2xxan3p1fyj1pi2p5yks0879gwz5f28y9mzq8vmd8"))))
|
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | ("letsencryptauthoritye2.pem"
|
| 218 | ,(origin
|
| 219 | (method url-fetch)
|
| 220 | (uri "https://letsencrypt.org/certs/lets-encrypt-e2.pem")
|
| 221 | (sha256
|
| 222 | (base32
|
| 223 | "1wfmsa29lyi9dkh6xdcamb2rhkp5yl2ppnsgrzcrjl5c7gbqh9ml"))))))
|
| 224 | (home-page "https://letsencrypt.org/certificates/")
|
| 225 | (synopsis "Let's Encrypt root and intermediate certificates")
|
| 226 | (description "This package provides a certificate store containing only the
|
| 227 | Let's Encrypt root and intermediate certificates. It is intended to be used
|
| 228 | within Guix.")
|
| 229 | (license license:public-domain)))
|
| 230 |
|
| 231 | (define-public mkcert
|
| 232 | (package
|
| 233 | (name "mkcert")
|
| 234 | (version "1.4.4")
|
| 235 | (source
|
| 236 | (origin
|
| 237 | (method git-fetch)
|
| 238 | (uri (git-reference
|
| 239 | (url "https://github.com/FiloSottile/mkcert")
|
| 240 | (commit (string-append "v" version))))
|
| 241 | (file-name (git-file-name name version))
|
| 242 | (sha256
|
| 243 | (base32 "0ms9mjspiwlsgsnir0ccj3w8vhvrphf5i6k9q3hrz47y2a6igh0l"))))
|
| 244 | (build-system go-build-system)
|
| 245 | (arguments
|
| 246 | (list
|
| 247 | #:import-path "filippo.io/mkcert"
|
| 248 | #:build-flags
|
| 249 | #~(list (string-append "-ldflags=-X main.Version="
|
| 250 | #$version))))
|
| 251 | (native-inputs (list go-golang-org-x-net
|
| 252 | go-software-sslmate-com-src-go-pkcs12))
|
| 253 | (synopsis "Zero-config tool to make locally trusted development
|
| 254 | certificates")
|
| 255 | (description
|
| 256 | "mkcert is a simple tool for making locally-trusted development
|
| 257 | certificates. It requires no configuration.")
|
| 258 | (home-page "https://github.com/FiloSottile/mkcert")
|
| 259 | (license license:bsd-3)))
|