New upstream version 5.7.4

mr12.2 upstream/5.7.4
Victor Seva 1 year ago
parent bb9629ea4f
commit 4abdbda9f9

@ -1,3 +1,739 @@
===================== 2024-01-18 Version 5.7.4 Released =====================
===================== Changes Since Version 5.7.3 ===========================
commit 116ce498cba50a071ee878e803dbcf63530688cc
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Jan 18 10:49:23 2024 +0100
Makefile.defs: version set to 5.7.4
commit 743cfae479bed2e5f09ed8e1cd4f3a959299e3ab
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Jan 18 10:30:20 2024 +0100
pkg: deb specs updated for v5.7.4
commit d5cf7148375feb7d4202a07023caaeaeda3396c7
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Jan 18 09:30:27 2024 +0100
pkg: version set to 5.7.4 for rpms and alpine specs
commit 3b79c1ef3cc6c1019fe7cb99ff77e0c51d8e789a
Author: S-P Chan <shihping.chan@gmail.com>
Date: Thu Jan 18 06:21:55 2024 +0800
tls_wolfssl: clean-up—using wolfSSL native naming for functions / structs
(cherry-pick from 5bbb224fdad1770150dd2fc37c69393aeda96d40)
commit 784bb3b397cc1922d06054c611c443dd19216504
Author: Elena-Ramona Modroiu <anomarme@users.noreply.github.com>
Date: Tue Jan 16 16:07:43 2024 +0100
tls: set parameter name for tls_h_mod_randctx()
- without it fails to compile on Unbuntu 22.04 with low latency kernel
(cherry picked from commit 03456e5e5983e2236b8e182cf3317d14ebf34e18)
commit a539ca32ec3a898e354aab90d899b99564064392
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Jan 11 08:21:00 2024 +0100
core: keep listen socket even if advertise address does not resolve
- the core advertise_address parameter works in the same fashion
- previously it was starting by skipping the listen, which resulted in
unexpected runtime list of sockets
(cherry picked from commit b50036200c5bc09fd2d412a18585b42d63763b27)
commit 2dff6f52d1393cf8eabe714262ec8e56aad0d212
Author: Federico Cabiddu <federico.cabiddu@gmail.com>
Date: Wed Jan 10 08:52:03 2024 +0100
http_async_client: exit mod_init if tm is not loaded
(cherry picked from commit 5a40d1ef1b484c4fc437a3f0183a101241e80313)
commit dc59286c26e9799f86e698a9698c9da846a2a41a
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Jan 9 14:06:21 2024 +0100
htable: read rpc number value as long
- remove autoconvert for number, it is only for string values
- GH #3674
(cherry picked from commit 577fb11010ff61af3c4b567581c0bbc5404654c8)
commit 37a07037b6e3485f3ddd1b27b1998af6e4283bcb
Author: Dennis Yurasov <dennis-y@yandex-team.ru>
Date: Wed Dec 20 16:11:56 2023 +0300
dialog: fixed saving dialogs on shutdown that are already loaded at startup when using db_mode 3
- The dialogs that loaded at startup are not saved in DB on shutdown, and so not loaded at restart,
fixes issue #3669
(cherry picked from commit 2d00ce546bb0852dc1784d5bc2e794d06f919577)
commit be5b4b160ecff8dc398735fbd28ceb71845f1bef
Author: Nikolay Ivanuschak <ivanuschak.nikolay@gmail.com>
Date: Mon Dec 18 22:20:50 2023 +0300
core: fixed haproxy protocol parser
fixes GH #3683
(cherry picked from commit c5237830f3e7fbeec403a0190471a066081c1117)
commit fc0bd88b55121e3588f5793480f0594e44bf2b17
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Dec 26 17:51:48 2023 +0100
statsd: use bool type for local variable to match return of function
(cherry picked from commit 0186246fce8f0e4bb46b30c05174983cd957a3ba)
commit 6cd8f2acc0601fbd040999d776f15b828d6e4946
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Sun Dec 24 12:20:57 2023 +0100
tmx: rework cleaning up on init failure
(cherry picked from commit 5192e5d275761ccd1af49d4bf9dd12e1438947b7)
commit 916d02d883dc938247576bdf8f5c5b23a588cb9c
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Dec 22 14:50:59 2023 +0100
tm: make lookup event_route[tm:local-response] only once
- related to issue #3064 and PR #3687
(cherry picked from commit 1f5444fd2e25d227ffd70f1087d057a3b8002558)
commit 5a26d9e9fba36a49a93bb3b886836615f62ed3d1
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon Dec 18 12:31:34 2023 +0100
pv: removed unnecessary condition
(cherry picked from commit 2f43510be37c157f800389dfb432b6c52d7435a7)
commit 2d385c1983a921a95fb392e8aea0332fdc10a387
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon Dec 18 12:22:25 2023 +0100
pv: typo in transformation log message
(cherry picked from commit ca2a9479adf720e67bf50c9d2795cc8937e223dc)
commit 0ca30e87655798e3841c005abb63ca66bb2ca0aa
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Sat Dec 16 20:04:08 2023 +0100
core: srjson - init vars and check scanned values
(cherry picked from commit 678b1a68de86d9539adeaf0262d9735b8d435077)
commit 4371adffc07bb555e2a52dedd6cd5afa2631287a
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Dec 13 12:23:23 2023 +0100
app_python3: check allocated pointer
(cherry picked from commit 49b3b90cd229b7c4da06b61cdfd782450d383cc9)
commit 62b76c076ff0f36b847a13c180b7d5090e98d94e
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Dec 13 12:15:28 2023 +0100
core: check if conversion could not be done
(cherry picked from commit 077651fa3bfd50e0f654c907f3783b1421497bd5)
commit 0712576dc4d57ba41e45012486dd206d955c35e6
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Dec 13 12:08:56 2023 +0100
registrar: check returned branch pointer
(cherry picked from commit 5d641f56fc1bc342d9be008ecd96959e114fef66)
commit 1189bb2962dd80c21a1d497125f3199ccc018270
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Dec 13 12:02:01 2023 +0100
tm: check get_t() result for consistency
(cherry picked from commit 1191ab4e5e03b35714ec1ad9d9bf2dd9665c71fd)
commit 37621005e38a0191a93fbaf4f39b8b88c7486c9d
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Sat Dec 9 20:07:37 2023 +0100
dialog: check first the size
(cherry picked from commit 9db18bc48bff0d230e66973a45c8e72e1b7744e8)
commit 81dce4e5003f3c00301671144ac67877f5824b72
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Dec 8 16:23:03 2023 +0100
core: xavp - info long when skipping serializing a field
(cherry picked from commit 5d97afefd2a8f53072a36b6eb8927c180fb984c9)
commit 3046d01bed4bdd0fe763fd770ffc8f7aeeae3418
Author: Péter Barabás <peter.barabas@securesoft.hu>
Date: Wed Dec 6 21:16:46 2023 +0100
uac: fix socket length settings
- set _uac_req.s_sock.len value to 0 in pv_set_uac_req() method in case of "all" case
- change setting of _uac_req.s_apasswd.len to _uac_req.s_sock.len in pv_set_uac_req() method in case of "sock" case
(cherry picked from commit 10519d199f6cac116399f4473bd82f2b08de72ba)
commit 065203150aaf2f99bd6fe40ce5ffb960bd430c16
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Dec 5 10:27:32 2023 +0100
dialog: prevent duplicate of leg1 attributes in json for dmq
- reported by #3656
(cherry picked from commit ca7e1e49aecd3e0f12cc783e3b97868980f1d3d2)
commit 18fead63dca0982df500b35b7c4e2d06550d9b40
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon Nov 20 10:07:50 2023 +0100
core: set proto on fixing forward actions
(cherry picked from commit e51ccd11fe51f2d53dd7719b8fdec561a6ba7494)
commit d411c6ea4358e6d9dd367349e877ed5f5bf4bb2f
Author: Federico Cabiddu <federico.cabiddu@gmail.com>
Date: Tue Jan 16 09:42:27 2024 +0100
dialog: don't send the BYE if dialog is in deleted state (#3714)
(cherry picked from commit 695f155f3a127f0bbe220a6b44a0fc3887e1e4be)
commit b6796b110adbe4dec7ac1acb1d7d70bdc58bf1c2
Author: S-P Chan <shihping.chan@gmail.com>
Date: Tue Jan 16 16:36:25 2024 +0800
tls_wolfssl: mask outer make DESTDIR=XX if building internal submodule
commit d5ebc2716992c2480c604555511511ce043bead7
Author: S-P Chan <shihping.chan@gmail.com>
Date: Tue Jan 16 16:13:55 2024 +0800
tls_wolfssl: update to v5.6.6-stable
commit 449155221586294d716e760fbabbd4e101ad1be2
Author: S-P Chan <shihping.chan@gmail.com>
Date: Mon Jan 15 21:32:53 2024 +0800
outbound: update to OpenSSL 3 API
(cherry-pick from fe5c7125c66e37d2db032a63328ad713738a4b0c)
commit bbbcb27040c632642c50209455efbb8225888723
Author: S-P Chan <shihping.chan@gmail.com>
Date: Sun Jan 14 14:08:03 2024 +0800
tls: remove thread-enablement on EVP_RAND_CTX
- with late initialisation it is not necessary to enable thread locking
on EVP_RAND_CTX
- the function remains but is not used in case requirements change
with OpenSSL >= 3.2
(cherry-pick from 8dffc45ee91aeed839efb38d17040359dcac953a)
commit c5ed0e65b2530443b1367986dac2b3da111c0701
Author: S-P Chan <shihping.chan@gmail.com>
Date: Thu Jan 11 08:03:07 2024 +0800
tls: historical code comment on repeating SSL_CTX per worker
(cherry-pick from 29007ada5bc9e07ede3cdbce285f04d1298c0612)
commit 1eb1d50e676fe8f81521c209f37ffe907fa9cf94
Author: S-P Chan <shihping.chan@gmail.com>
Date: Fri Jan 5 20:56:39 2024 +0800
outbound: build, fix missing argument name
(cherry-pick from 4708f537d7f5d28123b48cd89474a4931dd698ad)
commit fe0968687d5ee7918f6a18591623fcb1b5fe2004
Author: S-P Chan <shihping.chan@gmail.com>
Date: Thu Jan 4 21:47:23 2024 +0800
outbound: OpenSSL 1.1.1 thread-local, init libssl in thread
(cherry-pick from 689de2736f5c92f11860e5854ccd95c84239f032)
commit 31e42aade0a42aac8a128a4af3f37edb23bb3ab8
Author: S-P Chan <shihping.chan@gmail.com>
Date: Thu Jan 4 20:11:21 2024 +0800
outbound: OpenSSL 3.x thread-local, init libssl in thread
(cherry-pick from 4742c8131aba878c4fc954e42b656b9d4bafdd24)
commit 7060ad2b0ebf90288be9d8d7e9d789ccbb3aebdc
Author: S-P Chan <shihping.chan@gmail.com>
Date: Fri Jan 5 07:38:56 2024 +0800
tls: OpenSSL 3.x/1.1.1 thread-local, clean-up dead code and preprocessor blocks
(cherry-pick from 798cc26908395d2ba21015684ad6f0ac4f012b2e)
commit e73b07e9835ba5f0b89065616d8cd6390898d700
Author: S-P Chan <shihping.chan@gmail.com>
Date: Fri Jan 5 08:09:34 2024 +0800
tls: thread-local, revert 1a9b0b6361 as double-layer locking is redundant
- the 2nd lock was put in place as defensive programming for shm contention
- GH #3695: the underlying issue is early init of thread-locals
(cherry-pick from 1c70775530b1a3a905e8a983610cb0d092b0d240)
commit c011f518b083fc2f7da3a08a2c1a306c6122b04c
Author: S-P Chan <shihping.chan@gmail.com>
Date: Thu Jan 4 21:56:00 2024 +0800
tls: OpenSSL 1.1.1 thread-local, init libssl in thread
- no need for RAND workaround; default is OpenSSL 1.1.1 RAND
- linux/pthreads will handle forking
(cherry-pick from 7b531cfe038fae5e3414ac74c4e076c10e32b86c)
commit 90ea4120c04cb70f858f417309ee4fab71a070e7
Author: S-P Chan <shihping.chan@gmail.com>
Date: Thu Jan 4 21:51:15 2024 +0800
tls: fix compilation with OpenSSL <= 1.1.1
(cherry-pick from 7111687e1107261bcdd7a9f8cc90959754c93272)
commit ed2d70359723458089dd8a62fe1e37a60dd83869
Author: S-P Chan <shihping.chan@gmail.com>
Date: Thu Jan 4 20:00:09 2024 +0800
tls: OpenSSL 3.x thread-local, init libssl in thread or PROC_SIPINIT
- avoid initialising ERR_STATE in rank 0(thread#1)
(cherry-pick from e49a60e1052c6c1dcebe7f78f2ac970338eabe2e)
commit bfc63986ae7239a64803b8f20f634522bc584948
Author: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Tue Dec 12 15:38:33 2023 +0100
pkg/kamailio/deb: override lintian error on stretch [skip ci]
(cherry picked from commit aaeb54c8b630b4aac50df75ff430ad5baea6746c)
commit 75aecd3f2e10509d5ed71cc5e89ae6f5c3bd0fea
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Dec 12 13:08:18 2023 +0100
pv: remove extra len increment for some uri transformations
(cherry picked from commit 3fe9a279abecf6f367ce9fd2d4b085c41c87ad77)
commit 8674b333300d5829bff9cb4993886bcf7bea249b
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Dec 8 22:10:36 2023 +0100
core: parse privacy recompute lenght of rest to parse
(cherry picked from commit 804ee651b45498727196886c97cb55d20b254c4a)
commit b634dc7f4d8f1653502328488f0dded134547b54
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Dec 8 12:34:56 2023 +0100
tls: init early the local lock for memory
- needed to done before mod param init_mode is set
- runtime uses the modparam to do lock/unlock
- #3668
(cherry picked from commit 1a9b0b63617afebcee2aecb3b2240d7684ecabc2)
commit 63e8749132257ef1f8c8d86ec78f6db2c699f1c8
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Dec 7 13:00:50 2023 +0100
tls: rework init mode 1 to set PTHREAD_PROCESS_SHARED
- pthread mutex set in shm
- GH #3635
(cherry picked from commit 4b068f49b618dca5fa85a1687bd9054c1d98ae6a)
commit b29d5808505aa072fd23b59adf7943fb13ea98a2
Author: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed Nov 29 17:21:59 2023 +0100
Makefile.groups: fix ktls when KTLS_INCLUDE_TLSA is not set
fix #3660
(cherry picked from commit aef29af56cabaf626e2ae552ae69c3cd2f692a27)
commit 0d028d9a4900411856a64ab31f81f57e3fc68099
Author: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Fri Nov 24 14:21:27 2023 +0100
pkg/kamailio/deb: include tlsa in tls package [skip ci]
* skip xenial since build fails
commit 7f07a6ef9ae90baee4281394d0dcf505b30c8fcb
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Nov 24 10:38:49 2023 +0100
Makefile.groups: tlsa in packaging group ktls if KTLS_INCLUDE_TLSA=yes
- if not, then it is in separate group module_group_ktlsa
(cherry picked from commit a49c8d8d968e31a539e47db6c06a0756e4be55e3)
commit 1de0032363ffb0fb6e257497a173f70deac58525
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:48 2023 +0100
websocket: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 93609b53d70df84788741800fc2b80c5502a3358)
commit 292c8764b22d3cdb78a85f101b0359424d138d5d
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
usrloc: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 186ae3eef7f3e1b5ad6222c98a2f35a487deb316)
commit bf665fc6d398009a0643cb60f9dad95f66cdb17c
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
tsilo: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit a9d29645ab417c9b0f7afc6745e6dd54bdac07b4)
commit d5829f56bfc36133ba6db124bf738a6b9a90c904
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
tmx: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit d4c0e1bbcb0e423a545650aad4fbb4b2da8bb488)
commit 21abe7ab16d450f1b085a97a4c0f416d45ac2daf
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
sst: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 96bdd69945af9f08e6c89fb725248b8b268ee71a)
commit 9a768e006eb0b6ab508ebc5385690eb87711e14f
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
siptrace: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 92cdcb4bd280850743b3a952f1b6003be69daaf2)
commit 9a658e0533e592641f86db037eb398ae34f65848
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
sipcapture: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 01abed3ef17f6a5f0f215675a2980f0b9a4267fd)
commit 1467f7517b6256a712eeb93288561934477f36a4
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
registrar: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 0516fb802628ddb659a130aa2959df5b0b8e0c96)
commit 59c32aef1e40edcfb081a18728b4e6029d2d2be8
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
p_usrloc: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit a951cb44ecbcd0f9cba937176ea5117c6a1d15b6)
commit 21f4e3c9ce4a6d7ae87ad746742b283dde621a50
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
nat_traversal: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit f35f327a528670dcca0d7a767643a222f1aebd89)
commit 51937a32b205288ebeddfac7c4310b1f3ce698e7
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
msilo: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 609960812c572d2d19ba774b064fdf7e2ac45765)
commit 876fa1d0667acb2c46e5b8643cdb994546e45b21
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
ims_usrloc_pcscf: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit d29b3d6515f74d4cd7417dc9030d8ca53d57054e)
commit e96ecec877f2f9bc13000c7bd752ed8f1ec41935
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
ims_registrar_scscf: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 641d29820f8536247c49d5fb4caa882764dbd9af)
commit b5a2b0c782a18cd807d6d4851baa9be2bd299a0c
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
ims_icscf: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 39514660001b37eabfe3af6818949586fae9a4bf)
commit 6f3f297ea64a8fed4c77fdaf2abc90e468f6443c
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
ims_auth: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 524eeca084e0a0e61ad80f349ea79f8b1c3031f6)
commit c8a09510204e7d0ed9e486f4dc871353f1820866
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
imc: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 407168804cc1806b857c2ce78399e02a81692d1e)
commit 583a403d58c3e0e0b64a354d2e5fe4a28192403f
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
http_async_client: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit 40dd9f4e0fbe54046b7786e3572b491103af03d1)
commit d343b6d99cdb9a23ec5bfa332a34245cdce4c3af
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Nov 23 12:35:47 2023 +0100
dialog: use literal module name for stats group
- prevent conflicts with global exports
(cherry picked from commit d434270933f06b4de43cdf6d4b464bd264a3cb92)
commit 84b1543cf7b77bfffba0c3e6369b4cb06bf149b5
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Nov 22 14:52:59 2023 +0100
dialog: do not print module name in log messages
- it is added automatically
(cherry picked from commit e45c97d112c7c396ae0a11b7a431582a71361e5b)
commit 48fd5246c186524413d452032320378d9c87afc4
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Nov 22 14:52:18 2023 +0100
avp: do not print module name in log messages
- it is added automatically
(cherry picked from commit 463d5b34390e330a2b733deb673c1c77e5be9fcb)
commit c97e6b96821f0ffaf449643ed2229086b7bf0001
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Nov 22 14:26:23 2023 +0100
avpops: do not print module name in log messages
- it is added automatically
(cherry picked from commit 89a95ce1abefd772c0f09054473b07bbfc5426bc)
commit 3ab5e87f2e162704a261c3a45eeb5c000b6ddb99
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Nov 22 14:20:13 2023 +0100
textops: do not print module name in log messages
- it is added automatically
(cherry picked from commit ba1c0424732f1f2ab01bfd078ee272221a6b3e10)
commit 069876708076154387a599bf039edd83f5067974
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Nov 22 14:02:59 2023 +0100
app_ruby: use module name prefix for exports structure
(cherry picked from commit 65322a8ea66ed18fb2d089ade54702341e064944)
commit 8c5a7a8db1309515a1d2f167754a4ee046684569
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Nov 22 13:59:14 2023 +0100
app_jsdt: use module name prefix for exports structure
(cherry picked from commit a81e3c45dad338378fc8cf417bb0e9da1172a854)
commit 2442079e05b410cc9393fd15daf1f94169f80139
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 15:43:11 2023 +0100
app_lua: use module name prefix for exports structure
(cherry picked from commit 35e191e1bea5463e766cb6f8f2ffb4862bd812a8)
commit ef9c5e79b6923401a686c31a15af390e376e63e3
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 15:39:21 2023 +0100
app_lua: reformat exports structures
(cherry picked from commit c6feb52c97bbd3fc33dc837d2b23e56c75f09583)
commit d38cc3c15698b554c177e77e05f7393ae6a1baa7
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 15:35:04 2023 +0100
app_python3s: use module name prefix for exports structure
(cherry picked from commit ebe77a2068c5073b436a1f8fefdfd689c9010816)
commit 340efb9e3951fb4d15ae32e834ac58470b2c06f1
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 15:32:57 2023 +0100
app_python3s: reformat exports structures
(cherry picked from commit 9fb9cbddee8974a1733b999807cc1943248753f7)
commit 986cadb088805f5126c61d55fc0b72cec6fd3d18
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 15:29:49 2023 +0100
app_python3: use module name prefix for exports structure
(cherry picked from commit 114d6fe510d7c1876782054ed89e4017d39d5f69)
commit 4d04bafdba440b82a7da8424682b06db23721c8f
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 15:26:23 2023 +0100
app_python3: reformat exports structures
(cherry picked from commit 042bb9d10e12a256f9e4461031347e09b89fbe98)
commit d2f5603aff1bad106340b024d4a33f2be7791980
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 15:14:39 2023 +0100
core: resolve - variables initialisation
(cherry picked from commit 1623f9ed1728455b72abf0a74f06bfd24365cefb)
commit 55584b4de5ac60a1385edf245fc7f5bb516c271e
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 13:57:52 2023 +0100
core/mem: tlsf - cast to char* for pointer operations
(cherry picked from commit d0a353342b559191aafc732174773e132554694a)
commit 8779039f655e6cdc27c35a0145985de00ecef81e
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Nov 21 13:30:26 2023 +0100
core: resolve - cast after pointer operations for RES_AR
(cherry picked from commit 30c42aab767d777e3beb1493165458489957e92d)
commit 9b72b6dd4ffcf67f47f9d51c862e7a101c110c3f
Author: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu Nov 23 13:29:15 2023 +0100
github: refresh alpine workflow [skip ci]
commit 7ea47e5fc72d08384223fb479f6bcc098e236990
Author: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu Nov 23 13:27:51 2023 +0100
pkg/docker: set branch 5.7 and refresh [skip ci]
===================== 2023-11-17 Version 5.7.3 Released =====================
===================== Changes Since Version 5.7.2 ===========================

