X-Git-Url: http://git.samba.org/samba.git/?p=bbaumbach%2Fsamba-autobuild%2F.git;a=blobdiff_plain;f=source4%2Futils%2Fntlm_auth.c;fp=source4%2Futils%2Fntlm_auth.c;h=a3701f88224e3394c934b4e52f46a32c1cb8af14;hp=34f79715ff225be10c30ba2469f4fcc3f57c92e6;hb=a64958a8805b6ef1758293697e63309d3ddbe4ae;hpb=48d0abe0b50b4e0414f5dcb46aae2a4b5bfaac7e diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index 34f79715ff2..a3701f88224 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -142,33 +142,6 @@ static bool parse_ntlm_auth_domain_user(const char *domuser, char **domain, 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 */ @@ -291,7 +264,7 @@ static void manage_gensec_get_pw_request(enum stdio_helper_mode stdio_helper_mod } if (strlen(buf) > 3) { - in = base64_decode_data_blob(NULL, buf + 3); + in = base64_decode_data_blob(buf + 3); } else { in = data_blob(NULL, 0); } @@ -433,7 +406,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, mux_printf(mux_id, "OK\n"); return; } - in = base64_decode_data_blob(NULL, buf + 3); + in = base64_decode_data_blob(buf + 3); } else { in = data_blob(NULL, 0); }