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-5-1-13-gf1094f4


From: Simon Josefsson
Subject: [SCM] GNU gsasl branch, master, updated. gsasl-1-5-1-13-gf1094f4
Date: Thu, 29 Apr 2010 10:47:46 +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=f1094f4eabfa698c7269b3a31ef7ba121029857a

The branch, master has been updated
       via  f1094f4eabfa698c7269b3a31ef7ba121029857a (commit)
       via  d0abfd4443916b15f8d8852df052cd1fefdff8dc (commit)
       via  d79d6209cee857373c0f6b1422bd9e14b8be649b (commit)
       via  2ad9c4a7891ac14690e487cfab58ffeab4bc36f2 (commit)
       via  d50b0dc79919dc139c58bd39b9bf08f13e1b360c (commit)
       via  7252301c2ebeb2babfce3266f146df65a48d4503 (commit)
       via  0b606e0249ddd8386da892325dc2fbf5dff768b7 (commit)
       via  d463bc65f48c9a04ead2f941207a906d960b0389 (commit)
       via  8a28a5458b3add375ae260ae102e03c8c5009a41 (commit)
       via  0060c67e0c1b73eee12be8d7515423aa7c163376 (commit)
      from  dc773fa6eb38cc7c8a67e6fdaa70be429b632b14 (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 f1094f4eabfa698c7269b3a31ef7ba121029857a
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 12:47:34 2010 +0200

    Add.

commit d0abfd4443916b15f8d8852df052cd1fefdff8dc
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 12:46:57 2010 +0200

    More extension checking.

commit d79d6209cee857373c0f6b1422bd9e14b8be649b
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 12:19:44 2010 +0200

    Update gnulib files.  Add c-ctype module, for SCRAM.

commit 2ad9c4a7891ac14690e487cfab58ffeab4bc36f2
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 12:16:03 2010 +0200

    SCRAM server: ignore extensions in client-final.

commit d50b0dc79919dc139c58bd39b9bf08f13e1b360c
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 12:13:23 2010 +0200

    Test extension parameters.

commit 7252301c2ebeb2babfce3266f146df65a48d4503
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 11:15:03 2010 +0200

    Don't ignore unexpected successes for i=16,17.

commit 0b606e0249ddd8386da892325dc2fbf5dff768b7
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 11:11:52 2010 +0200

    Test two failure modes with mismatching c= fields.

commit d463bc65f48c9a04ead2f941207a906d960b0389
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 11:03:45 2010 +0200

    SCRAM server: Compare c= field in client-final to match client-first.
    
    Reported by Marc Santamaria <address@hidden>.

commit 8a28a5458b3add375ae260ae102e03c8c5009a41
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 10:41:42 2010 +0200

    Check that server supports n=y.

commit 0060c67e0c1b73eee12be8d7515423aa7c163376
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 10:41:04 2010 +0200

    SCRAM server: Interop against clients that supports channel bindings.
    
    Reported by Marc Santamaria <address@hidden>.

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

Summary of changes:
 THANKS                                  |    4 ++-
 gl/Makefile.am                          |    6 ++-
 gl/m4/gnulib-cache.m4                   |    4 +-
 gl/m4/gnulib-common.m4                  |    8 ++++-
 gl/m4/netdb_h.m4                        |    7 +++-
 gl/m4/unistd_h.m4                       |    3 +-
 gl/netdb.in.h                           |   30 +++++++++++++++-
 gl/unistd.in.h                          |   15 +++++++-
 gltests/init.sh                         |    8 +++--
 lib/gl/Makefile.am                      |    9 ++++-
 {gl => lib/gl}/c-ctype.c                |    8 ++--
 {gl => lib/gl}/c-ctype.h                |    8 ++--
 lib/gl/m4/gnulib-cache.m4               |    5 ++-
 lib/gl/m4/gnulib-common.m4              |    8 ++++-
 lib/gl/m4/gnulib-comp.m4                |    6 +++
 lib/gl/m4/unistd_h.m4                   |    3 +-
 lib/gl/unistd.in.h                      |   15 +++++++-
 lib/gltests/Makefile.am                 |    9 +++++
 {gltests => lib/gltests}/test-c-ctype.c |    0
 lib/maint.mk                            |   25 +++++++++++++
 lib/scram/parser.c                      |   36 ++++++++++++++++---
 lib/scram/server.c                      |   27 +++++++++++++-
 maint.mk                                |   25 +++++++++++++
 tests/scram.c                           |   61 ++++++++++++++++++++++++++++++-
 24 files changed, 294 insertions(+), 36 deletions(-)
 copy {gl => lib/gl}/c-ctype.c (97%)
 copy {gl => lib/gl}/c-ctype.h (97%)
 copy {gltests => lib/gltests}/test-c-ctype.c (100%)

diff --git a/THANKS b/THANKS
index 1970719..c1945d5 100644
--- a/THANKS
+++ b/THANKS
@@ -1,5 +1,6 @@
 GNU SASL THANKS -- Acknowledgements.
-Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson
+Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+              2009, 2010 Simon Josefsson
 See the end for copying conditions.
 
 GNU SASL uses libntlm by Grant Edwards maintained by Simon Josefsson;
@@ -40,6 +41,7 @@ Andery Melnikov <address@hidden>
 Vincent Untz <address@hidden>
 Marco Maggi <address@hidden>
 "carlo.bramix" <address@hidden>
+Marc Santamaria <address@hidden>
 
 ----------------------------------------------------------------------
 Copying and distribution of this file, with or without modification,
diff --git a/gl/Makefile.am b/gl/Makefile.am
index be30a2d..7741b52 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gltests --aux-dir=lib/build-aux --with-tests --libtool 
--macro-prefix=gl --no-vc-files autobuild close connect error exit fdl-1.3 
gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 maintainer-makefile 
manywarnings netdb netinet_in pmccabe2html poll progname quote readline recv 
shutdown socket striconv strtok_r sys_time unistd version-etc warnings xalloc
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gltests --aux-dir=lib/build-aux --with-tests 
--avoid=fcntl-h-c++-tests --avoid=iconv-h-c++-tests --avoid=stdio-c++-tests 
--avoid=stdlib-c++-tests --avoid=string-c++-tests --avoid=sys_ioctl-c++-tests 
--avoid=sys_select-c++-tests --avoid=sys_socket-c++-tests 
--avoid=sys_stat-c++-tests --avoid=sys_time-c++-tests --avoid=time-c++-tests 
--avoid=unistd-c++-tests --avoid=wchar-c++-tests --avoid=wctype-c++-tests 
--libtool --macro-prefix=gl --no-vc-files autobuild close connect error exit 
fdl-1.3 gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 
maintainer-makefile manywarnings netdb netinet_in pmccabe2html poll progname 
quote readline recv shutdown socket striconv strtok_r sys_time unistd 
version-etc warnings xalloc
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -634,7 +634,7 @@ BUILT_SOURCES += netdb.h
 
 # We need the following in order to create <netdb.h> when the system
 # doesn't have one that works with the given compiler.
-netdb.h: netdb.in.h $(ARG_NONNULL_H)
+netdb.h: netdb.in.h $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -648,6 +648,7 @@ netdb.h: netdb.in.h $(ARG_NONNULL_H)
              -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
              -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/netdb.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -1447,6 +1448,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
              -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index a1ac47c..f793dbf 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests 
--aux-dir=lib/build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files 
autobuild close connect error exit fdl-1.3 gendocs getaddrinfo getopt-gnu 
getpass gpl-3.0 lgpl-2.1 maintainer-makefile manywarnings netdb netinet_in 
pmccabe2html poll progname quote readline recv shutdown socket striconv 
strtok_r sys_time unistd version-etc warnings xalloc
+#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests 
--aux-dir=lib/build-aux --with-tests --avoid=fcntl-h-c++-tests 
--avoid=iconv-h-c++-tests --avoid=stdio-c++-tests --avoid=stdlib-c++-tests 
--avoid=string-c++-tests --avoid=sys_ioctl-c++-tests 
--avoid=sys_select-c++-tests --avoid=sys_socket-c++-tests 
--avoid=sys_stat-c++-tests --avoid=sys_time-c++-tests --avoid=time-c++-tests 
--avoid=unistd-c++-tests --avoid=wchar-c++-tests --avoid=wctype-c++-tests 
--libtool --macro-prefix=gl --no-vc-files autobuild close connect error exit 
fdl-1.3 gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 
maintainer-makefile manywarnings netdb netinet_in pmccabe2html poll progname 
quote readline recv shutdown socket striconv strtok_r sys_time unistd 
version-etc warnings xalloc
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
@@ -52,7 +52,7 @@ gl_MODULES([
   warnings
   xalloc
 ])
-gl_AVOID([])
+gl_AVOID([fcntl-h-c++-tests iconv-h-c++-tests stdio-c++-tests stdlib-c++-tests 
string-c++-tests sys_ioctl-c++-tests sys_select-c++-tests sys_socket-c++-tests 
sys_stat-c++-tests sys_time-c++-tests time-c++-tests unistd-c++-tests 
wchar-c++-tests wctype-c++-tests])
 gl_SOURCE_BASE([gl])
 gl_M4_BASE([gl/m4])
 gl_PO_BASE([])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 54b2517..4c7ac30 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 19
+# gnulib-common.m4 serial 20
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,12 @@ AC_DEFUN([gl_COMMON_BODY], [
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 ])
+  dnl Preparation for running test programs:
+  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
+  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+  LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
 ])
 
 # gl_MODULE_INDICATOR_CONDITION
diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4
index e04a2d1..c870fb6 100644
--- a/gl/m4/netdb_h.m4
+++ b/gl/m4/netdb_h.m4
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 8
+# netdb_h.m4 serial 9
 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,11 @@ AC_DEFUN([gl_HEADER_NETDB],
     HAVE_NETDB_H=0
   fi
   AC_SUBST([HAVE_NETDB_H])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <netdb.h>]],
+    [getaddrinfo freeaddrinfo gai_strerror getnameinfo])
 ])
 
 AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 8c2eec6..b26d0a9 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 45
+# unistd_h.m4 serial 46
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -144,6 +144,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
   REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
+  REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
   REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
   REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
   REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
diff --git a/gl/netdb.in.h b/gl/netdb.in.h
index 73db46a..f800cac 100644
--- a/gl/netdb.in.h
+++ b/gl/netdb.in.h
@@ -41,6 +41,8 @@
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 /* Declarations for a platform that lacks <netdb.h>, or where it is
    incomplete.  */
 
@@ -186,7 +188,33 @@ extern int getnameinfo (const struct sockaddr *restrict 
sa, socklen_t salen,
 #  define NI_NUMERICSERV 2
 # endif
 
-#endif /* @GNULIB_GETADDRINFO@ */
+#elif defined GNULIB_POSIXCHECK
+
+# undef getaddrinfo
+# if HAVE_RAW_DECL_GETADDRINFO
+_GL_WARN_ON_USE (getaddrinfo, "getaddrinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef freeaddrinfo
+# if HAVE_RAW_DECL_FREEADDRINFO
+_GL_WARN_ON_USE (freeaddrinfo, "freeaddrinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef gai_strerror
+# if HAVE_RAW_DECL_GAI_STRERROR
+_GL_WARN_ON_USE (gai_strerror, "gai_strerror is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef getnameinfo
+# if HAVE_RAW_DECL_GETNAMEINFO
+_GL_WARN_ON_USE (getnameinfo, "getnameinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+#endif
 
 #endif /* _GL_NETDB_H */
 #endif /* _GL_NETDB_H */
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 04d3a68..6a347cd 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -1164,12 +1164,23 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable 
- "
 #if @GNULIB_TTYNAME_R@
 /* Store at most BUFLEN characters of the pathname of the terminal FD is
    open on in BUF.  Return 0 on success, otherwise an error number.  */
-# if address@hidden@
+# if @REPLACE_TTYNAME_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ttyname_r
+#   define ttyname_r rpl_ttyname_r
+#  endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (ttyname_r, int,
                   (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ttyname_r, int,
                   (int fd, char *buf, size_t buflen));
+# endif
 _GL_CXXALIASWARN (ttyname_r);
 #elif defined GNULIB_POSIXCHECK
 # undef ttyname_r
diff --git a/gltests/init.sh b/gltests/init.sh
index ee9c542..512e876 100644
--- a/gltests/init.sh
+++ b/gltests/init.sh
@@ -225,10 +225,12 @@ setup_()
     || fail_ "failed to create temporary directory in $initial_cwd_"
   cd "$test_dir_"
 
-  # This pair of trap statements ensures that the temporary directory,
-  # $test_dir_, is removed upon exit as well as upon catchable signal.
+  # These trap statements ensure that the temporary directory, $test_dir_,
+  # is removed upon exit as well as upon receipt of any of the listed signals.
   trap remove_tmp_ 0
-  trap 'Exit $?' 1 2 13 15
+  for sig_ in 1 2 3 13 15; do
+    eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
+  done
 }
 
 # Create a temporary directory, much like mktemp -d does.
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index dfa88aa..9b25db6 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gltests --aux-dir=build-aux --with-tests 
--avoid=vc-list-files-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files 
base64 crypto/gc crypto/gc-hmac-md5 crypto/gc-hmac-sha1 crypto/gc-md5 
crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-sha1 getline gettext 
lib-msvc-compat lib-symbol-versions lib-symbol-visibility maintainer-makefile 
memmem memxor minmax strnlen strverscmp vasprintf
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gltests --aux-dir=build-aux --with-tests --avoid=stdio-c++-tests 
--avoid=stdlib-c++-tests --avoid=string-c++-tests --avoid=unistd-c++-tests 
--avoid=vc-list-files-tests --avoid=wchar-c++-tests --lgpl=2 --libtool 
--macro-prefix=gl --no-vc-files base64 c-ctype crypto/gc crypto/gc-hmac-md5 
crypto/gc-hmac-sha1 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random 
crypto/gc-sha1 getline gettext lib-msvc-compat lib-symbol-versions 
lib-symbol-visibility maintainer-makefile memmem memxor minmax strnlen 
strverscmp vasprintf
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -110,6 +110,12 @@ EXTRA_DIST += $(top_srcdir)/build-aux/c++defs.h
 
 ## end   gnulib module c++defs
 
+## begin gnulib module c-ctype
+
+libgl_la_SOURCES += c-ctype.h c-ctype.c
+
+## end   gnulib module c-ctype
+
 ## begin gnulib module crypto/gc
 
 if GL_COND_LIBTOOL
@@ -822,6 +828,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
              -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
diff --git a/gl/c-ctype.c b/lib/gl/c-ctype.c
similarity index 97%
copy from gl/c-ctype.c
copy to lib/gl/c-ctype.c
index 0d8da20..9da8e58 100644
--- a/gl/c-ctype.c
+++ b/lib/gl/c-ctype.c
@@ -3,16 +3,16 @@
    Copyright 2000-2003, 2006, 2009-2010 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GNU Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License
+You should have received a copy of the GNU Lesser General Public License
 along with this program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
diff --git a/gl/c-ctype.h b/lib/gl/c-ctype.h
similarity index 97%
copy from gl/c-ctype.h
copy to lib/gl/c-ctype.h
index 0eb27e6..5ac5dd2 100644
--- a/gl/c-ctype.h
+++ b/lib/gl/c-ctype.h
@@ -8,16 +8,16 @@
    Copyright (C) 2000-2003, 2006, 2008-2010 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GNU Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License
+You should have received a copy of the GNU Lesser General Public License
 along with this program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
diff --git a/lib/gl/m4/gnulib-cache.m4 b/lib/gl/m4/gnulib-cache.m4
index 94ba128..ec4b810 100644
--- a/lib/gl/m4/gnulib-cache.m4
+++ b/lib/gl/m4/gnulib-cache.m4
@@ -15,12 +15,13 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests 
--aux-dir=build-aux --with-tests --avoid=vc-list-files-tests --lgpl=2 --libtool 
--macro-prefix=gl --no-vc-files base64 crypto/gc crypto/gc-hmac-md5 
crypto/gc-hmac-sha1 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random 
crypto/gc-sha1 getline gettext lib-msvc-compat lib-symbol-versions 
lib-symbol-visibility maintainer-makefile memmem memxor minmax strnlen 
strverscmp vasprintf
+#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests 
--aux-dir=build-aux --with-tests --avoid=stdio-c++-tests 
--avoid=stdlib-c++-tests --avoid=string-c++-tests --avoid=unistd-c++-tests 
--avoid=vc-list-files-tests --avoid=wchar-c++-tests --lgpl=2 --libtool 
--macro-prefix=gl --no-vc-files base64 c-ctype crypto/gc crypto/gc-hmac-md5 
crypto/gc-hmac-sha1 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random 
crypto/gc-sha1 getline gettext lib-msvc-compat lib-symbol-versions 
lib-symbol-visibility maintainer-makefile memmem memxor minmax strnlen 
strverscmp vasprintf
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
 gl_MODULES([
   base64
+  c-ctype
   crypto/gc
   crypto/gc-hmac-md5
   crypto/gc-hmac-sha1
@@ -41,7 +42,7 @@ gl_MODULES([
   strverscmp
   vasprintf
 ])
-gl_AVOID([vc-list-files-tests])
+gl_AVOID([stdio-c++-tests stdlib-c++-tests string-c++-tests unistd-c++-tests 
vc-list-files-tests wchar-c++-tests])
 gl_SOURCE_BASE([gl])
 gl_M4_BASE([gl/m4])
 gl_PO_BASE([])
diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index 54b2517..4c7ac30 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 19
+# gnulib-common.m4 serial 20
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,12 @@ AC_DEFUN([gl_COMMON_BODY], [
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 ])
+  dnl Preparation for running test programs:
+  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
+  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+  LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
 ])
 
 # gl_MODULE_INDICATOR_CONDITION
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 5618293..27dc56d 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -31,6 +31,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module base64:
   # Code from module base64-tests:
   # Code from module c++defs:
+  # Code from module c-ctype:
+  # Code from module c-ctype-tests:
   # Code from module crypto/gc:
   # Code from module crypto/gc-hmac-md5:
   # Code from module crypto/gc-hmac-md5-tests:
@@ -124,6 +126,7 @@ AC_DEFUN([gl_INIT],
   # Code from module base64:
   gl_FUNC_BASE64
   # Code from module c++defs:
+  # Code from module c-ctype:
   # Code from module crypto/gc:
   gl_GC
   if test $gl_cond_libtool = false; then
@@ -397,6 +400,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/asprintf.c
   lib/base64.c
   lib/base64.h
+  lib/c-ctype.c
+  lib/c-ctype.h
   lib/errno.in.h
   lib/float+.h
   lib/float.in.h
@@ -523,6 +528,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/signature.h
   tests/test-alloca-opt.c
   tests/test-base64.c
+  tests/test-c-ctype.c
   tests/test-errno.c
   tests/test-gc-hmac-md5.c
   tests/test-gc-hmac-sha1.c
diff --git a/lib/gl/m4/unistd_h.m4 b/lib/gl/m4/unistd_h.m4
index 8c2eec6..b26d0a9 100644
--- a/lib/gl/m4/unistd_h.m4
+++ b/lib/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 45
+# unistd_h.m4 serial 46
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -144,6 +144,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
   REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
+  REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
   REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
   REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
   REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index e8997df..da6f086 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -1164,12 +1164,23 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable 
- "
 #if @GNULIB_TTYNAME_R@
 /* Store at most BUFLEN characters of the pathname of the terminal FD is
    open on in BUF.  Return 0 on success, otherwise an error number.  */
-# if address@hidden@
+# if @REPLACE_TTYNAME_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ttyname_r
+#   define ttyname_r rpl_ttyname_r
+#  endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (ttyname_r, int,
                   (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ttyname_r, int,
                   (int fd, char *buf, size_t buflen));
+# endif
 _GL_CXXALIASWARN (ttyname_r);
 #elif defined GNULIB_POSIXCHECK
 # undef ttyname_r
diff --git a/lib/gltests/Makefile.am b/lib/gltests/Makefile.am
index 1b95e7a..e24f9ae 100644
--- a/lib/gltests/Makefile.am
+++ b/lib/gltests/Makefile.am
@@ -111,6 +111,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/c++defs.h
 
 ## end   gnulib module c++defs
 
+## begin gnulib module c-ctype-tests
+
+TESTS += test-c-ctype
+check_PROGRAMS += test-c-ctype
+
+EXTRA_DIST += test-c-ctype.c macros.h
+
+## end   gnulib module c-ctype-tests
+
 ## begin gnulib module crypto/gc-hmac-md5-tests
 
 TESTS += test-gc-hmac-md5
diff --git a/gltests/test-c-ctype.c b/lib/gltests/test-c-ctype.c
similarity index 100%
copy from gltests/test-c-ctype.c
copy to lib/gltests/test-c-ctype.c
diff --git a/lib/maint.mk b/lib/maint.mk
index 33803f3..6389c38 100644
--- a/lib/maint.mk
+++ b/lib/maint.mk
@@ -645,6 +645,29 @@ sc_useless_cpp_parens:
        halt='found useless parentheses in cpp directive'               \
          $(_sc_search_regexp)
 
+# List headers for which HAVE_HEADER_H is always true, assuming you are
+# using the appropriate gnulib module.  CAUTION: for each "unnecessary"
+# #if HAVE_HEADER_H that you remove, be sure that your project explicitly
+# requires the gnulib module that guarantees the usability of that header.
+gl_assured_headers_ = \
+  cd $(gnulib_dir)/lib && echo *.in.h|sed 's/\.in\.h//g'
+
+# Convert the list of names to upper case, and replace each space with "|".
+az_ = abcdefghijklmnopqrstuvwxyz
+AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ
+gl_header_upper_case_or_ =                                             \
+  $$($(gl_assured_headers_)                                            \
+    | tr $(az_)/.- $(AZ_)___                                           \
+    | tr -s ' ' '|'                                                    \
+    )
+sc_prohibit_always_true_header_tests:
+       @or=$(gl_header_upper_case_or_);                                \
+       re="HAVE_($$or)_H";                                             \
+       prohibit='\<'"$$re"'\>'                                         \
+       halt='do not test the above HAVE_<header>_H symbol(s);\n'\
+'  with the corresponding gnulib module, they are always true'         \
+         $(_sc_search_regexp)
+
 # Prohibit checked in backup files.
 sc_prohibit_backup_files:
        @$(VC_LIST) | grep '~$$' &&                             \
@@ -1104,10 +1127,12 @@ refresh-po:
        echo 'address@hidden' >> $(PODIR)/LINGUAS && \
        ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> 
$(PODIR)/LINGUAS
 
+ # Running indent once is not idempotent, but running it twice is.
 INDENT_SOURCES ?= $(C_SOURCES)
 .PHONY: indent
 indent:
        indent $(INDENT_SOURCES)
+       indent $(INDENT_SOURCES)
 
 # If you want to set UPDATE_COPYRIGHT_* environment variables,
 # put the assignments in this variable.
diff --git a/lib/scram/parser.c b/lib/scram/parser.c
index 3a38bb0..6b9c5b9 100644
--- a/lib/scram/parser.c
+++ b/lib/scram/parser.c
@@ -36,6 +36,9 @@
 /* Get validator. */
 #include "validate.h"
 
+/* Get c_isalpha. */
+#include "c-ctype.h"
+
 static char *
 unescape (const char *str, size_t len)
 {
@@ -79,9 +82,9 @@ scram_parse_client_first (const char *str, size_t len,
   if (strnlen (str, len) < 10)
     return -1;
 
-  if (len == 0 || *str != 'n')
-      /* FIXME parse non-'n' cbflags */
-    return -1;
+  if (len == 0 || (*str != 'n' && *str != 'y'))
+      /* FIXME support channel bindings */
+      return -1;
   cf->cbflag = *str;
   str++, len--;
 
@@ -377,12 +380,35 @@ scram_parse_client_final (const char *str, size_t len,
     len -= l;
   }
 
-  /* FIXME check that any extension fields follow valid syntax. */
-
   if (len == 0 || *str != ',')
     return -1;
   str++, len--;
 
+  /* Ignore extensions. */
+  while (len > 0 && c_isalpha (*str) && *str != 'p')
+    {
+      const char *p;
+      size_t l;
+
+      str++, len--;
+
+      if (len == 0 || *str != '=')
+       return -1;
+      str++, len--;
+
+      p = memchr (str, ',', len);
+      if (!p)
+       return -1;
+      p++;
+
+      l = p - str;
+      if (len < l)
+       return -1;
+
+      str = p;
+      len -= l;
+    }
+
   if (len == 0 || *str != 'p')
     return -1;
   str++, len--;
diff --git a/lib/scram/server.c b/lib/scram/server.c
index 79dd7c1..6176243 100644
--- a/lib/scram/server.c
+++ b/lib/scram/server.c
@@ -51,6 +51,7 @@
 struct scram_server_state
 {
   int step;
+  char *gs2header; /* copy of client first gs2-header */
   char *cfmb_str; /* copy of client first message bare */
   char *sf_str; /* copy of server first message */
   char *snonce;
@@ -145,7 +146,7 @@ _gsasl_scram_sha1_server_step (Gsasl_session * sctx,
        {
          const char *p;
 
-         /* Save "bare" for next step. */
+         /* Save "gs2-header" and "message-bare" for next step. */
          p = memchr (input, ',', input_len);
          if (!p)
            return GSASL_AUTHENTICATION_ERROR;
@@ -155,6 +156,12 @@ _gsasl_scram_sha1_server_step (Gsasl_session * sctx,
            return GSASL_AUTHENTICATION_ERROR;
          p++;
 
+         state->gs2header = malloc (p - input + 1);
+         if (!state->gs2header)
+           return GSASL_MALLOC_ERROR;
+         memcpy (state->gs2header, input, p - input);
+         state->gs2header[p - input] = '\0';
+
          state->cfmb_str = malloc (input_len - (p - input) + 1);
          if (!state->cfmb_str)
            return GSASL_MALLOC_ERROR;
@@ -218,6 +225,24 @@ _gsasl_scram_sha1_server_step (Gsasl_session * sctx,
        if (strcmp (state->cl.nonce, state->sf.nonce) != 0)
          return GSASL_AUTHENTICATION_ERROR;
 
+       /* Base64 decode the c= field and check that it matches
+          client-first. */
+       {
+         size_t len;
+         char *cbind;
+
+         rc = gsasl_base64_from (state->cl.cbind, strlen (state->cl.cbind),
+                                 &cbind, &len);
+         if (rc != 0)
+           return rc;
+
+         if (len != strlen (state->gs2header))
+           return GSASL_AUTHENTICATION_ERROR;
+
+         if (memcmp (cbind, state->gs2header, len) != 0)
+           return GSASL_AUTHENTICATION_ERROR;
+       }
+
        /* Base64 decode client proof and check that length matches
           SHA-1 size. */
        {
diff --git a/maint.mk b/maint.mk
index 33803f3..6389c38 100644
--- a/maint.mk
+++ b/maint.mk
@@ -645,6 +645,29 @@ sc_useless_cpp_parens:
        halt='found useless parentheses in cpp directive'               \
          $(_sc_search_regexp)
 
+# List headers for which HAVE_HEADER_H is always true, assuming you are
+# using the appropriate gnulib module.  CAUTION: for each "unnecessary"
+# #if HAVE_HEADER_H that you remove, be sure that your project explicitly
+# requires the gnulib module that guarantees the usability of that header.
+gl_assured_headers_ = \
+  cd $(gnulib_dir)/lib && echo *.in.h|sed 's/\.in\.h//g'
+
+# Convert the list of names to upper case, and replace each space with "|".
+az_ = abcdefghijklmnopqrstuvwxyz
+AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ
+gl_header_upper_case_or_ =                                             \
+  $$($(gl_assured_headers_)                                            \
+    | tr $(az_)/.- $(AZ_)___                                           \
+    | tr -s ' ' '|'                                                    \
+    )
+sc_prohibit_always_true_header_tests:
+       @or=$(gl_header_upper_case_or_);                                \
+       re="HAVE_($$or)_H";                                             \
+       prohibit='\<'"$$re"'\>'                                         \
+       halt='do not test the above HAVE_<header>_H symbol(s);\n'\
+'  with the corresponding gnulib module, they are always true'         \
+         $(_sc_search_regexp)
+
 # Prohibit checked in backup files.
 sc_prohibit_backup_files:
        @$(VC_LIST) | grep '~$$' &&                             \
@@ -1104,10 +1127,12 @@ refresh-po:
        echo 'address@hidden' >> $(PODIR)/LINGUAS && \
        ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> 
$(PODIR)/LINGUAS
 
+ # Running indent once is not idempotent, but running it twice is.
 INDENT_SOURCES ?= $(C_SOURCES)
 .PHONY: indent
 indent:
        indent $(INDENT_SOURCES)
+       indent $(INDENT_SOURCES)
 
 # If you want to set UPDATE_COPYRIGHT_* environment variables,
 # put the assignments in this variable.
diff --git a/tests/scram.c b/tests/scram.c
index 0a826b6..a9c7b8f 100644
--- a/tests/scram.c
+++ b/tests/scram.c
@@ -141,7 +141,7 @@ doit (void)
 
   gsasl_callback_set (ctx, callback);
 
-  for (i = 0; i <= 15; i++)
+  for (i = 0; i <= 21; i++)
     {
       bool server_first = (i % 2) == 0;
 
@@ -193,6 +193,29 @@ doit (void)
          return;
        }
 
+      if (i == 16 || i == 17)
+       s1[0] = 'y';
+
+      if (i == 18)
+       {
+         char *s;
+
+         asprintf (&s, "%s,a=b", s1);
+         gsasl_free (s1);
+         s1 = s;
+         s1len = strlen (s);
+       }
+
+      if (i == 20)
+       {
+         char *s;
+
+         asprintf (&s, "%s,a=b,b=c,c=d", s1);
+         gsasl_free (s1);
+         s1 = s;
+         s1len = strlen (s);
+       }
+
       if (debug)
        printf ("C: %.*s [%c]\n", s1len, s1, res == GSASL_OK ? 'O' : 'N');
 
@@ -221,6 +244,30 @@ doit (void)
          return;
        }
 
+      if (i == 17)
+       memcpy (s1 + 2, "eS", 2);
+
+      if (i == 19 && s1len > 31)
+       {
+         char *s;
+
+         asprintf (&s, "%.*s,a=b,%s", s1len - 31, s1, s1 + s1len - 31 + 1);
+         gsasl_free (s1);
+         s1 = s;
+         s1len = strlen (s);
+       }
+
+      if (i == 21 && s1len > 31)
+       {
+         char *s;
+
+         asprintf (&s, "%.*s,a=b,b=c,c=d,%s", s1len - 31, s1,
+                   s1 + s1len - 31 + 1);
+         gsasl_free (s1);
+         s1 = s;
+         s1len = strlen (s);
+       }
+
       if (debug)
        printf ("C: %.*s [%c]\n", s1len, s1, res == GSASL_OK ? 'O' : 'N');
 
@@ -228,6 +275,17 @@ doit (void)
 
       res = gsasl_step (server, s1, s1len, &s2, &s2len);
       gsasl_free (s1);
+      if (i >= 16 && i <= 21)
+       {
+         if (res == GSASL_AUTHENTICATION_ERROR)
+           {
+             if (debug)
+               success ("Authentication failed expectedly\n");
+             goto done;
+           }
+         else
+           res = GSASL_AUTHENTICATION_ERROR;
+       }
       if (res != GSASL_OK)
        {
          fail ("gsasl_step[%d](4) failed (%d):\n%s\n", i, res,
@@ -268,6 +326,7 @@ doit (void)
          fail ("Expected authzid? %d/%s\n", i, AUTHZID[i % N_AUTHZID]);
       }
 
+    done:
       if (debug)
        printf ("\n");
 


hooks/post-receive
-- 
GNU gsasl




reply via email to

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