(make_etype_info2_entry): When its a afs3-salted key, use send the

opaque, length 1 (with content set to 0x01) in ETYPE-INFO2-ENTRY.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16077 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-09-19 22:01:04 +00:00
parent 9ea6ec2caa
commit d0af14e4fe

View File

@@ -480,8 +480,8 @@ make_etype_info2_entry(ETYPE_INFO2_ENTRY *ent, Key *key)
ent->s2kparams = NULL; ent->s2kparams = NULL;
switch (key->key.keytype) { switch (key->key.keytype) {
case KEYTYPE_AES128: case ETYPE_AES128_CTS_HMAC_SHA1_96:
case KEYTYPE_AES256: case ETYPE_AES256_CTS_HMAC_SHA1_96:
ALLOC(ent->s2kparams); ALLOC(ent->s2kparams);
if (ent->s2kparams == NULL) if (ent->s2kparams == NULL)
return ENOMEM; return ENOMEM;
@@ -496,6 +496,26 @@ make_etype_info2_entry(ETYPE_INFO2_ENTRY *ent, Key *key)
_krb5_AES_string_to_default_iterator, _krb5_AES_string_to_default_iterator,
ent->s2kparams->length); ent->s2kparams->length);
break; break;
case ETYPE_DES_CBC_CRC:
case ETYPE_DES_CBC_MD4:
case ETYPE_DES_CBC_MD5:
/* Check if this was a AFS3 salted key */
if(key->salt && key->salt->type == hdb_afs3_salt){
ALLOC(ent->s2kparams);
if (ent->s2kparams == NULL)
return ENOMEM;
ent->s2kparams->length = 1;
ent->s2kparams->data = malloc(ent->s2kparams->length);
if (ent->s2kparams->data == NULL) {
free(ent->s2kparams);
ent->s2kparams = NULL;
return ENOMEM;
}
_krb5_put_int(ent->s2kparams->data,
1,
ent->s2kparams->length);
}
break;
default: default:
break; break;
} }