r104: Fix ntlm_auth by adding the new strhex_to_data_blob() call.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 7 Apr 2004 09:27:50 +0000 (09:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:09 +0000 (10:51 -0500)
Andrew Bartlett

source/lib/util_str.c
source/utils/ntlm_auth.c

index 2be8b7eb64cce9f5889bd282fb6b45ffb9d0236c..e4b07a4b731d04a662d596f2af9cfd00fa45d2b2 100644 (file)
@@ -794,6 +794,17 @@ size_t strhex_to_str(char *p, size_t len, const char *strhex)
        return num_chars;
 }
 
+DATA_BLOB strhex_to_data_blob(const char *strhex) 
+{
+       DATA_BLOB ret_blob = data_blob(NULL, strlen(strhex)/2+1);
+
+       ret_blob.length = strhex_to_str(ret_blob.data,  
+                                       strlen(strhex), 
+                                       strhex);
+
+       return ret_blob;
+}
+
 /**
  * Routine to print a buffer as HEX digits, into an allocated string.
  */
index 09306adc78ea1dcbf9712328eed73ba335badd35..c926d07698021bc09ac89df9628eab94a0f33f68 100644 (file)
@@ -2166,18 +2166,14 @@ enum {
        while((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
                case OPT_CHALLENGE:
-#if 0 /* Mr Bartlett FIX THE  BUILD ! */
                        opt_challenge = strhex_to_data_blob(hex_challenge);
-#endif
                        if (opt_challenge.length != 8) {
                                x_fprintf(x_stderr, "hex decode of %s failed!\n", hex_challenge);
                                exit(1);
                        }
                        break;
                case OPT_LM: 
-#if 0 /* Mr Bartlett FIX THE  BUILD ! */
                        opt_lm_response = strhex_to_data_blob(hex_lm_response);
-#endif
                        if (opt_lm_response.length != 24) {
                                x_fprintf(x_stderr, "hex decode of %s failed!\n", hex_lm_response);
                                exit(1);
@@ -2185,9 +2181,7 @@ enum {
                        break;
 
                case OPT_NT: 
-#if 0 /* Mr Bartlett FIX THE  BUILD ! */
                        opt_nt_response = strhex_to_data_blob(hex_nt_response);
-#endif
                        if (opt_nt_response.length < 24) {
                                x_fprintf(x_stderr, "hex decode of %s failed!\n", hex_nt_response);
                                exit(1);