diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-10-31 16:44:11 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-01-12 03:13:31 +0100 |
commit | 7817e42d94140af8151cafa608398e4974489730 (patch) | |
tree | 3ea7636355339384abd6b42f74110a9c9d33a351 /librpc/rpc | |
parent | a2f718fb753b7ee38e30acebb02ef931a89f279f (diff) | |
download | samba-7817e42d94140af8151cafa608398e4974489730.tar.gz |
librpc: add dcerpc_get_auth_length() helper function
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'librpc/rpc')
-rw-r--r-- | librpc/rpc/dcerpc_util.c | 9 | ||||
-rw-r--r-- | librpc/rpc/rpc_common.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/librpc/rpc/dcerpc_util.c b/librpc/rpc/dcerpc_util.c index 0808131dd14..6cd3e38a75a 100644 --- a/librpc/rpc/dcerpc_util.c +++ b/librpc/rpc/dcerpc_util.c @@ -59,6 +59,15 @@ void dcerpc_set_auth_length(DATA_BLOB *blob, uint16_t v) } } +uint16_t dcerpc_get_auth_length(const DATA_BLOB *blob) +{ + if (CVAL(blob->data,DCERPC_DREP_OFFSET) & DCERPC_DREP_LE) { + return SVAL(blob->data, DCERPC_AUTH_LEN_OFFSET); + } else { + return RSVAL(blob->data, DCERPC_AUTH_LEN_OFFSET); + } +} + uint8_t dcerpc_get_endian_flag(DATA_BLOB *blob) { return blob->data[DCERPC_DREP_OFFSET]; diff --git a/librpc/rpc/rpc_common.h b/librpc/rpc/rpc_common.h index cdc9fe8ac88..d5b5d590bff 100644 --- a/librpc/rpc/rpc_common.h +++ b/librpc/rpc/rpc_common.h @@ -168,6 +168,7 @@ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower) void dcerpc_set_frag_length(DATA_BLOB *blob, uint16_t v); uint16_t dcerpc_get_frag_length(const DATA_BLOB *blob); void dcerpc_set_auth_length(DATA_BLOB *blob, uint16_t v); +uint16_t dcerpc_get_auth_length(const DATA_BLOB *blob); uint8_t dcerpc_get_endian_flag(DATA_BLOB *blob); const char *dcerpc_default_transport_endpoint(TALLOC_CTX *mem_ctx, enum dcerpc_transport_t transport, |