[SCM] GNU gnutls branch, master, updated. gnutls_3_0_11-16-g3eece98

"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=3eece98521d1965bd260b5f4a4e38835b01a9d35

The branch, master has been updated
       via  3eece98521d1965bd260b5f4a4e38835b01a9d35 (commit)
       via  8856e3cc30ef3fd3aba7cffafe8581a4287793fb (commit)
       via  db5619592b13c448c60373d4229ecc2105821c51 (commit)
       via  f1f79baf66a79227246160ea49a805f60d5d6b68 (commit)
       via  391cf5f64bc1bb263a33d1f7be9889be09161272 (commit)
      from  b0b55b40f3200cc5227d46de679e2e7311dce372 (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 3eece98521d1965bd260b5f4a4e38835b01a9d35
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Sun Jan 8 15:30:11 2012 +0100

    more gcc warnings to ignore

commit 8856e3cc30ef3fd3aba7cffafe8581a4287793fb
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Sun Jan 8 14:47:51 2012 +0100

    tcp and udp server are now void functions.

commit db5619592b13c448c60373d4229ecc2105821c51
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Sun Jan 8 14:40:17 2012 +0100

    --outder option works for public keys.

commit f1f79baf66a79227246160ea49a805f60d5d6b68
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Sun Jan 8 13:21:23 2012 +0100

    certtool --outder option now works for private keys as well.

commit 391cf5f64bc1bb263a33d1f7be9889be09161272
Author: Nikos Mavrogiannopoulos <[email protected]>
Date:   Sun Jan 8 12:46:52 2012 +0100

    removed trailing slash.

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

Summary of changes:
 NEWS                            |    3 ++
 configure.ac                    |    5 ++++
 lib/accelerated/x86/Makefile.am |    3 +-
 src/certtool.c                  |   44 ++++++++++++++++++++++++++++----------
 src/serv.c                      |   10 +++-----
 src/udp-serv.c                  |    2 +-
 src/udp-serv.h                  |    2 +-
 7 files changed, 47 insertions(+), 22 deletions(-)

diff --git a/NEWS b/NEWS
index df33d1b..80a51a2 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ See the end for copying conditions.
 
 * Version 3.0.12 (unreleased)
 
+** certtool: --outder option now works for private
+and public keys as well.
+
 ** libgnutls: Corrected memory leak in DH parameter
 generation.
 
diff --git a/configure.ac b/configure.ac
index 78eb975..56b2ada 100644
--- a/configure.ac
+++ b/configure.ac
@@ -276,7 +276,12 @@ if test "$gl_gcc_warnings" = yes; then
 
   gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
   gl_WARN_ADD([-Wno-sign-compare])     # Too many warnings for now
+  gl_WARN_ADD([-Wno-format-y2k])     # Too many warnings for now
+  gl_WARN_ADD([-Wno-suggest-attribute=pure])     # Too many warnings for now
+  gl_WARN_ADD([-Wno-suggest-attribute=const])     # Too many warnings for now
+  gl_WARN_ADD([-Wno-suggest-attribute=noreturn])     # Too many warnings for now
   gl_WARN_ADD([-Wno-pointer-sign])     # Too many warnings for now
+  gl_WARN_ADD([-Wno-unused-value]) # warnings for things we don't want to get
   gl_WARN_ADD([-Wno-unused-result]) # warnings for things we don't want to get
   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
diff --git a/lib/accelerated/x86/Makefile.am b/lib/accelerated/x86/Makefile.am
index 79acf96..d96837c 100644
--- a/lib/accelerated/x86/Makefile.am
+++ b/lib/accelerated/x86/Makefile.am
@@ -20,8 +20,7 @@
 
 AM_LIBTOOLFLAGS=--tag=CC
 AM_CFLAGS = $(WERROR_CFLAGS) $(WSTACK_CFLAGS) $(WARN_CFLAGS)
-AM_CPPFLAGS = \
-	-I$(srcdir)/../../../gl		\
+AM_CPPFLAGS = -I$(srcdir)/../../../gl		\
 	-I$(builddir)/../../../gl		\
 	-I$(srcdir)/../../includes	\
 	-I$(builddir)/../../includes	\
diff --git a/src/certtool.c b/src/certtool.c
index 11de1f9..d740474 100644
--- a/src/certtool.c
+++ b/src/certtool.c
@@ -275,7 +275,8 @@ print_private_key (gnutls_x509_privkey_t key)
   if (!key)
     return;
 
-  privkey_info_int(key);
+  if (info.outcert_format == GNUTLS_X509_FMT_PEM)
+    privkey_info_int(key);
 
   if (!info.pkcs8)
     {
@@ -1198,16 +1199,18 @@ certificate_info (int pubkey, common_info_st * cinfo)
       if (info.outcert_format == GNUTLS_X509_FMT_PEM)
         print_certificate_info (crt[i], outfile, 1);
 
-      size = buffer_size;
-      ret = gnutls_x509_crt_export (crt[i], info.outcert_format, buffer,
-                                    &size);
-      if (ret < 0)
-        error (EXIT_FAILURE, 0, "export error: %s", gnutls_strerror (ret));
-
-      fwrite (buffer, 1, size, outfile);
-
       if (pubkey)
         pubkey_info (crt[i], cinfo);
+      else
+        {
+          size = buffer_size;
+          ret = gnutls_x509_crt_export (crt[i], info.outcert_format, buffer,
+                                        &size);
+          if (ret < 0)
+            error (EXIT_FAILURE, 0, "export error: %s", gnutls_strerror (ret));
+
+          fwrite (buffer, 1, size, outfile);
+        }
 
       gnutls_x509_crt_deinit (crt[i]);
     }
@@ -1788,7 +1791,8 @@ privkey_info (void)
   if (ret < 0)
     error (EXIT_FAILURE, 0, "import error: %s", gnutls_strerror (ret));
 
-  privkey_info_int (key);
+  if (info.outcert_format == GNUTLS_X509_FMT_PEM)
+    privkey_info_int (key);
 
   ret = gnutls_x509_privkey_verify_params (key);
   if (ret < 0)
@@ -1802,11 +1806,11 @@ privkey_info (void)
     }
 
   size = buffer_size;
