summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2010-05-11 19:47:03 +0000
committerJames Yonan <james@openvpn.net>2010-05-11 19:47:03 +0000
commit484e9d36d09e3494a6d964c588c353f650a61b5f (patch)
treecb8bdaf0a8f53e6810c8ac581f6d17db4e0ac4a5
parentb27dc04c366c031f4bb349e3235a2b0eb76c821a (diff)
downloadopenvpn-484e9d36d09e3494a6d964c588c353f650a61b5f.tar.gz
openvpn-484e9d36d09e3494a6d964c588c353f650a61b5f.tar.xz
openvpn-484e9d36d09e3494a6d964c588c353f650a61b5f.zip
Minor fixes to recent HTTP proxy changes:
* use strcasecmp instead of stricmp * define HASH and HASHHEX as unsigned char to avoid compiler warnings git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@5629 e7ae566f-a301-0410-adde-c780ea21d3b5
-rw-r--r--config-win32.h2
-rw-r--r--httpdigest.c4
-rw-r--r--httpdigest.h4
3 files changed, 5 insertions, 5 deletions
diff --git a/config-win32.h b/config-win32.h
index bed043c..be0b320 100644
--- a/config-win32.h
+++ b/config-win32.h
@@ -291,7 +291,7 @@ typedef unsigned long in_addr_t;
#define lseek _lseek
#define chdir _chdir
#define strdup _strdup
-#define stricmp _stricmp
+#define strcasecmp _stricmp
#define chsize _chsize
#define S_IRUSR 0
#define S_IWUSR 0
diff --git a/httpdigest.c b/httpdigest.c
index abe5bea..ef77e12 100644
--- a/httpdigest.c
+++ b/httpdigest.c
@@ -75,7 +75,7 @@ DigestCalcHA1(
MD5_Update(&Md5Ctx, ":", 1);
MD5_Update(&Md5Ctx, pszPassword, strlen(pszPassword));
MD5_Final(HA1, &Md5Ctx);
- if (pszAlg && stricmp(pszAlg, "md5-sess") == 0)
+ if (pszAlg && strcasecmp(pszAlg, "md5-sess") == 0)
{
MD5_Init(&Md5Ctx);
MD5_Update(&Md5Ctx, HA1, HASHLEN);
@@ -112,7 +112,7 @@ DigestCalcResponse(
MD5_Update(&Md5Ctx, pszMethod, strlen(pszMethod));
MD5_Update(&Md5Ctx, ":", 1);
MD5_Update(&Md5Ctx, pszDigestUri, strlen(pszDigestUri));
- if (stricmp(pszQop, "auth-int") == 0)
+ if (strcasecmp(pszQop, "auth-int") == 0)
{
MD5_Update(&Md5Ctx, ":", 1);
MD5_Update(&Md5Ctx, HEntity, HASHHEXLEN);
diff --git a/httpdigest.h b/httpdigest.h
index d4764a1..fb6d114 100644
--- a/httpdigest.h
+++ b/httpdigest.h
@@ -25,9 +25,9 @@
#if PROXY_DIGEST_AUTH
#define HASHLEN 16
-typedef char HASH[HASHLEN];
+typedef unsigned char HASH[HASHLEN];
#define HASHHEXLEN 32
-typedef char HASHHEX[HASHHEXLEN+1];
+typedef unsigned char HASHHEX[HASHHEXLEN+1];
#undef IN
#undef OUT
#define IN const