aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/crypto/x509.c3
-rw-r--r--src/tests/x509_test.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/crypto/x509.c b/src/crypto/x509.c
index 17d8c7a43..1f017eb03 100644
--- a/src/crypto/x509.c
+++ b/src/crypto/x509.c
@@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <errno.h>
#include <assert.h>
#include <ipxe/list.h>
@@ -1464,7 +1465,7 @@ static int x509_check_dnsname ( struct x509_certificate *cert,
/* Compare names */
if ( ! ( ( strlen ( name ) == len ) &&
- ( memcmp ( name, dnsname, len ) == 0 ) ) )
+ ( strncasecmp ( name, dnsname, len ) == 0 ) ) )
return -ENOENT;
if ( name != fullname ) {
diff --git a/src/tests/x509_test.c b/src/tests/x509_test.c
index 256c3e85e..b6cba575c 100644
--- a/src/tests/x509_test.c
+++ b/src/tests/x509_test.c
@@ -1037,6 +1037,7 @@ static void x509_test_exec ( void ) {
/* Check certificate names */
x509_check_name_ok ( &server_crt, "boot.test.ipxe.org" );
x509_check_name_ok ( &server_crt, "demo.test.ipxe.org" );
+ x509_check_name_ok ( &server_crt, "demo.test.iPXE.org" );
x509_check_name_fail_ok ( &server_crt, "incorrect.test.ipxe.org" );
x509_check_name_ok ( &server_crt, "anything.alt.test.ipxe.org" );
x509_check_name_ok ( &server_crt, "wildcard.alt.test.ipxe.org" );