mirror of
https://github.com/esiur/esiur-js.git
synced 2025-06-27 07:13:12 +00:00
fix
This commit is contained in:
@ -19,6 +19,8 @@ import IIPAuthPacketIAuthDestination from '../../src/Net/Packets/IIPAuthPacketIA
|
||||
import IIPAuthPacketIAuthFormat from '../../src/Net/Packets/IIPAuthPacketIAuthFormat.js';
|
||||
import IIPAuthPacketHeader from '../../src/Net/Packets/IIPAuthPacketHeader.js';
|
||||
import Codec from '../../src/Data/Codec.js';
|
||||
import BinaryList from "../../src/Data/BinaryList.js";
|
||||
import SHA256 from "../../src/Security/Integrity/SHA256.js";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
@ -74,9 +76,8 @@ class MyMembership extends IMembership {
|
||||
let remoteNonce = session.remoteHeaders.get(IIPAuthPacketHeader.Nonce);
|
||||
let localNonce = session.localHeaders.get(IIPAuthPacketHeader.Nonce);
|
||||
|
||||
var hashFunc = SHA256.Create();
|
||||
// local nonce + password or token + remote nonce
|
||||
var challenge = hashFunc.ComputeHash(new BinaryList()
|
||||
var challenge = SHA256.compute(new BinaryList()
|
||||
.addUint8Array(remoteNonce)
|
||||
.addUint8Array(Codec.compose(7, null)) // answer is 7
|
||||
.addUint8Array(localNonce)
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
function authenticator(x)
|
||||
{
|
||||
debugger;
|
||||
let challenge = prompt(x.clue);
|
||||
if (challenge != null) {
|
||||
return new Esiur.Core.AsyncReply(parseInt(challenge));
|
||||
|
Reference in New Issue
Block a user