diff options
author | Günther Deschner <gdeschner@redhat.com> | 2012-08-24 16:15:47 +0200 |
---|---|---|
committer | Günther Deschner <gdeschner@redhat.com> | 2012-08-29 18:51:57 +0200 |
commit | 70351fa90ce4900391a1a811add4f1b09188e3e0 (patch) | |
tree | d7ea1734ec913eb2237c807afc83b43a78762968 /proxy/tests/cli_srv_comm.c | |
parent | 9b3f899d0818a9d4bdcdbf2e4937db9919d7ded8 (diff) | |
download | gss-proxy-70351fa90ce4900391a1a811add4f1b09188e3e0.tar.gz gss-proxy-70351fa90ce4900391a1a811add4f1b09188e3e0.tar.xz gss-proxy-70351fa90ce4900391a1a811add4f1b09188e3e0.zip |
Add testcode for add gpm_wrap().
Diffstat (limited to 'proxy/tests/cli_srv_comm.c')
-rw-r--r-- | proxy/tests/cli_srv_comm.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/proxy/tests/cli_srv_comm.c b/proxy/tests/cli_srv_comm.c index 6bf83b2..e62dad0 100644 --- a/proxy/tests/cli_srv_comm.c +++ b/proxy/tests/cli_srv_comm.c @@ -209,6 +209,7 @@ void *client_thread(void *pvt) struct gssx_cred *cred_handle = NULL; 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, + 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: |