diff options
| author | Doug Rabson <dfr@FreeBSD.org> | 2008-05-07 13:39:42 +0000 |
|---|---|---|
| committer | Doug Rabson <dfr@FreeBSD.org> | 2008-05-07 13:39:42 +0000 |
| commit | 4fe54d7c6acb302aacc6ac18798804b26c882c13 (patch) | |
| tree | 07a0d6761d1b42410a27e4c7d583b766d6671f80 /crypto/heimdal/appl/test/gssapi_client.c | |
| parent | 86067c77149c346cf467f1db4307a68c3632aa23 (diff) | |
| parent | c19800e8cd5640693f36f2040db4ab5e8d738146 (diff) | |
Notes
Diffstat (limited to 'crypto/heimdal/appl/test/gssapi_client.c')
| -rw-r--r-- | crypto/heimdal/appl/test/gssapi_client.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/crypto/heimdal/appl/test/gssapi_client.c b/crypto/heimdal/appl/test/gssapi_client.c index 126ce910b057..d10fc5701fa8 100644 --- a/crypto/heimdal/appl/test/gssapi_client.c +++ b/crypto/heimdal/appl/test/gssapi_client.c @@ -34,7 +34,7 @@ #include "test_locl.h" #include <gssapi.h> #include "gss_common.h" -RCSID("$Id: gssapi_client.c,v 1.16 2000/08/09 20:53:06 assar Exp $"); +RCSID("$Id: gssapi_client.c 21521 2007-07-12 13:13:40Z lha $"); static int do_trans (int sock, gss_ctx_id_t context_hdl) @@ -65,6 +65,17 @@ do_trans (int sock, gss_ctx_id_t context_hdl) input_token->length = 7; input_token->value = "hemligt"; + maj_stat = gss_wrap (&min_stat, + context_hdl, + 0, + GSS_C_QOP_DEFAULT, + input_token, + NULL, + output_token); + if (GSS_ERROR(maj_stat)) + gss_err (1, min_stat, "gss_wrap"); + + write_token (sock, output_token); maj_stat = gss_wrap (&min_stat, context_hdl, @@ -98,10 +109,17 @@ proto (int sock, const char *hostname, const char *service) struct gss_channel_bindings_struct input_chan_bindings; u_char init_buf[4]; u_char acct_buf[4]; + gss_OID mech_oid; + char *str; - name_token.length = asprintf ((char **)&name_token.value, - "%s@%s", service, hostname); + mech_oid = select_mech(mech); + name_token.length = asprintf (&str, + "%s@%s", service, hostname); + if (str == NULL) + errx(1, "malloc - out of memory"); + name_token.value = str; + maj_stat = gss_import_name (&min_stat, &name_token, GSS_C_NT_HOSTBASED_SERVICE, @@ -155,7 +173,7 @@ proto (int sock, const char *hostname, const char *service) GSS_C_NO_CREDENTIAL, &context_hdl, server, - GSS_C_NO_OID, + mech_oid, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG | GSS_C_DELEG_FLAG, 0, |
