Update osip2 vendoring to 5.2.1 #24

Merged
dyfet merged 4 commits from :19-sip-stack-update into master 1 year ago
  1. 1
      CHANGELOG.md
  2. 2
      cmake/features.cmake
  3. 18
      vendor/libeXosip2/ChangeLog
  4. 26
      vendor/libeXosip2/configure
  5. 6
      vendor/libeXosip2/configure.ac
  6. 2
      vendor/libeXosip2/help/doxygen/DoxyFile
  7. 6
      vendor/libeXosip2/src/eXcall_api.c
  8. 27
      vendor/libeXosip2/src/eXosip.c
  9. 3
      vendor/libeXosip2/src/eXosip2.h
  10. 2
      vendor/libeXosip2/src/eXtl_dtls.c
  11. 19
      vendor/libeXosip2/src/eXtl_tcp.c
  12. 457
      vendor/libeXosip2/src/eXtl_tls.c
  13. 8
      vendor/libeXosip2/src/eXtl_udp.c
  14. 18
      vendor/libeXosip2/src/eXutils.c
  15. 104
      vendor/libeXosip2/src/jauth.c
  16. 32
      vendor/libeXosip2/src/sdp_offans.c
  17. 6
      vendor/libeXosip2/src/udp.c
  18. 26
      vendor/libeXosip2/tools/sip_monitor.c
  19. 11
      vendor/libosip2/ChangeLog
  20. 26
      vendor/libosip2/configure
  21. 6
      vendor/libosip2/configure.ac
  22. 2
      vendor/libosip2/help/doxygen/DoxyFile
  23. 14
      vendor/libosip2/include/osip2/osip_time.h
  24. 2
      vendor/libosip2/include/osipparser2/Makefile.am
  25. 6
      vendor/libosip2/include/osipparser2/Makefile.in
  26. 9
      vendor/libosip2/include/osipparser2/osip_port.h
  27. 60
      vendor/libosip2/include/osipparser2/osip_sha256.h
  28. 2
      vendor/libosip2/scripts/Makefile.in
  29. 8
      vendor/libosip2/src/osip2/osip_time.c
  30. 1
      vendor/libosip2/src/osipparser2/Makefile.am
  31. 14
      vendor/libosip2/src/osipparser2/Makefile.in
  32. 3
      vendor/libosip2/src/osipparser2/osip_port.c
  33. 279
      vendor/libosip2/src/osipparser2/osip_sha256.c
  34. 6
      vendor/libosip2/src/osipparser2/osip_uri.c
  35. 2
      vendor/libosip2/src/osipparser2/osip_via.c
  36. 5
      vendor/libosip2/src/osipparser2/sdp_message.c
  37. 23
      vendor/libosip2/src/test/res/sip-malformed20
  38. 22
      vendor/libosip2/src/test/res/sip-malformed20~
  39. 129
      vendor/libosip2/src/test/res/sip-malformed21
  40. 22
      vendor/libosip2/src/test/res/sip97
  41. 15
      vendor/libosip2/src/test/res/urls-2.txt
  42. 116
      vendor/libosip2/src/test/res/urls-2.txt~
  43. 11
      vendor/libosip2/src/test/res/urls-3.txt
  44. 10
      vendor/libosip2/src/test/res/urls-3.txt~
  45. 6
      vendor/libosip2/src/test/res/urls.txt

1
CHANGELOG.md

@ -3,6 +3,7 @@
## v0.0.7
- Migration to gitea
- Docker migration to quay
- Osip2 vendoring updated to 5.2.1
## v0.0.6
- Use release for osip\_free

2
cmake/features.cmake

@ -31,7 +31,7 @@ find_package(Threads REQUIRED)
set(system_libs OpenSSL::Crypto Threads::Threads)
set(stack_libs eXosip2 osipparser2 osip2 ${system_libs})
if(NOT BUILD_STATIC AND NOT VENDOR_EXOSIP)
if(NOT BUILD_STATIC AND NOT BUILD_VENDOR AND NOT VENDOR_EXOSIP)
pkg_check_modules(OSIP2 libosip2>=5.2.0)
endif()

18
vendor/libeXosip2/ChangeLog vendored

