(krb5_mk_priv): figure out what etype to use from the keytype.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3571 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -57,6 +57,24 @@ krb5_mk_priv(krb5_context context,
|
|||||||
int32_t sec, usec;
|
int32_t sec, usec;
|
||||||
KerberosTime sec2;
|
KerberosTime sec2;
|
||||||
unsigned usec2;
|
unsigned usec2;
|
||||||
|
krb5_enctype enctype;
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
|
||||||
|
if (auth_context->enctype)
|
||||||
|
enctype = auth_context->enctype;
|
||||||
|
else {
|
||||||
|
r = krb5_keytype_to_etype (context, key->keytype, &enctype);
|
||||||
|
if (r)
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
krb5_us_timeofday (context, &sec, &usec);
|
krb5_us_timeofday (context, &sec, &usec);
|
||||||
|
|
||||||
@@ -81,20 +99,11 @@ krb5_mk_priv(krb5_context context,
|
|||||||
|
|
||||||
s.pvno = 5;
|
s.pvno = 5;
|
||||||
s.msg_type = krb_priv;
|
s.msg_type = krb_priv;
|
||||||
s.enc_part.etype = auth_context->enctype;
|
s.enc_part.etype = enctype;
|
||||||
s.enc_part.kvno = NULL;
|
s.enc_part.kvno = NULL;
|
||||||
|
|
||||||
/* 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_encrypt (context, buf + sizeof(buf) - len, len,
|
r = krb5_encrypt (context, buf + sizeof(buf) - len, len,
|
||||||
s.enc_part.etype, key, &s.enc_part.cipher);
|
enctype, key, &s.enc_part.cipher);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user