Skip to content

Commit 06f57a3

Browse files
zanebeckwithAndreas Fuchs
authored andcommitted
tpm2tss-genkey: If parent of key is OWNER, save that to file (not 0).
Signed-off-by: Zane Beckwith <[email protected]>
1 parent 62a60ef commit 06f57a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tpm2-tss-engine-common.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ tpm2tss_tpm2data_write(const TPM2_DATA *tpm2Data, const char *filename)
171171
}
172172

173173
tpk->emptyAuth = ! !tpm2Data->emptyAuth;
174-
ASN1_INTEGER_set(tpk->parent, tpm2Data->parent);
174+
if (tpm2Data->parent != 0) {
175+
ASN1_INTEGER_set(tpk->parent, tpm2Data->parent);
176+
} else {
177+
ASN1_INTEGER_set(tpk->parent, TPM2_RH_OWNER);
178+
}
175179
ASN1_STRING_set(tpk->privkey, &privbuf[0], privbuf_len);
176180
ASN1_STRING_set(tpk->pubkey, &pubbuf[0], pubbuf_len);
177181

0 commit comments

Comments
 (0)