trusty: keymaster: set_attestation_key: Change wrapped key

Remove WrappedPrivateKey and select wrapped vs plaintext key command
based on format instead.

Bug: 154033394
Test: send wrapped test key. Not yet accepted by trusty
Change-Id: I3b0a29be78f2a8e84ebd990713f66788256d8e3f
This commit is contained in:
Arve Hjønnevåg 2020-10-02 16:55:16 -07:00
parent 754c6b2924
commit fe090a4686
1 changed files with 8 additions and 3 deletions

View File

@ -292,9 +292,14 @@ static int process_xml(xmlTextReaderPtr xml) {
value = xmlTextReaderConstValue(xml);
uint32_t cmd;
if (xmlStrEqual(element, BAD_CAST "PrivateKey")) {
cmd = KM_SET_ATTESTATION_KEY;
} else if (xmlStrEqual(element, BAD_CAST "WrappedPrivateKey")) {
cmd = KM_SET_WRAPPED_ATTESTATION_KEY;
if (xmlStrEqual(element_format, BAD_CAST "pem")) {
cmd = KM_SET_ATTESTATION_KEY;
} else if (xmlStrEqual(element_format, BAD_CAST "iecs")) {
cmd = KM_SET_WRAPPED_ATTESTATION_KEY;
} else {
printf("unsupported key format: %s\n", element_format);
return -1;
}
} else if (xmlStrEqual(element, BAD_CAST "Certificate")) {
cmd = KM_APPEND_ATTESTATION_CERT_CHAIN;
} else {