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

Allows touch devices to sign micheline expression #305

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/ui_stream_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ tz_ui_nav_cb(void)
tz_parser_state *st = &global.keys.apdu.sign.u.clear.parser_state;

// Continue receiving data from the apdu until s->full is true.
while (((s->total < 0) || ((s->current == s->total) && !s->full))
while (((s->total < 0) || (s->current == s->total)) && !s->full
&& (st->errno < TZ_ERR_INVALID_TAG)) {
PRINTF("tz_ui_nav_cb: Looping...\n");
tz_ui_continue();
Expand Down
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.
39 changes: 39 additions & 0 deletions tests/integration/touch/test_sign_micheline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python3
# Copyright 2023 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from utils import (
tezos_app,
send_payload
)

# full input: 0502000000080100000001300000
# full output: Expression {"0";0}

if __name__ == "__main__":
app = tezos_app(__file__)

app.assert_home()

app.send_initialize_msg("8004000011048000002c800006c18000000080000000")
send_payload(app, "800481ff0e0502000000080100000001300000")

app.review.next()
app.assert_screen("micheline_screen")

expected_apdu = "c871155802f26f35ea07a15c8002d836a8779ac8cc2feb0141f08831dad0326a0905cd4fc8f00615b7b4a78e7eaf7fcc0b7959e01e3119b6261ebd71d76d580b9000"
app.review_confirm_signing(expected_apdu)

app.assert_home()
app.quit()
Loading