hdb: Fix crash when expected KR is missing

This commit is contained in:
Nicolas Williams
2021-10-30 00:40:32 -05:00
parent 2a9b57cdad
commit 831a5f9db3
2 changed files with 5 additions and 0 deletions

View File

@@ -995,6 +995,8 @@ derive_keys(krb5_context context,
/* Installing keys invalidates `ckr', so we copy it */
ret = hdb_entry_get_key_rotation(context, &h->entry, &ckr);
if (!ckr)
return ret;
if (ret == 0)
ret = copy_HDB_Ext_KeyRotation(ckr, &kr);
}

View File

@@ -246,6 +246,9 @@ hdb_remove_base_keys(krb5_context context,
size_t i, k;
ret = hdb_entry_get_key_rotation(context, e, &ckr);
if (!ckr)
return 0;
if (ret == 0) {
/*
* Changing the entry's extensions invalidates extensions obtained