<font face="arial,helvetica,sans-serif">My changes are just hack, it may not be optimized. I will make you an archive today but could you tell me if fixup_pvar_pvar is supposed to do the job correctly? I would like to solve this asap to continue. <br>

<br>Regards,<br>Alexandre.<br></font><br><div class="gmail_quote">On Fri, Jun 4, 2010 at 4:59 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Alexandre,<br>
<br>
Could you please send an unified diff with your changes?<br>
<br>
Regards,<br>
Bogdan<br>
<div><div></div><div class="h5"><br>
Alexandre Westfahl ($B%"%l%C%/%5%s%I%k!!%&%(%9%U%!%k(B) wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I am using OpenSIPS with auth_radius module to simulate to radius<br>
&gt; client with my Diameter/Radius Gateway. With scripting variables I<br>
&gt; succeeded for a part but I still have some problems. I change some<br>
&gt; functions to make opensips and my requests fully compliant to RFC 5090.<br>
&gt;<br>
&gt; First, there is some bugs in names. For example, two variables have<br>
&gt; the same name and one of them was with the wrong number to parse. Here<br>
&gt; is a propose change:<br>
&gt; pvar.c<br>
&gt;<br>
&gt; &nbsp; &nbsp; {{&quot;an&quot;, (sizeof(&quot;an&quot;)-1)}, /* */<br>
&gt; &nbsp; &nbsp; PVT_AUTH_NONCE, pv_get_authattr, 0,<br>
&gt; &nbsp; &nbsp; 0, 0, pv_init_iname, 5},<br>
&gt; &nbsp; &nbsp; {{&quot;aR&quot;, (sizeof(&quot;aR&quot;)-1)}, /* */<br>
&gt; &nbsp; &nbsp; PVT_AUTH_RESPONSE, pv_get_authattr, 0,<br>
&gt; &nbsp; &nbsp; 0, 0, pv_init_iname, 6},<br>
&gt;<br>
&gt;<br>
&gt; Second, I changed some functions in aaa_radius because I need high<br>
&gt; customization (to make it compliant with RFC5090).<br>
&gt; I changed &quot;proxy_challenge&quot; and I want to give as parameters realm and<br>
&gt; nonce (nonce must be done on diameter server). I succeeded in making<br>
&gt; static parameters but if I try this:<br>
&gt;<br>
&gt; &nbsp; &nbsp; xlog(&quot;realm: $var(realm), nonce: $var(nonce)\n&quot;);<br>
&gt; &nbsp; &nbsp; proxy_challenge( &quot;$var(realm)&quot;, &quot;$var(nonce)&quot;);<br>
&gt;<br>
&gt; In xlog, everything is Ok but in proxy_challenge, I obtain variables<br>
&gt; as they are, e.g.&quot;$var(realm)&quot;. It&#39;s hard to get into opensips source<br>
&gt; in just one day but I found that there is a translator in auth_mod.c.<br>
&gt; Here is the non controlled.<br>
&gt;<br>
&gt; &nbsp; &nbsp; {&quot;proxy_challenge&quot;, (cmd_function)proxy_challenge, 2,<br>
&gt; &nbsp; &nbsp; 0, 0, REQUEST_ROUTE},<br>
&gt;<br>
&gt; Obtained values are as I said before.<br>
&gt;<br>
&gt; If I try, to activate a translator:<br>
&gt;<br>
&gt; &nbsp; &nbsp; {&quot;proxy_challenge&quot;, (cmd_function)proxy_challenge, 2,<br>
&gt; &nbsp; &nbsp; fixup_pvar_pvar, 0, REQUEST_ROUTE},<br>
&gt;<br>
&gt; It&#39;s supposed to work but I obtain &quot;N&quot; for both values.<br>
&gt;<br>
&gt;<br>
&gt; For information, here is my opensips.cfg:<br>
&gt;<br>
&gt; &nbsp; &nbsp; # We are in REGISTER part!<br>
&gt; &nbsp; &nbsp; $var(method)=&quot;REGISTER&quot;;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; if ($adu == NULL)<br>
&gt; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; radius_send_auth(&quot;Frequest&quot;,&quot;challenge&quot;);<br>
&gt; &nbsp; &nbsp; #Digest-Realm = $var(realm),Digest-Nonce = $var(nonce),Digest-Qop<br>
&gt; &nbsp; &nbsp; = $var(qop),Digest-Algorithm = $var(algorithm)<br>
&gt;<br>
&gt; &nbsp; &nbsp; xlog(&quot;realm: $var(realm), nonce: $var(nonce)\n&quot;);<br>
&gt;<br>
&gt; &nbsp; &nbsp; proxy_challenge( &quot;$var(realm)&quot;, &quot;$var(nonce)&quot;);<br>
&gt; &nbsp; &nbsp; exit;<br>
&gt; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; else<br>
&gt; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; radius_send_auth(&quot;request&quot;,&quot;result&quot;);<br>
&gt; &nbsp; &nbsp; xlog( &quot;SECOND REQUEST!!!!!!!!!!!!!!!\n&quot;);<br>
&gt; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; xlog(&quot;**********************************OUT&quot;);<br>
&gt;<br>
&gt;<br>
&gt; I changed all functions after proxy_challenge (like challenge...) to<br>
&gt; give the nonce, don&#39;t ask for qop (always on) and don&#39;t manage nonce<br>
&gt; index as it&#39;s not sip server job.<br>
&gt;<br>
&gt;<br>
&gt; I hope I was clear in my questions.<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; Best regards,<br>
&gt; Alexandre Westfahl,<br>
&gt; Keio University, Yokohama<br>
&gt; Teraoka Lab.<br>
&gt; Linux User: #458230<br>
&gt; PGP: EACE5768<br>
</div></div>&gt; ------------------------------------------------------------------------<br>
<div class="im">&gt;<br>
&gt; _______________________________________________<br>
&gt; Devel mailing list<br>
&gt; <a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
&gt;<br>
<br>
<br>
</div><font color="#888888">--<br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Alexandre Westfahl,<br>Keio University, Yokohama<br>Teraoka Lab.<br>Linux User: #458230<br>PGP: EACE5768<br>