mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 16:15: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 {
|
try {
|
||||||
if (isHiChainLite) {
|
if (isHiChainLite) {
|
||||||
nonce = clientNonce;
|
|
||||||
key = paramsProvider.getPinCode();
|
key = paramsProvider.getPinCode();
|
||||||
if (authVersion == 0x02)
|
if (authVersion == 0x02)
|
||||||
key = paramsProvider.getSecretKey();
|
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);
|
byte[] challenge = huaweiCrypto.digestChallenge(key, doubleNonce);
|
||||||
if (challenge == null)
|
if (challenge == null)
|
||||||
throw new RequestCreationException("Challenge null");
|
throw new RequestCreationException("Challenge null");
|
||||||
|
Loading…
Reference in New Issue
Block a user