Skip to content

Allow authorization of known public keys in the tcp usb bridge - #540

Merged
koral-- merged 1 commit into
DeviceFarmer:masterfrom
slomg:master
Nov 19, 2024
Merged

koral-- merged 1 commit into
DeviceFarmer:masterfrom
slomg:master

Conversation

@slomg

@slomg slomg commented Nov 19, 2024

Copy link
Copy Markdown

Add an option to provide trusted public keys.
This prevents a "failed to authenticate" message from adb whenever you connect to a device

@koral--
koral-- merged commit 2fccd69 into DeviceFarmer:master Nov 19, 2024
@slomg

slomg commented Nov 19, 2024

Copy link
Copy Markdown
Author

@koral-- can you update the version please?

@koral--

koral-- commented Nov 20, 2024

Copy link
Copy Markdown
Member

Done

UrielCh added a commit to UrielCh/adbkit that referenced this pull request Jul 2, 2025
koral-- pushed a commit that referenced this pull request Oct 13, 2026
)

node-forge's verify() throws instead of returning false when it can't verify a
signature: one made by another key ('Encryption block is invalid'), or one with
the wrong length or no bytes ('Encrypted message length is invalid'). The
known-public-keys loop (#540) calls it for every key, so a client whose
signature isn't from the first known key gets an error instead of a new
challenge. The socket emits that error and the server re-emits it; STF treats
any error from the bridge as fatal and restarts the device. STF passes all of
the device owner's adb keys, so anyone with two keys hits it.

Treat a throw as a mismatch, in the loop and in the RSAPUBLICKEY check, and
reject a missing signature as an AuthError, which only closes the connection.

Signed-off-by: Arthur Yazhevich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants