diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-08-18 09:52:55 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-08-18 09:54:47 -0700 |
commit | e34c58ed66886ee2c964aa21aee2268d87c65699 (patch) | |
tree | c5c03da24237614b27e270643cc814ea212eee0e | |
parent | 4bacc11b3a103435f480e3a63e8e06e98d650bc1 (diff) | |
download | meta-openembedded-e34c58ed66886ee2c964aa21aee2268d87c65699.tar.gz |
librelp: Add packageconfigs for TLS implementations
valgrind is not available on all arches e.g. riscv so enable it
conditionally
Enable openSSL TLS by default and add option to enable gnuTLS
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch | 88 | ||||
-rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb | 14 |
2 files changed, 100 insertions, 2 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch new file mode 100644 index 0000000000..3ce5926333 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch | |||
@@ -0,0 +1,88 @@ | |||
1 | From 6e9b27f04132287463c89d3be0ce4f506944920d Mon Sep 17 00:00:00 2001 | ||
2 | From: Patrick Williams <patrick@stwcx.xyz> | ||
3 | Date: Fri, 3 Feb 2023 16:11:29 -0600 | ||
4 | Subject: [PATCH] tcp: fix some compiler warnings with enable-tls-openssl | ||
5 | |||
6 | When --enable-tls=no and --enable-tls-openssl=yes, the following | ||
7 | compiler errors are reported: | ||
8 | |||
9 | ``` | ||
10 | | ../../git/src/tcp.c:3765:1: error: no previous declaration for 'relpTcpGetRtryDirection_gtls' [-Werror=missing-declarations] | ||
11 | | 3765 | relpTcpGetRtryDirection_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis) | ||
12 | | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
13 | | ../../git/src/tcp.c:3583:1: error: 'relpTcpChkPeerName' defined but not used [-Werror=unused-function] | ||
14 | | 3583 | relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert) | ||
15 | | | ^~~~~~~~~~~~~~~~~~ | ||
16 | ``` | ||
17 | |||
18 | Fix these by: | ||
19 | 1. Add static on the openssl path for relpTcpGetRtryDirection_gtls. | ||
20 | 2. Move the relpTcpChkPeerName forward declaration to another ifdef | ||
21 | leg. | ||
22 | 3. Wrap relpTcpChkPeerName in gnutls-based ifdef. | ||
23 | 4. Remove relpTcpChkPeerName_gtls from openssl path. | ||
24 | |||
25 | Upstream-Status: Backport [https://github.com/rsyslog/librelp/pull/255] | ||
26 | Signed-off-by: Patrick Williams <patrick@stwcx.xyz> | ||
27 | --- | ||
28 | src/tcp.c | 11 ++++------- | ||
29 | 1 file changed, 4 insertions(+), 7 deletions(-) | ||
30 | |||
31 | diff --git a/src/tcp.c b/src/tcp.c | ||
32 | index 7a75cc4..18cffda 100644 | ||
33 | --- a/src/tcp.c | ||
34 | +++ b/src/tcp.c | ||
35 | @@ -132,12 +132,12 @@ callOnErr(const relpTcp_t *__restrict__ const pThis, | ||
36 | static int LIBRELP_ATTR_NONNULL() relpTcpGetCN(char *const namebuf, const size_t lenNamebuf, const char *const szDN); | ||
37 | #ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION | ||
38 | static int relpTcpVerifyCertificateCallback(gnutls_session_t session); | ||
39 | +static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert); | ||
40 | #endif /* #ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION */ | ||
41 | #if defined(HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION) || defined(ENABLE_TLS_OPENSSL) | ||
42 | static void relpTcpChkOnePeerName(relpTcp_t *const pThis, char *peername, int *pbFoundPositiveMatch); | ||
43 | static int relpTcpAddToCertNamesBuffer(relpTcp_t *const pThis, char *const buf, | ||
44 | const size_t buflen, int *p_currIdx, const char *const certName); | ||
45 | -static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert); | ||
46 | #endif /* defined(HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION) || defined(ENABLE_TLS_OPENSSL) */ | ||
47 | |||
48 | |||
49 | @@ -2820,11 +2820,6 @@ relpTcpLstnInitTLS_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis) | ||
50 | { | ||
51 | return RELP_RET_ERR_INTERNAL; | ||
52 | } | ||
53 | -static int | ||
54 | -relpTcpChkPeerName_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis, LIBRELP_ATTR_UNUSED void *vcert) | ||
55 | -{ | ||
56 | - return RELP_RET_ERR_INTERNAL; | ||
57 | -} | ||
58 | #endif /* defined(ENABLE_TLS)*/ | ||
59 | |||
60 | |||
61 | @@ -3579,6 +3574,7 @@ finalize_it: | ||
62 | |||
63 | } | ||
64 | |||
65 | +#ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION | ||
66 | static int | ||
67 | relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert) | ||
68 | { | ||
69 | @@ -3592,6 +3588,7 @@ relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert) | ||
70 | #endif /* #ifdef WITH_TLS*/ | ||
71 | LEAVE_RELPFUNC; | ||
72 | } | ||
73 | +#endif | ||
74 | |||
75 | static relpRetVal LIBRELP_ATTR_NONNULL() | ||
76 | relpTcpAcceptConnReqInitTLS(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED relpSrv_t *const pSrv) | ||
77 | @@ -3761,7 +3758,7 @@ relpTcpGetRtryDirection_gtls(relpTcp_t *const pThis) | ||
78 | return gnutls_record_get_direction(pThis->session); | ||
79 | } | ||
80 | #else /* #ifdef ENABLE_TLS */ | ||
81 | -relpRetVal LIBRELP_ATTR_NONNULL() | ||
82 | +static relpRetVal LIBRELP_ATTR_NONNULL() | ||
83 | relpTcpGetRtryDirection_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis) | ||
84 | { | ||
85 | return RELP_RET_ERR_INTERNAL; | ||
86 | -- | ||
87 | 2.41.0 | ||
88 | |||
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb index eebfece3f2..c64eaf2c48 100644 --- a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb +++ b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb | |||
@@ -4,11 +4,12 @@ HOMEPAGE = "https://github.com/rsyslog/librelp" | |||
4 | LICENSE = "GPL-3.0-only" | 4 | LICENSE = "GPL-3.0-only" |
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9" |
6 | 6 | ||
7 | DEPENDS = "gmp nettle libidn zlib gnutls openssl" | 7 | DEPENDS = "gmp libidn zlib" |
8 | 8 | ||
9 | SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \ | 9 | SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \ |
10 | file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \ | 10 | file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \ |
11 | file://0001-tests-Fix-callback-prototype.patch \ | 11 | file://0001-tests-Fix-callback-prototype.patch \ |
12 | file://0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch \ | ||
12 | file://run-ptest \ | 13 | file://run-ptest \ |
13 | " | 14 | " |
14 | 15 | ||
@@ -18,6 +19,15 @@ S = "${WORKDIR}/git" | |||
18 | 19 | ||
19 | inherit autotools pkgconfig ptest | 20 | inherit autotools pkgconfig ptest |
20 | 21 | ||
22 | PACKAGECONFIG ?= "tls-openssl valgrind" | ||
23 | # Valgrind is not available for RISCV yet | ||
24 | PACKAGECONFIG:remove:riscv64 = "valgrind" | ||
25 | PACKAGECONFIG:remove:riscv32 = "valgrind" | ||
26 | |||
27 | PACKAGECONFIG[tls] = "--enable-tls,--disable-tls,gnutls nettle" | ||
28 | PACKAGECONFIG[tls-openssl] = "--enable-tls-openssl,--disable-tls-openssl,openssl" | ||
29 | PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind," | ||
30 | |||
21 | # For ptests, copy source tests/*.sh scripts, Makefile and | 31 | # For ptests, copy source tests/*.sh scripts, Makefile and |
22 | # executables and run them with make on target. | 32 | # executables and run them with make on target. |
23 | TESTDIR = "tests" | 33 | TESTDIR = "tests" |
@@ -71,5 +81,5 @@ RDEPENDS:${PN}-ptest += "\ | |||
71 | make bash coreutils libgcc util-linux gawk grep \ | 81 | make bash coreutils libgcc util-linux gawk grep \ |
72 | python3-core python3-io \ | 82 | python3-core python3-io \ |
73 | " | 83 | " |
84 | RRECOMMENDS:${PN}-ptest += "${@bb.utils.filter('PACKAGECONFIG', 'valgrind', d)}" | ||
74 | 85 | ||
75 | RRECOMMENDS:${PN}-ptest += " valgrind" | ||