summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-06-20 17:43:47 +0200
committerKarolin Seeger <kseeger@samba.org>2015-07-05 21:30:16 +0200
commit50d702923ce24c94cb5afbca960d0610d9711bab (patch)
tree5965fbfdc44a0f6521440af551a3612acdf95881 /librpc
parent346735647b913449221cd1a4ebc84fadaf67b5d3 (diff)
downloadsamba-50d702923ce24c94cb5afbca960d0610d9711bab.tar.gz
librpc/rpc: add DCERPC_AUTH_PAD_LENGTH(stub_length) helper macro
This calculates the required padding DCERPC_AUTH_PAD_ALIGNMENT and the stub_length. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11061 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit f1e3ad269ca8f76876afd8e3837c9c9b48688941)
Diffstat (limited to 'librpc')
-rw-r--r--librpc/rpc/rpc_common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/librpc/rpc/rpc_common.h b/librpc/rpc/rpc_common.h
index ce7e6ea2722..45d36912030 100644
--- a/librpc/rpc/rpc_common.h
+++ b/librpc/rpc/rpc_common.h
@@ -370,4 +370,9 @@ bool dcerpc_sec_verification_trailer_check(
const struct dcerpc_sec_vt_pcontext *pcontext,
const struct dcerpc_sec_vt_header2 *header2);
+#define DCERPC_AUTH_PAD_LENGTH(stub_length) (\
+ (((stub_length) % DCERPC_AUTH_PAD_ALIGNMENT) > 0)?\
+ (DCERPC_AUTH_PAD_ALIGNMENT - (stub_length) % DCERPC_AUTH_PAD_ALIGNMENT):\
+ 0)
+
#endif /* __DEFAULT_LIBRPC_RPCCOMMON_H__ */