From 8bebd1039dff56b128cb5ef56c6ec1aa1202a130 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 24 Jul 1997 07:22:24 +0000 Subject: [PATCH] (krb5_rd_priv): Fetch the correct session key from auth_context git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2593 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/rd_priv.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/krb5/rd_priv.c b/lib/krb5/rd_priv.c index ca5d22739..673bd03ba 100644 --- a/lib/krb5/rd_priv.c +++ b/lib/krb5/rd_priv.c @@ -52,6 +52,7 @@ krb5_rd_priv(krb5_context context, EncKrbPrivPart part; size_t len; krb5_data plain; + krb5_keyblock *key; r = decode_KRB_PRIV (inbuf->data, inbuf->length, &priv, &len); if (r) @@ -65,11 +66,20 @@ krb5_rd_priv(krb5_context context, goto failure; } + /* XXX - Is this right? */ + + if (auth_context->local_subkey.keytype) + key = &auth_context->local_subkey; + else if (auth_context->remote_subkey.keytype) + key = &auth_context->remote_subkey; + else + key = &auth_context->key; + r = krb5_decrypt (context, priv.enc_part.cipher.data, priv.enc_part.cipher.length, priv.enc_part.etype, - &auth_context->key, + key, &plain); if (r) goto failure;