heimdal Add support for extracting a particular KVNO from the database
This should allow master key rollover. (but the real reason is to allow multiple krbtgt accounts, as used by Active Directory to implement RODC support) Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:

committed by
Love Hornquist Astrand

parent
e189d712ce
commit
f469fc6d49
28
kdc/misc.c
28
kdc/misc.c
@@ -40,12 +40,19 @@ _kdc_db_fetch(krb5_context context,
|
||||
krb5_kdc_configuration *config,
|
||||
krb5_const_principal principal,
|
||||
unsigned flags,
|
||||
krb5int32 *kvno_ptr,
|
||||
HDB **db,
|
||||
hdb_entry_ex **h)
|
||||
{
|
||||
hdb_entry_ex *ent;
|
||||
krb5_error_code ret;
|
||||
int i;
|
||||
unsigned kvno = 0;
|
||||
|
||||
if (kvno_ptr) {
|
||||
kvno = *kvno_ptr;
|
||||
flags |= HDB_F_KVNO_SPECIFIED;
|
||||
}
|
||||
|
||||
ent = calloc (1, sizeof (*ent));
|
||||
if (ent == NULL) {
|
||||
@@ -84,11 +91,22 @@ _kdc_db_fetch(krb5_context context,
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = config->db[i]->hdb_fetch(context,
|
||||
config->db[i],
|
||||
principal,
|
||||
flags | HDB_F_DECRYPT,
|
||||
ent);
|
||||
if (config->db[i]->hdb_fetch_kvno) {
|
||||
ret = config->db[i]->hdb_fetch_kvno(context,
|
||||
config->db[i],
|
||||
principal,
|
||||
flags | HDB_F_DECRYPT,
|
||||
kvno,
|
||||
ent);
|
||||
} else {
|
||||
flags &= ~HDB_F_KVNO_SPECIFIED;
|
||||
ret = config->db[i]->hdb_fetch(context,
|
||||
config->db[i],
|
||||
principal,
|
||||
flags | HDB_F_DECRYPT,
|
||||
ent);
|
||||
}
|
||||
|
||||
krb5_free_principal(context, enterprise_principal);
|
||||
|
||||
config->db[i]->hdb_close(context, config->db[i]);
|
||||
|
Reference in New Issue
Block a user