summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-19 01:31:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:29 -0500
commit56cc32800036472ebc29362d65e422c0b410e3fc (patch)
treecc590e85fde04ffac6dc296cfdb4a9844126b6e8 /source4/lib/ldb/common
parent814d5a5011038164dd55dd9e593989f69cedef0d (diff)
downloadsamba-56cc32800036472ebc29362d65e422c0b410e3fc.tar.gz
samba-56cc32800036472ebc29362d65e422c0b410e3fc.tar.bz2
samba-56cc32800036472ebc29362d65e422c0b410e3fc.zip
r7740: get rid of our duplicate base64 routines
(This used to be commit cf17f90a83cf04815544c5408eb56d00546b3e88)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb_ldif.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index 225fa3f3c9..9492aa3634 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -46,7 +46,7 @@
this base64 decoder was taken from jitterbug (written by tridge).
we might need to replace it with a new version
*/
-static int base64_decode(char *s)
+int ldb_base64_decode(char *s)
{
const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int bit_offset, byte_offset, idx, i, n;
@@ -92,7 +92,7 @@ static int base64_decode(char *s)
encode as base64
caller frees
*/
-char *ldb_base64_encode(struct ldb_context *ldb, const char *buf, int len)
+char *ldb_base64_encode(void *mem_ctx, const char *buf, int len)
{
const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int bit_offset, byte_offset, idx, i;
@@ -100,7 +100,7 @@ char *ldb_base64_encode(struct ldb_context *ldb, const char *buf, int len)
int bytes = (len*8 + 5)/6;
char *out;
- out = talloc_array(ldb, char, bytes+2);
+ out = talloc_array(mem_ctx, char, bytes+2);
if (!out) return NULL;
for (i=0;i<bytes;i++) {
@@ -402,7 +402,7 @@ static int next_attr(char **s, const char **attr, struct ldb_val *value)
}
if (base64_encoded) {
- int len = base64_decode(value->data);
+ int len = ldb_base64_decode(value->data);
if (len == -1) {
/* it wasn't valid base64 data */
return -1;