lib/util Move base64 functions into lib/util/base64.c
[bbaumbach/samba-autobuild/.git] / source4 / utils / ntlm_auth.c
index 34f79715ff225be10c30ba2469f4fcc3f57c92e6..a3701f88224e3394c934b4e52f46a32c1cb8af14 100644 (file)
@@ -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);
        }