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 Nov 18, 2023
2 parents f2f8e31 + ebdf9d7 commit 28a9b9f
Show file tree
Hide file tree
Showing 30 changed files with 903 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/abi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: 'v3.5.0'
ref: 'v3.6.0'
path: old

- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: coverage check
run: |
min_cov="63.9"
min_cov="63.8"
cov=$(~/.local/bin/gcovr -r . -s | grep lines | awk '{ print $2 }' | sed 's/%//')
echo "Coverage: ${cov}% (min $min_cov%)"
exit $(echo "$cov < $min_cov" | bc -l)
1 change: 1 addition & 0 deletions .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
build:
runs-on: macos-12
timeout-minutes: 20

env:
CMAKE_GENERATOR: Ninja
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:

- name: build
run: |
cmake -B build -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON -DUSE_OPENSSL=OFF -DCMAKE_C_FLAGS="-DDARWIN -Werror"
cmake -B build -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON -DUSE_OPENSSL=OFF -DCMAKE_C_FLAGS="-Werror"
cmake --build build -- CODE_SIGNING_ALLOWED=NO
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,54 @@ All notable changes to libre will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [v3.6.2] - 2023-11-06

## What's Changed
sip/transp: add win32 local transport addr fallback (fixes TCP/TLS register)


## [v3.6.1] - 2023-11-03

