summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-cpp/scitokens-cpp')
-rw-r--r--dev-cpp/scitokens-cpp/Manifest2
-rw-r--r--dev-cpp/scitokens-cpp/files/scitokens-cpp-1.1.0-invalid-vector-access.patch24
-rw-r--r--dev-cpp/scitokens-cpp/metadata.xml26
-rw-r--r--dev-cpp/scitokens-cpp/scitokens-cpp-1.1.0-r1.ebuild61
-rw-r--r--dev-cpp/scitokens-cpp/scitokens-cpp-1.1.1.ebuild57
5 files changed, 170 insertions, 0 deletions
diff --git a/dev-cpp/scitokens-cpp/Manifest b/dev-cpp/scitokens-cpp/Manifest
new file mode 100644
index 000000000000..42d724366ed9
--- /dev/null
+++ b/dev-cpp/scitokens-cpp/Manifest
@@ -0,0 +1,2 @@
+DIST scitokens-cpp-1.1.0.tar.gz 311446 BLAKE2B a515d834df04125ae9167cb4656def7df43c9f1ba6d701379257cdd0fd51b61a119e6222591fbe9c1d7ac7000b1b4590d12e9f9238810c0791397a9d9846f6f7 SHA512 e71474afbde45149fbd642918e802f7430603a14add7171525fd08fdfbfb9dc4ae5b151341d2c11b294f352cdf76315e5c1f089daca12a1c9db304f6b2c89276
+DIST scitokens-cpp-1.1.1.tar.gz 311677 BLAKE2B ea880a50b5e3e6f17c4bb11b7021df5e22cb4bb496fc17395a9886ebd359bc7f2522a0b1dd89e8aaa477a1302613f5da6d0a40f903e056736abc35ca1230518e SHA512 f5b42078fce6c1e812eedb456cf1275eaddfae5715193fd566f1f7a598b5632f81f3893efb220c57ff89d233c375c68785c8a6a1c3d3db6d3757979d87916265
diff --git a/dev-cpp/scitokens-cpp/files/scitokens-cpp-1.1.0-invalid-vector-access.patch b/dev-cpp/scitokens-cpp/files/scitokens-cpp-1.1.0-invalid-vector-access.patch
new file mode 100644
index 000000000000..db524b4245d5
--- /dev/null
+++ b/dev-cpp/scitokens-cpp/files/scitokens-cpp-1.1.0-invalid-vector-access.patch
@@ -0,0 +1,24 @@
+Fix invalid std::vector access (visible with tests on hardened systems)
+
+From: Mattias Ellert <mattias.ellert@physics.uu.se>
+Bug: https://github.com/scitokens/scitokens-cpp/pull/126
+Bug: https://bugs.gentoo.org/922679
+
+---
+ src/scitokens_internal.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/src/scitokens_internal.cpp
++++ b/src/scitokens_internal.cpp
+@@ -978,9 +978,9 @@ bool scitokens::Validator::store_public_ec_key(const std::string &issuer,
+ auto x_num = BN_num_bytes(x_bignum.get());
+ auto y_num = BN_num_bytes(y_bignum.get());
+ std::vector<unsigned char> x_bin;
+- x_bin.reserve(x_num);
++ x_bin.resize(x_num);
+ std::vector<unsigned char> y_bin;
+- y_bin.reserve(y_num);
++ y_bin.resize(y_num);
+ BN_bn2bin(x_bignum.get(), &x_bin[0]);
+ BN_bn2bin(y_bignum.get(), &y_bin[0]);
+ std::string x_str(reinterpret_cast<char *>(&x_bin[0]), x_num);
diff --git a/dev-cpp/scitokens-cpp/metadata.xml b/dev-cpp/scitokens-cpp/metadata.xml
new file mode 100644
index 000000000000..ec035d6ed7af
--- /dev/null
+++ b/dev-cpp/scitokens-cpp/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>o.freyermuth@googlemail.com</email>
+ <name>Oliver Freyermuth</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>amadio@gentoo.org</email>
+ <name>Guilherme Amadio</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ SciTokens provide a token format for distributed authorization. The tokens are
+ self-describing, can be verified in a distributed fashion (no need to contact
+ the issuer to determine if the token is valid). This is convenient for a
+ federated environment where several otherwise-independent storage endpoints
+ want to delegate trust for an issuer for managing a storage allocation.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">scitokens/scitokens-cpp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-cpp/scitokens-cpp/scitokens-cpp-1.1.0-r1.ebuild b/dev-cpp/scitokens-cpp/scitokens-cpp-1.1.0-r1.ebuild
new file mode 100644
index 000000000000..80259264e946
--- /dev/null
+++ b/dev-cpp/scitokens-cpp/scitokens-cpp-1.1.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/scitokens/scitokens-cpp"
+else
+ SRC_URI="https://github.com/scitokens/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 x86"
+fi
+
+DESCRIPTION="C++ implementation of the SciTokens library with a C library interface"
+HOMEPAGE="https://scitokens.org/"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="test"
+
+DEPEND="
+ <dev-cpp/jwt-cpp-0.7.0[picojson]
+ dev-db/sqlite
+ dev-libs/openssl:0=
+ net-misc/curl:0=
+ kernel_linux? ( sys-apps/util-linux )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ test? ( dev-cpp/gtest )
+"
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.0-invalid-vector-access.patch
+)
+
+src_prepare() {
+ # Unbundle dev-cpp/gtest, dev-cpp/jwt-cpp
+ rm -r vendor || die
+ # Fix include path for picojson.
+ find src/ \( -name '*.cpp' -o -name '*.h' \) -type f -print0 | \
+ xargs -0 sed -r -e "s:picojson/picojson\.h:picojson.h:g" -i || die
+ # Disable network-based tests relying on external services.
+ if use test; then
+ sed -i -e '/^TEST_F/s#RefreshTest#DISABLED_RefreshTest#' \
+ -e '/^TEST_F/s#RefreshExpiredTest#DISABLED_RefreshExpiredTest#' test/main.cpp || die
+ fi
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DSCITOKENS_BUILD_UNITTESTS="$(usex test)"
+ -DSCITOKENS_EXTERNAL_GTEST=YES
+ )
+ cmake_src_configure
+}
diff --git a/dev-cpp/scitokens-cpp/scitokens-cpp-1.1.1.ebuild b/dev-cpp/scitokens-cpp/scitokens-cpp-1.1.1.ebuild
new file mode 100644
index 000000000000..c12cad405a66
--- /dev/null
+++ b/dev-cpp/scitokens-cpp/scitokens-cpp-1.1.1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/scitokens/scitokens-cpp"
+else
+ SRC_URI="https://github.com/scitokens/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="C++ implementation of the SciTokens library with a C library interface"
+HOMEPAGE="https://scitokens.org/"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="test"
+
+DEPEND="
+ <dev-cpp/jwt-cpp-0.7.0[picojson]
+ dev-db/sqlite
+ dev-libs/openssl:0=
+ net-misc/curl:0=
+ kernel_linux? ( sys-apps/util-linux )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ test? ( dev-cpp/gtest )
+"
+RESTRICT="!test? ( test )"
+
+src_prepare() {
+ # Unbundle dev-cpp/gtest, dev-cpp/jwt-cpp
+ rm -r vendor || die
+ # Fix include path for picojson.
+ find src/ \( -name '*.cpp' -o -name '*.h' \) -type f -print0 | \
+ xargs -0 sed -r -e "s:picojson/picojson\.h:picojson.h:g" -i || die
+ # Disable network-based tests relying on external services.
+ if use test; then
+ sed -i -e '/^TEST_F/s#RefreshTest#DISABLED_RefreshTest#' \
+ -e '/^TEST_F/s#RefreshExpiredTest#DISABLED_RefreshExpiredTest#' test/main.cpp || die
+ fi
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DSCITOKENS_BUILD_UNITTESTS="$(usex test)"
+ -DSCITOKENS_EXTERNAL_GTEST=YES
+ )
+ cmake_src_configure
+}