diff options
| author | Simo Sorce <simo@redhat.com> | 2015-11-13 09:49:50 -0500 |
|---|---|---|
| committer | Robbie Harwood <rharwood@redhat.com> | 2015-12-01 17:54:05 -0500 |
| commit | e674f691ae0a9b2e7d2b2d2c3a745691efd469a1 (patch) | |
| tree | 50c13a4d731199d65b259c839867b71ec1c1ad03 | |
| parent | e5d0a2d58044042bd18103c934b98954d66653f9 (diff) | |
| download | gss-proxy-e674f691ae0a9b2e7d2b2d2c3a745691efd469a1.tar.gz gss-proxy-e674f691ae0a9b2e7d2b2d2c3a745691efd469a1.tar.xz gss-proxy-e674f691ae0a9b2e7d2b2d2c3a745691efd469a1.zip | |
Appropriately resolve const warnings in tests.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Robbie Harwoood <rharwood@redhat.com>
| -rw-r--r-- | proxy/tests/cli_srv_comm.c | 5 | ||||
| -rw-r--r-- | proxy/tests/interposetest.c | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/proxy/tests/cli_srv_comm.c b/proxy/tests/cli_srv_comm.c index 45f77e5..ae0851c 100644 --- a/proxy/tests/cli_srv_comm.c +++ b/proxy/tests/cli_srv_comm.c @@ -217,7 +217,7 @@ void *client_thread(void *pvt) gss_release_buffer(&ret_min, &out_token); - in_token.value = CLI_MSG; + in_token.value = discard_const(CLI_MSG); in_token.length = strlen(in_token.value) + 1; ret_maj = gpm_wrap(&ret_min, @@ -316,7 +316,8 @@ void *server_thread(void *pvt) goto done; } ret_maj = gpm_canonicalize_name(&ret_min, target_name, - gss_mech_krb5, &canon_name); + discard_const(gss_mech_krb5), + &canon_name); if (ret_maj) { DEBUG("gssproxy returned an error: %d\n", ret_maj); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); diff --git a/proxy/tests/interposetest.c b/proxy/tests/interposetest.c index d904002..a00904f 100644 --- a/proxy/tests/interposetest.c +++ b/proxy/tests/interposetest.c @@ -138,7 +138,7 @@ void run_client(struct aproc *data) gss_ctx_id_t ctx = GSS_C_NO_CONTEXT; gss_cred_id_t cred_handle = GSS_C_NO_CREDENTIAL; gss_buffer_desc msg_buf = GSS_C_EMPTY_BUFFER; - char *message = "SECRET"; + const char *message = "SECRET"; int ret = -1; gss_iov_buffer_desc iov[2] = { { 0, { 0, NULL } }, { 0, { 0, NULL } } }; int sealed; @@ -235,7 +235,7 @@ void run_client(struct aproc *data) /* test encryption */ msg_buf.length = strlen(message) + 1; - msg_buf.value = (void *)message; + msg_buf.value = discard_const(message); ret_maj = gss_wrap(&ret_min, ctx, 1, 0, &msg_buf, NULL, &out_token); if (ret_maj != GSS_S_COMPLETE) { DEBUG("Failed to wrap message.\n"); @@ -420,7 +420,8 @@ void run_server(struct aproc *data) goto done; } ret_maj = gss_canonicalize_name(&ret_min, target_name, - gss_mech_krb5, &canon_name); + discard_const(gss_mech_krb5), + &canon_name); if (ret_maj) { DEBUG("gssproxy returned an error: %d\n", ret_maj); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); @@ -592,7 +593,7 @@ void run_server(struct aproc *data) gss_release_buffer(&ret_min, &out_token); - in_token.value = message; + in_token.value = discard_const(message); in_token.length = strlen(message); ret_maj = gss_get_mic(&ret_min, context_handle, 0, &in_token, &out_token); |