## What's Changed
ice: AI_V4MAPPED doesn't exist on OpenBSD #989
dialog: REVERT fix rtags of forking INVITE with 100rel (#947) #986
debian: fix version number


## [v3.6.0] - 2023-10-17

## What's Changed
* ci/coverage: increase min. coverage by @sreimers in https://github.com/baresip/re/pull/958
* Implement aufile_set_position by @larsimmisch in https://github.com/baresip/re/pull/943
* dialog: fix rtags of forking INVITE with 100rel by @maximilianfridrich in https://github.com/baresip/re/pull/947
* tls/alloc: set default min proto TLS 1.2 by @sreimers in https://github.com/baresip/re/pull/948
* test: init err to 0 in sdp test (cppcheck) by @alfredh in https://github.com/baresip/re/pull/959
* main: fd_listen fhs alloc rewrite by @sreimers in https://github.com/baresip/re/pull/805
* Expand RE_BREAKPOINT macro on ARM64 by @larsimmisch in https://github.com/baresip/re/pull/961
* jbuf: trace data for plot by @cspiel1 in https://github.com/baresip/re/pull/964
* trace: use global trace log by @sreimers in https://github.com/baresip/re/pull/965
* main: use ifdef for RE_TRACE_ENABLED by @sreimers in https://github.com/baresip/re/pull/966
* test/hexdump: hide output by @sreimers in https://github.com/baresip/re/pull/968
* trace: remove global default trace json by @sreimers in https://github.com/baresip/re/pull/969
* ci/ssl: use tools repo and new assets by @sreimers in https://github.com/baresip/re/pull/972
* fmt: doxygen correction in print.c by @cspiel1 in https://github.com/baresip/re/pull/973
* trace: use only explicit RE_TRACE_ENABLED by cmake by @sreimers in https://github.com/baresip/re/pull/974
* cmake: enable C11 for Windows (not MINGW) by @alfredh in https://github.com/baresip/re/pull/970
* ci/coverage: lower min. coverage by @sreimers in https://github.com/baresip/re/pull/975
* jbuf: move jbuf to baresip by @cspiel1 in https://github.com/baresip/re/pull/971
* ci/coverage: improve coverage (enable trace) by @sreimers in https://github.com/baresip/re/pull/976
* ci: bump [email protected] by @sreimers in https://github.com/baresip/re/pull/977
* ice: mDNS refactoring by @sreimers in https://github.com/baresip/re/pull/934
* trace: add flush worker and optimize memory usage by @sreimers in https://github.com/baresip/re/pull/967
* rtp: fix video jitter calculation and add arrival time rtp header by @sreimers in https://github.com/baresip/re/pull/978
* ci: remove DARWIN compile flag from iOS build by @alfredh in https://github.com/baresip/re/pull/979
* thread: add trace thread name logging by @sreimers in https://github.com/baresip/re/pull/980
* ci/coverage: reduce min. coverage by @sreimers in https://github.com/baresip/re/pull/982


**Full Changelog**: https://github.com/baresip/re/compare/v3.5.1...v3.6.0

## [v3.5.1] - 2023-09-12

## What's Changed
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
cmake_minimum_required(VERSION 3.13)

project(re
VERSION 3.5.1
VERSION 3.6.2
LANGUAGES C
HOMEPAGE_URL https://github.com/baresip/re
DESCRIPTION "Generic library for real-time communications"
)

set(PROJECT_SOVERSION 17) # bump if ABI breaks
set(PROJECT_SOVERSION 18) # bump if ABI breaks

# Pre-release identifier, comment out on a release
# Increment for breaking changes (dev2, dev3...)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $ sudo ldconfig
### Examples

Coding examples are available from the
[redemo](http://creytiv.com/pub/redemo-0.5.0.tar.gz) project
[redemo](https://github.com/creytiv/redemo "creytiv/redemo: Demo example applications using libre") project.


## License
Expand Down Expand Up @@ -218,6 +218,7 @@ legend:
* [RFC 6455](https://tools.ietf.org/html/rfc6455) - The WebSocket Protocol
* [RFC 7159](https://tools.ietf.org/html/rfc7159) - JavaScript Object Notation (JSON)
* [RFC 7350](https://tools.ietf.org/html/rfc7350) - DTLS as Transport for STUN
* [RFC 7616](https://tools.ietf.org/html/rfc7616) - HTTP Digest Access Authentication
* [RFC 7714](https://tools.ietf.org/html/rfc7714) - AES-GCM Authenticated Encryption in SRTP


Expand Down
23 changes: 22 additions & 1 deletion cmake/re-config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include(CheckIncludeFile)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckTypeSize)

option(USE_MBEDTLS "Enable MbedTLS" OFF)

Expand Down Expand Up @@ -66,7 +67,11 @@ else()
set(Backtrace_LIBRARIES)
endif()

check_function_exists(thrd_create HAVE_THREADS)
check_function_exists(thrd_create HAVE_THREADS_FUN)
check_include_file(threads.h HAVE_THREADS_H)
if(HAVE_THREADS_FUN AND HAVE_THREADS_H)
set(HAVE_THREADS CACHE BOOL true)
endif()
if(HAVE_THREADS)
list(APPEND RE_DEFINITIONS HAVE_THREADS)
endif()
Expand Down Expand Up @@ -135,6 +140,20 @@ if(WIN32)
WIN32
_WIN32_WINNT=0x0600
)

unset(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h;qos2.h")
check_type_size("QOS_FLOWID" HAVE_QOS_FLOWID BUILTIN_TYPES_ONLY)
check_type_size("PQOS_FLOWID" HAVE_PQOS_FLOWID BUILTIN_TYPES_ONLY)
unset(CMAKE_EXTRA_INCLUDE_FILES)

if(HAVE_QOS_FLOWID)
list(APPEND RE_DEFINITIONS HAVE_QOS_FLOWID)
endif()

if(HAVE_PQOS_FLOWID)
list(APPEND RE_DEFINITIONS HAVE_PQOS_FLOWID)
endif()
endif()

if(USE_OPENSSL)
Expand Down Expand Up @@ -173,6 +192,8 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND RE_DEFINITIONS DARWIN)
include_directories(/opt/local/include)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS")
list(APPEND RE_DEFINITIONS DARWIN)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
list(APPEND RE_DEFINITIONS FREEBSD)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
libre (3.6.2) unstable; urgency=medium

* version 3.6.2

-- Sebastian Reimers <[email protected]> Mon, 6 Nov 2023 14:00:00 +0200

libre (3.6.1) unstable; urgency=medium

* version 3.6.1

-- Sebastian Reimers <[email protected]> Fri, 3 Nov 2023 14:00:00 +0200

libre (3.5.1) unstable; urgency=medium

* version 3.5.1
Expand Down
1 change: 1 addition & 0 deletions include/re_fmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct pl {

extern const struct pl pl_null;

struct pl *pl_alloc_str(const char *str);
void pl_set_str(struct pl *pl, const char *str);
void pl_set_mbuf(struct pl *pl, const struct mbuf *mb);
int32_t pl_i32(const struct pl *pl);
Expand Down
37 changes: 37 additions & 0 deletions include/re_httpauth.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ struct httpauth_digest_chall {
struct pl userhash;
};

struct httpauth_digest_enc_resp {
char *realm;
char *nonce;
char *opaque;
char *algorithm;
char *qop;

/* response specific */
char *response;
char *username;
char *username_star;
char *uri;
uint32_t cnonce;
uint32_t nc;

/* optional */
char *charset;
bool userhash;
void (*hashh)(const uint8_t *, size_t, uint8_t *);
size_t hash_length;
};

/** HTTP Digest response */
struct httpauth_digest_resp {
struct pl realm;
Expand Down Expand Up @@ -81,6 +103,21 @@ int httpauth_digest_response_encode(const struct httpauth_digest_resp *resp,
struct mbuf *mb);


int httpauth_digest_response_print(struct re_printf *pf,
const struct httpauth_digest_enc_resp *resp);
int httpauth_digest_response_set_cnonce(struct httpauth_digest_enc_resp *resp,
const struct httpauth_digest_chall *chall, const struct pl *method,
const char *user, const char *passwd, const char *entitybody,
const uint32_t cnonce, const uint32_t nc_);
int httpauth_digest_response(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);
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_chall_req_print(struct re_printf *pf,
const struct httpauth_digest_chall_req *req);
int httpauth_digest_chall_request(struct httpauth_digest_chall_req **preq,
Expand Down
1 change: 1 addition & 0 deletions include/re_sipsess.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ bool sipsess_refresh_allowed(const struct sipsess *sess);
void sipsess_close_all(struct sipsess_sock *sock);
struct sip_dialog *sipsess_dialog(const struct sipsess *sess);
void sipsess_abort(struct sipsess *sess);
bool sipsess_ack_pending(const struct sipsess *sess);
38 changes: 26 additions & 12 deletions include/re_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* JSON traces (chrome://tracing)
*/

struct pl;

typedef enum {
RE_TRACE_ARG_NONE,
RE_TRACE_ARG_INT,
Expand All @@ -14,37 +16,46 @@ typedef enum {
int re_trace_init(const char *json_file);
int re_trace_close(void);
int re_trace_flush(void);
void re_trace_event(const char *cat, const char *name, char ph, void *id,
int32_t async_id, re_trace_arg_type arg_type,
const char *arg_name, void *arg_value);
void re_trace_event(const char *cat, const char *name, char ph, struct pl *id,
re_trace_arg_type arg_type, const char *arg_name,
void *arg_value);

#ifdef RE_TRACE_ENABLED

#define RE_TRACE_BEGIN(c, n) \
re_trace_event(c, n, 'B', 0, 0, RE_TRACE_ARG_NONE, NULL, NULL)
re_trace_event(c, n, 'B', NULL, RE_TRACE_ARG_NONE, NULL, NULL)
#define RE_TRACE_END(c, n) \
re_trace_event(c, n, 'E', 0, 0, RE_TRACE_ARG_NONE, NULL, NULL)
re_trace_event(c, n, 'E', NULL, RE_TRACE_ARG_NONE, NULL, NULL)

#define RE_TRACE_ID_BEGIN(c, n, id) \
re_trace_event(c, n, 'B', 0, id, RE_TRACE_ARG_NONE, NULL, NULL)
re_trace_event(c, n, 'B', id, RE_TRACE_ARG_NONE, NULL, NULL)
#define RE_TRACE_ID_END(c, n, id) \
re_trace_event(c, n, 'E', 0, id, RE_TRACE_ARG_NONE, NULL, NULL)
re_trace_event(c, n, 'E', id, RE_TRACE_ARG_NONE, NULL, NULL)

#define RE_TRACE_INSTANT(c, n) \
re_trace_event(c, n, 'I', 0, 0, RE_TRACE_ARG_NONE, NULL, NULL)
re_trace_event(c, n, 'I', NULL, RE_TRACE_ARG_NONE, NULL, NULL)
#define RE_TRACE_INSTANT_C(c, n, vname, str) \
re_trace_event(c, n, 'I', 0, 0, RE_TRACE_ARG_STRING_CONST, \
re_trace_event(c, n, 'I', NULL, RE_TRACE_ARG_STRING_CONST, \
vname, (void *)(str))
#define RE_TRACE_INSTANT_I(c, n, i) \
re_trace_event(c, n, 'I', 0, 0, RE_TRACE_ARG_INT, \
re_trace_event(c, n, 'I', NULL, RE_TRACE_ARG_INT, \
n, (void *)(intptr_t)i)

#define RE_TRACE_ID_INSTANT(c, n, id) \
re_trace_event(c, n, 'I', id, RE_TRACE_ARG_NONE, NULL, NULL)
#define RE_TRACE_ID_INSTANT_C(c, n, vname, str, id) \
re_trace_event(c, n, 'I', id, RE_TRACE_ARG_STRING_CONST, \
vname, (void *)(str))
#define RE_TRACE_ID_INSTANT_I(c, n, i, id) \
re_trace_event(c, n, 'I', id, RE_TRACE_ARG_INT, \
n, (void *)(intptr_t)i)

#define RE_TRACE_PROCESS_NAME(n) \
re_trace_event("", "process_name", 'M', 0, 0, \
re_trace_event("", "process_name", 'M', NULL, \
RE_TRACE_ARG_STRING_COPY, \
"name", (void *)(n))
#define RE_TRACE_THREAD_NAME(n) \
re_trace_event("", "thread_name", 'M', 0, 0, \
re_trace_event("", "thread_name", 'M', NULL, \
RE_TRACE_ARG_STRING_COPY, \
"name", (void *)(n))

Expand All @@ -57,6 +68,9 @@ void re_trace_event(const char *cat, const char *name, char ph, void *id,
#define RE_TRACE_INSTANT(c, n)
#define RE_TRACE_INSTANT_C(c, n, str)
#define RE_TRACE_INSTANT_I(c, n, i)
#define RE_TRACE_ID_INSTANT(c, n, id)
#define RE_TRACE_ID_INSTANT_C(c, n, str, id)
#define RE_TRACE_ID_INSTANT_I(c, n, i, id)
#define RE_TRACE_PROCESS_NAME(n)
#define RE_TRACE_THREAD_NAME(n)

Expand Down
27 changes: 23 additions & 4 deletions include/re_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,31 @@ typedef int re_sock_t;
#define RE_ARG_14(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_13(__VA_ARGS__)
#define RE_ARG_15(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_14(__VA_ARGS__)
#define RE_ARG_16(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_15(__VA_ARGS__)

#define RE_ARG_VA_NUM_2(X, X16, X15, X14, X13, X12, X11, X10, X9, X8, X7, X6, \
X5, X4, X3, X2, X1, N, ...) \
#define RE_ARG_17(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_16(__VA_ARGS__)
#define RE_ARG_18(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_17(__VA_ARGS__)
#define RE_ARG_19(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_18(__VA_ARGS__)
#define RE_ARG_20(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_19(__VA_ARGS__)
#define RE_ARG_21(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_20(__VA_ARGS__)
#define RE_ARG_22(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_21(__VA_ARGS__)
#define RE_ARG_23(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_22(__VA_ARGS__)
#define RE_ARG_24(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_23(__VA_ARGS__)
#define RE_ARG_25(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_24(__VA_ARGS__)
#define RE_ARG_26(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_25(__VA_ARGS__)
#define RE_ARG_27(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_26(__VA_ARGS__)
#define RE_ARG_28(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_27(__VA_ARGS__)
#define RE_ARG_29(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_28(__VA_ARGS__)
#define RE_ARG_30(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_29(__VA_ARGS__)
#define RE_ARG_31(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_30(__VA_ARGS__)
#define RE_ARG_32(expr, ...) RE_ARG_SIZE(expr), (expr), RE_ARG_31(__VA_ARGS__)

#define RE_ARG_VA_NUM_2(X, X32, X31, X30, X29, X28, X27, X26, X25, X24, X23, \
X22, X21, X20, X19, X18, X17, X16, X15, X14, X13, \
X12, X11, X10, X9, X8, X7, X6, X5, X4, X3, X2, X1, N, \
...) \
N
#define RE_ARG_VA_NUM(...) \
RE_ARG_VA_NUM_2(0, ##__VA_ARGS__, 16, 15, 14, 13, 12, 11, \
RE_ARG_VA_NUM_2(0, ##__VA_ARGS__, 32, 31, 30, 29, 28, 27, 26, 25, 24, \
23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, \
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)

#define RE_ARG_N3(N, ...) RE_ARG_##N(__VA_ARGS__)
Expand Down
2 changes: 1 addition & 1 deletion mk/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = libre
PROJECT_NUMBER = 3.5.1
PROJECT_NUMBER = 3.6.2
OUTPUT_DIRECTORY = ../re-dox
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
Expand Down
Loading

0 comments on commit 28a9b9f

Please sign in to comment.