- Initial package

- Upstream contributions by:
    - Chuck Lever <chuck.lever@oracle.com>
    - Hannes Reinecke <hare@suse.de>
    - Jeff Layton <jlayton@kernel.org>
    - Benjamin Coddington <bcodding@redhat.com>
    - David Härdeman <david@hardeman.nu>
    - Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
    - Moritz "WanzenBug" Wanzenböck <moritz.wanzenboeck@linbit.com>

Signed-off-by: Steve Dickson <steved@redhat.com>
Resolves: RHEL-16641
This commit is contained in:
Steve Dickson 2024-03-01 07:31:26 -05:00
parent de4e8c3af6
commit b0a7f6a358
6 changed files with 134 additions and 0 deletions

4
.gitignore vendored
View File

@ -0,0 +1,4 @@
/ktls-utils-0.10.tar.gz
ktls-utils-0.10/
x86_64
Makefile

View File

@ -0,0 +1,42 @@
From 52ac9ff05a5edb5ccda33ee186ba388553b258c4 Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@kernel.org>
Date: Tue, 20 Jun 2023 13:20:14 -0400
Subject: [PATCH] tlshd: fix max config file size comparison
gcc throws a warning on 32-bit x86 because of signedness mismatch:
config.c:155:52: error: comparison of integer expressions of different signedness: '__off_t' {aka 'long int'} and 'unsigned int' [-Werror=sign-compare]
155 | if (statbuf.st_size < 0 || statbuf.st_size > UINT_MAX) {
| ^
st_size is a signed value (off_t), but UINT_MAX is unsigned.
Change it to compare against INT_MAX instead. This technically cuts the
max size of the config file in half to only 2GB, but I don't think we'll
miss it.
Cc: Steve Dickson <steved@redhat.com>
Reported-by: Petr Pisar <ppisar@redhat.com>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2182151
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
src/tlshd/config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tlshd/config.c b/src/tlshd/config.c
index 87cc4018733b..bdab98b9fba4 100644
--- a/src/tlshd/config.c
+++ b/src/tlshd/config.c
@@ -152,7 +152,7 @@ static bool tlshd_config_read_datum(const char *pathname, gnutls_datum_t *data,
tlshd_log_perror("stat");
goto out_close;
}
- if (statbuf.st_size < 0 || statbuf.st_size > UINT_MAX) {
+ if (statbuf.st_size < 0 || statbuf.st_size > INT_MAX) {
tlshd_log_error("Bad config file size: %lld", statbuf.st_size);
goto out_close;
}
--
2.41.0

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# ktls-utils
The ktls-utils package

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

78
ktls-utils.spec Normal file
View File

@ -0,0 +1,78 @@
%global forgeurl https://github.com/oracle/ktls-utils
%global baseversion 0.10
Name: ktls-utils
Version: %{baseversion}
Release: 0%{?dist}
Summary: TLS handshake agent for kernel sockets
%forgemeta
License: GPL-2.0-only AND (GPL-2.0-only OR BSD-3-Clause)
URL: %{forgeurl}
# FIXME: is this a bug in the tagging scheme or forgesource macro?
Source0: %{forgeurl}/releases/download/%{name}-%{baseversion}/%{name}-%{baseversion}.tar.gz
BuildRequires: bash systemd-rpm-macros
BuildRequires: gcc make coreutils
BuildRequires: pkgconfig(gnutls) >= 3.3.0
BuildRequires: autoconf >= 2.69
BuildRequires: automake
BuildRequires: pkgconfig(libkeyutils)
BuildRequires: pkgconfig(glib-2.0) >= 2.6
BuildRequires: pkgconfig(libnl-3.0) >= 3.1
%description
In-kernel TLS consumers need a mechanism to perform TLS handshakes
on a connected socket to negotiate TLS session parameters that can
then be programmed into the kernel's TLS record protocol engine.
This package of software provides a TLS handshake user agent that
listens for kernel requests and then materializes a user space
socket endpoint on which to perform these handshakes. The resulting
negotiated session parameters are passed back to the kernel via
standard kTLS socket options.
%prep
%setup -q -n %{name}-%{baseversion}
%autopatch -p1
%build
./autogen.sh
%configure --with-systemd
%make_build
%install
%make_install
%files
%config(noreplace) %{_sysconfdir}/tlshd.conf
%{_sbindir}/tlshd
%{_mandir}/man5/tlshd.conf.5.gz
%{_mandir}/man8/tlshd.8.gz
%{_unitdir}/tlshd.service
%license COPYING
%doc README.md
%doc SECURITY.md
%post
%systemd_post tlshd.service
%preun
%systemd_preun tlshd.service
%postun
%systemd_postun_with_restart tlshd.service
%changelog
* Thu Feb 29 2024 Steve Dickson <steved@redhat.com> 0.10-0
- Initial package
- Upstream contributions by:
- Chuck Lever <chuck.lever@oracle.com>
- Hannes Reinecke <hare@suse.de>
- Jeff Layton <jlayton@kernel.org>
- Benjamin Coddington <bcodding@redhat.com>
- David Härdeman <david@hardeman.nu>
- Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
- Moritz "WanzenBug" Wanzenböck <moritz.wanzenboeck@linbit.com>

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (ktls-utils-0.10.tar.gz) = cb2ef7fe93b0a9d982c082ff308aad29a4900106911f7f8bce15a876efdaadd7f031b4563373c24927e11abc33e6bfcb56be8675b1c51a2e3763e2a5c6796367