-
Notifications
You must be signed in to change notification settings - Fork 6
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
EncryptKey/DecryptKey return whole PB message, not just value #7
Comments
I am currently re-writing xaionaro-go/cryptoWallet to use my fork of trezord-go as a library here which will cause the code here to simplify a lot (I am basically removing all the intermediary classes) and improve the code here. (And I am also removing the dependency on tesoro, which is unmaintained.) |
Similarly, Ping result is not de-marshaled, as isn't Features. (I wonder how could it work for you :D ) |
I see JSON unmarshaling here, which makes no sense, as JSON is not used anywhere in trezor
|
Hello. I have no time on Trezors right now, so the only thing I can do is review and merge patches :(
If this's true then it's very strange. Because I remember for sure that the answer was in JSON. May be the device returns it that way or something. Or, may be it's just obsolete.
Well, it really worked, too :)
Yep, seems to be a mistake. |
UPD: I've just looked into the code a little because I couldn't believe I was so careless. And it seems that actually everything is OK. The unmarshaling was done here: https://github.com/conejoninja/tesoro/blob/master/tesoro.go#L864 And JSON messages are about there, too. |
OH OK! I looked at wrong place. In that case, closing. (as I said, I am rewriting this library + tesoro. I will make you a PR once it's done, but basically, at that point, this library will be basically almost empty.) |
EncryptKey/DecryptKey return whole PB message, not just value
This code just returns bytes from the PB message
cryptoWallet/internal/wallets/satoshilabs/trezor/trezor.go
Lines 124 to 127 in 47f9f68
and that's used directly as a key here
cryptoWallet/internal/wallets/satoshilabs/trezor/trezor.go
Lines 186 to 196 in 47f9f68
but it's never de-marshaled from protobuf.
https://github.com/trezor/trezor-common/blob/04bac52951764d5516206f5359cfc5f5c24eb38f/protob/messages-crypto.proto#L28-L30
The text was updated successfully, but these errors were encountered: