- adds count pv and sel for DNS, EMAIL, IP, URI
- adds ability to access SAN entries by index
fix #3400
<!-- Kamailio Pull Request Template -->
#### 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 you're unsure about any of these, don't 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)
- [x] 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
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] 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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #3400
#### Description
Fix issue #3400 that describes that tls module cannot properly handle certificates with multiple SAN entries.
Add ability to access SAN entries by index.
Add ability to get count of supported SAN entries by type of entry.
If index is not provided will return first entry (current behavior to remain backwards compatible.
Tested by creating a self signed SAN cert with 3 DNS entries and confirmed expected results for:
$(tls_peer_san_hostname[2])
$(tls_peer_san_hostname);
$tls_peer_san_count(DNS)
$tls_peer_san_count(URI)
$tls_peer_san_count(EMAIL)
$tls_peer_san_count(IP)
$sel(tls.peer.dns[1])
$sel(tls.peer.dns)
$sel(tls.peer.count[\"DNS\"])
$(tls_peer_san_ip[0])
$(tls_peer_san_uri)
$sel(tls.peer.ip[0])
$sel(tls.peer.count[\"EMAIL\"])
$(tls_my_san_hostname[2])
$(tls_my_san_hostname)
$tls_my_san_count(DNS)
$tls_my_san_count(URI)
$tls_my_san_count(EMAIL)
$tls_my_san_count(IP)
$sel(tls.my.dns[1])
$sel(tls.my.dns)
$sel(tls.my.count[\"DNS\"]
$(tls_my_san_ip[0])]
$(tls_my_san_uri)
$sel(tls.my.ip[0])
$sel(tls.my.count[\"EMAIL\"])
Also repeated the test with a self signed cert with 3 DNS entries, 1 IP entry, 1 EMAIL entry and 1 URI entry
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3408
-- Commit Summary --
* tls: get san entries by index
-- File Changes --
M src/modules/tls/tls_select.c (314)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3408.patchhttps://github.com/kamailio/kamailio/pull/3408.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3408
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3408(a)github.com>
### Description
Our partner sending a call with this header
```
From: "COVER JERRY & M" <sip:+12099283442@206.147.236.174:5060;otg=TLMNCAXFDS0_3887>;tag=gK0c7f90e2
```
According [RFC3261](https://www.rfc-editor.org/rfc/rfc3261#section-25.1)
```
Several rules are incorporated from RFC 2396 [5] but are updated to
make them compliant with RFC 2234 [10]. These include:
reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+"
/ "$" / ","
unreserved = alphanum / mark
mark = "-" / "_" / "." / "!" / "~" / "*" / "'"
/ "(" / ")"
escaped = "%" HEXDIG HEXDIG
```
Also
```
SIP follows the requirements and guidelines of RFC 2396 [5] when
defining the set of characters that must be escaped in a SIP URI, and
uses its ""%" HEX HEX" mechanism for escaping. From RFC 2396 [5]:
The set of characters actually reserved within any given URI
component is defined by that component. In general, a character
is reserved if the semantics of the URI changes if the character
is replaced with its escaped US-ASCII encoding [5]. Excluded US-
ASCII characters (RFC 2396 [5]), such as space and control
characters and characters used as URI delimiters, also MUST be
escaped. URIs MUST NOT contain unescaped space and control
characters.
```
And
```
Expanding the hname and hvalue tokens in Section 25 show that all URI
reserved characters in header field names and values MUST be escaped.
```
For now, looks like `the sanity` module does not check reserver char usage.
This ticket was created to collect recommendations for feature implementation.
Should be checked headers?
Maybe a similar check is already present in the code and you can provide a reference?
Unscaped reserved char usage in "From", "To", "P-Asserted-Identity" and "Remote-Party-ID" for display name breaking SIP message (for example the "lost" module cannot parse properly "From" header). Should such be implemented in the Kamailio core also?
### Expected behavior
One of these expected:
1) Kamailio drop a message with reserved char usage in the header names and values. For TCP and TLS transport drop connection;
2) sanity module allows checking reserved char usage in the header names and values.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3421
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3421(a)github.com>
Module: kamailio
Branch: master
Commit: 4c8276fcf268a690ea671c4ddeaad1f89e293565
URL: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
kex: typos
---
Modified: src/modules/kex/core_stats.c
Modified: src/modules/kex/doc/kex_admin.xml
Modified: src/modules/kex/kex_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
Patch: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
---
diff --git a/src/modules/kex/core_stats.c b/src/modules/kex/core_stats.c
index 565ce4e77d7..816ae39a90f 100644
--- a/src/modules/kex/core_stats.c
+++ b/src/modules/kex/core_stats.c
@@ -409,7 +409,7 @@ struct rpc_list_params {
/**
- * Satistic getter RPC callback.
+ * Statistic getter RPC callback.
*/
static void rpc_get_grp_vars_cbk(void* p, str* g, str* n, counter_handle_t h)
{
@@ -644,7 +644,7 @@ static void rpc_stats_fetchn_statistics(rpc_t* rpc, void* ctx)
}
/**
- * Satistic reset/clear-er RPC callback..
+ * Statistic reset/clear-er RPC callback..
*/
static void rpc_reset_or_clear_grp_vars_cbk(void* p, str* g, str* n,
counter_handle_t h)
diff --git a/src/modules/kex/doc/kex_admin.xml b/src/modules/kex/doc/kex_admin.xml
index 34484bc4ec8..5c597e97047 100644
--- a/src/modules/kex/doc/kex_admin.xml
+++ b/src/modules/kex/doc/kex_admin.xml
@@ -88,7 +88,7 @@ setsflag("$var(flag)");
<section id="kex.f.issflagset">
<title><function moreinfo="none">issflagset(flag)</function></title>
<para>
- Return true of the script flag is set.
+ Return true if the script flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
@@ -179,7 +179,7 @@ setbflag("$var(flag)", "1");
<section id="kex.f.isbflagset">
<title><function moreinfo="none">isbflagset(flag [, branch])</function></title>
<para>
- Return true of the branch flag is set.
+ Return true if the branch flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
@@ -762,7 +762,7 @@ resetdebug();
</title>
<para>Print the list of available internal statistics.</para>
<para>NOTE: the result is an array of strings that have the list of
- statistics formated like "name = value", being propagated over the time
+ statistics formatted like "name = value", being propagated over the time
from the MI variant. Use "stats.fetch" or "stats.fetchn"commands to have
a more JSON-friendly output.</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
@@ -785,7 +785,7 @@ resetdebug();
<para>Print the list of available internal statistics with a more
json friendly output. Each printed statistic is a field in the output
structure: {"statsgroup.statsname" : "statsvalue"}. The value is
- represented as string to accomodate large numbers.</para>
+ represented as string to accommodate large numbers.</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
be printed. If set to 'all' then all statistics are printed; if
set to 'statsgroup:' then all statistics in the group are printed;
diff --git a/src/modules/kex/kex_mod.c b/src/modules/kex/kex_mod.c
index e46e85b5cf4..1927c7343d3 100644
--- a/src/modules/kex/kex_mod.c
+++ b/src/modules/kex/kex_mod.c
@@ -141,7 +141,7 @@ static int mod_init(void)
register_pkg_proc_stats();
pkg_proc_stats_init_rpc();
- /* per module memmory debugging RPC command */
+ /* per module memory debugging RPC command */
mod_stats_init_rpc();
return 0;
Module: kamailio
Branch: master
Commit: 285a260687d4dce5636531a4ffffc43b0d37e883
URL: https://github.com/kamailio/kamailio/commit/285a260687d4dce5636531a4ffffc43…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
jsonrpcs: typos
---
Modified: src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
Modified: src/modules/jsonrpcs/jsonrpcs_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/285a260687d4dce5636531a4ffffc43…
Patch: https://github.com/kamailio/kamailio/commit/285a260687d4dce5636531a4ffffc43…
---
diff --git a/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml b/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
index 9e558c4cfd..0e39676edd 100644
--- a/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
+++ b/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
@@ -380,7 +380,7 @@ modparam("jsonrpcs", "dgram_user", "root")
<section id="jsonrpcs.p.dgram_timeout">
<title><varname>dgram_timeout</varname> (int)</title>
<para>
- The reply will expire after trying to sent it for socket_timeout
+ The reply will expire after trying to send it for socket_timeout
milliseconds.
</para>
<para>
diff --git a/src/modules/jsonrpcs/jsonrpcs_mod.c b/src/modules/jsonrpcs/jsonrpcs_mod.c
index e369c62569..8ce008ccb5 100644
--- a/src/modules/jsonrpcs/jsonrpcs_mod.c
+++ b/src/modules/jsonrpcs/jsonrpcs_mod.c
@@ -298,7 +298,7 @@ static int jsonrpc_delayed_reply_ctx_init(jsonrpc_ctx_t* ctx)
/** Implementation of rpc_fault function required by the management API.
*
* This function will be called whenever a management function
- * indicates that an error ocurred while it was processing the request. The
+ * indicates that an error occurred while it was processing the request. The
* function takes the reply code and reason phrase as parameters, these will
* be put in the body of the reply.
*
@@ -340,7 +340,7 @@ static void jsonrpc_fault(jsonrpc_ctx_t* ctx, int code, char* fmt, ...)
* This is the function that will be called whenever a management function
* asks the management interface to send the reply to the client.
* The SIP/HTTP reply sent to
- * the client will be always 200 OK, if an error ocurred on the server then it
+ * the client will be always 200 OK, if an error occurred on the server then it
* will be indicated in the html document in body.
*
* @param ctx A pointer to the context structure of the jsonrpc request that
@@ -1191,7 +1191,7 @@ static void jsonrpc_delayed_ctx_close(struct rpc_delayed_ctx* dctx)
(hdr->parsed<(void*)r_ctx->msg ||
hdr->parsed>=(void*)(r_ctx->msg+r_ctx->msg_shm_block_size))) {
/* header parsed filed doesn't point inside uas.request memory
- * chunck -> it was added by failure funcs.-> free it as pkg */
+ * chunk -> it was added by failure funcs.-> free it as pkg */
DBG("removing hdr->parsed %d\n", hdr->type);
clean_hdr_field(hdr);
hdr->parsed = 0;
Module: kamailio
Branch: master
Commit: 8c5a8ce562e5ab98a7e6bdf163bab833ec3a7cf5
URL: https://github.com/kamailio/kamailio/commit/8c5a8ce562e5ab98a7e6bdf163bab83…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
jwt: typo algoritm ������ algorithm
---
Modified: src/modules/jwt/doc/jwt_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/8c5a8ce562e5ab98a7e6bdf163bab83…
Patch: https://github.com/kamailio/kamailio/commit/8c5a8ce562e5ab98a7e6bdf163bab83…
---
diff --git a/src/modules/jwt/doc/jwt_admin.xml b/src/modules/jwt/doc/jwt_admin.xml
index 165ca170f95..5389bb61f30 100644
--- a/src/modules/jwt/doc/jwt_admin.xml
+++ b/src/modules/jwt/doc/jwt_admin.xml
@@ -101,7 +101,7 @@ modparam("jwt", "key_mode", 1)
</listitem>
<listitem>
<para>
- alg - the algoritm to build the signature, as supported by the
+ alg - the algorithm to build the signature, as supported by the
libjwt (e.g., RS256, HS256, ES256, ...)
</para>
</listitem>
@@ -158,7 +158,7 @@ modparam("jwt", "key_mode", 1)
</listitem>
<listitem>
<para>
- alg - the algoritm to build the signature, as supported by the
+ alg - the algorithm to build the signature, as supported by the
libjwt (e.g., RS256, HS256, ES256, ...)
</para>
</listitem>
@@ -210,7 +210,7 @@ modparam("jwt", "key_mode", 1)
</listitem>
<listitem>
<para>
- alg - the algoritm to build the signature, as supported by the
+ alg - the algorithm to build the signature, as supported by the
libjwt (e.g., RS256, HS256, ES256, ...)
</para>
</listitem>