mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 09:01:55 +01:00
[Huawei] Fix clientNonce for HiChainLite
This commit is contained in:
parent
61116c5fc8
commit
2b5a49641a
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user