diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2014-03-24 04:03:55 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2014-03-24 04:03:55 +0000 |
commit | da468060c75b20d54073da775845850a466f982c (patch) | |
tree | 32cbc8b7e9ef5f3bec85be5d83ca100569f39de5 | |
parent | efc57958a1bcb630e29f3600bedee4073ecf6359 (diff) |
libsylph/ssl_hostname_validation.h: Added debug print.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3365 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libsylph/ssl_hostname_validation.c | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -1,6 +1,7 @@ 2014-03-24 * libsylph/ssl_hostname_validation.h: added include guard. + Added debug print. 2014-03-20 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; |