summaryrefslogtreecommitdiff
path: root/app-crypt/yubihsm-shell/yubihsm-shell-2.6.0.ebuild
blob: 2b4f7c8da6d500993bc4dc92816c4df43c1d75b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright 2023-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

DESCRIPTION="Components used to interact with the YubiHSM 2"
HOMEPAGE="https://developers.yubico.com/yubihsm-shell/"
SRC_URI="https://developers.yubico.com/${PN}/Releases/${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="
	dev-libs/openssl:=
	net-misc/curl
	dev-libs/libedit
	sys-apps/pcsc-lite
	virtual/libusb:1
"
RDEPEND="${DEPEND}"
BDEPEND="
	dev-util/gengetopt
	sys-apps/help2man
	virtual/pkgconfig
"

PATCHES=(
	"${FILESDIR}"/${PN}-2.6.0-pcsc-lite-pkgconfig.patch
	"${FILESDIR}"/${PN}-2.6.0-remove-hardcoded-compiler-opts.patch
	"${FILESDIR}"/${PN}-2.6.0-fix-examples-link.patch
)

src_configure() {
	local mycmakeargs=(
		# Allow users to set this, don't force it.
		-DDISABLE_LTO=ON
	)

	cmake_src_configure
}

src_test() {
	# TODO: hook up more tests. Requires unpackaged dependencies and hosting a connector.
	# See https://github.com/Yubico/yubihsm-shell/issues/381 and the github workflow.
	local CMAKE_SKIP_TESTS=(
		# main: Assertion `yrc == YHR_SUCCESS' failed.
		attest
		generate_ec
		generate_hmac
		import_authkey
		import_rsa
		info
		wrap
		wrap_data
		yubico_otp
		echo
		asym_auth
		import_ec
		generate_rsa
		logs
		ssh
		decrypt_rsa
		decrypt_ec
		import_ed
		change_authkey
		encrypt_aes
		# Unpackaged
		# https://github.com/YubicoLabs/pkcs11test
		# line 42: pkcs11test: command not found
		pkcs11test
		# open_session: Assertion `rv == CKR_OK' failed.
		aes_encrypt_test
		ecdh_derive_test
		ecdh_sp800_test
		rsa_enc_test
		pss_sign_test
		asym_wrap_test
		# Requires unpackaged ghostunnel to host connector locally
		# Failed connecting 'http://localhost:12345': Unable to find a suitable connector
		bash_tests
		wrapped_tests
	)
	cmake_src_test
}