(krb5_get_forwarded_creds): honor
KRB5_AUTH_CONTEXT_CLEAR_FORWARDED_CRED and create unencrypted (ENCTYPE_NULL) credentials. for use with old mit server and java based ones as they can't handle encrypted KRB-CRED. Note that the option needs to turned on because if the consumer sends the KRB-CRED in clear bad things will happen. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15150 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -173,7 +173,6 @@ krb5_get_forwarded_creds (krb5_context context,
|
|||||||
krb5_crypto crypto;
|
krb5_crypto crypto;
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai;
|
||||||
int save_errno;
|
int save_errno;
|
||||||
krb5_keyblock *key;
|
|
||||||
krb5_creds *ticket;
|
krb5_creds *ticket;
|
||||||
char *realm;
|
char *realm;
|
||||||
|
|
||||||
@@ -216,7 +215,7 @@ krb5_get_forwarded_creds (krb5_context context,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
kdc_flags.i = flags;
|
kdc_flags.b = int2KDCOptions(flags);
|
||||||
|
|
||||||
ret = krb5_get_kdc_cred (context,
|
ret = krb5_get_kdc_cred (context,
|
||||||
ccache,
|
ccache,
|
||||||
@@ -373,6 +372,14 @@ krb5_get_forwarded_creds (krb5_context context,
|
|||||||
if(buf_size != len)
|
if(buf_size != len)
|
||||||
krb5_abortx(context, "internal error in ASN.1 encoder");
|
krb5_abortx(context, "internal error in ASN.1 encoder");
|
||||||
|
|
||||||
|
if (auth_context->flags & KRB5_AUTH_CONTEXT_CLEAR_FORWARDED_CRED) {
|
||||||
|
cred.enc_part.etype = ENCTYPE_NULL;
|
||||||
|
cred.enc_part.kvno = NULL;
|
||||||
|
cred.enc_part.cipher.data = buf;
|
||||||
|
cred.enc_part.cipher.length = buf_size;
|
||||||
|
} else {
|
||||||
|
krb5_keyblock *key;
|
||||||
|
|
||||||
if (auth_context->local_subkey)
|
if (auth_context->local_subkey)
|
||||||
key = auth_context->local_subkey;
|
key = auth_context->local_subkey;
|
||||||
else if (auth_context->remote_subkey)
|
else if (auth_context->remote_subkey)
|
||||||
@@ -399,6 +406,7 @@ krb5_get_forwarded_creds (krb5_context context,
|
|||||||
free_KRB_CRED(&cred);
|
free_KRB_CRED(&cred);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ASN1_MALLOC_ENCODE(KRB_CRED, buf, buf_size, &cred, &len, ret);
|
ASN1_MALLOC_ENCODE(KRB_CRED, buf, buf_size, &cred, &len, ret);
|
||||||
free_KRB_CRED (&cred);
|
free_KRB_CRED (&cred);
|
||||||
|
Reference in New Issue
Block a user