Update to reality.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2112 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1997-07-09 05:34:32 +00:00
parent 335b7b7cff
commit e1caece009

View File

@@ -9,25 +9,17 @@ db_fetch(krb5_context context, PrincipalName *principal, char *realm)
{
HDB *db;
hdb_entry *ent;
krb5_error_code ret;
ent = malloc(sizeof(*ent));
principalname2krb5_principal(&ent->principal, *principal, realm);
hdb_open(context, &db, NULL, O_RDONLY, 0);
db->fetch(context, db, ent);
ret = db->fetch(context, db, ent);
db->close(context, db);
if(ret){
krb5_free_principal(context, ent->principal);
free(ent);
return NULL;
}
return ent;
}
/* this should move someplace else */
krb5_error_code
mk_des_keyblock(EncryptionKey *kb)
{
kb->keytype = KEYTYPE_DES;
kb->keyvalue.data = malloc(sizeof(des_cblock));
kb->keyvalue.length = sizeof(des_cblock);
des_new_random_key(kb->keyvalue.data);
return 0;
}