gsasl-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gsasl branch, master, updated. gsasl-1-2-35-g5c1260a


From: Simon Josefsson
Subject: [SCM] GNU gsasl branch, master, updated. gsasl-1-2-35-g5c1260a
Date: Tue, 08 Sep 2009 16:42:41 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gsasl".

http://git.savannah.gnu.org/cgit/gsasl.git/commit/?id=5c1260a9c4de38d748e3839a079f2e228ee21742

The branch, master has been updated
       via  5c1260a9c4de38d748e3839a079f2e228ee21742 (commit)
      from  f228fa2341cb96fb4c7e63e18e961f7024e72632 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5c1260a9c4de38d748e3839a079f2e228ee21742
Author: Simon Josefsson <address@hidden>
Date:   Tue Sep 8 18:42:37 2009 +0200

    Add SCRAM skeleton.

-----------------------------------------------------------------------

Summary of changes:
 lib/Makefile.am       |    2 +-
 lib/configure.ac      |   23 ++++++++++++++++++-----
 lib/scram/Makefile.am |    4 ----
 lib/scram/mechinfo.c  |   36 +++++++++++++++++++++++++++++++++++-
 lib/scram/scram.h     |   10 +++++++++-
 lib/src/Makefile.am   |    4 ++++
 lib/src/init.c        |   13 +++++++++++++
 7 files changed, 80 insertions(+), 12 deletions(-)

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 05f4d1e..6355404 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -58,7 +58,7 @@ if DIGEST_MD5
 SUBDIRS += digest-md5
 endif
 
-if SCRAM_SHA1
+if SCRAM
 SUBDIRS += scram
 endif
 
diff --git a/lib/configure.ac b/lib/configure.ac
index ac90bce..9e3045f 100644
--- a/lib/configure.ac
+++ b/lib/configure.ac
@@ -152,17 +152,30 @@ AC_MSG_CHECKING([if DIGEST-MD5 should be used])
 AC_MSG_RESULT($digest_md5)
 AM_CONDITIONAL(DIGEST_MD5, test x$digest_md5 = xyes)
 
-# SCRAM-SHA1
+# SCRAM-SHA-1 and SCRAM-SHA-1-PLUS
 AC_ARG_ENABLE(scram-sha1,
-  AS_HELP_STRING([--disable-scram-sha1], [use the SCRAM-SHA1 mechanism]),
+  AS_HELP_STRING([--enable-scram-sha1], [use the SCRAM-SHA-1 mechanism]),
   scram_sha1=$enableval, scram_sha1=no)
 if test "$scram_sha1" != "no" ; then
   scram_sha1=yes
-  AC_DEFINE(USE_SCRAM_SHA1, 1, [Define to 1 if you want SCRAM-SHA1.])
+  AC_DEFINE(USE_SCRAM_SHA1, 1, [Define to 1 if you want SCRAM-SHA-1.])
 fi
-AC_MSG_CHECKING([if SCRAM-SHA1 should be used])
+AC_MSG_CHECKING([if SCRAM-SHA-1 should be used])
 AC_MSG_RESULT($scram_sha1)
