2020-03-10 15:40:37 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, pkgconfig
|
|
|
|
, libcbor
|
|
|
|
, openssl
|
|
|
|
, udev
|
|
|
|
, IOKit }:
|
2019-03-29 16:13:20 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libfido2";
|
2020-02-23 16:59:41 +01:00
|
|
|
version = "1.3.1";
|
2019-03-29 16:13:20 +01:00
|
|
|
src = fetchurl {
|
2019-11-29 04:18:47 +01:00
|
|
|
url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
|
2020-02-23 16:59:41 +01:00
|
|
|
sha256 = "0hdgxbmjbnm9kjwc07nrl2zy87qclvb3rzvdwr5iw35n2qhf4dds";
|
2019-03-29 16:13:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
2020-03-10 15:40:37 +01:00
|
|
|
|
2020-03-03 13:01:09 +01:00
|
|
|
buildInputs = [ libcbor openssl ]
|
2020-02-23 16:59:41 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ udev ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ];
|
2019-03-29 16:13:20 +01:00
|
|
|
|
2020-03-10 15:40:37 +01:00
|
|
|
patches = [
|
|
|
|
# fix build on darwin
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Yubico/libfido2/commit/916ebd18a89e4028de203d603726805339be7a5b.patch";
|
|
|
|
sha256 = "07f0xpxnq02cccmqcric87b6pms7k7ssvdw722zr970a6qs8p6i7";
|
|
|
|
})
|
|
|
|
# allow attestation using any supported algorithm
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Yubico/libfido2/commit/f7a9471fa0588cb91cbefffb13c1e4d06c2179b7.patch";
|
|
|
|
sha256 = "02qbw9bqy3sixvwig6az7v3vimgznxnfikn9p1jczm3d7mn8asw2";
|
|
|
|
})
|
|
|
|
# fix EdDSA attestation signature verification bug
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Yubico/libfido2/commit/95126eea52294419515e6540dfd7220f35664c48.patch";
|
|
|
|
sha256 = "076mwpl9xndjhy359jdv2drrwyq7wd3pampkn28mn1rlwxfgf0d0";
|
|
|
|
})
|
|
|
|
];
|
2020-02-23 16:59:41 +01:00
|
|
|
|
2020-03-10 15:40:37 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d"
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
];
|
2019-03-29 16:13:20 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = ''
|
|
|
|
Provides library functionality for FIDO 2.0, including communication with a device over USB.
|
|
|
|
'';
|
|
|
|
homepage = https://github.com/Yubico/libfido2;
|
|
|
|
license = licenses.bsd2;
|
2020-03-03 13:01:09 +01:00
|
|
|
maintainers = with maintainers; [ dtzWill prusnak ];
|
2020-02-23 16:59:41 +01:00
|
|
|
platforms = platforms.unix;
|
2019-03-29 16:13:20 +01:00
|
|
|
};
|
|
|
|
}
|