gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_3-5-g83ff33


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_3-5-g83ff33e
Date: Tue, 03 May 2011 19:47:29 +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=83ff33e7fdc369b8d4030f78633a6e279c51425f

The branch, gnutls_2_12_x has been updated
       via  83ff33e7fdc369b8d4030f78633a6e279c51425f (commit)
      from  0ed0446b6a73886a407136a3881ad90d979e8049 (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 83ff33e7fdc369b8d4030f78633a6e279c51425f
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Tue May 3 21:47:07 2011 +0200

    Added gnutls_certificate_get_issuer() to allow getting the issuer a 
certificate from the certificate credentials structure.

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

Summary of changes:
 NEWS                            |    9 +++++++++
 lib/gnutls_cert.c               |   31 +++++++++++++++++++++++++++++++
 lib/includes/gnutls/gnutls.h.in |    4 ++++
 lib/libgnutls.map               |    1 +
 tests/Makefile.am               |    2 +-
 5 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index f7a0e19..5cae3d4 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,15 @@ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
               2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
+* Version 2.12.4 (unreleased)
+
+** libgnutls: Added gnutls_certificate_get_issuer() to
+compensate for the deprecated gnutls_certificate_get_x509_cas().
+
+** API and ABI modifications:
+gnutls_certificate_get_issuer: ADDED
+
+
 * Version 2.12.3 (released 2011-04-22)
 
 * libgnutls: Several minor bugfixes.
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c
index 72887e5..d7ef9fd 100644
--- a/lib/gnutls_cert.c
+++ b/lib/gnutls_cert.c
@@ -87,6 +87,37 @@ gnutls_certificate_free_keys 
(gnutls_certificate_credentials_t sc)
 }
 
 /**
+ * gnutls_certificate_get_issuer:
+ * @sc: is a #gnutls_certificate_credentials_t structure.
+ * @cert: is the certificate to find issuer for
+ * @issuer: Will hold the issuer if any. Should be treated as constant.
+ * @flags: Use zero.
+ *
+ * This function will return the issuer of a given certificate.
+ *
+ * Returns: On success, %GNUTLS_E_SUCCESS is returned, otherwise a
+ *   negative error value.
+ **/
+int
+gnutls_certificate_get_issuer (gnutls_certificate_credentials_t sc,
+  gnutls_x509_crt_t cert, gnutls_x509_crt_t* issuer, unsigned int flags)
+{
+int i, ret;
+
+  for (i=0;i<sc->x509_ncas;i++)
+    {
+      ret = gnutls_x509_crt_check_issuer(cert, sc->x509_ca_list[i]);
+      if (ret > 0)
+        {
+          *issuer = sc->x509_ca_list[i];
+          return 0;
+        }
+    }
+  
+  return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE;
+}
+
+/**
  * gnutls_certificate_free_cas:
  * @sc: is a #gnutls_certificate_credentials_t structure.
  *
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index e28a666..20e5c50 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -1084,6 +1084,10 @@ extern "C"
   struct gnutls_openpgp_keyring_int;
   typedef struct gnutls_openpgp_keyring_int *gnutls_openpgp_keyring_t;
 
+  int
+    gnutls_certificate_get_issuer (gnutls_certificate_credentials_t sc,
+    gnutls_x509_crt_t cert, gnutls_x509_crt_t* issuer, unsigned int flags);
+
   int gnutls_certificate_set_x509_key (gnutls_certificate_credentials_t res,
                                        gnutls_x509_crt_t * cert_list,
                                        int cert_list_size,
diff --git a/lib/libgnutls.map b/lib/libgnutls.map
index 68ba398..2fc197a 100644
--- a/lib/libgnutls.map
+++ b/lib/libgnutls.map
@@ -689,6 +689,7 @@ GNUTLS_2_12
        gnutls_openpgp_crt_verify_hash;
        gnutls_pubkey_import_privkey;
        gnutls_pubkey_verify_data;
+       gnutls_certificate_get_issuer;
 } GNUTLS_2_10;
 
 GNUTLS_PRIVATE {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7bb485b..dfebc06 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -64,7 +64,7 @@ ctests = simple gc set_pkcs12_cred certder certuniqueid mpi   
                \
        crq_key_id x509sign-verify cve-2009-1415 cve-2009-1416          \
        crq_apis init_roundtrip pkcs12_s2k_pem dn2 mini-eagain          \
        nul-in-x509-names x509_altname pkcs12_encode mini-x509          \
-       mini-x509-rehandshake rng-fork #gendh
+       mini-x509-rehandshake rng-fork x509cert #gendh
 
 if ENABLE_OPENSSL
 ctests +=  openssl


hooks/post-receive
-- 
GNU gnutls



reply via email to

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