joelsdc created an issue (kamailio/kamailio#4571)

### Description

Hi everyone,

According to the secsipid module documentation, `$secsipid(ret)` is used to 
expose the return value of the underlying libsecsipid functions.

In practice, `$secsipid(ret)` is currently only set when calling functions that 
build an Identity header (signing / header construction). Functions that verify 
an existing Identity header do not set or update `$secsipid(ret)`.

While the documentation does not explicitly state that verification functions 
should populate `$secsipid(ret)`, having consistent behavior across signing and 
verification would be very useful. This would allow routing or policy logic to 
react to specific libsecsipid verification results (for example, certificate 
expired).

### Expected behavior

secsipid functions that verify an Identity header should also set 
`$secsipid(ret)` to the return value returned by libsecsipid.

Ideally the variable would be set on every call (including success), so it does 
not keep a stale value from a previous invocation.

#### Actual observed behavior

`$secsipid(ret)` is populated when calling functions that build the Identity 
header.

#### Debugging Data

```
N/A (feature request)
```

#### Log Messages

```
N/A
```

#### SIP Traffic

```
N/A
```

### Possible Solutions

In the secsipid verification code paths, propagate the libsecsipid return value 
into `$secsipid(ret)` in the same way it is already done for the 
header-building functions.

### Additional Information

```
version: kamailio 6.0.5 (x86_64/linux)
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: unknown
compiled with gcc 14.2.0
```

* **Operating System**:

```
Linux stirshaken 6.12.63+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.63-1 
(2025-12-30) x86_64 GNU/Linux
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4571
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to