(krb5_build_authenticator): figure out what etype to use from the

keytype.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3565 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-09-29 20:42:30 +00:00
parent f0d8d33171
commit f2943ec899

View File

@@ -48,10 +48,25 @@ krb5_build_authenticator (krb5_context context,
Authenticator **auth_result,
krb5_data *result)
{
Authenticator *auth = malloc(sizeof(*auth));
Authenticator *auth;
char buf[1024];
size_t len;
krb5_error_code ret;
krb5_enctype enctype;
if (auth_context->enctype)
enctype = auth_context->enctype;
else {
ret = krb5_keytype_to_etype(context,
cred->session.keytype,
&enctype);
if (ret)
return ret;
}
auth = malloc(sizeof(*auth));
if (auth == NULL)
return ENOMEM;
auth->authenticator_vno = 5;
copy_Realm(&cred->client->realm, &auth->crealm);
@@ -94,7 +109,7 @@ krb5_build_authenticator (krb5_context context,
ret = encode_Authenticator (buf + sizeof(buf) - 1, sizeof(buf), auth, &len);
ret = krb5_encrypt (context, buf + sizeof(buf) - len, len,
auth_context->enctype,
enctype,
&cred->session,
result);