Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve optiga communication reliability #3303

Merged
merged 2 commits into from
Sep 27, 2023
Merged

Conversation

TychoVrahe
Copy link
Contributor

  • adds delays to physical layer
  • resets the optiga via pin during initialization

@TychoVrahe TychoVrahe requested a review from prusnak as a code owner September 26, 2023 09:51
@TychoVrahe TychoVrahe self-assigned this Sep 26, 2023
@@ -300,6 +300,10 @@ void SVC_C_Handler(uint32_t *stack) {
// raising privileges.
stack[6] = (uintptr_t)reboot_to_bootloader;
return;
case SVC_GET_SYSTICK_VAL: {
uint32_t *ret_ptr = (uint32_t *)stack[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks insecure? allows unprivileged code to write to any address.
maybe we could return the value in some register or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hiviah any quick ideas how to do that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(alternately just reserve a static uint32_t at a known location and the caller will need to take the systick val out of there?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going with the static idea: 8f7ae53

core/embed/trezorhal/stm32f4/i2c.c Show resolved Hide resolved
Copy link
Contributor

@matejcik matejcik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@TychoVrahe TychoVrahe force-pushed the tychovrahe/optiga/i2cfix branch from 8f7ae53 to 750dc50 Compare September 27, 2023 09:15
@TychoVrahe TychoVrahe merged commit 5d017e9 into master Sep 27, 2023
@TychoVrahe TychoVrahe deleted the tychovrahe/optiga/i2cfix branch September 27, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants