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
openldap
OpenLDAP
Commits
d9eac720
Commit
d9eac720
authored
Aug 01, 2002
by
Howard Chu
Browse files
ITS
#1995
return error text when ldap_pvt_tls_check_hostname fails
parent
478283ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap/tls.c
View file @
d9eac720
...
...
@@ -916,7 +916,7 @@ ldap_pvt_tls_get_peer_hostname( void *s )
}
int
ldap_pvt_tls_check_hostname
(
void
*
s
,
const
char
*
name_in
)
ldap_pvt_tls_check_hostname
(
LDAP
*
ld
,
void
*
s
,
const
char
*
name_in
)
{
int
i
,
ret
=
LDAP_LOCAL_ERROR
;
X509
*
x
;
...
...
@@ -1019,6 +1019,7 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in )
"TLS: unable to get common name from peer certificate.
\n
"
,
0
,
0
,
0
);
#endif
ld
->
ld_error
=
LDAP_STRDUP
(
"TLS: unable to get CN from peer certificate"
);
}
else
if
(
strcasecmp
(
name
,
buf
))
{
#ifdef NEW_LOGGING
...
...
@@ -1031,6 +1032,7 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in )
name
,
buf
,
0
);
#endif
ret
=
LDAP_CONNECT_ERROR
;
ld
->
ld_error
=
LDAP_STRDUP
(
"TLS: hostname does not match CN in peer certificate"
);
}
else
{
ret
=
LDAP_SUCCESS
;
...
...
@@ -1308,7 +1310,7 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
/*
* compare host with name(s) in certificate
*/
ld
->
ld_errno
=
ldap_pvt_tls_check_hostname
(
ssl
,
host
);
ld
->
ld_errno
=
ldap_pvt_tls_check_hostname
(
ld
,
ssl
,
host
);
if
(
ld
->
ld_errno
!=
LDAP_SUCCESS
)
{
return
ld
->
ld_errno
;
}
...
...
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