From 06cf56bc1dd75bc3fd47ec7c100c42a8aa4b23ba Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 10 Aug 2004 04:28:00 +0000 Subject: r1685: Add the ability to lookup RPC auth types for the RPC-MGMT torture test. Andrew Bartlett (This used to be commit 0e4e3647e848605416fe79c742ac84d84dc4357c) --- source4/libcli/auth/gensec.c | 11 +++++++++++ source4/torture/rpc/mgmt.c | 10 ++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/libcli/auth/gensec.c b/source4/libcli/auth/gensec.c index e91497bee4..d635378117 100644 --- a/source4/libcli/auth/gensec.c +++ b/source4/libcli/auth/gensec.c @@ -212,6 +212,17 @@ NTSTATUS gensec_start_mech_by_authtype(struct gensec_security *gensec_security, return gensec_start_mech(gensec_security); } +const char *gensec_get_name_by_authtype(uint8_t authtype) +{ + const struct gensec_security_ops *ops; + ops = gensec_security_by_authtype(authtype); + if (ops) { + return ops->name; + } + return NULL; +} + + /** * Start a GENSEC sub-mechanism by OID, used in SPNEGO * diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c index a95fe43fb8..91d5ceb540 100644 --- a/source4/torture/rpc/mgmt.c +++ b/source4/torture/rpc/mgmt.c @@ -109,9 +109,15 @@ static BOOL test_inq_princ_name(struct dcerpc_pipe *p, continue; } if (W_ERROR_IS_OK(r.out.result)) { + const char *name = gensec_get_name_by_authtype(i); ret = True; - printf("\tprinciple name for proto %u is '%s'\n", - i, r.out.princ_name); + if (name) { + printf("\tprinciple name for proto %u (%s) is '%s'\n", + i, name, r.out.princ_name); + } else { + printf("\tprinciple name for proto %u is '%s'\n", + i, r.out.princ_name); + } } } -- cgit