[SCM] GNU gnutls branch, master, updated. gnutls_3_0_9-49-g10ce262

"Nikos Mavrogiannopoulos" <[email protected]>
Newsgroups gmane.comp.encryption.gpg.gnutls.cvs
Message-ID <[email protected]>
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=10ce2625f2625149083e66232795e7b20e3609ad

The branch, master has been updated
       via  10ce2625f2625149083e66232795e7b20e3609ad (commit)
       via  340a2a99d6a6b4a98fab75b876422d74ff8d22d2 (commit)
       via  f261fcd88326433616f71a190915307f371a1e5b (commit)
       via  412ea9fc5af9f54ca9375e9f73c051f510478d4c (commit)
      from  92353d742863ce89d4b1861c6fed26228e391ed2 (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 10ce2625f2625149083e66232795e7b20e3609ad
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Fri Dec 30 18:22:38 2011 +0200

    gnutls-cli can now read input from win32.

commit 340a2a99d6a6b4a98fab75b876422d74ff8d22d2
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Fri Dec 30 17:23:02 2011 +0200

    Avoid using base64 armor auto-detection which causes decoding errors in win32.
    For some reason reading from the stream modifies the stream
    and this work-around avoids that issue.

commit f261fcd88326433616f71a190915307f371a1e5b
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Fri Dec 30 12:04:06 2011 +0200

    enable debugging in pgps2kgnu

commit 412ea9fc5af9f54ca9375e9f73c051f510478d4c
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Fri Dec 30 12:01:16 2011 +0200

    do not use valgrind in windows

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

Summary of changes:
 NEWS                  |    7 +++++++
 lib/openpgp/pgp.c     |    3 +--
 lib/openpgp/privkey.c |   15 ++++++---------
 src/cli.c             |   20 +++++++++++++++++---
 tests/Makefile.am     |    7 +++++--
 tests/openpgp-auth2.c |   10 ++++++++++
 tests/pgps2kgnu.c     |   14 +++++++++++++-
 7 files changed, 59 insertions(+), 17 deletions(-)

diff --git a/NEWS b/NEWS
index a1a0e73..106cde2 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,13 @@ See the end for copying conditions.
 ** gnutls-cli/serv: Set don't fragment bit in DTLS sessions
 in Linux as well as in BSD.
 
+** gnutls-cli: Fixed reading from windows terminals.
+
+** libgnutls: When GNUTLS_OPENPGP_FMT_BASE64 is specified
+the stream is assumed to be base64 encoded (previously
+the encoding was auto-detected). This avoids a decoding
+issue in windows systems.
+
 ** libgnutls: Corrected ciphersuite GNUTLS_ECDHE_PSK_AES_256_CBC_SHA384
 
 ** libgnutls: Added ciphersuites: GNUTLS_PSK_WITH_AES_256_GCM_SHA384
diff --git a/lib/openpgp/pgp.c b/lib/openpgp/pgp.c
index 2510ae9..e012644 100644
--- a/lib/openpgp/pgp.c
+++ b/lib/openpgp/pgp.c
@@ -118,8 +118,7 @@ gnutls_openpgp_crt_import (gnutls_openpgp_crt_t key,
           gnutls_assert ();
           return rc;
         }
-      if (cdk_armor_filter_use (inp))
-        rc = cdk_stream_set_armor_flag (inp, 0);
+      rc = cdk_stream_set_armor_flag (inp, 0);
       if (!rc)
         rc = cdk_keydb_get_keyblock (inp, &key->knode);
       cdk_stream_close (inp);
diff --git a/lib/openpgp/privkey.c b/lib/openpgp/privkey.c
index 0ee0532..f43c53b 100644
--- a/lib/openpgp/privkey.c
+++ b/lib/openpgp/privkey.c
@@ -199,16 +199,13 @@ gnutls_openpgp_privkey_import (gnutls_openpgp_privkey_t key,
           return rc;
         }
 
-      if (cdk_armor_filter_use (inp))
+      rc = cdk_stream_set_armor_flag (inp, 0);
+      if (rc != 0)
         {
-          rc = cdk_stream_set_armor_flag (inp, 0);
-          if (rc != 0)
-            {
-              rc = _gnutls_map_cdk_rc (rc);
-              cdk_stream_close (inp);
-              gnutls_assert ();
-              return rc;
-            }
+          rc = _gnutls_map_cdk_rc (rc);
+          cdk_stream_close (inp);
+          gnutls_assert ();
+          return rc;
         }
 
       rc = cdk_keydb_get_keyblock (inp, &key->knode);
diff --git a/src/cli.c b/src/cli.c
index 8676d1c..9c39a10 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -688,12 +688,17 @@ static int check_net_or_keyboard_input(socket_st* hd)
   do
     {
       FD_ZERO (&rset);
-      FD_SET (fileno (stdin), &rset);
       FD_SET (hd->fd, &rset);
 
+#ifndef _WIN32
+      FD_SET (fileno (stdin), &rset);
       maxfd = MAX (fileno (stdin), hd->fd);
+#else
+      maxfd = hd->fd;
+#endif
+
       tv.tv_sec = 0;
-      tv.tv_usec = 500 * 1000;
+      tv.tv_usec = 50 * 1000;
 
       if (hd->secure == 1)
         if (gnutls_record_check_pending(hd->session))
@@ -706,9 +711,18 @@ static int check_net_or_keyboard_input(socket_st* hd)
       if (FD_ISSET (hd->fd, &rset))
         return IN_NET;
 
-
+#ifdef _WIN32
+      {
+        int state;
+        state = WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 200); 
+        
+        if (state == WAIT_OBJECT_0)
+          return IN_KEYBOARD;
+      }
+#else
       if (FD_ISSET (fileno (stdin), &rset))
         return IN_KEYBOARD;
+#endif
     }
   while(err == 0);
   
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 31fc875..b00adfc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -98,6 +98,9 @@ TESTS_ENVIRONMENT =						\
 	PKCS12FILE_2=$(srcdir)/pkcs12-decode/pkcs12_2certs.p12	\
 	PKCS12PASSWORD_2=""					\
 	EXEEXT=$(EXEEXT)					\