@ -4,7 +4,7 @@
# Maintainer: Nathan Angelacos <nangel@alpinelinux.org>
pkgname=kamailio
pkgver=5.7.3
pkgver=5.7.4
pkgrel=0
# If building from a git snapshot, specify the gitcommit

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -44,6 +44,9 @@ sed -i -e '/^ libnats-dev,/d' \
sed -i -e '/^PACKAGE_GROUPS += nats/d' ${DIST}/rules
sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += nats' ${DIST}/rules
# tlsa build fails
sed -i -e 's/KTLS_INCLUDE_TLSA=yes/KTLS_INCLUDE_TLSA=no/' ${DIST}/rules
wrap-and-sort -sat -d ${DIST}
# clean backports scripts

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -19,6 +19,10 @@ endif
export JAVA_HOME=/usr/lib/jvm/java-gcj
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -19,6 +19,10 @@ endif
export JAVA_HOME=/usr/lib/jvm/java-gcj
export FREERADIUS=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export JAVA_HOME=/usr/lib/jvm/java-gcj
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -19,6 +19,10 @@ endif
export JAVA_HOME=/usr/lib/jvm/java-gcj
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -19,6 +19,10 @@ endif
export JAVA_HOME=/usr/lib/jvm/java-gcj
export FREERADIUS=1
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -18,6 +18,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
export JAVA_HOME=/usr/lib/jvm/java-gcj
# tlsa
export KTLS_INCLUDE_TLSA=yes
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,3 +1,9 @@
kamailio (5.7.4) unstable; urgency=medium
* version set 5.7.4
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
kamailio (5.7.3) unstable; urgency=medium
* version set 5.7.3

