Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
container: ['fedora:36', 'fedora:37']
container: ['fedora:36', 'fedora:37', 'fedora:38']
env:
MAKEFLAGS: -j3
steps:
Expand Down Expand Up @@ -105,14 +105,14 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
container: ['ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:22.10']
container: ['ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:22.10', 'ubuntu:23.04']
env:
DEBIAN_FRONTEND: noninteractive
DEBFULLNAME: github-actions
DEBEMAIL: github-actions@github.com
steps:
- name: Install dependencies
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts cdbs cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-distutils libboost-test-dev lintian
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts cdbs debhelper cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-distutils libboost-test-dev lintian
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion cmake
13 changes: 5 additions & 8 deletions src/crypto/Connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ Connect::Connect(const string &_url, const string &method, int timeout, const st
OPENSSL_free(_host);
OPENSSL_free(_port);
OPENSSL_free(_path);
size_t pos = url.find("://");
if(pos != string::npos) {
pos = url.find('/', pos + 3);
if(pos != string::npos)
if(size_t pos = url.find("://"); pos != string::npos) {
if(pos = url.find('/', pos + 3); pos != string::npos)
baseurl = url.substr(0, pos);
}

Expand Down Expand Up @@ -135,15 +133,14 @@ Connect::Connect(const string &_url, const string &method, int timeout, const st
X509 *x509 = X509_STORE_CTX_get0_cert(store);
auto *certs = (vector<X509Cert>*)data;
return any_of(certs->cbegin(), certs->cend(), [x509](const X509Cert &cert) {
return cert == x509;
return cert && cert == x509;
}) ? 1 : 0;
}, const_cast<vector<X509Cert>*>(&certs));
}
BIO *sbio = BIO_new_ssl(ssl.get(), 1);
if(!sbio)
THROW_NETWORKEXCEPTION("Failed to create ssl connection with host: '%s'", hostname.c_str())
SSL *ssl = nullptr;
if(BIO_get_ssl(sbio, &ssl) == 1 && ssl)
if(SSL *ssl {}; BIO_get_ssl(sbio, &ssl) == 1 && ssl)
{
SSL_set1_host(ssl, host.c_str());
SSL_set_tlsext_host_name(ssl, host.c_str());
Expand Down Expand Up @@ -343,7 +340,7 @@ void Connect::waitReadWrite(bool read) const
fd_set confds;
FD_ZERO(&confds);
FD_SET(fd, &confds);
struct timeval tv = { _timeout, 0 };
timeval tv { _timeout, 0 };
if(select(fd + 1, read ? &confds : nullptr, read ? nullptr : &confds, nullptr, &tv) == -1)
DEBUG("select failed");
}