From 566e8ae67a18679e2c4c0c7d6affffd8a0faedd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 19 Dec 2006 15:34:32 +0000 Subject: [PATCH] Save session master key. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19444 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/ntlm/accept_sec_context.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/gssapi/ntlm/accept_sec_context.c b/lib/gssapi/ntlm/accept_sec_context.c index c62c6086b..10db28ad3 100644 --- a/lib/gssapi/ntlm/accept_sec_context.c +++ b/lib/gssapi/ntlm/accept_sec_context.c @@ -153,6 +153,12 @@ handle_type3(OM_uint32 *minor_status, if (ret) goto out; ret = krb5_ntlm_req_set_opaque(ctx->context, ctx->ntlm, &ctx->opaque); if (ret) goto out; + if (type3->sessionkey.length) { + ret = krb5_ntlm_req_set_session(ctx->context, ctx->ntlm, + type3->sessionkey.data, + type3->sessionkey.length); + if (ret) goto out; + } /* * Verify with the KDC the type3 packet is ok @@ -169,6 +175,16 @@ handle_type3(OM_uint32 *minor_status, goto out; } + ret = krb5_ntlm_rep_get_sessionkey(ctx->context, + ctx->ntlm, + &ctx->sessionkey); + if (ret == 0 && ctx->sessionkey.length == 16) { + ctx->status |= STATUS_SESSIONKEY; + RC4_set_key(&ctx->crypto.key, + ctx->sessionkey.length, + ctx->sessionkey.data); + } + return GSS_S_COMPLETE; out: *minor_status = ret;