summaryrefslogtreecommitdiff
path: root/librpc/tools
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2014-01-06 11:19:04 +0100
committerStefan Metzmacher <metze@samba.org>2014-01-08 14:35:03 +0100
commit410c30f12374b13854378f1d0fecaed9b5112bbb (patch)
tree288949872b71501abe48397598337fa1b51f92a1 /librpc/tools
parent0f3848a8632d6f6c113d128e71171dc49f4f74b9 (diff)
downloadsamba-410c30f12374b13854378f1d0fecaed9b5112bbb.tar.gz
ndrdump: dump verification trailer
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'librpc/tools')
-rw-r--r--librpc/tools/ndrdump.c21
-rw-r--r--librpc/tools/wscript_build2
2 files changed, 22 insertions, 1 deletions
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index 02cc47aaf9a..f7aac4e1112 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -23,6 +23,7 @@
#include "system/locale.h"
#include "librpc/ndr/libndr.h"
#include "librpc/ndr/ndr_table.h"
+#include "librpc/gen_ndr/ndr_dcerpc.h"
#include "lib/cmdline/popt_common.h"
#include "param/param.h"
@@ -221,6 +222,7 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
const struct ndr_interface_call_pipes *in_pipes = NULL;
const struct ndr_interface_call_pipes *out_pipes = NULL;
uint32_t highest_ofs;
+ struct dcerpc_sec_verification_trailer *sec_vt = NULL;
ndr_table_init();
@@ -400,6 +402,25 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
ndr_print->print = ndr_print_printf_helper;
ndr_print->depth = 1;
+ ndr_err = ndr_pop_dcerpc_sec_verification_trailer(ndr_pull, mem_ctx, &sec_vt);
+ status = ndr_map_error2ntstatus(ndr_err);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("ndr_pop_dcerpc_sec_verification_trailer returned %s\n",
+ nt_errstr(status));
+ }
+
+ if (sec_vt != NULL && sec_vt->count.count > 0) {
+ printf("SEC_VT: consumed %d bytes\n",
+ (int)(blob.length - ndr_pull->data_size));
+ if (dumpdata) {
+ ndrdump_data(blob.data + ndr_pull->data_size,
+ blob.length - ndr_pull->data_size,
+ dumpdata);
+ }
+ ndr_print_dcerpc_sec_verification_trailer(ndr_print, "SEC_VT", sec_vt);
+ }
+ TALLOC_FREE(sec_vt);
+
if (out_pipes) {
status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, out_pipes);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/librpc/tools/wscript_build b/librpc/tools/wscript_build
index d1f0a269395..a7463a91493 100644
--- a/librpc/tools/wscript_build
+++ b/librpc/tools/wscript_build
@@ -3,5 +3,5 @@
bld.SAMBA_BINARY('ndrdump',
source='ndrdump.c',
manpages='ndrdump.1',
- deps='samba-hostconfig samba-util popt POPT_SAMBA ndr-table errors'
+ deps='samba-hostconfig samba-util popt POPT_SAMBA ndr-table errors NDR_DCERPC'
)