@ -1,2 +1,4 @@
kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
kamailio-tls-modules binary: library-not-linked-against-libc
# error only on stretch
kamailio-tls-modules binary: embedded-library

@ -19,6 +19,10 @@ endif
export JAVA_HOME=/usr/lib/jvm/java-gcj
export RADCLI=1
# tlsa
export KTLS_INCLUDE_TLSA=no
export LIBSSL_STATIC_SRCLIB=yes
export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
# Modules not in the "main" kamailio package:
EXCLUDED_MODULES =

@ -1,5 +1,5 @@
%define name kamailio
%define ver 5.7.3
%define ver 5.7.4
%define rel dev1.0%{dist}
%if 0%{?fedora}

@ -106,7 +106,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
# version number
VERSION = 5
PATCHLEVEL = 7
SUBLEVEL = 3
SUBLEVEL = 4
EXTRAVERSION =
# memory manager switcher

@ -88,12 +88,12 @@ mod_list_memcached=memcached
# - modules depending on openssl library
mod_list_tlsdeps=crypto tls
# - modules depending on openssl (+curl) library
mod_list_tlsdeps_curl=auth_identity
# - modules depending on static openssl library
mod_list_tlsa=tlsa
# - modules depending on openssl (+curl) library
mod_list_tlsdeps_curl=auth_identity
# - modules depending on static wolfssl library
mod_list_tls_wolfssl=tls_wolfssl
@ -403,11 +403,16 @@ module_group_kmemcached=$(mod_list_memcached)
# pkg tls module
module_group_ktls_basic=$(mod_list_tlsdeps)
ifeq ($(KTLS_INCLUDE_TLSA),yes)
# pkg tls module with curl
module_group_ktls=$(mod_list_tlsdeps) $(mod_list_tlsdeps_curl) $(mod_list_tlsa)
else
# pkg tls module with curl
module_group_ktls=$(mod_list_tlsdeps) $(mod_list_tlsdeps_curl)
# pkg tlsa module
module_group_ktlsa=$(mod_list_tlsa)
endif
# pkg tls_wolfssl module
module_group_ktls_wolfssl=$(mod_list_tls_wolfssl)
@ -538,4 +543,3 @@ module_group_krtp_media_server=$(mod_list_rtp_media_server)
# list of static modules
#
static_modules:=

@ -2,6 +2,6 @@
* DO NOT EDIT IT
*/
#define REPO_VER "e4d96b"
#define REPO_HASH "e4d96b"
#define REPO_VER "dc393e"
#define REPO_HASH "dc393e"
#define REPO_STATE ""

