diff options
author | Simo Sorce <simo@redhat.com> | 2014-08-14 17:48:02 -0400 |
---|---|---|
committer | Günther Deschner <gdeschner@redhat.com> | 2014-09-15 13:09:56 +0200 |
commit | 57a9447610eb29c72f606a59d10c211c8d7f41e6 (patch) | |
tree | faf961eb52b6a18dcfa9b5e94b64f81b6d415221 /proxy/tests/t_utils.h | |
parent | 38a158446d1f9ce495715aa83265fe35a29f8a2b (diff) | |
download | gss-proxy-57a9447610eb29c72f606a59d10c211c8d7f41e6.tar.gz gss-proxy-57a9447610eb29c72f606a59d10c211c8d7f41e6.tar.xz gss-proxy-57a9447610eb29c72f606a59d10c211c8d7f41e6.zip |
Add a test framework for gss-proxy
This sets up a kdc using socket_wrapper and nss_wrapper from the cwrap
project, and uses a dirty hack to force gssapi to load the current
proxymech interposer library.
It provisions a service and a user key then runs the interpostest binary
in this artifical environment.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Guenther Deschner <gdeschner@redhat.com>
Diffstat (limited to 'proxy/tests/t_utils.h')
-rw-r--r-- | proxy/tests/t_utils.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/proxy/tests/t_utils.h b/proxy/tests/t_utils.h new file mode 100644 index 0000000..74f8ad5 --- /dev/null +++ b/proxy/tests/t_utils.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2014 the GSS-PROXY contributors, see COPYING for license */ + +#include "config.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <gssapi/gssapi.h> + +#define STDIN_FD 0 +#define STDOUT_FD 1 +#define MAX_RPC_SIZE 1024*1024 + +#define DEBUG(name, ...) do { \ + char msg[4096]; \ + snprintf(msg, 4096, __VA_ARGS__); \ + fprintf(stderr, "%s[%s:%d]: %s", name, __FUNCTION__, __LINE__, msg); \ + fflush(stderr); \ +} while(0); + +int t_send_buffer(int fd, char *buf, uint32_t len); +int t_recv_buffer(int fd, char *buf, uint32_t *len); + +void t_log_failure(gss_OID mech, uint32_t maj, uint32_t min); + +int t_string_to_name(const char *string, gss_name_t *name); |