[sr-dev] git:5.3:7f892850: pkg/kamailio/deb: version set 5.3.0~rc1
Module: kamailio Branch: 5.3 Commit: 7f892850916a6d668386575d1bb1ed1b3a638059 URL: https://github.com/kamailio/kamailio/commit/7f892850916a6d668386575d1bb1ed1b3a638059 Author: Victor Seva Committer: Victor Seva Date: 2019-10-07T23:21:33+02:00 pkg/kamailio/deb: version set 5.3.0~rc1 --- Modified: pkg/kamailio/deb/bionic/changelog Modified: pkg/kamailio/deb/buster/changelog Modified: pkg/kamailio/deb/debian/changelog Modified: pkg/kamailio/deb/jessie/changelog Modified: pkg/kamailio/deb/precise/changelog Modified: pkg/kamailio/deb/sid/changelog Modified: pkg/kamailio/deb/stretch/changelog Modified: pkg/kamailio/deb/trusty/changelog Modified: pkg/kamailio/deb/wheezy/changelog Modified: pkg/kamailio/deb/xenial/changelog --- Diff: https://github.com/kamailio/kamailio/commit/7f892850916a6d668386575d1bb1ed1b3a638059.diff Patch: https://github.com/kamailio/kamailio/commit/7f892850916a6d668386575d1bb1ed1b3a638059.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:9fc7c9a1: usrloc: keep a private copy of urecord before running ul_callbacks
Module: kamailio Branch: 5.2 Commit: 9fc7c9a1ee97e708247e050988eabf8b529c5fb2 URL: https://github.com/kamailio/kamailio/commit/9fc7c9a1ee97e708247e050988eabf8b529c5fb2 Author: Victor Seva Committer: Victor Seva Date: 2019-10-07T23:10:19+02:00 usrloc: keep a private copy of urecord before running ul_callbacks fixes #2089 (cherry picked from commit f3cf0a2f4e60a3a7185baa106869dab85cd8cd0b) --- Modified: src/modules/usrloc/udomain.c --- Diff: https://github.com/kamailio/kamailio/commit/9fc7c9a1ee97e708247e050988eabf8b529c5fb2.diff Patch: https://github.com/kamailio/kamailio/commit/9fc7c9a1ee97e708247e050988eabf8b529c5fb2.patch --- diff --git a/src/modules/usrloc/udomain.c b/src/modules/usrloc/udomain.c index d451057bdd..80980c4cdf 100644 --- a/src/modules/usrloc/udomain.c +++ b/src/modules/usrloc/udomain.c @@ -907,7 +907,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) str user, contact; int i; int n; - urecord_t* r; + urecord_t r; ucontact_t* c; #define RUIDBUF_SIZE 128 char ruidbuf[RUIDBUF_SIZE]; @@ -1013,12 +1013,16 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) } lock_udomain(_d, ); - get_static_urecord(_d, , ); + /* don't use the same static value from get_static_urecord() */ + memset( , 0, sizeof(struct urecord) ); + r.aor = user; + r.aorhash = ul_get_aorhash(); + r.domain = _d->name; - if ( (c=mem_insert_ucontact(r, , ci)) == 0) { + if ( (c=mem_insert_ucontact(, , ci)) == 0) { LM_ERR("inserting temporary contact failed for %.*s\n", user.len, user.s); - release_urecord(r); + release_urecord(); unlock_udomain(_d, ); goto error; } @@ -1041,7 +1045,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) user.len, user.s); } } - release_urecord(r); + release_urecord(); unlock_udomain(_d, ); if(ruid.len > 0 && ul_xavp_contact_name.s != NULL) { /* delete attributes by ruid */ ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:5f477b4e: usrloc: keep a private copy of urecord before running ul_callbacks
Module: kamailio Branch: 5.3 Commit: 5f477b4e58e4d9b02aa20176c314b2915ff832f5 URL: https://github.com/kamailio/kamailio/commit/5f477b4e58e4d9b02aa20176c314b2915ff832f5 Author: Victor Seva Committer: Victor Seva Date: 2019-10-07T23:11:03+02:00 usrloc: keep a private copy of urecord before running ul_callbacks fixes #2089 (cherry picked from commit f3cf0a2f4e60a3a7185baa106869dab85cd8cd0b) --- Modified: src/modules/usrloc/udomain.c --- Diff: https://github.com/kamailio/kamailio/commit/5f477b4e58e4d9b02aa20176c314b2915ff832f5.diff Patch: https://github.com/kamailio/kamailio/commit/5f477b4e58e4d9b02aa20176c314b2915ff832f5.patch --- diff --git a/src/modules/usrloc/udomain.c b/src/modules/usrloc/udomain.c index d451057bdd..80980c4cdf 100644 --- a/src/modules/usrloc/udomain.c +++ b/src/modules/usrloc/udomain.c @@ -907,7 +907,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) str user, contact; int i; int n; - urecord_t* r; + urecord_t r; ucontact_t* c; #define RUIDBUF_SIZE 128 char ruidbuf[RUIDBUF_SIZE]; @@ -1013,12 +1013,16 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) } lock_udomain(_d, ); - get_static_urecord(_d, , ); + /* don't use the same static value from get_static_urecord() */ + memset( , 0, sizeof(struct urecord) ); + r.aor = user; + r.aorhash = ul_get_aorhash(); + r.domain = _d->name; - if ( (c=mem_insert_ucontact(r, , ci)) == 0) { + if ( (c=mem_insert_ucontact(, , ci)) == 0) { LM_ERR("inserting temporary contact failed for %.*s\n", user.len, user.s); - release_urecord(r); + release_urecord(); unlock_udomain(_d, ); goto error; } @@ -1041,7 +1045,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) user.len, user.s); } } - release_urecord(r); + release_urecord(); unlock_udomain(_d, ); if(ruid.len > 0 && ul_xavp_contact_name.s != NULL) { /* delete attributes by ruid */ ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] ursloc has a memory leak if db_mode is DB_ONLY and calling reg_fetch_contacts() (#2089)
Closed #2089 via f3cf0a2f4e60a3a7185baa106869dab85cd8cd0b. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2089#event-2693286015___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:f3cf0a2f: usrloc: keep a private copy of urecord before running ul_callbacks
Module: kamailio Branch: master Commit: f3cf0a2f4e60a3a7185baa106869dab85cd8cd0b URL: https://github.com/kamailio/kamailio/commit/f3cf0a2f4e60a3a7185baa106869dab85cd8cd0b Author: Victor Seva Committer: Victor Seva Date: 2019-10-07T22:56:21+02:00 usrloc: keep a private copy of urecord before running ul_callbacks fixes #2089 --- Modified: src/modules/usrloc/udomain.c --- Diff: https://github.com/kamailio/kamailio/commit/f3cf0a2f4e60a3a7185baa106869dab85cd8cd0b.diff Patch: https://github.com/kamailio/kamailio/commit/f3cf0a2f4e60a3a7185baa106869dab85cd8cd0b.patch --- diff --git a/src/modules/usrloc/udomain.c b/src/modules/usrloc/udomain.c index d451057bdd..80980c4cdf 100644 --- a/src/modules/usrloc/udomain.c +++ b/src/modules/usrloc/udomain.c @@ -907,7 +907,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) str user, contact; int i; int n; - urecord_t* r; + urecord_t r; ucontact_t* c; #define RUIDBUF_SIZE 128 char ruidbuf[RUIDBUF_SIZE]; @@ -1013,12 +1013,16 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) } lock_udomain(_d, ); - get_static_urecord(_d, , ); + /* don't use the same static value from get_static_urecord() */ + memset( , 0, sizeof(struct urecord) ); + r.aor = user; + r.aorhash = ul_get_aorhash(); + r.domain = _d->name; - if ( (c=mem_insert_ucontact(r, , ci)) == 0) { + if ( (c=mem_insert_ucontact(, , ci)) == 0) { LM_ERR("inserting temporary contact failed for %.*s\n", user.len, user.s); - release_urecord(r); + release_urecord(); unlock_udomain(_d, ); goto error; } @@ -1041,7 +1045,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) user.len, user.s); } } - release_urecord(r); + release_urecord(); unlock_udomain(_d, ); if(ruid.len > 0 && ul_xavp_contact_name.s != NULL) { /* delete attributes by ruid */ ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] usrloc: keep a private copy of urecord before running ul_callbacks (#2090)
Merged #2090 into master. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2090#event-2693285959___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] pv: adding xavp_copy with destination index (#2096)
I will update the documentation. I will probably do another round of testing. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2096#issuecomment-539165905___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] [kamailio/kamailio] pv: adding xavp_copy with destination index (#2096)
!-- Kamailio Pull Request Template -- !-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with git cherry-pick -x ... - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception -- Pre-Submission Checklist !-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -- !-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-- !-- If youre unsure about any of these, dont hesitate to ask on sr-dev mailing list -- - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [ ] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: !-- Go over all points below, and after creating the PR, tick the checkboxes that apply -- - [ ] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description MR to add another xavp_copy function taking 4 params ``` xavc_copy(source_name, source_index, destination_name, destination_index) ``` This will let the user copy to a specific position in the stack (replacing its value). This would bring coherent behaviour compared to assign to a specific index vs appending. Example : swapping xavp in and existing stack: (second and third elements) ``` $xavp(a=x) = a-0-x; $xavp(a[0]=y) = a-0-y; $xavp(a=x) = a-1-x; $xavp(a[0]=y) = a-1-y; $xavp(a=x) = a-2-x; $xavp(a[0]=y) = a-2-y; # INFO: script: NEW $xavp(a[0]) = [a-2-x][a-2-y] # INFO: script: NEW $xavp(a[1]) = [a-1-x][a-1-y] # INFO: script: NEW $xavp(a[2]) = [a-0-x][a-0-y] xavp_copy(a, 1, c); xavp_copy(a, 2, a, 1); xavp_copy(c, 0, a, 2); # INFO: script: AFTER $xavp(a[0]) = [a-2-x][a-2-y] # INFO: script: AFTER $xavp(a[1]) = [a-0-x][a-0-y] # INFO: script: AFTER $xavp(a[2]) = [a-1-x][a-1-y] ``` You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/2096 -- Commit Summary -- * pv: adding xavp_copy with destination index -- File Changes -- M src/modules/pv/pv.c (78) -- Patch Links -- https://github.com/kamailio/kamailio/pull/2096.patch https://github.com/kamailio/kamailio/pull/2096.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2096 ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] avpops: avp_copy add xavp (#7)
Closed #7. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/7#event-2693006769___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] avpops: avp_copy add xavp (#7)
Closing, related code was just merged with #2070 . -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/7#issuecomment-539163453___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:2f641a40: modules: readme files regenerated - pv ... [skip ci]
Module: kamailio Branch: master Commit: 2f641a405ad703f5b3124621aa30291ef8742903 URL: https://github.com/kamailio/kamailio/commit/2f641a405ad703f5b3124621aa30291ef8742903 Author: Kamailio Dev Committer: Kamailio Dev Date: 2019-10-07T21:01:09+02:00 modules: readme files regenerated - pv ... [skip ci] --- Modified: src/modules/pv/README --- Diff: https://github.com/kamailio/kamailio/commit/2f641a405ad703f5b3124621aa30291ef8742903.diff Patch: https://github.com/kamailio/kamailio/commit/2f641a405ad703f5b3124621aa30291ef8742903.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] pv: adding xavp_copy (#2070)
Merged #2070 into master. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2070#event-2692956166___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:75226997: Merge pull request #2070 from kamailio/xavp_copy
Module: kamailio Branch: master Commit: 75226997422218a70acc121f4d9f65d9034de7ce URL: https://github.com/kamailio/kamailio/commit/75226997422218a70acc121f4d9f65d9034de7ce Author: Julien Chavanton Committer: GitHub Date: 2019-10-07T12:00:57-07:00 Merge pull request #2070 from kamailio/xavp_copy pv: adding xavp_copy --- Modified: src/core/xavp.c Modified: src/core/xavp.h Modified: src/modules/pv/doc/pv_admin.xml Modified: src/modules/pv/pv.c --- Diff: https://github.com/kamailio/kamailio/commit/75226997422218a70acc121f4d9f65d9034de7ce.diff Patch: https://github.com/kamailio/kamailio/commit/75226997422218a70acc121f4d9f65d9034de7ce.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:3cffe878: core: adding xavp_clone_level_nodata_with_new_name
Module: kamailio Branch: master Commit: 3cffe8789fd14baef4ff548bb2afc5b2ca9ed66e URL: https://github.com/kamailio/kamailio/commit/3cffe8789fd14baef4ff548bb2afc5b2ca9ed66e Author: Julien Chavanton Committer: Julien Chavanton Date: 2019-10-01T09:22:43-07:00 core: adding xavp_clone_level_nodata_with_new_name --- Modified: src/core/xavp.c Modified: src/core/xavp.h --- Diff: https://github.com/kamailio/kamailio/commit/3cffe8789fd14baef4ff548bb2afc5b2ca9ed66e.diff Patch: https://github.com/kamailio/kamailio/commit/3cffe8789fd14baef4ff548bb2afc5b2ca9ed66e.patch --- diff --git a/src/core/xavp.c b/src/core/xavp.c index e5e33f6e9d..f279def1ed 100644 --- a/src/core/xavp.c +++ b/src/core/xavp.c @@ -693,11 +693,16 @@ struct str_list *xavp_get_list_key_names(sr_xavp_t *xavp) return result; } +sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold) +{ + return xavp_clone_level_nodata_with_new_name(xold, >name); +} + /** * clone the xavp without values that are custom data * - only one list level is cloned, other sublists are ignored */ -sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold) +sr_xavp_t *xavp_clone_level_nodata_with_new_name(sr_xavp_t *xold, str *dst_name) { sr_xavp_t *xnew = NULL; sr_xavp_t *navp = NULL; @@ -713,13 +718,13 @@ sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold) LM_INFO("xavp value type is 'data' - ignoring in clone\n"); return NULL; } - xnew = xavp_new_value(>name, >val); + xnew = xavp_new_value(dst_name, >val); if(xnew==NULL) { LM_ERR("cannot create cloned root xavp\n"); return NULL; } - LM_DBG("cloned root xavp [%.*s]\n", xold->name.len, xold->name.s); + LM_DBG("cloned root xavp [%.*s] >> [%.*s]\n", xold->name.len, xold->name.s, dst_name->len, dst_name->s); if(xold->val.type!=SR_XTYPE_XAVP) { diff --git a/src/core/xavp.h b/src/core/xavp.h index 071a421a4a..85c4bb3a3d 100644 --- a/src/core/xavp.h +++ b/src/core/xavp.h @@ -102,6 +102,7 @@ sr_xavp_t *xavp_extract(str *name, sr_xavp_t **list); void xavp_print_list(sr_xavp_t **head); sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold); +sr_xavp_t *xavp_clone_level_nodata_with_new_name(sr_xavp_t *xold, str *dst_name); sr_xavp_t* xavp_get_child(str *rname, str *cname); sr_xavp_t* xavp_get_child_with_ival(str *rname, str *cname); ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:e3816557: pv: adding xavp_copy
Module: kamailio Branch: master Commit: e38165575c5e05e871fd3eb89973b385c2146539 URL: https://github.com/kamailio/kamailio/commit/e38165575c5e05e871fd3eb89973b385c2146539 Author: Julien Chavanton Committer: Julien Chavanton Date: 2019-10-01T09:23:13-07:00 pv: adding xavp_copy --- Modified: src/modules/pv/doc/pv_admin.xml Modified: src/modules/pv/pv.c --- Diff: https://github.com/kamailio/kamailio/commit/e38165575c5e05e871fd3eb89973b385c2146539.diff Patch: https://github.com/kamailio/kamailio/commit/e38165575c5e05e871fd3eb89973b385c2146539.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] HeartBeat Module (#1698)
Closed #1698. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/1698#event-2692900098___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] HeartBeat Module (#1698)
There are now rpc commands to get the call details using various filters. I guess for the moment it offers the foundation for external call controllers/billing systems to be built independently of Kamailio. If someone wants a different approach, just submit a PR. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/1698#issuecomment-539149494___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] siptrace: wrong IPv4 address value (#2092)
> So this is by design, otherwise there will be different ports for each > connection. I do not mind that different ports are used. I am for sending the correct information about the source port -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2092#issuecomment-539149547___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] siptrace: wrong IPv4 address value (#2092)
Thank you Daniel Could you give me reference to code where outbound TCP socket created/bound. I will try debug. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2092#issuecomment-539147004___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] $T_reply_last returns current reply status instead of previous (#735)
Closed #735. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/735#event-2692862656___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] $T_reply_last returns current reply status instead of previous (#735)
Closing as being too old and no interest for long time. If still wanted, just make a pull request. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/735#issuecomment-539144266___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] [Feature Request] Python3 compatibility for dbtextdb (#1747)
Patch for it was merged. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/1747#issuecomment-539143433___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] [Feature Request] Python3 compatibility for dbtextdb (#1747)
Closed #1747. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/1747#event-2692856445___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mongoDB module in kamailio/kamailio-cli docker image (#1995)
Closed #1995. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/1995#event-2692847038___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] Releasing Kamailio v5.2.5
Hello, I am considering to release Kamailio v5.2.5 out of the latest branch 5.2 on Thursday, October 10. As usual, if you noticed any patch that should be backported or you are aware of some issue not yet reported, announce it to sr-dev or via bug tracker. Cheers, Daniel -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] pv: adding xavp_copy (#2070)
The master is open for new features, this can be merged. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2070#issuecomment-539137047___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] usrloc: keep a private copy of urecord before running ul_callbacks (#2090)
miconda approved this pull request. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2090#pullrequestreview-298312515___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] usrloc: keep a private copy of urecord before running ul_callbacks (#2090)
You can merge and backport. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2090#issuecomment-539135127___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] siptrace: wrong IPv4 address value (#2092)
Closed #2092. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2092#event-2692791269___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:6ab666f4: Makefile.defs: version set to 5.3.0-rc1
Module: kamailio Branch: 5.3 Commit: 6ab666f4bb205d4729bfa8874a351f351ef5275e URL: https://github.com/kamailio/kamailio/commit/6ab666f4bb205d4729bfa8874a351f351ef5275e Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T18:51:51+02:00 Makefile.defs: version set to 5.3.0-rc1 --- Modified: src/Makefile.defs --- Diff: https://github.com/kamailio/kamailio/commit/6ab666f4bb205d4729bfa8874a351f351ef5275e.diff Patch: https://github.com/kamailio/kamailio/commit/6ab666f4bb205d4729bfa8874a351f351ef5275e.patch --- diff --git a/src/Makefile.defs b/src/Makefile.defs index 0161d2120b..e4d728dc2c 100644 --- a/src/Makefile.defs +++ b/src/Makefile.defs @@ -107,7 +107,7 @@ INSTALL_FLAVOUR=$(FLAVOUR) VERSION = 5 PATCHLEVEL = 3 SUBLEVEL = 0 -EXTRAVERSION = -rc0 +EXTRAVERSION = -rc1 # memory manager switcher # 0 - f_malloc (fast malloc) ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] core/cfg has memory leak if string value is set (#2094)
I looked today into it as well. I could reproduce it with current git master. ``` root@proxy-1:/usr/local/src/kamailio-devel# grep "^Oct 7 18:38.* qm_status:.*alloc'd" /var/log/syslog | cut -d: -f6- | sort | uniq -c | sort -n | grep core/cfg/cfg 1alloc'd from core: core/cfg/cfg_struct.c: cfg_shmize(217) 1alloc'd from core: core/cfg/cfg_struct.c: sr_cfg_init(324) 1alloc'd from core: core/cfg/cfg_struct.c: sr_cfg_init(336) 1alloc'd from core: core/cfg/cfg_struct.c: sr_cfg_init(348) 1alloc'd from core: core/cfg/cfg_struct.c: sr_cfg_init(355) 1alloc'd from core: core/cfg/cfg_struct.c: sr_cfg_init(362) 2alloc'd from core: core/cfg/cfg_ctx.c: cfg_register_ctx(47) 2alloc'd from core: core/cfg/cfg_struct.c: cfg_clone_global(627) 80alloc'd from core: core/cfg/cfg_ctx.c: cfg_set_now(559) 81alloc'd from core: core/cfg/cfg_struct.c: cfg_child_cb_new(830) 84alloc'd from core: core/cfg/cfg_struct.c: cfg_clone_str(130) root@proxy-1:/usr/local/src/kamailio-devel# kamcmd core.version kamailio 5.4.0-dev0 (x86_64/linux) 7cd263-dirty ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2094#issuecomment-539102437___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:970f86d2: core: workaround related to T_OPT for alpine linux musl C library (GH #2095)
Module: kamailio Branch: 5.3 Commit: 970f86d2fc8c842f267dc99fa1ebb4093b5586ad URL: https://github.com/kamailio/kamailio/commit/970f86d2fc8c842f267dc99fa1ebb4093b5586ad Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T17:24:23+02:00 core: workaround related to T_OPT for alpine linux musl C library (GH #2095) (cherry picked from commit cec1043a9c4daa39b4245b87f28fb5566e8627bd) --- Modified: src/core/resolve.c --- Diff: https://github.com/kamailio/kamailio/commit/970f86d2fc8c842f267dc99fa1ebb4093b5586ad.diff Patch: https://github.com/kamailio/kamailio/commit/970f86d2fc8c842f267dc99fa1ebb4093b5586ad.patch --- diff --git a/src/core/resolve.c b/src/core/resolve.c index 6edc47e506..ac9b2f2363 100644 --- a/src/core/resolve.c +++ b/src/core/resolve.c @@ -32,8 +32,12 @@ #include #include -/* older glibc < 2.25 does not include T_OPT in nameser_compat.h yet */ -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 25 +/* + * Older glibc < 2.25 does not include T_OPT in nameser_compat.h yet. + * On alpine linux musl library it is also not defined. There is no + * musl feature test macro, so we look for glibc instead. + */ +#if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ < 25) || !defined __GLIBC__ #ifndef T_OPT #define T_OPT ns_t_opt #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
Yes, now its there as well. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#issuecomment-539067048___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
Looks as for `5.3` need also backport -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#issuecomment-539063484___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:7cd2635b: modules: readme files regenerated - textopsx ... [skip ci]
Module: kamailio Branch: master Commit: 7cd2635b5c464c3f5b1cc0fc76f442b32bdff5ad URL: https://github.com/kamailio/kamailio/commit/7cd2635b5c464c3f5b1cc0fc76f442b32bdff5ad Author: Kamailio Dev Committer: Kamailio Dev Date: 2019-10-07T17:16:13+02:00 modules: readme files regenerated - textopsx ... [skip ci] --- Modified: src/modules/textopsx/README --- Diff: https://github.com/kamailio/kamailio/commit/7cd2635b5c464c3f5b1cc0fc76f442b32bdff5ad.diff Patch: https://github.com/kamailio/kamailio/commit/7cd2635b5c464c3f5b1cc0fc76f442b32bdff5ad.patch --- diff --git a/src/modules/textopsx/README b/src/modules/textopsx/README index bd0328b446..fdd95cd8e9 100644 --- a/src/modules/textopsx/README +++ b/src/modules/textopsx/README @@ -92,6 +92,10 @@ Chapter 1. Admin Guide routing block configurations. It adds new features similar to the textops module (textops eXtentions). + Note: If you add or remove message parts (header, body etc..) it may be + required to execute msg_apply_changes() from this module if there are + other operations done on the SIP message later on. + 2. Functions 2.1. msg_apply_changes() ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:46effd6a: texopsx: extend docs with a small note about msg_apply_changes()
Module: kamailio Branch: 5.3 Commit: 46effd6a25fb1bf4c789307b3b097bd2c25e9fac URL: https://github.com/kamailio/kamailio/commit/46effd6a25fb1bf4c789307b3b097bd2c25e9fac Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T17:06:52+02:00 texopsx: extend docs with a small note about msg_apply_changes() (cherry picked from commit 899b826bcf2ebe0197fae5766962e0c193c585ec) --- Modified: src/modules/textopsx/doc/textopsx.xml --- Diff: https://github.com/kamailio/kamailio/commit/46effd6a25fb1bf4c789307b3b097bd2c25e9fac.diff Patch: https://github.com/kamailio/kamailio/commit/46effd6a25fb1bf4c789307b3b097bd2c25e9fac.patch --- diff --git a/src/modules/textopsx/doc/textopsx.xml b/src/modules/textopsx/doc/textopsx.xml index b7fe0d14a8..1967229ac1 100644 --- a/src/modules/textopsx/doc/textopsx.xml +++ b/src/modules/textopsx/doc/textopsx.xml @@ -37,6 +37,11 @@ in routing block configurations. It adds new features similar to the textops module (textops eXtentions). + + Note: If you add or remove message parts (header, body etc..) it + may be required to execute msg_apply_changes() from this module + if there are other operations done on the SIP message later on. + ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:899b826b: texopsx: extend docs with a small note about msg_apply_changes()
Module: kamailio Branch: master Commit: 899b826bcf2ebe0197fae5766962e0c193c585ec URL: https://github.com/kamailio/kamailio/commit/899b826bcf2ebe0197fae5766962e0c193c585ec Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T17:04:54+02:00 texopsx: extend docs with a small note about msg_apply_changes() --- Modified: src/modules/textopsx/doc/textopsx.xml --- Diff: https://github.com/kamailio/kamailio/commit/899b826bcf2ebe0197fae5766962e0c193c585ec.diff Patch: https://github.com/kamailio/kamailio/commit/899b826bcf2ebe0197fae5766962e0c193c585ec.patch --- diff --git a/src/modules/textopsx/doc/textopsx.xml b/src/modules/textopsx/doc/textopsx.xml index b7fe0d14a8..1967229ac1 100644 --- a/src/modules/textopsx/doc/textopsx.xml +++ b/src/modules/textopsx/doc/textopsx.xml @@ -37,6 +37,11 @@ in routing block configurations. It adds new features similar to the textops module (textops eXtentions). + + Note: If you add or remove message parts (header, body etc..) it + may be required to execute msg_apply_changes() from this module + if there are other operations done on the SIP message later on. + ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] git:master:4e9f49a5: tls: docs - relocated the note about krand and fastrand from default value paragraph
Hi Daniel, Yes - I did it together in one commit as the two were tightly coupled. But this indeed made the backport difficult, was not intended - sorry. Ok, I will probably add a bit of clarification to the README - understood your goal here. Cheers, Henning -Original Message- From: Daniel-Constantin Mierla Sent: Monday, October 7, 2019 4:01 PM To: Henning Westerholt ; Kamailio (SER) - Development Mailing List Subject: Re: [sr-dev] git:master:4e9f49a5: tls: docs - relocated the note about krand and fastrand from default value paragraph Hello, I wanted to take the version of docs from master in order to be able to cherry-pick in the future. That's the reason most of the commits for documentation are done separate of the one for code, to be easy to cherry-pick one or the other based on the needs and reduce the risk of conflicts. But in this case, you did the documentation and code in a single commit. As I wanted to copy, first I notice it was in the default value paragraph, which is typically standalone and short, referring only to default value. Then I rephrased because the "production" term is mainly used for "stability" (as in production-ready code) and I wanted to be clear that is not about code stability, but strong security (encryption). At the end UDP is still the most used transport protocol for SIP even these days, with 0 encryption (and security level from that point of view). So it is fine to use it in production if one doesn't want strong security. Feel free to add more details there to make it clear from your point of view, but it is not something that cannot be used in production. Cheers, Daniel On 07.10.19 15:31, Henning Westerholt wrote: > Hi Daniel, > > thank you for integrating the changes in the stable branches, I could > have done it later as well. > > One remark about the README change - in my opinion the krand and > fastrand should not used in production. They will generate to weak > random numbers. Refer for example to this wikipedia summary: > > https://en.wikipedia.org/wiki/Random_number_generator_attack#Prominent > _examples > > Many systems were broken by using insufficient random number generators. > > So I think the documentation should indicate this as well. > > Cheers, > > Henning > > Am 07.10.19 um 15:11 schrieb Daniel-Constantin Mierla: >> Module: kamailio >> Branch: master >> Commit: 4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9 >> URL: >> https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310 >> 402acea7f5a3ca9 >> >> Author: Daniel-Constantin Mierla >> Committer: Daniel-Constantin Mierla >> Date: 2019-10-07T15:07:41+02:00 >> >> tls: docs - relocated the note about krand and fastrand from default >> value paragraph >> >> - rephrased a bit to avoid eventual confusion they are not production >> ready >> >> --- >> >> Modified: src/modules/tls/doc/params.xml >> >> --- >> >> Diff: >> https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310 >> 402acea7f5a3ca9.diff >> Patch: >> https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310 >> 402acea7f5a3ca9.patch >> >> --- >> >> diff --git a/src/modules/tls/doc/params.xml >> b/src/modules/tls/doc/params.xml index 72d3278ed7..dc6494c2db 100644 >> --- a/src/modules/tls/doc/params.xml >> +++ b/src/modules/tls/doc/params.xml >> @@ -1259,13 +1259,16 @@ end >> >> krand - use internal kam_rand() >> function >> fastrand - use internal fastrand >> function >> -cryptorand - use internal cryptorand >> function >> +cryptorand - use internal cryptorand (fortuna) >> +function >> >> + >> +Note: the krand and fastrand engines are not recommended for >> use on >> +systems requiring strong security, as they may not generate >> numbers >> +with enough randomness. >> + >> >> The default value is empty (not set) for libssl v1.0.x or >> older, and >> -"cryptorand" for libssl v1.1.x or newer. The krand and fastrand >> engines are >> -not recommended for production use, as they will not generate >> secure enough >> -random numbers. >> +"cryptorand" for libssl v1.1.x or newer. >> >> >> Set rand_engine parameter >> >> >> ___ >> Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org >> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:c419dfdd: http_async_client: use enough size to print pointer as string in build_hash_key()
Module: kamailio Branch: 5.2 Commit: c419dfddfbfc7b250a4be18665d4ed779435ac2e URL: https://github.com/kamailio/kamailio/commit/c419dfddfbfc7b250a4be18665d4ed779435ac2e Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T16:30:47+02:00 http_async_client: use enough size to print pointer as string in build_hash_key() - use local string variables instead of allocation in pkg, because the values are needed only inside the function - use safer snprintf() instead of sprintf() - GH #2091 (cherry picked from commit 087654a5028cd800e17fcd9d1768135a60fd6706) (cherry picked from commit 2ec8caa1ef9577fa4f21fb1fa2f9f6217a29f3eb) --- Modified: src/modules/http_async_client/hm_hash.c --- Diff: https://github.com/kamailio/kamailio/commit/c419dfddfbfc7b250a4be18665d4ed779435ac2e.diff Patch: https://github.com/kamailio/kamailio/commit/c419dfddfbfc7b250a4be18665d4ed779435ac2e.patch --- diff --git a/src/modules/http_async_client/hm_hash.c b/src/modules/http_async_client/hm_hash.c index 9497809847..b18a8b9c37 100644 --- a/src/modules/http_async_client/hm_hash.c +++ b/src/modules/http_async_client/hm_hash.c @@ -62,39 +62,25 @@ int init_http_m_table(unsigned int size) unsigned int build_hash_key(void *p) { - str *hash_str; - char*pointer_str; - int len; + str hash_str; + charpointer_str[20]; unsigned int hash; - pointer_str = (char *)pkg_malloc(sizeof(p) + 1); - - if (pointer_str==0) { - LM_ERR("no more pkg mem\n"); + hash_str.len = snprintf(pointer_str, 20, "%p", p); + if(hash_str.len<=0 || hash_str.len>=20) { + LM_ERR("failed to print the pointer address\n"); return 0; } + LM_DBG("received id %p (%d)-> %s (%d)\n", p, (int)sizeof(p), pointer_str, + hash_str.len); - sprintf(pointer_str, "%p", p); - len = strlen(pointer_str); - LM_DBG("received id %p (%d)-> %s (%d)\n", p, (int)sizeof(p), pointer_str, len); + hash_str.s = pointer_str; - hash_str = (str *)pkg_malloc(sizeof(str)); - if (hash_str==0) { - LM_ERR("no more pkg mem\n"); - pkg_free(pointer_str); - return 0; - } - hash_str->s = pointer_str; - hash_str->len = len; - - hash = core_hash(hash_str, 0, hash_size); + hash = core_hash(_str, 0, hash_size); LM_DBG("hash for %p is %d\n", p, hash); - pkg_free(pointer_str); - pkg_free(hash_str); - return hash; } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] q_malloc crash on Kamailio 5.2.3 with http_async_query function (#2091)
Can you try with latest version in git branch 5.2? I just pushed a patch to fix this issue -- the allocated size for the buffer to hold the hexa-printed address of a pointer was not enough (it was allocated the size of the pointer, but in hexa is twice the number of bytes). The commit has some changes to simplify the code and not allocate in pkg, because the values are used only inside the function. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2091#issuecomment-539042784___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:2ec8caa1: http_async_client: use enough size to print pointer as string in build_hash_key()
Module: kamailio Branch: 5.3 Commit: 2ec8caa1ef9577fa4f21fb1fa2f9f6217a29f3eb URL: https://github.com/kamailio/kamailio/commit/2ec8caa1ef9577fa4f21fb1fa2f9f6217a29f3eb Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T16:29:16+02:00 http_async_client: use enough size to print pointer as string in build_hash_key() - use local string variables instead of allocation in pkg, because the values are needed only inside the function - use safer snprintf() instead of sprintf() - GH #2091 (cherry picked from commit 087654a5028cd800e17fcd9d1768135a60fd6706) --- Modified: src/modules/http_async_client/hm_hash.c --- Diff: https://github.com/kamailio/kamailio/commit/2ec8caa1ef9577fa4f21fb1fa2f9f6217a29f3eb.diff Patch: https://github.com/kamailio/kamailio/commit/2ec8caa1ef9577fa4f21fb1fa2f9f6217a29f3eb.patch --- diff --git a/src/modules/http_async_client/hm_hash.c b/src/modules/http_async_client/hm_hash.c index 9497809847..b18a8b9c37 100644 --- a/src/modules/http_async_client/hm_hash.c +++ b/src/modules/http_async_client/hm_hash.c @@ -62,39 +62,25 @@ int init_http_m_table(unsigned int size) unsigned int build_hash_key(void *p) { - str *hash_str; - char*pointer_str; - int len; + str hash_str; + charpointer_str[20]; unsigned int hash; - pointer_str = (char *)pkg_malloc(sizeof(p) + 1); - - if (pointer_str==0) { - LM_ERR("no more pkg mem\n"); + hash_str.len = snprintf(pointer_str, 20, "%p", p); + if(hash_str.len<=0 || hash_str.len>=20) { + LM_ERR("failed to print the pointer address\n"); return 0; } + LM_DBG("received id %p (%d)-> %s (%d)\n", p, (int)sizeof(p), pointer_str, + hash_str.len); - sprintf(pointer_str, "%p", p); - len = strlen(pointer_str); - LM_DBG("received id %p (%d)-> %s (%d)\n", p, (int)sizeof(p), pointer_str, len); + hash_str.s = pointer_str; - hash_str = (str *)pkg_malloc(sizeof(str)); - if (hash_str==0) { - LM_ERR("no more pkg mem\n"); - pkg_free(pointer_str); - return 0; - } - hash_str->s = pointer_str; - hash_str->len = len; - - hash = core_hash(hash_str, 0, hash_size); + hash = core_hash(_str, 0, hash_size); LM_DBG("hash for %p is %d\n", p, hash); - pkg_free(pointer_str); - pkg_free(hash_str); - return hash; } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
Closed #2095. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#event-2692081266___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
Thanks for the confirmation - backported to stable branches and 5.3. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#issuecomment-539042626___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.1:31ee7514: core: workaround related to T_OPT for alpine linux musl C library (GH #2095)
Module: kamailio Branch: 5.1 Commit: 31ee751409e0efdace1f76ee78cc85da78b049b8 URL: https://github.com/kamailio/kamailio/commit/31ee751409e0efdace1f76ee78cc85da78b049b8 Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T16:35:44+02:00 core: workaround related to T_OPT for alpine linux musl C library (GH #2095) (cherry picked from commit cec1043a9c4daa39b4245b87f28fb5566e8627bd) --- Modified: src/core/resolve.c --- Diff: https://github.com/kamailio/kamailio/commit/31ee751409e0efdace1f76ee78cc85da78b049b8.diff Patch: https://github.com/kamailio/kamailio/commit/31ee751409e0efdace1f76ee78cc85da78b049b8.patch --- diff --git a/src/core/resolve.c b/src/core/resolve.c index 439435791a..f12b6e1ca6 100644 --- a/src/core/resolve.c +++ b/src/core/resolve.c @@ -32,8 +32,12 @@ #include #include -/* older glibc < 2.25 does not include T_OPT in nameser_compat.h yet */ -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 25 +/* + * Older glibc < 2.25 does not include T_OPT in nameser_compat.h yet. + * On alpine linux musl library it is also not defined. There is no + * musl feature test macro, so we look for glibc instead. + */ +#if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ < 25) || !defined __GLIBC__ #ifndef T_OPT #define T_OPT ns_t_opt #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:052c647e: core: workaround related to T_OPT for alpine linux musl C library (GH #2095)
Module: kamailio Branch: 5.2 Commit: 052c647e310b59efd06903668aec231eadf321c2 URL: https://github.com/kamailio/kamailio/commit/052c647e310b59efd06903668aec231eadf321c2 Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T16:35:11+02:00 core: workaround related to T_OPT for alpine linux musl C library (GH #2095) (cherry picked from commit cec1043a9c4daa39b4245b87f28fb5566e8627bd) --- Modified: src/core/resolve.c --- Diff: https://github.com/kamailio/kamailio/commit/052c647e310b59efd06903668aec231eadf321c2.diff Patch: https://github.com/kamailio/kamailio/commit/052c647e310b59efd06903668aec231eadf321c2.patch --- diff --git a/src/core/resolve.c b/src/core/resolve.c index 9f9705341e..04e65962ea 100644 --- a/src/core/resolve.c +++ b/src/core/resolve.c @@ -32,8 +32,12 @@ #include #include -/* older glibc < 2.25 does not include T_OPT in nameser_compat.h yet */ -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 25 +/* + * Older glibc < 2.25 does not include T_OPT in nameser_compat.h yet. + * On alpine linux musl library it is also not defined. There is no + * musl feature test macro, so we look for glibc instead. + */ +#if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ < 25) || !defined __GLIBC__ #ifndef T_OPT #define T_OPT ns_t_opt #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:087654a5: http_async_client: use enough size to print pointer as string in build_hash_key()
Module: kamailio Branch: master Commit: 087654a5028cd800e17fcd9d1768135a60fd6706 URL: https://github.com/kamailio/kamailio/commit/087654a5028cd800e17fcd9d1768135a60fd6706 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T16:28:24+02:00 http_async_client: use enough size to print pointer as string in build_hash_key() - use local string variables instead of allocation in pkg, because the values are needed only inside the function - use safer snprintf() instead of sprintf() - GH #2091 --- Modified: src/modules/http_async_client/hm_hash.c --- Diff: https://github.com/kamailio/kamailio/commit/087654a5028cd800e17fcd9d1768135a60fd6706.diff Patch: https://github.com/kamailio/kamailio/commit/087654a5028cd800e17fcd9d1768135a60fd6706.patch --- diff --git a/src/modules/http_async_client/hm_hash.c b/src/modules/http_async_client/hm_hash.c index 9497809847..b18a8b9c37 100644 --- a/src/modules/http_async_client/hm_hash.c +++ b/src/modules/http_async_client/hm_hash.c @@ -62,39 +62,25 @@ int init_http_m_table(unsigned int size) unsigned int build_hash_key(void *p) { - str *hash_str; - char*pointer_str; - int len; + str hash_str; + charpointer_str[20]; unsigned int hash; - pointer_str = (char *)pkg_malloc(sizeof(p) + 1); - - if (pointer_str==0) { - LM_ERR("no more pkg mem\n"); + hash_str.len = snprintf(pointer_str, 20, "%p", p); + if(hash_str.len<=0 || hash_str.len>=20) { + LM_ERR("failed to print the pointer address\n"); return 0; } + LM_DBG("received id %p (%d)-> %s (%d)\n", p, (int)sizeof(p), pointer_str, + hash_str.len); - sprintf(pointer_str, "%p", p); - len = strlen(pointer_str); - LM_DBG("received id %p (%d)-> %s (%d)\n", p, (int)sizeof(p), pointer_str, len); + hash_str.s = pointer_str; - hash_str = (str *)pkg_malloc(sizeof(str)); - if (hash_str==0) { - LM_ERR("no more pkg mem\n"); - pkg_free(pointer_str); - return 0; - } - hash_str->s = pointer_str; - hash_str->len = len; - - hash = core_hash(hash_str, 0, hash_size); + hash = core_hash(_str, 0, hash_size); LM_DBG("hash for %p is %d\n", p, hash); - pkg_free(pointer_str); - pkg_free(hash_str); - return hash; } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
On master looks as ok. Could you backport this to `5.3` and `5.2` branches. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#issuecomment-539028118___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] Kamailio jwt module or Lua script
On 07.10.19 14:36, Joey Golan wrote: > I’ve implemented the token verification in Lua script and I’m using > app_lua module to call the script from the configuration script inside > the [AUTH] block. > It works fine but I want to be sure that I will not face performance > degradation. > I’ve used the benchmark module to the log the execution duration. The > results shows 130~ microseconds avg. > Do you think it will have impact on performance? If you get the numbers you want (calls per second or registrations per second), then it is fine. > Regarding app_lua, is it running on the same call context or a > different one? What do you mean here? Like "sip/voip call context", or "function call context"? Cheers, Daniel > > Thanks > > > *From:* Daniel-Constantin Mierla > *Sent:* Monday, October 7, 2019 12:29 PM > *To:* Kamailio (SER) - Development Mailing List; Joey Golan > *Subject:* Re: [sr-dev] Kamailio jwt module or Lua script >  > > Hello, > > On 05.10.19 16:07, Joey Golan wrote: >> Hi all, >> >> I would like to authenticate subscribers using JWT tokens and I >> wonder which approach is better: >> 1. Writhing a dedicated kamailio module. >> 2. Writing a Lua script. >> >> What would work better performance wise? > > In terms of executing the same Kamailio C function exported to > kamailio.cfg routing blocks or to Lua API/kemi, there is not any > significant difference. > > However, if you execute Lua code written by third party, it is not > easy to say if it matches the same performances as an equivalent C > function that you write. > > You can go with the option you consider faster for development and > then see if you are pleased with the results. > > Cheers, > Daniel > > -- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- > www.linkedin.com/in/micondaKamailio Advanced Training, Oct 21-23, 2019, > Berlin, Germany -- https://asipto.com/u/kat -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] git:master:4e9f49a5: tls: docs - relocated the note about krand and fastrand from default value paragraph
Hello, I wanted to take the version of docs from master in order to be able to cherry-pick in the future. That's the reason most of the commits for documentation are done separate of the one for code, to be easy to cherry-pick one or the other based on the needs and reduce the risk of conflicts. But in this case, you did the documentation and code in a single commit. As I wanted to copy, first I notice it was in the default value paragraph, which is typically standalone and short, referring only to default value. Then I rephrased because the "production" term is mainly used for "stability" (as in production-ready code) and I wanted to be clear that is not about code stability, but strong security (encryption). At the end UDP is still the most used transport protocol for SIP even these days, with 0 encryption (and security level from that point of view). So it is fine to use it in production if one doesn't want strong security. Feel free to add more details there to make it clear from your point of view, but it is not something that cannot be used in production. Cheers, Daniel On 07.10.19 15:31, Henning Westerholt wrote: > Hi Daniel, > > thank you for integrating the changes in the stable branches, I could > have done it later as well. > > One remark about the README change - in my opinion the krand and > fastrand should not used in production. They will generate to weak > random numbers. Refer for example to this wikipedia summary: > > https://en.wikipedia.org/wiki/Random_number_generator_attack#Prominent_examples > > Many systems were broken by using insufficient random number generators. > > So I think the documentation should indicate this as well. > > Cheers, > > Henning > > Am 07.10.19 um 15:11 schrieb Daniel-Constantin Mierla: >> Module: kamailio >> Branch: master >> Commit: 4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9 >> URL: >> https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9 >> >> Author: Daniel-Constantin Mierla >> Committer: Daniel-Constantin Mierla >> Date: 2019-10-07T15:07:41+02:00 >> >> tls: docs - relocated the note about krand and fastrand from default value >> paragraph >> >> - rephrased a bit to avoid eventual confusion they are not production ready >> >> --- >> >> Modified: src/modules/tls/doc/params.xml >> >> --- >> >> Diff: >> https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9.diff >> Patch: >> https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9.patch >> >> --- >> >> diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml >> index 72d3278ed7..dc6494c2db 100644 >> --- a/src/modules/tls/doc/params.xml >> +++ b/src/modules/tls/doc/params.xml >> @@ -1259,13 +1259,16 @@ end >> >> krand - use internal kam_rand() >> function >> fastrand - use internal fastrand >> function >> -cryptorand - use internal cryptorand >> function >> +cryptorand - use internal cryptorand (fortuna) >> function >> >> + >> +Note: the krand and fastrand engines are not recommended for >> use on >> +systems requiring strong security, as they may not generate >> numbers >> +with enough randomness. >> + >> >> The default value is empty (not set) for libssl v1.0.x or >> older, and >> -"cryptorand" for libssl v1.1.x or newer. The krand and fastrand >> engines are >> -not recommended for production use, as they will not generate >> secure enough >> -random numbers. >> +"cryptorand" for libssl v1.1.x or newer. >> >> >> Set rand_engine parameter >> >> >> ___ >> Kamailio (SER) - Development Mailing List >> sr-dev@lists.kamailio.org >> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] q_malloc crash on Kamailio 5.2.3 with http_async_query function (#2091)
Hi, Kamailio always crashes on the function http_async_query. We are using a lot of functions from the evapi module in this version of Kamailio. Do not know if this can be a problem. Tried to increase debug level: the most important parts: ` 1(17805) INFO:
[sr-dev] git:master:cec1043a: core: workaround related to T_OPT for alpine linux musl C library (GH #2095)
Module: kamailio Branch: master Commit: cec1043a9c4daa39b4245b87f28fb5566e8627bd URL: https://github.com/kamailio/kamailio/commit/cec1043a9c4daa39b4245b87f28fb5566e8627bd Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T15:39:49+02:00 core: workaround related to T_OPT for alpine linux musl C library (GH #2095) --- Modified: src/core/resolve.c --- Diff: https://github.com/kamailio/kamailio/commit/cec1043a9c4daa39b4245b87f28fb5566e8627bd.diff Patch: https://github.com/kamailio/kamailio/commit/cec1043a9c4daa39b4245b87f28fb5566e8627bd.patch --- diff --git a/src/core/resolve.c b/src/core/resolve.c index 6edc47e506..ac9b2f2363 100644 --- a/src/core/resolve.c +++ b/src/core/resolve.c @@ -32,8 +32,12 @@ #include #include -/* older glibc < 2.25 does not include T_OPT in nameser_compat.h yet */ -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 25 +/* + * Older glibc < 2.25 does not include T_OPT in nameser_compat.h yet. + * On alpine linux musl library it is also not defined. There is no + * musl feature test macro, so we look for glibc instead. + */ +#if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ < 25) || !defined __GLIBC__ #ifndef T_OPT #define T_OPT ns_t_opt #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] git:master:4e9f49a5: tls: docs - relocated the note about krand and fastrand from default value paragraph
Hi Daniel, thank you for integrating the changes in the stable branches, I could have done it later as well. One remark about the README change - in my opinion the krand and fastrand should not used in production. They will generate to weak random numbers. Refer for example to this wikipedia summary: https://en.wikipedia.org/wiki/Random_number_generator_attack#Prominent_examples Many systems were broken by using insufficient random number generators. So I think the documentation should indicate this as well. Cheers, Henning Am 07.10.19 um 15:11 schrieb Daniel-Constantin Mierla: > Module: kamailio > Branch: master > Commit: 4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9 > URL: > https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9 > > Author: Daniel-Constantin Mierla > Committer: Daniel-Constantin Mierla > Date: 2019-10-07T15:07:41+02:00 > > tls: docs - relocated the note about krand and fastrand from default value > paragraph > > - rephrased a bit to avoid eventual confusion they are not production ready > > --- > > Modified: src/modules/tls/doc/params.xml > > --- > > Diff: > https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9.diff > Patch: > https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9.patch > > --- > > diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml > index 72d3278ed7..dc6494c2db 100644 > --- a/src/modules/tls/doc/params.xml > +++ b/src/modules/tls/doc/params.xml > @@ -1259,13 +1259,16 @@ end > > krand - use internal kam_rand() > function > fastrand - use internal fastrand > function > - cryptorand - use internal cryptorand > function > + cryptorand - use internal cryptorand (fortuna) > function > > + > + Note: the krand and fastrand engines are not recommended for > use on > + systems requiring strong security, as they may not generate > numbers > + with enough randomness. > + > > The default value is empty (not set) for libssl v1.0.x or > older, and > - "cryptorand" for libssl v1.1.x or newer. The krand and fastrand > engines are > - not recommended for production use, as they will not generate > secure enough > - random numbers. > + "cryptorand" for libssl v1.1.x or newer. > > > Set rand_engine parameter > > > ___ > Kamailio (SER) - Development Mailing List > sr-dev@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev -- Kamailio Merchandising - https://skalatan.de/merchandising/ Kamailio services - https://skalatan.de/services Henning Westerholt - https://skalatan.de/blog/ ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:a365a8d3: modules: readme files regenerated - modules ... [skip ci]
Module: kamailio Branch: 5.2 Commit: a365a8d3519d33f5314a9c3bdab4e1c1ea465642 URL: https://github.com/kamailio/kamailio/commit/a365a8d3519d33f5314a9c3bdab4e1c1ea465642 Author: Kamailio Dev Committer: Kamailio Dev Date: 2019-10-07T15:31:30+02:00 modules: readme files regenerated - modules ... [skip ci] --- Modified: src/modules/tls/README --- Diff: https://github.com/kamailio/kamailio/commit/a365a8d3519d33f5314a9c3bdab4e1c1ea465642.diff Patch: https://github.com/kamailio/kamailio/commit/a365a8d3519d33f5314a9c3bdab4e1c1ea465642.patch --- diff --git a/src/modules/tls/README b/src/modules/tls/README index bf9f693bd0..5a0d9dab1f 100644 --- a/src/modules/tls/README +++ b/src/modules/tls/README @@ -1427,14 +1427,19 @@ end v1.1.x is not designed for multi-process applications and can result in a crash. Therefore set the PRNG engine to one of the options listed in this section. If libssl 1.1.x (or newer) is detected at compile time, - then the PRNG engine is set to "fastrand". + then the PRNG engine is set to "cryptorand". The following options are avaialble: * krand - use internal kam_rand() function * fastrand - use internal fastrand function + * cryptorand - use internal cryptorand (fortuna) function + + Note: the krand and fastrand engines are not recommended for use on + systems requiring strong security, as they may not generate numbers + with enough randomness. The default value is empty (not set) for libssl v1.0.x or older, and - "fastrand" for libssl v1.1.x or newer. + "cryptorand" for libssl v1.1.x or newer. Example 1.45. Set rand_engine parameter ... ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:dde78715: tls: docs - documented cryptorand engine for prng
Module: kamailio Branch: 5.2 Commit: dde78715ce88c8bfb6530559fcaa3a182ca72af7 URL: https://github.com/kamailio/kamailio/commit/dde78715ce88c8bfb6530559fcaa3a182ca72af7 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T15:16:27+02:00 tls: docs - documented cryptorand engine for prng (cherry picked from commit 398641926648a32b635f39f655ae3231038b9c3d) --- Modified: src/modules/tls/doc/params.xml --- Diff: https://github.com/kamailio/kamailio/commit/dde78715ce88c8bfb6530559fcaa3a182ca72af7.diff Patch: https://github.com/kamailio/kamailio/commit/dde78715ce88c8bfb6530559fcaa3a182ca72af7.patch --- diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml index 6028642b5f..dc6494c2db 100644 --- a/src/modules/tls/doc/params.xml +++ b/src/modules/tls/doc/params.xml @@ -1251,7 +1251,7 @@ end is not designed for multi-process applications and can result in a crash. Therefore set the PRNG engine to one of the options listed in this section. If libssl 1.1.x (or newer) is detected at compile time, then - the PRNG engine is set to "fastrand". + the PRNG engine is set to "cryptorand". The following options are avaialble: @@ -1259,10 +1259,16 @@ end krand - use internal kam_rand() function fastrand - use internal fastrand function + cryptorand - use internal cryptorand (fortuna) function + + Note: the krand and fastrand engines are not recommended for use on + systems requiring strong security, as they may not generate numbers + with enough randomness. + The default value is empty (not set) for libssl v1.0.x or older, and - "fastrand" for libssl v1.1.x or newer. + "cryptorand" for libssl v1.1.x or newer. Set rand_engine parameter ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:ca12494e: modules: readme files regenerated - tls ... [skip ci]
Module: kamailio Branch: master Commit: ca12494ec776babab86897eba35b88424a707c69 URL: https://github.com/kamailio/kamailio/commit/ca12494ec776babab86897eba35b88424a707c69 Author: Kamailio Dev Committer: Kamailio Dev Date: 2019-10-07T15:16:37+02:00 modules: readme files regenerated - tls ... [skip ci] --- Modified: src/modules/tls/README --- Diff: https://github.com/kamailio/kamailio/commit/ca12494ec776babab86897eba35b88424a707c69.diff Patch: https://github.com/kamailio/kamailio/commit/ca12494ec776babab86897eba35b88424a707c69.patch --- diff --git a/src/modules/tls/README b/src/modules/tls/README index b0d9fa2601..650a964b58 100644 --- a/src/modules/tls/README +++ b/src/modules/tls/README @@ -1435,12 +1435,14 @@ end The following options are avaialble: * krand - use internal kam_rand() function * fastrand - use internal fastrand function - * cryptorand - use internal cryptorand function + * cryptorand - use internal cryptorand (fortuna) function + + Note: the krand and fastrand engines are not recommended for use on + systems requiring strong security, as they may not generate numbers + with enough randomness. The default value is empty (not set) for libssl v1.0.x or older, and - "cryptorand" for libssl v1.1.x or newer. The krand and fastrand engines - are not recommended for production use, as they will not generate - secure enough random numbers. + "cryptorand" for libssl v1.1.x or newer. Example 1.45. Set rand_engine parameter ... ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:0e5fbd02: tls: add cryptorand (fortuna) engine for PRNG if libssl v1.1.0+
Module: kamailio Branch: 5.2 Commit: 0e5fbd02c95d76045487b707a7386abb029234ff URL: https://github.com/kamailio/kamailio/commit/0e5fbd02c95d76045487b707a7386abb029234ff Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T15:16:17+02:00 tls: add cryptorand (fortuna) engine for PRNG if libssl v1.1.0+ - set it to be the default PRNG with libssl v1.1.0+ (cherry picked from commit 58f6eb7b8bbd6e22994f4b147b6c2fc9c7d1daa0) --- Modified: src/modules/tls/tls_mod.c Modified: src/modules/tls/tls_rand.c Modified: src/modules/tls/tls_rand.h --- Diff: https://github.com/kamailio/kamailio/commit/0e5fbd02c95d76045487b707a7386abb029234ff.diff Patch: https://github.com/kamailio/kamailio/commit/0e5fbd02c95d76045487b707a7386abb029234ff.patch --- diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 75d8aa8fd2..424fad8a08 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -453,6 +453,9 @@ int ksr_rand_engine_param(modparam_t type, void* val) } else if(reng->len == 8 && strncasecmp(reng->s, "fastrand", 8) == 0) { LM_DBG("setting fastrand random engine\n"); RAND_set_rand_method(RAND_ksr_fastrand_method()); + } else if (reng->len == 10 && strncasecmp(reng->s, "cryptorand", 10) == 0) { + LM_DBG("setting cryptorand random engine\n"); + RAND_set_rand_method(RAND_ksr_cryptorand_method()); } #endif return 0; @@ -563,8 +566,8 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) register_tls_hooks(_h); #if OPENSSL_VERSION_NUMBER >= 0x1010L - LM_DBG("setting fastrand random engine\n"); - RAND_set_rand_method(RAND_ksr_fastrand_method()); + LM_DBG("setting cryptorand random engine\n"); + RAND_set_rand_method(RAND_ksr_cryptorand_method()); #endif sr_kemi_modules_add(sr_kemi_tls_exports); diff --git a/src/modules/tls/tls_rand.c b/src/modules/tls/tls_rand.c index bc80f658c3..3cb2e8a712 100644 --- a/src/modules/tls/tls_rand.c +++ b/src/modules/tls/tls_rand.c @@ -129,4 +129,46 @@ const RAND_METHOD *RAND_ksr_fastrand_method(void) return &_ksr_fastrand_method; } + +/* + * Implementation with Fortuna cryptographic PRNG. + * We are not strictly implementing the OpenSSL API here - we will + * not return an error if the PRNG has not been seeded with enough + * randomness to ensure an unpredictable byte sequence. + */ +static int ksr_cryptorand_bytes(unsigned char *outdata, int size) +{ + if (size < 0) { + return 0; + } else if (size == 0) { + return 1; + } + + sr_get_pseudo_random_bytes(outdata, size); + return 1; +} + +static int ksr_cryptorand_status(void) +{ +return 1; +} + +/* + * We don't have a dedicated function for pseudo-random + * bytes, just use the secure version as well for it. + */ +const RAND_METHOD _ksr_cryptorand_method = { +NULL, +ksr_cryptorand_bytes, +NULL, +NULL, +ksr_cryptorand_bytes, +ksr_cryptorand_status +}; + +const RAND_METHOD *RAND_ksr_cryptorand_method(void) +{ +return &_ksr_cryptorand_method; +} + #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ diff --git a/src/modules/tls/tls_rand.h b/src/modules/tls/tls_rand.h index d1a3f0d37f..c73d36b8d9 100644 --- a/src/modules/tls/tls_rand.h +++ b/src/modules/tls/tls_rand.h @@ -27,6 +27,7 @@ const RAND_METHOD *RAND_ksr_krand_method(void); const RAND_METHOD *RAND_ksr_fastrand_method(void); +const RAND_METHOD *RAND_ksr_cryptorand_method(void); #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:39864192: tls: docs - documented cryptorand engine for prng
Module: kamailio Branch: 5.3 Commit: 398641926648a32b635f39f655ae3231038b9c3d URL: https://github.com/kamailio/kamailio/commit/398641926648a32b635f39f655ae3231038b9c3d Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T15:13:58+02:00 tls: docs - documented cryptorand engine for prng --- Modified: src/modules/tls/doc/params.xml --- Diff: https://github.com/kamailio/kamailio/commit/398641926648a32b635f39f655ae3231038b9c3d.diff Patch: https://github.com/kamailio/kamailio/commit/398641926648a32b635f39f655ae3231038b9c3d.patch --- diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml index 6028642b5f..dc6494c2db 100644 --- a/src/modules/tls/doc/params.xml +++ b/src/modules/tls/doc/params.xml @@ -1251,7 +1251,7 @@ end is not designed for multi-process applications and can result in a crash. Therefore set the PRNG engine to one of the options listed in this section. If libssl 1.1.x (or newer) is detected at compile time, then - the PRNG engine is set to "fastrand". + the PRNG engine is set to "cryptorand". The following options are avaialble: @@ -1259,10 +1259,16 @@ end krand - use internal kam_rand() function fastrand - use internal fastrand function + cryptorand - use internal cryptorand (fortuna) function + + Note: the krand and fastrand engines are not recommended for use on + systems requiring strong security, as they may not generate numbers + with enough randomness. + The default value is empty (not set) for libssl v1.0.x or older, and - "fastrand" for libssl v1.1.x or newer. + "cryptorand" for libssl v1.1.x or newer. Set rand_engine parameter ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:4e9f49a5: tls: docs - relocated the note about krand and fastrand from default value paragraph
Module: kamailio Branch: master Commit: 4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9 URL: https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T15:07:41+02:00 tls: docs - relocated the note about krand and fastrand from default value paragraph - rephrased a bit to avoid eventual confusion they are not production ready --- Modified: src/modules/tls/doc/params.xml --- Diff: https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9.diff Patch: https://github.com/kamailio/kamailio/commit/4e9f49a5e8ebd90d6b6913310402acea7f5a3ca9.patch --- diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml index 72d3278ed7..dc6494c2db 100644 --- a/src/modules/tls/doc/params.xml +++ b/src/modules/tls/doc/params.xml @@ -1259,13 +1259,16 @@ end krand - use internal kam_rand() function fastrand - use internal fastrand function - cryptorand - use internal cryptorand function + cryptorand - use internal cryptorand (fortuna) function + + Note: the krand and fastrand engines are not recommended for use on + systems requiring strong security, as they may not generate numbers + with enough randomness. + The default value is empty (not set) for libssl v1.0.x or older, and - "cryptorand" for libssl v1.1.x or newer. The krand and fastrand engines are - not recommended for production use, as they will not generate secure enough - random numbers. + "cryptorand" for libssl v1.1.x or newer. Set rand_engine parameter ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:58f6eb7b: tls: add cryptorand (fortuna) engine for PRNG if libssl v1.1.0+
Module: kamailio Branch: 5.3 Commit: 58f6eb7b8bbd6e22994f4b147b6c2fc9c7d1daa0 URL: https://github.com/kamailio/kamailio/commit/58f6eb7b8bbd6e22994f4b147b6c2fc9c7d1daa0 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T14:57:06+02:00 tls: add cryptorand (fortuna) engine for PRNG if libssl v1.1.0+ - set it to be the default PRNG with libssl v1.1.0+ --- Modified: src/modules/tls/tls_mod.c Modified: src/modules/tls/tls_rand.c Modified: src/modules/tls/tls_rand.h --- Diff: https://github.com/kamailio/kamailio/commit/58f6eb7b8bbd6e22994f4b147b6c2fc9c7d1daa0.diff Patch: https://github.com/kamailio/kamailio/commit/58f6eb7b8bbd6e22994f4b147b6c2fc9c7d1daa0.patch --- diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 75d8aa8fd2..424fad8a08 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -453,6 +453,9 @@ int ksr_rand_engine_param(modparam_t type, void* val) } else if(reng->len == 8 && strncasecmp(reng->s, "fastrand", 8) == 0) { LM_DBG("setting fastrand random engine\n"); RAND_set_rand_method(RAND_ksr_fastrand_method()); + } else if (reng->len == 10 && strncasecmp(reng->s, "cryptorand", 10) == 0) { + LM_DBG("setting cryptorand random engine\n"); + RAND_set_rand_method(RAND_ksr_cryptorand_method()); } #endif return 0; @@ -563,8 +566,8 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) register_tls_hooks(_h); #if OPENSSL_VERSION_NUMBER >= 0x1010L - LM_DBG("setting fastrand random engine\n"); - RAND_set_rand_method(RAND_ksr_fastrand_method()); + LM_DBG("setting cryptorand random engine\n"); + RAND_set_rand_method(RAND_ksr_cryptorand_method()); #endif sr_kemi_modules_add(sr_kemi_tls_exports); diff --git a/src/modules/tls/tls_rand.c b/src/modules/tls/tls_rand.c index bc80f658c3..3cb2e8a712 100644 --- a/src/modules/tls/tls_rand.c +++ b/src/modules/tls/tls_rand.c @@ -129,4 +129,46 @@ const RAND_METHOD *RAND_ksr_fastrand_method(void) return &_ksr_fastrand_method; } + +/* + * Implementation with Fortuna cryptographic PRNG. + * We are not strictly implementing the OpenSSL API here - we will + * not return an error if the PRNG has not been seeded with enough + * randomness to ensure an unpredictable byte sequence. + */ +static int ksr_cryptorand_bytes(unsigned char *outdata, int size) +{ + if (size < 0) { + return 0; + } else if (size == 0) { + return 1; + } + + sr_get_pseudo_random_bytes(outdata, size); + return 1; +} + +static int ksr_cryptorand_status(void) +{ +return 1; +} + +/* + * We don't have a dedicated function for pseudo-random + * bytes, just use the secure version as well for it. + */ +const RAND_METHOD _ksr_cryptorand_method = { +NULL, +ksr_cryptorand_bytes, +NULL, +NULL, +ksr_cryptorand_bytes, +ksr_cryptorand_status +}; + +const RAND_METHOD *RAND_ksr_cryptorand_method(void) +{ +return &_ksr_cryptorand_method; +} + #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ diff --git a/src/modules/tls/tls_rand.h b/src/modules/tls/tls_rand.h index d1a3f0d37f..c73d36b8d9 100644 --- a/src/modules/tls/tls_rand.h +++ b/src/modules/tls/tls_rand.h @@ -27,6 +27,7 @@ const RAND_METHOD *RAND_ksr_krand_method(void); const RAND_METHOD *RAND_ksr_fastrand_method(void); +const RAND_METHOD *RAND_ksr_cryptorand_method(void); #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
On glibc dist `T_OPT` macro defined inside `/usr/include/arpa/nameser_compat.h` file and looks as ``` #define T_OPT ns_t_opt ``` Inside Alpine dist also exist file `/usr/include/arpa/nameser_compat.h` but content of this file ``` /usr/include # cat /usr/include/arpa/nameser_compat.h #include /usr/include # ``` Is need use `nameser_compat.h` file? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#issuecomment-538964408___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
Looks as Alpine not use `glibc` and used [`musl 1.1.23-r3`](https://pkgs.alpinelinux.org/package/edge/main/x86/musl) library ([sources](http://www.musl-libc.org/releases/musl-1.1.23.tar.gz)) I tried search about usage `#ifdef __MUSL__` and found this [response](https://www.openwall.com/lists/musl/2013/03/29/13). I also looked into `musl` sources and `musl-dev` package and not found `GLIBC` comparability macros. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#issuecomment-538950559___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
This is related to GH #2087 - can you give me the glibc version number on this distribution? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095#issuecomment-538935679___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] [kamailio/kamailio] failed build on alpine linux (#2095)
### Description During build on alpine we get error ``` generating core/autover.h ... CC (gcc) [kamailio] main.o CC (gcc) [kamailio] core/daemonize.o CC (gcc) [kamailio] core/nonsip_hooks.o CC (gcc) [kamailio] core/timer_proc.o CC (gcc) [kamailio] core/select_buf.o CC (gcc) [kamailio] core/stun.o CC (gcc) [kamailio] core/action.o CC (gcc) [kamailio] core/raw_listener.o CC (gcc) [kamailio] core/sctp_core.o CC (gcc) [kamailio] core/str.o CC (gcc) [kamailio] core/atomic_ops.o CC (gcc) [kamailio] core/bit_count.o CC (gcc) [kamailio] core/select_core.o CC (gcc) [kamailio] core/pvapi.o CC (gcc) [kamailio] core/forward.o CC (gcc) [kamailio] core/ut.o CC (gcc) [kamailio] core/timer.o CC (gcc) [kamailio] core/ver.o CC (gcc) [kamailio] core/id.o CC (gcc) [kamailio] core/switch.o CC (gcc) [kamailio] core/kemi.o CC (gcc) [kamailio] core/local_timer.o CC (gcc) [kamailio] core/dns_cache.o CC (gcc) [kamailio] core/route.o CC (gcc) [kamailio] core/udp_server.o CC (gcc) [kamailio] core/sr_compat.o CC (gcc) [kamailio] core/locking.o CC (gcc) [kamailio] core/socket_info.o CC (gcc) [kamailio] core/resolve.o core/resolve.c: In function 'get_record': core/resolve.c:961:9: error: 'T_OPT' undeclared (first use in this function) 961 | case T_OPT: | ^ core/resolve.c:961:9: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile.rules:100: core/resolve.o] Error 1 make[1]: *** Waiting for unfinished jobs make[1]: Leaving directory '/usr/src/kamailio/pkg/kamailio/alpine/src/kamailio-49a78933845f136f8f7caaf7e24e6cdcf206cbb5/src' make: *** [Makefile:30: all] Error 2 >>> ERROR: kamailio: build failed >>> kamailio: Uninstalling dependencies... (1/1) Purging .makedepends-kamailio (20191007.100221) OK: 635 MiB in 184 packages pre_build hook failed! (1) ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2095___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] Errored: kamailio/kamailio#7889 (master - 49a7893)
Build Update for kamailio/kamailio - Build: #7889 Status: Errored Duration: 1 min and 47 secs Commit: 49a7893 (master) Author: Henning Westerholt Message: tls: update name and mailing list in tls_cert.sh script View the changeset: https://github.com/kamailio/kamailio/compare/b0538d6515ad...49a78933845f View the full build log and details: https://travis-ci.org/kamailio/kamailio/builds/594505407?utm_medium=notification_source=email -- You can unsubscribe from build emails from the kamailio/kamailio repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=3596148_medium=notification_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:49a78933: tls: update name and mailing list in tls_cert.sh script
Module: kamailio Branch: master Commit: 49a78933845f136f8f7caaf7e24e6cdcf206cbb5 URL: https://github.com/kamailio/kamailio/commit/49a78933845f136f8f7caaf7e24e6cdcf206cbb5 Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T11:50:29+02:00 tls: update name and mailing list in tls_cert.sh script --- Modified: src/modules/tls/tls_cert.sh --- Diff: https://github.com/kamailio/kamailio/commit/49a78933845f136f8f7caaf7e24e6cdcf206cbb5.diff Patch: https://github.com/kamailio/kamailio/commit/49a78933845f136f8f7caaf7e24e6cdcf206cbb5.patch --- diff --git a/src/modules/tls/tls_cert.sh b/src/modules/tls/tls_cert.sh index 9e1cd7fa3c..dc9ea24380 100755 --- a/src/modules/tls/tls_cert.sh +++ b/src/modules/tls/tls_cert.sh @@ -11,7 +11,7 @@ # Configuration variables # NAME=$MAIN_NAME -if [ -z "$NAME" ] ; then NAME="sip-router"; fi; +if [ -z "$NAME" ] ; then NAME="kamailio"; fi; DEFAULT_DIR="/usr/local/etc/$NAME" DEFAULT_DAYS=365 DEFAULT_INFO="Self-signed certificate for $NAME" @@ -102,7 +102,7 @@ AUTHOR Written by Jan Janak REPORTING BUGS - Report bugs to + Report bugs to EOF } #usage ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:dbd4bc09: modules: readme files regenerated - modules ... [skip ci]
Module: kamailio Branch: 5.2 Commit: dbd4bc0944664c861a31f42c4c70eac148312969 URL: https://github.com/kamailio/kamailio/commit/dbd4bc0944664c861a31f42c4c70eac148312969 Author: Kamailio Dev Committer: Kamailio Dev Date: 2019-10-07T11:46:59+02:00 modules: readme files regenerated - modules ... [skip ci] --- Modified: src/modules/tls/README --- Diff: https://github.com/kamailio/kamailio/commit/dbd4bc0944664c861a31f42c4c70eac148312969.diff Patch: https://github.com/kamailio/kamailio/commit/dbd4bc0944664c861a31f42c4c70eac148312969.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:466075c0: tls: Makefile - do not enclose fortuna lib in quotes
Module: kamailio Branch: 5.2 Commit: 466075c0c9145cf676ffac8102af23478cc1a244 URL: https://github.com/kamailio/kamailio/commit/466075c0c9145cf676ffac8102af23478cc1a244 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:44:09+02:00 tls: Makefile - do not enclose fortuna lib in quotes - bsd make keeps them in compile/ldd command (cherry picked from commit f07893606b2129f3a7f24a7d1f7fee619f9b8105) --- Modified: src/modules/tls/Makefile --- Diff: https://github.com/kamailio/kamailio/commit/466075c0c9145cf676ffac8102af23478cc1a244.diff Patch: https://github.com/kamailio/kamailio/commit/466075c0c9145cf676ffac8102af23478cc1a244.patch --- diff --git a/src/modules/tls/Makefile b/src/modules/tls/Makefile index 02f879cc42..7e3c409a70 100644 --- a/src/modules/tls/Makefile +++ b/src/modules/tls/Makefile @@ -28,7 +28,7 @@ else # E.g.: make TLS_HOOKS=1 TLS_EXTRA_LIBS="-lz -lkrb5" endif -TLS_EXTRA_LIBS="-L. -lfortuna" +TLS_EXTRA_LIBS= -L. -lfortuna LIBS+= $(TLS_EXTRA_LIBS) # dcm: tls.cfg installed via local 'install-cfg' to update paths ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] git:master:876c0529: pkg/docker: updated kamailio-ci subproject
Hi Sergey, you probably already noticed it, somehow this commit broke the travis CI build. Does this maybe needs some more changes? Cheers, Henning Am 07.10.19 um 11:29 schrieb Sergey Safarov: > Module: kamailio > Branch: master > Commit: 876c0529962678f7f0c610dd7190cb42d623f2a7 > URL: > https://github.com/kamailio/kamailio/commit/876c0529962678f7f0c610dd7190cb42d623f2a7 > > Author: Sergey Safarov > Committer: Sergey Safarov > Date: 2019-10-07T12:28:17+03:00 > > pkg/docker: updated kamailio-ci subproject > > --- > > Modified: pkg/docker > > --- > > Diff: > https://github.com/kamailio/kamailio/commit/876c0529962678f7f0c610dd7190cb42d623f2a7.diff > Patch: > https://github.com/kamailio/kamailio/commit/876c0529962678f7f0c610dd7190cb42d623f2a7.patch > > --- > > diff --git a/pkg/docker b/pkg/docker > index b92a1c899b..4b81cba4c2 16 > --- a/pkg/docker > +++ b/pkg/docker > @@ -1 +1 @@ > -Subproject commit b92a1c899b8c474afadd0cf29dd7cb4ea01a3466 > +Subproject commit 4b81cba4c293f79ef3b4ae4a8c391d0da220878e > > > ___ > Kamailio (SER) - Development Mailing List > sr-dev@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev -- Kamailio Merchandising - https://skalatan.de/merchandising/ Kamailio services - https://skalatan.de/services Henning Westerholt - https://skalatan.de/blog/ ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:1ccb215b: xmlrpc: clean allocated buffer for reply when no more memory for reason value
Module: kamailio Branch: 5.2 Commit: 1ccb215b96f3dc0bd49ea3feb00f9e8f1a5c1fda URL: https://github.com/kamailio/kamailio/commit/1ccb215b96f3dc0bd49ea3feb00f9e8f1a5c1fda Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:43:55+02:00 xmlrpc: clean allocated buffer for reply when no more memory for reason value (cherry picked from commit 36a4b16117d79f1a30a9f929350f75ab8bfd5d2a) (cherry picked from commit aa875e297bea05828f319d71fc68c44969931231) --- Modified: src/modules/xmlrpc/xmlrpc.c --- Diff: https://github.com/kamailio/kamailio/commit/1ccb215b96f3dc0bd49ea3feb00f9e8f1a5c1fda.diff Patch: https://github.com/kamailio/kamailio/commit/1ccb215b96f3dc0bd49ea3feb00f9e8f1a5c1fda.patch --- diff --git a/src/modules/xmlrpc/xmlrpc.c b/src/modules/xmlrpc/xmlrpc.c index 9521af2386..7552b4d7f1 100644 --- a/src/modules/xmlrpc/xmlrpc.c +++ b/src/modules/xmlrpc/xmlrpc.c @@ -2509,7 +2509,7 @@ static int ki_xmlrpc_reply(sip_msg_t* msg, int rcode, str* reason) reply.reason = as_asciiz(reason); if (reply.reason == NULL) { ERR("No memory left\n"); - return -1; + goto error; } if (reply.code >= 300) { ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:6beb87f1: tls: use fastrand() for the corresponding rand_engine
Module: kamailio Branch: 5.2 Commit: 6beb87f165d9926cd14eb0bd4d57f4167232121c URL: https://github.com/kamailio/kamailio/commit/6beb87f165d9926cd14eb0bd4d57f4167232121c Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:43:55+02:00 tls: use fastrand() for the corresponding rand_engine (cherry picked from commit f877069e141749796ec02a78ce16342f9e120ef7) (cherry picked from commit 52dda341500c697b988f600d3ae6f1b0065670bc) --- Modified: src/modules/tls/tls_rand.c --- Diff: https://github.com/kamailio/kamailio/commit/6beb87f165d9926cd14eb0bd4d57f4167232121c.diff Patch: https://github.com/kamailio/kamailio/commit/6beb87f165d9926cd14eb0bd4d57f4167232121c.patch --- diff --git a/src/modules/tls/tls_rand.c b/src/modules/tls/tls_rand.c index 9101251dd7..bc80f658c3 100644 --- a/src/modules/tls/tls_rand.c +++ b/src/modules/tls/tls_rand.c @@ -93,13 +93,13 @@ static int ksr_fastrand_bytes(unsigned char *outdata, int size) } while(size >= sizeof(int)) { - r = kam_rand(); + r = fastrand(); memcpy(outdata, , sizeof(int)); size -= sizeof(int); outdata += sizeof(int); } if(size>0) { - r = kam_rand(); + r = fastrand(); memcpy(outdata, , size); } return 1; ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:d86c831a: core: str2int() test first if result is null, otherwise init it to 0
Module: kamailio Branch: 5.2 Commit: d86c831a474e57acc6bd744eb52a24b3b7b9a3c0 URL: https://github.com/kamailio/kamailio/commit/d86c831a474e57acc6bd744eb52a24b3b7b9a3c0 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:43:55+02:00 core: str2int() test first if result is null, otherwise init it to 0 (cherry picked from commit b83a165e2d0e34c9bca742708c1891eb114bae04) (cherry picked from commit ac16e21715e57befcba386e74214fa482bdf97d7) --- Modified: src/core/ut.h --- Diff: https://github.com/kamailio/kamailio/commit/d86c831a474e57acc6bd744eb52a24b3b7b9a3c0.diff Patch: https://github.com/kamailio/kamailio/commit/d86c831a474e57acc6bd744eb52a24b3b7b9a3c0.patch --- diff --git a/src/core/ut.h b/src/core/ut.h index 8d4f01e9a1..4a5cc463a5 100644 --- a/src/core/ut.h +++ b/src/core/ut.h @@ -635,12 +635,12 @@ static inline int str2int(str* _s, unsigned int* _r) { int i; - if (_s == NULL) return -1; if (_r == NULL) return -1; + *_r = 0; + if (_s == NULL) return -1; if (_s->len < 0) return -1; if (_s->s == NULL) return -1; - *_r = 0; for(i = 0; i < _s->len; i++) { if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) { *_r *= 10; ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:e1b740b4: tls: set random number engine to fastrand for libssl1.1+
Module: kamailio Branch: 5.2 Commit: e1b740b43f0fda7bcbf4b36c2816d318193acf54 URL: https://github.com/kamailio/kamailio/commit/e1b740b43f0fda7bcbf4b36c2816d318193acf54 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:43:55+02:00 tls: set random number engine to fastrand for libssl1.1+ (cherry picked from commit 6d154fbb2ff1d2941316281fad120b5db219deb1) (cherry picked from commit 2935b65d7d909f8ac355b8f2b5404494c4ec2c6b) --- Modified: src/modules/tls/tls_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/e1b740b43f0fda7bcbf4b36c2816d318193acf54.diff Patch: https://github.com/kamailio/kamailio/commit/e1b740b43f0fda7bcbf4b36c2816d318193acf54.patch --- diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 87759249b2..75d8aa8fd2 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -561,6 +561,12 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) return -1; register_tls_hooks(_h); + +#if OPENSSL_VERSION_NUMBER >= 0x1010L + LM_DBG("setting fastrand random engine\n"); + RAND_set_rand_method(RAND_ksr_fastrand_method()); +#endif + sr_kemi_modules_add(sr_kemi_tls_exports); return 0; ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:52e34808: tls: docs for rand_engine parameter
Module: kamailio Branch: 5.2 Commit: 52e348087551b42c97bcb235dabbc95255a83b1a URL: https://github.com/kamailio/kamailio/commit/52e348087551b42c97bcb235dabbc95255a83b1a Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:43:55+02:00 tls: docs for rand_engine parameter (cherry picked from commit 787b95a5a0573d4e81b2475a84bad59076e34faf) (cherry picked from commit 3c11a405344af55aa4b9c8d35e1c181473cbdf42) --- Modified: src/modules/tls/doc/params.xml --- Diff: https://github.com/kamailio/kamailio/commit/52e348087551b42c97bcb235dabbc95255a83b1a.diff Patch: https://github.com/kamailio/kamailio/commit/52e348087551b42c97bcb235dabbc95255a83b1a.patch --- diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml index 6ef2d4123f..6028642b5f 100644 --- a/src/modules/tls/doc/params.xml +++ b/src/modules/tls/doc/params.xml @@ -1241,6 +1241,39 @@ end + + rand_engine (str) + + Set the ranondom number generator engine for libssl. + + + Note: the default random number generator (PRNG) engine of libssl v1.1.x + is not designed for multi-process applications and can result in a crash. + Therefore set the PRNG engine to one of the options listed in this + section. If libssl 1.1.x (or newer) is detected at compile time, then + the PRNG engine is set to "fastrand". + + + The following options are avaialble: + + + krand - use internal kam_rand() function + fastrand - use internal fastrand function + + + The default value is empty (not set) for libssl v1.0.x or older, and + "fastrand" for libssl v1.1.x or newer. + + + Set rand_engine parameter + +... +modparam("tls", "rand_engine", "fastrand") +... + + + + engine (string) ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:f73aa772: tls: option to set use fastrand for rand_engine
Module: kamailio Branch: 5.2 Commit: f73aa7727607c18cf6d6bcb11c51510c8d3660c9 URL: https://github.com/kamailio/kamailio/commit/f73aa7727607c18cf6d6bcb11c51510c8d3660c9 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:43:55+02:00 tls: option to set use fastrand for rand_engine (cherry picked from commit 4f514a7956534f1afc1ef30d8332f5dc3547de4b) (cherry picked from commit 43aa779ee9e43805e6a7da2c12562fdc89c5c413) --- Modified: src/modules/tls/tls_mod.c Modified: src/modules/tls/tls_rand.c Modified: src/modules/tls/tls_rand.h --- Diff: https://github.com/kamailio/kamailio/commit/f73aa7727607c18cf6d6bcb11c51510c8d3660c9.diff Patch: https://github.com/kamailio/kamailio/commit/f73aa7727607c18cf6d6bcb11c51510c8d3660c9.patch --- diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 52a45353d6..87759249b2 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -449,7 +449,10 @@ int ksr_rand_engine_param(modparam_t type, void* val) LM_DBG("random engine: %.*s\n", reng->len, reng->s); if(reng->len == 5 && strncasecmp(reng->s, "krand", 5) == 0) { LM_DBG("setting krand random engine\n"); - RAND_set_rand_method(RAND_ksr_method()); + RAND_set_rand_method(RAND_ksr_krand_method()); + } else if(reng->len == 8 && strncasecmp(reng->s, "fastrand", 8) == 0) { + LM_DBG("setting fastrand random engine\n"); + RAND_set_rand_method(RAND_ksr_fastrand_method()); } #endif return 0; diff --git a/src/modules/tls/tls_rand.c b/src/modules/tls/tls_rand.c index 0f283306dd..9101251dd7 100644 --- a/src/modules/tls/tls_rand.c +++ b/src/modules/tls/tls_rand.c @@ -27,9 +27,10 @@ #include "../../core/dprint.h" #include "../../core/rand/kam_rand.h" +#include "../../core/rand/fastrand.h" #include "fortuna/random.h" -static int ksr_rand_bytes(unsigned char *outdata, int size) +static int ksr_krand_bytes(unsigned char *outdata, int size) { int r; @@ -57,28 +58,75 @@ static int ksr_rand_bytes(unsigned char *outdata, int size) return 1; } -static int ksr_rand_pseudorand(unsigned char *outdata, int size) +static int ksr_krand_pseudorand(unsigned char *outdata, int size) { -return ksr_rand_bytes(outdata, size); +return ksr_krand_bytes(outdata, size); } -static int ksr_rand_status(void) +static int ksr_krand_status(void) { return 1; } -const RAND_METHOD _ksr_rand_method = { +const RAND_METHOD _ksr_krand_method = { NULL, -ksr_rand_bytes, +ksr_krand_bytes, NULL, NULL, -ksr_rand_pseudorand, -ksr_rand_status +ksr_krand_pseudorand, +ksr_krand_status }; -const RAND_METHOD *RAND_ksr_method(void) +const RAND_METHOD *RAND_ksr_krand_method(void) { -return &_ksr_rand_method; +return &_ksr_krand_method; +} + +static int ksr_fastrand_bytes(unsigned char *outdata, int size) +{ + int r; + + if (size < 0) { + return 0; + } else if (size == 0) { + return 1; + } + + while(size >= sizeof(int)) { + r = kam_rand(); + memcpy(outdata, , sizeof(int)); + size -= sizeof(int); + outdata += sizeof(int); + } + if(size>0) { + r = kam_rand(); + memcpy(outdata, , size); + } + return 1; +} + +static int ksr_fastrand_pseudorand(unsigned char *outdata, int size) +{ +return ksr_fastrand_bytes(outdata, size); +} + +static int ksr_fastrand_status(void) +{ +return 1; +} + +const RAND_METHOD _ksr_fastrand_method = { +NULL, +ksr_fastrand_bytes, +NULL, +NULL, +ksr_fastrand_pseudorand, +ksr_fastrand_status +}; + +const RAND_METHOD *RAND_ksr_fastrand_method(void) +{ +return &_ksr_fastrand_method; } #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ diff --git a/src/modules/tls/tls_rand.h b/src/modules/tls/tls_rand.h index 20b5a20e9c..d1a3f0d37f 100644 --- a/src/modules/tls/tls_rand.h +++ b/src/modules/tls/tls_rand.h @@ -25,7 +25,8 @@ #include -const RAND_METHOD *RAND_ksr_method(void); +const RAND_METHOD *RAND_ksr_krand_method(void); +const RAND_METHOD *RAND_ksr_fastrand_method(void); #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:c6cac677: tls: add local copy of fortuna and depenencies from git master
Module: kamailio Branch: 5.2 Commit: c6cac67746e96fff43dbf6b55e018a84722a1400 URL: https://github.com/kamailio/kamailio/commit/c6cac67746e96fff43dbf6b55e018a84722a1400 Author: Henning Westerholt Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:43:54+02:00 tls: add local copy of fortuna and depenencies from git master - add local copy of fortuna and depenencies from git master - not active yet, needs additions in tls_rand.* and probably also Makefile (cherry picked from commit 26d8e3cf82a49ad4e58ced507f7a1787b74656b0) --- Added: src/modules/tls/fortuna/Makefile Added: src/modules/tls/fortuna/fortuna.c Added: src/modules/tls/fortuna/fortuna.h Added: src/modules/tls/fortuna/random.c Added: src/modules/tls/fortuna/random.h Added: src/modules/tls/fortuna/rijndael.c Added: src/modules/tls/fortuna/rijndael.h Added: src/modules/tls/fortuna/rijndael.tbl Added: src/modules/tls/fortuna/sha256.c Added: src/modules/tls/fortuna/sha256.h Modified: src/modules/tls/Makefile Modified: src/modules/tls/tls_rand.c --- Diff: https://github.com/kamailio/kamailio/commit/c6cac67746e96fff43dbf6b55e018a84722a1400.diff Patch: https://github.com/kamailio/kamailio/commit/c6cac67746e96fff43dbf6b55e018a84722a1400.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:f0789360: tls: Makefile - do not enclose fortuna lib in quotes
Module: kamailio Branch: 5.3 Commit: f07893606b2129f3a7f24a7d1f7fee619f9b8105 URL: https://github.com/kamailio/kamailio/commit/f07893606b2129f3a7f24a7d1f7fee619f9b8105 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T11:42:12+02:00 tls: Makefile - do not enclose fortuna lib in quotes - bsd make keeps them in compile/ldd command --- Modified: src/modules/tls/Makefile --- Diff: https://github.com/kamailio/kamailio/commit/f07893606b2129f3a7f24a7d1f7fee619f9b8105.diff Patch: https://github.com/kamailio/kamailio/commit/f07893606b2129f3a7f24a7d1f7fee619f9b8105.patch --- diff --git a/src/modules/tls/Makefile b/src/modules/tls/Makefile index 9911882dc8..224bbd81d3 100644 --- a/src/modules/tls/Makefile +++ b/src/modules/tls/Makefile @@ -28,7 +28,7 @@ else # E.g.: make TLS_HOOKS=1 TLS_EXTRA_LIBS="-lz -lkrb5" endif -TLS_EXTRA_LIBS="-L. -lfortuna" +TLS_EXTRA_LIBS= -L. -lfortuna LIBS+= $(TLS_EXTRA_LIBS) # dcm: tls.cfg installed via local 'install-cfg' to update paths ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] Errored: kamailio/kamailio#7886 (master - b0538d6)
Build Update for kamailio/kamailio - Build: #7886 Status: Errored Duration: 33 secs Commit: b0538d6 (master) Author: Henning Westerholt Message: tls: fix error in DBG message View the changeset: https://github.com/kamailio/kamailio/compare/876c05299626...b0538d6515ad View the full build log and details: https://travis-ci.org/kamailio/kamailio/builds/594497545?utm_medium=notification_source=email -- You can unsubscribe from build emails from the kamailio/kamailio repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=3596148_medium=notification_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:876c0529: pkg/docker: updated kamailio-ci subproject
Module: kamailio Branch: master Commit: 876c0529962678f7f0c610dd7190cb42d623f2a7 URL: https://github.com/kamailio/kamailio/commit/876c0529962678f7f0c610dd7190cb42d623f2a7 Author: Sergey Safarov Committer: Sergey Safarov Date: 2019-10-07T12:28:17+03:00 pkg/docker: updated kamailio-ci subproject --- Modified: pkg/docker --- Diff: https://github.com/kamailio/kamailio/commit/876c0529962678f7f0c610dd7190cb42d623f2a7.diff Patch: https://github.com/kamailio/kamailio/commit/876c0529962678f7f0c610dd7190cb42d623f2a7.patch --- diff --git a/pkg/docker b/pkg/docker index b92a1c899b..4b81cba4c2 16 --- a/pkg/docker +++ b/pkg/docker @@ -1 +1 @@ -Subproject commit b92a1c899b8c474afadd0cf29dd7cb4ea01a3466 +Subproject commit 4b81cba4c293f79ef3b4ae4a8c391d0da220878e ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:b0538d65: tls: fix error in DBG message
Module: kamailio Branch: master Commit: b0538d6515ad2a62f4336ec4395d10a5a9fc654b URL: https://github.com/kamailio/kamailio/commit/b0538d6515ad2a62f4336ec4395d10a5a9fc654b Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T11:31:50+02:00 tls: fix error in DBG message --- Modified: src/modules/tls/tls_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/b0538d6515ad2a62f4336ec4395d10a5a9fc654b.diff Patch: https://github.com/kamailio/kamailio/commit/b0538d6515ad2a62f4336ec4395d10a5a9fc654b.patch --- diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 5784ce4842..424fad8a08 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -566,7 +566,7 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) register_tls_hooks(_h); #if OPENSSL_VERSION_NUMBER >= 0x1010L - LM_DBG("setting fastrand random engine\n"); + LM_DBG("setting cryptorand random engine\n"); RAND_set_rand_method(RAND_ksr_cryptorand_method()); #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] Errored: kamailio/kamailio#7885 (master - 876c052)
Build Update for kamailio/kamailio - Build: #7885 Status: Errored Duration: 33 secs Commit: 876c052 (master) Author: Sergey Safarov Message: pkg/docker: updated kamailio-ci subproject View the changeset: https://github.com/kamailio/kamailio/compare/b1886c15ba56...876c05299626 View the full build log and details: https://travis-ci.org/kamailio/kamailio/builds/594496259?utm_medium=notification_source=email -- You can unsubscribe from build emails from the kamailio/kamailio repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=3596148_medium=notification_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] Kamailio jwt module or Lua script
Hello, On 05.10.19 16:07, Joey Golan wrote: > Hi all, > > I would like to authenticate subscribers using JWT tokens and I wonder > which approach is better: > 1. Writhing a dedicated kamailio module. > 2. Writing a Lua script. > > What would work better performance wise? In terms of executing the same Kamailio C function exported to kamailio.cfg routing blocks or to Lua API/kemi, there is not any significant difference. However, if you execute Lua code written by third party, it is not easy to say if it matches the same performances as an equivalent C function that you write. You can go with the option you consider faster for development and then see if you are pleased with the results. Cheers, Daniel -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:b1886c15: modules: readme files regenerated - tls ... [skip ci]
Module: kamailio Branch: master Commit: b1886c15ba562fef987fe6361df2cb3bbe00888c URL: https://github.com/kamailio/kamailio/commit/b1886c15ba562fef987fe6361df2cb3bbe00888c Author: Kamailio Dev Committer: Kamailio Dev Date: 2019-10-07T11:02:17+02:00 modules: readme files regenerated - tls ... [skip ci] --- Modified: src/modules/tls/README --- Diff: https://github.com/kamailio/kamailio/commit/b1886c15ba562fef987fe6361df2cb3bbe00888c.diff Patch: https://github.com/kamailio/kamailio/commit/b1886c15ba562fef987fe6361df2cb3bbe00888c.patch --- diff --git a/src/modules/tls/README b/src/modules/tls/README index 295306a74e..b0d9fa2601 100644 --- a/src/modules/tls/README +++ b/src/modules/tls/README @@ -1430,14 +1430,17 @@ end v1.1.x is not designed for multi-process applications and can result in a crash. Therefore set the PRNG engine to one of the options listed in this section. If libssl 1.1.x (or newer) is detected at compile time, - then the PRNG engine is set to "fastrand". + then the PRNG engine is set to "cryptorand". The following options are avaialble: * krand - use internal kam_rand() function * fastrand - use internal fastrand function + * cryptorand - use internal cryptorand function The default value is empty (not set) for libssl v1.0.x or older, and - "fastrand" for libssl v1.1.x or newer. + "cryptorand" for libssl v1.1.x or newer. The krand and fastrand engines + are not recommended for production use, as they will not generate + secure enough random numbers. Example 1.45. Set rand_engine parameter ... ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:aa875e29: xmlrpc: clean allocated buffer for reply when no more memory for reason value
Module: kamailio Branch: 5.3 Commit: aa875e297bea05828f319d71fc68c44969931231 URL: https://github.com/kamailio/kamailio/commit/aa875e297bea05828f319d71fc68c44969931231 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:52:41+02:00 xmlrpc: clean allocated buffer for reply when no more memory for reason value (cherry picked from commit 36a4b16117d79f1a30a9f929350f75ab8bfd5d2a) --- Modified: src/modules/xmlrpc/xmlrpc.c --- Diff: https://github.com/kamailio/kamailio/commit/aa875e297bea05828f319d71fc68c44969931231.diff Patch: https://github.com/kamailio/kamailio/commit/aa875e297bea05828f319d71fc68c44969931231.patch --- diff --git a/src/modules/xmlrpc/xmlrpc.c b/src/modules/xmlrpc/xmlrpc.c index 9521af2386..7552b4d7f1 100644 --- a/src/modules/xmlrpc/xmlrpc.c +++ b/src/modules/xmlrpc/xmlrpc.c @@ -2509,7 +2509,7 @@ static int ki_xmlrpc_reply(sip_msg_t* msg, int rcode, str* reason) reply.reason = as_asciiz(reason); if (reply.reason == NULL) { ERR("No memory left\n"); - return -1; + goto error; } if (reply.code >= 300) { ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:30cef0e2: presence: free allocated memory in case of error
Module: kamailio Branch: 5.3 Commit: 30cef0e29c39402b91cd6d4b4d323cf3bf9fd033 URL: https://github.com/kamailio/kamailio/commit/30cef0e29c39402b91cd6d4b4d323cf3bf9fd033 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:52:54+02:00 presence: free allocated memory in case of error (cherry picked from commit 4e6c8fe6073d7d52bab66faa68abad2f685d2090) --- Modified: src/modules/presence/notify.c --- Diff: https://github.com/kamailio/kamailio/commit/30cef0e29c39402b91cd6d4b4d323cf3bf9fd033.diff Patch: https://github.com/kamailio/kamailio/commit/30cef0e29c39402b91cd6d4b4d323cf3bf9fd033.patch --- diff --git a/src/modules/presence/notify.c b/src/modules/presence/notify.c index f9ce4c403f..245c2b95c0 100644 --- a/src/modules/presence/notify.c +++ b/src/modules/presence/notify.c @@ -2018,6 +2018,7 @@ int add_waiting_watchers(watcher_t *watchers, str pres_uri, str event) w = (watcher_t *)pkg_malloc(sizeof(watcher_t)); if(w == NULL) { + pkg_free(wuri.s); ERR_MEM(PKG_MEM_STR); } memset(w, 0, sizeof(watcher_t)); ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:52dda341: tls: use fastrand() for the corresponding rand_engine
Module: kamailio Branch: 5.3 Commit: 52dda341500c697b988f600d3ae6f1b0065670bc URL: https://github.com/kamailio/kamailio/commit/52dda341500c697b988f600d3ae6f1b0065670bc Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:52:33+02:00 tls: use fastrand() for the corresponding rand_engine (cherry picked from commit f877069e141749796ec02a78ce16342f9e120ef7) --- Modified: src/modules/tls/tls_rand.c --- Diff: https://github.com/kamailio/kamailio/commit/52dda341500c697b988f600d3ae6f1b0065670bc.diff Patch: https://github.com/kamailio/kamailio/commit/52dda341500c697b988f600d3ae6f1b0065670bc.patch --- diff --git a/src/modules/tls/tls_rand.c b/src/modules/tls/tls_rand.c index 9101251dd7..bc80f658c3 100644 --- a/src/modules/tls/tls_rand.c +++ b/src/modules/tls/tls_rand.c @@ -93,13 +93,13 @@ static int ksr_fastrand_bytes(unsigned char *outdata, int size) } while(size >= sizeof(int)) { - r = kam_rand(); + r = fastrand(); memcpy(outdata, , sizeof(int)); size -= sizeof(int); outdata += sizeof(int); } if(size>0) { - r = kam_rand(); + r = fastrand(); memcpy(outdata, , size); } return 1; ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:2935b65d: tls: set random number engine to fastrand for libssl1.1+
Module: kamailio Branch: 5.3 Commit: 2935b65d7d909f8ac355b8f2b5404494c4ec2c6b URL: https://github.com/kamailio/kamailio/commit/2935b65d7d909f8ac355b8f2b5404494c4ec2c6b Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:51:47+02:00 tls: set random number engine to fastrand for libssl1.1+ (cherry picked from commit 6d154fbb2ff1d2941316281fad120b5db219deb1) --- Modified: src/modules/tls/tls_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/2935b65d7d909f8ac355b8f2b5404494c4ec2c6b.diff Patch: https://github.com/kamailio/kamailio/commit/2935b65d7d909f8ac355b8f2b5404494c4ec2c6b.patch --- diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 87759249b2..75d8aa8fd2 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -561,6 +561,12 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) return -1; register_tls_hooks(_h); + +#if OPENSSL_VERSION_NUMBER >= 0x1010L + LM_DBG("setting fastrand random engine\n"); + RAND_set_rand_method(RAND_ksr_fastrand_method()); +#endif + sr_kemi_modules_add(sr_kemi_tls_exports); return 0; ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:3c11a405: tls: docs for rand_engine parameter
Module: kamailio Branch: 5.3 Commit: 3c11a405344af55aa4b9c8d35e1c181473cbdf42 URL: https://github.com/kamailio/kamailio/commit/3c11a405344af55aa4b9c8d35e1c181473cbdf42 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:52:03+02:00 tls: docs for rand_engine parameter (cherry picked from commit 787b95a5a0573d4e81b2475a84bad59076e34faf) --- Modified: src/modules/tls/doc/params.xml --- Diff: https://github.com/kamailio/kamailio/commit/3c11a405344af55aa4b9c8d35e1c181473cbdf42.diff Patch: https://github.com/kamailio/kamailio/commit/3c11a405344af55aa4b9c8d35e1c181473cbdf42.patch --- diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml index 6ef2d4123f..6028642b5f 100644 --- a/src/modules/tls/doc/params.xml +++ b/src/modules/tls/doc/params.xml @@ -1241,6 +1241,39 @@ end + + rand_engine (str) + + Set the ranondom number generator engine for libssl. + + + Note: the default random number generator (PRNG) engine of libssl v1.1.x + is not designed for multi-process applications and can result in a crash. + Therefore set the PRNG engine to one of the options listed in this + section. If libssl 1.1.x (or newer) is detected at compile time, then + the PRNG engine is set to "fastrand". + + + The following options are avaialble: + + + krand - use internal kam_rand() function + fastrand - use internal fastrand function + + + The default value is empty (not set) for libssl v1.0.x or older, and + "fastrand" for libssl v1.1.x or newer. + + + Set rand_engine parameter + +... +modparam("tls", "rand_engine", "fastrand") +... + + + + engine (string) ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:ac16e217: core: str2int() test first if result is null, otherwise init it to 0
Module: kamailio Branch: 5.3 Commit: ac16e21715e57befcba386e74214fa482bdf97d7 URL: https://github.com/kamailio/kamailio/commit/ac16e21715e57befcba386e74214fa482bdf97d7 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:52:23+02:00 core: str2int() test first if result is null, otherwise init it to 0 (cherry picked from commit b83a165e2d0e34c9bca742708c1891eb114bae04) --- Modified: src/core/ut.h --- Diff: https://github.com/kamailio/kamailio/commit/ac16e21715e57befcba386e74214fa482bdf97d7.diff Patch: https://github.com/kamailio/kamailio/commit/ac16e21715e57befcba386e74214fa482bdf97d7.patch --- diff --git a/src/core/ut.h b/src/core/ut.h index 88df8dba65..2259aea973 100644 --- a/src/core/ut.h +++ b/src/core/ut.h @@ -635,12 +635,12 @@ static inline int str2int(str* _s, unsigned int* _r) { int i; - if (_s == NULL) return -1; if (_r == NULL) return -1; + *_r = 0; + if (_s == NULL) return -1; if (_s->len < 0) return -1; if (_s->s == NULL) return -1; - *_r = 0; for(i = 0; i < _s->len; i++) { if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) { *_r *= 10; ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.3:43aa779e: tls: option to set use fastrand for rand_engine
Module: kamailio Branch: 5.3 Commit: 43aa779ee9e43805e6a7da2c12562fdc89c5c413 URL: https://github.com/kamailio/kamailio/commit/43aa779ee9e43805e6a7da2c12562fdc89c5c413 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:51:25+02:00 tls: option to set use fastrand for rand_engine (cherry picked from commit 4f514a7956534f1afc1ef30d8332f5dc3547de4b) --- Modified: src/modules/tls/tls_mod.c Modified: src/modules/tls/tls_rand.c Modified: src/modules/tls/tls_rand.h --- Diff: https://github.com/kamailio/kamailio/commit/43aa779ee9e43805e6a7da2c12562fdc89c5c413.diff Patch: https://github.com/kamailio/kamailio/commit/43aa779ee9e43805e6a7da2c12562fdc89c5c413.patch --- diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 52a45353d6..87759249b2 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -449,7 +449,10 @@ int ksr_rand_engine_param(modparam_t type, void* val) LM_DBG("random engine: %.*s\n", reng->len, reng->s); if(reng->len == 5 && strncasecmp(reng->s, "krand", 5) == 0) { LM_DBG("setting krand random engine\n"); - RAND_set_rand_method(RAND_ksr_method()); + RAND_set_rand_method(RAND_ksr_krand_method()); + } else if(reng->len == 8 && strncasecmp(reng->s, "fastrand", 8) == 0) { + LM_DBG("setting fastrand random engine\n"); + RAND_set_rand_method(RAND_ksr_fastrand_method()); } #endif return 0; diff --git a/src/modules/tls/tls_rand.c b/src/modules/tls/tls_rand.c index 0f283306dd..9101251dd7 100644 --- a/src/modules/tls/tls_rand.c +++ b/src/modules/tls/tls_rand.c @@ -27,9 +27,10 @@ #include "../../core/dprint.h" #include "../../core/rand/kam_rand.h" +#include "../../core/rand/fastrand.h" #include "fortuna/random.h" -static int ksr_rand_bytes(unsigned char *outdata, int size) +static int ksr_krand_bytes(unsigned char *outdata, int size) { int r; @@ -57,28 +58,75 @@ static int ksr_rand_bytes(unsigned char *outdata, int size) return 1; } -static int ksr_rand_pseudorand(unsigned char *outdata, int size) +static int ksr_krand_pseudorand(unsigned char *outdata, int size) { -return ksr_rand_bytes(outdata, size); +return ksr_krand_bytes(outdata, size); } -static int ksr_rand_status(void) +static int ksr_krand_status(void) { return 1; } -const RAND_METHOD _ksr_rand_method = { +const RAND_METHOD _ksr_krand_method = { NULL, -ksr_rand_bytes, +ksr_krand_bytes, NULL, NULL, -ksr_rand_pseudorand, -ksr_rand_status +ksr_krand_pseudorand, +ksr_krand_status }; -const RAND_METHOD *RAND_ksr_method(void) +const RAND_METHOD *RAND_ksr_krand_method(void) { -return &_ksr_rand_method; +return &_ksr_krand_method; +} + +static int ksr_fastrand_bytes(unsigned char *outdata, int size) +{ + int r; + + if (size < 0) { + return 0; + } else if (size == 0) { + return 1; + } + + while(size >= sizeof(int)) { + r = kam_rand(); + memcpy(outdata, , sizeof(int)); + size -= sizeof(int); + outdata += sizeof(int); + } + if(size>0) { + r = kam_rand(); + memcpy(outdata, , size); + } + return 1; +} + +static int ksr_fastrand_pseudorand(unsigned char *outdata, int size) +{ +return ksr_fastrand_bytes(outdata, size); +} + +static int ksr_fastrand_status(void) +{ +return 1; +} + +const RAND_METHOD _ksr_fastrand_method = { +NULL, +ksr_fastrand_bytes, +NULL, +NULL, +ksr_fastrand_pseudorand, +ksr_fastrand_status +}; + +const RAND_METHOD *RAND_ksr_fastrand_method(void) +{ +return &_ksr_fastrand_method; } #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ diff --git a/src/modules/tls/tls_rand.h b/src/modules/tls/tls_rand.h index 20b5a20e9c..d1a3f0d37f 100644 --- a/src/modules/tls/tls_rand.h +++ b/src/modules/tls/tls_rand.h @@ -25,7 +25,8 @@ #include -const RAND_METHOD *RAND_ksr_method(void); +const RAND_METHOD *RAND_ksr_krand_method(void); +const RAND_METHOD *RAND_ksr_fastrand_method(void); #endif /* OPENSSL_VERSION_NUMBER >= 0x1010L */ #endif ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:254d66b0: modules: readme files regenerated - modules ... [skip ci]
Module: kamailio Branch: 5.2 Commit: 254d66b0a1b88ba91dabffc3b55a0b10430a18e1 URL: https://github.com/kamailio/kamailio/commit/254d66b0a1b88ba91dabffc3b55a0b10430a18e1 Author: Kamailio Dev Committer: Kamailio Dev Date: 2019-10-07T11:01:53+02:00 modules: readme files regenerated - modules ... [skip ci] --- Modified: src/modules/db_cassandra/README --- Diff: https://github.com/kamailio/kamailio/commit/254d66b0a1b88ba91dabffc3b55a0b10430a18e1.diff Patch: https://github.com/kamailio/kamailio/commit/254d66b0a1b88ba91dabffc3b55a0b10430a18e1.patch --- diff --git a/src/modules/db_cassandra/README b/src/modules/db_cassandra/README index 99cb2bac5b..443f91f1fc 100644 --- a/src/modules/db_cassandra/README +++ b/src/modules/db_cassandra/README @@ -61,6 +61,13 @@ Chapter 1. Admin Guide 1. Overview + Note: the module requires old version of external library, not + compiling with those available out of the stock in the Linux + distributions. It is going to be kept for a while in case someone wants + to pick it up and upgrade. Also, the module was never extensively + tested, therefore take the appropriate actions in case you plan to use + it. + Db_cassandra is one of the Kamailio database modules. It does not export any functions executable from the configuration scripts, but it exports a subset of functions using the database API, and thus, other ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] Kamailio 5.2.3 on Buster - Segmentation fault in libcrypto.so.1.1 (#2077)
I think it is all fine - I have one question regarding your implementation about the wrapper functions - just write you a quick e-mail about it. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2077#issuecomment-538905950___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] Kamailio 5.2.3 on Buster - Segmentation fault in libcrypto.so.1.1 (#2077)
@henningw - ok, new random generators are going to be done to 5.3 and then backported to 5.2 and 5.1. But they are a different matter than the crash reported here and discussion here is too long to follow it over the time, if the issue needs to be revised for various purposes. If you really want to discuss more about PRNGs, better use sr-dev or create a dedicated issue. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2077#issuecomment-538905425___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:8c70c16d: app_perl: first destroy old interpreter before creating the new one
Module: kamailio Branch: 5.2 Commit: 8c70c16d10ed46f4ba8cf002a5b1599a02b5cb93 URL: https://github.com/kamailio/kamailio/commit/8c70c16d10ed46f4ba8cf002a5b1599a02b5cb93 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:43:18+02:00 app_perl: first destroy old interpreter before creating the new one - on interpreter reset, the new one may inherit globals from the old one, if that is not yet destroyed (cherry picked from commit 58047ba61d0cbceebc8c85590970a573fc396aa5) --- Modified: src/modules/app_perl/app_perl_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/8c70c16d10ed46f4ba8cf002a5b1599a02b5cb93.diff Patch: https://github.com/kamailio/kamailio/commit/8c70c16d10ed46f4ba8cf002a5b1599a02b5cb93.patch --- diff --git a/src/modules/app_perl/app_perl_mod.c b/src/modules/app_perl/app_perl_mod.c index 785d4c39b0..3112f9acce 100644 --- a/src/modules/app_perl/app_perl_mod.c +++ b/src/modules/app_perl/app_perl_mod.c @@ -262,6 +262,8 @@ PerlInterpreter *parser_init(void) { * */ int unload_perl(PerlInterpreter *p) { + /* clean and reset everything */ + PL_perl_destruct_level = 1; perl_destruct(p); perl_free(p); @@ -276,26 +278,26 @@ int unload_perl(PerlInterpreter *p) { */ int perl_reload(void) { - - PerlInterpreter *new_perl; - - new_perl = parser_init(); - - if (new_perl) { + if(my_perl) { unload_perl(my_perl); - my_perl = new_perl; + } + my_perl = parser_init(); + #ifdef PERL_EXIT_DESTRUCT_END - PL_exit_flags |= PERL_EXIT_DESTRUCT_END; + PL_exit_flags |= PERL_EXIT_DESTRUCT_END; #else #warning Perl 5.8.x should be used. Please upgrade. #warning This binary will be unsupported. - PL_exit_flags |= PERL_EXIT_EXPECTED; + PL_exit_flags |= PERL_EXIT_EXPECTED; #endif + + if(my_perl) { + LM_DBG("new perl interpreter initialized\n"); return 0; } else { - return -1; + LM_CRIT("failed to initialize a new perl interpreter - exiting\n"); + exit(-1); } - } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:d0743460: tls: add cryptorand engine also to tls_mod and documentation, enable as default
Module: kamailio Branch: master Commit: d0743460f68c0dfcb807319dc9e2247eb51ee1ba URL: https://github.com/kamailio/kamailio/commit/d0743460f68c0dfcb807319dc9e2247eb51ee1ba Author: Henning Westerholt Committer: Henning Westerholt Date: 2019-10-07T10:49:16+02:00 tls: add cryptorand engine also to tls_mod and documentation, enable as default --- Modified: src/modules/tls/doc/params.xml Modified: src/modules/tls/tls_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/d0743460f68c0dfcb807319dc9e2247eb51ee1ba.diff Patch: https://github.com/kamailio/kamailio/commit/d0743460f68c0dfcb807319dc9e2247eb51ee1ba.patch --- diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml index 6028642b5f..72d3278ed7 100644 --- a/src/modules/tls/doc/params.xml +++ b/src/modules/tls/doc/params.xml @@ -1251,7 +1251,7 @@ end is not designed for multi-process applications and can result in a crash. Therefore set the PRNG engine to one of the options listed in this section. If libssl 1.1.x (or newer) is detected at compile time, then - the PRNG engine is set to "fastrand". + the PRNG engine is set to "cryptorand". The following options are avaialble: @@ -1259,10 +1259,13 @@ end krand - use internal kam_rand() function fastrand - use internal fastrand function + cryptorand - use internal cryptorand function The default value is empty (not set) for libssl v1.0.x or older, and - "fastrand" for libssl v1.1.x or newer. + "cryptorand" for libssl v1.1.x or newer. The krand and fastrand engines are + not recommended for production use, as they will not generate secure enough + random numbers. Set rand_engine parameter diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index 75d8aa8fd2..5784ce4842 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -453,6 +453,9 @@ int ksr_rand_engine_param(modparam_t type, void* val) } else if(reng->len == 8 && strncasecmp(reng->s, "fastrand", 8) == 0) { LM_DBG("setting fastrand random engine\n"); RAND_set_rand_method(RAND_ksr_fastrand_method()); + } else if (reng->len == 10 && strncasecmp(reng->s, "cryptorand", 10) == 0) { + LM_DBG("setting cryptorand random engine\n"); + RAND_set_rand_method(RAND_ksr_cryptorand_method()); } #endif return 0; @@ -564,7 +567,7 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) #if OPENSSL_VERSION_NUMBER >= 0x1010L LM_DBG("setting fastrand random engine\n"); - RAND_set_rand_method(RAND_ksr_fastrand_method()); + RAND_set_rand_method(RAND_ksr_cryptorand_method()); #endif sr_kemi_modules_add(sr_kemi_tls_exports); ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:fdb54474: pdt: init len variable to avoid using garbage value
Module: kamailio Branch: 5.2 Commit: fdb54474b7a7cbe953f7869be41459650493e551 URL: https://github.com/kamailio/kamailio/commit/fdb54474b7a7cbe953f7869be41459650493e551 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:42:45+02:00 pdt: init len variable to avoid using garbage value (cherry picked from commit 47e0649eca286bfc26c39dd1142169fc06eea077) --- Modified: src/modules/pdt/pdtree.c --- Diff: https://github.com/kamailio/kamailio/commit/fdb54474b7a7cbe953f7869be41459650493e551.diff Patch: https://github.com/kamailio/kamailio/commit/fdb54474b7a7cbe953f7869be41459650493e551.patch --- diff --git a/src/modules/pdt/pdtree.c b/src/modules/pdt/pdtree.c index e55f5bdfa5..d0ff43871a 100644 --- a/src/modules/pdt/pdtree.c +++ b/src/modules/pdt/pdtree.c @@ -278,7 +278,6 @@ str* get_domain(pdt_tree_t *pt, str *sp, int *plen) *plen = len; return domain; - } /** @@ -287,7 +286,7 @@ str* get_domain(pdt_tree_t *pt, str *sp, int *plen) str* pdt_get_domain(pdt_tree_t *pl, str* sdomain, str *code, int *plen) { pdt_tree_t *it; - int len; + int len = 0; str *domain=NULL; if(pl==NULL || sdomain==NULL || sdomain->s==NULL || code == NULL @@ -300,13 +299,14 @@ str* pdt_get_domain(pdt_tree_t *pl, str* sdomain, str *code, int *plen) it = pl; while(it!=NULL && str_strcmp(>sdomain, sdomain)<0) it = it->next; - + if(it==NULL || str_strcmp(>sdomain, sdomain)>0) return NULL; - + domain = get_domain(it, code, ); if(plen!=NULL) - *plen = len; + *plen = len; + return domain; } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:0e22d01b: tls: option to set custom random bytess generator
Module: kamailio Branch: 5.2 Commit: 0e22d01b54340009d34db92bafb7da5a82c76cc7 URL: https://github.com/kamailio/kamailio/commit/0e22d01b54340009d34db92bafb7da5a82c76cc7 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:43:07+02:00 tls: option to set custom random bytess generator - attempt to fix GH #2077 which exposes a crash in the libssl v1.1 default random bytes generator (cherry picked from commit fc542100d85a013272dde869e54173a7d5a062f4) --- Added: src/modules/tls/tls_rand.c Added: src/modules/tls/tls_rand.h Modified: src/modules/tls/tls_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/0e22d01b54340009d34db92bafb7da5a82c76cc7.diff Patch: https://github.com/kamailio/kamailio/commit/0e22d01b54340009d34db92bafb7da5a82c76cc7.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:7829be65: speeddial: fix stripping domain prefix
Module: kamailio Branch: 5.2 Commit: 7829be6555b1da66a3802b713304cb28a5ff29a3 URL: https://github.com/kamailio/kamailio/commit/7829be6555b1da66a3802b713304cb28a5ff29a3 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:42:31+02:00 speeddial: fix stripping domain prefix - increment the index after the value is adjusted (cherry picked from commit 6861995e417c40e9ab530d4c0bed97c57de184fd) --- Modified: src/modules/speeddial/sdlookup.c --- Diff: https://github.com/kamailio/kamailio/commit/7829be6555b1da66a3802b713304cb28a5ff29a3.diff Patch: https://github.com/kamailio/kamailio/commit/7829be6555b1da66a3802b713304cb28a5ff29a3.patch --- diff --git a/src/modules/speeddial/sdlookup.c b/src/modules/speeddial/sdlookup.c index d9e52bf3cd..e26bc37bb8 100644 --- a/src/modules/speeddial/sdlookup.c +++ b/src/modules/speeddial/sdlookup.c @@ -117,7 +117,6 @@ int sd_lookup_owner(sip_msg_t* _msg, str* stable, str* sowner) db_vals[nr_keys].nul = 0; db_vals[nr_keys].val.str_val.s = puri->host.s; db_vals[nr_keys].val.str_val.len = puri->host.len; - nr_keys++; if (dstrip_s.s!=NULL && dstrip_s.len>0 && dstrip_s.lenhost.len @@ -126,6 +125,7 @@ int sd_lookup_owner(sip_msg_t* _msg, str* stable, str* sowner) db_vals[nr_keys].val.str_val.s += dstrip_s.len; db_vals[nr_keys].val.str_val.len -= dstrip_s.len; } + nr_keys++; } /* take sd from r-uri */ if (parse_sip_msg_uri(_msg) < 0) ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:3bd97b2d: jsonrpcc: removed old todo file
Module: kamailio Branch: 5.2 Commit: 3bd97b2ddaf537cad9f937485ec94391f78b17a1 URL: https://github.com/kamailio/kamailio/commit/3bd97b2ddaf537cad9f937485ec94391f78b17a1 Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:41:45+02:00 jsonrpcc: removed old todo file (cherry picked from commit fa5f36454f2ef5fb4e55dd05f746430d9786e842) --- Removed: src/modules/jsonrpcc/TODO --- Diff: https://github.com/kamailio/kamailio/commit/3bd97b2ddaf537cad9f937485ec94391f78b17a1.diff Patch: https://github.com/kamailio/kamailio/commit/3bd97b2ddaf537cad9f937485ec94391f78b17a1.patch --- diff --git a/src/modules/jsonrpcc/TODO b/src/modules/jsonrpcc/TODO deleted file mode 100644 index f0e19152f1..00 --- a/src/modules/jsonrpcc/TODO +++ /dev/null @@ -1,2 +0,0 @@ -* "Reliable" Notifications (implement using requests, and failover on error; ignore non-error responses) ? -* Implement timout for non-Linux systems ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:7c219b4a: core: init local structs to avoid use of garbage values
Module: kamailio Branch: 5.2 Commit: 7c219b4a7a2e6a8448d72789587ca10f27fcf36c URL: https://github.com/kamailio/kamailio/commit/7c219b4a7a2e6a8448d72789587ca10f27fcf36c Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:42:17+02:00 core: init local structs to avoid use of garbage values (cherry picked from commit dfe8db758f84f5e88e0cb35b80a65dcd48158897) --- Modified: src/core/forward.c Modified: src/core/ip_addr.h --- Diff: https://github.com/kamailio/kamailio/commit/7c219b4a7a2e6a8448d72789587ca10f27fcf36c.diff Patch: https://github.com/kamailio/kamailio/commit/7c219b4a7a2e6a8448d72789587ca10f27fcf36c.patch --- diff --git a/src/core/forward.c b/src/core/forward.c index a6bf221a79..11933cf132 100644 --- a/src/core/forward.c +++ b/src/core/forward.c @@ -471,6 +471,7 @@ int forward_request(struct sip_msg* msg, str* dst, unsigned short port, prev_send_sock=0; err=0; + memset(_srv_h, 0, sizeof(struct dns_srv_handle)); #endif buf=0; diff --git a/src/core/ip_addr.h b/src/core/ip_addr.h index aa5af2b2f4..df57c5faa3 100644 --- a/src/core/ip_addr.h +++ b/src/core/ip_addr.h @@ -420,6 +420,7 @@ static inline void su2ip_addr(struct ip_addr* ip, union sockaddr_union* su) break; default: LM_CRIT("unknown address family %d\n", su->s.sa_family); + memset(ip, 0, sizeof(ip_addr_t)); } } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:5.2:77c4bd32: ims_qos: fixed typo in comments (timout -> timeout)
Module: kamailio Branch: 5.2 Commit: 77c4bd3207173f7e43e67e553fb47f1f260c166e URL: https://github.com/kamailio/kamailio/commit/77c4bd3207173f7e43e67e553fb47f1f260c166e Author: Daniel-Constantin Mierla Committer: Daniel-Constantin Mierla Date: 2019-10-07T10:41:29+02:00 ims_qos: fixed typo in comments (timout -> timeout) (cherry picked from commit a6caed41166e555d7297abbae6017c5c54262662) --- Modified: src/modules/ims_qos/rx_str.c --- Diff: https://github.com/kamailio/kamailio/commit/77c4bd3207173f7e43e67e553fb47f1f260c166e.diff Patch: https://github.com/kamailio/kamailio/commit/77c4bd3207173f7e43e67e553fb47f1f260c166e.patch --- diff --git a/src/modules/ims_qos/rx_str.c b/src/modules/ims_qos/rx_str.c index efa9617222..6b243e85a4 100644 --- a/src/modules/ims_qos/rx_str.c +++ b/src/modules/ims_qos/rx_str.c @@ -104,8 +104,8 @@ int rx_send_str(str *rx_session_id) { if (auth->u.auth.state == AUTH_ST_DISCON) { // If we are in DISCON is because an STR was already sent -// so just wait for STA or for Grace Timout to happen -LM_DBG("Hmmm, auth session already in disconnected state\n"); +// so just wait for STA or for Grace Timeout to happen +LM_DBG("auth session already in disconnected state\n"); cdpb.AAASessionsUnlock(auth->hash); return CSCF_RETURN_FALSE; } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev