let client do unwrap, handle keytab for gss

This commit is contained in:
Love Hornquist Astrand
2011-09-22 16:10:06 +02:00
parent b6f4094cfe
commit aabe9f0f4a
4 changed files with 40 additions and 1 deletions

View File

@@ -128,6 +128,25 @@ process_it(int sock,
gss_release_buffer (&min_stat, input_token);
gss_release_buffer (&min_stat, output_token);
input_token->value = "hejhej";
input_token->length = 6;
maj_stat = gss_wrap (&min_stat,
context_hdl,
1,
GSS_C_QOP_DEFAULT,
input_token,
NULL,
output_token);
write_token (sock, output_token);
gss_release_buffer (&min_stat, output_token);
read_token (sock, input_token);
if (input_token->length != 6 && memcmp(input_token->value, "hejhej", 6) != 0)
errx(1, "invalid reply");
return 0;
}
@@ -302,6 +321,9 @@ doit (int port, const char *service)
int one = 1;
int ret;
if (keytab_str)
gsskrb5_register_acceptor_identity(keytab_str);
sock = socket (AF_INET, SOCK_STREAM, 0);
if (sock < 0)
err (1, "socket");