Hello,

I see you mention both base64 and base64t, while they are very similar,
there are some differences in charsets and if encoded with one might not
be properly decoded with the other. Is it only one used or it is a mix
what you try?

Cheers,
Daniel

On 28.11.24 11:32, Dirk Brouwers | CM.com via sr-users wrote:
> Dear Kamailio Developers,
>
> I am writing to report a potential bug in Kamailio's handling of base64 
> decoding when using the Lua scripting interface (app_lua). 
> It appears that base64 decoding behaves inconsistently between Lua scripts 
> and kamailio.cfg. 
>
> When using `$(var(encoded_json){s.decode.base64t})` in kamailio.cfg, where 
> $var(encoded_json) contains the encoded base64 string: `eyJmb28iOiJiYXIifQ` 
> it decodes to the correct `{"foo":"bar"}`. 
> But when using the same transformation in Lua `KSR.xlog.xinfo("Decoded in 
> Lua: ".. KSR.pv.get("$(var(encoded_json){s.decode.base64t})"))` it logs a 
> corrupted encoded base64 string:  `Decoded in Lua: 
> ..]..#035z{b.?...#036..-....`
>
> Thank you in advance for looking into this issue. Please let me know if you 
> need additional details or test cases.
>
> Kind regards,
>
> Dbrcm
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions -- 
> [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!

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- 
[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