-	srcdir="$(srcdir)"					\
-	$(VALGRIND)
+	srcdir="$(srcdir)"
 
+if !WINDOWS
+TESTS_ENVIRONMENT +=						\
+	$(VALGRIND)
+endif
diff --git a/tests/openpgp-auth2.c b/tests/openpgp-auth2.c
index 85820cc..9f3cd38 100644
--- a/tests/openpgp-auth2.c
+++ b/tests/openpgp-auth2.c
@@ -23,6 +23,8 @@
 #include <config.h>
 #endif
 
+#if !defined(_WIN32)
+
 #include <gnutls/gnutls.h>
 #include <gnutls/openpgp.h>
 
@@ -38,6 +40,7 @@
 #include <errno.h>
 #include <stdio.h>
 
+
 /* This is the same test as openpgp-auth but tests
  * openpgp under the latest TLS protocol (TLSv1.2). In
  * addition it tests DSS signatures under that.
@@ -247,3 +250,10 @@ doit ()
         fail ("child failed: %d\n", status);
     }
 }
+#else
+void
+doit ()
+{
+  exit (77);
+}
+#endif
diff --git a/tests/pgps2kgnu.c b/tests/pgps2kgnu.c
index f4ea214..b67e7eb 100644
--- a/tests/pgps2kgnu.c
+++ b/tests/pgps2kgnu.c
@@ -68,14 +68,26 @@ static char dummy_key[] =
         http://lists.gnu.org/archive/html/gnutls-devel/2008-08/msg00023.html
 */
 
+static void
+tls_log_func (int level, const char *str)
+{
+  fprintf (stderr, "|<%d>| %s", level, str);
+}
+
 int
-main (void)
+main (int argc, char** argv)
 {
   int rc;
   gnutls_datum_t keydatum =
     { (unsigned char *) dummy_key, strlen (dummy_key) };
   gnutls_openpgp_privkey_t key;
 
+  if (argc > 1)
+    {
+      gnutls_global_set_log_function (tls_log_func);
+      gnutls_global_set_log_level (9);
+    }
+
   rc = gnutls_global_init ();
   if (rc)
     {


hooks/post-receive
-- 
GNU gnutls
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.