-  ret = gnutls_x509_privkey_export (key, GNUTLS_X509_FMT_PEM, buffer, &size);
+  ret = gnutls_x509_privkey_export (key, info.outcert_format, buffer, &size);
   if (ret < 0)
     error (EXIT_FAILURE, 0, "export error: %s", gnutls_strerror (ret));
 
-  fprintf (outfile, "\n%s\n", buffer);
+  fwrite (buffer, 1, size, outfile);
 
   gnutls_x509_privkey_deinit (key);
 }
@@ -2945,6 +2949,22 @@ pubkey_info (gnutls_x509_crt_t crt, common_info_st * cinfo)
       pubkey = load_pubkey (1, cinfo);
     }
 
+  if (info.outcert_format == GNUTLS_X509_FMT_DER)
+    {
+      size = buffer_size;
+      ret = gnutls_pubkey_export (pubkey, info.outcert_format, buffer, &size);
+      if (ret < 0)
+        error (EXIT_FAILURE, 0, "export error: %s", gnutls_strerror (ret));
+
+      fwrite (buffer, 1, size, outfile);
+
+      gnutls_pubkey_deinit (pubkey);
+      
+      return;
+    }
+    
+  /* PEM */
+
   fprintf (outfile, "Public Key Info:\n\n");
   ret = gnutls_pubkey_get_pk_algorithm (pubkey, &bits);
   fprintf (outfile, "Public Key Algorithm: ");
diff --git a/src/serv.c b/src/serv.c
index 9305caa..7aa60d0 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -81,7 +81,7 @@ char *dh_params_file;
 char *x509_crlfile = NULL;
 
 gnutls_datum_t session_ticket_key;
-static int tcp_server(const char* name, int port);
+static void tcp_server(const char* name, int port);
 
 /* end of globals */
 
@@ -1137,12 +1137,12 @@ main (int argc, char **argv)
 #endif
 
   if (info.udp)
-    return udp_server(name, info.port, info.mtu);
+    udp_server(name, info.port, info.mtu);
   else
-    return tcp_server(name, info.port);
+    tcp_server(name, info.port);
 }
 
-static int tcp_server(const char* name, int port)
+static void tcp_server(const char* name, int port)
 {
   int n, s;
   char topbuf[512];
@@ -1528,8 +1528,6 @@ static int tcp_server(const char* name, int port)
     wrap_db_deinit ();
   gnutls_global_deinit ();
 
-  return 0;
-
 }
 
 void
diff --git a/src/udp-serv.c b/src/udp-serv.c
index 2d98f45..af033fa 100644
--- a/src/udp-serv.c
+++ b/src/udp-serv.c
@@ -50,7 +50,7 @@ static ssize_t pull_func(gnutls_transport_ptr_t p, void * data, size_t size);
 
 #define MAX_BUFFER 255     /* Longest string to echo */
 
-int udp_server(const char* name, int port, int mtu)
+void udp_server(const char* name, int port, int mtu)
 {
     int sock, ret;
     struct sockaddr_in cli_addr;
diff --git a/src/udp-serv.h b/src/udp-serv.h
index ce4c54d..b7e2aa7 100644
--- a/src/udp-serv.h
+++ b/src/udp-serv.h
@@ -1,6 +1,6 @@
 #include <gnutls/dtls.h>
 
-int udp_server(const char* name, int port, int mtu);
+void udp_server(const char* name, int port, int mtu);
 gnutls_session_t initialize_session (int dtls);
 const char * human_addr (const struct sockaddr *sa, socklen_t salen,
             char *buf, size_t buflen);


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.