### Description
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
I used `jwt_verify()` function and expected to automatically handle the expiration check. But it doesn't.
### Troubleshooting
#### Reproduction
Have the following Kamailio config:
```
loadmodule "jwt.so"
...
modparam("jwt", "key_mode", 0)
....
$var(authorization_header_value) = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDQ0ODEiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjExMTYyMzkwMjJ9.Ce0o-10D-ghrfQ8jAZTFgJxw6pufLa6gtoCsylI9cPQo2MANVKV1sjwwKtbLfPzSobz1VhOVZ3RtbFME1GKwEOQq0MuNh7EsmMypjAyBbSPj3he0H4ysa3Lt2i8nJ2Z02j_PU387EEwziC4ilkbXNLXdx43ji_SP--dF3rij2C1Wv8AWbNloPnIAIgtTMdXRuxQPPGFhpBLfUPa54dgrRjLRSGzUJKNbszVljhpzqLM6rJ7hsf2MiB3Ww0goRH7r_9-rm4s9eYMK1xaCPlxBUIxw9bVbNkpiFypq_IcdhXnfyTsF4FUuXSgoUqGD6dOCOh6umsDfl7rrBTMRDdqT1CcBj-_CIWSwmxreVxYz1ET5cZe0oj1GnZRYFXrJzUFd1y9srV6qKY-QK1hlflONd_YZ23hpT1hXOVF0fsgB5JQBjDYBi2kLKms5zi-EAmoIVr1JVJS5-tE_iS3p40YGblI0oOOfxeKCtskgl9KtsRvUWi_25pU5BOEX8KiXVkJ2MH9KFYv2-HXrBVkZyY4kCsHIedz8k_nMfOICrh932pC2bgkQLJEZLSwtO8nTK5G1OrS_VLYwqJv0oGtnmcupexTGYiDjN6t1nqnH6s6409z16M-pKG2wwrt-40sFJh-5eDrpqs8KreSDdOYZsoB5POn7ipqZ0OfbVUCT4TzYYPA";
$var(jwt_verification) = jwt_verify("/etc/kamailio/oauth_pub.pem", "RS256",
"sub='$fU'",
"$var(authorization_header_value)"
);
xlog("JWT verification Status: $var(jwt_verification)");
#Outputs 1
...
```
If you decode the JWT you'll see that the timestamp in the `iat` header is in the past.
#### Debugging Data
#### Log Messages
```
{1 90377072 REGISTER 1d0833c1-0d75-123e-8abe-560004469ea4} <script>: JWT verification Status: 1
```
### Possible Solutions
Compare the timestamp from the token's `iat` claim with the current timestamp and fail the verification if it's in the past.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.8.2 (x86_64/linux) 3fa5f4
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 3fa5f4
compiled on 10:39:56 Jun 12 2024 with gcc 8.5.0
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
Rocky Linux 8.10 (Green Obsidian)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4007
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4007(a)github.com>
Module: kamailio
Branch: 5.7
Commit: 4ddd8de2d6c6a02a5c156d0505feb9164a7d5a3e
URL: https://github.com/kamailio/kamailio/commit/4ddd8de2d6c6a02a5c156d0505feb91…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-11-15T11:19:59+01:00
doc: update manpage with missing -B option [skip ci]
(cherry picked from commit 77f03aabd871dbf86c5106a93eb32ce67d7762bf)
(cherry picked from commit 6816f992696fe894b3a47cd511a59e1b5a0ed89b)
---
Modified: doc/man/kamailio.8
---
Diff: https://github.com/kamailio/kamailio/commit/4ddd8de2d6c6a02a5c156d0505feb91…
Patch: https://github.com/kamailio/kamailio/commit/4ddd8de2d6c6a02a5c156d0505feb91…
---
diff --git a/doc/man/kamailio.8 b/doc/man/kamailio.8
index f4fc69ade7e..05460afbddc 100644
--- a/doc/man/kamailio.8
+++ b/doc/man/kamailio.8
@@ -8,7 +8,7 @@ kamailio \- a very fast and configurable SIP server
.SH SYNOPSIS
.B kamailio
[
-.B \-hfcmMdVIhEeblLnvKrRDTNWwtugPGSQOaAxXY
+.B \-hfcmMdVIhEebBlLnvKrRDTNWwtugPGSQOaAxXY
] [
.BI \-a " auto\-aliases\-mode"
] [
@@ -16,6 +16,8 @@ kamailio \- a very fast and configurable SIP server
] [
.BI \-b " max_rcv_buf_size"
] [
+.BI \-B " max_snd_buf_size"
+] [
.BI \-f " config\-file"
] [
.BI \-g " gid"
@@ -68,7 +70,10 @@ default is yes.
Add config pre-processor define (e.g., -A WITH_AUTH, -A N=1, -A X='"Y"')
.TP
.BI \-b " max_rcv_buf_size"
-Maximum receive buffer size which will not be exceeded by the auto-probing procedure even if the OS allows.
+Maximum OS UDP receive buffer size which will not be exceeded by auto-probing-and-increase procedure even if OS allows.
+.TP
+.BI \-B " max_snd_buf_size"
+Maximum OS UDP send buffer size which will not be exceeded by auto-probing-and-increase procedure even if OS allows.
.TP
.BI \-c
Checks the config file and displays the aliases and listen interface list.
Module: kamailio
Branch: 5.8
Commit: 6816f992696fe894b3a47cd511a59e1b5a0ed89b
URL: https://github.com/kamailio/kamailio/commit/6816f992696fe894b3a47cd511a59e1…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-11-15T11:18:46+01:00
doc: update manpage with missing -B option [skip ci]
(cherry picked from commit 77f03aabd871dbf86c5106a93eb32ce67d7762bf)
---
Modified: doc/man/kamailio.8
---
Diff: https://github.com/kamailio/kamailio/commit/6816f992696fe894b3a47cd511a59e1…
Patch: https://github.com/kamailio/kamailio/commit/6816f992696fe894b3a47cd511a59e1…
---
diff --git a/doc/man/kamailio.8 b/doc/man/kamailio.8
index f4fc69ade7e..05460afbddc 100644
--- a/doc/man/kamailio.8
+++ b/doc/man/kamailio.8
@@ -8,7 +8,7 @@ kamailio \- a very fast and configurable SIP server
.SH SYNOPSIS
.B kamailio
[
-.B \-hfcmMdVIhEeblLnvKrRDTNWwtugPGSQOaAxXY
+.B \-hfcmMdVIhEebBlLnvKrRDTNWwtugPGSQOaAxXY
] [
.BI \-a " auto\-aliases\-mode"
] [
@@ -16,6 +16,8 @@ kamailio \- a very fast and configurable SIP server
] [
.BI \-b " max_rcv_buf_size"
] [
+.BI \-B " max_snd_buf_size"
+] [
.BI \-f " config\-file"
] [
.BI \-g " gid"
@@ -68,7 +70,10 @@ default is yes.
Add config pre-processor define (e.g., -A WITH_AUTH, -A N=1, -A X='"Y"')
.TP
.BI \-b " max_rcv_buf_size"
-Maximum receive buffer size which will not be exceeded by the auto-probing procedure even if the OS allows.
+Maximum OS UDP receive buffer size which will not be exceeded by auto-probing-and-increase procedure even if OS allows.
+.TP
+.BI \-B " max_snd_buf_size"
+Maximum OS UDP send buffer size which will not be exceeded by auto-probing-and-increase procedure even if OS allows.
.TP
.BI \-c
Checks the config file and displays the aliases and listen interface list.
Module: kamailio
Branch: master
Commit: 77f03aabd871dbf86c5106a93eb32ce67d7762bf
URL: https://github.com/kamailio/kamailio/commit/77f03aabd871dbf86c5106a93eb32ce…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-11-15T11:10:59+01:00
doc: update manpage with missing -B option [skip ci]
* update -l description
---
Modified: doc/man/kamailio.8
---
Diff: https://github.com/kamailio/kamailio/commit/77f03aabd871dbf86c5106a93eb32ce…
Patch: https://github.com/kamailio/kamailio/commit/77f03aabd871dbf86c5106a93eb32ce…
---
diff --git a/doc/man/kamailio.8 b/doc/man/kamailio.8
index f4fc69ade7e..9579c806020 100644
--- a/doc/man/kamailio.8
+++ b/doc/man/kamailio.8
@@ -8,7 +8,7 @@ kamailio \- a very fast and configurable SIP server
.SH SYNOPSIS
.B kamailio
[
-.B \-hfcmMdVIhEeblLnvKrRDTNWwtugPGSQOaAxXY
+.B \-hfcmMdVIhEebBlLnvKrRDTNWwtugPGSQOaAxXY
] [
.BI \-a " auto\-aliases\-mode"
] [
@@ -16,6 +16,8 @@ kamailio \- a very fast and configurable SIP server
] [
.BI \-b " max_rcv_buf_size"
] [
+.BI \-B " max_snd_buf_size"
+] [
.BI \-f " config\-file"
] [
.BI \-g " gid"
@@ -68,7 +70,10 @@ default is yes.
Add config pre-processor define (e.g., -A WITH_AUTH, -A N=1, -A X='"Y"')
.TP
.BI \-b " max_rcv_buf_size"
-Maximum receive buffer size which will not be exceeded by the auto-probing procedure even if the OS allows.
+Maximum OS UDP receive buffer size which will not be exceeded by auto-probing-and-increase procedure even if OS allows.
+.TP
+.BI \-B " max_snd_buf_size"
+Maximum OS UDP send buffer size which will not be exceeded by auto-probing-and-increase procedure even if OS allows.
.TP
.BI \-c
Checks the config file and displays the aliases and listen interface list.
@@ -132,10 +137,18 @@ Turns on via host checking when forwarding replies.
Listens on the specified address/interface. Multiple
.B \-l
mean listening on multiple addresses. The address format is
-[proto:]address[:port], where proto = udp|tcp and
-address = host|ip_address|interface_name. Example: -l localhost,
--l udp:127.0.0.1:5080, -l eth0:5062.
-The default behaviour is to listen on all the ipv4 interfaces.
+[proto:]addr_lst[:port][/advaddr][/socket_name],
+where proto=udp|tcp|tls|sctp,
+addr_list = addr|(addr, addrress),
+addr=host|ip_address|interface_name,
+advaddr=addr[:port] (advertised address) and
+socket_name=identifying name.
+E.g: -l localhost, -l udp:127.0.0.1:5080, -l eth0:5062,
+-l udp:127.0.0.1:5080/1.2.3.4:5060,
+-l udp:127.0.0.1:5080//local,
+-l udp:127.0.0.1:5080/1.2.3.4:5060/local,
+-l \"sctp:(eth0)\", -l \"(eth0, eth1, 127.0.0.1):5065\".
+The default behaviour is to listen on all the interfaces.
.TP
.BI \-\-loadmodule\fR=\fIname
load the module specified by name