Refactor authentication challenge logic in HandleCount and HandleReq
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled

- Updated the authentication challenge conditions in both HandleCount and HandleReq functions to check for the presence of an authenticated public key.
- Introduced the schnorr package to handle public key length validation.
- Bumped version to v0.25.7 to reflect these changes.
This commit is contained in:
2025-11-05 19:23:59 +00:00
parent eaac3cdc19
commit 88d3e3f73e
3 changed files with 4 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ func (l *Listener) HandleReq(msg []byte) (err error) {
},
)
// send a challenge to the client to auth if an ACL is active, auth is required, or AuthToWrite is enabled
if acl.Registry.Active.Load() != "none" || l.Config.AuthRequired || l.Config.AuthToWrite {
if len(l.authedPubkey.Load()) == 0 && (acl.Registry.Active.Load() != "none" || l.Config.AuthRequired || l.Config.AuthToWrite) {
if err = authenvelope.NewChallengeWith(l.challenge.Load()).
Write(l); chk.E(err) {
return