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-44-g0a0978e


From: Simon Josefsson
Subject: [SCM] GNU gsasl branch, master, updated. gsasl-1-2-44-g0a0978e
Date: Wed, 09 Sep 2009 15:18:39 +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=0a0978edc55f61bdda776c3122eb20846618423c

The branch, master has been updated
       via  0a0978edc55f61bdda776c3122eb20846618423c (commit)
       via  0580bfbd6a35d2b9a05b1e901a6c5e3812f04af6 (commit)
      from  baf75359711fd1dd8c751ec8171c08a2804108e8 (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 0a0978edc55f61bdda776c3122eb20846618423c
Author: Simon Josefsson <address@hidden>
Date:   Wed Sep 9 17:18:34 2009 +0200

    Add skeleton parser.

commit 0580bfbd6a35d2b9a05b1e901a6c5e3812f04af6
Author: Simon Josefsson <address@hidden>
Date:   Wed Sep 9 17:12:28 2009 +0200

    Add.

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

Summary of changes:
 .gitignore                        |   63 +++++++++++++++++++++++++++++++++++++
 lib/scram/Makefile.am             |    6 ++--
 lib/scram/{tokens.h => parser.c}  |   34 ++++++++++++--------
 lib/scram/{printer.h => parser.h} |   12 +++---
 lib/scram/server.c                |   15 +++++++++
 5 files changed, 107 insertions(+), 23 deletions(-)
 create mode 100644 .gitignore
 copy lib/scram/{tokens.h => parser.c} (70%)
 copy lib/scram/{printer.h => parser.h} (80%)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3d738ff
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,63 @@
+*.la
+*.lo
+*.o
+*~
+.deps
+.libs
+ABOUT-NLS
+INSTALL
+Makefile
+Makefile.in
+TAGS
+aclocal.m4
+autom4te.cache/
+config.h
+config.h.in
+config.log
+config.status
+configure
+doc/abstraction.pdf
+doc/controlflow.pdf
+doc/controlflow2.pdf
+doc/doxygen/Doxyfile
+doc/gsasl-api-error-labels.texi
+doc/gsasl.1
+doc/gsasl.info
+doc/man/
+doc/print-errors
+doc/reference/
+doc/stamp-vti
+doc/texi/
+doc/version.texi
+examples/client
+examples/client-callback
+examples/client-mech
+examples/client-serverfirst
+gl/
+lib/aclocal.m4
+lib/autom4te.cache/
+lib/build-aux/config.guess
+lib/build-aux/config.sub
+lib/build-aux/depcomp
+lib/build-aux/install-sh
+lib/build-aux/ltmain.sh
+lib/build-aux/mdate-sh
+lib/build-aux/missing
+lib/build-aux/texinfo.tex
+lib/config.h
+lib/config.h.in
+lib/config.log
+lib/config.status
+lib/configure
+lib/libgsasl.pc
+lib/libtool
+lib/po/
+lib/stamp-h1
+libtool
+m4/
+po/
+src/gsasl
+src/gsasl_cmd.c
+src/gsasl_cmd.h
+stamp-h1
+tests/scram
diff --git a/lib/scram/Makefile.am b/lib/scram/Makefile.am
index d426fec..e8a1845 100644
--- a/lib/scram/Makefile.am
+++ b/lib/scram/Makefile.am
@@ -24,9 +24,9 @@ AM_CPPFLAGS = -I$(srcdir)/../src -I../src -I$(srcdir)/../gl 
-I../gl
 noinst_LTLIBRARIES = libgsasl-scram.la
 libgsasl_scram_la_SOURCES = scram.h mechinfo.c \
        tokens.h \
-       printer.h printer.c \
-       validate.h validate.c
-
+       validate.h validate.c \
+       parser.h parser.c \
+       printer.h printer.c
 
 if CLIENT
 libgsasl_scram_la_SOURCES += client.c
diff --git a/lib/scram/tokens.h b/lib/scram/parser.c
similarity index 70%
copy from lib/scram/tokens.h
copy to lib/scram/parser.c
index 19e4a6d..5b6b918 100644
--- a/lib/scram/tokens.h
+++ b/lib/scram/parser.c
@@ -1,4 +1,4 @@
-/* tokens.h --- Types for SCRAM tokens.
+/* parser.c --- SCRAM parser.
  * Copyright (C) 2009  Simon Josefsson
  *
  * This file is part of GNU SASL Library.
@@ -20,19 +20,25 @@
  *
  */
 
-#ifndef SCRAM_TOKENS_H
-# define SCRAM_TOKENS_H
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-/* Get size_t. */
-#include <stddef.h>
+/* Get prototypes. */
+#include "parser.h"
 
-struct scram_client_first
-{
-  char cbflag;
-  char *cbname;
-  char *authzid;
-  char *username;
-  char *client_nonce;
-};
+/* Get malloc, free. */
+#include <stdlib.h>
+
+/* Get memcpy, strlen. */
+#include <string.h>
 
-#endif /* SCRAM_TOKENS_H */
+/* Get validator. */
+#include "validate.h"
+
+int
+scram_parse_client_first (const char *str, size_t len,
+                         struct scram_client_first *cf)
+{
+  return -1;
+}
diff --git a/lib/scram/printer.h b/lib/scram/parser.h
similarity index 80%
copy from lib/scram/printer.h
copy to lib/scram/parser.h
index 56aec61..ec58204 100644
--- a/lib/scram/printer.h
+++ b/lib/scram/parser.h
@@ -1,4 +1,4 @@
-/* printer.h --- Convert SCRAM token structures into strings.
+/* parser.h --- SCRAM parser.
  * Copyright (C) 2009  Simon Josefsson
  *
  * This file is part of GNU SASL Library.
@@ -20,13 +20,13 @@
  *
  */
 
-#ifndef SCRAM_PRINTER_H
-# define SCRAM_PRINTER_H
+#ifndef SCRAM_PARSER_H
+# define SCRAM_PARSER_H
 
 /* Get token types. */
 #include "tokens.h"
 
-extern int
-scram_print_client_first (struct scram_client_first *cf, char **out);
+extern int scram_parse_client_first (const char *str, size_t len,
+                                    struct scram_client_first *cf);
 
-#endif /* SCRAM_PRINTER_H */
+#endif /* SCRAM_PARSER_H */
diff --git a/lib/scram/server.c b/lib/scram/server.c
index f081f73..feb96f7 100644
--- a/lib/scram/server.c
+++ b/lib/scram/server.c
@@ -34,6 +34,7 @@
 #include <string.h>
 
 #include "tokens.h"
+#include "parser.h"
 
 #define SNONCE_ENTROPY_BYTES 16
 
@@ -96,6 +97,20 @@ _gsasl_scram_sha1_server_step (Gsasl_session * sctx,
 
   switch (state->step)
     {
+    case 0:
+      {
+       if (scram_parse_client_first (input, input_len, &state->cf) < 0)
+         return GSASL_MECHANISM_PARSE_ERROR;
+
+       if (scram_valid_client_first (state->cf) < 0)
+         return GSASL_MECHANISM_PARSE_ERROR;
+
+       state->step++;
+       return GSASL_NEEDS_MORE;
+       break;
+      }
+
+
     default:
       break;
     }


hooks/post-receive
-- 
GNU gsasl




reply via email to

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