new files

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2292 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-07-14 12:22:07 +00:00
parent 77833b4151
commit 2e3f7f8c4e
2 changed files with 44 additions and 0 deletions

36
appl/test/gss_common.c Normal file
View File

@@ -0,0 +1,36 @@
#include "test_locl.h"
#include <gssapi.h>
RCSID("$Id$");
void
write_token (int sock, gss_buffer_t buf)
{
u_int32_t len, net_len;
OM_uint32 min_stat;
len = buf->length;
net_len = htonl(len);
if (write (sock, &net_len, 4) != 4)
err (1, "write");
if (write (sock, buf->value, len) != len)
err (1, "write");
gss_release_buffer (&min_stat, buf);
}
void
read_token (int sock, gss_buffer_t buf)
{
u_int32_t len, net_len;
if (read(sock, &net_len, 4) != 4)
err (1, "read");
len = ntohl(net_len);
buf->length = len;
buf->value = malloc(len);
if (read (sock, buf->value, len) != len)
err (1, "read");
}

8
appl/test/gss_common.h Normal file
View File

@@ -0,0 +1,8 @@
/* $Id$ */
#include "test_locl.h"
#include <gssapi.h>
RCSID("$Id$");
void write_token (int sock, gss_buffer_t buf);
void read_token (int sock, gss_buffer_t buf);