summaryrefslogtreecommitdiffstats
path: root/src/ntlm.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2013-07-08 23:27:39 -0400
committerSimo Sorce <simo@redhat.com>2013-07-18 22:37:25 -0400
commit5323847ff1f135a66ed00cfe983573c4c364f594 (patch)
tree0ff71589104086aba4027e34af974816a400d61e /src/ntlm.c
parentdc2cf8903ca08152464ef50ec989e97640cf1248 (diff)
downloadgss-ntlmssp-5323847ff1f135a66ed00cfe983573c4c364f594.tar.gz
gss-ntlmssp-5323847ff1f135a66ed00cfe983573c4c364f594.tar.xz
gss-ntlmssp-5323847ff1f135a66ed00cfe983573c4c364f594.zip
Implement credential handling
Diffstat (limited to 'src/ntlm.c')
-rw-r--r--src/ntlm.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ntlm.c b/src/ntlm.c
index 97771bc..9041a71 100644
--- a/src/ntlm.c
+++ b/src/ntlm.c
@@ -31,6 +31,8 @@
#include <string.h>
#include <sys/time.h>
+#include <unicase.h>
+
#include "ntlm.h"
#pragma pack(push, 1)
@@ -247,6 +249,24 @@ uint64_t ntlm_timestamp_now(void)
return filetime;
}
+bool ntlm_casecmp(const char *s1, const char *s2)
+{
+ size_t s1_len, s2_len;
+ int ret, res;
+
+ if (s1 == s2) return true;
+ if (!s1 || !s2) return false;
+
+ s1_len = strlen(s1);
+ s2_len = strlen(s2);
+
+ ret = ulc_casecmp(s1, s1_len, s2, s2_len,
+ uc_locale_language(), NULL, &res);
+ if (ret || res != 0) return false;
+ return true;
+}
+
+
/**
* @brief Converts a string using the provided iconv context.
* This function is ok only to convert utf8<->ucs2