@ -1,3 +1,21 @@
eXosip2 (5.2.1) - 2020-05-21
* [ENABLE_MAIN_SOCKET] fix epoll mechanism for server socket with TCP and TLS
* [crash] check scheme upon processing 3xx
* [ssl] fix to be compatible with libressl
* [ssl] https://savannah.nongnu.org/patch/?10046 compatibility with openssl below 1.1.0
* fix when Content-Type indicates application/sdp, but there is no body
* [TLS] modify the code for TLS validation in order to improve logs and details on the connection
* use time_t instead of int for r_retry_after_delay variable [fix 1367a34ca commited on March 1st]
* eXosip_default_action will return OSIP_RETRY_LIMIT when limit is reached
* make sure to obey the Retry-After header from REGISTER reply
* use newer osip_timersub MACRO
* [bug#60024] fix openssl usage to always use callback mode for private key password, even when missing
* eXosip_reset_transports was not effective any more since [5.1.2] [commit 705643fa 2020-07-07] [do not use unless you understand it]
* [windows] a HANDLE is leaked when loading trusted certificates
* dp layer: handle WSAEMSGSIZE when buffer is too short for complete incoming messag
* cleaner code to retreive an SDP from a SIP message
* fix crash when ENABLE_MAIN_SOCKET is defined and epoll is used
eXosip2 (5.2.0) - 2020-11-10
* fix memory and socket leak [major] [affected TCP, TLS, UDP: since 5.1.2, need update asap]
* fix to make sure a non yet established TLS descriptor with read descriptor set will be processed when no outgoing transaction is in a state to handle it [since 5.1.2]

26
vendor/libeXosip2/configure vendored

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libeXosip2 5.2.0.
# Generated by GNU Autoconf 2.69 for libeXosip2 5.2.1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libeXosip2'
PACKAGE_TARNAME='libexosip2'
PACKAGE_VERSION='5.2.0'
PACKAGE_STRING='libeXosip2 5.2.0'
PACKAGE_VERSION='5.2.1'
PACKAGE_STRING='libeXosip2 5.2.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -1357,7 +1357,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libeXosip2 5.2.0 to adapt to many kinds of systems.
\`configure' configures libeXosip2 5.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1428,7 +1428,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libeXosip2 5.2.0:";;
short | recursive ) echo "Configuration of libeXosip2 5.2.1:";;
esac
cat <<\_ACEOF
@ -1562,7 +1562,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libeXosip2 configure 5.2.0
libeXosip2 configure 5.2.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1927,7 +1927,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libeXosip2 $as_me 5.2.0, which was
It was created by libeXosip2 $as_me 5.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2279,14 +2279,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: libeXosip2 The Extended Open SIP library." >&5
$as_echo "$as_me: libeXosip2 The Extended Open SIP library." >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: Copyright (C) 2002-2020 Aymeric MOIZARD - <amoizard@antisip.com>" >&5
$as_echo "$as_me: Copyright (C) 2002-2020 Aymeric MOIZARD - <amoizard@antisip.com>" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: Copyright (C) 2002-2021 Aymeric MOIZARD - <amoizard@antisip.com>" >&5
$as_echo "$as_me: Copyright (C) 2002-2021 Aymeric MOIZARD - <amoizard@antisip.com>" >&6;}
# format: ‘current[:revision[:age]]’. So, passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 1
# 1/ increase revision for every source code change [release]
# 2/ increase current for every API/ABI change and revert revision to 0
# 3/ always set age to 0 (for public release)
LIBEXOSIP_SO_VERSION=14:0:0
LIBEXOSIP_SO_VERSION=14:1:0
EXOSIP_VERSION=$VERSION
@ -2815,7 +2815,7 @@ fi
# Define the identity of the package.
PACKAGE='libexosip2'
VERSION='5.2.0'
VERSION='5.2.1'
cat >>confdefs.h <<_ACEOF
@ -15007,7 +15007,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libeXosip2 $as_me 5.2.0, which was
This file was extended by libeXosip2 $as_me 5.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -15073,7 +15073,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libeXosip2 config.status 5.2.0
libeXosip2 config.status 5.2.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

6
vendor/libeXosip2/configure.ac vendored

@ -1,15 +1,15 @@
AC_PREREQ([2.69])
AC_INIT([libeXosip2],[5.2.0])
AC_INIT([libeXosip2],[5.2.1])
AC_CONFIG_SRCDIR([include/eXosip2/eXosip.h])
AC_MSG_NOTICE([libeXosip2 The Extended Open SIP library.])
AC_MSG_NOTICE([Copyright (C) 2002-2020 Aymeric MOIZARD - <amoizard@antisip.com>])
AC_MSG_NOTICE([Copyright (C) 2002-2021 Aymeric MOIZARD - <amoizard@antisip.com>])
# format: ‘current[:revision[:age]]’. So, passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 1
# 1/ increase revision for every source code change [release]
# 2/ increase current for every API/ABI change and revert revision to 0
# 3/ always set age to 0 (for public release)
AC_SUBST(LIBEXOSIP_SO_VERSION, 14:0:0)
AC_SUBST(LIBEXOSIP_SO_VERSION, 14:1:0)
AC_SUBST(EXOSIP_VERSION, $VERSION)
AC_MSG_RESULT([Configuring ${PACKAGE} ${EXOSIP_VERSION}])

2
vendor/libeXosip2/help/doxygen/DoxyFile vendored

@ -38,7 +38,7 @@ PROJECT_NAME = libeXosip2
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 5.2.0
PROJECT_NUMBER = 5.2.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

6
vendor/libeXosip2/src/eXcall_api.c vendored

@ -1335,7 +1335,7 @@ int _eXosip_call_retry_request(struct eXosip_t *excontext, eXosip_call_t *jc, eX
co = (osip_contact_t *) osip_list_get_first(&out_tr->last_response->contacts, &it);
while (co != NULL) {
if (co->url != NULL && (osip_strcasestr(co->url->scheme, "sip") != NULL || osip_strcasestr(co->url->scheme, "tel") != NULL)) {
if (co->url != NULL && co->url->scheme != NULL && (osip_strcasestr(co->url->scheme, "sip") != NULL || osip_strcasestr(co->url->scheme, "tel") != NULL)) {
/* check tranport? */
osip_uri_param_t *u_param;
@ -1357,12 +1357,12 @@ int _eXosip_call_retry_request(struct eXosip_t *excontext, eXosip_call_t *jc, eX
co = (osip_contact_t *) osip_list_get_next(&it);
}
if (co == NULL || co->url == NULL) {
if (co == NULL || co->url == NULL || co->url->scheme == NULL) {
/* revert anyway to first(tel/sip/sips) contact // we don't care: we use our own transport with proxy */
co = co_usable;
}
if (co == NULL || co->url == NULL) {
if (co == NULL || co->url == NULL || co->url->scheme == NULL) {
osip_message_free(msg);
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_WARNING, NULL, "[eXosip] no contact header usable for SIP redirection\n"));
return OSIP_SYNTAXERROR;

27
vendor/libeXosip2/src/eXosip.c vendored

@ -420,7 +420,7 @@ static int _eXosip_retry_register_with_auth(struct eXosip_t *excontext, eXosip_e
return eXosip_register_send_register(excontext, jr->r_id, NULL);
}
return OSIP_UNDEFINED_ERROR;
return OSIP_RETRY_LIMIT;
}
static int _eXosip_retry_invite_with_auth(struct eXosip_t *excontext, eXosip_event_t *je) {
@ -448,7 +448,7 @@ static int _eXosip_retry_invite_with_auth(struct eXosip_t *excontext, eXosip_eve
return _eXosip_call_retry_request(excontext, jc, jd, tr);
}
return OSIP_UNDEFINED_ERROR;
return OSIP_RETRY_LIMIT;
}
static int _eXosip_redirect_invite(struct eXosip_t *excontext, eXosip_event_t *je) {
@ -492,7 +492,7 @@ static int _eXosip_retry_subscribe_with_auth(struct eXosip_t *excontext, eXosip_
return _eXosip_subscription_send_request_with_credential(excontext, js, jd, tr);
}
return OSIP_UNDEFINED_ERROR;
return OSIP_RETRY_LIMIT;
}
static int _eXosip_retry_publish_with_auth(struct eXosip_t *excontext, eXosip_event_t *je) {
@ -838,7 +838,13 @@ void eXosip_automatic_action(struct eXosip_t *excontext) {
for (jr = excontext->j_reg; jr != NULL; jr = jr->next) {
if (jr->r_id >= 1 && jr->r_last_tr != NULL) {
if (jr->r_reg_period != 0 && now - jr->r_last_tr->birth_time > 900) {
if (now >= jr->r_retry_after_delay)
jr->r_retry_after_delay = 0;
if (now < jr->r_retry_after_delay) {
/* skip for a while */
} else if (jr->r_reg_period != 0 && now - jr->r_last_tr->birth_time > 900) {
/* automatic refresh */
eXosip_register_send_register(excontext, jr->r_id, NULL);
@ -1523,6 +1529,19 @@ void _eXosip_mark_registration_expired(struct eXosip_t *excontext, const char *c
now = osip_getsystemtime(NULL);
if (jr->r_last_tr->last_response == NULL || (!MSG_IS_STATUS_2XX(jr->r_last_tr->last_response))) {
if (jr->r_last_tr->last_response != NULL) {
osip_header_t *retry_after_header = NULL;
osip_message_header_get_byname(jr->r_last_tr->last_response, (const char *) "retry-after", 0, &retry_after_header);
if (retry_after_header != NULL && retry_after_header->hvalue != NULL) {
jr->r_retry_after_delay = osip_atoi(retry_after_header->hvalue);
if (jr->r_retry_after_delay < 0)
jr->r_retry_after_delay = 0;
if (jr->r_retry_after_delay > 0)
jr->r_retry_after_delay += now;
}
}
jr->r_last_tr->birth_time = now - 120; /* after a failure, always make it exactly now-120 */
} else if (jr->r_reg_period > 900) {

3
vendor/libeXosip2/src/eXosip2.h vendored

@ -212,7 +212,7 @@
#include "eXtransport.h"
#include "jpipe.h"
#define EXOSIP_VERSION "5.2.0"
#define EXOSIP_VERSION "5.2.1"
#ifdef HAVE_WINSOCK2_H
#define SOCKET_TYPE SOCKET
@ -368,6 +368,7 @@ struct eXosip_reg_t {
osip_transaction_t *r_last_tr;
int r_retry; /* avoid too many unsuccessful retry */
int r_retryfailover; /* avoid too many unsuccessful retry */
time_t r_retry_after_delay; /* obey to retry_after header */
#define RS_DELETIONREQUIRED 2
#define RS_DELETIONPROCEEDING 3
#define RS_MASQUERADINGREQUIRED 4

2
vendor/libeXosip2/src/eXtl_dtls.c vendored

@ -102,7 +102,7 @@
#define RANDOM "random.pem"
#define DHFILE "dh1024.pem"
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
static void SSL_set0_rbio(SSL *s, BIO *rbio) {
BIO_free_all(s->rbio);

19
vendor/libeXosip2/src/eXtl_tcp.c vendored

@ -370,7 +370,15 @@ static int tcp_tl_set_fdset(struct eXosip_t *excontext, fd_set *osip_fdset, fd_s
#endif
for (pos = 0; pos < EXOSIP_MAX_SOCKETS; pos++) {
if (reserved->socket_tab[pos].invalid > 0) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] [TCP] [fdset] socket info:[%s][%d] [sock=%d] [pos=%d] manual reset\n", reserved->socket_tab[pos].remote_ip, reserved->socket_tab[pos].remote_port, reserved->socket_tab[pos].socket, pos));
_tcp_tl_close_sockinfo(&reserved->socket_tab[pos]);
continue;
}
if (reserved->socket_tab[pos].socket > 0) {
if (osip_fdset != NULL)
eXFD_SET(reserved->socket_tab[pos].socket, osip_fdset);
@ -677,7 +685,7 @@ static int _tcp_read_tcp_main_socket(struct eXosip_t *excontext) {
int res;
memset(&ev, 0, sizeof(struct epoll_event));
ev.events = EPOLLIN | EPOLLOUT;
ev.events = EPOLLIN;
ev.data.fd = sock;
res = epoll_ctl(excontext->epfd, EPOLL_CTL_ADD, sock, &ev);
@ -1731,6 +1739,15 @@ static int tcp_tl_send_message(struct eXosip_t *excontext, osip_transaction_t *t
port = 5060;
}
for (pos = 0; pos < EXOSIP_MAX_SOCKETS; pos++) {
if (reserved->socket_tab[pos].invalid > 0) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] [TCP] [send] socket info:[%s][%d] [sock=%d] [pos=%d] manual reset\n", reserved->socket_tab[pos].remote_ip, reserved->socket_tab[pos].remote_port,
reserved->socket_tab[pos].socket, pos));
_tcp_tl_close_sockinfo(&reserved->socket_tab[pos]);
continue;
}
}
i = _tl_resolv_naptr_destination(excontext, tr, sip, &host, &port, &naptr_record);
if (i == OSIP_SUCCESS + 1)
return i;

457
vendor/libeXosip2/src/eXtl_tls.c vendored

File diff suppressed because it is too large Load Diff

8
vendor/libeXosip2/src/eXtl_udp.c vendored

@ -804,7 +804,7 @@ static int _udp_read_udp_main_socket(struct eXosip_t *excontext) {
int valopt = ex_errno;
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] [UDP] cannot read socket [%i] %s\n", i, _ex_strerror(valopt, eb, ERRBSIZ)));
if (valopt == 0 || valopt == 34) {
if (valopt == 0 || valopt == 34 || valopt == 10040 /* WSAEMSGSIZE */ ) {
if (udp_message_max_length < 65536) {
udp_message_max_length = udp_message_max_length * 2;
@ -1328,7 +1328,9 @@ static int udp_tl_send_message(struct eXosip_t *excontext, osip_transaction_t *t
if (excontext->ipv6_enable > 1 && curinfo == NULL) {
/* search for an IP similar to reserved->udp_socket_family */
for (curinfo = addrinfo; curinfo; curinfo = curinfo->ai_next) {
curinfo = addrinfo;
if (curinfo) {
if (curinfo->ai_family == AF_INET && reserved->udp_socket_family == AF_INET6) {
/* switch to another family */
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_INFO2, NULL, "[eXosip] [UDP] [tid=%i] switching to IPv4\n", tid));
@ -1342,8 +1344,6 @@ static int udp_tl_send_message(struct eXosip_t *excontext, osip_transaction_t *t
_udp_tl_reset(excontext, curinfo->ai_family);
return OSIP_SUCCESS;
}
break;
}
}

18
vendor/libeXosip2/src/eXutils.c vendored

@ -286,15 +286,16 @@ char *_ex_strerror(int errnum, char *buf, size_t buflen) {
return buf;
}
#elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || __APPLE__) && !_GNU_SOURCE
#elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || __APPLE__ || defined(ANDROID)) && !_GNU_SOURCE
char *_ex_strerror(int errnum, char *buf, size_t buflen) {
int in = snprintf(buf, buflen, "[%d:", errnum);
if (strerror_r(errnum, buf + in, buflen - in)) {
snprintf(buf + in, buflen - in, "invalid error]");
int err = strerror_r(errnum, buf + in, buflen - in);
if (err) {
snprintf(buf, buflen, "[%d:invalid error]", errnum);
return buf;
}
if (buflen - strlen(buf) > 0)
if (buflen - strlen(buf) > 1)
snprintf(buf + strlen(buf), buflen - strlen(buf), "]");
return buf;
}
@ -303,12 +304,17 @@ char *_ex_strerror(int errnum, char *buf, size_t buflen) {
char *_ex_strerror(int errnum, char *buf, size_t buflen) {
int in = snprintf(buf, buflen, "[%d:", errnum);
strerror_r(errnum, buf + in, buflen - in);
if (buflen - strlen(buf) > 0)
/* fix: GNU strerror_r may return a static buffer instead of writing into buf */
char *tmp = strerror_r(errnum, buf + in, buflen - in);
if (tmp != buf) {
strncat(buf + strlen(buf), tmp, buflen - strlen(buf) - 1);
}
if (buflen - strlen(buf) > 1)
snprintf(buf + strlen(buf), buflen - strlen(buf), "]");
return buf;
}
#endif
#if defined(WIN32) || defined(_WIN32_WCE)

104
vendor/libeXosip2/src/jauth.c vendored

@ -37,9 +37,12 @@
#include <osip2/osip_condv.h>
#include <osipparser2/osip_md5.h>
#include <osipparser2/osip_sha256.h>
#include "milenage.h"
#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/sha.h>
#endif
/* TAKEN from rcf2617.txt */
#define MD5HASHLEN 16
@ -121,28 +124,30 @@ void CvtHex(char *input_binary, size_t input_len, char *output_hexa) {
output_hexa[i * 2] = '\0';
}
#ifdef HAVE_OPENSSL_SSL_H
static void SHA256DigestCalcHA1(const char *pszAlg, const char *pszUserName, const char *pszRealm, const char *pszPassword, const char *pszNonce, const char *pszCNonce, char SessionKey[SHA256HEXLEN + 1]) {
osip_SHA256_CTX SHA256Ctx;
SHA256_CTX SHA256Ctx;
char HA1[SHA256HASHLEN];
char HA1Hex[SHA256HEXLEN + 1];
osip_SHA256Init(&SHA256Ctx);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszUserName, (unsigned int) strlen(pszUserName));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszRealm, (unsigned int) strlen(pszRealm));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszPassword, (unsigned int) strlen(pszPassword));
osip_SHA256Final((unsigned char *) HA1, &SHA256Ctx);
SHA256_Init(&SHA256Ctx);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszUserName, (unsigned int) strlen(pszUserName));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszRealm, (unsigned int) strlen(pszRealm));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszPassword, (unsigned int) strlen(pszPassword));
SHA256_Final((unsigned char *) HA1, &SHA256Ctx);
if ((pszAlg != NULL) && osip_strcasecmp(pszAlg, "sha256-sess") == 0) {
CvtHex(HA1, SHA256HASHLEN, HA1Hex);
osip_SHA256Init(&SHA256Ctx);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) HA1Hex, SHA256HEXLEN);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszNonce, (unsigned int) strlen(pszNonce));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszCNonce, (unsigned int) strlen(pszCNonce));
osip_SHA256Final((unsigned char *) HA1, &SHA256Ctx);
SHA256_Init(&SHA256Ctx);
SHA256_Update(&SHA256Ctx, (unsigned char *) HA1Hex, SHA256HEXLEN);
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszNonce, (unsigned int) strlen(pszNonce));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszCNonce, (unsigned int) strlen(pszCNonce));
SHA256_Final((unsigned char *) HA1, &SHA256Ctx);
}
CvtHex(HA1, SHA256HASHLEN, SessionKey);
@ -150,16 +155,16 @@ static void SHA256DigestCalcHA1(const char *pszAlg, const char *pszUserName, con
static void SHA256DigestCalcResponse(char HA1[SHA256HEXLEN + 1], const char *pszNonce, const char *pszNonceCount, const char *pszCNonce, const char *pszQop, int Aka, const char *pszMethod, const char *pszDigestUri, char HEntity[SHA256HEXLEN + 1],
char Response[SHA256HEXLEN + 1]) {
osip_SHA256_CTX SHA256Ctx;
SHA256_CTX SHA256Ctx;
char HA2[SHA256HASHLEN];
char RespHash[SHA256HASHLEN];
char HA2Hex[SHA256HEXLEN + 1];
/* calculate H(A2) */
osip_SHA256Init(&SHA256Ctx);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszMethod, (unsigned int) strlen(pszMethod));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszDigestUri, (unsigned int) strlen(pszDigestUri));
SHA256_Init(&SHA256Ctx);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszMethod, (unsigned int) strlen(pszMethod));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszDigestUri, (unsigned int) strlen(pszDigestUri));
if (pszQop == NULL) {
goto auth_withoutqop;
@ -172,48 +177,49 @@ static void SHA256DigestCalcResponse(char HA1[SHA256HEXLEN + 1], const char *psz
}
auth_withoutqop:
osip_SHA256Final((unsigned char *) HA2, &SHA256Ctx);
SHA256_Final((unsigned char *) HA2, &SHA256Ctx);
CvtHex(HA2, SHA256HASHLEN, HA2Hex);
/* calculate response */
osip_SHA256Init(&SHA256Ctx);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) HA1, SHA256HEXLEN);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszNonce, (unsigned int) strlen(pszNonce));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Init(&SHA256Ctx);
SHA256_Update(&SHA256Ctx, (unsigned char *) HA1, SHA256HEXLEN);
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszNonce, (unsigned int) strlen(pszNonce));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
goto end;
auth_withauth_int:
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) HEntity, SHA256HEXLEN);
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) HEntity, SHA256HEXLEN);
auth_withauth:
osip_SHA256Final((unsigned char *) HA2, &SHA256Ctx);
SHA256_Final((unsigned char *) HA2, &SHA256Ctx);
CvtHex(HA2, SHA256HASHLEN, HA2Hex);
/* calculate response */
osip_SHA256Init(&SHA256Ctx);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) HA1, SHA256HEXLEN);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszNonce, (unsigned int) strlen(pszNonce));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Init(&SHA256Ctx);
SHA256_Update(&SHA256Ctx, (unsigned char *) HA1, SHA256HEXLEN);
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszNonce, (unsigned int) strlen(pszNonce));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
if (Aka == 0) {
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszNonceCount, (unsigned int) strlen(pszNonceCount));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszCNonce, (unsigned int) strlen(pszCNonce));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
osip_SHA256Update(&SHA256Ctx, (unsigned char *) pszQop, (unsigned int) strlen(pszQop));
osip_SHA256Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszNonceCount, (unsigned int) strlen(pszNonceCount));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszCNonce, (unsigned int) strlen(pszCNonce));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
SHA256_Update(&SHA256Ctx, (unsigned char *) pszQop, (unsigned int) strlen(pszQop));
SHA256_Update(&SHA256Ctx, (unsigned char *) ":", 1);
}
end:
osip_SHA256Update(&SHA256Ctx, (unsigned char *) HA2Hex, SHA256HEXLEN);
osip_SHA256Final((unsigned char *) RespHash, &SHA256Ctx);
SHA256_Update(&SHA256Ctx, (unsigned char *) HA2Hex, SHA256HEXLEN);
SHA256_Final((unsigned char *) RespHash, &SHA256Ctx);
CvtHex(RespHash, SHA256HASHLEN, Response);
}
#endif
/* calculate H(A1) as per spec */
static void DigestCalcHA1(const char *pszAlg, const char *pszUserName, const char *pszRealm, const char *pszPassword, const char *pszNonce, const char *pszCNonce, char SessionKey[MD5HEXLEN + 1]) {
@ -789,8 +795,12 @@ int _eXosip_create_proxy_authorization_header(osip_proxy_authenticate_t *wa, con
/* "MD5" is invalid, but some servers use it. */
if (wa->algorithm != NULL) {
if (0 == osip_strcasecmp("MD5", wa->algorithm) || 0 == osip_strcasecmp("\"MD5\"", wa->algorithm)) {
#ifdef HAVE_OPENSSL_SSL_H
} else if (0 == osip_strcasecmp("SHA-256", wa->algorithm) || 0 == osip_strcasecmp("\"SHA-256\"", wa->algorithm)) {
Alg = "SHA-256";
#endif
} else if (0 == osip_strcasecmp("AKAv1-MD5", wa->algorithm) || 0 == osip_strcasecmp("\"AKAv1-MD5\"", wa->algorithm)) {
Alg = "AKAv1-MD5";
@ -798,7 +808,11 @@ int _eXosip_create_proxy_authorization_header(osip_proxy_authenticate_t *wa, con
Alg = "AKAv2-MD5";
} else {
#ifdef HAVE_OPENSSL_SSL_H
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] skip authentication [algorithm not supported] [SHA-256, MD5, AKAv1-MD5, AKAv2-MD5]\n"));
#else
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] skip authentication [algorithm not supported] [MD5, AKAv1-MD5, AKAv2-MD5]\n"));
#endif
return OSIP_UNDEFINED_ERROR;
}
}
@ -957,12 +971,16 @@ int _eXosip_create_proxy_authorization_header(osip_proxy_authenticate_t *wa, con
version = 0;
DigestCalcResponse((char *) pha1, pszNonce, szNonceCount, pszCNonce, pszQop, version, pszMethod, pszURI, HA2, Response);
respponse_len = MD5HEXLEN + 1;
#ifdef HAVE_OPENSSL_SSL_H
} else if (0 == osip_strcasecmp(Alg, "SHA-256")) {
SHA256DigestCalcHA1("SHA-256", pszUser, pszRealm, pszPass, pszNonce, pszCNonce, HA1);
version = 0;
pha1 = HA1;
SHA256DigestCalcResponse((char *) pha1, pszNonce, szNonceCount, pszCNonce, pszQop, version, pszMethod, pszURI, HA2, Response);
respponse_len = SHA256HEXLEN + 1;
#endif
} else {
if (0 == osip_strcasecmp(Alg, "AKAv1-MD5"))
version = 1;

32
vendor/libeXosip2/src/sdp_offans.c vendored

@ -208,15 +208,38 @@ sdp_message_t *eXosip_get_sdp_info(osip_message_t *message) {
if (ctt->type == NULL || ctt->subtype == NULL)
return NULL;
if (osip_strcasecmp(ctt->type, "multipart") == 0) {
/* probably within the multipart attachement */
} else if (osip_strcasecmp(ctt->type, "application") != 0 || osip_strcasecmp(ctt->subtype, "sdp") != 0)
if (osip_strcasecmp(ctt->type, "application") == 0 && osip_strcasecmp(ctt->subtype, "sdp") == 0) {
int i;
oldbody = (osip_body_t *) osip_list_get_first(&message->bodies, &it);
if (oldbody == NULL)
return NULL;
sdp_message_init(&sdp);
i = sdp_message_parse(sdp, oldbody->body);
if (i == 0)
return sdp;
sdp_message_free(sdp);
return NULL;
}
if (osip_strcasecmp(ctt->type, "multipart") != 0)
return NULL;
oldbody = (osip_body_t *) osip_list_get_first(&message->bodies, &it);
while (oldbody != NULL) {
int i;
ctt = oldbody->content_type;
if (ctt == NULL) {
oldbody = (osip_body_t *) osip_list_get_next(&it);
continue;
}
if (osip_strcasecmp(ctt->type, "application") != 0 || osip_strcasecmp(ctt->subtype, "sdp") != 0) {
oldbody = (osip_body_t *) osip_list_get_next(&it);
continue;
}
sdp_message_init(&sdp);
i = sdp_message_parse(sdp, oldbody->body);
@ -225,8 +248,7 @@ sdp_message_t *eXosip_get_sdp_info(osip_message_t *message) {
return sdp;
sdp_message_free(sdp);
sdp = NULL;
oldbody = (osip_body_t *) osip_list_get_next(&it);
return NULL;
}
return NULL;

6
vendor/libeXosip2/src/udp.c vendored

@ -1850,6 +1850,11 @@ int _eXosip_read_message(struct eXosip_t *excontext, int max_message_nb, int sec
}
#endif
#ifdef ENABLE_MAIN_SOCKET
/* we call this anyway for incoming connection on MAIN socket */
/* TODO: also use this code in standard version? */
excontext->eXtl_transport.tl_epoll_read_message(excontext, nfds, excontext->ep_array);
#else
for (i = 0; osip_fd_table[i] != -1; i++) {
for (n = 0; n < nfds; ++n) {
if (((excontext->ep_array[n].events & EPOLLIN) || (excontext->ep_array[n].events & EPOLLOUT)) && excontext->ep_array[n].data.fd == osip_fd_table[i]) {
@ -1861,6 +1866,7 @@ int _eXosip_read_message(struct eXosip_t *excontext, int max_message_nb, int sec
}
}
}
#endif
eXosip_lock(excontext);
i = _eXosip_dnsutils_checksock_epoll(excontext, nfds);

26
vendor/libeXosip2/tools/sip_monitor.c vendored

@ -229,20 +229,18 @@ static void __osip_trace_func(const char *fi, int li, osip_trace_level_t level,
char *tmp = strstr(buffer, "socket [");
add_log(LOG_ERR, tmp);
} else if (strstr(buffer, "[ssl connect] succeeded") != NULL) {
char *tmp = strstr(buffer, "[ssl connect] succeeded");
} else if (strstr(buffer, "[ssl connect] [verification=") != NULL) {
char *tmp = strstr(buffer, "[ssl connect] ");
add_log(LOG_INFO, tmp);
} else if (strstr(buffer, "[TLS] invalid depth[") != NULL) {
char *tmp = strstr(buffer, "[TLS] invalid depth[");
add_log(LOG_ERR, tmp);
if (error_reason[0] == '\0') {
snprintf(error_reason, sizeof(error_reason), "%s", tmp);
if (strstr(buffer, "[ssl connect] [verification=ENABLED] [FAILURE") != NULL) {
snprintf(error_reason, sizeof(error_reason), "%s", tmp);
}
}
} else if (strstr(buffer, "[ssl connect] error") != NULL) {
char *tmp = strstr(buffer, "[ssl connect] error");
} else if (strstr(buffer, "[TLS] invalid depth[") != NULL) {
char *tmp = strstr(buffer, "[TLS] invalid depth[");
add_log(LOG_ERR, tmp);
if (error_reason[0] == '\0') {
@ -366,7 +364,7 @@ static int _resolv_naptr(const char *domain) {
}
osip_gettimeofday(&time_end, NULL);
timersub(&time_end, &time_start, &time_sub);
osip_timersub(&time_end, &time_start, &time_sub);
syslog_wrapper(LOG_INFO, "NAPTR REPORT:[SUCCESS] [duration:%li,%03lis] best service for %s -> [%s] [%s:%i]", time_sub.tv_sec, time_sub.tv_usec / 1000, naptr_lookup.domain, best->protocol, best->srventry[0].srv, best->srventry[0].port);
return 0;
}
@ -374,7 +372,7 @@ static int _resolv_naptr(const char *domain) {
}
osip_gettimeofday(&time_end, NULL);
timersub(&time_end, &time_start, &time_sub);
osip_timersub(&time_end, &time_start, &time_sub);
syslog_wrapper(LOG_ERR, "NAPTR REPORT:[FAILURE] [duration:%li,%03lis] no NAPTR/no SRV record for %s", time_sub.tv_sec, time_sub.tv_usec / 1000, domain);
return 0;
}
@ -779,7 +777,7 @@ int main(int argc, char *argv[]) {
switch (event->type) {
case EXOSIP_REGISTRATION_SUCCESS:
osip_gettimeofday(&time_end, NULL);
timersub(&time_end, &time_start, &time_sub);
osip_timersub(&time_end, &time_start, &time_sub);
dump_logs();
syslog_wrapper(LOG_INFO, "REGISTRATION REPORT:[SUCCESS] [%s][duration:%li,%03lis] REGISTER [%i][%s]", transport, time_sub.tv_sec, time_sub.tv_usec / 1000, event->response->status_code, event->response->reason_phrase);
@ -789,7 +787,7 @@ int main(int argc, char *argv[]) {
case EXOSIP_REGISTRATION_FAILURE:
osip_gettimeofday(&time_end, NULL);
timersub(&time_end, &time_start, &time_sub);
osip_timersub(&time_end, &time_start, &time_sub);
dump_logs();

11
vendor/libosip2/ChangeLog vendored

@ -1,3 +1,14 @@
libosip2 (5.2.1) - 2021-05-25
* fix compilation warning on ANDROID
* add OSIP_RETRY_LIMIT which may be useful to exosip
* add osip_timersub macro
* [windows] automatic usage of debug malloc/free to ease leak detection on windows
* fix validate that the API are used with the expected/required leading char
osip_uri_parse_headers parameter must start by '?'
osip_uri_parse_params parameter must start by ';'
* fix memory out-of-bound access in broken uncompliant Via header
* fix k= within media being rejected since 5.1.1 [wrong check]
libosip2 (5.2.0) - 2020-11-10
* use localtime_r when __USE_POSIX is available
* sync versions with libexosip

26
vendor/libosip2/configure vendored

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libosip2 5.2.0.
# Generated by GNU Autoconf 2.69 for libosip2 5.2.1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libosip2'
PACKAGE_TARNAME='libosip2'
PACKAGE_VERSION='5.2.0'
PACKAGE_STRING='libosip2 5.2.0'
PACKAGE_VERSION='5.2.1'
PACKAGE_STRING='libosip2 5.2.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -1350,7 +1350,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libosip2 5.2.0 to adapt to many kinds of systems.
\`configure' configures libosip2 5.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1421,7 +1421,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libosip2 5.2.0:";;
short | recursive ) echo "Configuration of libosip2 5.2.1:";;
esac
cat <<\_ACEOF
@ -1547,7 +1547,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libosip2 configure 5.2.0
libosip2 configure 5.2.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1966,7 +1966,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libosip2 $as_me 5.2.0, which was
It was created by libosip2 $as_me 5.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2318,14 +2318,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: libosip2 The GNU Open SIP library." >&5
$as_echo "$as_me: libosip2 The GNU Open SIP library." >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: Copyright (C) 2001-2020 Aymeric MOIZARD - <amoizard@antisip.com>" >&5
$as_echo "$as_me: Copyright (C) 2001-2020 Aymeric MOIZARD - <amoizard@antisip.com>" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: Copyright (C) 2001-2021 Aymeric MOIZARD - <amoizard@antisip.com>" >&5
$as_echo "$as_me: Copyright (C) 2001-2021 Aymeric MOIZARD - <amoizard@antisip.com>" >&6;}
#‘current[:revision[:age]]’. So, passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 1
# 1/ increase revision for every source code change [release]
# 2/ increase current for every API/ABI change and revert revision to 0
# 3/ always set age to 0 (for public release)
LIBOSIP_SO_VERSION=14:0:0
LIBOSIP_SO_VERSION=14:1:0
OSIP_VERSION=$VERSION
@ -2854,7 +2854,7 @@ fi
# Define the identity of the package.
PACKAGE='libosip2'
VERSION='5.2.0'
VERSION='5.2.1'
cat >>confdefs.h <<_ACEOF
@ -14304,7 +14304,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libosip2 $as_me 5.2.0, which was
This file was extended by libosip2 $as_me 5.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -14370,7 +14370,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libosip2 config.status 5.2.0
libosip2 config.status 5.2.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

6
vendor/libosip2/configure.ac vendored

@ -1,15 +1,15 @@
AC_PREREQ([2.69])
AC_INIT([libosip2],[5.2.0])
AC_INIT([libosip2],[5.2.1])
AC_CONFIG_SRCDIR([include/osip2/osip.h])
AC_MSG_NOTICE([libosip2 The GNU Open SIP library.])
AC_MSG_NOTICE([Copyright (C) 2001-2020 Aymeric MOIZARD - <amoizard@antisip.com>])
AC_MSG_NOTICE([Copyright (C) 2001-2021 Aymeric MOIZARD - <amoizard@antisip.com>])
#‘current[:revision[:age]]’. So, passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 1
# 1/ increase revision for every source code change [release]
# 2/ increase current for every API/ABI change and revert revision to 0
# 3/ always set age to 0 (for public release)
AC_SUBST(LIBOSIP_SO_VERSION, 14:0:0)
AC_SUBST(LIBOSIP_SO_VERSION, 14:1:0)
AC_SUBST(OSIP_VERSION, $VERSION)
AC_MSG_RESULT([Configuring ${PACKAGE} ${VERSION}])

2
vendor/libosip2/help/doxygen/DoxyFile vendored

@ -38,7 +38,7 @@ PROJECT_NAME = libosip
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 5.2.0
PROJECT_NUMBER = 5.2.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

14
vendor/libosip2/include/osip2/osip_time.h vendored

@ -62,6 +62,20 @@ void min_timercmp(struct timeval *tv1, struct timeval *tv2);
#define osip_timerclear(tvp) timerclear(tvp)
#endif
#if !defined(timersub)
#define osip_timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) { \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)
#else
#define osip_timersub(a, b, result) timersub(a, b, result)
#endif
int osip_gettimeofday(struct timeval *tp, void *tz);
time_t osip_getsystemtime(time_t *t);
void osip_compensatetime(void);

2
vendor/libosip2/include/osipparser2/Makefile.am vendored

@ -8,4 +8,4 @@ osipparser2_includedir=$(includedir)/osipparser2
osipparser2_include_HEADERS=\
osip_const.h osip_md5.h osip_parser.h osip_uri.h \
osip_list.h osip_message.h osip_port.h sdp_message.h \
osip_sha256.h osip_headers.h osip_body.h
osip_headers.h osip_body.h

6
vendor/libosip2/include/osipparser2/Makefile.in vendored

@ -112,11 +112,11 @@ am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
@ -352,7 +352,7 @@ osipparser2_includedir = $(includedir)/osipparser2
osipparser2_include_HEADERS = \
osip_const.h osip_md5.h osip_parser.h osip_uri.h \
osip_list.h osip_message.h osip_port.h sdp_message.h \
osip_sha256.h osip_headers.h osip_body.h
osip_headers.h osip_body.h
all: all-recursive

9
vendor/libosip2/include/osipparser2/osip_port.h vendored

@ -140,7 +140,13 @@ void *_osip_realloc(void *ptr, size_t size, char *file, unsigned short line);
#else
#if 0 /* for windows test purpose */
/* Check for memory leaks */
#if defined(_DEBUG) && defined(WIN32)
#define OSIP_MEMORY_DEBUG
#endif
#ifdef OSIP_MEMORY_DEBUG
/* for windows test purpose */
#ifndef osip_malloc
#define osip_malloc(S) _osip_malloc(S, __FILE__, __LINE__)
#endif
@ -356,4 +362,5 @@ const char *osip_strerror(int err);
#define OSIP_TOOMUCHCALL -51
#define OSIP_WRONG_FORMAT -52
#define OSIP_NOCOMMONCODEC -53
#define OSIP_RETRY_LIMIT -60
#endif /* _PORT_H_ */

60
vendor/libosip2/include/osipparser2/osip_sha256.h vendored

@ -1,60 +0,0 @@
/* sha.h - header file for sha.c
*/
/*-
* Copyright 2005,2007,2009 Colin Percival
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SHA_H_
#define _SHA_H_
#ifndef DOXYGEN
#include <sys/types.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Structure for holding SHA256 context.
* @var SHA256_CTX
*/
typedef struct {
uint32_t state[8];
uint32_t count[2];
unsigned char buf[128];
} osip_SHA256_CTX;
void osip_SHA256Init(osip_SHA256_CTX *);
void osip_SHA256Update(osip_SHA256_CTX *, const void*, size_t);
void osip_SHA256Final(unsigned char[32], osip_SHA256_CTX *);
#ifdef __cplusplus
}
#endif
#endif
#endif

2
vendor/libosip2/scripts/Makefile.in vendored

@ -124,7 +124,7 @@ am__can_run_installinfo = \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in compile config.guess \
config.sub depcomp install-sh ltmain.sh missing mkinstalldirs
config.sub install-sh ltmain.sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@

8
vendor/libosip2/src/osip2/osip_time.c vendored

@ -194,6 +194,9 @@ time_t time(time_t *t) {
#endif
void osip_compensatetime() {
#ifndef ANDROID
return;
#else
static struct timeval last_now_monotonic = {0, 0};
static struct timeval last_now_real = {0, 0};
struct timeval now_monotonic;
@ -201,10 +204,6 @@ void osip_compensatetime() {
struct timeval diff_monotonic;
struct timeval diff_real;
#ifndef ANDROID
return;
#endif
_osip_gettimeofday_realtime(&now_real, NULL);
osip_gettimeofday(&now_monotonic, NULL);
now_monotonic.tv_sec -= offset.tv_sec;
@ -243,6 +242,7 @@ void osip_compensatetime() {
_osip_gettimeofday_realtime(&last_now_real, NULL);
osip_gettimeofday(&last_now_monotonic, NULL);
last_now_monotonic.tv_sec -= offset.tv_sec;
#endif
}
time_t osip_getsystemtime(time_t *t) {

1
vendor/libosip2/src/osipparser2/Makefile.am vendored

@ -10,7 +10,6 @@ osip_from.c osip_uri.c \
osip_authorization.c osip_header.c \
osip_www_authenticate.c osip_via.c \
osip_body.c osip_md5c.c \
osip_sha256.c \
osip_message.c osip_list.c \
osip_call_id.c osip_message_parse.c \
osip_contact.c osip_message_to_str.c \

14
vendor/libosip2/src/osipparser2/Makefile.in vendored

@ -147,7 +147,7 @@ am__libosipparser2_la_SOURCES_DIST = osip_proxy_authorization.c \
osip_www_authenticate.c osip_via.c osip_body.c osip_md5c.c \
osip_message.c osip_list.c osip_call_id.c osip_message_parse.c \
osip_contact.c osip_message_to_str.c osip_content_length.c \
osip_parser_cfg.c osip_content_type.c osip_sha256.c \
osip_parser_cfg.c osip_content_type.c \
osip_proxy_authenticate.c osip_mime_version.c osip_port.c \
osip_call_info.c osip_content_disposition.c \
osip_accept_encoding.c osip_content_encoding.c \
@ -175,7 +175,7 @@ libosipparser2_la_OBJECTS = $(am_libosipparser2_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__v_lt_1 =
libosipparser2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \