lib: Give base64.c its own .h
authorVolker Lendecke <vl@samba.org>
Tue, 3 May 2016 14:12:10 +0000 (16:12 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 3 May 2016 23:28:23 +0000 (01:28 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
21 files changed:
auth/gensec/gensec_start.c
auth/gensec/spnego.c
lib/util/base64.c
lib/util/base64.h [new file with mode: 0644]
lib/util/charset/tests/convert_string.c
lib/util/samba_util.h
source3/lib/tldap_util.c
source3/libnet/libnet_dssync_passdb.c
source3/libnet/libnet_samsync_ldif.c
source3/libnet/libnet_samsync_passdb.c
source3/passdb/pdb_ipa.c
source3/passdb/pdb_samba_dsdb.c
source3/rpc_server/samr/srv_samr_nt.c
source3/rpc_server/samr/srv_samr_util.c
source3/torture/torture.c
source3/utils/ntlm_auth.c
source4/lib/http/gensec/basic.c
source4/lib/http/gensec/ntlm.c
source4/ntvfs/posix/python/pyxattr_native.c
source4/torture/ndr/drsblobs.c
source4/utils/ntlm_auth.c

index 4c43519f26d415e2dfd0f895eb62ea89e3ac0cd0..1e616277dad41c9d1c9f28af1974a05061b779b1 100644 (file)
@@ -31,6 +31,7 @@
 #include "lib/param/param.h"
 #include "lib/util/tsort.h"
 #include "lib/util/samba_modules.h"
+#include "lib/util/base64.h"
 
 /* the list of currently registered GENSEC backends */
 static const struct gensec_security_ops **generic_security_ops;
index 3962d7268b25aeabb05acbd49f7f4c40bcbebbae..ef30ab72ad991135210b8faff6e2c4aff5ba9d93 100644 (file)
@@ -30,6 +30,7 @@
 #include "auth/gensec/gensec_internal.h"
 #include "param/param.h"
 #include "lib/util/asn1.h"
+#include "lib/util/base64.h"
 
 #undef strcasecmp
 
index e01fb6d35e293059af28ad8e3c3ced542948c8b4..157cb347705658e0be9f08ab2b36a35aee2290aa 100644 (file)
@@ -23,6 +23,7 @@
 */
 
 #include "includes.h"
+#include "lib/util/base64.h"
 
 static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
diff --git a/lib/util/base64.h b/lib/util/base64.h
new file mode 100644 (file)
index 0000000..4763804
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * Samba utility functions
+ *
+ * Copyright (C) Andrew Tridgell 1992-2001
+ * Copyright (C) Simo Sorce      2001-2002
+ * Copyright (C) Martin Pool     2003
+ * Copyright (C) James Peach    2006
+ * Copyright (C) Jeremy Allison  1992-2007
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __LIB_UTIL_BASE64_H__
+#define __LIB_UTIL_BASE64_H__
+
+#include "replace.h"
+#include "lib/util/data_blob.h"
+
+/**
+ Base64 decode a string, place into a data blob.  Caller to
+ data_blob_free() the result.
+**/
+DATA_BLOB base64_decode_data_blob_talloc(TALLOC_CTX *mem_ctx, const char *s);
+
+/**
+ Base64 decode a string, place into a data blob on NULL context.
+ Caller to data_blob_free() the result.
+**/
+DATA_BLOB base64_decode_data_blob(const char *s);
+
+/**
+ Base64 decode a string, inplace
+**/
+void base64_decode_inplace(char *s);
+/**
+ Base64 encode a binary data blob into a string
+**/
+char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data);
+
+#endif
index 92de70295f800da35d694782c8792c88606afe38..e63fca650b0e8df0bd562aedf23b34bf81459387 100644 (file)
@@ -22,6 +22,7 @@
 #include "torture/torture.h"
 #include "lib/util/charset/charset.h"
 #include "param/param.h"
+#include "lib/util/base64.h"
 
 struct torture_suite *torture_local_convert_string_handle(TALLOC_CTX *mem_ctx);
 struct torture_suite *torture_local_string_case_handle(TALLOC_CTX *mem_ctx);
index 387e957ceca23c59735286b18482bf0412bfdd1f..c33916116271b7a803e79144ff8f7f710143a9cc 100644 (file)
@@ -302,27 +302,6 @@ _PUBLIC_ int strwicmp(const char *psz1, const char *psz2);
 **/
 _PUBLIC_ void string_replace(char *s, char oldc, char newc);
 
-/**
- Base64 decode a string, place into a data blob.  Caller to data_blob_free() the result.
-**/
-_PUBLIC_ DATA_BLOB base64_decode_data_blob_talloc(TALLOC_CTX *mem_ctx, const char *s);
-
-/**
- Base64 decode a string, place into a data blob on NULL context.
- Caller to data_blob_free() the result.
-**/
-_PUBLIC_ DATA_BLOB base64_decode_data_blob(const char *s);
-
-
-/**
- Base64 decode a string, inplace
-**/
-_PUBLIC_ void base64_decode_inplace(char *s);
-/**
- Base64 encode a binary data blob into a string
-**/
-_PUBLIC_ char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data);
-
 /**
  * Compare 2 strings.
  *
index b7233f68705fc7acb571878e9204903665d56997..89f812b97e07f04b62fd9416582bfde4b96b8746 100644 (file)
@@ -23,6 +23,7 @@
 #include "../libcli/security/security.h"
 #include "../lib/util/asn1.h"
 #include "../librpc/ndr/libndr.h"
+#include "lib/util/base64.h"
 
 bool tldap_entry_values(struct tldap_message *msg, const char *attribute,
                        DATA_BLOB **values, int *num_values)
index 62ce0745cb4e3d1385e3f892cc2e646834da77bf..b80bece691558146fa80c14b98c50959d665bb71 100644 (file)
@@ -28,6 +28,7 @@
 #include "dbwrap/dbwrap_rbt.h"
 #include "../libds/common/flag_mapping.h"
 #include "passdb.h"
+#include "lib/util/base64.h"
 
 /****************************************************************
 ****************************************************************/
