From bf598954f75bfd924b9aa22649975b372c74a49e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 19 Jun 2004 08:15:41 +0000 Subject: r1198: Merge the Samba 3.0 ntlm_auth, including the kerberos and SPENGO parts. I have moved the SPNEGO and Kerberos code into libcli/auth, and intend to refactor them into the same format as NTLMSSP. Andrew Bartlett (This used to be commit 58da78a7460d5d0a4abee7d7b84799c228e6bc0b) --- source4/lib/basic.mk | 3 ++- source4/lib/util_str.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk index 754458fec1..ccd0935407 100644 --- a/source4/lib/basic.mk +++ b/source4/lib/basic.mk @@ -50,7 +50,8 @@ ADD_OBJ_FILES = \ lib/crypto/md5.o \ lib/crypto/hmacmd5.o \ lib/crypto/md4.o \ - lib/tdb_helper.o + lib/tdb_helper.o \ + lib/server_mutex.o REQUIRED_SUBSYSTEMS = \ LIBTDB CHARSET # End SUBSYSTEM LIBBASIC diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index bb94d3fce6..70011cf80d 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -1252,6 +1252,22 @@ DATA_BLOB strhex_to_data_blob(const char *strhex) return ret_blob; } +/** + * Routine to print a buffer as HEX digits, into an allocated string. + */ + +void hex_encode(const unsigned char *buff_in, size_t len, char **out_hex_buffer) +{ + int i; + char *hex_buffer; + + *out_hex_buffer = smb_xmalloc((len*2)+1); + hex_buffer = *out_hex_buffer; + + for (i = 0; i < len; i++) + slprintf(&hex_buffer[i*2], 3, "%02X", buff_in[i]); +} + /** Unescape a URL encoded string, in place. -- cgit