(krb5_get_forwarded_creds): don't blindly use the local subkey

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11348 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-09-03 19:59:48 +00:00
parent ae784bda45
commit d9a1ec3c10

View File

@@ -168,6 +168,7 @@ krb5_get_forwarded_creds (krb5_context context,
krb5_crypto crypto;
struct addrinfo *ai;
int save_errno;
krb5_keyblock *key;
addrs.len = 0;
addrs.val = NULL;
@@ -328,7 +329,14 @@ krb5_get_forwarded_creds (krb5_context context,
return ret;
}
ret = krb5_crypto_init(context, auth_context->local_subkey, 0, &crypto);
if (auth_context->local_subkey)
key = auth_context->local_subkey;
else if (auth_context->remote_subkey)
key = auth_context->remote_subkey;
else
key = auth_context->keyblock;
ret = krb5_crypto_init(context, key, 0, &crypto);
if (ret) {
free_KRB_CRED(&cred);
return ret;