diff --git a/doc/CUSTOM_DATA.md b/doc/CUSTOM_DATA.md index 4f786f0..7aa5816 100644 --- a/doc/CUSTOM_DATA.md +++ b/doc/CUSTOM_DATA.md @@ -30,7 +30,7 @@ text#_ {n:#} data:(SnakeData ~n) = Text; Ledger request format: | Value | Length or type | Description | | --- | --- | --- | -| `message` | 0-250 | ASCII-only message | +| `message` | 0-120 | ASCII-only message | ## App data (0x54b58535) diff --git a/src/sign_data/sign_data_deserialize.c b/src/sign_data/sign_data_deserialize.c index 6bbd9cc..f02462a 100644 --- a/src/sign_data/sign_data_deserialize.c +++ b/src/sign_data/sign_data_deserialize.c @@ -13,7 +13,7 @@ #define PLAINTEXT_REQUEST 0x754bf91b #define APP_DATA_REQUEST 0x54b58535 -#define MAX_PLAINTEXT_LENGTH 188 +#define MAX_PLAINTEXT_LENGTH 120 #define MAX_APP_DATA_DOMAIN_LENGTH 126 // max allowed domain len as per TON DNS spec #define SAFE(RES) \ diff --git a/tests/requirements.txt b/tests/requirements.txt index 150afbb..c284c1e 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ pytest -ragger[speculos,ledgerwallet]>=1.14.2 +ragger[speculos,ledgerwallet]>=1.14.4 pysha3>=1.0.0,<2.0.0 tonsdk==1.0.13 ecdsa>=0.18.0 diff --git a/tests/snapshots/nanos/test_sign_data/part0/00001.png b/tests/snapshots/nanos/test_sign_data/part0/00001.png index 57be405..41c9cfc 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00001.png and b/tests/snapshots/nanos/test_sign_data/part0/00001.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00002.png b/tests/snapshots/nanos/test_sign_data/part0/00002.png index 511f12b..50f5e10 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00002.png and b/tests/snapshots/nanos/test_sign_data/part0/00002.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00003.png b/tests/snapshots/nanos/test_sign_data/part0/00003.png index 0eb0e1c..c7d8eaf 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00003.png and b/tests/snapshots/nanos/test_sign_data/part0/00003.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00004.png b/tests/snapshots/nanos/test_sign_data/part0/00004.png index 4c62025..4d2186c 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00004.png and b/tests/snapshots/nanos/test_sign_data/part0/00004.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00005.png b/tests/snapshots/nanos/test_sign_data/part0/00005.png index 82a44cf..e8649af 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00005.png and b/tests/snapshots/nanos/test_sign_data/part0/00005.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00006.png b/tests/snapshots/nanos/test_sign_data/part0/00006.png index 704841d..5c97b05 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00006.png and b/tests/snapshots/nanos/test_sign_data/part0/00006.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00007.png b/tests/snapshots/nanos/test_sign_data/part0/00007.png index 42cfe96..6a91b5c 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00007.png and b/tests/snapshots/nanos/test_sign_data/part0/00007.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00008.png b/tests/snapshots/nanos/test_sign_data/part0/00008.png index e93bbe7..66c411c 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00008.png and b/tests/snapshots/nanos/test_sign_data/part0/00008.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00009.png b/tests/snapshots/nanos/test_sign_data/part0/00009.png index 80d5cb0..d548246 100644 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00009.png and b/tests/snapshots/nanos/test_sign_data/part0/00009.png differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00010.png b/tests/snapshots/nanos/test_sign_data/part0/00010.png deleted file mode 100644 index 685b94f..0000000 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00010.png and /dev/null differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00011.png b/tests/snapshots/nanos/test_sign_data/part0/00011.png deleted file mode 100644 index 66c411c..0000000 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00011.png and /dev/null differ diff --git a/tests/snapshots/nanos/test_sign_data/part0/00012.png b/tests/snapshots/nanos/test_sign_data/part0/00012.png deleted file mode 100644 index d548246..0000000 Binary files a/tests/snapshots/nanos/test_sign_data/part0/00012.png and /dev/null differ diff --git a/tests/snapshots/nanosp/test_sign_data/part0/00001.png b/tests/snapshots/nanosp/test_sign_data/part0/00001.png index b0089ff..7e619b6 100644 Binary files a/tests/snapshots/nanosp/test_sign_data/part0/00001.png and b/tests/snapshots/nanosp/test_sign_data/part0/00001.png differ diff --git a/tests/snapshots/nanosp/test_sign_data/part0/00002.png b/tests/snapshots/nanosp/test_sign_data/part0/00002.png index f9c3bba..5a36500 100644 Binary files a/tests/snapshots/nanosp/test_sign_data/part0/00002.png and b/tests/snapshots/nanosp/test_sign_data/part0/00002.png differ diff --git a/tests/snapshots/nanosp/test_sign_data/part0/00003.png b/tests/snapshots/nanosp/test_sign_data/part0/00003.png index 1e900e6..6543680 100644 Binary files a/tests/snapshots/nanosp/test_sign_data/part0/00003.png and b/tests/snapshots/nanosp/test_sign_data/part0/00003.png differ diff --git a/tests/snapshots/nanosp/test_sign_data/part0/00004.png b/tests/snapshots/nanosp/test_sign_data/part0/00004.png index 2a37e11..53ae651 100644 Binary files a/tests/snapshots/nanosp/test_sign_data/part0/00004.png and b/tests/snapshots/nanosp/test_sign_data/part0/00004.png differ diff --git a/tests/snapshots/nanosp/test_sign_data/part0/00005.png b/tests/snapshots/nanosp/test_sign_data/part0/00005.png index 53ae651..c250b11 100644 Binary files a/tests/snapshots/nanosp/test_sign_data/part0/00005.png and b/tests/snapshots/nanosp/test_sign_data/part0/00005.png differ diff --git a/tests/snapshots/nanosp/test_sign_data/part0/00006.png b/tests/snapshots/nanosp/test_sign_data/part0/00006.png deleted file mode 100644 index c250b11..0000000 Binary files a/tests/snapshots/nanosp/test_sign_data/part0/00006.png and /dev/null differ diff --git a/tests/snapshots/nanox/test_sign_data/part0/00001.png b/tests/snapshots/nanox/test_sign_data/part0/00001.png index 546d087..b667376 100644 Binary files a/tests/snapshots/nanox/test_sign_data/part0/00001.png and b/tests/snapshots/nanox/test_sign_data/part0/00001.png differ diff --git a/tests/snapshots/nanox/test_sign_data/part0/00002.png b/tests/snapshots/nanox/test_sign_data/part0/00002.png index 5dc7cbf..02f919c 100644 Binary files a/tests/snapshots/nanox/test_sign_data/part0/00002.png and b/tests/snapshots/nanox/test_sign_data/part0/00002.png differ diff --git a/tests/snapshots/nanox/test_sign_data/part0/00003.png b/tests/snapshots/nanox/test_sign_data/part0/00003.png index a55f0e6..0a81235 100644 Binary files a/tests/snapshots/nanox/test_sign_data/part0/00003.png and b/tests/snapshots/nanox/test_sign_data/part0/00003.png differ diff --git a/tests/snapshots/nanox/test_sign_data/part0/00004.png b/tests/snapshots/nanox/test_sign_data/part0/00004.png index 54735e5..53ae651 100644 Binary files a/tests/snapshots/nanox/test_sign_data/part0/00004.png and b/tests/snapshots/nanox/test_sign_data/part0/00004.png differ diff --git a/tests/snapshots/nanox/test_sign_data/part0/00005.png b/tests/snapshots/nanox/test_sign_data/part0/00005.png index 53ae651..ca542dd 100644 Binary files a/tests/snapshots/nanox/test_sign_data/part0/00005.png and b/tests/snapshots/nanox/test_sign_data/part0/00005.png differ diff --git a/tests/snapshots/nanox/test_sign_data/part0/00006.png b/tests/snapshots/nanox/test_sign_data/part0/00006.png deleted file mode 100644 index ca542dd..0000000 Binary files a/tests/snapshots/nanox/test_sign_data/part0/00006.png and /dev/null differ diff --git a/tests/snapshots/stax/test_sign_data/part0/00001.png b/tests/snapshots/stax/test_sign_data/part0/00001.png index dbe8fb9..3e98012 100644 Binary files a/tests/snapshots/stax/test_sign_data/part0/00001.png and b/tests/snapshots/stax/test_sign_data/part0/00001.png differ diff --git a/tests/test_sign_custom_data.py b/tests/test_sign_custom_data.py index ef88ecf..d00974c 100644 --- a/tests/test_sign_custom_data.py +++ b/tests/test_sign_custom_data.py @@ -21,7 +21,7 @@ def test_sign_data(firmware, backend, navigator, test_name): pubkey = client.get_public_key(path=path).data requests: List[SignDataRequest] = [ - PlaintextSignDataRequest("a" * 188), + PlaintextSignDataRequest("a" * 120), AppDataSignDataRequest(Cell(), address=Address("0:" + "0" * 64), domain="test.ton", ext=Cell()) ]