-AM_CONDITIONAL(SCRAM_SHA1, test x$scram_sha1 = xyes)
+
+AC_ARG_ENABLE(scram-sha1-plus,
+  AS_HELP_STRING([--enable-scram-sha1-plus],
+                 [use the SCRAM-SHA-1-PLUS mechanism]),
+  scram_sha1_plus=$enableval, scram_sha1_plus=no)
+if test "$scram_sha1_plus" != "no" ; then
+  scram_sha1_plus=yes
+  AC_DEFINE(USE_SCRAM_SHA1_PLUS, 1,
+    [Define to 1 if you want SCRAM-SHA-1-PLUS.])
+fi
+AC_MSG_CHECKING([if SCRAM-SHA-1-PLUS should be used])
+AC_MSG_RESULT($scram_sha1_plus)
+
+AM_CONDITIONAL(SCRAM, test "$scram_sha1$scram_sha1_plus" != "nono")
 
 # GS2, first part
 AC_ARG_ENABLE(gs2,
diff --git a/lib/scram/Makefile.am b/lib/scram/Makefile.am
index 385aead..ad024ed 100644
--- a/lib/scram/Makefile.am
+++ b/lib/scram/Makefile.am
@@ -27,7 +27,3 @@ libgsasl_scram_la_SOURCES = scram.h mechinfo.c
 if CLIENT
 libgsasl_scram_la_SOURCES += client.c
 endif
-
-if SERVER
-libgsasl_scram_la_SOURCES += server.c
-endif
diff --git a/lib/scram/mechinfo.c b/lib/scram/mechinfo.c
index e97da51..a48335e 100644
--- a/lib/scram/mechinfo.c
+++ b/lib/scram/mechinfo.c
@@ -27,13 +27,46 @@
 /* Get specification. */
 #include "scram.h"
 
-Gsasl_mechanism gsasl_cram_md5_mechanism = {
+#ifdef USE_SCRAM_SHA1
+Gsasl_mechanism gsasl_scram_sha1_mechanism = {
   GSASL_SCRAM_SHA1_NAME,
   {
     NULL,
     NULL,
     NULL,
+#ifdef USE_CLIENT
+    _gsasl_scram_client_step,
+#else
     NULL,
+#endif
+    NULL,
+    NULL,
+    NULL
+  },
+  {
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+  }
+};
+#endif
+
+#ifdef USE_SCRAM_SHA1_PLUS
+Gsasl_mechanism gsasl_scram_sha1_plus_mechanism = {
+  GSASL_SCRAM_SHA1_PLUS_NAME,
+  {
+    NULL,
+    NULL,
+    NULL,
+#ifdef USE_CLIENT
+    _gsasl_scram_client_step,
+#else
+    NULL,
+#endif
     NULL,
     NULL,
     NULL
@@ -48,3 +81,4 @@ Gsasl_mechanism gsasl_cram_md5_mechanism = {
     NULL
   }
 };
+#endif
diff --git a/lib/scram/scram.h b/lib/scram/scram.h
index 6445ab9..b4c59ee 100644
--- a/lib/scram/scram.h
+++ b/lib/scram/scram.h
@@ -25,8 +25,16 @@
 
 #include <gsasl.h>
 
-#define GSASL_SCRAM_SHA1_NAME "SCRAM-SHA1"
+#define GSASL_SCRAM_SHA1_NAME "SCRAM-SHA-1"
+#define GSASL_SCRAM_SHA1_PLUS_NAME "SCRAM-SHA-1-PLUS"
 
 extern Gsasl_mechanism gsasl_scram_sha1_mechanism;
+extern Gsasl_mechanism gsasl_scram_sha1_plus_mechanism;
+
+int
+_gsasl_scram_client_step (Gsasl_session * sctx,
+                         void *mech_data,
+                         const char *input, size_t input_len,
+                         char **output, size_t * output_len);
 
 #endif /* SCRAM_H */
diff --git a/lib/src/Makefile.am b/lib/src/Makefile.am
index d14fcde..dcc7659 100644
--- a/lib/src/Makefile.am
+++ b/lib/src/Makefile.am
@@ -85,6 +85,10 @@ if DIGEST_MD5
 libgsasl_la_LIBADD += ../digest-md5/libgsasl-digest_md5.la
 endif
 
+if SCRAM
+libgsasl_la_LIBADD += ../scram/libgsasl-scram.la
+endif
+
 if NTLM
 libgsasl_la_LIBADD += ../ntlm/libgsasl-ntlm.la
 endif
diff --git a/lib/src/init.c b/lib/src/init.c
index 5bb0b63..026f7ca 100644
--- a/lib/src/init.c
+++ b/lib/src/init.c
@@ -34,6 +34,7 @@
 #include "plain/plain.h"
 #include "securid/securid.h"
 #include "digest-md5/digest-md5.h"
+#include "scram/scram.h"
 
 #include "login/login.h"
 #include "ntlm/x-ntlm.h"
@@ -101,6 +102,18 @@ register_builtin_mechs (Gsasl * ctx)
     return rc;
 #endif /* USE_CRAM_MD5 */
 
+#ifdef USE_SCRAM_SHA1
+  rc = gsasl_register (ctx, &gsasl_scram_sha1_mechanism);
+  if (rc != GSASL_OK)
+    return rc;
+#endif /* USE_SCRAM_SHA1 */
+
+#ifdef USE_SCRAM_SHA1_PLUS
+  rc = gsasl_register (ctx, &gsasl_scram_sha1_plus_mechanism);
+  if (rc != GSASL_OK)
+    return rc;
+#endif /* USE_SCRAM_SHA1_PLUS */
+
 #ifdef USE_GSSAPI
   rc = gsasl_register (ctx, &gsasl_gssapi_mechanism);
   if (rc != GSASL_OK)


hooks/post-receive
-- 
GNU gsasl




reply via email to

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