mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Added challenge issue and verification for peer connections (#93)
Implemented flatbuffer peer challenge issue and verification messages. Replaced session flags with challenge status enum.
This commit is contained in:
@@ -86,8 +86,7 @@ int verify_challenge(std::string_view message, comm::comm_session &session)
|
||||
// All good. Unique public key.
|
||||
// Promote the connection from pending-challenges to authenticated users.
|
||||
|
||||
session.flags.reset(comm::SESSION_FLAG::USER_CHALLENGE_ISSUED); // Clear challenge-issued flag
|
||||
session.flags.set(comm::SESSION_FLAG::USER_AUTHED); // Set the user-authed flag
|
||||
session.challenge_status = comm::CHALLENGE_VERIFIED; // Set as challenge verified
|
||||
add_user(session, userpubkey); // Add the user to the global authed user list
|
||||
session.issued_challenge.clear(); // Remove the stored challenge
|
||||
|
||||
|
||||
Reference in New Issue
Block a user