Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme Code Example is Incorrect #91

Open
micchickenburger opened this issue Jan 15, 2024 · 1 comment
Open

Readme Code Example is Incorrect #91

micchickenburger opened this issue Jan 15, 2024 · 1 comment

Comments

@micchickenburger
Copy link

The sign in example in the Readme is incorrect. Specifically, B is assigned to an instance of SRPServerSessionStep1, not to a bigint. Should this have been destructured?

// Sign in
    const srp6aNimbusClient = new SRPClientSession(srp6aNimbusRoutines);
    await srp6aNimbusClient.step1(username, password);
// erase password at this point, it is no longer stored
    password = ""

    const server = new SRPServerSession(srp6aNimbusRoutines);
// server gets identifier from client, salt+verifier from db (from signup)
    const B = await server.step1(username, salt, verifier);

// client gets challenge B from server step1 and sends prove M1 to server
    const {A, M1} = await srp6aNimbusClient.step2(salt, B);

// servers checks client prove M1 and sends server prove M2 to client
    const M2 = await server.step2(A, M1);

// client ensures server identity
    await srp6aNimbusClient.step3(M2);
@bufistov
Copy link

Good catch. Unfortunately I no longer have write access to this repo, so cannot fix/merge the fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants