From 58d3bedb1ba0b9f19045d13534de9a8df9d92df6 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 4 Apr 2015 17:10:15 -0400 Subject: Add test to check actual_mech is actually returned --- tests/ntlmssptest.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/ntlmssptest.c b/tests/ntlmssptest.c index ad90c12..82e8628 100644 --- a/tests/ntlmssptest.c +++ b/tests/ntlmssptest.c @@ -1467,6 +1467,7 @@ int test_gssapi_1(bool user_env_file, bool use_cb, bool no_seal) const char *msg = "Sample, signature checking, message."; gss_buffer_desc message = { strlen(msg), discard_const(msg) }; gss_buffer_desc ctx_token; + gss_OID actual_mech; uint8_t rand_cb[128]; struct gss_channel_bindings_struct cbts = { 0 }; gss_channel_bindings_t cbt = GSS_C_NO_CHANNEL_BINDINGS; @@ -1607,7 +1608,7 @@ int test_gssapi_1(bool user_env_file, bool use_cb, bool no_seal) retmaj = gssntlm_init_sec_context(&retmin, cli_cred, &cli_ctx, gss_srvname, GSS_C_NO_OID, req_flags, 0, cbt, - &srv_token, NULL, &cli_token, + &srv_token, &actual_mech, &cli_token, NULL, NULL); if (retmaj != GSS_S_COMPLETE) { print_gss_error("gssntlm_init_sec_context 2 failed!", @@ -1616,6 +1617,12 @@ int test_gssapi_1(bool user_env_file, bool use_cb, bool no_seal) goto done; } + if (!actual_mech) { + fprintf(stderr, "Expected actual mech to be returned!\n"); + ret = EINVAL; + goto done; + } + gss_release_buffer(&retmin, &srv_token); retmaj = gssntlm_accept_sec_context(&retmin, &srv_ctx, srv_cred, -- cgit