From df79977ee9e39537f8409aa3980e1d318f041463 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 2 May 2022 15:46:56 +0200 Subject: [PATCH 01/10] Fix EIP1024 warnings --- .../performPrivacyOperation/cmd_performPrivacyOperation.c | 1 + .../performPrivacyOperation/ui_common_performPrivacyOperation.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c b/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c index b396d33..9bd5802 100644 --- a/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c +++ b/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c @@ -1,5 +1,6 @@ #include "shared_context.h" #include "apdu_constants.h" +#include "ethUtils.h" #include "ui_flow.h" #include "feature_performPrivacyOperation.h" diff --git a/src_features/performPrivacyOperation/ui_common_performPrivacyOperation.c b/src_features/performPrivacyOperation/ui_common_performPrivacyOperation.c index 6cc7182..ac045f2 100644 --- a/src_features/performPrivacyOperation/ui_common_performPrivacyOperation.c +++ b/src_features/performPrivacyOperation/ui_common_performPrivacyOperation.c @@ -1,6 +1,7 @@ #include "shared_context.h" #include "feature_getPublicKey.h" #include "ui_callbacks.h" +#include "feature_performPrivacyOperation.h" unsigned int io_seproxyhal_touch_privacy_ok(__attribute__((unused)) const bagl_element_t *e) { uint32_t tx = set_result_perform_privacy_operation(); From 5dc1a0cfcd8e9e4e4e514094227dde3fad816eaa Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 23 May 2022 16:39:24 +0200 Subject: [PATCH 02/10] EIP-191 clear signing --- src_features/signMessage/cmd_signMessage.c | 123 ++++++++++++++++-- .../signMessage/ui_flow_signMessage.c | 2 +- 2 files changed, 113 insertions(+), 12 deletions(-) diff --git a/src_features/signMessage/cmd_signMessage.c b/src_features/signMessage/cmd_signMessage.c index 2c5ec6f..a7592a3 100644 --- a/src_features/signMessage/cmd_signMessage.c +++ b/src_features/signMessage/cmd_signMessage.c @@ -1,3 +1,4 @@ +#include #include "shared_context.h" #include "apdu_constants.h" #include "utils.h" @@ -7,12 +8,108 @@ static const char SIGN_MAGIC[] = "\x19" "Ethereum Signed Message:\n"; +/** + * Check if a given character is a "special" displayable ASCII character + * + * @param[in] c character we're checking + * @return wether the character is special or not + */ +static inline bool is_char_special(char c) { + return ((c >= '\b') && (c <= '\r')); +} + +/** + * Check if a given data is made of ASCII characters + * + * @param[in] data the input data + * @param[in] the length of the input data + * @return wether the data is fully ASCII or not + */ +static bool is_data_ascii(const uint8_t *const data, uint8_t length) { + for (uint8_t idx = 0; idx < length; ++idx) { + if (!is_char_special(data[idx]) && ((data[idx] < 0x20) || (data[idx] > 0x7e))) { + return false; + } + } + return true; +} + +/** + * Initialize value string that will be displayed in the UX STEP + * + * @param[in] if the value is ASCII + */ +static void init_value_str(bool is_ascii) { + if (is_ascii) { + strings.tmp.tmp[0] = '\0'; // init string as empty + } else { + strcpy(strings.tmp.tmp, "0x"); // will display the hex bytes instead + } +} + +/** + * Update the global UI string variable by formatting & appending the new data to it + * + * @param[in] data the input data + * @param[in] length the data length + * @param[in] is_ascii wether the data is ASCII or not + */ +static void feed_value_str(const uint8_t *const data, uint8_t length, bool is_ascii) { + uint16_t value_strlen = strlen(strings.tmp.tmp); + + if ((value_strlen + 1) < sizeof(strings.tmp.tmp)) { + if (is_ascii) { + uint8_t src_idx = 0; + uint16_t dst_idx = value_strlen; + bool prev_is_special = false; + + while ((src_idx < length) && (dst_idx < sizeof(strings.tmp.tmp))) { + if (prev_is_special) { + if (!is_char_special(data[src_idx])) { + prev_is_special = false; + } + } else { + if (is_char_special(data[src_idx])) { + prev_is_special = true; + strings.tmp.tmp[dst_idx] = ' '; + dst_idx += 1; + } + } + if (!is_char_special(data[src_idx])) { + strings.tmp.tmp[dst_idx] = data[src_idx]; + dst_idx += 1; + } + src_idx += 1; + } + + if (dst_idx < sizeof(strings.tmp.tmp)) { + strings.tmp.tmp[dst_idx] = '\0'; + } else { + const char marker[] = "..."; + + memcpy(strings.tmp.tmp + sizeof(strings.tmp.tmp) - sizeof(marker), + marker, + sizeof(marker)); + } + } else { + snprintf(strings.tmp.tmp + value_strlen, + sizeof(strings.tmp.tmp) - value_strlen, + "%.*H", + length, + data); + } + } +} + void handleSignPersonalMessage(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) { + // Point to this unused global variable for persistency + bool *is_ascii = (bool *) &strings.tmp.tmp2[0]; + UNUSED(tx); uint8_t hashMessage[INT256_LENGTH]; if (p1 == P1_FIRST) { @@ -29,6 +126,7 @@ void handleSignPersonalMessage(uint8_t p1, reset_app_context(); } appState = APP_STATE_SIGNING_MESSAGE; + tmpCtx.messageSigningContext.pathLength = workBuffer[0]; if ((tmpCtx.messageSigningContext.pathLength < 0x01) || (tmpCtx.messageSigningContext.pathLength > MAX_BIP32_PATH)) { @@ -38,21 +136,21 @@ void handleSignPersonalMessage(uint8_t p1, workBuffer++; dataLength--; for (i = 0; i < tmpCtx.messageSigningContext.pathLength; i++) { - if (dataLength < 4) { + if (dataLength < sizeof(uint32_t)) { PRINTF("Invalid data\n"); THROW(0x6a80); } tmpCtx.messageSigningContext.bip32Path[i] = U4BE(workBuffer, 0); - workBuffer += 4; - dataLength -= 4; + workBuffer += sizeof(uint32_t); + dataLength -= sizeof(uint32_t); } - if (dataLength < 4) { + if (dataLength < sizeof(uint32_t)) { PRINTF("Invalid data\n"); THROW(0x6a80); } tmpCtx.messageSigningContext.remainingLength = U4BE(workBuffer, 0); - workBuffer += 4; - dataLength -= 4; + workBuffer += sizeof(uint32_t); + dataLength -= sizeof(uint32_t); // Initialize message header + length cx_keccak_init(&global_sha3, 256); cx_hash((cx_hash_t *) &global_sha3, @@ -71,6 +169,10 @@ void handleSignPersonalMessage(uint8_t p1, tmp[pos] = '\0'; cx_hash((cx_hash_t *) &global_sha3, 0, (uint8_t *) tmp, pos, NULL, 0); cx_sha256_init(&tmpContent.sha2); + + *is_ascii = is_data_ascii(workBuffer, dataLength); + init_value_str(*is_ascii); + } else if (p1 != P1_MORE) { THROW(0x6B00); } @@ -84,9 +186,13 @@ void handleSignPersonalMessage(uint8_t p1, if (dataLength > tmpCtx.messageSigningContext.remainingLength) { THROW(0x6A80); } + cx_hash((cx_hash_t *) &global_sha3, 0, workBuffer, dataLength, NULL, 0); cx_hash((cx_hash_t *) &tmpContent.sha2, 0, workBuffer, dataLength, NULL, 0); tmpCtx.messageSigningContext.remainingLength -= dataLength; + + feed_value_str(workBuffer, dataLength, *is_ascii); + if (tmpCtx.messageSigningContext.remainingLength == 0) { cx_hash((cx_hash_t *) &global_sha3, CX_LAST, @@ -95,11 +201,6 @@ void handleSignPersonalMessage(uint8_t p1, tmpCtx.messageSigningContext.hash, 32); cx_hash((cx_hash_t *) &tmpContent.sha2, CX_LAST, workBuffer, 0, hashMessage, 32); - snprintf(strings.tmp.tmp, - sizeof(strings.tmp.tmp), - "%.*H", - sizeof(hashMessage), - hashMessage); #ifdef NO_CONSENT io_seproxyhal_touch_signMessage_ok(NULL); diff --git a/src_features/signMessage/ui_flow_signMessage.c b/src_features/signMessage/ui_flow_signMessage.c index 6672977..ee8e39e 100644 --- a/src_features/signMessage/ui_flow_signMessage.c +++ b/src_features/signMessage/ui_flow_signMessage.c @@ -14,7 +14,7 @@ UX_STEP_NOCB( ux_sign_flow_2_step, bnnn_paging, { - .title = "Message hash", + .title = "Message", .text = strings.tmp.tmp, }); UX_STEP_CB( From 8bc541b994e0674e558119b202cfb0cbb094d8b2 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 23 May 2022 16:39:45 +0200 Subject: [PATCH 03/10] Increased display value buffer size for LNX & LNS+ --- src/shared_context.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared_context.h b/src/shared_context.h index 12b21f5..ef418fe 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -170,7 +170,11 @@ typedef struct txStringProperties_t { char network_name[NETWORK_STRING_MAX_SIZE]; } txStringProperties_t; +#ifdef TARGET_NANOS #define SHARED_CTX_FIELD_1_SIZE 100 +#else +#define SHARED_CTX_FIELD_1_SIZE 256 +#endif #define SHARED_CTX_FIELD_2_SIZE 40 typedef struct strDataTmp_t { From fa7c4476d7b9cc62948ff336890ff5d78a0c68ad Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 25 May 2022 18:09:38 +0200 Subject: [PATCH 04/10] Update Zemu framework --- tests/package.json | 2 +- tests/yarn.lock | 192 ++++++++++++++++++++------------------------- 2 files changed, 87 insertions(+), 107 deletions(-) diff --git a/tests/package.json b/tests/package.json index 7b08f38..ff934a8 100644 --- a/tests/package.json +++ b/tests/package.json @@ -15,7 +15,7 @@ "@ledgerhq/hw-app-eth": "^6.5.0", "@ledgerhq/hw-transport-http": "^4.74.2", "@ledgerhq/logs": "^5.50.0", - "@zondax/zemu": "^0.22.1", + "@zondax/zemu": "^0.27.4", "bignumber.js": "^9.0.0", "bip32-path": "^0.4.2", "core-js": "^3.7.0", diff --git a/tests/yarn.lock b/tests/yarn.lock index 238895c..2ed8afa 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -1637,11 +1637,12 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" -"@grpc/grpc-js@^1.3.4": - version "1.3.7" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.3.7.tgz#58b687aff93b743aafde237fd2ee9a3259d7f2d8" - integrity sha512-CKQVuwuSPh40tgOkR7c0ZisxYRiN05PcKPW72mQL5y++qd7CwBRoaJZvU5xfXnCJDFBmS3qZGQ71Frx6Ofo2XA== +"@grpc/grpc-js@^1.5.5": + version "1.6.7" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.6.7.tgz#4c4fa998ff719fe859ac19fe977fdef097bb99aa" + integrity sha512-eBM03pu9hd3VqDQG+kHahiG1x80RGkkqqRb1Pchcwqej/KkAH95gAvKs6laqaHCycYaPK+TKuNQnOz9UXYA8qw== dependencies: + "@grpc/proto-loader" "^0.6.4" "@types/node" ">=12.12.47" "@grpc/proto-loader@^0.6.4": @@ -1655,6 +1656,17 @@ protobufjs "^6.10.0" yargs "^16.1.1" +"@grpc/proto-loader@^0.6.9": + version "0.6.12" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.12.tgz#459b619b8b9b67794bf0d1cb819653a38c63e164" + integrity sha512-filTVbETFnxb9CyRX98zN18ilChTuf/C5scZ2xyaOTp0EHGq0/ufX8rjqXUcSb1Gpv7eZq4M2jDvbh9BogKnrg== + dependencies: + "@types/long" "^4.0.1" + lodash.camelcase "^4.3.0" + long "^4.0.0" + protobufjs "^6.10.0" + yargs "^16.2.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1945,6 +1957,16 @@ "@ledgerhq/logs" "^4.72.0" rxjs "^6.5.3" +"@ledgerhq/devices@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.27.1.tgz#3b13ab1d1ba8201e9e74a08f390560483978c962" + integrity sha512-jX++oy89jtv7Dp2X6gwt3MMkoajel80JFWcdc0HCouwDsV1mVJ3SQdwl/bQU0zd8HI6KebvUP95QTwbQLLK/RQ== + dependencies: + "@ledgerhq/errors" "^6.10.0" + "@ledgerhq/logs" "^6.10.0" + rxjs "6" + semver "^7.3.5" + "@ledgerhq/devices@^6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.3.0.tgz#7ee59614198882311d1805912e368451527d05b2" @@ -1960,6 +1982,11 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-4.78.0.tgz#23daf3af54d03b1bda3e616002b555da1bdb705a" integrity sha512-FX6zHZeiNtegBvXabK6M5dJ+8OV8kQGGaGtuXDeK/Ss5EmG4Ltxc6Lnhe8hiHpm9pCHtktOsnUVL7IFBdHhYUg== +"@ledgerhq/errors@^6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.10.0.tgz#dda9127b65f653fbb2f74a55e8f0e550d69de6e4" + integrity sha512-fQFnl2VIXh9Yd41lGjReCeK+Q2hwxQJvLZfqHnKqWapTz68NHOv5QcI0OHuZVNEbv0xhgdLhi5b65kgYeQSUVg== + "@ledgerhq/errors@^6.2.0": version "6.2.0" resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.2.0.tgz#7dc2b3bf6bdedccdaa1b97dccacfa912c4fc22f8" @@ -1989,16 +2016,16 @@ axios "^0.19.0" ws "6" -"@ledgerhq/hw-transport-http@^6.1.0": - version "6.3.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.3.0.tgz#e409ba846b3fda9366f1ad68f545b799336ab08b" - integrity sha512-KIYRlobKsjxBa7wNIDB+8Vo+OcKRmUy/nImyFZLTnKE0nLNgwRaK+P7D/Qw3VXBMpwHkdCtsTeBho+0fapkHxA== +"@ledgerhq/hw-transport-http@^6.24.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.27.1.tgz#25c6cf02c4b464fae416d163f9ab4fda7b6198ff" + integrity sha512-494Zk5jvHcasa5xjZW7l5g+QqJqLlZpuV/RvlIWnKHdVdrBWYvG/1VukQfJQPgbK3WHtt/9WhrnJoLI+xv2PrA== dependencies: - "@ledgerhq/errors" "^6.2.0" - "@ledgerhq/hw-transport" "^6.3.0" - "@ledgerhq/logs" "^6.2.0" - axios "^0.21.1" - ws "7" + "@ledgerhq/errors" "^6.10.0" + "@ledgerhq/hw-transport" "^6.27.1" + "@ledgerhq/logs" "^6.10.0" + axios "^0.26.1" + ws "8.5.0" "@ledgerhq/hw-transport@^4.78.0": version "4.78.0" @@ -2009,7 +2036,16 @@ "@ledgerhq/errors" "^4.78.0" events "^3.0.0" -"@ledgerhq/hw-transport@^6.1.0", "@ledgerhq/hw-transport@^6.3.0": +"@ledgerhq/hw-transport@^6.24.1", "@ledgerhq/hw-transport@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.27.1.tgz#88072278f69c279cb6569352acd4ae2fec33ace3" + integrity sha512-hnE4/Fq1YzQI4PA1W0H8tCkI99R3UWDb3pJeZd6/Xs4Qw/q1uiQO+vNLC6KIPPhK0IajUfuI/P2jk0qWcMsuAQ== + dependencies: + "@ledgerhq/devices" "^6.27.1" + "@ledgerhq/errors" "^6.10.0" + events "^3.3.0" + +"@ledgerhq/hw-transport@^6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.3.0.tgz#4fc966b1a68c991c0a6b5384841f99c4f8304ce9" integrity sha512-kdnVrgmxrFtKaRdkoaQBEa02RXgLzEBiooYbxA65BGSJig3PGWDS9LrqNpzLTZM1RQlivd9NLBmfwU2ze4chWA== @@ -2028,6 +2064,11 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.50.0.tgz#29c6419e8379d496ab6d0426eadf3c4d100cd186" integrity sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA== +"@ledgerhq/logs@^6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.10.0.tgz#c012c1ecc1a0e53d50e6af381618dca5268461c1" + integrity sha512-lLseUPEhSFUXYTKj6q7s2O3s2vW2ebgA11vMAlKodXGf5AFw4zUoEbTz9CoFOC9jS6xY4Qr8BmRnxP/odT4Uuw== + "@ledgerhq/logs@^6.2.0": version "6.2.0" resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.2.0.tgz#9fb2d6f1811316697f7b3cc14607f6c608912419" @@ -2238,22 +2279,21 @@ dependencies: "@types/yargs-parser" "*" -"@zondax/zemu@^0.22.1": - version "0.22.1" - resolved "https://registry.yarnpkg.com/@zondax/zemu/-/zemu-0.22.1.tgz#378ea193ccc4836ee5407b01028e9030f70a696e" - integrity sha512-WxX65myug9tyQuoXENO4XujDpTY+guQpc+mzN8rggmIwNqleNDe/HmBc5aeTqNyORBCSJkYpUVv3O9q2xcqzrg== +"@zondax/zemu@^0.27.4": + version "0.27.4" + resolved "https://registry.yarnpkg.com/@zondax/zemu/-/zemu-0.27.4.tgz#4e306ba76f5c718d901c7948516668e944a6aa1e" + integrity sha512-bbYAW9JJUx+hVBdwkTonu+0q9WkeFQpcGMRUrzS/Gfc6rvhAQ+X9KrGhwGrnxmBuzajt0oXZ50QvoEJHBR9PDA== dependencies: - "@grpc/grpc-js" "^1.3.4" - "@grpc/proto-loader" "^0.6.4" - "@ledgerhq/hw-transport" "^6.1.0" - "@ledgerhq/hw-transport-http" "^6.1.0" - axios "^0.22.0" + "@grpc/grpc-js" "^1.5.5" + "@grpc/proto-loader" "^0.6.9" + "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport-http" "^6.24.1" + axios "^0.26.0" axios-retry "^3.2.0" - dockerode "^3.3.0" + dockerode "^3.3.1" elfy "^1.0.0" fs-extra "^10.0.0" get-port "^5.1.1" - json-rpc2 "^2.0.0" path "^0.12.7" pngjs "^6.0.0" randomstring "^1.2.1" @@ -2486,12 +2526,12 @@ axios@^0.21.1: dependencies: follow-redirects "^1.10.0" -axios@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.22.0.tgz#bf702c41fb50fbca4539589d839a077117b79b25" - integrity sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w== +axios@^0.26.0, axios@^0.26.1: + version "0.26.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" + integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== dependencies: - follow-redirects "^1.14.4" + follow-redirects "^1.14.8" babel-jest@^24.9.0: version "24.9.0" @@ -2658,11 +2698,6 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -better-curry@1.x.x: - version "1.6.0" - resolved "https://registry.yarnpkg.com/better-curry/-/better-curry-1.6.0.tgz#38f716b24c8cee07a262abc41c22c314e20e3869" - integrity sha1-OPcWskyM7geiYqvEHCLDFOIOOGk= - bignumber.js@^9.0.0, bignumber.js@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" @@ -3274,10 +3309,10 @@ docker-modem@^3.0.0: split-ca "^1.0.1" ssh2 "^0.8.7" -dockerode@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.0.tgz#bedaf48ef9fa9124275a54a9881a92374c51008e" - integrity sha512-St08lfOjpYCOXEM8XA0VLu3B3hRjtddODphNW5GFoA0AS3JHgoPQKOz0Qmdzg3P+hUPxhb02g1o1Cu1G+U3lRg== +dockerode@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.1.tgz#74f66e239e092e7910e2beae6322d35c44b08cdc" + integrity sha512-AS2mr8Lp122aa5n6d99HkuTNdRV1wkkhHwBdcnY6V0+28D3DSYwhxAk85/mM9XwD3RMliTxyr63iuvn5ZblFYQ== dependencies: docker-modem "^3.0.0" tar-fs "~2.0.1" @@ -3416,13 +3451,6 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es5class@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/es5class/-/es5class-2.3.1.tgz#42c5c18a9016bcb0db28a4d340ebb831f55d1b66" - integrity sha1-QsXBipAWvLDbKKTTQOu4MfVdG2Y= - dependencies: - better-curry "1.x.x" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -3723,13 +3751,6 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -faye-websocket@^0.11.3: - version "0.11.4" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" - integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== - dependencies: - websocket-driver ">=0.5.1" - fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -3800,10 +3821,10 @@ follow-redirects@^1.10.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== -follow-redirects@^1.14.4: - version "1.14.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== +follow-redirects@^1.14.8: + version "1.15.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4" + integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== for-each@^0.3.3: version "0.3.3" @@ -4120,11 +4141,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-parser-js@>=0.5.1: - version "0.5.3" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9" - integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== - http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" @@ -5324,18 +5340,6 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== -json-rpc2@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/json-rpc2/-/json-rpc2-2.0.0.tgz#7935199f23cf3665fe6b19b03a85d4a3ea3d94b8" - integrity sha512-0jfrGSH0ZDxrpaaHUkigg/oA6MQqsZDpKSpUzeokhP2jyy6h+cH4G+MPoAa4SVdw9sTzc+YK2hzhUgdShMzKow== - dependencies: - debug "^4.1.1" - es5class "^2.3.1" - faye-websocket "^0.11.3" - jsonparse "^1.3.1" - lodash "^4.17.15" - object-assign "^4.1.1" - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -5367,11 +5371,6 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsonparse@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= - jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -5474,7 +5473,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.17.15, lodash@^4.17.19, lodash@^4.7.0: +lodash@^4.17.19, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5747,11 +5746,6 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -6384,7 +6378,7 @@ rxjs@6, rxjs@^6.5.3: dependencies: tslib "^1.9.0" -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -7234,20 +7228,6 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -websocket-driver@>=0.5.1: - version "0.7.4" - resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" - integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== - dependencies: - http-parser-js ">=0.5.1" - safe-buffer ">=5.1.0" - websocket-extensions ">=0.1.1" - -websocket-extensions@>=0.1.1: - version "0.1.4" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" - integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== - whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" @@ -7380,16 +7360,16 @@ ws@6: dependencies: async-limiter "~1.0.0" -ws@7: - version "7.5.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" - integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== - ws@7.4.6, ws@^7.4.5: version "7.4.6" resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + ws@^5.2.0: version "5.2.2" resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" @@ -7481,7 +7461,7 @@ yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.1.1: +yargs@^16.1.1, yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From af67739aeb54110bbd6aa0d5f67c0b142cb4a75a Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 30 May 2022 14:20:23 +0200 Subject: [PATCH 05/10] Removed unused Jest configuration --- tests/jest.js | 22 ---------------------- tests/src/contract_data_warning.test.js | 1 - 2 files changed, 23 deletions(-) delete mode 100644 tests/jest.js diff --git a/tests/jest.js b/tests/jest.js deleted file mode 100644 index 521ecbe..0000000 --- a/tests/jest.js +++ /dev/null @@ -1,22 +0,0 @@ -export default jest; -export const { expect, test } = global; - -export const sim_options_s = { - model: "nanos", - logging: true, - start_delay: 2000, - X11: true, - custom: "", -}; - -export const sim_options_x = { - model: "nanox", - logging: true, - start_delay: 2000, - X11: true, - custom: "", -}; - -export const Resolve = require("path").resolve; -export const NANOS_ELF_PATH = Resolve("elfs/ethereum_nanos.elf"); -export const NANOX_ELF_PATH = Resolve("elfs/ethereum_nanox.elf"); \ No newline at end of file diff --git a/tests/src/contract_data_warning.test.js b/tests/src/contract_data_warning.test.js index 7047968..c3b06e2 100644 --- a/tests/src/contract_data_warning.test.js +++ b/tests/src/contract_data_warning.test.js @@ -1,6 +1,5 @@ import 'core-js/stable'; import 'regenerator-runtime/runtime'; -import { expect } from "../jest"; import { TransportStatusError } from "@ledgerhq/errors"; import { waitForAppScreen, zemu, nano_models } from './test.fixture'; import Zemu from '@zondax/zemu'; From b937717f121d7ec017f963627260c5ccaff4a66e Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 25 May 2022 18:28:41 +0200 Subject: [PATCH 06/10] Added Zemu tests for EIP-191 --- .../snapshots/nanos_eip191_metamask/00000.png | Bin 0 -> 368 bytes .../snapshots/nanos_eip191_metamask/00001.png | Bin 0 -> 463 bytes .../snapshots/nanos_eip191_metamask/00002.png | Bin 0 -> 423 bytes .../snapshots/nanos_eip191_metamask/00003.png | Bin 0 -> 407 bytes .../snapshots/nanos_eip191_metamask/00004.png | Bin 0 -> 449 bytes .../snapshots/nanos_eip191_metamask/00005.png | Bin 0 -> 407 bytes .../snapshots/nanos_eip191_metamask/00006.png | Bin 0 -> 349 bytes .../snapshots/nanos_eip191_nonascii/00000.png | Bin 0 -> 368 bytes .../snapshots/nanos_eip191_nonascii/00001.png | Bin 0 -> 492 bytes .../snapshots/nanos_eip191_nonascii/00002.png | Bin 0 -> 489 bytes .../snapshots/nanos_eip191_nonascii/00003.png | Bin 0 -> 474 bytes .../snapshots/nanos_eip191_nonascii/00004.png | Bin 0 -> 490 bytes .../snapshots/nanos_eip191_nonascii/00005.png | Bin 0 -> 407 bytes .../snapshots/nanos_eip191_nonascii/00006.png | Bin 0 -> 449 bytes .../snapshots/nanos_eip191_nonascii/00007.png | Bin 0 -> 407 bytes .../snapshots/nanos_eip191_nonascii/00008.png | Bin 0 -> 349 bytes .../snapshots/nanos_eip191_opensea/00000.png | Bin 0 -> 368 bytes .../snapshots/nanos_eip191_opensea/00001.png | Bin 0 -> 475 bytes .../snapshots/nanos_eip191_opensea/00002.png | Bin 0 -> 471 bytes .../snapshots/nanos_eip191_opensea/00003.png | Bin 0 -> 465 bytes .../snapshots/nanos_eip191_opensea/00004.png | Bin 0 -> 449 bytes .../snapshots/nanos_eip191_opensea/00005.png | Bin 0 -> 466 bytes .../snapshots/nanos_eip191_opensea/00006.png | Bin 0 -> 407 bytes .../snapshots/nanos_eip191_opensea/00007.png | Bin 0 -> 449 bytes .../snapshots/nanos_eip191_opensea/00008.png | Bin 0 -> 407 bytes .../snapshots/nanos_eip191_opensea/00009.png | Bin 0 -> 349 bytes .../snapshots/nanox_eip191_metamask/00000.png | Bin 0 -> 415 bytes .../snapshots/nanox_eip191_metamask/00001.png | Bin 0 -> 624 bytes .../snapshots/nanox_eip191_metamask/00002.png | Bin 0 -> 463 bytes .../snapshots/nanox_eip191_metamask/00003.png | Bin 0 -> 499 bytes .../snapshots/nanox_eip191_metamask/00004.png | Bin 0 -> 463 bytes .../snapshots/nanox_eip191_metamask/00005.png | Bin 0 -> 382 bytes .../snapshots/nanox_eip191_nonascii/00000.png | Bin 0 -> 415 bytes .../snapshots/nanox_eip191_nonascii/00001.png | Bin 0 -> 882 bytes .../snapshots/nanox_eip191_nonascii/00002.png | Bin 0 -> 570 bytes .../snapshots/nanox_eip191_nonascii/00003.png | Bin 0 -> 463 bytes .../snapshots/nanox_eip191_nonascii/00004.png | Bin 0 -> 499 bytes .../snapshots/nanox_eip191_nonascii/00005.png | Bin 0 -> 463 bytes .../snapshots/nanox_eip191_nonascii/00006.png | Bin 0 -> 382 bytes .../snapshots/nanox_eip191_opensea/00000.png | Bin 0 -> 415 bytes .../snapshots/nanox_eip191_opensea/00001.png | Bin 0 -> 853 bytes .../snapshots/nanox_eip191_opensea/00002.png | Bin 0 -> 852 bytes .../snapshots/nanox_eip191_opensea/00003.png | Bin 0 -> 837 bytes .../snapshots/nanox_eip191_opensea/00004.png | Bin 0 -> 814 bytes .../snapshots/nanox_eip191_opensea/00005.png | Bin 0 -> 522 bytes .../snapshots/nanox_eip191_opensea/00006.png | Bin 0 -> 463 bytes .../snapshots/nanox_eip191_opensea/00007.png | Bin 0 -> 499 bytes .../snapshots/nanox_eip191_opensea/00008.png | Bin 0 -> 463 bytes .../snapshots/nanox_eip191_opensea/00009.png | Bin 0 -> 382 bytes tests/src/eip191.test.js | 65 ++++++++++++++++++ 50 files changed, 65 insertions(+) create mode 100644 tests/snapshots/nanos_eip191_metamask/00000.png create mode 100644 tests/snapshots/nanos_eip191_metamask/00001.png create mode 100644 tests/snapshots/nanos_eip191_metamask/00002.png create mode 100644 tests/snapshots/nanos_eip191_metamask/00003.png create mode 100644 tests/snapshots/nanos_eip191_metamask/00004.png create mode 100644 tests/snapshots/nanos_eip191_metamask/00005.png create mode 100644 tests/snapshots/nanos_eip191_metamask/00006.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00000.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00001.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00002.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00003.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00004.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00005.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00006.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00007.png create mode 100644 tests/snapshots/nanos_eip191_nonascii/00008.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00000.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00001.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00002.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00003.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00004.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00005.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00006.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00007.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00008.png create mode 100644 tests/snapshots/nanos_eip191_opensea/00009.png create mode 100644 tests/snapshots/nanox_eip191_metamask/00000.png create mode 100644 tests/snapshots/nanox_eip191_metamask/00001.png create mode 100644 tests/snapshots/nanox_eip191_metamask/00002.png create mode 100644 tests/snapshots/nanox_eip191_metamask/00003.png create mode 100644 tests/snapshots/nanox_eip191_metamask/00004.png create mode 100644 tests/snapshots/nanox_eip191_metamask/00005.png create mode 100644 tests/snapshots/nanox_eip191_nonascii/00000.png create mode 100644 tests/snapshots/nanox_eip191_nonascii/00001.png create mode 100644 tests/snapshots/nanox_eip191_nonascii/00002.png create mode 100644 tests/snapshots/nanox_eip191_nonascii/00003.png create mode 100644 tests/snapshots/nanox_eip191_nonascii/00004.png create mode 100644 tests/snapshots/nanox_eip191_nonascii/00005.png create mode 100644 tests/snapshots/nanox_eip191_nonascii/00006.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00000.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00001.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00002.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00003.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00004.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00005.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00006.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00007.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00008.png create mode 100644 tests/snapshots/nanox_eip191_opensea/00009.png create mode 100644 tests/src/eip191.test.js diff --git a/tests/snapshots/nanos_eip191_metamask/00000.png b/tests/snapshots/nanos_eip191_metamask/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..ab16f62bfcfb15701d788a6a84fe55001d152730 GIT binary patch literal 368 zcmV-$0gwKPP)m1gYoarBO3LH$euV2HeiC{**okfHIi+m$sv2p+{O|Q}I5aNh^Ys5dP#v zj%1qABdJ+S6K!y2Hbl8uvs5Q~cSHZe-9%(GG&6lVhU>>5GXsQK^2D%BBCpwrIq!n_ zbF$#pv0JKROAs&1vS|{M6`m6<_23d_XsOOAL5k@8zo4r@s|o-B(!2ofEx#wWs1tqw O0000MaU92SR5*`t9v2czV|X*7BvxgO z)p+ZvUYGL-uTN3<`uzV)UX(wBJ~&{Iaqz+-DJeaLDamgLY-*-R{vnH4-lM9jf!c0Z zW(TB_^bJjm!dYmTEbNp>H>H5d0)RioL&_xJL%+#x*1e1;tlet>H^A3mCU^5fdvRf~^Fux$cn{KwhX0c0r{CWT}dOP@do{nOCcdxzI`4*IM{X z(+=@)+0baZ)i*pXCfVP#10*4_ zb})?2Qi4;iiq{~_r}BO6jb^%WahCib^CWx$9LI5<%NLSnLSpuqiy>kU=~#TZ3V6h&d-ea!o0ERxQIK0r5|1-|8U z_`@f?F82OCybtn>zGY+f1o*|}hFaJ}Eva6Ajo;Kn6MaCN(B3IU#~G0*w9F0&E#bN6tRh{PX$qPz!L z&z2-%L#|DKhC!3CvqPQ8j%tcd$*e*1Skq3In;H^kC6uo~pR56Ep zGQ7@O5AzNnvKDJXldQAuM{N~T9zhR>?f~@YrjRh-15(tU`sG>QLq$=PZoYT}NH|@ zz8wshkB{~MB4`H0-uM*3M1j}m%A!300N{kCpu~9KJs1LQ1E{7`qHO>OJQ#XfRy9Bv z^==(ieYk597RD@{OEdS6GT+Lmuf_h$vek1^KVM4p7nbmHWt7bot=9>X{;(33tDmYc z&D9U$Wf)T#sV`+WTVz^Qo=ISYs`0?ozXTD=g%{*$&h`n6Q%*!K%L9vjA?<}S_3O~y z51_40w#ON-)XL64x@JligSXK^F9>U5TpZCDR;l1-dd45KJ?)^knt8<|^tT^?&`+$? zRq8>0Bcb3GkI=CJNF3=@I3K*Rlqo0JRixhcTL&d5MMji-{W*PXyu+hM-x=UTI}_BI zGx^;Gypw%}(Vkv=s~wl1InZ7QJjtlNRl_ihQog8p&yJp0VZ8tV002ovPDHLkV1iJ- Bw$=au literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_metamask/00004.png b/tests/snapshots/nanos_eip191_metamask/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..d55782f429e629a5ae929916914befa14613edba GIT binary patch literal 449 zcmV;y0Y3hTP)9Z)nZ zoKdfPKxBZtOD`O!Ud7)^nCSVm48R~fHVz_gJJ3!JB$;A z73W%!0pdWH0?92?e|oM4;Hw|TH|@ zz8wshkB{~MB4`H0-uM*3M1j}m%A!300N{kCpu~9KJs1LQ1E{7`qHO>OJQ#XfRy9Bv z^==(ieYk597RD@{OEdS6GT+Lmuf_h$vek1^KVM4p7nbmHWt7bot=9>X{;(33tDmYc z&D9U$Wf)T#sV`+WTVz^Qo=ISYs`0?ozXTD=g%{*$&h`n6Q%*!K%L9vjA?<}S_3O~y z51_40w#ON-)XL64x@JligSXK^F9>U5TpZCDR;l1-dd45KJ?)^knt8<|^tT^?&`+$? zRq8>0Bcb3GkI=CJNF3=@I3K*Rlqo0JRixhcTL&d5MMji-{W*PXyu+hM-x=UTI}_BI zGx^;Gypw%}(Vkv=s~wl1InZ7QJjtlNRl_ihQog8p&yJp0VZ8tV002ovPDHLkV1iJ- Bw$=au literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_metamask/00006.png b/tests/snapshots/nanos_eip191_metamask/00006.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_nonascii/00000.png b/tests/snapshots/nanos_eip191_nonascii/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..ab16f62bfcfb15701d788a6a84fe55001d152730 GIT binary patch literal 368 zcmV-$0gwKPP)m1gYoarBO3LH$euV2HeiC{**okfHIi+m$sv2p+{O|Q}I5aNh^Ys5dP#v zj%1qABdJ+S6K!y2Hbl8uvs5Q~cSHZe-9%(GG&6lVhU>>5GXsQK^2D%BBCpwrIq!n_ zbF$#pv0JKROAs&1vS|{M6`m6<_23d_XsOOAL5k@8zo4r@s|o-B(!2ofEx#wWs1tqw O00006LwR*|Yf6fo2|!!QiP=+AY!>nuoSD#O*_l3{AU z2F?3iuG1Z#vT)WxdCz$bCM?n~UfG0_+$c#-o+x&FmN{!T`~t!}fWihmvYFBnU&GC iHU}7nVHk#C7=kZ=)>zdthta420000 z@m&|&>(e-Pxt%COFx3G`$y0e}SEOjGiUr$V(++DhoC@Hx&%0tn>~eY~D=orYm8TAC zoB&M0UoMFfWjwWMM*JCw{tifInJY;sDTbU4(gi8Mp7OYKE-TtCd+8p9dYDmyZ4d z*6sE#-+n@R)80{X2Px1K;e(m@ohWoid>eTahQ+cJxgdjdI~4DW+O+H~ljJL-{^OzB z%hTkn?&4&R5WzQ7bJKaxn)?gy*a8P%CZW08jAce+7!8vvI>C5PwD3F%VD`s>~nF(@!7} f2m}Iwzz^XKS+88*y!L||00000NkvXXu0mjf@D19* literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_nonascii/00003.png b/tests/snapshots/nanos_eip191_nonascii/00003.png new file mode 100644 index 0000000000000000000000000000000000000000..fcd68b2ff0dd294d869ba59869833833ab338336 GIT binary patch literal 474 zcmV<00VV#4P)Wb~JX@k{_&;UC2@s_<{Z!umi#mryXP`NRcI7~bD&3cP)=rEde zAq(c&$&J5m%U@}4oV3xR*O^c>}^#9 zd;F}~=HxbfdPf(}t~sYy(7YtYR+1H0zOMA0imnv!kRP{Fv>&EO1=iSex1EGdykA2d zy|^;_Xk@Y078W5mVBfTL06V1$Pm4N&8>$3{yzsA!MlENZqDxr(8HcqOWcUeJC`YS7I1@){sWIgaBvj^j9lH!=KV$FT{N QIsgCw07*qoM6N<$f_S6fk^lez literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_nonascii/00004.png b/tests/snapshots/nanos_eip191_nonascii/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..251c562bb48fde4f7c038b5bb7b48ecf11927c88 GIT binary patch literal 490 zcmVhh zT`ZL$-Dt4{F1l^~wt|eCK{pzIh5K gI2;a#!||K=2jD|uwtM20uK)l507*qoM6N<$g1g?{yZ`_I literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_nonascii/00005.png b/tests/snapshots/nanos_eip191_nonascii/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..f5c2d6774a86d59f5cad0974eb03748765433d08 GIT binary patch literal 407 zcmV;I0cie-P)H|@ zz8wshkB{~MB4`H0-uM*3M1j}m%A!300N{kCpu~9KJs1LQ1E{7`qHO>OJQ#XfRy9Bv z^==(ieYk597RD@{OEdS6GT+Lmuf_h$vek1^KVM4p7nbmHWt7bot=9>X{;(33tDmYc z&D9U$Wf)T#sV`+WTVz^Qo=ISYs`0?ozXTD=g%{*$&h`n6Q%*!K%L9vjA?<}S_3O~y z51_40w#ON-)XL64x@JligSXK^F9>U5TpZCDR;l1-dd45KJ?)^knt8<|^tT^?&`+$? zRq8>0Bcb3GkI=CJNF3=@I3K*Rlqo0JRixhcTL&d5MMji-{W*PXyu+hM-x=UTI}_BI zGx^;Gypw%}(Vkv=s~wl1InZ7QJjtlNRl_ihQog8p&yJp0VZ8tV002ovPDHLkV1iJ- Bw$=au literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_nonascii/00006.png b/tests/snapshots/nanos_eip191_nonascii/00006.png new file mode 100644 index 0000000000000000000000000000000000000000..d55782f429e629a5ae929916914befa14613edba GIT binary patch literal 449 zcmV;y0Y3hTP)9Z)nZ zoKdfPKxBZtOD`O!Ud7)^nCSVm48R~fHVz_gJJ3!JB$;A z73W%!0pdWH0?92?e|oM4;Hw|TH|@ zz8wshkB{~MB4`H0-uM*3M1j}m%A!300N{kCpu~9KJs1LQ1E{7`qHO>OJQ#XfRy9Bv z^==(ieYk597RD@{OEdS6GT+Lmuf_h$vek1^KVM4p7nbmHWt7bot=9>X{;(33tDmYc z&D9U$Wf)T#sV`+WTVz^Qo=ISYs`0?ozXTD=g%{*$&h`n6Q%*!K%L9vjA?<}S_3O~y z51_40w#ON-)XL64x@JligSXK^F9>U5TpZCDR;l1-dd45KJ?)^knt8<|^tT^?&`+$? zRq8>0Bcb3GkI=CJNF3=@I3K*Rlqo0JRixhcTL&d5MMji-{W*PXyu+hM-x=UTI}_BI zGx^;Gypw%}(Vkv=s~wl1InZ7QJjtlNRl_ihQog8p&yJp0VZ8tV002ovPDHLkV1iJ- Bw$=au literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_nonascii/00008.png b/tests/snapshots/nanos_eip191_nonascii/00008.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_opensea/00000.png b/tests/snapshots/nanos_eip191_opensea/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..ab16f62bfcfb15701d788a6a84fe55001d152730 GIT binary patch literal 368 zcmV-$0gwKPP)m1gYoarBO3LH$euV2HeiC{**okfHIi+m$sv2p+{O|Q}I5aNh^Ys5dP#v zj%1qABdJ+S6K!y2Hbl8uvs5Q~cSHZe-9%(GG&6lVhU>>5GXsQK^2D%BBCpwrIq!n_ zbF$#pv0JKROAs&1vS|{M6`m6<_23d_XsOOAL5k@8zo4r@s|o-B(!2ofEx#wWs1tqw O0000SyQLV>f``qQOXbqPQ!xHR|COsXOA0SyCJd8p>4D$G9G01l`_(uRqI zm-0Bm&=LeaYiYtkEafR_*d`q3*-+7p*k<53^!1u%AOyTIcM4XSqhdgXLp08%+! z=q2-`B8L>iaS;F>zm;Y{ zj&!821jz#B0i?eyMp+k`@-*5>54HRek%oSDznJODGUXpK{{#vm*lAeRXW1z!`B~Xjy zoAGI8WQapZ2;I@an8mpTOzf3HSkd@SvJ9DX?dY4Tu2=hTU(oHz5rZ; zcW&Y(@^ngKy8r2NR&_DJ_We(W`h=ted`L_r*}!=os@dXs5;KouA3XpLFc_Pq!grT) zn$-`3T@YSb%OM;DmxX1hPTUvOlax!H_A}V1OL_*z6WcCOy`e$Xo>ouuZ9Wstoi4QZ z0rtu`Kg?*?n!p2a8;s;pUT8Tk7TInCC2DvXLa4|LcN@FrYMmlFqHW~3gGX)07UdM79NJ?6+R3ma-P@KPV zRAMn*27p6YZ76Wizk)I-0{JC5TxgdZ#1P&dd|R&4+P N002ovPDHLkV1k+Z%<%vK literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_opensea/00003.png b/tests/snapshots/nanos_eip191_opensea/00003.png new file mode 100644 index 0000000000000000000000000000000000000000..582648da56a7d94ec933c29542bffe0905921119 GIT binary patch literal 465 zcmV;?0WSWDP) zt}Y19tmP6;g3E$+s7~0I)C+QYwA1U>*y|&`0ppEruW))pgQ^EEUimmLfaXpY+WQ&y zlW~3+Yu6gU9}sKc$zOS)<@lZCjVYe(9&Rv+jS=;m(XVjA>E(}IPaH;hEA%kNJ=8qJ z*e!5MI1_~vsE~bIHAFq7U0k%YsIazS7xsvwQeXewA)SC?)KixjRY}!~15|7fXgvYr znz$&h3ZN!AG*WL;Wh{vO4N|N>h!d6DRnb5ptI9k@Q$|DYMCA#fpLg&U(z8edy#vv1 zl71nuT}wq$Ur?y1qV^PRnEEZ{Zk)RTgm6L5!~z6C5ZsqH@5oSV+{|q600000NkvXX Hu0mjfC5O-K literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_opensea/00004.png b/tests/snapshots/nanos_eip191_opensea/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..53e131782764371604e832ef97bbf7abadd774d6 GIT binary patch literal 449 zcmV;y0Y3hTP)>A zCic^4-VGqNf4sisQZUBV07V7)Yn4^9g&QR-eZ1VIFEK07bgE*m6!8~<~AO{WhFIm124^q rjn^$wHITeD_#eVS5ClOG1e@^zhU7M@71qgk)t^U7DQ&yf(v0)? z9rv=~g4nk0;A!sYz>kyO(cum)z1%Q9dQU(OHxirrEo_l`EzRYN>=AeiFW@b2zo+Uv z{(n%X^0YR?tbnqG=VeLQsFT1I!u;dr^pYkMkasqo6G#i$^!OggGY{81Rpxp0HUPn2 zMU-IN_PIPx=$e8`&ssL&B&4iThU+ZHl1AY#%4E=XbKE5H)xo%9+Xbq3G^l#e$1^YI z3DDB%M6sWNuZ-gZtexu*d;u{BJ^89EG#xLTtUvaip(dyQ`+RQFry5}YT3#F6`#!vX z5QAqWSQ~(4cl{7#8IcU9oS`fR7<*+&MNbQ)@}Vvu3Ex((H`@E^hAA!e7Hf}E1dMtT zT=&AtUM_{}<}D?aXg&e1ANedgr3x#Q@uyQYR4;I@V89=hRzO*l=hx}gCamNisk+G< zB}r&%mVv!^QsUn&l%grW=!0K~jS;+681jS6O2h;NK@hCV6S?wCq3f%xlK=n!07*qo IM6N<$f*F9@#{d8T literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_opensea/00006.png b/tests/snapshots/nanos_eip191_opensea/00006.png new file mode 100644 index 0000000000000000000000000000000000000000..f5c2d6774a86d59f5cad0974eb03748765433d08 GIT binary patch literal 407 zcmV;I0cie-P)H|@ zz8wshkB{~MB4`H0-uM*3M1j}m%A!300N{kCpu~9KJs1LQ1E{7`qHO>OJQ#XfRy9Bv z^==(ieYk597RD@{OEdS6GT+Lmuf_h$vek1^KVM4p7nbmHWt7bot=9>X{;(33tDmYc z&D9U$Wf)T#sV`+WTVz^Qo=ISYs`0?ozXTD=g%{*$&h`n6Q%*!K%L9vjA?<}S_3O~y z51_40w#ON-)XL64x@JligSXK^F9>U5TpZCDR;l1-dd45KJ?)^knt8<|^tT^?&`+$? zRq8>0Bcb3GkI=CJNF3=@I3K*Rlqo0JRixhcTL&d5MMji-{W*PXyu+hM-x=UTI}_BI zGx^;Gypw%}(Vkv=s~wl1InZ7QJjtlNRl_ihQog8p&yJp0VZ8tV002ovPDHLkV1iJ- Bw$=au literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_opensea/00007.png b/tests/snapshots/nanos_eip191_opensea/00007.png new file mode 100644 index 0000000000000000000000000000000000000000..d55782f429e629a5ae929916914befa14613edba GIT binary patch literal 449 zcmV;y0Y3hTP)9Z)nZ zoKdfPKxBZtOD`O!Ud7)^nCSVm48R~fHVz_gJJ3!JB$;A z73W%!0pdWH0?92?e|oM4;Hw|TH|@ zz8wshkB{~MB4`H0-uM*3M1j}m%A!300N{kCpu~9KJs1LQ1E{7`qHO>OJQ#XfRy9Bv z^==(ieYk597RD@{OEdS6GT+Lmuf_h$vek1^KVM4p7nbmHWt7bot=9>X{;(33tDmYc z&D9U$Wf)T#sV`+WTVz^Qo=ISYs`0?ozXTD=g%{*$&h`n6Q%*!K%L9vjA?<}S_3O~y z51_40w#ON-)XL64x@JligSXK^F9>U5TpZCDR;l1-dd45KJ?)^knt8<|^tT^?&`+$? zRq8>0Bcb3GkI=CJNF3=@I3K*Rlqo0JRixhcTL&d5MMji-{W*PXyu+hM-x=UTI}_BI zGx^;Gypw%}(Vkv=s~wl1InZ7QJjtlNRl_ihQog8p&yJp0VZ8tV002ovPDHLkV1iJ- Bw$=au literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_eip191_opensea/00009.png b/tests/snapshots/nanos_eip191_opensea/00009.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_metamask/00000.png b/tests/snapshots/nanox_eip191_metamask/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..1b271542d4bdb2b420bf296e4efb75129bcde20b GIT binary patch literal 415 zcmV;Q0bu@#P)5YKJ%(KU&1ONcAAJx@!`E?Y1^<~WN}zCyXs#X zo?o6k@9c|LZskJhD8km*o@uZbHa}-B?&(7HD5C%IYmwHRbJ)2) z`V`bZme<8JnX>F>hL3vOBL0b~>J+pM|9!ySI57nP0000WkROv_^0k3i)wKWs002ov JPDHLkV1lAe!YTj& literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_metamask/00001.png b/tests/snapshots/nanox_eip191_metamask/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..58f060626179693a40fbd8ebe172a55ee552d996 GIT binary patch literal 624 zcmV-$0+0QPP)0`;d{4QW3j_ock`M?Xgb+dqG3V=);*`>L5M!*3 zyn*l22E3i0(*}f;QjGCl{>9XNe5J+MNHO?$vL${q;BrljQT0^etb8Q?5rp6KbFd0C z&S!wi?F*0@c?|NAMn7T|W*iPcUVPL-Bv*RwxNGrBSJomSBPV|v}pRwN^TJgTAsZYt}Th%Kg=3yaxKw|Ey;g2`gF%`v^M~t(O7h_ zH>s{!A`O$3M_RbUT8j^}YG2*jXNKHtz@oOXaBl{*_aN5--g?%yQ}CW^piAnS#{KXh zmKLte0QJ_5V9tCS+I!b;kADjZA%qY@2qAi<1<)ust$A*~1i00000005j&Ypu2Jj^YWw zy90QoT&ZuaQvl6=DP?aYPf1pQ*$k63`;x8zO;>}w*_U($&=hOZQ)gd9es%|NhM$F! zW?$0X0Zo_gyxGq!-I5;w002`g?B41@dShn48j^qcKMg+SRb@~2kiDXt9?G(zZ_&4C zhfSe&Es>ja8l-41$VME{IyOzQ?Ue@1yRzZ^H{)W~!1tfC>juYNH#BJt?4%T&zcu@I zbg0WXI2uYRp~7D9ao)DXaZq_zsB{W|%4eW}Iz^4!e zUu_N6PY6z&;*%m4K>3kw6W0ds>@{hh*gX9g;)ZTl>^=Ari<1<)ust$A*~1i00000005j&Ypu2Jj^YWw zy90QoT&ZuaQvl6=DP?aYPf1pQ*$k63`;x8zO;>}w*_U($&=hOZQ)gd9es%|NhM$F! zW?$0X0Zo_gyxGq!-I5;w002`g?B41@dShn48j^qcKMg+SRb@~2kiDXt9?G(zZ_&4C zhfSe&Es>ja8l-41$VME{IyOzQ?Ue@1yRzZ^H{)W~!1tfC>juYNH#BJt?4%T&zcu@I zbg0WXI2uYRp~7D9ao)DXaZq_zsB{W|%4eW}Iz^4!e zUu_N6PY6z&;*%m4K>3kw6W0ds>@{hh*sAjk5Y(@*V#~rbuHu`7A_H&AxgwHf8y4cdKvg$JbB4n%ez%sZ31aBYd&Oo@(7)_WJ(Znl2o8^PD` zFE`_Y-IS+Kdq0Q2-7r_C=}F(5ev`U`H~)QH|9$1FHE$YjoVax+e0xei%S`SAGlOm! zp7{T3NA-mVOYb&rdU8MdyIHo@@7cE*uj@I+Zu{2i)KMSV-E~o5YKJ%(KU&1ONcAAJx@!`E?Y1^<~WN}zCyXs#X zo?o6k@9c|LZskJhD8km*o@uZbHa}-B?&(7HD5C%IYmwHRbJ)2) z`V`bZme<8JnX>F>hL3vOBL0b~>J+pM|9!ySI57nP0000WkROv_^0k3i)wKWs002ov JPDHLkV1lAe!YTj& literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_nonascii/00001.png b/tests/snapshots/nanox_eip191_nonascii/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..93eda35385a2312963bba2b12c1c5f518b17e39f GIT binary patch literal 882 zcmV-&1C9KNP)6Q%z zf)wUGA>CWet#3eEQ!r9yz`f=3!!`u2FToi$3!gig*k@On+X`8ta#<7d&sI36vo{=BKe17GS$g$0&k)*i~Ca0 z_OsZ@q9zt^F&b~M3DY_ZsP}GdC>g%zRQ(ucO2`b6TG!jX&fmHRq^#WB<)3*Iz8UX4 zS`=f~F5$52skdE1#}X@9Obzx5`Z1M4KlM&=beD}{Q(r&pIZYKpbO`j3M8!b;C4@pL}#kPAEHl@Du$ zWklK1>jobe_ah3cA;C>}P8j&zYJ{c>d{}NhC)Vl(0g@Y zTIZX`sXoAN=qllnzIA!A_h5P=_Wxbq2h53@DL~D~JTm(PUvMJtnt%sUR=r7XDJvsk z0+i%CDu~nB*-KNRY{_%r)@7lK`$zirQxru}6h-lyP}R@|xwXQQx|j-Gk&4sK&FB_2 zAqp)qiU7$iqUgwdo^r)i(%vFgS3ZPKA#49dDN#&K*JW=LIXIVY!daKSrI$u8n~6WT zGns_nu6Z%Yr3rv3l{^joj2ZcgP{Eyx-i%x^et=EDVvuApE^!G@#7mTsiKux$FI7XA z24#h)IgK;{p#Yh+2SB6loa?e7O2!WrR#L1eilQirqA1?Ne?C3o5S)?U3jhEB07*qo IM6N<$f;&B*c>n+a literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_nonascii/00002.png b/tests/snapshots/nanox_eip191_nonascii/00002.png new file mode 100644 index 0000000000000000000000000000000000000000..873634efa0bd3de936624c6dbdec7f3c5b33077f GIT binary patch literal 570 zcmV-A0>%A_P)T=mewjbsv>P0nqkEo-p3+2T8CC8O&O=C%~ z%Go`NM^8Z6P^wbRZ0nNq#UXUB+t?=R?L0&8(2TL<1gMk|8z-Yy$953|CX6o4sWPsF zaN-xBc0Q^jk~_T?E^l5bWp5=^b(~^()+x~4tE_TCm%2AqhX1i?Jk`x%D!tT~th)^2 z!%+1Es5j@>C2SX}-Q@_??maiC+I^qEdJie3=7M$llX;gC@{+>;`VNTNwt?F}(gi(C z&jkShfRoufzzE$uIZ-t?SsL4crVKIdVI1xNS9Uj&Q9JJ*`MuivQtfrOQ;ce@YAZk6 z=|44mv`u)%HW`v`3qxbG>Q3G;Qi{(7d0dcR{h41nP8VT2tKKZsFXsVf7r>vCznl3g z^DI@p+oDuuQDlPJ)<`wcj9Hp4jVF)t)B+g)MhqH%EvG$Tbal>h9nbv_C^RQM#4kIy z!j_B2rVT@H4bkwPc8O|EnzoamJr9un{t%rBL+wa<;10Nu_j3>O2hkN7^&dl#8ucHB zHP{JWXeSpUvj$5+UH||9000000000000000000000Dxuu0&U>+zsop!Qvd(}07*qo IM6N<$g7=g90RR91 literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_nonascii/00003.png b/tests/snapshots/nanox_eip191_nonascii/00003.png new file mode 100644 index 0000000000000000000000000000000000000000..c9da92b60a9314d8252cfcd68c1cd10acaf07bb1 GIT binary patch literal 463 zcmV;=0WkiFP)i<1<)ust$A*~1i00000005j&Ypu2Jj^YWw zy90QoT&ZuaQvl6=DP?aYPf1pQ*$k63`;x8zO;>}w*_U($&=hOZQ)gd9es%|NhM$F! zW?$0X0Zo_gyxGq!-I5;w002`g?B41@dShn48j^qcKMg+SRb@~2kiDXt9?G(zZ_&4C zhfSe&Es>ja8l-41$VME{IyOzQ?Ue@1yRzZ^H{)W~!1tfC>juYNH#BJt?4%T&zcu@I zbg0WXI2uYRp~7D9ao)DXaZq_zsB{W|%4eW}Iz^4!e zUu_N6PY6z&;*%m4K>3kw6W0ds>@{hh*gX9g;)ZTl>^=Ari<1<)ust$A*~1i00000005j&Ypu2Jj^YWw zy90QoT&ZuaQvl6=DP?aYPf1pQ*$k63`;x8zO;>}w*_U($&=hOZQ)gd9es%|NhM$F! zW?$0X0Zo_gyxGq!-I5;w002`g?B41@dShn48j^qcKMg+SRb@~2kiDXt9?G(zZ_&4C zhfSe&Es>ja8l-41$VME{IyOzQ?Ue@1yRzZ^H{)W~!1tfC>juYNH#BJt?4%T&zcu@I zbg0WXI2uYRp~7D9ao)DXaZq_zsB{W|%4eW}Iz^4!e zUu_N6PY6z&;*%m4K>3kw6W0ds>@{hh*sAjk5Y(@*V#~rbuHu`7A_H&AxgwHf8y4cdKvg$JbB4n%ez%sZ31aBYd&Oo@(7)_WJ(Znl2o8^PD` zFE`_Y-IS+Kdq0Q2-7r_C=}F(5ev`U`H~)QH|9$1FHE$YjoVax+e0xei%S`SAGlOm! zp7{T3NA-mVOYb&rdU8MdyIHo@@7cE*uj@I+Zu{2i)KMSV-E~o5YKJ%(KU&1ONcAAJx@!`E?Y1^<~WN}zCyXs#X zo?o6k@9c|LZskJhD8km*o@uZbHa}-B?&(7HD5C%IYmwHRbJ)2) z`V`bZme<8JnX>F>hL3vOBL0b~>J+pM|9!ySI57nP0000WkROv_^0k3i)wKWs002ov JPDHLkV1lAe!YTj& literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_opensea/00001.png b/tests/snapshots/nanox_eip191_opensea/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..802fad56d37a5496b01e613af00acd1b784e63aa GIT binary patch literal 853 zcmV-b1FHOqP)@~p&BKdi-~k#ki13!%WXI4deZD{d}ge| z*qn{16D|SBCm(hqqCGu#Tr(~I34mRTWl`^HfU#BkMhqnSrF|Bg#Vqm`KzJ%-6GT<( zA1PO=ZVy#~wGDMEi@r~X0{B5M**bPnQbV<7zjk&$uv_ap0z6pqMzJU@GTv;%D&yM& z;JWKsvZb;sWxrNZQI<%EsfeT_&oW9mtUv|$tsDVHFSBn>_7S9|K8{800s7IM|}e3M$s>&}Mm#%jyRdBKsR8#YatSH>d(%+2+sMXX51U5)CjsU+VON1Mf4R_5Ur$Q5Txgh(I z$GpB11BEX+6`F`t#A5130Ql@jvzWF2yeN7TTPUfPZb`cGLf2EFd$HWO4t0;=1D2k#emh&gk)_vd4 zFReAHWjptM5103}x7K=x-Ukj(;cud?^MMZSUPkQ?(95kg_$Tcg;V02n=Lr*bp=?Y! zS}xgZY-ft}uU!8QS$YC`(6OFE9)T_Gmy0+E_R*(+A^&#SC|M36h)NW^I7m zgNf&wy;F?y6<3ndh1%5Vwq$dB0@6e8tu<-jE1R^Zdr4>@`_^DLIOzOAZ*QNA=;ZSL zG8k8v_ZL%pu#?I{I~h2+_FyVb_s-rGNvJpk<8AZm6=ZqsaPM1)2t-yXLQx`N2dVmZ z6fd-HQuIr@HhlrcQN5>P2Q32%P{BJ1Y#RMO6gZ{MZsQL9(jjUpEw4VN@nkRkZYUcy zFu2^eSB?cpTjH2K65xwAVCvn4#U@<<9kt-AxRj-8=wglYzy(l3CxAY1q=ygt5LWV! zBwo5@PSl4TMU&D{k)?gQA0m=)h3EX3Xx5o}$fi-M9KsmPyF?WUNbBBgEzRfxmSd#R-&JG%*e-;@(z zKfm@-5kXX10CWxfY5WL25tpLX0f~vlVhTP~9QHpeD|W;bl=~e`i>b&&RJ5_ocmjh; zI8i=auSDuI!d!36`!h&;2rF1jQSDH2A8lksN;ISAG58)`#6ABwihN2!cTi&7W@-b9 eq9}@D6aN4>tGTwWostLu00003`I#QH}UFRtt2 zQvRL$zN<6Mw}RZOx325Ld0O!(J_Bu?4+v-lq_?{uCuzjbSD>v%9VVos1@2w1|hTGoVdvGEyK|eTpzz`#f?L?N*sAr~S%()+;G!HYx5#ey8d=REUORxLql+`%nj{gDAH)u5ZSLBA0@ z`<9^cJJ^LmEu?Vk0I)_@0cy9@3yg!57n)(K09_*VkWk8Bub*e_0}foHB6q@@;oe7+ zBuSFpY?e?|p=r*-gf(Zwhu?y@`X2iXbT)i!BUYo2>M&l94;TEY4vxOQHsl@3)cRM8J6A%p6GT&c=dDWb=?ab4}h=ui!JY1M&D z;kD(8U27}LdZJ%Bhe`#yw4?)Yla75v&-FndumddKsEVNQ?CLd3kViIUsii^MS1UDo zU7~KgWb8+cN$&|TSCA0OwiRQO P00000NkvXXu0mjfmobDs literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_opensea/00004.png b/tests/snapshots/nanox_eip191_opensea/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..eab9f1d489e914195b0f28fae10625d1802d26c1 GIT binary patch literal 814 zcmV+}1JV46P)WgU0~?00000z;eC)%cT1N{OV?s31*Q0W5jM%F3vhdDGqM zT{Ml8jq42J15hR(HWAe`y>#3)d23fnj$j|5o_T#WBwd@W!kLwVOuv(#l>DPZGL?UX zWm+R`S4Lu83Oeq|u1spBL`nk08rucwUGcByHHlqw9|sAE5+S8kNY{gW);=I=+6GSl z$er+Fr1wz(005hbdQa%Hvr^1?5Vi0!ZfAC@L9^qXy553xO}y4VSs9&}a_+)NN0NPK zE9rLFoAvafbV_a~<|U0)yYxb~LWdo5C){Vs-1;igp<>D}3%aC;z}3C?+2A+MPT20; zs7!ya78Iq*25y%o3B~%kV{518DduNM5q_i-y>M%E1^8E=k{qRIlcNG<#I>Eetw*Qy z_ehK!)kE9Usp2JbDg3Do<{>&6-d_geYIuJ!h`~;fg?3^%88Mj3Qupe@!(s*xa?_3U zYq#YU%nN|iphw>6?r|`*L!YIv`d_{_HXV1(>w?t|6(KY4uzgnY z#EwF}FVa>~VVf>y@E|F|$w)rwJHVOB%L3r~zRYLAth0t!K7^G+C?cIcK}prwwgRLl ss`EgqdnuUd#jm*n000000Pt3R0a$Qy>tzDFPXGV_07*qoM6N<$f(VR)`v3p{ literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_opensea/00005.png b/tests/snapshots/nanox_eip191_opensea/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..0b4bdbd98ccf3f72a060e4b0c5fb192c849418e5 GIT binary patch literal 522 zcmV+l0`>igP)(Y^%m5cW=uhAqiEo}2D=s@d#V3zu;T7DOK7Xv3hhbH zm)c+C`{ZPy+TEs7Laf>n{|HK>x=nwI@{@3>FM8d;bl?g{Q&91{vop+G-0HGAgeUhZ)z;dFJ=on1UuBcjc!}{^=t!)uNlmXctFV;`Avf zhju5ZJC;@|5Tlt>h}q4})Y@Cx@-EwJFJeiC&(fu4o4RXGpMq}ZX*tUICVZIIc@zKu zp2)B|xqb+T_>aDX6}Jeg2Wj45cf^ z;l*|6z+}9iOhJ2hfcsD)a#sVn)cADGRgZaQm+Y#B29K363!Ft47n%A=@&NBwiqNlW z=e5(d?%R<&z-8a*3V~Ug?yDePD%8VHK7`GL({i;gXp3GtDZQ-HpyPAm;)7|5jQYng zq(=S2um*QR7P^yx$gIIukQV>|00000000000000000000003YczYvwlj>9mIv;Y7A M07*qoM6N<$f`&Er1^@s6 literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_eip191_opensea/00006.png b/tests/snapshots/nanox_eip191_opensea/00006.png new file mode 100644 index 0000000000000000000000000000000000000000..c9da92b60a9314d8252cfcd68c1cd10acaf07bb1 GIT binary patch literal 463 zcmV;=0WkiFP)i<1<)ust$A*~1i00000005j&Ypu2Jj^YWw zy90QoT&ZuaQvl6=DP?aYPf1pQ*$k63`;x8zO;>}w*_U($&=hOZQ)gd9es%|NhM$F! zW?$0X0Zo_gyxGq!-I5;w002`g?B41@dShn48j^qcKMg+SRb@~2kiDXt9?G(zZ_&4C zhfSe&Es>ja8l-41$VME{IyOzQ?Ue@1yRzZ^H{)W~!1tfC>juYNH#BJt?4%T&zcu@I zbg0WXI2uYRp~7D9ao)DXaZq_zsB{W|%4eW}Iz^4!e zUu_N6PY6z&;*%m4K>3kw6W0ds>@{hh*gX9g;)ZTl>^=Ari<1<)ust$A*~1i00000005j&Ypu2Jj^YWw zy90QoT&ZuaQvl6=DP?aYPf1pQ*$k63`;x8zO;>}w*_U($&=hOZQ)gd9es%|NhM$F! zW?$0X0Zo_gyxGq!-I5;w002`g?B41@dShn48j^qcKMg+SRb@~2kiDXt9?G(zZ_&4C zhfSe&Es>ja8l-41$VME{IyOzQ?Ue@1yRzZ^H{)W~!1tfC>juYNH#BJt?4%T&zcu@I zbg0WXI2uYRp~7D9ao)DXaZq_zsB{W|%4eW}Iz^4!e zUu_N6PY6z&;*%m4K>3kw6W0ds>@{hh*sAjk5Y(@*V#~rbuHu`7A_H&AxgwHf8y4cdKvg$JbB4n%ez%sZ31aBYd&Oo@(7)_WJ(Znl2o8^PD` zFE`_Y-IS+Kdq0Q2-7r_C=}F(5ev`U`H~)QH|9$1FHE$YjoVax+e0xei%S`SAGlOm! zp7{T3NA-mVOYb&rdU8MdyIHo@@7cE*uj@I+Zu{2i)KMSV-E~o { + + const tx = eth.signPersonalMessage( + "44'/60'/0'/0/0", + Buffer.from("Example `personal_sign` message").toString("hex") + ); + + await waitForAppScreen(sim); + + const rclicks = (model.letter == 'S') ? 4 : 3; + await sim.navigateAndCompareSnapshots('.', model.name + '_eip191_metamask', [rclicks, -1, 0]); + + await expect(tx).resolves.toEqual({ + "v": 28, + "r": "916099cf0d9c21911c85f0770a47a9696a8189e78c259cf099749748c507baae", + "s": "0d72234bc0ac2e94c5f7a5f4f9cd8610a52be4ea55515a85b9703f1bb158415c" + }); + })); + + + test("[Nano " + model.letter + "] "+ testgroup +" non-ASCII test", zemu(model, async (sim, eth) => { + + const tx = eth.signPersonalMessage( + "44'/60'/0'/0/0", + "9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658" + ); + + await waitForAppScreen(sim); + + const rclicks = (model.letter == 'S') ? 6 : 4; + await sim.navigateAndCompareSnapshots('.', model.name + '_eip191_nonascii', [rclicks, -1, 0]); + + await expect(tx).resolves.toEqual({ + "v": 28, + "r": "64bdbdb6959425445d00ff2536a7018d2dce904e1f7475938fe4221c3c72500c", + "s": "7c9208e99b6b9266a73aae17b73472d06499746edec34fd47a9dab42f06f2e42" + }); + })); + + + test("[Nano " + model.letter + "] "+ testgroup +" OpenSea test", zemu(model, async (sim, eth) => { + + const tx = eth.signPersonalMessage( + "44'/60'/0'/0/0", + Buffer.from("Welcome to OpenSea!\n\nClick to sign in and accept the OpenSea Terms of Service: https://opensea.io/tos\n\nThis request will not trigger a blockchain transaction or cost any gas fees.\n\nYour authentication status will reset after 24 hours.\n\nWallet address:\n0x9858effd232b4033e47d90003d41ec34ecaeda94\n\nNonce:\n2b02c8a0-f74f-4554-9821-a28054dc9121").toString("hex") + ); + + await waitForAppScreen(sim); + + await sim.navigateAndCompareSnapshots('.', model.name + '_eip191_opensea', [7, -1, 0]); + + await expect(tx).resolves.toEqual({ + "v": 28, + "r": "61a68c986f087730d2f6ecf89d6d1e48ab963ac461102bb02664bc05c3db75bb", + "s": "5714729ef441e097673a7b29a681e97f6963d875eeed2081f26b0b6686cd2bd2" + }); + })); +}); From cf9cbc0f476f449b96381414dacef6212f628570 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 30 May 2022 15:59:01 +0200 Subject: [PATCH 07/10] Updated the changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d01c246..09820a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.9.19](https://github.com/ledgerhq/app-ethereum/compare/1.9.18...1.9.19) - 2022-XX-XX + +### Changed + +- EIP-191 signatures now show the actual data contained in the message (clear-signing) + ## [1.9.18](https://github.com/ledgerhq/app-ethereum/compare/1.9.17...1.9.18) - 2022-04-25 ### Added From fb677fc187ec88f05880af431edaa571d97a421d Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 8 Jun 2022 11:39:22 +0200 Subject: [PATCH 08/10] Removed the -dev version suffix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f3e9e58..1d6fac2 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'" APPVERSION_M=1 APPVERSION_N=9 APPVERSION_P=19 -APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)-dev +APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION) ########################### From 6768ccaf785d8ada2bf857a289a00bc4da2f1d4e Mon Sep 17 00:00:00 2001 From: yhql Date: Fri, 10 Jun 2022 09:45:12 +0200 Subject: [PATCH 09/10] Eip191 review (#314) * Avoid using a global for is_ascii * Fix unused var, missing init, and use size_t for length * Use snprintf where possible --- Makefile | 2 +- src_features/signMessage/cmd_signMessage.c | 47 ++++++++++------------ 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 1d6fac2..f9af42a 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ all: default ############ DEFINES += OS_IO_SEPROXYHAL -DEFINES += HAVE_BAGL HAVE_SPRINTF +DEFINES += HAVE_BAGL HAVE_SPRINTF HAVE_SNPRINTF_FORMAT_U DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=4 IO_HID_EP_LENGTH=64 HAVE_USB_APDU DEFINES += LEDGER_MAJOR_VERSION=$(APPVERSION_M) LEDGER_MINOR_VERSION=$(APPVERSION_N) LEDGER_PATCH_VERSION=$(APPVERSION_P) diff --git a/src_features/signMessage/cmd_signMessage.c b/src_features/signMessage/cmd_signMessage.c index a7592a3..2138a2f 100644 --- a/src_features/signMessage/cmd_signMessage.c +++ b/src_features/signMessage/cmd_signMessage.c @@ -25,7 +25,7 @@ static inline bool is_char_special(char c) { * @param[in] the length of the input data * @return wether the data is fully ASCII or not */ -static bool is_data_ascii(const uint8_t *const data, uint8_t length) { +static bool is_data_ascii(const uint8_t *const data, size_t length) { for (uint8_t idx = 0; idx < length; ++idx) { if (!is_char_special(data[idx]) && ((data[idx] < 0x20) || (data[idx] > 0x7e))) { return false; @@ -47,6 +47,13 @@ static void init_value_str(bool is_ascii) { } } +/** + * @return Whether the currently stored data is initialized as ASCII or not + */ +static bool is_value_str_ascii() { + return (memcmp(strings.tmp.tmp, "0x", 2) != 0); +} + /** * Update the global UI string variable by formatting & appending the new data to it * @@ -54,7 +61,7 @@ static void init_value_str(bool is_ascii) { * @param[in] length the data length * @param[in] is_ascii wether the data is ASCII or not */ -static void feed_value_str(const uint8_t *const data, uint8_t length, bool is_ascii) { +static void feed_value_str(const uint8_t *const data, size_t length, bool is_ascii) { uint16_t value_strlen = strlen(strings.tmp.tmp); if ((value_strlen + 1) < sizeof(strings.tmp.tmp)) { @@ -92,11 +99,14 @@ static void feed_value_str(const uint8_t *const data, uint8_t length, bool is_as sizeof(marker)); } } else { - snprintf(strings.tmp.tmp + value_strlen, - sizeof(strings.tmp.tmp) - value_strlen, - "%.*H", - length, - data); + // truncate to strings.tmp.tmp 's size + length = MIN(length, (sizeof(strings.tmp.tmp) - value_strlen)/2); + for (size_t i = 0; i < length; i++ ) { + snprintf(strings.tmp.tmp + value_strlen + 2*i, + sizeof(strings.tmp.tmp) - value_strlen - 2*i, + "%02X", + data[i]); + } } } } @@ -107,16 +117,11 @@ void handleSignPersonalMessage(uint8_t p1, uint16_t dataLength, unsigned int *flags, unsigned int *tx) { - // Point to this unused global variable for persistency - bool *is_ascii = (bool *) &strings.tmp.tmp2[0]; UNUSED(tx); uint8_t hashMessage[INT256_LENGTH]; if (p1 == P1_FIRST) { - char tmp[11]; - uint32_t index; - uint32_t base = 10; - uint8_t pos = 0; + char tmp[11] = {0}; uint32_t i; if (dataLength < 1) { PRINTF("Invalid data\n"); @@ -159,19 +164,11 @@ void handleSignPersonalMessage(uint8_t p1, sizeof(SIGN_MAGIC) - 1, NULL, 0); - for (index = 1; (((index * base) <= tmpCtx.messageSigningContext.remainingLength) && - (((index * base) / base) == index)); - index *= base) - ; - for (; index; index /= base) { - tmp[pos++] = '0' + ((tmpCtx.messageSigningContext.remainingLength / index) % base); - } - tmp[pos] = '\0'; - cx_hash((cx_hash_t *) &global_sha3, 0, (uint8_t *) tmp, pos, NULL, 0); + snprintf(tmp, sizeof(tmp), "%u", tmpCtx.messageSigningContext.remainingLength); + cx_hash((cx_hash_t *) &global_sha3, 0, (uint8_t *) tmp, strlen(tmp), NULL, 0); cx_sha256_init(&tmpContent.sha2); - *is_ascii = is_data_ascii(workBuffer, dataLength); - init_value_str(*is_ascii); + init_value_str(is_data_ascii(workBuffer, dataLength)); } else if (p1 != P1_MORE) { THROW(0x6B00); @@ -191,7 +188,7 @@ void handleSignPersonalMessage(uint8_t p1, cx_hash((cx_hash_t *) &tmpContent.sha2, 0, workBuffer, dataLength, NULL, 0); tmpCtx.messageSigningContext.remainingLength -= dataLength; - feed_value_str(workBuffer, dataLength, *is_ascii); + feed_value_str(workBuffer, dataLength, is_value_str_ascii()); if (tmpCtx.messageSigningContext.remainingLength == 0) { cx_hash((cx_hash_t *) &global_sha3, From 2ed6a4502d2333e5bd6773142a6d95599711726a Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Fri, 10 Jun 2022 09:47:32 +0200 Subject: [PATCH 10/10] Linting fix following review --- src_features/signMessage/cmd_signMessage.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src_features/signMessage/cmd_signMessage.c b/src_features/signMessage/cmd_signMessage.c index 2138a2f..7ea12db 100644 --- a/src_features/signMessage/cmd_signMessage.c +++ b/src_features/signMessage/cmd_signMessage.c @@ -100,12 +100,12 @@ static void feed_value_str(const uint8_t *const data, size_t length, bool is_asc } } else { // truncate to strings.tmp.tmp 's size - length = MIN(length, (sizeof(strings.tmp.tmp) - value_strlen)/2); - for (size_t i = 0; i < length; i++ ) { - snprintf(strings.tmp.tmp + value_strlen + 2*i, - sizeof(strings.tmp.tmp) - value_strlen - 2*i, - "%02X", - data[i]); + length = MIN(length, (sizeof(strings.tmp.tmp) - value_strlen) / 2); + for (size_t i = 0; i < length; i++) { + snprintf(strings.tmp.tmp + value_strlen + 2 * i, + sizeof(strings.tmp.tmp) - value_strlen - 2 * i, + "%02X", + data[i]); } } } @@ -117,7 +117,6 @@ void handleSignPersonalMessage(uint8_t p1, uint16_t dataLength, unsigned int *flags, unsigned int *tx) { - UNUSED(tx); uint8_t hashMessage[INT256_LENGTH]; if (p1 == P1_FIRST) {