strcpy(response, "FAILInternal error!");
} else
strcpy(response, "OKAY");
+ } else if (endswith(cmd, FASTBOOT_SET_RSA_ATTESTATION_KEY_ENC)) {
+ if (trusty_set_attestation_key_enc(fastboot_buf_addr,
+ fastboot_bytes_received,
+ KM_ALGORITHM_RSA)) {
+ printf("ERROR set rsa attestation key failed!\n");
+ strcpy(response, "FAILInternal error!");
+ } else {
+ printf("Set rsa attestation key successfully!\n");
+ strcpy(response, "OKAY");
+ }
+ } else if (endswith(cmd, FASTBOOT_SET_EC_ATTESTATION_KEY_ENC)) {
+ if (trusty_set_attestation_key_enc(fastboot_buf_addr,
+ fastboot_bytes_received,
+ KM_ALGORITHM_EC)) {
+ printf("ERROR set ec attestation key failed!\n");
+ strcpy(response, "FAILInternal error!");
+ } else {
+ printf("Set ec attestation key successfully!\n");
+ strcpy(response, "OKAY");
+ }
+ } else if (endswith(cmd, FASTBOOT_APPEND_RSA_ATTESTATION_CERT_ENC)) {
+ if (trusty_append_attestation_cert_chain_enc(fastboot_buf_addr,
+ fastboot_bytes_received,
+ KM_ALGORITHM_RSA)) {
+ printf("ERROR append rsa attestation cert chain failed!\n");
+ strcpy(response, "FAILInternal error!");
+ } else {
+ printf("Append rsa attestation key successfully!\n");
+ strcpy(response, "OKAY");
+ }
+ } else if (endswith(cmd, FASTBOOT_APPEND_EC_ATTESTATION_CERT_ENC)) {
+ if (trusty_append_attestation_cert_chain_enc(fastboot_buf_addr,
+ fastboot_bytes_received,
+ KM_ALGORITHM_EC)) {
+ printf("ERROR append ec attestation cert chain failed!\n");
+ strcpy(response, "FAILInternal error!");
+ } else {
+ printf("Append ec attestation key successfully!\n");
+ strcpy(response, "OKAY");
+ }
} else if (endswith(cmd, FASTBOOT_SET_RSA_ATTESTATION_KEY)) {
if (trusty_set_attestation_key(fastboot_buf_addr,
fastboot_bytes_received,
#define FASTBOOT_SET_EC_ATTESTATION_KEY "set-ec-atte-key"
#define FASTBOOT_APPEND_RSA_ATTESTATION_CERT "append-rsa-atte-cert"
#define FASTBOOT_APPEND_EC_ATTESTATION_CERT "append-ec-atte-cert"
+#define FASTBOOT_SET_RSA_ATTESTATION_KEY_ENC "set-rsa-atte-key-enc"
+#define FASTBOOT_SET_EC_ATTESTATION_KEY_ENC "set-ec-atte-key-enc"
+#define FASTBOOT_APPEND_RSA_ATTESTATION_CERT_ENC "append-rsa-atte-cert-enc"
+#define FASTBOOT_APPEND_EC_ATTESTATION_CERT_ENC "append-ec-atte-cert-enc"
#define FASTBOOT_GET_MPPUBK "get-mppubk"
#endif
KM_ATAP_SET_CA_RESPONSE_FINISH = (0x7000 << KEYMASTER_REQ_SHIFT),
KM_ATAP_READ_UUID = (0x8000 << KEYMASTER_REQ_SHIFT),
KM_SET_PRODUCT_ID = (0x9000 << KEYMASTER_REQ_SHIFT),
+ KM_SET_ATTESTATION_KEY_ENC = (0xa000 << KEYMASTER_REQ_SHIFT),
+ KM_APPEND_ATTESTATION_CERT_CHAIN_ENC = (0xb000 << KEYMASTER_REQ_SHIFT),
KM_GET_MPPUBK = (0xc000 << KEYMASTER_REQ_SHIFT)
};
cert, cert_size, algorithm);
}
+int trusty_set_attestation_key_enc(const uint8_t *key, uint32_t key_size,
+ keymaster_algorithm_t algorithm)
+{
+ return trusty_send_attestation_data(KM_SET_ATTESTATION_KEY_ENC, key, key_size,
+ algorithm);
+}
+
+int trusty_append_attestation_cert_chain_enc(const uint8_t *cert,
+ uint32_t cert_size,
+ keymaster_algorithm_t algorithm)
+{
+ return trusty_send_attestation_data(KM_APPEND_ATTESTATION_CERT_CHAIN_ENC,
+ cert, cert_size, algorithm);
+}
+
int trusty_atap_get_ca_request(const uint8_t *operation_start,
uint32_t operation_start_size,
uint8_t **ca_request_p,