summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-16 07:53:26 +0200
committerGünther Deschner <gd@samba.org>2009-09-16 07:54:02 +0200
commitc5c04fcf90849d31ff4d0343dedec2c097823a7e (patch)
tree0ab50f233c89b28cda535c5761a5aded74e98973 /librpc
parent30d13288e5bb506584a0bf012d7b2e579a6a2074 (diff)
downloadsamba-c5c04fcf90849d31ff4d0343dedec2c097823a7e.tar.gz
samba-c5c04fcf90849d31ff4d0343dedec2c097823a7e.tar.bz2
samba-c5c04fcf90849d31ff4d0343dedec2c097823a7e.zip
s3-schannel: add dump_NL_AUTH_SIGNATURE.
Guenther
Diffstat (limited to 'librpc')
-rw-r--r--librpc/ndr/ndr_schannel.c36
-rw-r--r--librpc/ndr/ndr_schannel.h3
2 files changed, 38 insertions, 1 deletions
diff --git a/librpc/ndr/ndr_schannel.c b/librpc/ndr/ndr_schannel.c
index 02796f7d9f..b610429211 100644
--- a/librpc/ndr/ndr_schannel.c
+++ b/librpc/ndr/ndr_schannel.c
@@ -69,3 +69,39 @@ _PUBLIC_ void ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_print *ndr, cons
}
}
+
+void dump_NL_AUTH_SIGNATURE(TALLOC_CTX *mem_ctx,
+ const DATA_BLOB *blob)
+{
+ enum ndr_err_code ndr_err;
+ uint16_t signature_algorithm;
+
+ if (blob->length < 2) {
+ return;
+ }
+
+ signature_algorithm = SVAL(blob->data, 0);
+
+ switch (signature_algorithm) {
+ case NL_SIGN_HMAC_MD5: {
+ struct NL_AUTH_SIGNATURE r;
+ ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, &r,
+ (ndr_pull_flags_fn_t)ndr_pull_NL_AUTH_SIGNATURE);
+ if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ NDR_PRINT_DEBUG(NL_AUTH_SIGNATURE, &r);
+ }
+ break;
+ }
+ case NL_SIGN_HMAC_SHA256: {
+ struct NL_AUTH_SHA2_SIGNATURE r;
+ ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, &r,
+ (ndr_pull_flags_fn_t)ndr_pull_NL_AUTH_SHA2_SIGNATURE);
+ if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ NDR_PRINT_DEBUG(NL_AUTH_SHA2_SIGNATURE, &r);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
diff --git a/librpc/ndr/ndr_schannel.h b/librpc/ndr/ndr_schannel.h
index d2dce7911a..d57278cfb2 100644
--- a/librpc/ndr/ndr_schannel.h
+++ b/librpc/ndr/ndr_schannel.h
@@ -21,4 +21,5 @@
void ndr_print_NL_AUTH_MESSAGE_BUFFER(struct ndr_print *ndr, const char *name, const union NL_AUTH_MESSAGE_BUFFER *r);
void ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_print *ndr, const char *name, const union NL_AUTH_MESSAGE_BUFFER_REPLY *r);
-
+void dump_NL_AUTH_SIGNATURE(TALLOC_CTX *mem_ctx,
+ const DATA_BLOB *blob);