aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-03-24 04:03:55 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-03-24 04:03:55 +0000
commitda468060c75b20d54073da775845850a466f982c (patch)
tree32cbc8b7e9ef5f3bec85be5d83ca100569f39de5 /libsylph
parentefc57958a1bcb630e29f3600bedee4073ecf6359 (diff)
libsylph/ssl_hostname_validation.h: Added debug print.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3365 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/ssl_hostname_validation.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libsylph/ssl_hostname_validation.c b/libsylph/ssl_hostname_validation.c
index 0d301420..cb2cea94 100644
--- a/libsylph/ssl_hostname_validation.c
+++ b/libsylph/ssl_hostname_validation.c
@@ -41,6 +41,7 @@
#include <openssl/x509v3.h>
#include <openssl/ssl.h>
+#include "utils.h"
#include "ssl_hostname_validation.h"
@@ -187,6 +188,8 @@ static SSLHostnameValidationResult matches_common_name(const char *hostname, con
}
common_name_str = (char *) ASN1_STRING_data(common_name_asn1);
+ debug_print("matches_common_name: %s\n", common_name_str);
+
// Make sure there isn't an embedded NUL character in the CN
if (ASN1_STRING_length(common_name_asn1) != strlen(common_name_str)) {
return SSL_HOSTNAME_MALFORMED_CERTIFICATE;
@@ -226,6 +229,8 @@ static SSLHostnameValidationResult matches_subject_alternative_name(const char *
// Current name is a DNS name, let's check it
char *dns_name = (char *) ASN1_STRING_data(current_name->d.dNSName);
+ debug_print("matches_subject_alternative_name: %s\n", dns_name);
+
// Make sure there isn't an embedded NUL character in the DNS name
if (ASN1_STRING_length(current_name->d.dNSName) != strlen(dns_name)) {
result = SSL_HOSTNAME_MALFORMED_CERTIFICATE;
@@ -259,6 +264,8 @@ static SSLHostnameValidationResult matches_subject_alternative_name(const char *
SSLHostnameValidationResult ssl_validate_hostname(const char *hostname, const X509 *server_cert) {
SSLHostnameValidationResult result;
+ debug_print("ssl_validate_hostname: validating hostname: %s\n", hostname);
+
if((hostname == NULL) || (server_cert == NULL))
return SSL_HOSTNAME_ERROR;