help-gsasl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A problem in using DIGEST-MD5 mechanism


From: makotosc
Subject: A problem in using DIGEST-MD5 mechanism
Date: Thu, 1 Nov 2007 16:23:27 +0800

Hi,
 
I got a problem in using GNU SASL library.  
I only can build SASL client/server authentication by PLAIN/EXTERN/CRAM-MD5/ANONYMOUS mechanism except DIGEST-MD5.
Is there anyone ever successful in using DIGEST-MD5 mechanism?
I also tried the example in the website (http://josefsson.org/gsasl/manual/html_node/Examples.html#Examples)
but the problem is still existed.
It always gets error from gsasl_client_start() and the returned code is 3( GSASL_MECHANISM_CALLED_TOO_MANY_TIMES).
Who can tell me where the problem is? Thanks.
 
makotosc
 
------------------------------------------------------------------------------------------------
The test code is copied from the example website and I only change the mech to "DIGEST-MD5":
 
int main (int argc, char *argv[])
{
   Gsasl *ctx = NULL;
   int rc;
    
   if ((rc = gsasl_init (&ctx)) != GSASL_OK)
   {
      printf ("Cannot initialize libgsasl (%d): %s", rc, gsasl_strerror (rc));
      return 1;
   }
   client (ctx);
   gsasl_done (ctx);
   return 0;
}
 
static void client (Gsasl * ctx)
{
   Gsasl_session *session;
   const char *mech = "DIGEST-MD5";
   int rc;
    
   if ((rc = gsasl_client_start (ctx, mech, &session)) != GSASL_OK)
   {
       printf ("Cannot initialize client (%d): %s\n", rc, gsasl_strerror (rc));
       return;
   }
   gsasl_property_set (session, GSASL_AUTHID, "jas");
   gsasl_property_set (session, GSASL_PASSWORD, "secret");
   client_authenticate (ctx, session);
   gsasl_finish (session);
}
 
static void client_authenticate (Gsasl * ctx, Gsasl_session * session)
{.......}
 
 
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]