gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_7-27-g3762977


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_7-27-g3762977
Date: Wed, 09 Nov 2011 00:40:48 +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 gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=3762977eb4bcff96117fff7456ededd21849b0f2

The branch, master has been updated
       via  3762977eb4bcff96117fff7456ededd21849b0f2 (commit)
       via  69fa77f03a2358c5e3e1ff164635128c16877c36 (commit)
       via  3160ff8ad863d0ed0f85c86c8e0f873c7d711bff (commit)
      from  f680a8a51c1496006b2cca5e1a3e706739225cd3 (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 3762977eb4bcff96117fff7456ededd21849b0f2
Author: Simon Josefsson <address@hidden>
Date:   Wed Nov 9 01:35:12 2011 +0100

    Remove some redundant prototypes and use more static.

commit 69fa77f03a2358c5e3e1ff164635128c16877c36
Author: Simon Josefsson <address@hidden>
Date:   Wed Nov 9 01:26:07 2011 +0100

    Simplify redundant code.

commit 3160ff8ad863d0ed0f85c86c8e0f873c7d711bff
Author: Simon Josefsson <address@hidden>
Date:   Wed Nov 9 00:59:30 2011 +0100

    Add pmccabe2html gnulib module.

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

Summary of changes:
 build-aux/pmccabe2html |    2 +-
 gl/Makefile.am         |    9 ++-
 gl/m4/gnulib-cache.m4  |    3 +-
 gl/m4/gnulib-comp.m4   |    4 +
 lib/gnutls_db.c        |  209 +++++++++++++++++++++---------------------------
 lib/gnutls_db.h        |    9 --
 6 files changed, 107 insertions(+), 129 deletions(-)

diff --git a/build-aux/pmccabe2html b/build-aux/pmccabe2html
index 1a4cdd1..c7cf3d0 100644
--- a/build-aux/pmccabe2html
+++ b/build-aux/pmccabe2html
@@ -1,6 +1,6 @@
 # pmccabe2html - AWK script to convert pmccabe output to html       -*- awk -*-
 
-# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2011 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
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 320b2c0..e5e0b6a 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -21,7 +21,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=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests 
--avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl 
--no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect 
error extensions func getpass getsubopt gettext gettime havelib inet_ntop 
inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile 
manywarnings memmem-simple minmax netdb netinet_in progname read-file recv 
recvfrom scandir select send sendto setsockopt shutdown snprintf socket sockets 
socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec u64 
unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix 
vprintf-posix vsnprintf warnings
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests 
--avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl 
--no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect 
error extensions func getpass getsubopt gettext gettime havelib inet_ntop 
inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile 
manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname 
read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf 
socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r 
timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf 
vfprintf-posix vprintf-posix vsnprintf warnings
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -973,6 +973,13 @@ EXTRA_libgnu_la_SOURCES += opendir.c
 
 ## end   gnulib module opendir
 
+## begin gnulib module pmccabe2html
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/pmccabe2html 
$(top_srcdir)/build-aux/pmccabe.css
+
+## end   gnulib module pmccabe2html
+
 ## begin gnulib module printf-frexp
 
 libgnu_la_SOURCES += printf-frexp.c
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index d43ce3f..409b70b 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -27,7 +27,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests 
--aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests 
--no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept 
alloca alphasort argp bind byteswap c-ctype close connect error extensions func 
getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat 
lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple 
minmax netdb netinet_in progname read-file recv recvfrom scandir select send 
sendto setsockopt shutdown snprintf socket sockets socklen stdint strcase 
strverscmp sys_socket sys_stat time_r timespec u64 unistd valgrind-tests 
vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf 
warnings
+#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests 
--aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests 
--no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept 
alloca alphasort argp bind byteswap c-ctype close connect error extensions func 
getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat 
lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple 
minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir 
select send sendto setsockopt shutdown snprintf socket sockets socklen stdint 
strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd 
valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix 
vprintf-posix vsnprintf warnings
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
@@ -60,6 +60,7 @@ gl_MODULES([
   minmax
   netdb
   netinet_in
+  pmccabe2html
   progname
   read-file
   recv
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 75c46af..fe23cdf 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -196,6 +196,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module perror-tests:
   # Code from module pipe-posix:
   # Code from module pipe-posix-tests:
+  # Code from module pmccabe2html:
   # Code from module printf-frexp:
   # Code from module printf-frexp-tests:
   # Code from module printf-frexpl:
@@ -605,6 +606,7 @@ if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
   AC_LIBOBJ([opendir])
 fi
 gl_DIRENT_MODULE_INDICATOR([opendir])
+AC_PATH_PROG([PMCCABE], [pmccabe], [false])
 gl_FUNC_PRINTF_FREXP
 gl_FUNC_PRINTF_FREXPL
 m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
@@ -1076,6 +1078,8 @@ AC_DEFUN([gltests_LIBSOURCES], [
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
   build-aux/config.rpath
+  build-aux/pmccabe.css
+  build-aux/pmccabe2html
   build-aux/snippet/_Noreturn.h
   build-aux/snippet/arg-nonnull.h
   build-aux/snippet/c++defs.h
diff --git a/lib/gnutls_db.c b/lib/gnutls_db.c
index ff8de18..5e07b04 100644
--- a/lib/gnutls_db.c
+++ b/lib/gnutls_db.c
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2000, 2002, 2003, 2004, 2005, 2008, 2010, 2011 Free Software
- * Foundation, Inc.
+ * Copyright (C) 2000-2011 Free Software Foundation, Inc.
  *
  * Author: Nikos Mavrogiannopoulos
  *
@@ -28,7 +27,6 @@
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include <gnutls_db.h>
-#include "debug.h"
 #include <gnutls_session_pack.h>
 #include <gnutls_datum.h>
 
@@ -165,51 +163,11 @@ gnutls_db_check_entry (gnutls_session_t session, 
gnutls_datum_t session_entry)
   return 0;
 }
 
-/* The format of storing data is:
- * (forget it). Check gnutls_session_pack.c
- */
-int
-_gnutls_server_register_current_session (gnutls_session_t session)
-{
-  gnutls_datum_t key;
-  gnutls_datum_t content;
-  int ret = 0;
-
-  key.data = session->security_parameters.session_id;
-  key.size = session->security_parameters.session_id_size;
-
-  if (session->internals.resumable == RESUME_FALSE)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_INVALID_SESSION;
-    }
-
-  if (session->security_parameters.session_id == NULL
-      || session->security_parameters.session_id_size == 0)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_INVALID_SESSION;
-    }
-
-/* copy data */
-  ret = _gnutls_session_pack (session, &content);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      return ret;
-    }
-
-  ret = _gnutls_store_session (session, key, content);
-  _gnutls_free_datum (&content);
-
-  return ret;
-}
-
 /* Checks if both db_store and db_retrieve functions have
  * been set up.
  */
 static int
-_gnutls_db_func_is_ok (gnutls_session_t session)
+db_func_is_ok (gnutls_session_t session)
 {
   if (session->internals.db_store_func != NULL &&
       session->internals.db_retrieve_func != NULL &&
@@ -219,103 +177,86 @@ _gnutls_db_func_is_ok (gnutls_session_t session)
     return GNUTLS_E_DB_ERROR;
 }
 
-
-int
-_gnutls_server_restore_session (gnutls_session_t session,
-                                uint8_t * session_id, int session_id_size)
+/* Stores session data to the db backend.
+ */
+static int
+store_session (gnutls_session_t session,
+              gnutls_datum_t session_id,
+              gnutls_datum_t session_data)
 {
-  gnutls_datum_t data;
-  gnutls_datum_t key;
-  int ret;
-
-  key.data = session_id;
-  key.size = session_id_size;
+  int ret = 0;
 
-  if (_gnutls_db_func_is_ok (session) != 0)
+  if (session->internals.resumable == RESUME_FALSE)
     {
       gnutls_assert ();
       return GNUTLS_E_INVALID_SESSION;
     }
 
-  data = _gnutls_retrieve_session (session, key);
+  if (db_func_is_ok (session) != 0)
+    {
+      return GNUTLS_E_DB_ERROR;
+    }
 
-  if (data.data == NULL)
+  if (session_id.data == NULL || session_id.size == 0)
     {
       gnutls_assert ();
       return GNUTLS_E_INVALID_SESSION;
     }
 
-  /* expiration check is performed inside */
-  ret = gnutls_session_set_data (session, data.data, data.size);
-  if (ret < 0)
+  if (session_data.data == NULL || session_data.size == 0)
     {
       gnutls_assert ();
-      return ret;
+      return GNUTLS_E_INVALID_SESSION;
     }
 
-  gnutls_free (data.data);
+  /* if we can't read why bother writing? */
+  if (session->internals.db_store_func != NULL)
+    ret = session->internals.db_store_func (session->internals.db_ptr,
+                                           session_id, session_data);
 
-  return 0;
+  return (ret == 0 ? ret : GNUTLS_E_DB_ERROR);
 }
 
 int
-_gnutls_db_remove_session (gnutls_session_t session, uint8_t * session_id,
-                           int session_id_size)
+_gnutls_server_register_current_session (gnutls_session_t session)
 {
   gnutls_datum_t key;
-
-  key.data = session_id;
-  key.size = session_id_size;
-
-  return _gnutls_remove_session (session, key);
-}
-
-
-/* Stores session data to the db backend.
- */
-int
-_gnutls_store_session (gnutls_session_t session,
-                       gnutls_datum_t session_id, gnutls_datum_t session_data)
-{
+  gnutls_datum_t content;
   int ret = 0;
 
+  key.data = session->security_parameters.session_id;
+  key.size = session->security_parameters.session_id_size;
+
   if (session->internals.resumable == RESUME_FALSE)
     {
       gnutls_assert ();
       return GNUTLS_E_INVALID_SESSION;
     }
 
-  if (_gnutls_db_func_is_ok (session) != 0)
-    {
-      return GNUTLS_E_DB_ERROR;
-    }
-
-  if (session_id.data == NULL || session_id.size == 0)
+  if (session->security_parameters.session_id == NULL
+      || session->security_parameters.session_id_size == 0)
     {
       gnutls_assert ();
       return GNUTLS_E_INVALID_SESSION;
     }
 
-  if (session_data.data == NULL || session_data.size == 0)
+  ret = _gnutls_session_pack (session, &content);
+  if (ret < 0)
     {
       gnutls_assert ();
-      return GNUTLS_E_INVALID_SESSION;
+      return ret;
     }
-  /* if we can't read why bother writing? */
 
-  if (session->internals.db_store_func != NULL)
-    ret =
-      session->internals.db_store_func (session->internals.db_ptr,
-                                        session_id, session_data);
-
-  return (ret == 0 ? ret : GNUTLS_E_DB_ERROR);
+  ret = store_session (session, key, content);
+  _gnutls_free_datum (&content);
 
+  return ret;
 }
 
 /* Retrieves session data from the db backend.
  */
-gnutls_datum_t
-_gnutls_retrieve_session (gnutls_session_t session, gnutls_datum_t session_id)
+static gnutls_datum_t
+retrieve_session (gnutls_session_t session, gnutls_datum_t session_id)
 {
   gnutls_datum_t ret = { NULL, 0 };
 
@@ -326,37 +267,48 @@ _gnutls_retrieve_session (gnutls_session_t session, 
gnutls_datum_t session_id)
     }
 
   if (session->internals.db_retrieve_func != NULL)
-    ret =
-      session->internals.db_retrieve_func (session->internals.db_ptr,
-                                           session_id);
+    ret = session->internals.db_retrieve_func (session->internals.db_ptr,
+                                              session_id);
 
   return ret;
-
 }
 
-/* Removes session data from the db backend.
- */
 int
-_gnutls_remove_session (gnutls_session_t session, gnutls_datum_t session_id)
+_gnutls_server_restore_session (gnutls_session_t session,
+                                uint8_t * session_id, int session_id_size)
 {
-  int ret = 0;
+  gnutls_datum_t data;
+  gnutls_datum_t key;
+  int ret;
 
-  if (_gnutls_db_func_is_ok (session) != 0)
+  key.data = session_id;
+  key.size = session_id_size;
+
+  if (db_func_is_ok (session) != 0)
     {
-      return GNUTLS_E_DB_ERROR;
+      gnutls_assert ();
+      return GNUTLS_E_INVALID_SESSION;
     }
 
-  if (session_id.data == NULL || session_id.size == 0)
-    return GNUTLS_E_INVALID_SESSION;
+  data = retrieve_session (session, key);
 
-  /* if we can't read why bother writing? */
-  if (session->internals.db_remove_func != NULL)
-    ret =
-      session->internals.db_remove_func (session->internals.db_ptr,
-                                         session_id);
+  if (data.data == NULL)
+    {
+      gnutls_assert ();
+      return GNUTLS_E_INVALID_SESSION;
+    }
 
-  return (ret == 0 ? ret : GNUTLS_E_DB_ERROR);
+  /* expiration check is performed inside */
+  ret = gnutls_session_set_data (session, data.data, data.size);
+  if (ret < 0)
+    {
+      gnutls_assert ();
+      return ret;
+    }
 
+  gnutls_free (data.data);
+
+  return 0;
 }
 
 /**
@@ -374,7 +326,30 @@ _gnutls_remove_session (gnutls_session_t session, 
gnutls_datum_t session_id)
 void
 gnutls_db_remove_session (gnutls_session_t session)
 {
-  _gnutls_db_remove_session (session,
-                             session->security_parameters.session_id,
-                             session->security_parameters.session_id_size);
+  gnutls_datum_t session_id;
+  int ret = 0;
+
+  session_id.data = session->security_parameters.session_id;
+  session_id.size = session->security_parameters.session_id_size;
+
+  if (db_func_is_ok (session) != 0)
+    {
+      gnutls_assert ();
+      return /* GNUTLS_E_DB_ERROR */;
+    }
+
+  if (session_id.data == NULL || session_id.size == 0)
+    {
+      gnutls_assert ();
+      return /* GNUTLS_E_INVALID_SESSION */;
+    }
+
+  /* if we can't read why bother writing? */
+  if (session->internals.db_remove_func != NULL)
+    {
+      ret = session->internals.db_remove_func (session->internals.db_ptr,
+                                              session_id);
+      if (ret != 0)
+       gnutls_assert ();
+    }
 }
diff --git a/lib/gnutls_db.h b/lib/gnutls_db.h
index 94b00a4..bf43e02 100644
--- a/lib/gnutls_db.h
+++ b/lib/gnutls_db.h
@@ -24,12 +24,3 @@ int _gnutls_server_register_current_session 
(gnutls_session_t session);
 int _gnutls_server_restore_session (gnutls_session_t session,
                                     uint8_t * session_id,
                                     int session_id_size);
-int _gnutls_db_remove_session (gnutls_session_t session, uint8_t * session_id,
-                               int session_id_size);
-int _gnutls_store_session (gnutls_session_t session,
-                           gnutls_datum_t session_id,
-                           gnutls_datum_t session_data);
-gnutls_datum_t _gnutls_retrieve_session (gnutls_session_t session,
-                                         gnutls_datum_t session_id);
-int _gnutls_remove_session (gnutls_session_t session,
-                            gnutls_datum_t session_id);


hooks/post-receive
-- 
GNU gnutls



reply via email to

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