Skip to content

Commit

Permalink
[clean] Update snapshots + linter pass"
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed Jul 8, 2024
1 parent c75b97b commit a0113ad
Show file tree
Hide file tree
Showing 87 changed files with 27 additions and 22 deletions.
8 changes: 2 additions & 6 deletions include/ctap2.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,8 @@ void ctap2_send_keepalive_processing(void);
// Correspond to FIDO2.1 spec performBuiltInUv() operation
void performBuiltInUv(void);

void ctap2_make_credential_handle(u2f_service_t *service,
uint8_t *buffer,
uint16_t length);
void ctap2_get_assertion_handle(u2f_service_t *service,
uint8_t *buffer,
uint16_t length);
void ctap2_make_credential_handle(u2f_service_t *service, uint8_t *buffer, uint16_t length);
void ctap2_get_assertion_handle(u2f_service_t *service, uint8_t *buffer, uint16_t length);
void ctap2_get_next_assertion_handle(u2f_service_t *service, uint8_t *buffer, uint16_t length);
void ctap2_get_info_handle(u2f_service_t *service, uint8_t *buffer, uint16_t length);
void ctap2_client_pin_handle(u2f_service_t *service, uint8_t *buffer, uint16_t length);
Expand Down
4 changes: 1 addition & 3 deletions src/ctap2_get_assertion.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,7 @@ static int process_getAssert_authnr_pin(cbipDecoder_t *decoder, cbipItem_t *mapI
return 0;
}

void ctap2_get_assertion_handle(u2f_service_t *service,
uint8_t *buffer,
uint16_t length) {
void ctap2_get_assertion_handle(u2f_service_t *service, uint8_t *buffer, uint16_t length) {
ctap2_assert_data_t *ctap2AssertData = globals_get_ctap2_assert_data();
cbipDecoder_t decoder;
cbipItem_t mapItem;
Expand Down
5 changes: 3 additions & 2 deletions src/ctap2_get_assertion_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@ UX_FLOW(ux_ctap2_no_assertion_flow,

static nbgl_page_t *pageContext;
#define NB_OF_PAIRS 2
static const nbgl_layoutTagValue_t pairs[NB_OF_PAIRS] = {{.item = "Website", .value = g.rpID},
{.item = "User ID", .value = g.verifyHash}};
static const nbgl_layoutTagValue_t pairs[NB_OF_PAIRS] = {
{.item = "Website", .value = g.rpID},
{.item = "User ID", .value = g.verifyHash}};

#define SELECT_MAX_ID_NB 5
#define SELECT_ID_BUFFER_SIZE 36
Expand Down
12 changes: 7 additions & 5 deletions src/ctap2_make_credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ static int parse_makeCred_authnr_user(cbipDecoder_t *decoder, cbipItem_t *mapIte
// overflows under the "Register" button. We'll need to clean that (new page?)
ctap2RegisterData->userStrLen = 64;
}
PRINTF("MAKE_CREDENTIAL: userStr %.*s\n", ctap2RegisterData->userStrLen, ctap2RegisterData->userStr);
PRINTF("MAKE_CREDENTIAL: userStr %.*s\n",
ctap2RegisterData->userStrLen,
ctap2RegisterData->userStr);
} else {
PRINTF("MAKE_CREDENTIAL: userID %.*H\n", ctap2RegisterData->userIdLen, ctap2RegisterData->userId);
PRINTF("MAKE_CREDENTIAL: userID %.*H\n",
ctap2RegisterData->userIdLen,
ctap2RegisterData->userId);
}
return 0;
}
Expand Down Expand Up @@ -409,9 +413,7 @@ static int process_makeCred_authnr_pin(cbipDecoder_t *decoder, cbipItem_t *mapIt
return 0;
}

void ctap2_make_credential_handle(u2f_service_t *service,
uint8_t *buffer,
uint16_t length) {
void ctap2_make_credential_handle(u2f_service_t *service, uint8_t *buffer, uint16_t length) {
ctap2_register_data_t *ctap2RegisterData = globals_get_ctap2_register_data();
cbipDecoder_t decoder;
cbipItem_t mapItem;
Expand Down
3 changes: 2 additions & 1 deletion src/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void truncate_pairs_for_display() {
void prepare_display_status() {
if (!g.is_nfc) {
PRINTF("NOT NFC so no display status for rpID '%s' and verifyHash '%s'\n",
g.rpID, g.verifyHash);
g.rpID,
g.verifyHash);
g.display_status[0] = '\0';
return;
}
Expand Down
11 changes: 8 additions & 3 deletions src/string_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <nbgl_layout.h>
#endif // defined(HAVE_NBGL)


void truncate_for_nb_lines(char *input) {
#if !defined(HAVE_NBGL)
UNUSED(input);
Expand All @@ -29,8 +28,14 @@ void truncate_for_nb_lines(char *input) {
// Ex: on Flex, with a single call, 'MMMMMMMMMMMMMMMMMMMMMMMMMMMM' would be reduced to
// 'MMMMMMMMMMMMMMMMMMMMMMM...', when it fact 'MMMMMMMMMMMMMMMMMMMMMMMM...' would fit.
// As the truncation could be severe (down to 24B in this example), I think this is worth
// the extra computation (in any case, this would take a maximum of 3 iterations into the loop)
nbgl_getTextMaxLenInNbLines(LARGE_MEDIUM_FONT, input, AVAILABLE_WIDTH, line_nb, &max_bytes, false);
// the extra computation (in any case, this would take a maximum of 3 iterations into the
// loop)
nbgl_getTextMaxLenInNbLines(LARGE_MEDIUM_FONT,
input,
AVAILABLE_WIDTH,
line_nb,
&max_bytes,
false);
if (size <= max_bytes) {
return;
}
Expand Down
6 changes: 4 additions & 2 deletions tests/speculos/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ def create_backend(root_pytest_dir: Path, backend_name: str,


@pytest.fixture(scope="module")
def backend(root_pytest_dir: Path, backend_name: str, firmware: Firmware, display: bool, transport: str):
def backend(root_pytest_dir: Path, backend_name: str, firmware: Firmware, display: bool,
transport: str):
with create_backend(root_pytest_dir, backend_name, firmware, display, transport) as b:
yield b


@pytest.fixture
def client(firmware: Firmware, backend, navigator, transport: str, ctap2_u2f_proxy: bool) -> TestClient:
def client(firmware: Firmware, backend, navigator, transport: str,
ctap2_u2f_proxy: bool) -> TestClient:
client = TestClient(firmware, backend, navigator, transport, ctap2_u2f_proxy)
client.start()
return client
Expand Down
Binary file modified tests/speculos/snapshots/flex/test_authenticate_ok/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/speculos/snapshots/stax/test_authenticate_ok/00000.png
Binary file modified tests/speculos/snapshots/stax/test_u2f_screens_idle/00000.png
Binary file modified tests/speculos/snapshots/stax/test_u2f_screens_idle/00001.png
Binary file modified tests/speculos/snapshots/stax/test_u2f_screens_idle/00002.png

0 comments on commit a0113ad

Please sign in to comment.