mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 20:19:23 +00:00
firmware: mark usb buffer variables confidential
This commit is contained in:
parent
2387f71813
commit
36f3b7fe09
@ -222,7 +222,7 @@ enum {
|
|||||||
|
|
||||||
void msg_process(char type, uint16_t msg_id, const pb_field_t *fields, uint8_t *msg_raw, uint32_t msg_size)
|
void msg_process(char type, uint16_t msg_id, const pb_field_t *fields, uint8_t *msg_raw, uint32_t msg_size)
|
||||||
{
|
{
|
||||||
static uint8_t msg_data[MSG_IN_SIZE];
|
static CONFIDENTIAL uint8_t msg_data[MSG_IN_SIZE];
|
||||||
memset(msg_data, 0, sizeof(msg_data));
|
memset(msg_data, 0, sizeof(msg_data));
|
||||||
pb_istream_t stream = pb_istream_from_buffer(msg_raw, msg_size);
|
pb_istream_t stream = pb_istream_from_buffer(msg_raw, msg_size);
|
||||||
bool status = pb_decode(&stream, fields, msg_data);
|
bool status = pb_decode(&stream, fields, msg_data);
|
||||||
@ -236,7 +236,7 @@ void msg_process(char type, uint16_t msg_id, const pb_field_t *fields, uint8_t *
|
|||||||
void msg_read_common(char type, const uint8_t *buf, int len)
|
void msg_read_common(char type, const uint8_t *buf, int len)
|
||||||
{
|
{
|
||||||
static char read_state = READSTATE_IDLE;
|
static char read_state = READSTATE_IDLE;
|
||||||
static uint8_t msg_in[MSG_IN_SIZE];
|
static CONFIDENTIAL uint8_t msg_in[MSG_IN_SIZE];
|
||||||
static uint16_t msg_id = 0xFFFF;
|
static uint16_t msg_id = 0xFFFF;
|
||||||
static uint32_t msg_size = 0;
|
static uint32_t msg_size = 0;
|
||||||
static uint32_t msg_pos = 0;
|
static uint32_t msg_pos = 0;
|
||||||
@ -304,7 +304,7 @@ const uint8_t *msg_debug_out_data(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8_t msg_tiny[64];
|
CONFIDENTIAL uint8_t msg_tiny[64];
|
||||||
uint16_t msg_tiny_id = 0xFFFF;
|
uint16_t msg_tiny_id = 0xFFFF;
|
||||||
|
|
||||||
void msg_read_tiny(const uint8_t *buf, int len)
|
void msg_read_tiny(const uint8_t *buf, int len)
|
||||||
|
@ -343,7 +343,7 @@ static volatile char tiny = 0;
|
|||||||
static void hid_rx_callback(usbd_device *dev, uint8_t ep)
|
static void hid_rx_callback(usbd_device *dev, uint8_t ep)
|
||||||
{
|
{
|
||||||
(void)ep;
|
(void)ep;
|
||||||
static uint8_t buf[64] __attribute__ ((aligned(4)));
|
static CONFIDENTIAL uint8_t buf[64] __attribute__ ((aligned(4)));
|
||||||
if ( usbd_ep_read_packet(dev, ENDPOINT_ADDRESS_OUT, buf, 64) != 64) return;
|
if ( usbd_ep_read_packet(dev, ENDPOINT_ADDRESS_OUT, buf, 64) != 64) return;
|
||||||
debugLog(0, "", "hid_rx_callback");
|
debugLog(0, "", "hid_rx_callback");
|
||||||
if (!tiny) {
|
if (!tiny) {
|
||||||
@ -356,7 +356,7 @@ static void hid_rx_callback(usbd_device *dev, uint8_t ep)
|
|||||||
static void hid_u2f_rx_callback(usbd_device *dev, uint8_t ep)
|
static void hid_u2f_rx_callback(usbd_device *dev, uint8_t ep)
|
||||||
{
|
{
|
||||||
(void)ep;
|
(void)ep;
|
||||||
static uint8_t buf[64] __attribute__ ((aligned(4)));
|
static CONFIDENTIAL uint8_t buf[64] __attribute__ ((aligned(4)));
|
||||||
|
|
||||||
debugLog(0, "", "hid_u2f_rx_callback");
|
debugLog(0, "", "hid_u2f_rx_callback");
|
||||||
if ( usbd_ep_read_packet(dev, ENDPOINT_ADDRESS_U2F_OUT, buf, 64) != 64) return;
|
if ( usbd_ep_read_packet(dev, ENDPOINT_ADDRESS_U2F_OUT, buf, 64) != 64) return;
|
||||||
@ -367,7 +367,7 @@ static void hid_u2f_rx_callback(usbd_device *dev, uint8_t ep)
|
|||||||
static void hid_debug_rx_callback(usbd_device *dev, uint8_t ep)
|
static void hid_debug_rx_callback(usbd_device *dev, uint8_t ep)
|
||||||
{
|
{
|
||||||
(void)ep;
|
(void)ep;
|
||||||
static uint8_t buf[64] __attribute__ ((aligned(4)));
|
static CONFIDENTIAL uint8_t buf[64] __attribute__ ((aligned(4)));
|
||||||
if ( usbd_ep_read_packet(dev, ENDPOINT_ADDRESS_DEBUG_OUT, buf, 64) != 64) return;
|
if ( usbd_ep_read_packet(dev, ENDPOINT_ADDRESS_DEBUG_OUT, buf, 64) != 64) return;
|
||||||
debugLog(0, "", "hid_debug_rx_callback");
|
debugLog(0, "", "hid_debug_rx_callback");
|
||||||
if (!tiny) {
|
if (!tiny) {
|
||||||
|
Loading…
Reference in New Issue
Block a user