(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
This commit is contained in:
Assar Westerlund
1997-07-24 07:22:24 +00:00
parent 40ebd0d909
commit 8bebd1039d

View File

@@ -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;