@ -1058,9 +1058,10 @@ void tlsf_free(tlsf_t tlsf, void *ptr)
control->allocated -= block_size(block);
control->real_used -=
(block_size(block)
+ (ptr
- (void *)block
/* prev_phys_block is melted in the previous block when the current block is used */
+ ((char *)ptr
- (char *)block
/* prev_phys_block is melted in the previous
* block when the current block is used */
+ sizeof(block->prev_phys_block)));
#ifdef DBG_TLSF_MALLOC
block->alloc_info.file = file;

@ -178,14 +178,13 @@ int parse_privacy(struct sip_msg *msg)
values = 0;
p = next.s;
len = next.len;
beyond = p + len;
beyond = next.s + next.len;
while(p < beyond) {
len = beyond - p;
if((val_len = parse_priv_value(p, len, &value)) != 0) {
values |= value;
p = p + val_len;
len = len - val_len;
} else {
LM_ERR("invalid privacy value\n");
return -1;

@ -1026,7 +1026,7 @@ again:
/* check if enough space is left for type, class, ttl & size */
if(unlikely((p + 2 + 2 + 4 + 2) > end))
goto error_boundary;
memcpy((void *)&rdlength, (void *)p + 2 + 2 + 4, 2);
memcpy((void *)&rdlength, (void *)(p + 2 + 2 + 4), 2);
p += 2 + 2 + 4 + 2 + ntohs(rdlength);
}
answers_no = ntohs((unsigned short)buff.hdr.arcount);
@ -1511,7 +1511,7 @@ size_t create_srv_pref_list(char *proto, struct dns_srv_proto *list)
{
struct dns_srv_proto tmp;
size_t i, j, list_len;
int default_order, max;
int default_order = 1, max;
/* if proto available, then add only the forced protocol to the list */
if(proto && *proto != PROTO_NONE) {
@ -1661,7 +1661,7 @@ struct hostent *naptr_sip_resolvehost(
char n_proto;
str srv_name;
naptr_bmp_t tried_bmp; /* tried bitmap */
char origproto;
char origproto = PROTO_NONE;
if(proto)
origproto = *proto;

@ -619,6 +619,7 @@ int fix_actions(struct action *a)
enum rval_type rve_type, err_type, expected_type;
struct rvalue *rv;
int rve_param_no;
int proto;
if(a == 0) {
LM_CRIT("null pointer\n");
@ -646,8 +647,23 @@ int fix_actions(struct action *a)
case STRING_ST:
s.s = t->val[0].u.string;
s.len = strlen(s.s);
p = add_proxy(
&s, t->val[1].u.number, 0); /* FIXME proto*/
switch(t->type) {
case FORWARD_TCP_T:
proto = PROTO_TCP;
break;
case FORWARD_TLS_T:
proto = PROTO_TCP;
break;
case FORWARD_SCTP_T:
proto = PROTO_TCP;
break;
case FORWARD_UDP_T:
proto = PROTO_TCP;
break;
default:
proto = 0;
}
p = add_proxy(&s, t->val[1].u.number, proto);
if(p == 0) {
ret = E_BAD_ADDRESS;
goto error;
@ -1543,6 +1559,11 @@ inline static int comp_rve(int op, struct rval_expr *rve, int rtype,
if(unlikely(rv)) {
/* no int => str */
rv1 = rval_convert(h, msg, RV_STR, rv, &c1);
if(rv1 == NULL) {
LM_ERR("failure converting expression\n");
i = 0; /* false */
goto int_expr;
}
i = comp_str(op, &rv1->v.s, rtype, r, msg, h);
rval_destroy(rv1);
rval_destroy(rv);

@ -359,11 +359,13 @@ static inline struct socket_info *new_sock_info(char *name,
he = resolvehost(si->useinfo.name.s);
if(he == 0) {
LM_ERR("unable to resolve advertised name %s\n",
LM_WARN("unable to resolve advertised name %s\n",
si->useinfo.name.s);
goto error;
si->useinfo.address.len = 0;
si->useinfo.address.af = 0;
} else {
hostent2ip_addr(&si->useinfo.address, he, 0);
}
hostent2ip_addr(&si->useinfo.address, he, 0);
}
return si;
error:

@ -1018,12 +1018,12 @@ int tcpconn_read_haproxy(struct tcp_connection *c)
src_ip->af = AF_INET;
src_ip->len = 4;
src_ip->u.addr32[0] = hdr.v2.addr.ip4.src_addr;
c->rcv.src_port = hdr.v2.addr.ip4.src_port;
c->rcv.src_port = htons(hdr.v2.addr.ip4.src_port);
dst_ip->af = AF_INET;
dst_ip->len = 4;
dst_ip->u.addr32[0] = hdr.v2.addr.ip4.dst_addr;
c->rcv.dst_port = hdr.v2.addr.ip4.dst_port;
c->rcv.dst_port = htons(hdr.v2.addr.ip4.dst_port);
goto done;
@ -1031,12 +1031,12 @@ int tcpconn_read_haproxy(struct tcp_connection *c)
src_ip->af = AF_INET6;
src_ip->len = 16;
memcpy(src_ip->u.addr, hdr.v2.addr.ip6.src_addr, 16);
c->rcv.src_port = hdr.v2.addr.ip6.src_port;
c->rcv.src_port = htons(hdr.v2.addr.ip6.src_port);
dst_ip->af = AF_INET6;
dst_ip->len = 16;
memcpy(dst_ip->u.addr, hdr.v2.addr.ip6.src_addr, 16);
c->rcv.dst_port = hdr.v2.addr.ip6.dst_port;
memcpy(dst_ip->u.addr, hdr.v2.addr.ip6.dst_addr, 16);
c->rcv.dst_port = htons(hdr.v2.addr.ip6.dst_port);
goto done;

@ -272,7 +272,10 @@ static const char *parse_string(
*ptr2++ = '\t';
break;
case 'u': /* transcode utf16 to utf8. */
sscanf(ptr + 1, "%4x", &uc);
uc = 0;
if(sscanf(ptr + 1, "%4x", &uc) < 1) {
break;
}
ptr += 4; /* get the unicode char. */
if((uc >= 0xDC00 && uc <= 0xDFFF) || uc == 0)
@ -283,8 +286,11 @@ static const char *parse_string(
{
if(ptr[1] != '\\' || ptr[2] != 'u')
break;
uc2 = 0;
//missing second - half of surrogate.
sscanf(ptr + 3, "%4x", &uc2);
if(sscanf(ptr + 3, "%4x", &uc2) < 1) {
break;
}
ptr += 6;
if(uc2 < 0xDC00 || uc2 > 0xDFFF)
break;

@ -1158,7 +1158,8 @@ int xavp_serialize_fields(str *rname, char *obuf, int olen)
}
break;
default:
LM_DBG("skipping value type: %d\n", avp->val.type);
LM_INFO("skipping field [%.*s] value type: %d\n", avp->name.len,
avp->name.s, avp->val.type);
ostr.len = 0;
}
if(ostr.len > 0) {
@ -1628,7 +1629,8 @@ int xavu_serialize_fields(str *rname, char *obuf, int olen)
}
break;
default:
LM_DBG("skipping value type: %d\n", avu->val.type);
LM_INFO("skipping field [%.*s] value type: %d\n", avu->name.len,
avu->name.s, avu->val.type);
ostr.len = 0;
}
if(ostr.len > 0) {
@ -2591,7 +2593,8 @@ int xavi_serialize_fields(str *rname, char *obuf, int olen)
}
break;
default:
LM_DBG("skipping value type: %d\n", avi->val.type);
LM_INFO("skipping field [%.*s] value type: %d\n", avi->name.len,
avi->name.s, avi->val.type);
ostr.len = 0;
}
if(ostr.len > 0) {

@ -84,7 +84,7 @@ static param_export_t params[]={
{0, 0, 0}
};
struct module_exports exports = {
struct module_exports _app_jsdt_exports = {
"app_jsdt", /* module name */
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* exported functions */

@ -62,40 +62,48 @@ int app_lua_reload_param(modparam_t type, void *val);
int _ksr_app_lua_log_mode = 0;
/* clang-format off */
static param_export_t params[] = {
{"load", PARAM_STRING | USE_FUNC_PARAM, (void *)app_lua_load_param},
{"reload", INT_PARAM | USE_FUNC_PARAM, (void *)app_lua_reload_param},
{"log_mode", PARAM_INT, &_ksr_app_lua_log_mode}, {0, 0, 0}};
static cmd_export_t cmds[] = {{"lua_dostring", (cmd_function)w_app_lua_dostring,
1, fixup_spve_null, 0, ANY_ROUTE},
{"lua_dofile", (cmd_function)w_app_lua_dofile, 1, fixup_spve_null, 0,
ANY_ROUTE},
{"lua_runstring", (cmd_function)w_app_lua_runstring, 1, fixup_spve_null,
0, ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run0, 1, fixup_lua_run, 0,
ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run1, 2, fixup_lua_run, 0,
ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run2, 3, fixup_lua_run, 0,
ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run3, 4, fixup_lua_run, 0,
ANY_ROUTE},
{"bind_app_lua", (cmd_function)bind_app_lua, 0, 0, 0, ANY_ROUTE},
{0, 0, 0, 0, 0, 0}};
struct module_exports exports = {
"app_lua", DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /*·exported·functions·*/
params, /*·exported·params·*/
0, /*·exported·RPC·methods·*/
0, /* exported pseudo-variables */
0, /*·response·function·*/
mod_init, /* initialization module*/
child_init, /* per child init function */
mod_destroy /* destroy function */
{"load", PARAM_STRING | USE_FUNC_PARAM, (void *)app_lua_load_param},
{"reload", INT_PARAM | USE_FUNC_PARAM, (void *)app_lua_reload_param},
{"log_mode", PARAM_INT, &_ksr_app_lua_log_mode},
{0, 0, 0}
};
static cmd_export_t cmds[] = {
{"lua_dostring", (cmd_function)w_app_lua_dostring, 1,
fixup_spve_null, 0, ANY_ROUTE},
{"lua_dofile", (cmd_function)w_app_lua_dofile, 1,
fixup_spve_null, 0, ANY_ROUTE},
{"lua_runstring", (cmd_function)w_app_lua_runstring, 1,
fixup_spve_null, 0, ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run0, 1,
fixup_lua_run, 0, ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run1, 2,
fixup_lua_run, 0, ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run2, 3,
fixup_lua_run, 0, ANY_ROUTE},
{"lua_run", (cmd_function)w_app_lua_run3, 4,
fixup_lua_run, 0, ANY_ROUTE},
{"bind_app_lua", (cmd_function)bind_app_lua, 0,
0, 0, ANY_ROUTE},
{0, 0, 0, 0, 0, 0}
};
struct module_exports _app_lua_exports = {
"app_lua", /* module name */
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* exported functions */
params, /* exported params */
0, /* exported RPC methods */
0, /* exported pseudo-variables */
0, /* response function */
mod_init, /* initialization module */
child_init, /* per child init function */
mod_destroy /* destroy function */
};
/* clang-format on */
/**
*
*/

@ -61,35 +61,41 @@ int _apy_process_rank = 0;
PyThreadState *myThreadState;
/* clang-format off */
/** module parameters */
static param_export_t params[] = {
{"script_name", PARAM_STR, &_sr_python_load_file},
{"load", PARAM_STR, &_sr_python_load_file},
{"mod_init_function", PARAM_STR, &mod_init_fname},
{"child_init_method", PARAM_STR, &child_init_mname}, {0, 0, 0}};
{"script_name", PARAM_STR, &_sr_python_load_file},
{"load", PARAM_STR, &_sr_python_load_file},
{"mod_init_function", PARAM_STR, &mod_init_fname},
{"child_init_method", PARAM_STR, &child_init_mname},
{0, 0, 0}
};
/*
* Exported functions
*/
static cmd_export_t cmds[] = {{"python_exec", (cmd_function)python_exec1, 1,
fixup_spve_null, 0, ANY_ROUTE},
{"python_exec", (cmd_function)python_exec2, 2, fixup_spve_spve, 0,
ANY_ROUTE},
{0, 0, 0, 0, 0, 0}};
static cmd_export_t cmds[] = {
{"python_exec", (cmd_function)python_exec1, 1,
fixup_spve_null, 0, ANY_ROUTE},
{"python_exec", (cmd_function)python_exec2, 2,
fixup_spve_spve, 0, ANY_ROUTE},
{0, 0, 0, 0, 0, 0}
};
/** module exports */
struct module_exports exports = {
"app_python3", /* module name */
RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */
cmds, /* exported functions */
params, /* exported parameters */
0, /* exported rpc functions */
0, /* exported pseudo-variables */
0, /* response handling function */
mod_init, /* module init function */
child_init, /* per-child init function */
mod_destroy /* destroy function */
struct module_exports _app_python3_exports = {
"app_python3", /* module name */
RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */
cmds, /* exported functions */
params, /* exported parameters */
0, /* exported rpc functions */
0, /* exported pseudo-variables */
0, /* response handling function */
mod_init, /* module init function */
child_init, /* per-child init function */
mod_destroy /* destroy function */
};
/* clang-format on */
/**

@ -567,6 +567,12 @@ static PyObject *init_KSR(void)
emods[k].kexp[0].mname.s);
PyModuleDef *mmodule = malloc(sizeof(PyModuleDef));
if(mmodule == NULL) {
LM_ERR("failed to allocate system memory\n");
free(_sr_KSRMethods);
_sr_KSRMethods = NULL;
return NULL;
}
memset(mmodule, 0, sizeof(PyModuleDef));
mmodule->m_name = strndup(mname, 127);
mmodule->m_methods = _sr_crt_KSRMethods;

@ -60,37 +60,42 @@ PyThreadState *myThreadState = NULL;
int apy3s_script_init_exec(PyObject *pModule, str *fname, int *vparam);
/* clang-format off */
/** module parameters */
static param_export_t params[] = {{"load", PARAM_STR, &_sr_python_load_file},
{"script_init", PARAM_STR, &_sr_apy3s_script_init},
{"script_child_init", PARAM_STR, &_sr_apy3s_script_child_init},
static param_export_t params[] = {
{"load", PARAM_STR, &_sr_python_load_file},
{"script_init", PARAM_STR, &_sr_apy3s_script_init},
{"script_child_init", PARAM_STR, &_sr_apy3s_script_child_init},
{0, 0, 0}};
{0, 0, 0}
};
/*
* Exported functions
*/
static cmd_export_t cmds[] = {
{"app_python3s_exec", (cmd_function)w_app_python3s_exec1, 1,
fixup_spve_null, 0, ANY_ROUTE},
{"app_python3s_exec", (cmd_function)w_app_python3s_exec2, 2,
fixup_spve_spve, 0, ANY_ROUTE},
{"app_python3s_exec", (cmd_function)w_app_python3s_exec1, 1,
fixup_spve_null, 0, ANY_ROUTE},
{"app_python3s_exec", (cmd_function)w_app_python3s_exec2, 2,
fixup_spve_spve, 0, ANY_ROUTE},
{0, 0, 0, 0, 0, 0}};
{0, 0, 0, 0, 0, 0}
};
/** module exports */
struct module_exports exports = {
"app_python3s", /* module name */
RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */
cmds, /* exported functions */
params, /* exported parameters */
0, /* exported rpc functions */
0, /* exported pseudo-variables */
0, /* response handling function */
mod_init, /* module init function */
child_init, /* per-child init function */
mod_destroy /* destroy function */
struct module_exports _app_python3s_exports = {
"app_python3s", /* module name */
RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */
cmds, /* exported functions */
params, /* exported parameters */
0, /* exported rpc functions */
0, /* exported pseudo-variables */
0, /* response handling function */
mod_init, /* module init function */
child_init, /* per-child init function */
mod_destroy /* destroy function */
};
/* clang-format on */
/**

@ -86,7 +86,7 @@ static param_export_t params[]={
{0, 0, 0}
};
struct module_exports exports = {
struct module_exports _app_ruby_exports = {
"app_ruby",
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* exported functions */

@ -1704,6 +1704,6 @@ select_row_t sel_declaration[] = {{NULL, SEL_PARAM_STR, STR_STATIC_INIT("avp"),
static int mod_init()
{
DBG("%s - initializing\n", exports.name);
DBG("initializing\n");
return register_select_table(sel_declaration);
}

@ -810,12 +810,12 @@ static int fixup_subst(void **param, int param_no)
}
*param = (void *)av;
} else if(param_no == 2) {
LM_DBG("%s fixing %s\n", exports.name, (char *)(*param));
LM_DBG("fixing: %s\n", (char *)(*param));
subst.s = *param;
subst.len = strlen(*param);
se = subst_parser(&subst);
if(se == 0) {
LM_ERR("%s: bad subst re %s\n", exports.name, (char *)*param);
LM_ERR("bad subst re: %s\n", (char *)*param);
return E_BAD_RE;
}
/* don't free string -- needed for specifiers */

@ -551,8 +551,8 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(dlg_enable_stats
&& (register_module_stats(exports.name, mod_stats) != 0)) {
LM_ERR("failed to register %s statistics\n", exports.name);
&& (register_module_stats("dialog", mod_stats) != 0)) {
LM_ERR("failed to register statistics\n");
return -1;
}
#endif

@ -509,6 +509,9 @@ int load_dialog_info_from_db(
get_ticks());
dlg->dflags = 0;
if(mode == 0 && dlg_db_mode == DB_MODE_SHUTDOWN) {
dlg->dflags |= DLG_FLAG_NEW;
}
if(mode != 0) {
if(loaded_extra < DLG_MAX_DB_LOAD_EXTRA) {

@ -535,6 +535,7 @@ int dlg_dmq_replicate_action(dlg_dmq_action_t action, dlg_cell_t *dlg,
&jdoc, jdoc.root, "to_uri", dlg->to_uri.s, dlg->to_uri.len);
srjson_AddStrToObject(&jdoc, jdoc.root, "req_uri", dlg->req_uri.s,
dlg->req_uri.len);
srjson_AddStrToObject(
&jdoc, jdoc.root, "tag1", dlg->tag[0].s, dlg->tag[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "cseq1", dlg->cseq[0].s,
@ -578,14 +579,16 @@ int dlg_dmq_replicate_action(dlg_dmq_action_t action, dlg_cell_t *dlg,
srjson_AddNumberToObject(
&jdoc, jdoc.root, "lifetime", dlg->lifetime);
srjson_AddStrToObject(&jdoc, jdoc.root, "tag1",
dlg->tag[0].s, dlg->tag[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "cseq1",
dlg->cseq[0].s, dlg->cseq[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "route_set1",
dlg->route_set[0].s, dlg->route_set[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "contact1",
dlg->contact[0].s, dlg->contact[0].len);
if(action != DLG_DMQ_UPDATE) {
srjson_AddStrToObject(&jdoc, jdoc.root, "tag1",
dlg->tag[0].s, dlg->tag[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "cseq1",
dlg->cseq[0].s, dlg->cseq[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "route_set1",
dlg->route_set[0].s, dlg->route_set[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "contact1",
dlg->contact[0].s, dlg->contact[0].len);
}
break;
case DLG_STATE_CONFIRMED:
srjson_AddNumberToObject(
@ -593,23 +596,24 @@ int dlg_dmq_replicate_action(dlg_dmq_action_t action, dlg_cell_t *dlg,
srjson_AddNumberToObject(
&jdoc, jdoc.root, "lifetime", dlg->lifetime);
srjson_AddStrToObject(&jdoc, jdoc.root, "tag1",
dlg->tag[0].s, dlg->tag[0].len);
if(action != DLG_DMQ_UPDATE) {
srjson_AddStrToObject(&jdoc, jdoc.root, "tag1",
dlg->tag[0].s, dlg->tag[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "cseq1",
dlg->cseq[0].s, dlg->cseq[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "route_set1",
dlg->route_set[0].s, dlg->route_set[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "contact1",
dlg->contact[0].s, dlg->contact[0].len);
}
srjson_AddStrToObject(&jdoc, jdoc.root, "tag2",
dlg->tag[1].s, dlg->tag[1].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "cseq1",
dlg->cseq[0].s, dlg->cseq[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "cseq2",
dlg->cseq[1].s, dlg->cseq[1].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "route_set1",
dlg->route_set[0].s, dlg->route_set[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "route_set2",
dlg->route_set[1].s, dlg->route_set[1].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "contact1",
dlg->contact[0].s, dlg->contact[0].len);
srjson_AddStrToObject(&jdoc, jdoc.root, "contact2",
dlg->contact[1].s, dlg->contact[1].len);
break;
case DLG_STATE_DELETED:
//dlg->iflags &= ~DLG_IFLAG_DMQ_SYNC;

@ -383,6 +383,14 @@ static inline int send_bye(struct dlg_cell *cell, int dir, str *hdrs)
dlg_iuid_t *iuid = NULL;
str lhdrs;
/* dialog is already in deleted state, nothing to do */
if(cell->state == DLG_STATE_DELETED) {
LM_WARN("dlg [%u:%u] with callid %.*s already in deleted state, BYE "
"not sent.\n",
cell->h_entry, cell->h_id, cell->callid.len, cell->callid.s);
return 0;
}
/* Send Cancel or final response for non-confirmed dialogs */
if(cell->state != DLG_STATE_CONFIRMED_NA
&& cell->state != DLG_STATE_CONFIRMED) {

@ -667,8 +667,8 @@ int pv_set_dlg_ctx(
break;
case 4:
if(val && val->flags & PV_VAL_STR) {
if(val->rs.s[val->rs.len] == '\0'
&& val->rs.len < DLG_TOROUTE_SIZE) {
if(val->rs.len < DLG_TOROUTE_SIZE
&& val->rs.s[val->rs.len] == '\0') {
_dlg_ctx.to_route = route_lookup(&main_rt, val->rs.s);
strcpy(_dlg_ctx.to_route_name, val->rs.s);
} else {

@ -1628,7 +1628,8 @@ static void htable_rpc_seti(rpc_t *rpc, void *c)
int_str keyvalue;
ht_t *ht;
if(rpc->scan(c, "SS.d", &htname, &keyname, &keyvalue.n) < 3) {
keyvalue.n = 0;
if(rpc->scan(c, "SSl", &htname, &keyname, &keyvalue.n) < 3) {
rpc->fault(c, 500,
"Not enough parameters (htable name, key name and value)");
return;
@ -1665,7 +1666,7 @@ static void htable_rpc_setex(rpc_t *rpc, void *c)
int exval;
ht_t *ht;
if(rpc->scan(c, "SS.d", &htname, &itname, &exval) < 3) {
if(rpc->scan(c, "SSd", &htname, &itname, &exval) < 3) {
rpc->fault(c, 500,
"Not enough parameters (htable name, item name and expire)");
return;
@ -1716,10 +1717,10 @@ static void htable_rpc_setxs(rpc_t *rpc, void *c)
static void htable_rpc_setxi(rpc_t *rpc, void *c)
{
str htname, keyname;
int ival;
int ival = 0;
int exval;
if(rpc->scan(c, "SS.dd", &htname, &keyname, &ival, &exval) < 4) {
if(rpc->scan(c, "SSdd", &htname, &keyname, &ival, &exval) < 4) {
rpc->fault(c, 500,
"Not enough parameters (htable name, key name, value and "
"expire)");

@ -232,7 +232,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("http_async_client", mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}
@ -295,7 +295,7 @@ static int mod_init(void)
if(load_tm_api(&tmb) < 0) {
LM_INFO("cannot load the TM-functions - async relay disabled\n");
memset(&tmb, 0, sizeof(tm_api_t));
return -1;
}
/* allocate workers array */

@ -144,7 +144,7 @@ static int mod_init(void)
{
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, imc_stats) != 0) {
if(register_module_stats("imc", imc_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -196,7 +196,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("ims_auth", mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -172,7 +172,7 @@ static int mod_init(void)
int route_no;
#ifdef STATISTICS
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("ims_icscf", mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
goto error;
}

@ -412,7 +412,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("ims_registrar_scscf", mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -162,7 +162,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("ims_usrloc_pcscf", mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -258,7 +258,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, msilo_stats) != 0) {
if(register_module_stats("msilo", msilo_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -1861,7 +1861,7 @@ static int mod_init(void)
#ifdef STATISTICS
// we need the statistics initialized before restoring the keepalive state
if(register_module_stats(exports.name, statistics) < 0) {
if(register_module_stats("nat_traversal", statistics) < 0) {
LM_ERR("failed to initialize module statistics\n");
return -1;
}

@ -75,6 +75,28 @@ struct module_exports exports = {
destroy /* destroy function */
};
static void *mod_init_openssl(void *arg) {
if(flow_token_secret.s) {
assert(ob_key.len == SHA_DIGEST_LENGTH);
LM_DBG("flow_token_secret mod param set. use persistent ob_key");
#if OPENSSL_VERSION_NUMBER < 0x030000000L
SHA1((const unsigned char *)flow_token_secret.s, flow_token_secret.len,
(unsigned char *)ob_key.s);
#else
EVP_Q_digest(NULL, "SHA1", NULL, flow_token_secret.s,
flow_token_secret.len, (unsigned char *)ob_key.s, NULL);
#endif
} else {
if(RAND_bytes((unsigned char *)ob_key.s, ob_key.len) == 0) {
LM_ERR("unable to get %d cryptographically strong pseudo-"
"random bytes\n",
ob_key.len);
}
}
return NULL;
}
static int mod_init(void)
{
if(ob_force_flag != -1 && !flag_in_range(ob_force_flag)) {
@ -93,18 +115,14 @@ static int mod_init(void)
}
ob_key.len = OB_KEY_LEN;
if(flow_token_secret.s) {
assert(ob_key.len == SHA_DIGEST_LENGTH);
LM_DBG("flow_token_secret mod param set. use persistent ob_key");
SHA1((const unsigned char *)flow_token_secret.s, flow_token_secret.len,
(unsigned char *)ob_key.s);
} else {
if(RAND_bytes((unsigned char *)ob_key.s, ob_key.len) == 0) {
LM_ERR("unable to get %d cryptographically strong pseudo-"
"random bytes\n",
ob_key.len);
}
}
#if OPENSSL_VERSION_NUMBER < 0x010101000L
mod_init_openssl(NULL);
#else
pthread_t tid;
void *retval;
pthread_create(&tid, NULL, mod_init_openssl, NULL);
pthread_join(tid, &retval);
#endif
if(cfg_declare("outbound", outbound_cfg_def, &default_outbound_cfg,
cfg_sizeof(outbound), &outbound_cfg)) {

@ -311,7 +311,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("p_usrloc", mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -1406,7 +1406,7 @@ int tr_eval_string(
case TR_S_FMTLINES:
case TR_S_FMTLINET:
if(tp == NULL || tp->next == NULL) {
LM_ERR("substr invalid parameters (cfg line: %d)\n",
LM_ERR("fmtline invalid parameters (cfg line: %d)\n",
get_cfg_crt_line());
return -1;
}
@ -1439,7 +1439,7 @@ int tr_eval_string(
get_cfg_crt_line());
return -1;
}
if(n == 0 || m >= val->rs.len) {
if(m >= val->rs.len) {
if(val->rs.len > TR_BUFFER_SIZE - 2) {
LM_ERR("value too large: %d\n", val->rs.len);
return -1;
@ -1595,7 +1595,6 @@ int tr_eval_uri(
sv.len++;
memcpy(_tr_buffer, sv.s, sv.len);
sv.s = _tr_buffer;
sv.len++;
if((_tr_parsed_uri.user.len > 0) && (subtype != TR_URI_DURI)) {
memcpy(sv.s + sv.len, _tr_parsed_uri.user.s,
_tr_parsed_uri.user.len);

@ -703,8 +703,9 @@ int lookup_branches(sip_msg_t *msg, udomain_t *d)
for(i = 0; i < nr_branches_start; i++) {
crt = get_sip_branch(i);
/* it has to be a clean branch to do lookup for it */
if(crt->len <= 0 || crt->dst_uri_len > 0 || crt->path_len > 0
|| crt->force_send_socket != NULL || crt->flags != 0)
if(crt == NULL || crt->len <= 0 || crt->dst_uri_len > 0
|| crt->path_len > 0 || crt->force_send_socket != NULL
|| crt->flags != 0)
continue;
/* set the new uri from branch and lookup */
new_uri.s = crt->uri;

@ -304,7 +304,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("registrar", mod_stats) != 0) {
LM_ERR("Failed to register core statistics\n");
return -1;
}

@ -930,7 +930,7 @@ static int mod_init(void)
sipcapture_stats = stats;
/* register statistics */
if(register_module_stats(exports.name, sipcapture_stats) != 0) {
if(register_module_stats("sipcapture", sipcapture_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -320,7 +320,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, siptrace_stats) != 0) {
if(register_module_stats("siptrace", siptrace_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -152,7 +152,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(sst_enable_stats != 0) {
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("sst", mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}

@ -83,7 +83,7 @@ struct module_exports exports = {
static int mod_init(void)
{
int rc = 0;
bool rc = false;
if(!statsd_params.ip) {
LM_INFO("Statsd init ip value is null. use default 127.0.0.1\n");
} else {
@ -97,7 +97,7 @@ static int mod_init(void)
}
rc = statsd_init(statsd_params.ip, statsd_params.port);
if(rc < 0) {
if(rc == false) {
LM_ERR("Statsd connection failed (ERROR_CODE: %i)\n", rc);
return -1;
} else {

@ -1330,15 +1330,15 @@ static int subst_helper_f(sip_msg_t *msg, struct subst_expr *se)
if(lst == 0)
goto error; /* not found */
for(rpl = lst; rpl; rpl = rpl->next) {
LM_DBG("%s: replacing at offset %d [%.*s] with [%.*s]\n", exports.name,
rpl->offset + off, rpl->size, rpl->offset + off + msg->buf,
rpl->rpl.len, rpl->rpl.s);
LM_DBG("replacing at offset %d [%.*s] with [%.*s]\n", rpl->offset + off,
rpl->size, rpl->offset + off + msg->buf, rpl->rpl.len,
rpl->rpl.s);
if((l = del_lump(msg, rpl->offset + off, rpl->size, 0)) == 0)
goto error;
/* hack to avoid re-copying rpl, possible because both
* replace_lst & lumps use pkg_malloc */
if(insert_new_lump_after(l, rpl->rpl.s, rpl->rpl.len, 0) == 0) {
LM_ERR("%s: could not insert new lump\n", exports.name);
LM_ERR("could not insert new lump\n");
goto error;
}
/* hack continued: set rpl.s to 0 so that replace_lst_free will
@ -1352,7 +1352,7 @@ error:
if(lst)
replace_lst_free(lst);
if(nmatches < 0)
LM_ERR("%s: subst_run failed\n", exports.name);
LM_ERR("subst_run failed\n");
return ret;
}
@ -1387,9 +1387,8 @@ static int subst_uri_helper_f(struct sip_msg *msg, struct subst_expr *se)
result = subst_str(tmp, msg, se, 0); /* pkg malloc'ed result */
tmp[len] = c;
if(result) {
LM_DBG("%s match - old uri= [%.*s], new uri= [%.*s]\n", exports.name,
len, tmp, (result->len) ? result->len : 0,
(result->s) ? result->s : "");
LM_DBG("match - old uri= [%.*s], new uri= [%.*s]\n", len, tmp,
(result->len) ? result->len : 0, (result->s) ? result->s : "");
if(msg->new_uri.s)
pkg_free(msg->new_uri.s);
msg->new_uri = *result;
@ -1493,15 +1492,15 @@ static int subst_body_helper_f(struct sip_msg *msg, struct subst_expr *se)
if(lst == 0)
goto error; /* not found */
for(rpl = lst; rpl; rpl = rpl->next) {
LM_DBG("%s replacing at offset %d [%.*s] with [%.*s]\n", exports.name,
rpl->offset + off, rpl->size, rpl->offset + off + msg->buf,
rpl->rpl.len, rpl->rpl.s);
LM_DBG("replacing at offset %d [%.*s] with [%.*s]\n", rpl->offset + off,
rpl->size, rpl->offset + off + msg->buf, rpl->rpl.len,
rpl->rpl.s);
if((l = del_lump(msg, rpl->offset + off, rpl->size, 0)) == 0)
goto error;
/* hack to avoid re-copying rpl, possible because both
* replace_lst & lumps use pkg_malloc */
if(insert_new_lump_after(l, rpl->rpl.s, rpl->rpl.len, 0) == 0) {
LM_ERR("%s could not insert new lump\n", exports.name);
LM_ERR("could not insert new lump\n");
goto error;
}
/* hack continued: set rpl.s to 0 so that replace_lst_free will
@ -1515,7 +1514,7 @@ error:
if(lst)
replace_lst_free(lst);
if(nmatches < 0)
LM_ERR("%s subst_run failed\n", exports.name);
LM_ERR("subst_run failed\n");
return ret;
}
@ -2301,14 +2300,14 @@ static int fixup_substre(void **param, int param_no)
struct subst_expr *se;
str subst;
LM_DBG("%s module -- fixing %s\n", exports.name, (char *)(*param));
LM_DBG("fixing: %s\n", (char *)(*param));
if(param_no != 1)
return 0;
subst.s = *param;
subst.len = strlen(*param);
se = subst_parser(&subst);
if(se == 0) {
LM_ERR("%s: bad subst. re %s\n", exports.name, (char *)*param);
LM_ERR("bad subst re: %s\n", (char *)*param);
return E_BAD_RE;
}
/* don't free string -- needed for specifiers */
@ -4778,8 +4777,8 @@ static int subst_hf_helper_f(
if(lst != 0)
ret = 1;
for(rpl = lst; rpl; rpl = rpl->next) {
LM_DBG("%s replacing at offset %d [%.*s] with [%.*s]\n",
exports.name, rpl->offset + off, rpl->size,
LM_DBG("replacing at offset %d [%.*s] with [%.*s]\n",
rpl->offset + off, rpl->size,
rpl->offset + off + msg->buf, rpl->rpl.len, rpl->rpl.s);
if((l = del_lump(msg, rpl->offset + off, rpl->size, 0)) == 0) {
ret = -1;
@ -4788,7 +4787,7 @@ static int subst_hf_helper_f(
/* hack to avoid re-copying rpl, possible because both
* replace_lst & lumps use pkg_malloc */
if(insert_new_lump_after(l, rpl->rpl.s, rpl->rpl.len, 0) == 0) {
LM_ERR("%s could not insert new lump\n", exports.name);
LM_ERR("could not insert new lump\n");
ret = -1;
goto error;
}
@ -4820,9 +4819,9 @@ static int subst_hf_helper_f(
goto error; /* not found */
ret = 1;
for(rpl = lst; rpl; rpl = rpl->next) {
LM_DBG("%s replacing at offset %d [%.*s] with [%.*s]\n",
exports.name, rpl->offset + off, rpl->size,
rpl->offset + off + msg->buf, rpl->rpl.len, rpl->rpl.s);
LM_DBG("replacing at offset %d [%.*s] with [%.*s]\n",
rpl->offset + off, rpl->size, rpl->offset + off + msg->buf,
rpl->rpl.len, rpl->rpl.s);
if((l = del_lump(msg, rpl->offset + off, rpl->size, 0)) == 0) {
ret = -1;
goto error;
@ -4830,7 +4829,7 @@ static int subst_hf_helper_f(
/* hack to avoid re-copying rpl, possible because both
* replace_lst & lumps use pkg_malloc */
if(insert_new_lump_after(l, rpl->rpl.s, rpl->rpl.len, 0) == 0) {
LM_ERR("%s could not insert new lump\n", exports.name);
LM_ERR("could not insert new lump\n");
ret = -1;
goto error;
}
@ -4842,7 +4841,7 @@ static int subst_hf_helper_f(
}
error:
if(nmatches < 0)
LM_ERR("%s subst_run failed\n", exports.name);
LM_ERR("subst_run failed\n");
LM_DBG("lst was %p\n", lst);
done:
if(lst)

@ -69,20 +69,31 @@ static int tls_mod_preinitialized = 0;
static int tls_mod_initialized = 0;
extern int ksr_tls_init_mode;
pthread_mutex_t ksr_tls_lock_shm;
static pthread_mutex_t *ksr_tls_lock_shm = NULL;
/**
*
*/
int ksr_tls_lock_init(void)
{
if(!(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)) {
pthread_mutexattr_t attr;
if(ksr_tls_lock_shm != NULL) {
return 0;
}
if(pthread_mutex_init(&ksr_tls_lock_shm, NULL) != 0) {
ksr_tls_lock_shm = (pthread_mutex_t *)shm_mallocxz(sizeof(pthread_mutex_t));
if(ksr_tls_lock_shm == NULL) {
LM_ERR("mutex allocation failed\n");
return -1;
}
pthread_mutexattr_init(&attr);
pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
if(pthread_mutex_init(ksr_tls_lock_shm, &attr) != 0) {
pthread_mutexattr_destroy(&attr);
LM_ERR("mutex init failed\n");
return -1;
}
pthread_mutexattr_destroy(&attr);
return 0;
}
@ -94,7 +105,8 @@ void ksr_tls_lock_destroy(void)
if(!(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)) {
return;
}
pthread_mutex_destroy(&ksr_tls_lock_shm);
pthread_mutex_destroy(ksr_tls_lock_shm);
shm_free(ksr_tls_lock_shm);
return;
}
@ -247,9 +259,6 @@ static void *ser_malloc(size_t size, const char *file, int line)
static ticks_t st = 0;
#endif
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
#ifdef RAND_NULL_MALLOC
/* start random null returns only after
* NULL_GRACE_PERIOD from first call */
@ -277,8 +286,6 @@ static void *ser_malloc(size_t size, const char *file, int line)
size, file, line, bt_buf);
}
#endif
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
return p;
}
@ -292,9 +299,6 @@ static void *ser_realloc(void *ptr, size_t size, const char *file, int line)
static ticks_t st = 0;
#endif
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
#ifdef RAND_NULL_MALLOC
/* start random null returns only after
* NULL_GRACE_PERIOD from first call */
@ -323,11 +327,16 @@ static void *ser_realloc(void *ptr, size_t size, const char *file, int line)
}
#endif
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
return p;
}
static void ser_free(void *ptr, const char *fname, int fline)
{
if(ptr) {
shm_free(ptr);
}
}
#endif /* LIBRESSL_VERSION_NUMBER */
#else /*TLS_MALLOC_DBG */
@ -339,11 +348,7 @@ static void *ser_malloc(size_t size)
{
void *p;
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
p = shm_malloc(size);
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
return p;
}
@ -351,22 +356,14 @@ static void *ser_malloc(size_t size)
static void *ser_realloc(void *ptr, size_t size)
{
void *p;
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
p = shm_realloc(ptr, size);
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
return p;
}
#else
static void *ser_malloc(size_t size, const char *fname, int fline)
{
void *p;
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
p = shm_malloc(size);
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
return p;
}
@ -374,11 +371,7 @@ static void *ser_malloc(size_t size, const char *fname, int fline)
static void *ser_realloc(void *ptr, size_t size, const char *fname, int fline)
{
void *p;
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
p = shm_realloc(ptr, size);
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
return p;
}
#endif
@ -395,24 +388,16 @@ static void ser_free(void *ptr)
* As shm_free() aborts on null pointers, we have to check for null pointer
* here in the wrapper function.
*/
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
if(ptr) {
shm_free(ptr);
}
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
}
#else
static void ser_free(void *ptr, const char *fname, int fline)
{
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_lock(&ksr_tls_lock_shm);
if(ptr) {
shm_free(ptr);
}
if(ksr_tls_init_mode & TLS_MODE_PTHREAD_LOCK_SHM)
pthread_mutex_unlock(&ksr_tls_lock_shm);
}
#endif
@ -699,6 +684,11 @@ int tls_pre_init(void)
LM_INFO("libssl linked mode: static\n");
#endif
if(ksr_tls_lock_init() < 0) {
LM_ERR("failed to init local lock\n");
return -1;
}
/*
* this has to be called before any function calling CRYPTO_malloc,
* CRYPTO_malloc will set allow_customize in openssl to 0
@ -740,61 +730,92 @@ int tls_pre_init(void)
* tls mod pre-init function
* - executed before any mod_init()
*/
#if OPENSSL_VERSION_NUMBER >= 0x030000000L
/*
* With late initialisation it is not necessary to
* enable threading on the EVP_RAND_CTX. This function
* left here in case more complex requirements arise in
* OpenSSL >= 3.2.
*/
long tls_h_mod_randctx(void *param)
{
do {
OSSL_LIB_CTX *osslglobal = NULL;
EVP_RAND_CTX *randctx = NULL;
LM_DBG("enabling locking for rand ctx\n");
osslglobal = OSSL_LIB_CTX_get0_global_default();
if(osslglobal == NULL) {
LM_ERR("failed to get lib ssl global ctx\n");
return -1L;
}
randctx = RAND_get0_primary(osslglobal);
if(randctx == NULL) {
LM_ERR("primary rand ctx is null\n");
return -1L;
}
EVP_RAND_enable_locking(randctx);
randctx = RAND_get0_public(osslglobal);
if(randctx == NULL) {
LM_ERR("public rand ctx is null\n");
return -1L;
}
EVP_RAND_enable_locking(randctx);
randctx = RAND_get0_private(osslglobal);
if(randctx == NULL) {
LM_ERR("private rand ctx is null\n");
return -1L;
}
EVP_RAND_enable_locking(randctx);
} while(0);
return 0L;
}
#endif /* OPENSSL_VERSION_NUMBER */
int tls_h_mod_pre_init_f(void)
{
if(tls_mod_preinitialized == 1) {
LM_DBG("already mod pre-initialized\n");
return 0;
}
if(ksr_tls_lock_init() < 0) {
LM_ERR("failed to init local lock\n");
return -1;
}
LM_DBG("preparing tls env for modules initialization\n");
#if OPENSSL_VERSION_NUMBER >= 0x010100000L && !defined(LIBRESSL_VERSION_NUMBER)
LM_DBG("preparing tls env for modules initialization (libssl >=1.1)\n");
#if OPENSSL_VERSION_NUMBER >= 0x010101000L
OPENSSL_init_ssl(OPENSSL_INIT_ATFORK, NULL);
#else
#if OPENSSL_VERSION_NUMBER < 0x010100000L
OPENSSL_init_ssl(0, NULL);
#endif
#else
LM_DBG("preparing tls env for modules initialization (libssl <=1.0)\n");
SSL_library_init();
#endif
#if OPENSSL_VERSION_NUMBER < 0x010101000L
SSL_load_error_strings();
#endif
#if 0
#if OPENSSL_VERSION_NUMBER >= 0x030000000L
do {
OSSL_LIB_CTX *osslglobal = NULL;
EVP_RAND_CTX *randctx = NULL;
LM_DBG("enabling locking for rand ctx\n");
osslglobal = OSSL_LIB_CTX_get0_global_default();
if(osslglobal == NULL) {
LM_ERR("failed to get lib ssl global ctx\n");
return -1;
}
randctx = RAND_get0_primary(osslglobal);
if(randctx == NULL) {
LM_ERR("primary rand ctx is null\n");
return -1;
}
EVP_RAND_enable_locking(randctx);
randctx = RAND_get0_public(osslglobal);
if(randctx == NULL) {
LM_ERR("public rand ctx is null\n");
return -1;
}
EVP_RAND_enable_locking(randctx);
randctx = RAND_get0_private(osslglobal);
if(randctx == NULL) {
LM_ERR("private rand ctx is null\n");
return -1;
}
EVP_RAND_enable_locking(randctx);
} while(0);
#endif
/*
* With deferred initialisation it is not necessary to enable threading
* on the EVP_RAND_CTX. We leave this block here as an example of how
* to do it in case of future requirements.
*/
pthread_t tid;
long rl;
pthread_create(&tid, NULL, (void *(*)(void *))tls_h_mod_randctx, NULL);
pthread_join(tid, (void **)&rl);
if ((int)rl)
return (int)rl;
#endif /* OPENSSL_VERSION_NUMBER */
#endif /* 0 */
tls_mod_preinitialized = 1;
return 0;

@ -402,10 +402,6 @@ static int mod_init(void)
if(tls_check_sockets(*tls_domains_cfg) < 0)
goto error;
if(ksr_tls_lock_init() < 0) {
goto error;
}
LM_INFO("use OpenSSL version: %08x\n", (uint32_t)(OPENSSL_VERSION_NUMBER));
#ifndef OPENSSL_NO_ECDH
LM_INFO("With ECDH-Support!\n");
@ -437,14 +433,30 @@ static int tls_engine_init();
int tls_fix_engine_keys(tls_domains_cfg_t *, tls_domain_t *, tls_domain_t *);
#endif
/*
* OpenSSL 1.1.1+: SSL_CTX is repeated in each worker
*
* OpenSSL RSA blinding works in single-process multi-threaded mode
* and depends on pthread_self() to separate threads. In Kamailio multi-process workers
* pthread_self() will not necessarily be unique, this will result in incorrect BN
* operationshence we create a separate SSL_CTX for each worker
*
* EC operations do not use pthread_self(), so could use shared SSL_CTX
*/
static int mod_child(int rank)
{
if(tls_disable || (tls_domains_cfg == 0))
return 0;
/* fix tls config only from the main proc/PROC_INIT., when we know
* the exact process number and before any other process starts*/
if(rank == PROC_INIT) {
#if OPENSSL_VERSION_NUMBER >= 0x010101000L
/*
* OpenSSL 3.x/1.1.1: create shared SSL_CTX* in worker to avoid init of
* libssl in rank 0(thread#1)
*/
if(rank == PROC_SIPINIT) {
#else
if(rank == PROC_INIT) {
#endif
if(cfg_get(tls, tls_cfg, config_file).s) {
if(tls_fix_domains_cfg(
*tls_domains_cfg, &srv_defaults, &cli_defaults)
@ -455,31 +467,9 @@ static int mod_child(int rank)
< 0)
return -1;
}
#if OPENSSL_VERSION_NUMBER >= 0x010101000L \
&& OPENSSL_VERSION_NUMBER < 0x030000000L
if(ksr_tls_init_mode & TLS_MODE_FORK_PREPARE) {
OPENSSL_fork_prepare();
}
#endif
return 0;
}
#if OPENSSL_VERSION_NUMBER >= 0x010101000L \
&& OPENSSL_VERSION_NUMBER < 0x030000000L
if(ksr_tls_init_mode & TLS_MODE_FORK_PREPARE) {
if(rank == PROC_POSTCHILDINIT) {
/*
* this is called after forking of all child processes
*/
OPENSSL_fork_parent();
return 0;
}
if(!_ksr_is_main) {
OPENSSL_fork_child();
}
}
#endif
#ifndef OPENSSL_NO_ENGINE
/*
* after the child is fork()ed we go through the TLS domains
@ -507,6 +497,11 @@ static void mod_destroy(void)
* => nothing to do here */
}
/*
* GH #3695: OpenSSL 1.1.1: it is no longer necessary to replace RAND
* - early init in rank 0 causes workers to inherit public_drbg/private_drbg
* which are not thread-safe
*/
int ksr_rand_engine_param(modparam_t type, void *val)
{
@ -674,17 +669,19 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2)
if(!shm_initialized() && init_shm() < 0)
return -1;
if(ksr_tls_lock_init() < 0) {
return -1;
}
if(tls_pre_init() < 0)
return -1;
register_tls_hooks(&tls_h);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L \
&& OPENSSL_VERSION_NUMBER < 0x030000000L
LM_DBG("setting cryptorand random engine\n");
RAND_set_rand_method(RAND_ksr_cryptorand_method());
#endif
/*
* GH #3695: OpenSSL 1.1.1 historical note: it is no longer
* needed to replace RAND with cryptorand
*/
sr_kemi_modules_add(sr_kemi_tls_exports);
return 0;

@ -30,7 +30,7 @@ $(WOLFSSL_PREFIX)/include/wolfssl/options.h $(WOLFSSL_PREFIX)/lib/libwolfssl.a:
--prefix=$(CURDIR)/$(WOLFSSL_PREFIX) \
--exec-prefix=$(CURDIR)/$(WOLFSSL_PREFIX); \
fi;
@$(MAKE) -C $(WOLFSSL_SRC) prefix=$(CURDIR)/$(WOLFSSL_PREFIX) exec-prefix=$(CURDIR)/$(WOLFSSL_PREFIX) install
@$(MAKE) -C $(WOLFSSL_SRC) DESTDIR= prefix=$(CURDIR)/$(WOLFSSL_PREFIX) exec-prefix=$(CURDIR)/$(WOLFSSL_PREFIX) install
$(NAME): $(WOLFSSL_PREFIX)/lib/libwolfssl.a

@ -110,7 +110,7 @@ WOLFSSL_BIO *tls_BIO_new_mbuf(struct tls_mbuf *rd, struct tls_mbuf *wr)
/** sets the read and write mbuf for an mbuf BIO.
* @return 1 on success, 0 on error (openssl BIO convention).
*/
int tls_BIO_mbuf_set(BIO *b, struct tls_mbuf *rd, struct tls_mbuf *wr)
int tls_BIO_mbuf_set(WOLFSSL_BIO *b, struct tls_mbuf *rd, struct tls_mbuf *wr)
{
struct tls_bio_mbuf_data *d;
@ -131,7 +131,7 @@ int tls_BIO_mbuf_set(BIO *b, struct tls_mbuf *rd, struct tls_mbuf *wr)
* (internal openssl use via the tls_mbuf method)
* @return 1 on success, 0 on error.
*/
static int tls_bio_mbuf_new(BIO *b)
static int tls_bio_mbuf_new(WOLFSSL_BIO *b)
{
struct tls_bio_mbuf_data *d;
@ -151,7 +151,7 @@ static int tls_bio_mbuf_new(BIO *b)
* (internal openssl use via the tls_mbuf method)
* @return 1 on success, 0 on error.
*/
static int tls_bio_mbuf_free(BIO *b)
static int tls_bio_mbuf_free(WOLFSSL_BIO *b)
{
TLS_BIO_DBG("tls_bio_mbuf_free called (%p)\n", b);
if(unlikely(b == 0))
@ -174,7 +174,7 @@ static int tls_bio_mbuf_free(BIO *b)
* @return bytes read on success (0< ret <=dst_len), -1 on empty buffer & sets
* should_retry_read, -1 on some other errors (w/o should_retry_read set).
*/
static int tls_bio_mbuf_read(BIO *b, char *dst, int dst_len)
static int tls_bio_mbuf_read(WOLFSSL_BIO *b, char *dst, int dst_len)
{
struct tls_bio_mbuf_data *d;
struct tls_mbuf *rd;
@ -226,7 +226,7 @@ static int tls_bio_mbuf_read(BIO *b, char *dst, int dst_len)
* @return bytes written on success (0<= ret <=src_len), -1 on error or buffer
* full (in this case sets should_retry_write).
*/
static int tls_bio_mbuf_write(BIO *b, const char *src, int src_len)
static int tls_bio_mbuf_write(WOLFSSL_BIO *b, const char *src, int src_len)
{
struct tls_bio_mbuf_data *d;
struct tls_mbuf *wr;
@ -296,7 +296,7 @@ static long tls_bio_mbuf_ctrl(WOLFSSL_BIO *b, int cmd, long arg1, void *arg2)
}
static int tls_bio_mbuf_puts(BIO *b, const char *s)
static int tls_bio_mbuf_puts(WOLFSSL_BIO *b, const char *s)
{
int len;

@ -45,7 +45,7 @@ struct tls_bio_mbuf_data
WOLFSSL_BIO_METHOD *tls_BIO_mbuf(void);
WOLFSSL_BIO *tls_BIO_new_mbuf(struct tls_mbuf *rd, struct tls_mbuf *wr);
int tls_BIO_mbuf_set(BIO *b, struct tls_mbuf *rd, struct tls_mbuf *wr);
int tls_BIO_mbuf_set(WOLFSSL_BIO *b, struct tls_mbuf *rd, struct tls_mbuf *wr);
/** initialize an mbuf structure.

@ -604,7 +604,7 @@ static int get_validity(str *res, int local, int bound, sip_msg_t *msg)
goto err;
}
mem = BIO_new(BIO_s_mem());
mem = wolfSSL_BIO_new(wolfSSL_BIO_s_mem());
if(!mem) {
ERR("Error while creating memory BIO\n");
goto err;
@ -779,7 +779,7 @@ static int cert_to_buf(X509 *cert, char **bufptr, size_t *len)
static char buf[MAX_CERT_SIZE];
BIO *mem = NULL;
mem = BIO_new(BIO_s_mem());
mem = wolfSSL_BIO_new(wolfSSL_BIO_s_mem());
if(!mem) {
ERR("Error while creating memory BIO\n");
goto err;

@ -31,7 +31,7 @@
#include <wolfssl/ssl.h>
// WOLFFIX
#define SSL_get_cipher_version(s) \
#define GET_CIPHER_VERSION(s) \
wolfSSL_CIPHER_get_version(wolfSSL_get_current_cipher(s))
@ -427,7 +427,7 @@ int tls_accept(struct tcp_connection *c, int *error)
tls_log = cfg_get(tls, tls_cfg, log);
LOG(tls_log, "tls_accept: new connection from %s:%d using %s %s %d\n",
ip_addr2a(&c->rcv.src_ip), c->rcv.src_port,
SSL_get_cipher_version(ssl), wolfSSL_get_cipher_name(ssl),
GET_CIPHER_VERSION(ssl), wolfSSL_get_cipher_name(ssl),
SSL_get_cipher_bits(ssl, 0));
LOG(tls_log, "tls_accept: local socket: %s:%d\n",
ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
@ -490,7 +490,7 @@ int tls_connect(struct tcp_connection *c, int *error)
tls_log = cfg_get(tls, tls_cfg, log);
LOG(tls_log, "tls_connect: new connection to %s:%d using %s %s %d\n",
ip_addr2a(&c->rcv.src_ip), c->rcv.src_port,
SSL_get_cipher_version(ssl), wolfSSL_get_cipher_name(ssl),
GET_CIPHER_VERSION(ssl), wolfSSL_get_cipher_name(ssl),
SSL_get_cipher_bits(ssl, 0));
LOG(tls_log, "tls_connect: sending socket: %s:%d \n",
ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);

@ -34,7 +34,7 @@
#include "tls_domain.h"
static inline int tls_err_ret(
char *s, SSL *ssl, tls_domains_cfg_t **tls_domains_cfg)
char *s, WOLFSSL *ssl, tls_domains_cfg_t **tls_domains_cfg)
{
long err;
int ret = 0;
@ -43,11 +43,11 @@ static inline int tls_err_ret(
if((*tls_domains_cfg)->srv_default->ctx
&& (*tls_domains_cfg)->srv_default->ctx[0]) {
if(ssl) {
sn = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
sn = wolfSSL_get_servername(ssl, WOLFSSL_SNI_HOST_NAME);
}
while((err = ERR_get_error())) {
ret = 1;
ERR("%s%s (sni: %s)\n", s ? s : "", ERR_error_string(err, 0),
ERR("%s%s (sni: %s)\n", s ? s : "", wolfSSL_ERR_error_string(err, 0),
(sn) ? sn : "unknown");
}
}

@ -443,7 +443,7 @@ inline static void start_final_repl_retr(struct cell *t)
}
static int _tm_local_response_sent_lookup = 0;
static int _tm_local_response_sent_evrt = -2;
static int _reply_light(struct cell *trans, char *buf, unsigned int len,
unsigned int code, char *to_tag, unsigned int to_tag_len, int lock,
@ -573,9 +573,15 @@ static int _reply_light(struct cell *trans, char *buf, unsigned int len,
}
rt = -1;
if(likely(keng == NULL)) {
if(_tm_local_response_sent_lookup == 0) {
if(_tm_local_response_sent_evrt == -2) {
rt = route_lookup(&event_rt, "tm:local-response");
_tm_local_response_sent_lookup = 1;
if(rt < 0) {
_tm_local_response_sent_evrt = -1;
} else {
_tm_local_response_sent_evrt = rt;
}
} else {
rt = _tm_local_response_sent_evrt;
}
}
if((rt >= 0 && event_rt.rlist[rt] != NULL) || (keng != NULL)

@ -2527,6 +2527,10 @@ int t_check_trans(struct sip_msg *msg)
return 1;
case 1: /* found */
t = get_t();
if(t == NULL || t == T_UNDEFINED) {
LM_WARN("unexpected transaction value\n");
return -1;
}
if(msg->REQ_METHOD == METHOD_ACK) {
/* ack to neg. reply or ack to local trans.
* => process it and end the script */

@ -226,7 +226,7 @@ static int mod_init(void)
#ifdef STATISTICS
/* register statistics */
if(register_module_stats(exports.name, mod_stats) != 0) {
if(register_module_stats("tmx", mod_stats) != 0) {
LM_ERR("failed to register statistics\n");
return -1;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save