index d9ae4140dbebde00dc434e730db25b92e59a5a34..198373e23d256ed7048945fe1214b5d3a78aefb4 100644 (file)
@@ -29,6 +29,7 @@
 #include "transfer_file.h"
 #include "passdb.h"
 #include "passdb/pdb_ldap_schema.h"
+#include "lib/util/base64.h"
 
 #ifdef HAVE_LDAP
 
index 51857226fc19b643d85da17099a77d8e1419d852..91482e69f2e627acf88db00697f37599ff66ef17 100644 (file)
@@ -28,6 +28,7 @@
 #include "libnet/libnet_samsync.h"
 #include "../libcli/security/security.h"
 #include "passdb.h"
+#include "lib/util/base64.h"
 
 /* Convert a struct samu_DELTA to a struct samu. */
 #define STRING_CHANGED (old_string && !new_string) ||\
index 4d9d09c84c282d0adc57ed27904a698ba0d665b1..ca305aaa960e3f296be142ca0a152ccbc3c1f6eb 100644 (file)
@@ -29,6 +29,7 @@
 #include "passdb/pdb_ldap.h"
 #include "passdb/pdb_ipa.h"
 #include "passdb/pdb_ldap_schema.h"
+#include "lib/util/base64.h"
 
 #define IPA_KEYTAB_SET_OID "2.16.840.1.113730.3.8.3.1"
 #define IPA_MAGIC_ID_STR "999"
index 54b9ef9ad083b2acc2b0f294eb04308bbbeb24d4..56f3f107cef6c86660aa0aab5ff1c03c8149da1f 100644 (file)
@@ -39,6 +39,7 @@
 #include "source3/include/secrets.h"
 #include "source4/auth/auth_sam.h"
 #include "auth/credentials/credentials.h"
