diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/basic.mk | 3 | ||||
-rw-r--r-- | source4/lib/util_str.c | 16 |
2 files changed, 18 insertions, 1 deletions
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. |