aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-09-30 18:54:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-10-31 08:46:35 +0100
commit811a693b803a8715e15ba56fb161d9e6b3b6b016 (patch)
tree47f61478d7d860eadba5396d88a444e906f6cfb9 /lib/vtls
parent502acba2af821391b85a2cd4ac7b91ad8e9d4180 (diff)
strcasecompare: all case insensitive string compares ignore locale now
We had some confusions on when each function was used. We should not act differently on different locales anyway.
Diffstat (limited to 'lib/vtls')
-rw-r--r--lib/vtls/cyassl.c4
-rw-r--r--lib/vtls/gtls.c4
-rw-r--r--lib/vtls/nss.c2
-rw-r--r--lib/vtls/openssl.c10
-rw-r--r--lib/vtls/vtls.c16
5 files changed, 18 insertions, 18 deletions
diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c
index 44c7ed760..492d812d2 100644
--- a/lib/vtls/cyassl.c
+++ b/lib/vtls/cyassl.c
@@ -118,9 +118,9 @@ static int do_file_type(const char *type)
{
if(!type || !type[0])
return SSL_FILETYPE_PEM;
- if(Curl_raw_equal(type, "PEM"))
+ if(strcasecompare(type, "PEM"))
return SSL_FILETYPE_PEM;
- if(Curl_raw_equal(type, "DER"))
+ if(strcasecompare(type, "DER"))
return SSL_FILETYPE_ASN1;
return -1;
}
diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
index 3b056c426..adc010b6a 100644
--- a/lib/vtls/gtls.c
+++ b/lib/vtls/gtls.c
@@ -356,9 +356,9 @@ static gnutls_x509_crt_fmt_t do_file_type(const char *type)
{
if(!type || !type[0])
return GNUTLS_X509_FMT_PEM;
- if(Curl_raw_equal(type, "PEM"))
+ if(strcasecompare(type, "PEM"))
return GNUTLS_X509_FMT_PEM;
- if(Curl_raw_equal(type, "DER"))
+ if(strcasecompare(type, "DER"))
return GNUTLS_X509_FMT_DER;
return -1;
}
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index 214c2240e..1c7594d7c 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -261,7 +261,7 @@ static SECStatus set_ciphers(struct Curl_easy *data, PRFileDesc * model,
found = PR_FALSE;
for(i=0; i<NUM_OF_CIPHERS; i++) {
- if(Curl_raw_equal(cipher, cipherlist[i].name)) {
+ if(strcasecompare(cipher, cipherlist[i].name)) {
cipher_state[i] = PR_TRUE;
found = PR_TRUE;
break;
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index b93b53fa2..c040928a1 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -48,7 +48,7 @@
#include "slist.h"
#include "select.h"
#include "vtls.h"
-#include "rawstr.h"
+#include "strcase.h"
#include "hostcheck.h"
#include "curl_printf.h"
@@ -289,13 +289,13 @@ static int do_file_type(const char *type)
{
if(!type || !type[0])
return SSL_FILETYPE_PEM;
- if(Curl_raw_equal(type, "PEM"))
+ if(strcasecompare(type, "PEM"))
return SSL_FILETYPE_PEM;
- if(Curl_raw_equal(type, "DER"))
+ if(strcasecompare(type, "DER"))
return SSL_FILETYPE_ASN1;
- if(Curl_raw_equal(type, "ENG"))
+ if(strcasecompare(type, "ENG"))
return SSL_FILETYPE_ENGINE;
- if(Curl_raw_equal(type, "P12"))
+ if(strcasecompare(type, "P12"))
return SSL_FILETYPE_PKCS12;
return -1;
}
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index 66b49540c..56a882341 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -61,7 +61,7 @@
#include "vtls.h" /* generic SSL protos etc */
#include "slist.h"
#include "sendf.h"
-#include "rawstr.h"
+#include "strcase.h"
#include "url.h"
#include "progress.h"
#include "share.h"
@@ -84,7 +84,7 @@ static bool safe_strequal(char* str1, char* str2)
{
if(str1 && str2)
/* both pointers point to something then compare them */
- return (0 != Curl_raw_equal(str1, str2)) ? TRUE : FALSE;
+ return (0 != strcasecompare(str1, str2)) ? TRUE : FALSE;
else
/* if both pointers are NULL then treat them as equal */
return (!str1 && !str2) ? TRUE : FALSE;
@@ -390,15 +390,15 @@ bool Curl_ssl_getsessionid(struct connectdata *conn,
if(!check->sessionid)
/* not session ID means blank entry */
continue;
- if(Curl_raw_equal(conn->host.name, check->name) &&
+ if(strcasecompare(conn->host.name, check->name) &&
((!conn->bits.conn_to_host && !check->conn_to_host) ||
- (conn->bits.conn_to_host && check->conn_to_host &&
- Curl_raw_equal(conn->conn_to_host.name, check->conn_to_host))) &&
+ (conn->bits.conn_to_host && check->conn_to_host &&
+ strcasecompare(conn->conn_to_host.name, check->conn_to_host))) &&
((!conn->bits.conn_to_port && check->conn_to_port == -1) ||
- (conn->bits.conn_to_port && check->conn_to_port != -1 &&
- conn->conn_to_port == check->conn_to_port)) &&
+ (conn->bits.conn_to_port && check->conn_to_port != -1 &&
+ conn->conn_to_port == check->conn_to_port)) &&
(conn->remote_port == check->remote_port) &&
- Curl_raw_equal(conn->handler->scheme, check->scheme) &&
+ strcasecompare(conn->handler->scheme, check->scheme) &&
Curl_ssl_config_matches(&conn->ssl_config, &check->ssl_config)) {
/* yes, we have a session ID! */
(*general_age)++; /* increase general age */