<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
<div>fU and rU are 10 digit numbers. My public key path is 81 characters long, could that be an issue? </div>
<div><br>
</div>
<p class="p1" style="margin: 0px; font-stretch: normal; line-height: normal; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); -webkit-text-size-adjust: auto;">
<span class="s1">if (!secsipid_add_identity("$fU", "$rU", "A", "",</span>"https://publickeypath.crt","/privatekeypath/shaken.pem") {</p>
<p class="p1" style="margin: 0px; font-stretch: normal; line-height: normal; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); -webkit-text-size-adjust: auto;">
…</p>
<p class="p1" style="margin: 0px; font-stretch: normal; line-height: normal; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); -webkit-text-size-adjust: auto;">
}</p>
<div dir="ltr"><br>
</div>
<div dir="ltr">-dan</div>
<div dir="ltr"><br>
<blockquote type="cite">On Jul 1, 2021, at 2:37 AM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr">
<p>Maybe the parameters provided to generate the header have some invalid values. Can you give the relevant config snippets for generating the header?</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 01.07.21 05:31, Daniel W. Graham wrote:<br>
</div>
<blockquote type="cite" cite="mid:E6D1C800-8390-4657-9DB7-F5B537F16000@exchange.intra.cmsinter.net">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style>
<div class="WordSection1">
<p class="MsoNormal">Here is an example, payload taken from Identity header.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Identity was added with secsipid_add_identity<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Payload test:<o:p></o:p></p>
<p class="MsoNormal">$var(test) = "eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6I5ODkyODkyMjgwIl19LCJpYXQiOjE2MjUxMDk2MzQsIm9yaWciOnsidG4iOiI5ODk0MDA0MjMwIn0sIm9yaWdpZCI6IjNmYmE4NTg0LTRkNzMtNGU2NC04NDc5LTQ5MjU2ZGIyMWFhYSJ9";<o:p></o:p></p>
<p class="MsoNormal">xlogl("L_WARN", "$(var(test){s.decode.base64t})\n");<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Result is:<o:p></o:p></p>
<p class="MsoNormal">{"attest":"A","dest":{"tn":#���#��##�#002%���&�#027B#�#023c#S#023#003�#023sB�&�&�r#��'F�#�#���C#003#003C#3#002'��&�&�v�B#�Vc�s#006f"�&6#026#022�CVCB�#023c3#022�3#0066#�#026#6#026S�r'<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">-dan<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">sr-users
<a class="moz-txt-link-rfc2396E" href="mailto:sr-users-bounces@lists.kamailio.org">
<sr-users-bounces@lists.kamailio.org></a> on behalf of Daniel Graham <a class="moz-txt-link-rfc2396E" href="mailto:dan@cmsinter.net">
<dan@cmsinter.net></a><br>
<b>Reply-To: </b>"Kamailio (SER) - Users Mailing List" <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org">
<sr-users@lists.kamailio.org></a><br>
<b>Date: </b>Wednesday, June 30, 2021 at 5:32 PM<br>
<b>To: </b>David Villasmil <a class="moz-txt-link-rfc2396E" href="mailto:david.villasmil.work@gmail.com">
<david.villasmil.work@gmail.com></a>, <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">
"miconda@gmail.com"</a> <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">
<miconda@gmail.com></a>, "Kamailio (SER) - Users Mailing List" <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org">
<sr-users@lists.kamailio.org></a><br>
<b>Subject: </b>Re: [SR-Users] SECSIPID Identity Decode<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">That’s the same way I am doing it, I was just trying to do a verification that the identity header/payload was correct before activating new changes.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I will do further testing and share results. Just found it odd that the header would decode but payload wouldn’t.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">Daniel W. Graham, CTO<o:p></o:p></p>
<p class="MsoNormal">CMSInter.net LLC<o:p></o:p></p>
<p class="MsoNormal">DIRECT (989) 400-4230<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">INTERNET | TELEPHONE | MANAGED IT<o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">David Villasmil
<a class="moz-txt-link-rfc2396E" href="mailto:david.villasmil.work@gmail.com"><david.villasmil.work@gmail.com></a><br>
<b>Date: </b>Wednesday, June 30, 2021 at 4:06 PM<br>
<b>To: </b><a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">"miconda@gmail.com"</a>
<a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a>, "Kamailio (SER) - Users Mailing List"
<a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a><br>
<b>Cc: </b>Daniel Graham <a class="moz-txt-link-rfc2396E" href="mailto:dan@cmsinter.net">
<dan@cmsinter.net></a><br>
<b>Subject: </b>Re: [SR-Users] SECSIPID Identity Decode</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I DO IT WITH: <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"># Break JWT<br>
$var(jwt1) = $(hdr(Identity){s.select,0,.}{s.decode.base64t});<br>
$var(jwt2) = $(hdr(Identity){s.select,1,.}{s.decode.base64t});<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal">David Villasmil <o:p></o:p></p>
<div>
<p class="MsoNormal">email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank" moz-do-not-send="true">
david.villasmil.work@gmail.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">phone: +34669448337<o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Jun 30, 2021 at 8:48 PM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" moz-do-not-send="true">miconda@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p>Hello,<o:p></o:p></p>
<p>not familiar with python functions, have you tried with Kamailio transformation?<o:p></o:p></p>
<p><a href="https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sdecodebase64url" target="_blank" moz-do-not-send="true">https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sdecodebase64url</a><o:p></o:p></p>
<p>Maybe you have to specify in Python that it is ASCII, I remember I had to do decoding when porting kamcli to work with Python3 -- had to change from using directly the variables received as parameter to a decoded value, something like:<o:p></o:p></p>
<p>prefix = tprefix.encode("ascii", "ignore").decode()<o:p></o:p></p>
<p>Also, if you can, share the identity header here to test with and see if can be reproduced.<o:p></o:p></p>
<p>Cheers,<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 30.06.21 21:14, Daniel W. Graham wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am unable to base64url decode the json payload in identity header generated by secsipid.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">(Using python for test)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">decoded_payload = url64.decode(‘payload’)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 27: invalid continuation byte<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Header decodes fine this way but not payload.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is this an issue with the payload encoding?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Kamailio 5.5<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Daniel W. Graham, CTO<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">CMSInter.net LLC<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">DIRECT (989) 400-4230<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">INTERNET | TELEPHONE | MANAGED IT<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>__________________________________________________________<o:p></o:p></pre>
<pre>Kamailio - Users Mailing List - Non Commercial Discussions<o:p></o:p></pre>
<pre> * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><o:p></o:p></pre>
<pre>Important: keep the mailing list in the recipients, do not reply only to the sender!<o:p></o:p></pre>
<pre>Edit mailing list options or unsubscribe:<o:p></o:p></pre>
<pre> * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a><o:p></o:p></pre>
<pre><a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a><o:p></o:p></pre>
</div>
<p class="MsoNormal">__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">
sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
</div>
</blockquote>
</body>
</html>