Skip to content

Commit

Permalink
Merge branch 'main' into coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Jan 12, 2024
2 parents 78ed46a + ba844d9 commit 2423b5f
Show file tree
Hide file tree
Showing 19 changed files with 543 additions and 102 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/run-on-arch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on: [push, pull_request]

jobs:
build_job:
# The host should always be linux
runs-on: ubuntu-20.04
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}

strategy:
matrix:
include:
- arch: aarch64
distro: bullseye

steps:
- uses: actions/checkout@v4

- uses: uraimo/run-on-arch-action@v2
name: Build artifact
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}

# Not required, but speeds up builds
githubToken: ${{ github.token }}

install: |
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster|bullseye)
apt-get update -q -y
apt-get install -q -y cmake gcc g++ libssl-dev ninja-build
;;
esac
run: |
cmake -G Ninja -B build -DCMAKE_C_FLAGS="-Werror"
cmake --build build -j --target retest
./build/test/retest -r -v
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ if(LIBRE_BUILD_STATIC)

if(MSVC)
set_target_properties(re PROPERTIES OUTPUT_NAME "re-static")
if(NOT LIBRE_BUILD_SHARED)
set(PC_LIBNAME "re-static")
endif()
endif()
endif()

Expand All @@ -668,6 +671,28 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory(packaging)
endif()

if(NOT PC_LIBNAME)
set(PC_LIBNAME "re")
endif()
set(PC_REQUIRES "")
set(PC_LINKLIBS "")
foreach(item IN LISTS RE_LIBS)
if(item STREQUAL "Threads::Threads")
list(APPEND PC_LINKLIBS ${CMAKE_THREADS_LIBS_INIT})
elseif(item STREQUAL "OpenSSL::Crypto")
list(APPEND PC_REQUIRES "libcrypto")
elseif(item STREQUAL "OpenSSL::SSL")
list(APPEND PC_REQUIRES "libssl")
elseif(item STREQUAL "ZLIB::ZLIB")
list(APPEND PC_REQUIRES "zlib")
elseif(item MATCHES "^-|/")
list(APPEND PC_LINKLIBS "${item}")
else()
list(APPEND PC_LINKLIBS "-l${item}")
endif()
endforeach()
list(JOIN PC_LINKLIBS " " PC_LINKLIBS)
list(JOIN PC_REQUIRES " " PC_REQUIRES)
configure_file(packaging/libre.pc.in libre.pc @ONLY)


Expand Down
10 changes: 9 additions & 1 deletion include/re_httpauth.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ struct httpauth_digest_resp {
struct pl cnonce;
struct pl qop;

struct pl algorithm;
struct pl charset;
struct pl userhash;
void (*hashh)(const uint8_t *, size_t, uint8_t *);
size_t hash_length;

struct mbuf *mb;
};

Expand Down Expand Up @@ -117,6 +123,9 @@ int httpauth_digest_response_full(struct httpauth_digest_enc_resp **presp,
const struct httpauth_digest_chall *chall, const struct pl *method,
const char *uri, const char *user, const char *passwd, const char *qop,
const char *entitybody, const char *charset, const bool userhash);
int httpauth_digest_verify(struct httpauth_digest_chall_req *req,
const struct pl *hval, const struct pl *method, const char *etag,
const char *user, const char *passwd, const char *entitybody);

int httpauth_digest_chall_req_print(struct re_printf *pf,
const struct httpauth_digest_chall_req *req);
Expand All @@ -127,7 +136,6 @@ int httpauth_digest_chall_request_full(struct httpauth_digest_chall_req **preq,
const char *opaque, const bool stale, const char *algo,
const char *qop, const char *charset, const bool userhash);


struct httpauth_basic *httpauth_basic_alloc(void);
int httpauth_basic_decode(struct httpauth_basic *basic,
const struct pl *hval);
Expand Down
4 changes: 3 additions & 1 deletion include/re_tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


#include "re_thread.h"
#include "re_atomic.h"

/**
* Defines the timeout handler
Expand All @@ -19,7 +20,8 @@ struct tmrl;
/** Defines a timer */
struct tmr {
struct le le; /**< Linked list element */
mtx_t *lock; /**< Mutex lock */
RE_ATOMIC bool active; /**< Timer is active */
mtx_t *llock; /**< List Mutex lock */
tmr_h *th; /**< Timeout handler */
void *arg; /**< Handler argument */
uint64_t jfs; /**< Jiffies for timeout */
Expand Down
5 changes: 3 additions & 2 deletions packaging/libre.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name: libre
Description: @CMAKE_PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Libs: -L${libdir} -lre
Libs.private: -L${libdir} -lre -ldl -lssl -lcrypto -lz -lpthread
Libs: -L${libdir} -l@PC_LIBNAME@
Libs.private: @PC_LINKLIBS@
Requires.private: @PC_REQUIRES@
Cflags: -I${includedir}
Loading

0 comments on commit 2423b5f

Please sign in to comment.