+#include "lib/util/base64.h"
 
 struct pdb_samba_dsdb_state {
        struct tevent_context *ev;
index 2f6f02032486587acc2a94934b87a95ec81bf096..6354556d591e771ac21dc1b3d96cc1ce9467427b 100644 (file)
@@ -45,6 +45,7 @@
 #include "auth.h"
 #include "rpc_server/srv_access_check.h"
 #include "../lib/tsocket/tsocket.h"
+#include "lib/util/base64.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
index 4c2307d4ffcf6dfa3a7939abcd63e25dddb8ba63..e48c020e85404380636b65f18a92806942208ab7 100644 (file)
@@ -26,6 +26,7 @@
 #include "../librpc/gen_ndr/samr.h"
 #include "rpc_server/samr/srv_samr_util.h"
 #include "passdb.h"
+#include "lib/util/base64.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
index 8b8dbe9debb94127f610314ac10183b0a22f35e3..d6489c82fbb03303ad2a2e4916f193bd055ffd5e 100644 (file)
@@ -42,6 +42,7 @@
 #include "../libcli/smb/read_smb.h"
 #include "../libcli/smb/smbXcli_base.h"
 #include "lib/util/sys_rw_data.h"
+#include "lib/util/base64.h"
 
 extern char *optarg;
 extern int optind;
index 7bce5caa67b08b7bd0476493858a8536a9cf3ef5..e19bc7e75e17f46585b0b5c35448cdde27f06d81 100644 (file)
@@ -45,6 +45,7 @@
 #include "source3/auth/proto.h"
 #include "nsswitch/libwbclient/wbclient.h"
 #include "lib/param/loadparm.h"
+#include "lib/util/base64.h"
 
 #if HAVE_KRB5
 #include "auth/kerberos/pac_utils.h"
index 86a2d51d67a95545f62d9647d3a99946f09a30ce..4a488a34bfa4aeac79fe1338a3b66e226bf3dc63 100644 (file)
@@ -24,6 +24,7 @@
 #include "auth/gensec/gensec.h"
 #include "auth/gensec/gensec_internal.h"
 #include "auth/credentials/credentials.h"
+#include "lib/util/base64.h"
 
 _PUBLIC_ NTSTATUS gensec_http_basic_init(void);
 
index 07470fa71c2e0a9943ee5b7bfc1f262b4459f1ff..8afb275dafe4c10f7b68f107b6396420040fa2f6 100644 (file)
@@ -23,6 +23,7 @@
 #include "auth/auth.h"
 #include "auth/gensec/gensec.h"
 #include "auth/gensec/gensec_internal.h"
+#include "lib/util/base64.h"
 
 _PUBLIC_ NTSTATUS gensec_http_ntlm_init(void);
 
index 8dd98d26e805e8d0d0c75ff76aaafc9786825c90..6758996da6d2f474d610400ad36f7142041950f0 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "librpc/ndr/libndr.h"
 #include "system/filesys.h"
+#include "lib/util/base64.h"
 
 void initxattr_native(void);
 
index 938b6fe1186cacc0c4f7a587a66942546fe0285c..ecdc01449cc2320089b035501bad6dd07d59aaf0 100644 (file)
@@ -22,6 +22,7 @@
 #include "torture/ndr/ndr.h"
 #include "librpc/gen_ndr/ndr_drsblobs.h"
 #include "torture/ndr/proto.h"
+#include "lib/util/base64.h"
 
 static const uint8_t forest_trust_info_data_out[] = {
        0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
index 6d0e259259dfbc921b28acecb49cbf580ced7e69..75dcebf05714bfaea50096f428a089ead5ee8164 100644 (file)
@@ -38,6 +38,7 @@
 #include "lib/messaging/irpc.h"
 #include "auth/ntlmssp/ntlmssp.h"
 #include "param/param.h"
+#include "lib/util/base64.h"
 
 #define INITIAL_BUFFER_SIZE 300
 #define MAX_BUFFER_SIZE 63000