summaryrefslogtreecommitdiff
path: root/sys-auth
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2022-03-31 01:45:12 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2022-03-31 01:45:12 +0000
commit2f554a26ad94de2e833320953fd517020fad1e00 (patch)
tree9a88be2ccef47c286a4ed1a7f4aadf4e0e351c68 /sys-auth
parent7680095b6d19fb85211c866c7ee4b9287aacd508 (diff)
downloadsrcux-2f554a26ad94de2e833320953fd517020fad1e00.tar.gz
srcux-2f554a26ad94de2e833320953fd517020fad1e00.tar.xz
srcux-2f554a26ad94de2e833320953fd517020fad1e00.zip
Adding metadata
Diffstat (limited to 'sys-auth')
-rw-r--r--sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var-2.patch10
-rw-r--r--sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var.patch10
-rw-r--r--sys-auth/yubico-piv-tool/files/yubico-openssl-compat.patch31
-rw-r--r--sys-auth/yubico-piv-tool/files/yubico-piv-tool.patch57
-rw-r--r--sys-auth/yubico-piv-tool/yubico-piv-tool-2.3.0-r1.ebuild61
5 files changed, 169 insertions, 0 deletions
diff --git a/sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var-2.patch b/sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var-2.patch
new file mode 100644
index 000000000000..e4d505080d7f
--- /dev/null
+++ b/sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var-2.patch
@@ -0,0 +1,10 @@
+--- a/ykcs11/tests/ykcs11_tests_util.c
++++ b/ykcs11/tests/ykcs11_tests_util.c
+@@ -281,7 +281,7 @@ void test_digest_func(CK_FUNCTION_LIST_PTR funcs, CK_SESSION_HANDLE session, CK_
+ CK_BYTE digest_update[128] = {0};
+ CK_ULONG digest_update_len;
+ CK_BYTE hdata[128] = {0};
+- CK_ULONG hdata_len;
++ CK_ULONG hdata_len = 0;
+
+ CK_MECHANISM mech = {mech_type, NULL, 0};
diff --git a/sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var.patch b/sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var.patch
new file mode 100644
index 000000000000..34ad5c2fbac3
--- /dev/null
+++ b/sys-auth/yubico-piv-tool/files/ykcs11-test-unassigned-var.patch
@@ -0,0 +1,10 @@
+--- yubico-piv-tool-2.3.0/ykcs11/tests/ykcs11_tests_util.c 2022-02-23 08:54:47.000000000 -0500
++++ yubico-piv-tool-2.3.0.patch/ykcs11/tests/ykcs11_tests_util.c 2022-03-08 13:37:03.828285732 -0500
+@@ -1039,6 +1039,7 @@
+
+ // External verification
+ if(evp != NULL) {
++ hdata_len = 0;
+ asrt(get_digest(mech_type, data, sizeof(data), hdata, &hdata_len), CKR_OK, "GET DIGEST");
+ ctx = EVP_PKEY_CTX_new(evp, NULL);
+ asrt(ctx != NULL, 1, "EVP_KEY_CTX_new");
diff --git a/sys-auth/yubico-piv-tool/files/yubico-openssl-compat.patch b/sys-auth/yubico-piv-tool/files/yubico-openssl-compat.patch
new file mode 100644
index 000000000000..4cd817d5160c
--- /dev/null
+++ b/sys-auth/yubico-piv-tool/files/yubico-openssl-compat.patch
@@ -0,0 +1,31 @@
+diff -urN yubico-piv-tool-yubico-piv-tool-2.3.0.orig/common/openssl-compat.c yubico-piv-tool-yubico-piv-tool-2.3.0/common/openssl-compat.c
+--- yubico-piv-tool-yubico-piv-tool-2.3.0.orig/common/openssl-compat.c 2022-03-31 00:01:41.006586972 +0200
++++ yubico-piv-tool-yubico-piv-tool-2.3.0/common/openssl-compat.c 2022-03-31 00:02:58.868585332 +0200
+@@ -16,15 +16,6 @@
+ #include <string.h>
+ #include <limits.h>
+
+-void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg,
+- ASN1_OCTET_STRING **pdigest)
+-{
+- if (palg)
+- *palg = sig->algor;
+- if (pdigest)
+- *pdigest = sig->digest;
+-}
+-
+ #if (LIBRESSL_VERSION_NUMBER < 0x2070000fL)
+
+ int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
+diff -urN yubico-piv-tool-yubico-piv-tool-2.3.0.orig/common/openssl-compat.h yubico-piv-tool-yubico-piv-tool-2.3.0/common/openssl-compat.h
+--- yubico-piv-tool-yubico-piv-tool-2.3.0.orig/common/openssl-compat.h 2022-03-31 00:01:41.006586972 +0200
++++ yubico-piv-tool-yubico-piv-tool-2.3.0/common/openssl-compat.h 2022-03-31 00:03:46.155584335 +0200
+@@ -29,8 +29,6 @@
+ void RSA_get0_crt_params(const RSA *r,
+ const BIGNUM **dmp1, const BIGNUM **dmq1,
+ const BIGNUM **iqmp);
+-void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg,
+- ASN1_OCTET_STRING **pdigest);
+ int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
+ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
+
diff --git a/sys-auth/yubico-piv-tool/files/yubico-piv-tool.patch b/sys-auth/yubico-piv-tool/files/yubico-piv-tool.patch
new file mode 100644
index 000000000000..4d1774828644
--- /dev/null
+++ b/sys-auth/yubico-piv-tool/files/yubico-piv-tool.patch
@@ -0,0 +1,57 @@
+diff -urN yubico-piv-tool-yubico-piv-tool-2.3.0.orig/tool/yubico-piv-tool.c yubico-piv-tool-yubico-piv-tool-2.3.0/tool/yubico-piv-tool.c
+--- yubico-piv-tool-yubico-piv-tool-2.3.0.orig/tool/yubico-piv-tool.c 2022-03-30 23:28:23.673629049 +0200
++++ yubico-piv-tool-yubico-piv-tool-2.3.0/tool/yubico-piv-tool.c 2022-03-30 23:33:40.999622364 +0200
+@@ -133,7 +133,7 @@
+ return false;
+ }
+
+-#if !((OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER))
++#if !(OPENSSL_VERSION_NUMBER < 0x10100000L)
+ static int ec_key_ex_data_idx = -1;
+
+ struct internal_key {
+@@ -748,7 +748,7 @@
+ int key = 0;
+ size_t oid_len;
+ const unsigned char *oid;
+-#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+ unsigned char digest[EVP_MAX_MD_SIZE + MAX_OID_LEN] = {0};
+ unsigned int md_len;
+ unsigned int digest_len;
+@@ -858,7 +858,7 @@
+ goto request_out;
+ }
+
+-#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+ null_parameter.type = V_ASN1_NULL;
+ null_parameter.value.ptr = NULL;
+
+@@ -933,7 +933,7 @@
+ fclose(output_file);
+ }
+ EVP_PKEY_free(public_key);
+-#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+ if(req) {
+ if(req->sig_alg->parameter) {
+ req->sig_alg->parameter = NULL;
+@@ -1159,7 +1159,7 @@
+ }
+ }
+
+-#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+ unsigned char digest[EVP_MAX_MD_SIZE + MAX_OID_LEN] = {0};
+ unsigned char *signinput;
+ size_t len = 0;
+@@ -1237,7 +1237,7 @@
+ if(output_file && output_file != stdout) {
+ fclose(output_file);
+ }
+- #if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
++ #if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+ if(x509) {
+ if(x509->sig_alg->parameter) {
+ x509->sig_alg->parameter = NULL;
diff --git a/sys-auth/yubico-piv-tool/yubico-piv-tool-2.3.0-r1.ebuild b/sys-auth/yubico-piv-tool/yubico-piv-tool-2.3.0-r1.ebuild
new file mode 100644
index 000000000000..91b60bd99204
--- /dev/null
+++ b/sys-auth/yubico-piv-tool/yubico-piv-tool-2.3.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2021-2022 Liguros Authors
+# Distributed under the terms of the GNU General Public License v2
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Command-line tool and p11-kit module for the YubiKey PIV application"
+HOMEPAGE="https://developers.yubico.com/yubico-piv-tool/ https://github.com/Yubico/yubico-piv-tool"
+SRC_URI="https://github.com/Yubico/${PN}/archive/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/2"
+KEYWORDS="amd64"
+IUSE="libressl test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-apps/pcsc-lite
+ !libressl? ( dev-libs/openssl:0=[-bindist] )
+ libressl? ( >=dev-libs/libressl-3.5.0:0= )
+ "
+DEPEND="
+ ${RDEPEND}
+ test? ( dev-libs/check )"
+BDEPEND="
+ dev-util/gengetopt
+ sys-apps/help2man
+ virtual/pkgconfig"
+
+PATCHES=(
+ ${FILESDIR}/yubico-piv-tool.patch
+ ${FILESDIR}/yubico-openssl-compat.patch
+ ${FILESDIR}/ykcs11-test-unassigned-var.patch
+ ${FILESDIR}/ykcs11-test-unassigned-var-2.patch
+)
+
+S="${WORKDIR}/${PN}-${P}"
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+src_configure() {
+ # As of 2.2.0, man pages end up in /usr/usr/... without the MANDIR override
+ local mycmakeargs=(
+ -DBUILD_STATIC_LIB=OFF
+ -DBUILD_TESTING=$(usex test)
+ -DCMAKE_INSTALL_MANDIR="share/man"
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+
+ echo "module: ${EPREFIX}/usr/$(get_libdir)/libykcs11.so" > ${PN}.module \
+ || die "Failed to generate p11-kit module configuration"
+ insinto /usr/share/p11-kit/modules
+ doins ${PN}.module
+}