Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
7d2f9c62
Commit
7d2f9c62
authored
Jun 30, 2014
by
Ryan Tandy
Committed by
Howard Chu
Jun 30, 2014
Browse files
ITS#7877 assume gnutls is at least 2.12.0
parent
0fd0f24f
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap/tls_g.c
View file @
7d2f9c62
...
...
@@ -272,7 +272,6 @@ tlsg_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
* then we have to build the cert chain.
*/
if
(
max
==
1
&&
!
gnutls_x509_crt_check_issuer
(
certs
[
0
],
certs
[
0
]
))
{
#if GNUTLS_VERSION_NUMBER >= 0x020c00
unsigned
int
i
;
for
(
i
=
1
;
i
<
VERIFY_DEPTH
;
i
++
)
{
if
(
gnutls_certificate_get_issuer
(
ctx
->
cred
,
certs
[
i
-
1
],
&
certs
[
i
],
0
))
...
...
@@ -282,27 +281,6 @@ tlsg_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
if
(
gnutls_x509_crt_check_issuer
(
certs
[
i
],
certs
[
i
]
))
break
;
}
#else
gnutls_x509_crt_t
*
cas
;
unsigned
int
i
,
j
,
ncas
;
gnutls_certificate_get_x509_cas
(
ctx
->
cred
,
&
cas
,
&
ncas
);
for
(
i
=
1
;
i
<
VERIFY_DEPTH
;
i
++
)
{
for
(
j
=
0
;
j
<
ncas
;
j
++
)
{
if
(
gnutls_x509_crt_check_issuer
(
certs
[
i
-
1
],
cas
[
j
]
))
{
certs
[
i
]
=
cas
[
j
];
max
++
;
/* If this CA is self-signed, we're done */
if
(
gnutls_x509_crt_check_issuer
(
cas
[
j
],
cas
[
j
]
))
j
=
ncas
;
break
;
}
}
/* only continue if we found a CA and it was not self-signed */
if
(
j
==
ncas
)
break
;
}
#endif
}
rc
=
gnutls_certificate_set_x509_key
(
ctx
->
cred
,
certs
,
max
,
key
);
if
(
rc
)
return
-
1
;
...
...
@@ -692,8 +670,6 @@ tlsg_session_strength( tls_session *session )
static
int
tlsg_session_unique
(
tls_session
*
sess
,
struct
berval
*
buf
,
int
is_server
)
{
/* channel bindings added in 2.12.0 */
#if GNUTLS_VERSION_NUMBER >= 0x020c00
tlsg_session
*
s
=
(
tlsg_session
*
)
sess
;
gnutls_datum_t
cb
;
int
rc
;
...
...
@@ -707,7 +683,6 @@ tlsg_session_unique( tls_session *sess, struct berval *buf, int is_server)
memcpy
(
buf
->
bv_val
,
cb
.
data
,
len
);
return
len
;
}
#endif
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment