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_2_11_6-358-g4adc232


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_11_6-358-g4adc232
Date: Sun, 03 Apr 2011 08:56:53 +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=4adc232cdc3f5aad1a2be38d8875494561f813cb

The branch, master has been updated
       via  4adc232cdc3f5aad1a2be38d8875494561f813cb (commit)
       via  463f925edd6e6b7196a31c4176d4af67d01d0c59 (commit)
       via  047a5ccbe87e3c35eb036225e398f25cb9e55158 (commit)
      from  909151890d182348a2c98c8fd644e1ee0eafd5a7 (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 4adc232cdc3f5aad1a2be38d8875494561f813cb
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Apr 3 10:56:36 2011 +0200

    crypt.* renamed to srptool.*.

commit 463f925edd6e6b7196a31c4176d4af67d01d0c59
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Apr 3 10:52:21 2011 +0200

    Corrected bug in gnutls_srp_verifier() that prevented the allocation of a 
verifier. Reported by Andrew Wiseman.

commit 047a5ccbe87e3c35eb036225e398f25cb9e55158
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Apr 3 10:50:54 2011 +0200

    Added debug option to srptool.

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

Summary of changes:
 lib/gnutls_srp.c                   |    2 +-
 src/Makefile.am                    |    8 ++--
 src/{crypt-gaa.c => srptool-gaa.c} |   63 ++++++++++++++++++++++++-----------
 src/{crypt-gaa.h => srptool-gaa.h} |   16 +++++----
 src/{crypt.c => srptool.c}         |   12 ++++++-
 src/{crypt.gaa => srptool.gaa}     |    5 ++-
 6 files changed, 71 insertions(+), 35 deletions(-)
 rename src/{crypt-gaa.c => srptool-gaa.c} (95%)
 rename src/{crypt-gaa.h => srptool-gaa.h} (71%)
 rename src/{crypt.c => srptool.c} (98%)
 rename src/{crypt.gaa => srptool.gaa} (90%)

diff --git a/lib/gnutls_srp.c b/lib/gnutls_srp.c
index df4e55e..6e07854 100644
--- a/lib/gnutls_srp.c
+++ b/lib/gnutls_srp.c
@@ -69,7 +69,7 @@ _gnutls_srp_gx (opaque * text, size_t textsize, opaque ** 
result,
   _gnutls_mpi_release (&x);
 
   ret = _gnutls_mpi_print (e, NULL, &result_size);
-  if (ret != GNUTLS_E_SHORT_MEMORY_BUFFER)
+  if (ret == GNUTLS_E_SHORT_MEMORY_BUFFER)
     {
       *result = galloc_func (result_size);
       if ((*result) == NULL)
diff --git a/src/Makefile.am b/src/Makefile.am
index 9460985..e1d9b4c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -53,11 +53,11 @@ libcmd_serv_la_CFLAGS =
 libcmd_serv_la_SOURCES = serv.gaa serv-gaa.h serv-gaa.c
 
 if ENABLE_SRP
-srptool_SOURCES = crypt.c
+srptool_SOURCES = srptool.c
 srptool_LDADD = ../lib/libgnutls.la libcmd-srp.la ../gl/libgnu.la
 noinst_LTLIBRARIES += libcmd-srp.la
 libcmd_srp_la_CFLAGS =
-libcmd_srp_la_SOURCES = crypt.gaa crypt-gaa.h crypt-gaa.c
+libcmd_srp_la_SOURCES = srptool.gaa srptool-gaa.h srptool-gaa.c
 endif
 
 psktool_SOURCES = psk.c
@@ -133,8 +133,8 @@ libcmd_p11tool_la_LIBADD += ../gl/libgnu.la $(INET_PTON_LIB)
 
 psk-gaa.c: $(srcdir)/psk.gaa
        -$(GAA) $< -o psk-gaa.c -i psk-gaa.h
-crypt-gaa.c: $(srcdir)/crypt.gaa
-       -$(GAA) $< -o crypt-gaa.c -i crypt-gaa.h
+srptool-gaa.c: $(srcdir)/srptool.gaa
+       -$(GAA) $< -o srptool-gaa.c -i srptool-gaa.h
 p11tool-gaa.c: $(srcdir)/p11tool.gaa
        -$(GAA) $< -o p11tool-gaa.c -i p11tool-gaa.h
 certtool-gaa.c: $(srcdir)/certtool.gaa
diff --git a/src/crypt-gaa.c b/src/srptool-gaa.c
similarity index 95%
rename from src/crypt-gaa.c
rename to src/srptool-gaa.c
index 3375cf9..f396335 100644
--- a/src/crypt-gaa.c
+++ b/src/srptool-gaa.c
@@ -1,7 +1,7 @@
 /* File generated by GAA 1.6.6
  */
 #define GAA_NO_WIN32
-#line 1 "crypt.gaa"
+#line 1 "srptool.gaa"
 
 
 /* C declarations */
@@ -129,6 +129,7 @@ static void __gaa_helpsingle(char short_name, char *name,
 void gaa_help(void)
 {
        printf("Srptool help\nUsage : srptool [options]\n");
+       __gaa_helpsingle('d', "debug", "integer ", "Enable debugging");
        __gaa_helpsingle('u', "username", "username ", "specify username.");
        __gaa_helpsingle('p', "passwd", "FILE ", "specify a password file.");
        __gaa_helpsingle('i', "index", "INDEX ", "specify the index of the 
group parameters in tpasswd.conf to use.");
@@ -152,20 +153,22 @@ typedef struct _gaainfo gaainfo;
 
 struct _gaainfo
 {
-#line 34 "crypt.gaa"
+#line 37 "srptool.gaa"
        char *create_conf;
-#line 31 "crypt.gaa"
+#line 34 "srptool.gaa"
        char *passwd_conf;
-#line 28 "crypt.gaa"
+#line 31 "srptool.gaa"
        int verify;
-#line 25 "crypt.gaa"
+#line 28 "srptool.gaa"
        int salt;
-#line 22 "crypt.gaa"
+#line 25 "srptool.gaa"
        int index;
-#line 19 "crypt.gaa"
+#line 22 "srptool.gaa"
        char *passwd;
-#line 16 "crypt.gaa"
+#line 19 "srptool.gaa"
        char *username;
+#line 16 "srptool.gaa"
+       int debug;
 
 #line 114 "gaa.skel"
 };
@@ -220,7 +223,7 @@ static int gaa_error = 0;
 #define GAA_MULTIPLE_OPTION     3
 
 #define GAA_REST                0
-#define GAA_NB_OPTION           9
+#define GAA_NB_OPTION           10
 #define GAAOPTID_help  1
 #define GAAOPTID_version       2
 #define GAAOPTID_create_conf   3
@@ -230,6 +233,7 @@ static int gaa_error = 0;
 #define GAAOPTID_index 7
 #define GAAOPTID_passwd        8
 #define GAAOPTID_username      9
+#define GAAOPTID_debug 10
 
 #line 168 "gaa.skel"
 
@@ -451,6 +455,12 @@ struct GAAOPTION_username
        char* arg1;
        int size1;
 };
+
+struct GAAOPTION_debug 
+{
+       int arg1;
+       int size1;
+};
          
 #line 349 "gaa.skel"
 static int gaa_is_an_argument(char *str)
@@ -487,6 +497,7 @@ static int gaa_get_option_num(char *str, int status)
                        GAA_CHECK1STR("i", GAAOPTID_index);
                        GAA_CHECK1STR("p", GAAOPTID_passwd);
                        GAA_CHECK1STR("u", GAAOPTID_username);
+                       GAA_CHECK1STR("d", GAAOPTID_debug);
         case GAA_MULTIPLE_OPTION:
 #line 375 "gaa.skel"
                        GAA_CHECK1STR("h", GAAOPTID_help);
@@ -505,6 +516,7 @@ static int gaa_get_option_num(char *str, int status)
                        GAA_CHECKSTR("index", GAAOPTID_index);
                        GAA_CHECKSTR("passwd", GAAOPTID_passwd);
                        GAA_CHECKSTR("username", GAAOPTID_username);
+                       GAA_CHECKSTR("debug", GAAOPTID_debug);
 
 #line 281 "gaa.skel"
        break;
@@ -523,6 +535,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
        struct GAAOPTION_index GAATMP_index;
        struct GAAOPTION_passwd GAATMP_passwd;
        struct GAAOPTION_username GAATMP_username;
+       struct GAAOPTION_debug GAATMP_debug;
 
 #line 393 "gaa.skel"
 #ifdef GAA_REST_EXISTS
@@ -545,14 +558,14 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
     {
        case GAAOPTID_help:
        OK = 0;
-#line 38 "crypt.gaa"
+#line 41 "srptool.gaa"
 { gaa_help(); exit(0); ;};
 
                return GAA_OK;
                break;
        case GAAOPTID_version:
        OK = 0;
-#line 37 "crypt.gaa"
+#line 40 "srptool.gaa"
 { srptool_version(); exit(0); ;};
 
                return GAA_OK;
@@ -562,7 +575,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
                GAA_TESTMOREARGS;
                GAA_FILL(GAATMP_create_conf.arg1, gaa_getstr, 
GAATMP_create_conf.size1);
                gaa_index++;
-#line 35 "crypt.gaa"
+#line 38 "srptool.gaa"
 { gaaval->create_conf = GAATMP_create_conf.arg1 ;};
 
                return GAA_OK;
@@ -572,14 +585,14 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
                GAA_TESTMOREARGS;
                GAA_FILL(GAATMP_passwd_conf.arg1, gaa_getstr, 
GAATMP_passwd_conf.size1);
                gaa_index++;
-#line 32 "crypt.gaa"
+#line 35 "srptool.gaa"
 { gaaval->passwd_conf = GAATMP_passwd_conf.arg1 ;};
 
                return GAA_OK;
                break;
        case GAAOPTID_verify:
        OK = 0;
-#line 29 "crypt.gaa"
+#line 32 "srptool.gaa"
 { gaaval->verify = 1 ;};
 
                return GAA_OK;
@@ -589,7 +602,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
                GAA_TESTMOREARGS;
                GAA_FILL(GAATMP_salt.arg1, gaa_getint, GAATMP_salt.size1);
                gaa_index++;
-#line 26 "crypt.gaa"
+#line 29 "srptool.gaa"
 { gaaval->salt = GAATMP_salt.arg1 ;};
 
                return GAA_OK;
@@ -599,7 +612,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
                GAA_TESTMOREARGS;
                GAA_FILL(GAATMP_index.arg1, gaa_getint, GAATMP_index.size1);
                gaa_index++;
-#line 23 "crypt.gaa"
+#line 26 "srptool.gaa"
 { gaaval->index = GAATMP_index.arg1 ;};
 
                return GAA_OK;
@@ -609,7 +622,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
                GAA_TESTMOREARGS;
                GAA_FILL(GAATMP_passwd.arg1, gaa_getstr, GAATMP_passwd.size1);
                gaa_index++;
-#line 20 "crypt.gaa"
+#line 23 "srptool.gaa"
 { gaaval->passwd = GAATMP_passwd.arg1 ;};
 
                return GAA_OK;
@@ -619,11 +632,21 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo 
*gaaval, char *opt_list)
                GAA_TESTMOREARGS;
                GAA_FILL(GAATMP_username.arg1, gaa_getstr, 
GAATMP_username.size1);
                gaa_index++;
-#line 17 "crypt.gaa"
+#line 20 "srptool.gaa"
 { gaaval->username = GAATMP_username.arg1 ;};
 
                return GAA_OK;
                break;
+       case GAAOPTID_debug:
+       OK = 0;
+               GAA_TESTMOREARGS;
+               GAA_FILL(GAATMP_debug.arg1, gaa_getint, GAATMP_debug.size1);
+               gaa_index++;
+#line 17 "srptool.gaa"
+{ gaaval->debug = GAATMP_debug.arg1 ;};
+
+               return GAA_OK;
+               break;
 
 #line 413 "gaa.skel"
     default: break;
@@ -648,10 +671,10 @@ int gaa(int argc, char **argv, gaainfo *gaaval)
     if(inited == 0)
     {
 
-#line 40 "crypt.gaa"
+#line 43 "srptool.gaa"
 { gaaval->username=NULL; gaaval->passwd=NULL; gaaval->salt=0;
        gaaval->create_conf=NULL; gaaval->passwd_conf=NULL; gaaval->verify = 0; 
-       gaaval->index = 1; ;};
+       gaaval->index = 1; gaaval->debug = 0; ;};
 
     }
     inited = 1;
diff --git a/src/crypt-gaa.h b/src/srptool-gaa.h
similarity index 71%
rename from src/crypt-gaa.h
rename to src/srptool-gaa.h
index 42eac7d..585238d 100644
--- a/src/crypt-gaa.h
+++ b/src/srptool-gaa.h
@@ -8,20 +8,22 @@ typedef struct _gaainfo gaainfo;
 
 struct _gaainfo
 {
-#line 34 "crypt.gaa"
+#line 37 "srptool.gaa"
        char *create_conf;
-#line 31 "crypt.gaa"
+#line 34 "srptool.gaa"
        char *passwd_conf;
-#line 28 "crypt.gaa"
+#line 31 "srptool.gaa"
        int verify;
-#line 25 "crypt.gaa"
+#line 28 "srptool.gaa"
        int salt;
-#line 22 "crypt.gaa"
+#line 25 "srptool.gaa"
        int index;
-#line 19 "crypt.gaa"
+#line 22 "srptool.gaa"
        char *passwd;
-#line 16 "crypt.gaa"
+#line 19 "srptool.gaa"
        char *username;
+#line 16 "srptool.gaa"
+       int debug;
 
 #line 114 "gaa.skel"
 };
diff --git a/src/crypt.c b/src/srptool.c
similarity index 98%
rename from src/crypt.c
rename to src/srptool.c
index 2673683..1878424 100644
--- a/src/crypt.c
+++ b/src/srptool.c
@@ -389,8 +389,13 @@ verify_passwd (char *conffile, char *tpasswd, char 
*username,
 #define KPASSWD "/etc/tpasswd"
 #define KPASSWD_CONF "/etc/tpasswd.conf"
 
-int
-main (int argc, char **argv)
+static void
+tls_log_func (int level, const char *str)
+{
+  fprintf (stderr, "|<%d>| %s", level, str);
+}
+
+int main (int argc, char **argv)
 {
   gaainfo info;
   const char *passwd;
@@ -413,6 +418,9 @@ main (int argc, char **argv)
       return -1;
     }
 
+  gnutls_global_set_log_function (tls_log_func);
+  gnutls_global_set_log_level (info.debug);
+
   if (info.create_conf != NULL)
     {
       return generate_create_conf (info.create_conf);
diff --git a/src/crypt.gaa b/src/srptool.gaa
similarity index 90%
rename from src/crypt.gaa
rename to src/srptool.gaa
index 516b257..0026b0a 100644
--- a/src/crypt.gaa
+++ b/src/srptool.gaa
@@ -13,6 +13,9 @@ void srptool_version(void);
 
 helpnode "Srptool help\nUsage : srptool [options]"
 
+#int debug;
+option (d, debug) INT "integer" { $debug = $1 } "Enable debugging" 
+
 #char *username;
 option (u,username) STR "username" { $username = $1 } "specify username."
 
@@ -39,4 +42,4 @@ option (h, help) { gaa_help(); exit(0); } "shows this help 
text"
 
 init { $username=NULL; $passwd=NULL; $salt=0;
        $create_conf=NULL; $passwd_conf=NULL; $verify = 0; 
-       $index = 1; }
+       $index = 1; $debug = 0; }


hooks/post-receive
-- 
GNU gnutls



reply via email to

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