summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-03-30 17:49:01 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-03-30 12:17:05 +0200
commita64958a8805b6ef1758293697e63309d3ddbe4ae (patch)
tree325ced3f0b6910c7761a2ddd9a6500493c2c0a87 /source4/utils
parent48d0abe0b50b4e0414f5dcb46aae2a4b5bfaac7e (diff)
downloadsamba-a64958a8805b6ef1758293697e63309d3ddbe4ae.tar.gz
samba-a64958a8805b6ef1758293697e63309d3ddbe4ae.tar.bz2
samba-a64958a8805b6ef1758293697e63309d3ddbe4ae.zip
lib/util Move base64 functions into lib/util/base64.c
Andrew Bartlett
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/ntlm_auth.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index 34f79715ff..a3701f8822 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);
}