security-token.scm 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014, 2021 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2016, 2021 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–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  8. ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
  9. ;;; Copyright © 2018, 2019 Chris Marusich <cmmarusich@gmail.com>
  10. ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
  11. ;;; Copyright © 2020 Raphaël Mélotte <raphael.melotte@mind.be>
  12. ;;; Copyright © 2021 Antero Mejr <antero@kodmin.com>
  13. ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
  14. ;;; Copyright © 2021 Sergey Trofimov <sarg@sarg.org.ru>
  15. ;;; Copyright © 2021 Dhruvin Gandhi <contact@dhruvin.dev>
  16. ;;;
  17. ;;; This file is part of GNU Guix.
  18. ;;;
  19. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  20. ;;; under the terms of the GNU General Public License as published by
  21. ;;; the Free Software Foundation; either version 3 of the License, or (at
  22. ;;; your option) any later version.
  23. ;;;
  24. ;;; GNU Guix is distributed in the hope that it will be useful, but
  25. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  26. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. ;;; GNU General Public License for more details.
  28. ;;;
  29. ;;; You should have received a copy of the GNU General Public License
  30. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  31. (define-module (gnu packages security-token)
  32. #:use-module (gnu packages)
  33. #:use-module ((guix licenses) #:prefix license:)
  34. #:use-module (guix packages)
  35. #:use-module (guix download)
  36. #:use-module (guix gexp)
  37. #:use-module (guix git-download)
  38. #:use-module (guix build-system cargo)
  39. #:use-module (guix build-system cmake)
  40. #:use-module (guix build-system gnu)
  41. #:use-module (guix build-system glib-or-gtk)
  42. #:use-module (guix build-system python)
  43. #:use-module (gnu packages autotools)
  44. #:use-module (gnu packages base)
  45. #:use-module (gnu packages curl)
  46. #:use-module (gnu packages check)
  47. #:use-module (gnu packages crates-io)
  48. #:use-module (gnu packages docbook)
  49. #:use-module (gnu packages documentation)
  50. #:use-module (gnu packages dns)
  51. #:use-module (gnu packages gettext)
  52. #:use-module (gnu packages graphviz)
  53. #:use-module (gnu packages gnupg)
  54. #:use-module (gnu packages gtk)
  55. #:use-module (gnu packages libusb)
  56. #:use-module (gnu packages linux)
  57. #:use-module (gnu packages man)
  58. #:use-module (gnu packages networking)
  59. #:use-module (gnu packages cyrus-sasl)
  60. #:use-module (gnu packages popt)
  61. #:use-module (gnu packages readline)
  62. #:use-module (gnu packages qt)
  63. #:use-module (gnu packages tls)
  64. #:use-module (gnu packages tex)
  65. #:use-module (gnu packages perl)
  66. #:use-module (gnu packages pkg-config)
  67. #:use-module (gnu packages python)
  68. #:use-module (gnu packages python-crypto)
  69. #:use-module (gnu packages python-xyz)
  70. #:use-module (gnu packages swig)
  71. #:use-module (gnu packages web)
  72. #:use-module (gnu packages xml))
  73. (define-public ccid
  74. (package
  75. (name "ccid")
  76. (version "1.4.34")
  77. (source (origin
  78. (method url-fetch)
  79. (uri (string-append "https://ccid.apdu.fr/files/ccid-"
  80. version ".tar.bz2"))
  81. (sha256
  82. (base32
  83. "02mlbpnsvy6jgwpz0jk5lh27y3cn2bsyz9xini7898m9b5dn9xz6"))))
  84. (build-system gnu-build-system)
  85. (arguments
  86. `(#:configure-flags (list (string-append "--enable-usbdropdir=" %output
  87. "/pcsc/drivers"))
  88. #:phases
  89. (modify-phases %standard-phases
  90. (add-after 'unpack 'patch-Makefile
  91. (lambda _
  92. (substitute* "src/Makefile.in"
  93. (("/bin/echo") (which "echo")))
  94. #t)))))
  95. (native-inputs
  96. `(("perl" ,perl)
  97. ("pkg-config" ,pkg-config)))
  98. (inputs
  99. `(("libusb" ,libusb)
  100. ("pcsc-lite" ,pcsc-lite)))
  101. (home-page "https://ccid.apdu.fr/")
  102. (synopsis "PC/SC driver for USB smart card devices")
  103. (description
  104. "This package provides a PC/SC IFD handler implementation for devices
  105. compliant with the CCID and ICCD protocols. It supports a wide range of
  106. readers and is needed to communicate with such devices through the
  107. @command{pcscd} resource manager.")
  108. (license license:lgpl2.1+)))
  109. (define-public eid-mw
  110. (package
  111. (name "eid-mw")
  112. (version "5.0.14")
  113. (source
  114. (origin
  115. (method git-fetch)
  116. (uri (git-reference
  117. (url "https://github.com/Fedict/eid-mw")
  118. (commit (string-append "v" version))))
  119. (file-name (git-file-name name version))
  120. (sha256
  121. (base32 "1hyxsbxjjn9hh5p7jlcfb5yplf3n8dg49dfgi8fjp95phis3gbd4"))))
  122. (build-system glib-or-gtk-build-system)
  123. (native-inputs
  124. `(("autoconf" ,autoconf)
  125. ("autoconf-archive" ,autoconf-archive)
  126. ("automake" ,automake)
  127. ("gettext" ,gettext-minimal)
  128. ("libtool" ,libtool)
  129. ("libassuan" ,libassuan)
  130. ("pkg-config" ,pkg-config)
  131. ("perl" ,perl)))
  132. (inputs
  133. `(("curl" ,curl)
  134. ("openssl" ,openssl)
  135. ("gtk+" ,gtk+)
  136. ("pcsc-lite" ,pcsc-lite)
  137. ("p11-kit" ,p11-kit)
  138. ("libproxy" ,libproxy)
  139. ("libxml2" ,libxml2)
  140. ("cyrus-sasl" ,cyrus-sasl)))
  141. (arguments
  142. `(#:configure-flags
  143. (list "--disable-static")
  144. #:phases
  145. (modify-phases %standard-phases
  146. (replace 'bootstrap
  147. (lambda _
  148. ;; configure.ac relies on ‘git --describe’ to get the version.
  149. ;; Patch it to just return the real version number directly.
  150. (substitute* "scripts/build-aux/genver.sh"
  151. (("/bin/sh") (which "sh"))
  152. (("^(GITDESC=).*" _ match) (string-append match ,version "\n")))
  153. (invoke "sh" "./bootstrap.sh")))
  154. (add-after 'unpack 'make-reproducible
  155. (lambda _
  156. (substitute* "scripts/mac/create-vers.sh"
  157. (("NOW=.*")
  158. "NOW=1970-01-01\n"))
  159. #t))
  160. ;; Remove failing test that was removed upstream after version 5.0.8.
  161. ;; See: https://github.com/Fedict/eid-mw/commit/3d1187b1b61118b9ae97607903d3d2fc0bad7518
  162. (add-before 'check 'remove-failing-test
  163. (lambda _
  164. (substitute* "tests/unit/Makefile.am"
  165. (("sign_state ordering cardcom_common")
  166. "sign_state ordering #cardcom_common"))
  167. #t))
  168. )))
  169. (synopsis "Belgian eID Middleware")
  170. (description "The Belgian eID Middleware is required to authenticate with
  171. online services using the Belgian electronic identity card.")
  172. (home-page "https://github.com/Fedict/eid-mw")
  173. (license license:lgpl3)))
  174. (define-public libyubikey
  175. (package
  176. (name "libyubikey")
  177. (version "1.13")
  178. (source (origin
  179. (method url-fetch)
  180. (uri (string-append
  181. "https://developers.yubico.com/yubico-c/Releases/"
  182. name "-" version ".tar.gz"))
  183. (sha256
  184. (base32
  185. "009l3k2zyn06dbrlja2d4p2vfnzjhlcqxi88v02mlrnb17mx1v84"))))
  186. (build-system gnu-build-system)
  187. (synopsis "Development kit for the YubiKey authentication device")
  188. (description
  189. "This package contains a C library and command-line tools that make up
  190. the low-level development kit for the Yubico YubiKey authentication device.")
  191. (home-page "https://developers.yubico.com/yubico-c/")
  192. (license license:bsd-2)))
  193. (define-public softhsm
  194. (package
  195. (name "softhsm")
  196. (version "2.6.1")
  197. (source (origin
  198. (method url-fetch)
  199. (uri (string-append
  200. "https://dist.opendnssec.org/source/"
  201. "softhsm-" version ".tar.gz"))
  202. (sha256
  203. (base32
  204. "1wkmyi6n3z2pak1cj5yk6v6bv9w0m24skycya48iikab0mrr8931"))))
  205. (build-system gnu-build-system)
  206. (arguments
  207. '(#:configure-flags '("--disable-gost"))) ; TODO Missing the OpenSSL
  208. ; engine for GOST
  209. (inputs
  210. `(("openssl" ,openssl)))
  211. (native-inputs
  212. `(("pkg-config" ,pkg-config)
  213. ("cppunit" ,cppunit)))
  214. (synopsis "Software implementation of a generic cryptographic device")
  215. (description
  216. "SoftHSM 2 is a software implementation of a generic cryptographic device
  217. with a PKCS #11 Cryptographic Token Interface.")
  218. (home-page "https://www.opendnssec.org/softhsm/")
  219. (license license:bsd-2)))
  220. (define-public pcsc-lite
  221. (package
  222. (name "pcsc-lite")
  223. (version "1.9.3")
  224. (source (origin
  225. (method url-fetch)
  226. (uri (string-append "https://pcsclite.apdu.fr/files/"
  227. "pcsc-lite-" version ".tar.bz2"))
  228. (sha256
  229. (base32
  230. "0n9y9m1wr5bwanpnylpdza3sf7lawi63jjizrl1aj5yxf4y46mk9"))))
  231. (build-system gnu-build-system)
  232. (arguments
  233. `(#:configure-flags '("--enable-usbdropdir=/var/lib/pcsc/drivers"
  234. "--disable-libsystemd")))
  235. (native-inputs
  236. `(("perl" ,perl) ; for pod2man
  237. ("pkg-config" ,pkg-config)))
  238. (inputs
  239. `(("libudev" ,eudev)))
  240. (home-page "https://pcsclite.apdu.fr/")
  241. (synopsis "Middleware to access a smart card using PC/SC")
  242. (description
  243. "pcsc-lite provides an interface to communicate with smartcards and
  244. readers using the SCard API. pcsc-lite is used to connect to the PC/SC daemon
  245. from a client application and provide access to the desired reader.")
  246. (license (list license:bsd-3 ; pcsc-lite
  247. license:isc ; src/strlcat.c src/strlcpy.c
  248. license:gpl3+)))) ; src/spy/*
  249. (define-public ykclient
  250. (package
  251. (name "ykclient")
  252. (version "2.15")
  253. (source (origin
  254. (method url-fetch)
  255. (uri (string-append
  256. "https://developers.yubico.com/yubico-c-client/Releases/"
  257. name "-" version ".tar.gz"))
  258. (sha256
  259. (base32
  260. "05jhx9waj3pl120ddnwap1v3bjrnbfhvf3lxs2xmhpcmwzpwsqgl"))))
  261. (build-system gnu-build-system)
  262. ;; There's just one test, and it requires network access to access
  263. ;; yubico.com, so skip it.
  264. (arguments '(#:tests? #f))
  265. (native-inputs `(("pkg-config" ,pkg-config)
  266. ("help2man" ,help2man)))
  267. (inputs `(("curl" ,curl)))
  268. (synopsis "C library to validate one-time-password YubiKeys")
  269. (description
  270. "YubiKey C Client Library (libykclient) is a C library used to validate a
  271. one-time-password (OTP) YubiKey against Yubico’s servers. See the Yubico
  272. website for more information about Yubico and the YubiKey.")
  273. (home-page "https://developers.yubico.com/yubico-c-client/")
  274. (license license:bsd-2)))
  275. (define-public opensc
  276. (package
  277. (name "opensc")
  278. (version "0.21.0")
  279. (source (origin
  280. (method url-fetch)
  281. (uri (string-append
  282. "https://github.com/OpenSC/OpenSC/releases/download/"
  283. version "/opensc-" version ".tar.gz"))
  284. (sha256
  285. (base32
  286. "0pijycjwpll9zn83dazgsh8n9ywq0z1ragjsd1sqv3abrcfvpyrb"))))
  287. (build-system gnu-build-system)
  288. (arguments
  289. `(#:phases
  290. (modify-phases %standard-phases
  291. ;; By setting an absolute path here, we arrange for OpenSC to
  292. ;; successfully dlopen libpcsclite.so.1 by default. The user can
  293. ;; still override this if they want to, by specifying a custom OpenSC
  294. ;; configuration file at runtime.
  295. (add-after 'unpack 'set-default-libpcsclite.so.1-path
  296. (lambda* (#:key inputs #:allow-other-keys)
  297. (let ((libpcsclite (search-input-file inputs
  298. "/lib/libpcsclite.so.1")))
  299. (substitute* "configure"
  300. (("DEFAULT_PCSC_PROVIDER=\"libpcsclite\\.so\\.1\"")
  301. (string-append
  302. "DEFAULT_PCSC_PROVIDER=\"" libpcsclite "\"")))
  303. #t))))))
  304. (inputs
  305. `(("readline" ,readline)
  306. ("openssl" ,openssl)
  307. ("pcsc-lite" ,pcsc-lite)
  308. ("ccid" ,ccid)))
  309. (native-inputs
  310. `(("libxslt" ,libxslt)
  311. ("docbook-xsl" ,docbook-xsl)
  312. ("pkg-config" ,pkg-config)))
  313. (home-page "https://github.com/OpenSC/OpenSC/wiki")
  314. (synopsis "Tools and libraries related to smart cards")
  315. (description
  316. "OpenSC is a set of software tools and libraries to work with smart
  317. cards, with the focus on smart cards with cryptographic capabilities. OpenSC
  318. facilitate the use of smart cards in security applications such as
  319. authentication, encryption and digital signatures. OpenSC implements the PKCS
  320. #15 standard and the PKCS #11 API.")
  321. (license license:lgpl2.1+)))
  322. (define-public yubico-piv-tool
  323. (package
  324. (name "yubico-piv-tool")
  325. (version "1.6.1")
  326. (source (origin
  327. (method url-fetch)
  328. (uri (string-append
  329. "https://developers.yubico.com/yubico-piv-tool/Releases/"
  330. name "-" version ".tar.gz"))
  331. (sha256
  332. (base32
  333. "10xgdc51xvszkxmsvqnbjs8ixxz7rfnfahh3wn8glllynmszbhwi"))))
  334. (build-system gnu-build-system)
  335. (inputs
  336. `(("gengetopt" ,gengetopt)
  337. ("perl" ,perl)
  338. ("pcsc-lite" ,pcsc-lite)
  339. ("openssl" ,openssl)))
  340. (native-inputs
  341. `(("doxygen" ,doxygen)
  342. ("graphviz" ,graphviz)
  343. ("help2man" ,help2man)
  344. ("check" ,check)
  345. ("texlive-bin" ,texlive-bin)
  346. ("pkg-config" ,pkg-config)))
  347. (home-page "https://developers.yubico.com/yubico-piv-tool/")
  348. (synopsis "Interact with the PIV application on a YubiKey")
  349. (description
  350. "The Yubico PIV tool is used for interacting with the Privilege and
  351. Identification Card (PIV) application on a YubiKey. With it you may generate
  352. keys on the device, import keys and certificates, create certificate requests,
  353. and other operations. It includes a library and a command-line tool.")
  354. ;; The file ykcs11/pkcs11.h also declares an additional, very short free
  355. ;; license for that one file. Please see it for details. The vast
  356. ;; majority of files are licensed under bsd-2.
  357. (license license:bsd-2)))
  358. (define-public yubikey-personalization
  359. (package
  360. (name "yubikey-personalization")
  361. (version "1.20.0")
  362. (source (origin
  363. (method url-fetch)
  364. (uri (string-append
  365. "https://developers.yubico.com/" name
  366. "/Releases/ykpers-" version ".tar.gz"))
  367. (sha256
  368. (base32
  369. "14wvlwqnwj0gllkpvfqiy8ns938bwvjsz8x1hmymmx32m074vj0f"))
  370. (modules '((guix build utils)))
  371. (snippet
  372. ;; Fix build with GCC 10, remove for versions > 1.20.0.
  373. '(begin
  374. (substitute* "ykpers-args.h"
  375. (("^const char")
  376. "extern const char"))))))
  377. (build-system gnu-build-system)
  378. (arguments
  379. '(#:configure-flags (list (string-append "--with-udevrulesdir="
  380. (assoc-ref %outputs "out")
  381. "/lib/udev/rules.d"))))
  382. (inputs
  383. `(("json-c" ,json-c-0.13)
  384. ("libusb" ,libusb)
  385. ;; The library "libyubikey" is also known as "yubico-c".
  386. ("libyubikey" ,libyubikey)))
  387. (native-inputs
  388. `(("pkg-config" ,pkg-config)
  389. ("eudev" ,eudev)))
  390. (home-page "https://developers.yubico.com/yubikey-personalization/")
  391. (synopsis "Library and tools to personalize YubiKeys")
  392. (description
  393. "The YubiKey Personalization package contains a C library and command
  394. line tools for personalizing YubiKeys. You can use these to set an AES key,
  395. retrieve a YubiKey's serial number, and so forth.")
  396. (license license:bsd-2)))
  397. (define-public python-pyscard
  398. (package
  399. (name "python-pyscard")
  400. (version "1.9.9")
  401. (source (origin
  402. (method url-fetch)
  403. ;; The maintainer publishes releases on various sites, but
  404. ;; SourceForge is apparently the only one with a signed release.
  405. (uri (string-append
  406. "mirror://sourceforge/pyscard/pyscard/pyscard%20"
  407. version "/pyscard-" version ".tar.gz"))
  408. (sha256
  409. (base32
  410. "082cjkbxadaz2jb4rbhr0mkrirzlqyqhcf3r823qb0q1k50ybgg6"))))
  411. (build-system python-build-system)
  412. (arguments
  413. `(#:phases
  414. (modify-phases %standard-phases
  415. ;; Tell pyscard where to find the PCSC include directory.
  416. (add-after 'unpack 'patch-platform-include-dirs
  417. (lambda* (#:key inputs #:allow-other-keys)
  418. (let ((pcsc-include-dir (string-append
  419. (assoc-ref inputs "pcsc-lite")
  420. "/include/PCSC")))
  421. (substitute* "setup.py"
  422. (("platform_include_dirs = \\[.*?\\]")
  423. (string-append
  424. "platform_include_dirs = ['" pcsc-include-dir "']")))
  425. #t)))
  426. ;; pyscard wants to dlopen libpcsclite, so tell it where it is.
  427. (add-after 'unpack 'patch-dlopen
  428. (lambda* (#:key inputs #:allow-other-keys)
  429. (substitute* "smartcard/scard/winscarddll.c"
  430. (("lib = \"libpcsclite\\.so\\.1\";")
  431. (simple-format #f
  432. "lib = \"~a\";"
  433. (search-input-file inputs
  434. "/lib/libpcsclite.so.1"))))
  435. #t)))))
  436. (inputs
  437. `(("pcsc-lite" ,pcsc-lite)))
  438. (native-inputs
  439. `(("swig" ,swig)))
  440. (home-page "https://github.com/LudovicRousseau/pyscard")
  441. (synopsis "Smart card library for Python")
  442. (description
  443. "The pyscard smart card library is a framework for building smart card
  444. aware applications in Python. The smart card module is built on top of the
  445. PCSC API Python wrapper module.")
  446. (license license:lgpl2.1+)))
  447. (define-public python2-pyscard
  448. (package-with-python2 python-pyscard))
  449. (define-public libu2f-host
  450. (package
  451. (name "libu2f-host")
  452. (version "1.1.10")
  453. (source (origin
  454. (method url-fetch)
  455. (uri
  456. (string-append
  457. "https://developers.yubico.com"
  458. "/libu2f-host/Releases/libu2f-host-" version ".tar.xz"))
  459. (sha256
  460. (base32
  461. "0vrivl1dwql6nfi48z6dy56fwy2z13d7abgahgrs2mcmqng7hra2"))))
  462. (build-system gnu-build-system)
  463. (arguments
  464. `(#:configure-flags
  465. (list "--enable-gtk-doc"
  466. (string-append "--with-udevrulesdir="
  467. (assoc-ref %outputs "out")
  468. "/lib/udev/rules.d"))
  469. #:phases
  470. (modify-phases %standard-phases
  471. (add-after 'unpack 'patch-docbook-xml
  472. (lambda* (#:key inputs #:allow-other-keys)
  473. ;; Avoid a network connection attempt during the build.
  474. (substitute* "gtk-doc/u2f-host-docs.xml"
  475. (("http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd")
  476. (string-append (assoc-ref inputs "docbook-xml")
  477. "/xml/dtd/docbook/docbookx.dtd")))
  478. #t)))))
  479. (inputs
  480. `(("json-c" ,json-c-0.13)
  481. ("hidapi" ,hidapi)))
  482. (native-inputs
  483. `(("help2man" ,help2man)
  484. ("gengetopt" ,gengetopt)
  485. ("pkg-config" ,pkg-config)
  486. ("gtk-doc" ,gtk-doc)
  487. ("docbook-xml" ,docbook-xml-4.3)
  488. ("eudev" ,eudev)))
  489. (home-page "https://developers.yubico.com/libu2f-host/")
  490. ;; TRANSLATORS: The U2F protocol has a "server side" and a "host side".
  491. (synopsis "U2F host-side C library and tool")
  492. (description
  493. "Libu2f-host provides a C library and command-line tool that implements
  494. the host-side of the Universal 2nd Factor (U2F) protocol. There are APIs to
  495. talk to a U2F device and perform the U2F Register and U2F Authenticate
  496. operations.")
  497. ;; Most files are LGPLv2.1+, but some files are GPLv3+.
  498. (license (list license:lgpl2.1+ license:gpl3+))))
  499. (define-public libu2f-server
  500. (package
  501. (name "libu2f-server")
  502. (version "1.1.0")
  503. (source (origin
  504. (method git-fetch)
  505. (uri
  506. (git-reference
  507. (url "https://github.com/Yubico/libu2f-server")
  508. (commit (string-append "libu2f-server-" version))))
  509. (file-name (git-file-name name version))
  510. (sha256
  511. (base32
  512. "1nmsfq372zza5y6j13ydincjf324bwfcjg950vykh166xkp6wiic"))))
  513. (build-system gnu-build-system)
  514. (arguments
  515. `(#:configure-flags
  516. (list "--enable-gtk-doc"
  517. "--enable-tests")))
  518. (inputs
  519. `(("json-c" ,json-c-0.13)
  520. ("libressl" ,libressl)))
  521. (native-inputs
  522. `(("autoconf" ,autoconf)
  523. ("automake" ,automake)
  524. ("libtool" ,libtool)
  525. ("check" ,check)
  526. ("gengetopt" ,gengetopt)
  527. ("help2man" ,help2man)
  528. ("pkg-config" ,pkg-config)
  529. ("gtk-doc" ,gtk-doc)
  530. ("which" ,which)))
  531. (home-page "https://developers.yubico.com/libu2f-server/")
  532. ;; TRANSLATORS: The U2F protocol has a "server side" and a "host side".
  533. (synopsis "U2F server-side C library")
  534. (description
  535. "This is a C library that implements the server-side of the
  536. @dfn{Universal 2nd Factor} (U2F) protocol. More precisely, it provides an API
  537. for generating the JSON blobs required by U2F devices to perform the U2F
  538. Registration and U2F Authentication operations, and functionality for
  539. verifying the cryptographic operations.")
  540. (license license:bsd-2)))
  541. (define-public pam-u2f
  542. (package
  543. (name "pam-u2f")
  544. (version "1.0.8")
  545. (source (origin
  546. (method git-fetch)
  547. (uri
  548. (git-reference
  549. (url "https://github.com/Yubico/pam-u2f")
  550. (commit (string-append "pam_u2f-" version))))
  551. (file-name (git-file-name name version))
  552. (sha256
  553. (base32
  554. "04d9davyi33gqbvga1rvh9fijp6f16mx2xmnn4n61rnhcn2jac98"))))
  555. (build-system gnu-build-system)
  556. (arguments
  557. `(#:configure-flags
  558. (list (string-append "--with-pam-dir="
  559. (assoc-ref %outputs "out") "/lib/security"))))
  560. (inputs
  561. `(("libu2f-host" ,libu2f-host)
  562. ("libu2f-server" ,libu2f-server)
  563. ("linux-pam" ,linux-pam)))
  564. (native-inputs
  565. `(("autoconf" ,autoconf)
  566. ("automake" ,automake)
  567. ("libtool" ,libtool)
  568. ("asciidoc" ,asciidoc)
  569. ("pkg-config" ,pkg-config)))
  570. (home-page "https://developers.yubico.com/pam-u2f/")
  571. (synopsis "PAM module for U2F authentication")
  572. (description
  573. "This package provides a module implementing PAM over U2F, providing an
  574. easy way to integrate the YubiKey (or other U2F compliant authenticators) into
  575. your existing infrastructure.")
  576. (license license:bsd-2)))
  577. (define-public python-fido2
  578. (package
  579. (name "python-fido2")
  580. (version "0.5.0")
  581. (source (origin
  582. (method url-fetch)
  583. (uri
  584. (string-append
  585. "https://github.com/Yubico/python-fido2/releases/download/"
  586. version "/fido2-" version ".tar.gz"))
  587. (sha256
  588. (base32
  589. "1pl8d2pr6jzqj4y9qiaddhjgnl92kikjxy0bgzm2jshkzzic8mp3"))
  590. (snippet
  591. ;; Remove bundled dependency.
  592. #~(delete-file "fido2/public_suffix_list.dat"))))
  593. (build-system python-build-system)
  594. (arguments
  595. `(#:phases
  596. (modify-phases %standard-phases
  597. (add-after 'unpack 'install-public-suffix-list
  598. (lambda* (#:key inputs #:allow-other-keys)
  599. (copy-file
  600. (search-input-file inputs
  601. (string-append
  602. "/share/public-suffix-list-"
  603. ,(package-version public-suffix-list)
  604. "/public_suffix_list.dat"))
  605. "fido2/public_suffix_list.dat")
  606. #t)))))
  607. (propagated-inputs
  608. `(("python-cryptography" ,python-cryptography)
  609. ("python-six" ,python-six)))
  610. (native-inputs
  611. `(("python-mock" ,python-mock)
  612. ("python-pyfakefs" ,python-pyfakefs)
  613. ("public-suffix-list" ,public-suffix-list)))
  614. (home-page "https://github.com/Yubico/python-fido2")
  615. (synopsis "Python library for communicating with FIDO devices over USB")
  616. (description
  617. "This Python library provides functionality for communicating with a Fast
  618. IDentity Online (FIDO) device over Universal Serial Bus (USB) as well as
  619. verifying attestation and assertion signatures. It aims to support the FIDO
  620. Universal 2nd Factor (U2F) and FIDO 2.0 protocols for communicating with a USB
  621. authenticator via the Client-to-Authenticator Protocol (CTAP 1 and 2). In
  622. addition to this low-level device access, classes defined in the
  623. @code{fido2.client} and @code{fido2.server} modules implement higher level
  624. operations which are useful when interfacing with an Authenticator, or when
  625. implementing a Relying Party.")
  626. ;; python-fido2 contains some derivative files originally from pyu2f
  627. ;; (https://github.com/google/pyu2f). These files are licensed under the
  628. ;; Apache License, version 2.0. The maintainers have customized these
  629. ;; files for internal use, so they are not really a bundled dependency.
  630. (license (list license:bsd-2 license:asl2.0))))
  631. (define-public python-yubikey-manager
  632. (package
  633. (name "python-yubikey-manager")
  634. (version "2.1.0")
  635. (source (origin
  636. (method url-fetch)
  637. (uri (string-append
  638. "https://developers.yubico.com/yubikey-manager/Releases"
  639. "/yubikey-manager-" version ".tar.gz"))
  640. (sha256
  641. (base32
  642. "11rsmcaj60k3y5m5gdhr2nbbz0w5dm3m04klyxz0fh5hnpcmr7fm"))))
  643. (build-system python-build-system)
  644. (arguments
  645. '(#:modules ((srfi srfi-1)
  646. (guix build utils)
  647. (guix build python-build-system))
  648. #:phases
  649. (modify-phases %standard-phases
  650. (add-after 'unpack 'fix-libykpers-reference
  651. (lambda* (#:key inputs #:allow-other-keys)
  652. (substitute* "ykman/driver_otp.py"
  653. (("Ykpers\\('ykpers-1', '1'\\)")
  654. (string-append
  655. "Ykpers('"
  656. (find (negate symbolic-link?)
  657. (find-files (assoc-ref inputs "yubikey-personalization")
  658. "^libykpers-.*\\.so\\..*"))
  659. "')")))
  660. #t)))))
  661. (propagated-inputs
  662. `(("python-six" ,python-six)
  663. ("python-pyscard" ,python-pyscard)
  664. ("python-pyusb" ,python-pyusb)
  665. ("python-click" ,python-click)
  666. ("python-cryptography" ,python-cryptography)
  667. ("python-pyopenssl" ,python-pyopenssl)
  668. ("python-fido2" ,python-fido2)))
  669. (inputs
  670. `(("yubikey-personalization" ,yubikey-personalization)
  671. ("pcsc-lite" ,pcsc-lite)
  672. ("libusb" ,libusb)))
  673. (native-inputs
  674. `(("swig" ,swig)
  675. ("python-mock" ,python-mock)))
  676. (home-page "https://developers.yubico.com/yubikey-manager/")
  677. (synopsis "Command line tool and library for configuring a YubiKey")
  678. (description
  679. "Python library and command line tool for configuring a YubiKey. Note
  680. that after installing this package, you might still need to add appropriate
  681. udev rules to your system configuration to be able to configure the YubiKey as
  682. an unprivileged user.")
  683. (license license:bsd-2)))
  684. (define-public nitrocli
  685. (package
  686. (name "nitrocli")
  687. (version "0.4.1")
  688. (source (origin
  689. (method url-fetch)
  690. (uri (crate-uri "nitrocli" version))
  691. (file-name (string-append name "-" version ".tar.gz"))
  692. (sha256
  693. (base32
  694. "1djspfvcqjipg17v8hkph8xrhkdg1xqjhq5jk1sr8vr750yavidy"))))
  695. (build-system cargo-build-system)
  696. (arguments
  697. `(#:tests? #f ;; 2/164 tests fail, nitrocli-ext tests failing
  698. #:cargo-inputs
  699. (("rust-anyhow" ,rust-anyhow-1)
  700. ("rust-base32" ,rust-base32-0.4)
  701. ("rust-directories" ,rust-directories-3)
  702. ("rust-envy" ,rust-envy-0.4)
  703. ("rust-libc-0.2" ,rust-libc-0.2)
  704. ("rust-merge" ,rust-merge-0.1)
  705. ("rust-nitrokey" ,rust-nitrokey-0.9)
  706. ("rust-progressing" ,rust-progressing-3)
  707. ("rust-serde" ,rust-serde-1)
  708. ("rust-structopt" ,rust-structopt-0.3)
  709. ("rust-termion" ,rust-termion-1)
  710. ("rust-toml" ,rust-toml-0.5))
  711. #:cargo-development-inputs
  712. (("rust-nitrokey-test" ,rust-nitrokey-test-0.5)
  713. ("rust-nitrokey-test-state" ,rust-nitrokey-test-state-0.1)
  714. ("rust-regex" ,rust-regex-1)
  715. ("rust-tempfile" ,rust-tempfile-3))))
  716. (inputs
  717. `(("hidapi" ,hidapi)
  718. ("gnupg" ,gnupg)))
  719. (home-page "https://github.com/d-e-s-o/nitrocli")
  720. (synopsis "Command line tool for Nitrokey devices")
  721. (description
  722. "nitrocli is a program that provides a command line interface
  723. for interaction with Nitrokey Pro, Nitrokey Storage, and Librem Key
  724. devices.")
  725. (license license:gpl3+)))
  726. (define-public ausweisapp2
  727. (package
  728. (name "ausweisapp2")
  729. (version "1.22.2")
  730. (source (origin
  731. (method url-fetch)
  732. (uri (string-append "https://github.com/Governikus/AusweisApp2/releases"
  733. "/download/" version "/AusweisApp2-" version ".tar.gz"))
  734. (sha256
  735. (base32
  736. "1qh1m057va7njs3yk0s31kwsvv44fjlsdac6lhiw5npcwssgjn8l"))))
  737. (build-system cmake-build-system)
  738. (native-inputs
  739. `(("pkg-config" ,pkg-config)
  740. ("qttools" ,qttools)))
  741. (inputs
  742. `(("qtbase" ,qtbase-5)
  743. ("qtsvg" ,qtsvg)
  744. ("qtdeclarative" ,qtdeclarative)
  745. ("qtwebsockets" ,qtwebsockets)
  746. ("qtgraphicaleffects" ,qtgraphicaleffects)
  747. ("qtquickcontrols2" ,qtquickcontrols2)
  748. ("pcsc-lite" ,pcsc-lite)
  749. ("openssl" ,openssl)))
  750. (arguments
  751. `(#:modules ((guix build cmake-build-system)
  752. (guix build qt-utils)
  753. (guix build utils))
  754. #:imported-modules (,@%cmake-build-system-modules
  755. (guix build qt-utils))
  756. #:phases
  757. (modify-phases %standard-phases
  758. (add-after 'install 'wrap-qt
  759. (lambda* (#:key inputs outputs #:allow-other-keys)
  760. (let ((out (assoc-ref outputs "out")))
  761. (wrap-qt-program "AusweisApp2" #:output out #:inputs inputs)))))))
  762. (home-page "https://github.com/Governikus/AusweisApp2")
  763. (synopsis
  764. "Authentication program for German ID cards and residence permits")
  765. (description
  766. "This application is developed and issued by the German government to be
  767. used for online authentication with electronic German ID cards and residence
  768. titles. To use this app, a supported RFID card reader or NFC-enabled smart
  769. phone is required.")
  770. (license license:eupl1.2)))