tpm2: allow use of recoverable sealing keys
In some use cases it is desirable to use a recoverable (ie duplicatable) sealing key. Currently objects have the attribute TPMA_OBJECT_FIXEDTPM and TPMA_OBJECT_FIXEDPARENT hard coded, which will not work with a recoverable sealing key. This patch sets the object's attributes from the sealing key's attributes, so that both types of sealing keys will work.
This commit is contained in:
committed by
Lennart Poettering
parent
9316e02c9d
commit
331fef07d8
@@ -5441,6 +5441,11 @@ int tpm2_seal(Tpm2Context *c,
|
||||
seal_key_handle);
|
||||
|
||||
primary_alg = primary_public->publicArea.type;
|
||||
|
||||
/* Propagate fixedTPM/fixedParent flags from sealing key to hmac key */
|
||||
hmac_template.objectAttributes = (hmac_template.objectAttributes & ~(TPMA_OBJECT_FIXEDTPM|TPMA_OBJECT_FIXEDPARENT)) |
|
||||
(primary_public->publicArea.objectAttributes & (TPMA_OBJECT_FIXEDTPM|TPMA_OBJECT_FIXEDPARENT));
|
||||
|
||||
} else {
|
||||
if (seal_key_handle != 0)
|
||||
log_debug("Using primary alg sealing, but seal key handle also provided; ignoring seal key handle.");
|
||||
|
||||
Reference in New Issue
Block a user