Subject: [Sip] Response calculation for Authorization header (fwd)

From: Rinchen Tundup <[email-masked]>
Date: Wed, 9 Jul 2003 15:00:56 +0530 (IST)

hi all ,

I am using the HTTP Authentication RFC code to calculate
"response" for Authorization header. 
I am using estara and SIEMENS proxy to cross check the generated result.

estara and Siemens proxy works fine  ( authentication  works fine )

Message dumps between them :-
SIP/2.0 407 Proxy Authentication Required
Call-ID: [email-masked]
CSeq: 7155859 INVITE
From: <sip:[email-masked]>;tag=5f1878f0
To: sip:[email-masked]
Via: SIP/2.0/UDP 192.168.6.114:5060
Content-Length: 0
Proxy-Authenticate:Digest
realm="cdot",nonce="1b8afbde897ce542346164da91a35b",opaque="IWUSipProxy",stale=FALSE,algorithm=MD5,qop="auth"

INVITE sip:[email-masked] SIP/2.0
Via: SIP/2.0/UDP 192.168.6.114:5060
From: <sip:[email-masked]>;tag=5f1878f0
To: sip:[email-masked]
Contact: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 7155860 INVITE
Content-Length: 173
Content-Type: application/sdp
User-Agent: eStara SoftPHONE
Supported: com.estara.mux
Proxy-Authorization:  Digest
username="123",realm="cdot",nonce="1b8afbde897ce542346164da91a35b",response="a016c94a34fd3516fe01177eb4dc4a9e",uri="sip:[email-masked]",opaque="IWUSipProxy"

above works fine 

But using the HTTP auth code :-
   /* Get frm 401 */
	  char * pszNonce = "1b8afbde897ce542346164da91a35b";
	  /* client to choose cnonce */
      char * pszCNonce = "a12";  /* what should be this ?? It can't be
NULL i suppose */
	  /* ph no icw */
      char * pszUser = "123";
      char * pszRealm = "cdot";
      char * pszPass = "123";
      char * pszAlg = "MD5";
      char szNonceCount[9] = "00000001"; /* ?????? what about this */
      char * pszMethod = "INVITE";
      char * pszQop = "auth";
	  /* request uri */
      char * pszURI = "sip:[email-masked]";
      HASHHEX HA1;
      HASHHEX HA2 = "";
      HASHHEX Response;

      DigestCalcHA1(pszAlg, pszUser, pszRealm, pszPass, pszNonce,
pszCNonce, HA1);
      DigestCalcResponse(HA1, pszNonce, szNonceCount, pszCNonce, pszQop,
       pszMethod, pszURI, HA2, Response);
      printf("Response = %s\n", Response);

I get response as ..
Response = 290050605274e103212bd3eac00b10df 

which is not correct ? 

My question is 
1. what should be value of cnonce and nc(nonce count) , since this values
are must for response calulation? 
2.how estara is calculating response without them (as they are not
forming any cnonce or nc parameters)? 
3. how should a client choose cnonce and nc values ?
4. Am i going wrong some where ?  
5. For a given username , passwd , nonce etc how can i check whether my
generated response is corrrect or not ? any freely available tool to check
that  or any standard docs available ?

pls help 
thanks in advance ..

Greetings

Rinchen Tundup      
Delhi

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip