svn commit: samba r15296 - in branches/SAMBA_4_0/source/utils: .

jelmer at samba.org jelmer at samba.org
Thu Apr 27 16:06:19 GMT 2006


Author: jelmer
Date: 2006-04-27 16:06:18 +0000 (Thu, 27 Apr 2006)
New Revision: 15296

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15296

Log:
Move ntlm_auth-specific functions from util to ntlm_auth so libutil doesn't need ldb

Modified:
   branches/SAMBA_4_0/source/utils/config.mk
   branches/SAMBA_4_0/source/utils/ntlm_auth.c


Changeset:
Modified: branches/SAMBA_4_0/source/utils/config.mk
===================================================================
--- branches/SAMBA_4_0/source/utils/config.mk	2006-04-27 16:05:05 UTC (rev 15295)
+++ branches/SAMBA_4_0/source/utils/config.mk	2006-04-27 16:06:18 UTC (rev 15296)
@@ -28,7 +28,8 @@
 		LIBSAMBA-UTIL \
 		LIBPOPT \
 		POPT_SAMBA \
-		POPT_CREDENTIALS
+		POPT_CREDENTIALS \
+		gensec
 MANPAGE = man/ntlm_auth.1
 # End BINARY ntlm_auth
 #################################

Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c
===================================================================
--- branches/SAMBA_4_0/source/utils/ntlm_auth.c	2006-04-27 16:05:05 UTC (rev 15295)
+++ branches/SAMBA_4_0/source/utils/ntlm_auth.c	2006-04-27 16:06:18 UTC (rev 15296)
@@ -29,6 +29,7 @@
 #include "pstring.h"
 #include "libcli/auth/libcli_auth.h"
 #include "librpc/gen_ndr/ndr_security.h"
+#include "lib/ldb/include/ldb.h"
 
 #define SQUID_BUFFER_SIZE 2010
 
@@ -127,6 +128,34 @@
 	return True;
 }
 
+/**
+ * Decode a base64 string into a DATA_BLOB - simple and slow algorithm
+ **/
+static DATA_BLOB base64_decode_data_blob(TALLOC_CTX *mem_ctx, const char *s)
+{
+	DATA_BLOB ret = data_blob_talloc(mem_ctx, s, strlen(s)+1);
+	ret.length = ldb_base64_decode((char *)ret.data);
+	return ret;
+}
+
+/**
+ * Encode a base64 string into a talloc()ed string caller to free.
+ **/
+static char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data)
+{
+	return ldb_base64_encode(mem_ctx, (const char *)data.data, data.length);
+}
+
+/**
+ * Decode a base64 string in-place - wrapper for the above
+ **/
+static void base64_decode_inplace(char *s)
+{
+	ldb_base64_decode(s);
+}
+
+
+
 /* Authenticate a user with a plaintext password */
 
 static BOOL check_plaintext_auth(const char *user, const char *pass, 



More information about the samba-cvs mailing list