(read_master_mit): fix this
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8552 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -156,16 +156,22 @@ read_master_mit(krb5_context context, const char *filename,
|
||||
return errno;
|
||||
}
|
||||
krb5_storage_set_flags(sp, KRB5_STORAGE_HOST_BYTEORDER);
|
||||
#if 0
|
||||
/* could possibly use ret_keyblock here, but do it with more
|
||||
checks for now */
|
||||
ret = krb5_ret_keyblock(sp, &key);
|
||||
#else
|
||||
ret = krb5_ret_int16(sp, &enctype);
|
||||
if((htons(enctype) & 0xff00) == 0x3000) {
|
||||
ret = HEIM_ERR_BAD_MKEY;
|
||||
goto out;
|
||||
}
|
||||
ret = krb5_ret_keyblock(sp, &key);
|
||||
if(enctype != 0x1ff /* ENCTYPE_UNKNOWN */ && enctype != key.keytype)
|
||||
ret = HEIM_ERR_BAD_MKEY;
|
||||
else
|
||||
ret = hdb_process_master_key(context, 0, &key, 0, mkey);
|
||||
key.keytype = enctype;
|
||||
ret = krb5_ret_data(sp, &key.keyvalue);
|
||||
if(ret)
|
||||
goto out;
|
||||
#endif
|
||||
ret = hdb_process_master_key(context, 0, &key, 0, mkey);
|
||||
krb5_free_keyblock_contents(context, &key);
|
||||
out:
|
||||
krb5_storage_free(sp);
|
||||
|
Reference in New Issue
Block a user