From 6bb3ebf29273db8552bab54b4d424bc8a12700a0 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Tue, 8 Aug 2023 07:19:04 +0200 Subject: [PATCH] CI: get rid of travis-ci coverity wrapper --- .github/workflows/coverity.yml | 33 +++++++++++++++++++++++---------- src/Mayaqua/Network.c | 8 ++++++++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index a35745cba6..513f3df550 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -5,16 +5,13 @@ on: schedule: - cron: "0 0 * * *" +permissions: + contents: read + jobs: scan: runs-on: ubuntu-latest if: ${{ github.repository_owner == 'SoftEtherVPN' }} - env: - COVERITY_SCAN_PROJECT_NAME: 'SoftEtherVPN/SoftEtherVPN' - COVERITY_SCAN_BRANCH_PATTERN: '*' - COVERITY_SCAN_NOTIFICATION_EMAIL: 'chipitsine@gmail.com' - COVERITY_SCAN_BUILD_COMMAND_PREPEND: "./configure" - COVERITY_SCAN_BUILD_COMMAND: "make -C build" steps: - uses: actions/checkout@v2 with: @@ -23,8 +20,24 @@ jobs: run: | sudo apt-get update sudo apt-get install -y cmake gcc g++ libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev libsodium-dev - - name: Run Coverity Scan - env: - COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + - name: Download Coverity build tool + run: | + wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=SoftEtherVPN%2FSoftEtherVPN" -O coverity_tool.tar.gz + mkdir coverity_tool + tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool + - name: Configure + run: | + ./configure + - name: Build with Coverity build tool + run: | + export PATH=`pwd`/coverity_tool/bin:$PATH + cov-build --dir cov-int make -C build + - name: Submit build result to Coverity Scan run: | - curl -fsSL "https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh" | bash || true + tar czvf cov.tar.gz cov-int + curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \ + --form email=chipitsine@gmail.com \ + --form file=@cov.tar.gz \ + --form version="Commit $GITHUB_SHA" \ + --form description="Build submitted via CI" \ + https://scan.coverity.com/builds?project=SoftEtherVPN%2FSoftEtherVPN diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index d478bfd91e..de0b053e2d 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -5724,6 +5724,10 @@ SSL_PIPE *NewSslPipeEx3(bool server_mode, X *x, K *k, LIST *chain, DH_CTX *dh, b SSL_PIPE *s; SSL *ssl; SSL_CTX *ssl_ctx = NewSSLCtx(server_mode); + if (ssl_ctx == NULL) + { + return NULL; + } Lock(openssl_lock); { @@ -11727,6 +11731,10 @@ bool StartSSLEx3(SOCK *sock, X *x, K *priv, LIST *chain, UINT ssl_timeout, char } ssl_ctx = NewSSLCtx(sock->ServerMode); + if (ssl_ctx == NULL) + { + return false; + } Lock(openssl_lock); {