1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 12:00:51 +02:00

[Huawei] Fix clientNonce for HiChainLite

This commit is contained in:
Damien 'Psolyca' Gaignon 2024-01-29 21:21:20 +01:00
parent 61116c5fc8
commit 2b5a49641a
No known key found for this signature in database
GPG Key ID: 9E9404E5D9E11843

View File

@ -67,16 +67,14 @@ public class GetAuthRequest extends Request {
try {
if (isHiChainLite) {
nonce = clientNonce;
key = paramsProvider.getPinCode();
if (authVersion == 0x02)
key = paramsProvider.getSecretKey();
} else { // normal mode
nonce = ByteBuffer.allocate(18)
.putShort(authVersion)
.put(clientNonce)
.array();
}
nonce = ByteBuffer.allocate(18)
.putShort(authVersion)
.put(clientNonce)
.array();
byte[] challenge = huaweiCrypto.digestChallenge(key, doubleNonce);
if (challenge == null)
throw new RequestCreationException("Challenge null");