Comments (7)
Thanks for the clarification! Indeed, it looks like a bug in speculos, related to this io_seproxyhal_button_push().
from speculos.
As mentioned by @mul1sh, the bug can be reproduced on the sia app (it isn't related to OS X and can be reproduced on Linux too), for instance in the ui_getPublicKey_compare_button() callback with the following APDU:
echo 'e002000000' | LEDGER_PROXY_ADDRESS=127.0.0.1 LEDGER_PROXY_PORT=9999 ledgerctl send -
When a button is pushed (either left or right), UX_REDISPLAY()
is called, then UX_REDISPLAY_IDX()
and eventually io_seproxyhal_init_button(). io_seproxyhal_init_button()
sets G_ux_os.button_mask to 0
.
When the button is released, the callback (ui_getPublicKey_compare_button()
) is called with button_mask
being equal to BUTTON_EVT_RELEASED
, because:
G_ux_os.button_mask = 0
because ofio_seproxyhal_init_button()
button_mask = G_ux_os.button_mask | new_button_mask;
(L910)
The condition BUTTON_EVT_RELEASED | BUTTON_LEFT | BUTTON_RIGHT is thus never met.
I guess it works on a real device because of some race condition?
from speculos.
@mul1sh does #62 fix the issue?
from speculos.
@greenknot unfortunately no as explained in the PR. i'm also using the headless
option with docker, not sure if that can be an issue too.
from speculos.
@greenknot no worries, glad I could help. Thanks.
from speculos.
I've really now idea how it can work on a real device and it's indeed a bug in speculos since the behavior differs. That being said, the sia app uses some legacy UX primitives and I guess this behavior can be fixed (in the sia app) using what's called flow now IIRC, or more conventional button callbacks.
I don't plan to spend more time on this issue, feel free to re-open it if these suggestions don't work for you.
from speculos.
@greenknot no worries and thanks for the feedback. I think i'll just improvise with other button events moving forward.
Also just out of curiosity what do you mean legacy UX primitives, sounds like the security risk no? Since even the official docs recommend to start developing from the sia app.
from speculos.
Related Issues (20)
- Does it supports Bluetooth emulation? HOT 1
- Werkzeug >= 2.1.0 triggers issues when using the `SpeculosClient` HOT 3
- Long term storage location HOT 2
- unable to build Docker container with speculos on MAC M1 (aarch64 architecture)
- Add Mac M1 support HOT 2
- How to connect ledger live HOT 2
- Build speculos on MacOS HOT 1
- Emulator just displays a black screen HOT 8
- Auto detect device model and SDK version HOT 2
- How do we set "SPECULOS_SEED"? HOT 1
- Speculos support for new Ledger Stax wallet HOT 1
- ECDSA verify syscall not working
- Any plan to add the BN_MONT_CTX family of functions? HOT 2
- Possible issue using cx_crc32_hw() when testing on Speculos HOT 1
- Support BLS signatures for Chia (XCH) app development
- Visual glitches on web view
- New Stax OCR does not insert spaces into strings HOT 1
- event text is missing spaces HOT 2
- Build fails on M2 Pro HOT 3
- os_lib_call implementation is different from BOLOS' one
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speculos.