fix: newBootloaderQuery now returns an ErrTuple

This commit is contained in:
Derrick Hammer 2023-09-11 07:13:27 -04:00
parent 3ee446a9c5
commit 780f4fddf7
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 3 deletions

View File

@ -90,12 +90,12 @@ async function login(key: Uint8Array) {
data: bytesToHex(x25519.getPublicKey(privKey)),
});
if (pubKeyRet.err) {
alert(`Failed to login: could not get communication key: ${pubKeyRet.err}`);
if (pubKeyRet[1]) {
alert(`Failed to login: could not get communication key: ${pubKeyRet[1]}`);
return;
}
let pubKey = hexToBytes(pubKeyRet.data);
let pubKey = hexToBytes(pubKeyRet[0] as string);
const secret = x25519.getSharedSecret(privKey, pubKey);
const nonce = randomBytes(24);