Found!

It looks like the translation from password to aka_K was broken as it
always copied the first 16 characters but my_auth_pass could be shorter.
I have also blanked the aka_* parameters just in case they are not
present so they don't remain uninitialized. These values are binary and
they are always used even if they are not given in the scenario.

Below you have the full patch for r253.

-Dragos

Index: call.cpp
===================================================================
--- call.cpp    (revision 253)
+++ call.cpp    (working copy)
@@ -2239,9 +2239,9 @@
     /* Build the auth credenticals */
     char uri[MAX_HEADER_LEN];
     sprintf (uri, "%s:%d", remote_ip, remote_port);
-    if (createAuthHeader(auth_comp->auth_user, auth_comp->auth_pass,
+    if (createAuthHeader(auth_comp->comp_param.auth_param.auth_user,
auth_comp->comp_param.auth_param.auth_pass,
          method, uri, body, dialog_authentication,
-         auth_comp->aka_OP, auth_comp->aka_AMF, auth_comp->aka_K,
+         auth_comp->comp_param.auth_param.aka_OP,
auth_comp->comp_param.auth_param.aka_AMF,
auth_comp->comp_param.auth_param.aka_K,
          result + authlen) == 0) {
       ERROR_P1("%s", result + authlen);
     }
Index: message.cpp
===================================================================
--- message.cpp (revision 253)
+++ message.cpp (working copy)
@@ -426,18 +426,20 @@
   getKeywordParam(keyword, "password=", my_auth_pass);
   dst->comp_param.auth_param.auth_user = strdup(my_auth_user);
   dst->comp_param.auth_param.auth_pass = strdup(my_auth_pass);
-
+
   dst->comp_param.auth_param.aka_OP = (char *)calloc(KEYWORD_SIZE, 1);
+  memset(dst->comp_param.auth_param.aka_OP,0,KEYWORD_SIZE*1);
   dst->comp_param.auth_param.aka_AMF = (char *)calloc(KEYWORD_SIZE, 1);
+  memset(dst->comp_param.auth_param.aka_AMF,0,KEYWORD_SIZE*1);
   dst->comp_param.auth_param.aka_K = (char *)calloc(KEYWORD_SIZE, 1);
-
+  memset(dst->comp_param.auth_param.aka_K,0,KEYWORD_SIZE*1);
+
   /* add aka_OP, aka_AMF, aka_K */
   getKeywordParam(keyword, "aka_OP=", dst->comp_param.auth_param.aka_OP);
   getKeywordParam(keyword, "aka_AMF=", dst->comp_param.auth_param.aka_AMF);
   getKeywordParam(keyword, "aka_K=", dst->comp_param.auth_param.aka_K);
   if (dst->comp_param.auth_param.aka_K[0]==0){
-    memcpy(dst->comp_param.auth_param.aka_K,my_auth_pass,16);
-    dst->comp_param.auth_param.aka_K[16]=0;
+   
memcpy(dst->comp_param.auth_param.aka_K,my_auth_pass,strlen(my_auth_pass));
   }
 }

Dragos Vingarzan wrote:
> Hello Olivier,
>
> It seems that you did some modification in r246 and those broke the AKA
> authentication. The patch below should make it compilable at least as
> you have changed the MessageComponent structure. It seems that even with
> those it does not work. I will dig deeper, but it's kind of hard because
> a lot changed since r223 when it worked.
>
>
> stan SIPp_svn # svn diff call.cpp
> Index: call.cpp
> ===================================================================
> --- call.cpp    (revision 253)
> +++ call.cpp    (working copy)
> @@ -2239,9 +2239,9 @@
>      /* Build the auth credenticals */
>      char uri[MAX_HEADER_LEN];
>      sprintf (uri, "%s:%d", remote_ip, remote_port);
> -    if (createAuthHeader(auth_comp->auth_user, auth_comp->auth_pass,
> +    if (createAuthHeader(auth_comp->comp_param.auth_param.auth_user,
> auth_comp->comp_param.auth_param.auth_pass,
>           method, uri, body, dialog_authentication,
> -         auth_comp->aka_OP, auth_comp->aka_AMF, auth_comp->aka_K,
> +         auth_comp->comp_param.auth_param.aka_OP,
> auth_comp->comp_param.auth_param.aka_AMF,
> auth_comp->comp_param.auth_param.aka_K,
>           result + authlen) == 0) {
>        ERROR_P1("%s", result + authlen);
>      }
>
> Cheers,
> -Dragos
>
>   


-- 
-----------------------------------------
Dipl. Eng. Dragos Vingarzan
Fraunhofer FOKUS/NGNI
Kaiserin-Augusta-Allee 31
10589 Berlin,Germany
Phone +49 (0)30 - 3463 - 7385
Mobile +49 (0)163 - 159 - 5221
Web www.fokus.fraunhofer.de www.openimscore.org
We could change the world if God would give us the source code...
-----------------------------------------------------------------


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to