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_99_4-9-g724bc2f


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_99_4-9-g724bc2f
Date: Wed, 27 Jul 2011 15:54:28 +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=724bc2f719148f097c9d65f216ab6364abf8fb5f

The branch, master has been updated
       via  724bc2f719148f097c9d65f216ab6364abf8fb5f (commit)
       via  74062dd6be8373a3a692580aa0e7808a1a2f0624 (commit)
       via  6c79f80768310baab38496255d349e722aa173c8 (commit)
       via  dde838cc7d5c8d61162c2e6900a18397ddaab592 (commit)
      from  c4d352e6559179652c20f1fb67fa522be4a3c028 (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 724bc2f719148f097c9d65f216ab6364abf8fb5f
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Jul 27 17:42:33 2011 +0200

    Added gnutls_pcert_list_import_x509_raw() and few doc fixes.

commit 74062dd6be8373a3a692580aa0e7808a1a2f0624
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Jul 27 16:00:04 2011 +0200

    corrected for libnettle.

commit 6c79f80768310baab38496255d349e722aa173c8
Author: Andreas Metzler <address@hidden>
Date:   Fri Jun 24 17:56:38 2011 +0200

    fix zlib handling in gnutls.pc
    
    Only add zlib to gnutls.pc's Requies.private if zlib ships a pkg-config
    file. Ancient (<< 1.2.3.1) versions don't. Otherwise add -lz to
    Libs.private.
    
    Signed-off-by: Nikos Mavrogiannopoulos <address@hidden>

commit dde838cc7d5c8d61162c2e6900a18397ddaab592
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Jul 27 15:51:19 2011 +0200

    gnutls_global_init_extra() is not needed for SRP.

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

Summary of changes:
 configure.ac                   |   13 ++++++--
 doc/examples/ex-client-srp.c   |    5 ---
 doc/examples/ex-serv-srp.c     |    3 --
 lib/gnutls.pc.in               |    2 +-
 lib/gnutls_pcert.c             |   64 ++++++++++++++++++++++++++++++++++++++++
 lib/gnutls_privkey.c           |    6 ++--
 lib/includes/gnutls/abstract.h |    6 ++++
 lib/libgnutls.map              |    1 +
 8 files changed, 85 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index a03421f..d232634 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,14 +186,21 @@ else
  AC_MSG_RESULT(no)
 fi
 
+PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n)
+
 if test x$ac_zlib != xno; then
-  if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
-    GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
+  if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then
+    if test x$GNUTLS_REQUIRES_PRIVATE = x; then
+      GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
+    else
+      GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE , zlib"
+    fi
   else
-    GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE , zlib"
+    GNUTLS_ZLIB_LIBS_PRIVATE="$LTLIBZ"
   fi
 fi
 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
+AC_SUBST(GNUTLS_ZLIB_LIBS_PRIVATE)
 
 
 gl_INIT
diff --git a/doc/examples/ex-client-srp.c b/doc/examples/ex-client-srp.c
index a7109b6..905aab1 100644
--- a/doc/examples/ex-client-srp.c
+++ b/doc/examples/ex-client-srp.c
@@ -34,11 +34,6 @@ main (void)
 
   gnutls_global_init ();
 
-  /* now enable the gnutls-extra library which contains the
-   * SRP stuff.
-   */
-  gnutls_global_init_extra ();
-
   gnutls_srp_allocate_client_credentials (&srp_cred);
   gnutls_certificate_allocate_credentials (&cert_cred);
 
diff --git a/doc/examples/ex-serv-srp.c b/doc/examples/ex-serv-srp.c
index 96a0a74..880c429 100644
--- a/doc/examples/ex-serv-srp.c
+++ b/doc/examples/ex-serv-srp.c
@@ -72,10 +72,7 @@ main (void)
 
   strcpy (name, "Echo Server");
 
-  /* these must be called once in the program
-   */
   gnutls_global_init ();
-  gnutls_global_init_extra ();  /* for SRP */
 
   /* SRP_PASSWD a password file (created with the included srptool utility) 
    */
diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in
index 2d3328c..32170b6 100644
--- a/lib/gnutls.pc.in
+++ b/lib/gnutls.pc.in
@@ -20,6 +20,6 @@ Description: Transport Security Layer implementation for the 
GNU system
 URL: http://www.gnu.org/software/gnutls/
 Version: @VERSION@
 Libs: -L${libdir} -lgnutls
-Libs.private: @LTLIBGCRYPT@ @NETTLE_LIBS@
+Libs.private: @LTLIBNETTLE@
 @GNUTLS_REQUIRES_PRIVATE@
 Cflags: -I${includedir}
