1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-19 22:18:13 +00:00

add FirmwareRequest message

This commit is contained in:
Pavol Rusnak 2017-04-06 14:50:28 +02:00
parent 6a1adef5f9
commit 072770f51a
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -23,6 +23,7 @@ enum MessageType {
MessageType_WipeDevice = 5 [(wire_in) = true]; MessageType_WipeDevice = 5 [(wire_in) = true];
MessageType_FirmwareErase = 6 [(wire_in) = true]; MessageType_FirmwareErase = 6 [(wire_in) = true];
MessageType_FirmwareUpload = 7 [(wire_in) = true]; MessageType_FirmwareUpload = 7 [(wire_in) = true];
MessageType_FirmwareRequest = 8 [(wire_out) = true];
MessageType_GetEntropy = 9 [(wire_in) = true]; MessageType_GetEntropy = 9 [(wire_in) = true];
MessageType_Entropy = 10 [(wire_out) = true]; MessageType_Entropy = 10 [(wire_out) = true];
MessageType_GetPublicKey = 11 [(wire_in) = true]; MessageType_GetPublicKey = 11 [(wire_in) = true];
@ -714,13 +715,23 @@ message SetU2FCounter {
///////////////////////// /////////////////////////
/** /**
* Request: Ask device to erase its firmware * Request: Ask device to erase its firmware (so it can be replaced via FirmwareUpload)
* @next Success * @next Success
* @next FirmwareRequest
* @next Failure * @next Failure
*/ */
message FirmwareErase { message FirmwareErase {
} }
/**
* Response: Ask for firmware chunk
* @next FirmwareUpload
*/
message FirmwareRequest {
optional uint32 offset = 1; // offset of requested firmware chunk
optional uint32 length = 2; // length of requested firmware chunk
}
/** /**
* Request: Send firmware in binary form to the device * Request: Send firmware in binary form to the device
* @next Success * @next Success
@ -728,6 +739,7 @@ message FirmwareErase {
*/ */
message FirmwareUpload { message FirmwareUpload {
required bytes payload = 1; // firmware to be loaded into device required bytes payload = 1; // firmware to be loaded into device
optional bytes hash = 2; // hash of the payload
} }
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////