summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-12-21 14:38:51 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-12-21 14:38:51 +0000
commitbe733f30414ceb85304396d30b9648b6afe283e5 (patch)
tree1c451580b0bea8d8c2d1350e4cad0e064f693dbb
parent576c7eae45be250478b5317bacfa19ad46f812de (diff)
downloadwireshark-be733f30414ceb85304396d30b9648b6afe283e5.tar.gz
Move epan/base64.[ch] to wsutil/ with function name change.
svn path=/trunk/; revision=54326
-rw-r--r--epan/CMakeLists.txt1
-rw-r--r--epan/Makefile.common2
-rw-r--r--epan/dissectors/packet-http.c4
-rw-r--r--epan/dissectors/packet-smtp.c18
-rw-r--r--epan/tvbuff_base64.c4
-rw-r--r--epan/wslua/wslua_tvb.c4
-rw-r--r--wsutil/CMakeLists.txt1
-rw-r--r--wsutil/Makefile.common4
-rw-r--r--wsutil/base64.c (renamed from epan/base64.c)2
-rw-r--r--wsutil/base64.h (renamed from epan/base64.h)2
10 files changed, 21 insertions, 21 deletions
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 9b20aa0e63..c7a7b98cf3 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -1471,7 +1471,6 @@ set(LIBWIRESHARK_FILES
app_mem_usage.c
asn1.c
atalk-utils.c
- base64.c
camel-persistentdata.c
charsets.c
circuit.c
diff --git a/epan/Makefile.common b/epan/Makefile.common
index 3e7f1b288d..69b7f6d811 100644
--- a/epan/Makefile.common
+++ b/epan/Makefile.common
@@ -32,7 +32,6 @@ LIBWIRESHARK_SRC = \
app_mem_usage.c \
asn1.c \
atalk-utils.c \
- base64.c \
camel-persistentdata.c \
charsets.c \
circuit.c \
@@ -158,7 +157,6 @@ LIBWIRESHARK_INCLUDES = \
asn1.h \
atalk-utils.h \
ax25_pids.h \
- base64.h \
bridged_pids.h \
camel-persistentdata.h \
charsets.h \
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index ce372e6823..1a9529e8ea 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -41,7 +41,7 @@
#include <epan/conversation.h>
#include <epan/packet.h>
#include <epan/strutil.h>
-#include <epan/base64.h>
+#include <wsutil/base64.h>
#include <epan/stats_tree.h>
#include <epan/req_resp_hdrs.h>
@@ -2655,7 +2655,7 @@ check_auth_basic(proto_item *hdr_item, tvbuff_t *tvb, gchar *value)
hdr_tree = NULL;
value += hdrlen;
- epan_base64_decode(value);
+ ws_base64_decode_inplace(value);
proto_tree_add_string(hdr_tree, hf_http_basic, tvb,
0, 0, value);
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c
index bdcb4b8070..6a1f8bdcf7 100644
--- a/epan/dissectors/packet-smtp.c
+++ b/epan/dissectors/packet-smtp.c
@@ -40,7 +40,7 @@
#include <epan/strutil.h>
#include <epan/wmem/wmem.h>
#include <epan/reassemble.h>
-#include <epan/base64.h>
+#include <wsutil/base64.h>
#include <epan/dissectors/packet-ssl.h>
/* RFC 2821 */
@@ -321,7 +321,7 @@ decode_plain_auth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
decrypt = tvb_get_string(wmem_packet_scope(), tvb, a_offset, a_linelen);
if (stmp_decryption_enabled) {
- returncode = (gint)epan_base64_decode(decrypt);
+ returncode = (gint)ws_base64_decode_inplace(decrypt);
if (returncode) {
length_user1 = (gint)strlen(decrypt);
if (returncode >= (length_user1 + 1)) {
@@ -579,7 +579,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(pinfo->fd->num >= session_state->first_auth_frame) &&
((session_state->last_auth_frame == 0) || (pinfo->fd->num <= session_state->last_auth_frame))) {
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
- if ((stmp_decryption_enabled) && (epan_base64_decode(decrypt) > 0)) {
+ if ((stmp_decryption_enabled) && (ws_base64_decode_inplace(decrypt) > 0)) {
line = decrypt;
} else {
line = tvb_get_ptr(tvb, loffset, linelen);
@@ -837,7 +837,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This line wasn't already decrypted through the state machine */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
if (stmp_decryption_enabled) {
- if (epan_base64_decode(decrypt) == 0) {
+ if (ws_base64_decode_inplace(decrypt) == 0) {
/* Go back to the original string */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
}
@@ -851,7 +851,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This line wasn't already decrypted through the state machine */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
if (stmp_decryption_enabled) {
- if (epan_base64_decode(decrypt) == 0) {
+ if (ws_base64_decode_inplace(decrypt) == 0) {
/* Go back to the original string */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
}
@@ -863,7 +863,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else if (session_state->ntlm_rsp_frame == pinfo->fd->num) {
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
if (stmp_decryption_enabled) {
- if (epan_base64_decode(decrypt) == 0) {
+ if (ws_base64_decode_inplace(decrypt) == 0) {
/* Go back to the original string */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
col_append_str(pinfo->cinfo, COL_INFO, decrypt);
@@ -907,7 +907,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This line wasn't already decrypted through the state machine */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 11, linelen - 11);
if (stmp_decryption_enabled) {
- if (epan_base64_decode(decrypt) == 0) {
+ if (ws_base64_decode_inplace(decrypt) == 0) {
/* Go back to the original string */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 11, linelen - 11);
}
@@ -922,7 +922,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
loffset + 5, linelen - 5, ENC_ASCII|ENC_NA);
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 10, linelen - 10);
if (stmp_decryption_enabled) {
- if (epan_base64_decode(decrypt) == 0) {
+ if (ws_base64_decode_inplace(decrypt) == 0) {
/* Go back to the original string */
decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 10, linelen - 10);
col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, loffset, 10));
@@ -1097,7 +1097,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (linelen >= 4) {
if ((stmp_decryption_enabled) && (code == 334)) {
decrypt = tvb_get_string(wmem_packet_scope(), tvb, offset + 4, linelen - 4);
- if (epan_base64_decode(decrypt) > 0) {
+ if (ws_base64_decode_inplace(decrypt) > 0) {
if (g_ascii_strncasecmp(decrypt, "NTLMSSP", 7) == 0) {
base64_string = tvb_get_string(wmem_packet_scope(), tvb, loffset + 4, linelen - 4);
col_append_fstr(pinfo->cinfo, COL_INFO, "%d ", code);
diff --git a/epan/tvbuff_base64.c b/epan/tvbuff_base64.c
index 425670a71b..5f4cb67f8b 100644
--- a/epan/tvbuff_base64.c
+++ b/epan/tvbuff_base64.c
@@ -27,7 +27,7 @@
#include <glib.h>
#include <epan/tvbuff.h>
-#include <epan/base64.h>
+#include <wsutil/base64.h>
tvbuff_t *
base64_to_tvb(tvbuff_t *parent, const char *base64)
@@ -36,7 +36,7 @@ base64_to_tvb(tvbuff_t *parent, const char *base64)
char *data = g_strdup(base64);
gint len;
- len = (gint) epan_base64_decode(data);
+ len = (gint) ws_base64_decode_inplace(data);
tvb = tvb_new_child_real_data(parent, (const guint8 *)data, len, len);
tvb_set_free_cb(tvb, g_free);
diff --git a/epan/wslua/wslua_tvb.c b/epan/wslua/wslua_tvb.c
index aa1d7b5bc1..2341abfc1f 100644
--- a/epan/wslua/wslua_tvb.c
+++ b/epan/wslua/wslua_tvb.c
@@ -35,7 +35,7 @@
/* WSLUA_MODULE Tvb Functions for handling packet data */
#include "wslua.h"
-#include "epan/base64.h"
+#include "wsutil/base64.h"
WSLUA_CLASS_DEFINE(ByteArray,FAIL_ON_NULL("null bytearray"),NOP);
@@ -269,7 +269,7 @@ static int ByteArray_base64_decode(lua_State* L) {
memcpy(data, ba->data, ba->len);
data[ba->len] = '\0';
- len = epan_base64_decode(data);
+ len = ws_base64_decode_inplace(data);
g_byte_array_append(ba2,data,(int)len);
g_free(data);
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index 9ad86e8247..b14c236238 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -39,6 +39,7 @@ set(WSUTIL_FILES
adler32.c
aes.c
airpdcap_wep.c
+ base64.c
bitswap.c
crash_info.c
crc10.c
diff --git a/wsutil/Makefile.common b/wsutil/Makefile.common
index 1ed4f22ed3..96b5a7cfa3 100644
--- a/wsutil/Makefile.common
+++ b/wsutil/Makefile.common
@@ -32,7 +32,8 @@ LIBWSUTIL_SRC = \
adler32.c \
aes.c \
airpdcap_wep.c \
- bitswap.c \
+ base64.c \
+ bitswap.c \
crash_info.c \
crc6.c \
crc7.c \
@@ -66,6 +67,7 @@ LIBWSUTIL_SRC = \
LIBWSUTIL_INCLUDES = \
adler32.h \
aes.h \
+ base64.h \
bits_ctz.h \
bits_count_ones.h \
bitswap.h \
diff --git a/epan/base64.c b/wsutil/base64.c
index bf507fca8a..2211cff522 100644
--- a/epan/base64.c
+++ b/wsutil/base64.c
@@ -31,7 +31,7 @@
Return length of result. Taken from rproxy/librsync/base64.c by
Andrew Tridgell. */
-size_t epan_base64_decode(char *s)
+size_t ws_base64_decode_inplace(char *s)
{
static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\r\n";
int bit_offset, byte_offset, idx, i;
diff --git a/epan/base64.h b/wsutil/base64.h
index 2888bbdac0..e9bc51758d 100644
--- a/epan/base64.h
+++ b/wsutil/base64.h
@@ -32,7 +32,7 @@ extern "C" {
/* In-place decoding of a base64 string. Resulting string is NULL terminated */
WS_DLL_PUBLIC
-size_t epan_base64_decode(char *s);
+size_t ws_base64_decode_inplace(char *s);
#ifdef __cplusplus
}