diff --git a/lib/gnutls_pcert.c b/lib/gnutls_pcert.c
index ef360a1..1927b90 100644
--- a/lib/gnutls_pcert.c
+++ b/lib/gnutls_pcert.c
@@ -100,6 +100,70 @@ cleanup:
 }
 
 /**
+ * gnutls_pcert_list_import_x509_raw:
+ * @pcerts: The structures to store the parsed certificate. Must not be 
initialized.
+ * @pcert_max: Initially must hold the maximum number of certs. It will be 
updated with the number of certs available.
+ * @data: The certificates.
+ * @format: One of DER or PEM.
+ * @flags: must be (0) or an OR'd sequence of gnutls_certificate_import_flags.
+ *
+ * This function will convert the given PEM encoded certificate list
+ * to the native gnutls_x509_crt_t format. The output will be stored
+ * in @certs.  They will be automatically initialized.
+ *
+ * If the Certificate is PEM encoded it should have a header of "X509
+ * CERTIFICATE", or "CERTIFICATE".
+ *
+ * Returns: the number of certificates read or a negative error value.
+ **/
+int
+gnutls_pcert_list_import_x509_raw (gnutls_pcert_st * pcerts,
+                             unsigned int *pcert_max,
+                             const gnutls_datum_t * data,
+                             gnutls_x509_crt_fmt_t format, unsigned int flags)
+{
+int ret, i = 0, j;
+gnutls_x509_crt_t *crt;
+
+  crt = gnutls_malloc((*pcert_max) * sizeof(gnutls_x509_crt_t));
+
+  if (crt == NULL)
+    return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
+
+  ret = gnutls_x509_crt_list_import( crt, pcert_max, data, format, flags);
+  if (ret < 0)
+    {
+      ret = gnutls_assert_val(ret);
+      goto cleanup;
+    }
+  
+  for (i=0;i<*pcert_max;i++)
+    {
+      ret = gnutls_pcert_import_x509(&pcerts[i], crt[i], flags);
+      if (ret < 0)
+        {
+          ret = gnutls_assert_val(ret);
+          goto cleanup_pcert;
+        }
+    }
+
+  ret = 0;
+  goto cleanup;
+
+cleanup_pcert:
+  for (j=0;j<i;j++)
+    gnutls_pcert_deinit(&pcerts[j]);
+
+cleanup:
+  for (i=0;i<*pcert_max;i++)
+    gnutls_x509_crt_deinit(crt[i]);
+
+  gnutls_free(crt);
+  return ret;
+
+}
+
+/**
  * gnutls_pcert_import_x509_raw:
  * @pcert: The pcert structure
  * @cert: The raw certificate to be imported
diff --git a/lib/gnutls_privkey.c b/lib/gnutls_privkey.c
index ef2801a..422b2e1 100644
--- a/lib/gnutls_privkey.c
+++ b/lib/gnutls_privkey.c
@@ -307,7 +307,7 @@ static int check_if_clean(gnutls_privkey_t key)
  * gnutls_privkey_import_pkcs11:
  * @pkey: The private key
  * @key: The private key to be imported
- * @flags: should be zero
+ * @flags: should be zero or %GNUTLS_PRIVKEY_IMPORT_AUTO_RELEASE
  *
  * This function will import the given private key to the abstract
  * #gnutls_privkey_t structure.
@@ -345,7 +345,7 @@ int ret;
  * gnutls_privkey_import_x509:
  * @pkey: The private key
  * @key: The private key to be imported
- * @flags: should be zero
+ * @flags: should be zero or %GNUTLS_PRIVKEY_IMPORT_AUTO_RELEASE
  *
  * This function will import the given private key to the abstract
  * #gnutls_privkey_t structure.
@@ -382,7 +382,7 @@ int ret;
  * gnutls_privkey_import_openpgp:
  * @pkey: The private key
  * @key: The private key to be imported
- * @flags: should be zero
+ * @flags: should be zero or %GNUTLS_PRIVKEY_IMPORT_AUTO_RELEASE
  *
  * This function will import the given private key to the abstract
  * #gnutls_privkey_t structure.
diff --git a/lib/includes/gnutls/abstract.h b/lib/includes/gnutls/abstract.h
index 078ab60..c1a028e 100644
--- a/lib/includes/gnutls/abstract.h
+++ b/lib/includes/gnutls/abstract.h
@@ -182,6 +182,12 @@ typedef struct gnutls_pcert_st {
 int gnutls_pcert_import_x509 (gnutls_pcert_st* pcert,
        gnutls_x509_crt_t crt, unsigned int flags);
 
+int
+gnutls_pcert_list_import_x509_raw (gnutls_pcert_st * pcerts,
+                             unsigned int *pcert_max,
+                             const gnutls_datum_t * data,
+                             gnutls_x509_crt_fmt_t format, unsigned int flags);
+
 int gnutls_pcert_import_x509_raw (gnutls_pcert_st* pcert,
        const gnutls_datum_t* cert, 
        gnutls_x509_crt_fmt_t format, unsigned int flags);
diff --git a/lib/libgnutls.map b/lib/libgnutls.map
index b26c065..42bb838 100644
--- a/lib/libgnutls.map
+++ b/lib/libgnutls.map
@@ -714,6 +714,7 @@ GNUTLS_3_0_0 {
        gnutls_x509_trust_list_verify_named_crt;
        gnutls_x509_trust_list_add_named_crt;
        gnutls_alert_get_strname;
+       gnutls_pcert_list_import_x509_raw;
 } GNUTLS_2_12;
 
 GNUTLS_PRIVATE {


hooks/post-receive
-- 
GNU gnutls



reply via email to

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