1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Mike Gerwitz <mtg@gnu.org>
5 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
10 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
27 (define-module (gnu packages security-token)
28 #:use-module (gnu packages)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system glib-or-gtk)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages curl)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages docbook)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages graphviz)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages libusb)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages man)
46 #:use-module (gnu packages networking)
47 #:use-module (gnu packages cyrus-sasl)
48 #:use-module (gnu packages popt)
49 #:use-module (gnu packages readline)
50 #:use-module (gnu packages tls)
51 #:use-module (gnu packages tex)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages web)
55 #:use-module (gnu packages xml))
64 "https://ccid.apdu.fr/files/"
65 name "-" version ".tar.bz2"))
68 "0z7zafdg75fr1adlv2x0zz34s07gljcjg2lsz76s1048w1xhh5xc"))))
69 (build-system gnu-build-system)
71 `(#:configure-flags (list (string-append "--enable-usbdropdir=" %output
74 (modify-phases %standard-phases
75 (add-after 'unpack 'patch-Makefile
77 (substitute* "src/Makefile.in"
78 (("/bin/echo") (which "echo")))
81 `(("pcsc-lite" ,pcsc-lite) ; only required for headers
83 ("pkg-config" ,pkg-config)))
85 `(("libusb" ,libusb)))
86 (home-page "https://ccid.apdu.fr/")
87 (synopsis "PC/SC driver for USB smart card devices")
89 "This package provides a PC/SC IFD handler implementation for devices
90 compliant with the CCID and ICCD protocols. It supports a wide range of
91 readers and is needed to communicate with such devices through the
92 @command{pcscd} resource manager.")
93 (license license:lgpl2.1+)))
103 (url "https://github.com/Fedict/eid-mw")
104 (commit (string-append "v" version))))
106 (base32 "1h90iz4l85drchpkmhlsvg7f9abhw6890fdr9x5n5ir3kxikwcdm"))))
107 (build-system glib-or-gtk-build-system)
109 `(("autoconf" ,autoconf)
110 ("automake" ,automake)
111 ("gettext" ,gnu-gettext)
113 ("pkg-config" ,pkg-config)
119 ("pcsc-lite" ,pcsc-lite)
121 ("libproxy" ,libproxy)
123 ("cyrus-sasl" ,cyrus-sasl)))
126 (modify-phases %standard-phases
127 (add-after 'unpack 'bootstrap
129 ;; configure.ac relies on ‘git --describe’ to get the version.
130 ;; Patch it to just return the real version number directly.
131 (substitute* "scripts/build-aux/genver.sh"
132 (("/bin/sh") (which "sh"))
133 (("\\$GITDESC") ,version))
134 (invoke "sh" "./bootstrap.sh"))))))
135 (synopsis "Belgian eID Middleware")
136 (description "The Belgian eID Middleware is required to authenticate with
137 online services using the Belgian electronic identity card.")
138 (home-page "https://github.com/Fedict/eid-mw")
139 (license license:lgpl3)))
141 (define-public libyubikey
148 "https://developers.yubico.com/yubico-c/Releases/"
149 name "-" version ".tar.gz"))
152 "009l3k2zyn06dbrlja2d4p2vfnzjhlcqxi88v02mlrnb17mx1v84"))))
153 (build-system gnu-build-system)
154 (synopsis "Development kit for the YubiKey authentication device")
156 "This package contains a C library and command-line tools that make up
157 the low-level development kit for the Yubico YubiKey authentication device.")
158 (home-page "https://developers.yubico.com/yubico-c/")
159 (license license:bsd-2)))
161 (define-public pcsc-lite
168 "https://pcsclite.apdu.fr/files/"
169 name "-" version ".tar.bz2"))
172 "0s3mv6csbi9303vvis0hilm71xsmi6cqkbh2kiipdisydbx6865q"))))
173 (build-system gnu-build-system)
175 `(#:configure-flags '("--enable-usbdropdir=/var/lib/pcsc/drivers"
176 "--disable-libsystemd")))
178 `(("perl" ,perl) ; for pod2man
179 ("pkg-config" ,pkg-config)))
181 `(("libudev" ,eudev)))
182 (home-page "https://pcsclite.apdu.fr/")
183 (synopsis "Middleware to access a smart card using PC/SC")
185 "pcsc-lite provides an interface to communicate with smartcards and
186 readers using the SCard API. pcsc-lite is used to connect to the PC/SC daemon
187 from a client application and provide access to the desired reader.")
188 (license (list license:bsd-3 ; pcsc-lite
189 license:isc ; src/strlcat.c src/strlcpy.c
190 license:gpl3+)))) ; src/spy/*
192 (define-public ykclient
199 "https://developers.yubico.com/yubico-c-client/Releases/"
200 name "-" version ".tar.gz"))
203 "05jhx9waj3pl120ddnwap1v3bjrnbfhvf3lxs2xmhpcmwzpwsqgl"))))
204 (build-system gnu-build-system)
206 ;; There's just one test, and it requires network access to access
207 ;; yubico.com, so skip it.
208 (arguments '(#:tests? #f))
210 (native-inputs `(("pkg-config" ,pkg-config)
211 ("help2man" ,help2man)))
212 (inputs `(("curl" ,curl)))
213 (synopsis "C library to validate one-time-password YubiKeys")
215 "YubiKey C Client Library (libykclient) is a C library used to validate a
216 one-time-password (OTP) YubiKey against Yubico’s servers. See the Yubico
217 website for more information about Yubico and the YubiKey.")
218 (home-page "https://developers.yubico.com/yubico-c-client/")
219 (license license:bsd-2)))
221 (define-public opensc
228 "https://github.com/OpenSC/OpenSC/releases/download/"
229 version "/opensc-" version ".tar.gz"))
232 "09jqzl18z5qfrf4vf2nvbpdm3mphpgfkl3ww1clkaxh2z56hwnic"))))
233 (build-system gnu-build-system)
236 (modify-phases %standard-phases
237 ;; By setting an absolute path here, we arrange for OpenSC to
238 ;; successfully dlopen libpcsclite.so.1 by default. The user can
239 ;; still override this if they want to, by specifying a custom OpenSC
240 ;; configuration file at runtime.
241 (add-after 'unpack 'set-default-libpcsclite.so.1-path
242 (lambda* (#:key inputs #:allow-other-keys)
243 (let ((libpcsclite (string-append (assoc-ref inputs "pcsc-lite")
244 "/lib/libpcsclite.so.1")))
245 (substitute* "configure"
246 (("DEFAULT_PCSC_PROVIDER=\"libpcsclite\\.so\\.1\"")
248 "DEFAULT_PCSC_PROVIDER=\"" libpcsclite "\"")))
250 (add-before 'check 'disable-broken-test
252 ;; XXX: This test is fixed in git, remove this phase for >= 0.19.
253 (substitute* "doc/tools/Makefile"
254 (("TESTS = test-manpage.sh") "TESTS = "))
257 `(("readline" ,readline)
259 ("pcsc-lite" ,pcsc-lite)
262 `(("libxslt" ,libxslt)
263 ("docbook-xsl" ,docbook-xsl)
264 ("pkg-config" ,pkg-config)))
265 (home-page "https://github.com/OpenSC/OpenSC/wiki")
266 (synopsis "Tools and libraries related to smart cards")
268 "OpenSC is a set of software tools and libraries to work with smart
269 cards, with the focus on smart cards with cryptographic capabilities. OpenSC
270 facilitate the use of smart cards in security applications such as
271 authentication, encryption and digital signatures. OpenSC implements the PKCS
272 #15 standard and the PKCS #11 API.")
273 (license license:lgpl2.1+)))
275 (define-public yubico-piv-tool
277 (name "yubico-piv-tool")
282 "https://developers.yubico.com/yubico-piv-tool/Releases/"
283 name "-" version ".tar.gz"))
286 "10xgdc51xvszkxmsvqnbjs8ixxz7rfnfahh3wn8glllynmszbhwi"))))
287 (build-system gnu-build-system)
289 `(("gengetopt" ,gengetopt)
291 ("pcsc-lite" ,pcsc-lite)
292 ("openssl" ,openssl)))
294 `(("doxygen" ,doxygen)
295 ("graphviz" ,graphviz)
296 ("help2man" ,help2man)
298 ("texlive-bin" ,texlive-bin)
299 ("pkg-config" ,pkg-config)))
300 (home-page "https://developers.yubico.com/yubico-piv-tool/")
301 (synopsis "Interact with the PIV application on a YubiKey")
303 "The Yubico PIV tool is used for interacting with the Privilege and
304 Identification Card (PIV) application on a YubiKey. With it you may generate
305 keys on the device, import keys and certificates, create certificate requests,
306 and other operations. It includes a library and a command-line tool.")
307 ;; The file ykcs11/pkcs11.h also declares an additional, very short free
308 ;; license for that one file. Please see it for details. The vast
309 ;; majority of files are licensed under bsd-2.
310 (license license:bsd-2)))
312 (define-public yubikey-personalization
314 (name "yubikey-personalization")
319 "https://developers.yubico.com/" name
320 "/Releases/ykpers-" version ".tar.gz"))
323 "104lc0nnqdr365fa7c4vrq67rxp1dp8idndsh9jlhnj9dnhszj1b"))))
324 (build-system gnu-build-system)
326 '(#:configure-flags (list (string-append "--with-udevrulesdir="
327 (assoc-ref %outputs "out")
328 "/lib/udev/rules.d"))))
332 ;; The library "libyubikey" is also known as "yubico-c".
333 ("libyubikey" ,libyubikey)))
335 `(("pkg-config" ,pkg-config)
337 (home-page "https://developers.yubico.com/yubikey-personalization/")
338 (synopsis "Library and tools to personalize YubiKeys")
340 "The YubiKey Personalization package contains a C library and command
341 line tools for personalizing YubiKeys. You can use these to set an AES key,
342 retrieve a YubiKey's serial number, and so forth.")
343 (license license:bsd-2)))