authentication.scm 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
  3. ;;; Copyright © 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages authentication)
  20. #:use-module (gnu packages)
  21. #:use-module (gnu packages autotools)
  22. #:use-module (gnu packages documentation)
  23. #:use-module (gnu packages linux)
  24. #:use-module (gnu packages pkg-config)
  25. #:use-module (gnu packages security-token)
  26. #:use-module (gnu packages tls)
  27. #:use-module (gnu packages xml)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (guix download)
  30. #:use-module (guix git-download)
  31. #:use-module ((guix licenses) #:prefix license:)
  32. #:use-module (guix packages))
  33. (define-public oath-toolkit
  34. (package
  35. (name "oath-toolkit")
  36. (version "2.6.7")
  37. (source
  38. (origin
  39. (method url-fetch)
  40. (uri (string-append "https://download.savannah.nongnu.org/releases/"
  41. name "/" name "-" version ".tar.gz"))
  42. (sha256
  43. (base32 "1aa620k05lsw3l3slkp2mzma40q3p9wginspn9zk8digiz7dzv9n"))))
  44. (build-system gnu-build-system)
  45. (arguments
  46. ;; TODO ‘--enable-pskc’ causes xmlsec-related test suite failures.
  47. `(#:configure-flags
  48. (list "--enable-pam"
  49. "--enable-pskc"
  50. "--with-xmlsec-crypto-engine=openssl")
  51. #:phases
  52. (modify-phases %standard-phases
  53. (add-after 'install 'delete-static-libraries
  54. (lambda* (#:key outputs #:allow-other-keys)
  55. (let* ((out (assoc-ref outputs "out"))
  56. (lib (string-append out "/lib")))
  57. (for-each delete-file (find-files lib "\\.a$"))
  58. #t))))))
  59. (native-inputs
  60. `(("pkg-config" ,pkg-config)
  61. ;; XXX: Perhaps this should be propagated from xmlsec.
  62. ("libltdl" ,libltdl)))
  63. (inputs
  64. `(("linux-pam" ,linux-pam)
  65. ("openssl" ,openssl)
  66. ("xmlsec-openssl" ,xmlsec-openssl)))
  67. (home-page "https://www.nongnu.org/oath-toolkit/")
  68. (synopsis "One-time password (OTP) components")
  69. (description
  70. "The @dfn{OATH} (Open AuTHentication) Toolkit provides various components
  71. for building one-time password (@dfn{OTP}) authentication systems:
  72. @itemize
  73. @item @command{oathtool}, a command-line tool for generating & validating OTPs.
  74. @item @code{liboath}, a C library for OATH handling.
  75. @item @command{pskctool}, a command-line tool for manipulating secret key
  76. files in the Portable Symmetric Key Container (@dfn{PSKC}) format
  77. described in RFC6030.
  78. @item @code{libpskc}, a shared and static C library for PSKC handling.
  79. @item @code{pam_oath}, a PAM module for pluggable login authentication.
  80. @end itemize
  81. Supported technologies include the event-based @acronym{HOTP, Hash-based Message
  82. Authentication Code One-Time Password} algorithm (RFC4226), the time-based
  83. @acronym{TOTP, Time-based One-Time Password} algorithm (RFC6238), and
  84. @acronym{PSKC, Portable Symmetric Key Container} (RFC6030) to manage secret key
  85. data.")
  86. (license (list license:lgpl2.1+ ; the libraries (liboath/ & libpskc/)
  87. license:gpl3+)))) ; the tools (everything else)
  88. (define-public yubico-pam
  89. (let ((commit "b5bd00db81e0e0e0ecced65c684080bb56ddc35b")
  90. (revision "0"))
  91. (package
  92. (name "yubico-pam")
  93. (version (git-version "2.26" revision commit))
  94. (source (origin
  95. (method git-fetch)
  96. (uri (git-reference
  97. (url "https://github.com/Yubico/yubico-pam")
  98. (commit commit)))
  99. (file-name (git-file-name name version))
  100. (sha256
  101. (base32
  102. "10dq8dqi3jldllj6p8r9hldx9sank9n82c44w8akxrs1vli6nj3m"))))
  103. (build-system gnu-build-system)
  104. (arguments
  105. ;; The pam_test fails because ykclient fails to build a Curl handle.
  106. '(#:make-flags '("TESTS=util_test")))
  107. (inputs
  108. `(("linux-pam" ,linux-pam)
  109. ("libyubikey" ,libyubikey)
  110. ("ykclient" ,ykclient)
  111. ("yubikey-personalization" ,yubikey-personalization)))
  112. (native-inputs
  113. `(("autoconf" ,autoconf)
  114. ("automake" ,automake)
  115. ("libtool" ,libtool)
  116. ("asciidoc" ,asciidoc)
  117. ("pkg-config" ,pkg-config)))
  118. (home-page "https://developers.yubico.com/yubico-pam")
  119. (synopsis "Yubico pluggable authentication module")
  120. (description "The Yubico PAM module provides an easy way to integrate the
  121. YubiKey into your existing user authentication infrastructure.")
  122. (license license:bsd-2))))
  123. (define-public pamtester
  124. (package
  125. (name "pamtester")
  126. (version "0.1.2")
  127. (source
  128. (origin
  129. (method url-fetch)
  130. (uri (string-append
  131. "mirror://sourceforge/pamtester/pamtester/"
  132. version "/pamtester-" version ".tar.gz"))
  133. (sha256
  134. (base32 "1mdj1wj0adcnx354fs17928yn2xfr1hj5mfraq282dagi873sqw3"))))
  135. (build-system gnu-build-system)
  136. (native-inputs
  137. `(("pkg-config" ,pkg-config)))
  138. (inputs
  139. `(("linux-pam" ,linux-pam)))
  140. (home-page "http://pamtester.sourceforge.net/")
  141. (synopsis "Utility for testing pluggable authentication modules (PAM) facility")
  142. (description
  143. "Pamtester is a tiny utility program to test the pluggable authentication
  144. modules (PAM) facility, specifically designed to help PAM module authors to
  145. intensively test their own modules.")
  146. (license license:bsd-3)))