gsasl-commit
[Top][All Lists]
Advanced

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

CVS gsasl/lib/src


From: gsasl-commit
Subject: CVS gsasl/lib/src
Date: Sat, 18 Sep 2004 03:37:22 +0200

Update of /home/cvs/gsasl/lib/src
In directory dopio:/tmp/cvs-serv26977/lib/src

Modified Files:
        common.c done.c error.c gsasl.h.in internal.h property.c 
Log Message:
Make LOGIN client use new callback API.
Add password/authzid properties.


--- /home/cvs/gsasl/lib/src/common.c    2004/09/18 00:58:36     1.6
+++ /home/cvs/gsasl/lib/src/common.c    2004/09/18 01:37:22     1.7
@@ -125,10 +125,11 @@
     NULL,
     NULL,
     _gsasl_login_client_start,
-    _gsasl_login_client_step,
+    NULL,
     _gsasl_login_client_finish,
     NULL,
-    NULL
+    NULL,
+    _gsasl_login_client_step
 #endif
     },
    {
--- /home/cvs/gsasl/lib/src/done.c      2004/09/18 00:58:36     1.4
+++ /home/cvs/gsasl/lib/src/done.c      2004/09/18 01:37:22     1.5
@@ -56,6 +56,10 @@
 
   if (ctx->anonymous_token)
     free (ctx->anonymous_token);
+  if (ctx->authzid)
+    free (ctx->authzid);
+  if (ctx->password)
+    free (ctx->password);
 
   free (ctx);
 
--- /home/cvs/gsasl/lib/src/error.c     2004/09/18 00:58:36     1.3
+++ /home/cvs/gsasl/lib/src/error.c     2004/09/18 01:37:22     1.4
@@ -311,7 +311,18 @@
       break;
 
     case GSASL_NO_ANONYMOUS_TOKEN:
-      p = _("Authentication failed because no anonymous token was provided.");
+      p = _("Authentication failed because the "
+           "anonymous token was not provided.");
+      break;
+
+    case GSASL_NO_AUTHZID:
+      p = _("Authentication failed because the "
+           "authorization identity was not provided.");
+      break;
+
+    case GSASL_NO_PASSWORD:
+      p = _("Authentication failed because the "
+           "password was not provided.");
       break;
 
     default:
--- /home/cvs/gsasl/lib/src/gsasl.h.in  2004/09/18 00:58:36     1.9
+++ /home/cvs/gsasl/lib/src/gsasl.h.in  2004/09/18 01:37:22     1.10
@@ -86,6 +86,8 @@
     GSASL_NO_SERVER_CODE,
     GSASL_NO_CALLBACK,
     GSASL_NO_ANONYMOUS_TOKEN,
+    GSASL_NO_AUTHZID,
+    GSASL_NO_PASSWORD,
     /* Mechanism specific errors. */
     GSASL_GSSAPI_RELEASE_BUFFER_ERROR,
     GSASL_GSSAPI_IMPORT_NAME_ERROR,
@@ -131,7 +133,9 @@
   enum Gsasl_property
   {
     GSASL_CLIENT_ANONYMOUS,
-    GSASL_CLIENT_SIMPLE,
+    GSASL_CLIENT_AUTHID,
+    GSASL_CLIENT_AUTHZID,
+    GSASL_CLIENT_PASSWORD,
     GSASL_CLIENT_PASSCODE,
     GSASL_CLIENT_PIN,
     GSASL_CLIENT_SERVICE,
--- /home/cvs/gsasl/lib/src/internal.h  2004/09/18 00:58:36     1.5
+++ /home/cvs/gsasl/lib/src/internal.h  2004/09/18 01:37:22     1.6
@@ -95,6 +95,8 @@
   Gsasl_callback cb;
   /* Global properties. */
   char *anonymous_token;
+  char *authzid;
+  char *password;
   /* Obsolete callbacks. */
   Gsasl_client_callback_authorization_id cbc_authorization_id;
   Gsasl_client_callback_authentication_id cbc_authentication_id;
@@ -135,6 +137,8 @@
   /* Session specific properties.  If NULL, use corresponding global
    * property. */
   char *anonymous_token;
+  char *authzid;
+  char *password;
 };
 
 #endif /* _INTERNAL_H */
--- /home/cvs/gsasl/lib/src/property.c  2004/09/18 00:58:36     1.1
+++ /home/cvs/gsasl/lib/src/property.c  2004/09/18 01:37:22     1.2
@@ -33,6 +33,14 @@
       p = &sctx->anonymous_token;
       break;
 
+    case GSASL_CLIENT_AUTHZID:
+      p = &sctx->authzid;
+      break;
+
+    case GSASL_CLIENT_PASSWORD:
+      p = &sctx->password;
+      break;
+
     default:
       break;
     }
@@ -52,6 +60,14 @@
       p = &ctx->anonymous_token;
       break;
 
+    case GSASL_CLIENT_AUTHZID:
+      p = &ctx->authzid;
+      break;
+
+    case GSASL_CLIENT_PASSWORD:
+      p = &ctx->password;
+      break;
+
     default:
       break;
     }
@@ -214,6 +230,8 @@
   if (!p)
     {
       Gsasl_client_callback_anonymous cb_anonymous;
+      Gsasl_client_callback_authorization_id cb_authorization_id;
+      Gsasl_client_callback_password cb_password;
       char buf[BUFSIZ];
       size_t buflen = BUFSIZ - 1;
       int res;
@@ -234,6 +252,29 @@
          gsasl_property_set (sctx, prop, buf);
          break;
 
+       case GSASL_CLIENT_AUTHZID:
+         cb_authorization_id =
+           gsasl_client_callback_authorization_id_get (sctx->ctx);
+         if (!cb_authorization_id)
+           break;
+         res = cb_authorization_id (sctx, buf, &buflen);
+         if (res != GSASL_OK)
+           break;
+         buf[buflen] = '\0';
+         gsasl_property_set (sctx, prop, buf);
+         break;
+
+       case GSASL_CLIENT_PASSWORD:
+         cb_password = gsasl_client_callback_password_get (sctx->ctx);
+         if (!cb_password)
+           break;
+         res = cb_password (sctx, buf, &buflen);
+         if (res != GSASL_OK)
+           break;
+         buf[buflen] = '\0';
+         gsasl_property_set (sctx, prop, buf);
+         break;
+
        default:
          break;
        }





reply via email to

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