Update to 1.3.10

Resolves: rhbz#2211498
This commit is contained in:
Tomas Korbar 2023-06-06 16:37:08 +02:00
parent dfb04a1871
commit 17b253741a
6 changed files with 11 additions and 239 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/serf-1.3.6.tar.bz2
/serf-1.3.7.tar.bz2
/serf-1.3.9.tar.bz2
/serf-1.3.10.tar.bz2

View File

@ -1,21 +0,0 @@
diff --git a/buckets/ssl_buckets.c b/buckets/ssl_buckets.c
index b01e5359db08..3c8b7e2a685f 100644
--- a/buckets/ssl_buckets.c
+++ b/buckets/ssl_buckets.c
@@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio)
static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr)
{
- long ret = 1;
+ long ret = 0;
switch (cmd) {
default:
@@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr)
break;
case BIO_CTRL_FLUSH:
/* At this point we can't force a flush. */
+ ret = 1;
break;
case BIO_CTRL_PUSH:
case BIO_CTRL_POP:

View File

@ -1,149 +0,0 @@
commit ac95824beca21a6f8c7b51b6f7afebf01fbb1b4c
Author: Tomas Korbar <tkorbar@redhat.com>
Date: Thu Feb 2 09:50:20 2023 +0100
Fix bio_apr_socket_ctrl in tests and fix test_ssl_handshake
diff --git a/test/server/test_sslserver.c b/test/server/test_sslserver.c
index 6c1a028..b9288e4 100644
--- a/test/server/test_sslserver.c
+++ b/test/server/test_sslserver.c
@@ -96,7 +96,7 @@ static int bio_apr_socket_destroy(BIO *bio)
static long bio_apr_socket_ctrl(BIO *bio, int cmd, long num, void *ptr)
{
- long ret = 1;
+ long ret = 0;
switch (cmd) {
default:
@@ -104,6 +104,7 @@ static long bio_apr_socket_ctrl(BIO *bio, int cmd, long num, void *ptr)
break;
case BIO_CTRL_FLUSH:
/* At this point we can't force a flush. */
+ ret = 1;
break;
case BIO_CTRL_PUSH:
case BIO_CTRL_POP:
diff --git a/test/test_context.c b/test/test_context.c
index 74e53b4..5e2bddf 100644
--- a/test/test_context.c
+++ b/test/test_context.c
@@ -1164,6 +1164,37 @@ ssl_server_cert_cb_reject(void *baton, int failures,
return SERF_ERROR_ISSUE_IN_TESTSUITE;
}
+/* Set up the ssl context with the CA and root CA certificates needed for
+ successful valiation of the server certificate. */
+static apr_status_t
+https_set_root_ca_conn_setup(apr_socket_t *skt,
+ serf_bucket_t **input_bkt,
+ serf_bucket_t **output_bkt,
+ void *setup_baton,
+ apr_pool_t *pool)
+{
+ serf_ssl_certificate_t *rootcacert;
+ test_baton_t *tb = setup_baton;
+ apr_status_t status;
+
+ status = default_https_conn_setup(skt, input_bkt, output_bkt,
+ setup_baton, pool);
+ if (status)
+ return status;
+
+ status = serf_ssl_load_cert_file(&rootcacert,
+ get_srcdir_file(pool,
+ "test/server/serfrootcacert.pem"),
+ pool);
+ if (status)
+ return status;
+ status = serf_ssl_trust_cert(tb->ssl_context, rootcacert);
+ if (status)
+ return status;
+
+ return status;
+}
+
/* Validate that we can connect successfully to an https server. This
certificate is not trusted, so a cert validation failure is expected. */
static void test_ssl_handshake(CuTest *tc)
@@ -1171,7 +1202,6 @@ static void test_ssl_handshake(CuTest *tc)
test_baton_t *tb;
handler_baton_t handler_ctx[1];
const int num_requests = sizeof(handler_ctx)/sizeof(handler_ctx[0]);
- int expected_failures;
apr_status_t status;
test_server_message_t message_list[] = {
{CHUNKED_REQUEST(1, "1")},
@@ -1180,9 +1210,6 @@ static void test_ssl_handshake(CuTest *tc)
test_server_action_t action_list[] = {
{SERVER_RESPOND, CHUNKED_EMPTY_RESPONSE},
};
- static const char *server_cert[] = { "test/server/serfservercert.pem",
- NULL };
-
/* Set up a test context with a server */
apr_pool_t *test_pool = tc->testBaton;
@@ -1190,57 +1217,20 @@ static void test_ssl_handshake(CuTest *tc)
status = test_https_server_setup(&tb,
message_list, num_requests,
action_list, num_requests, 0,
- NULL, /* default conn setup */
+ https_set_root_ca_conn_setup,
get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
- server_certs_srcdir(server_cert, test_pool),
+ server_certs_srcdir(server_certs, test_pool),
NULL, /* no client cert */
- ssl_server_cert_cb_expect_failures,
+ ssl_server_cert_cb_expect_allok,
test_pool);
CuAssertIntEquals(tc, APR_SUCCESS, status);
- /* This unknown failures is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE,
- meaning the chain has only the server cert. A good candidate for its
- own failure code. */
- expected_failures = SERF_SSL_CERT_UNKNOWNCA;
- tb->user_baton = &expected_failures;
-
create_new_request(tb, &handler_ctx[0], "GET", "/", 1);
test_helper_run_requests_expect_ok(tc, tb, num_requests, handler_ctx,
test_pool);
}
-/* Set up the ssl context with the CA and root CA certificates needed for
- successful valiation of the server certificate. */
-static apr_status_t
-https_set_root_ca_conn_setup(apr_socket_t *skt,
- serf_bucket_t **input_bkt,
- serf_bucket_t **output_bkt,
- void *setup_baton,
- apr_pool_t *pool)
-{
- serf_ssl_certificate_t *rootcacert;
- test_baton_t *tb = setup_baton;
- apr_status_t status;
-
- status = default_https_conn_setup(skt, input_bkt, output_bkt,
- setup_baton, pool);
- if (status)
- return status;
-
- status = serf_ssl_load_cert_file(&rootcacert,
- get_srcdir_file(pool,
- "test/server/serfrootcacert.pem"),
- pool);
- if (status)
- return status;
- status = serf_ssl_trust_cert(tb->ssl_context, rootcacert);
- if (status)
- return status;
-
- return status;
-}
-
/* Validate that server certificate validation is ok when we
explicitly trust our self-signed root ca. */
static void test_ssl_trust_rootca(CuTest *tc)

View File

@ -1,60 +0,0 @@
diff -up serf-1.3.9/SConstruct.python3 serf-1.3.9/SConstruct
--- serf-1.3.9/SConstruct.python3 2018-07-02 17:21:47.331685070 +0200
+++ serf-1.3.9/SConstruct 2018-07-02 17:27:12.316413515 +0200
@@ -20,6 +20,8 @@
# ====================================================================
#
+from __future__ import print_function
+
import sys
import os
import re
@@ -166,7 +168,7 @@ env.Append(BUILDERS = {
match = re.search('SERF_MAJOR_VERSION ([0-9]+).*'
'SERF_MINOR_VERSION ([0-9]+).*'
'SERF_PATCH_VERSION ([0-9]+)',
- env.File('serf.h').get_contents(),
+ env.File('serf.h').get_contents().decode('utf-8'),
re.DOTALL)
MAJOR, MINOR, PATCH = [int(x) for x in match.groups()]
env.Append(MAJOR=str(MAJOR))
@@ -183,7 +185,7 @@ CALLOUT_OKAY = not (env.GetOption('clean
unknown = opts.UnknownVariables()
if unknown:
- print 'Warning: Used unknown variables:', ', '.join(unknown.keys())
+ print('Warning: Used unknown variables:', ', '.join(unknown.keys()))
apr = str(env['APR'])
apu = str(env['APU'])
diff -uap serf-1.3.9/build/check.py.python3 serf-1.3.9/build/check.py
--- serf-1.3.9/build/check.py.python3 2015-09-17 13:46:24.000000000 +0100
+++ serf-1.3.9/build/check.py 2018-12-17 11:40:06.524901129 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
#
# check.py : Run all the test cases.
#
@@ -52,16 +52,16 @@ if __name__ == '__main__':
# Find test responses and run them one by one
for case in glob.glob(testdir + "/testcases/*.response"):
- print "== Testing %s ==" % (case)
+ print("== Testing %s ==" % (case))
try:
subprocess.check_call([SERF_RESPONSE_EXE, case])
except subprocess.CalledProcessError:
- print "ERROR: test case %s failed" % (case)
+ print("ERROR: test case %s failed" % (case))
sys.exit(1)
- print "== Running the unit tests =="
+ print("== Running the unit tests ==")
try:
subprocess.check_call(TEST_ALL_EXE)
except subprocess.CalledProcessError:
- print "ERROR: test(s) failed in test_all"
+ print("ERROR: test(s) failed in test_all")
sys.exit(1)

View File

@ -1,6 +1,6 @@
Name: libserf
Version: 1.3.9
Release: 28%{?dist}
Version: 1.3.10
Release: 1%{?dist}
Summary: High-Performance Asynchronous HTTP Client Library
License: Apache-2.0
URL: http://serf.apache.org/
@ -12,12 +12,9 @@ BuildRequires: zlib-devel, cmake
BuildRequires: openssl, libfaketime
%endif
Patch0: %{name}-norpath.patch
Patch1: %{name}-python3.patch
Patch2: %{name}-1.3.9-bio-ctrl.patch
Patch3: %{name}-1.3.9-errgetfunc.patch
Patch4: %{name}-1.3.9-multihome.patch
Patch5: %{name}-1.3.9-cmake.patch
Patch6: %{name}-1.3.9-testsuite.patch
Patch1: %{name}-1.3.9-errgetfunc.patch
Patch2: %{name}-1.3.9-multihome.patch
Patch3: %{name}-1.3.9-cmake.patch
%description
The serf library is a C-based HTTP client library built upon the Apache
@ -80,6 +77,10 @@ true
%{_libdir}/pkgconfig/serf*.pc
%changelog
* Tue Jun 06 2023 Tomas Korbar <tkorbar@redhat.com> - 1.3.10-1
- Update to 1.3.10
- Resolves: rhbz#2211498
* Sun Mar 12 2023 Tomas Korbar <tkorbar@redhat.com> - 1.3.9-28
- Change the License tag to the SPDX format

View File

@ -1 +1 @@
370a6340ff20366ab088012cd13f2b57 serf-1.3.9.tar.bz2
SHA512 (serf-1.3.10.tar.bz2) = 19165274d35c694935cda33f99ef92a7663a5d9c540fb7fd6792aa0efe39941b2fa87ff8b61afd060c6676baec634fd33dc2e9d34ecbee45ed99dfaed077802c