summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/openldap/openldap-2.4.39/gnutls-Avoid-use-of-deprecated-function.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/openldap/openldap-2.4.39/gnutls-Avoid-use-of-deprecated-function.patch')
-rw-r--r--meta-oe/recipes-support/openldap/openldap-2.4.39/gnutls-Avoid-use-of-deprecated-function.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/openldap/openldap-2.4.39/gnutls-Avoid-use-of-deprecated-function.patch b/meta-oe/recipes-support/openldap/openldap-2.4.39/gnutls-Avoid-use-of-deprecated-function.patch
new file mode 100644
index 000000000..dffd3ca51
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap-2.4.39/gnutls-Avoid-use-of-deprecated-function.patch
@@ -0,0 +1,44 @@
1From 0205e83f4670d10ad3c6ae4b8fc5ec1d0c7020c0 Mon Sep 17 00:00:00 2001
2From: Howard Chu <hyc@openldap.org>
3Date: Sat, 7 Sep 2013 09:39:24 -0700
4Subject: [PATCH] ITS#7430 GnuTLS: Avoid use of deprecated function
5
6Upstream-status: Backport
7
8---
9 libraries/libldap/tls_g.c | 12 ++++++++++++
10 1 files changed, 12 insertions(+), 0 deletions(-)
11
12diff --git a/libraries/libldap/tls_g.c b/libraries/libldap/tls_g.c
13index 9acffaf..c793828 100644
14--- a/libraries/libldap/tls_g.c
15+++ b/libraries/libldap/tls_g.c
16@@ -368,6 +368,17 @@ tlsg_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
17 * then we have to build the cert chain.
18 */
19 if ( max == 1 && !gnutls_x509_crt_check_issuer( certs[0], certs[0] )) {
20+#if GNUTLS_VERSION_NUMBER >= 0x020c00
21+ unsigned int i;
22+ for ( i = 1; i<VERIFY_DEPTH; i++ ) {
23+ if ( gnutls_certificate_get_issuer( ctx->cred, certs[i-1], &certs[i], 0 ))
24+ break;
25+ max++;
26+ /* If this CA is self-signed, we're done */
27+ if ( gnutls_x509_crt_check_issuer( certs[i], certs[i] ))
28+ break;
29+ }
30+#else
31 gnutls_x509_crt_t *cas;
32 unsigned int i, j, ncas;
33
34@@ -387,6 +398,7 @@ tlsg_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
35 if ( j == ncas )
36 break;
37 }
38+#endif
39 }
40 rc = gnutls_certificate_set_x509_key( ctx->cred, certs, max, key );
41 if ( rc ) return -1;
42--
431.7.4.2
44