move generation of session key to preauth hook.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24940 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1465,11 +1465,12 @@ _kdc_as_rep(krb5_context context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = krb5_generate_random_keyblock(context, sessionetype, &et.key);
|
ret = copy_PrincipalName(&rep.cname, &et.cname);
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
ret = copy_Realm(&rep.crealm, &et.crealm);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
copy_PrincipalName(&rep.cname, &et.cname);
|
|
||||||
copy_Realm(&rep.crealm, &et.crealm);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
time_t start;
|
time_t start;
|
||||||
@@ -1533,8 +1534,6 @@ _kdc_as_rep(krb5_context context,
|
|||||||
et.transited.tr_type = DOMAIN_X500_COMPRESS;
|
et.transited.tr_type = DOMAIN_X500_COMPRESS;
|
||||||
krb5_data_zero(&et.transited.contents);
|
krb5_data_zero(&et.transited.contents);
|
||||||
|
|
||||||
copy_EncryptionKey(&et.key, &ek.key);
|
|
||||||
|
|
||||||
/* The MIT ASN.1 library (obviously) doesn't tell lengths encoded
|
/* The MIT ASN.1 library (obviously) doesn't tell lengths encoded
|
||||||
* as 0 and as 0x80 (meaning indefinite length) apart, and is thus
|
* as 0 and as 0x80 (meaning indefinite length) apart, and is thus
|
||||||
* incapable of correctly decoding SEQUENCE OF's of zero length.
|
* incapable of correctly decoding SEQUENCE OF's of zero length.
|
||||||
@@ -1607,8 +1606,8 @@ _kdc_as_rep(krb5_context context,
|
|||||||
if (pkp) {
|
if (pkp) {
|
||||||
e_text = "Failed to build PK-INIT reply";
|
e_text = "Failed to build PK-INIT reply";
|
||||||
ret = _kdc_pk_mk_pa_reply(context, config, pkp, client,
|
ret = _kdc_pk_mk_pa_reply(context, config, pkp, client,
|
||||||
req, req_buffer,
|
sessionetype, req, req_buffer,
|
||||||
&reply_key, rep.padata);
|
&reply_key, &et.key, rep.padata);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
ret = _kdc_add_inital_verified_cas(context,
|
ret = _kdc_add_inital_verified_cas(context,
|
||||||
@@ -1617,8 +1616,17 @@ _kdc_as_rep(krb5_context context,
|
|||||||
&et);
|
&et);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
} else
|
||||||
|
ret = krb5_generate_random_keyblock(context, sessionetype, &et.key);
|
||||||
|
#else
|
||||||
|
ret = krb5_generate_random_keyblock(context, sessionetype, &et.key);
|
||||||
#endif
|
#endif
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
ret = copy_EncryptionKey(&et.key, &ek.key);
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
set_salt_padata (rep.padata, ckey->salt);
|
set_salt_padata (rep.padata, ckey->salt);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user