summaryrefslogtreecommitdiffstats
path: root/proxy/tests
diff options
context:
space:
mode:
authorGünther Deschner <gdeschner@redhat.com>2012-08-24 16:15:47 +0200
committerSimo Sorce <simo@redhat.com>2012-09-14 16:14:15 -0400
commitfa8533256fadbd8ad79a6e98b98a62c7a7ba73a4 (patch)
tree9485d7e59ba0f5aa80a10fce7e56fb440b6a8dc5 /proxy/tests
parent61f67f27fe6ebd3d820a464199215e899aac3019 (diff)
downloadgss-proxy-fa8533256fadbd8ad79a6e98b98a62c7a7ba73a4.tar.gz
gss-proxy-fa8533256fadbd8ad79a6e98b98a62c7a7ba73a4.tar.xz
gss-proxy-fa8533256fadbd8ad79a6e98b98a62c7a7ba73a4.zip
Add testcode for add gpm_wrap().
Diffstat (limited to 'proxy/tests')
-rw-r--r--proxy/tests/cli_srv_comm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/proxy/tests/cli_srv_comm.c b/proxy/tests/cli_srv_comm.c
index b30ba2f..eee8fc5 100644
--- a/proxy/tests/cli_srv_comm.c
+++ b/proxy/tests/cli_srv_comm.c
@@ -209,6 +209,7 @@ void *client_thread(void *pvt)
gss_cred_id_t cred_handle = GSS_C_NO_CREDENTIAL;
int ret = 0;
gss_buffer_desc msg_buf = GSS_C_EMPTY_BUFFER;
+ int conf_state;
data = (struct athread *)pvt;
@@ -296,6 +297,32 @@ void *client_thread(void *pvt)
goto done;
}
+ gss_release_buffer(&ret_min, &out_token);
+
+ in_token.value = CLI_MSG;
+ in_token.length = strlen(in_token.value) + 1;
+
+ ret_maj = gpm_wrap(&ret_min,
+ (gssx_ctx *)ctx,
+ 1, /* conf_req_flag */
+ GSS_C_QOP_DEFAULT, /* qop_req */
+ &in_token,
+ &conf_state,
+ &out_token);
+ if (ret_maj) {
+ fprintf(stderr, "gpm_wrap failed: %d\n", ret_maj);
+ gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min);
+ goto done;
+ }
+
+ /* send to server */
+ ret = gp_send_buffer(data->srv_pipe[1],
+ out_token.value,
+ out_token.length);
+ if (ret) {
+ goto done;
+ }
+
fprintf(stdout, "client: Success!\n");
done: