handleAuthCert: reject cert-auth when number differs from session
If session already has a number (from PoW), cert auth must match that number. Prevents identity theft via cert-sharing.
This commit is contained in:
parent
b7597e1335
commit
12f38ecb68
1 changed files with 2 additions and 1 deletions
|
|
@ -351,7 +351,8 @@ func (s *Server) handleAuthCert(sess *Session, payload []byte) {
|
|||
}
|
||||
|
||||
if sess.IsAuthenticated() && sess.Number() != ident.Number {
|
||||
s.Unregister(sess.Number())
|
||||
sendOpError(sess.Stream(), types.ErrAuthFailed, "cert number mismatch")
|
||||
return
|
||||
}
|
||||
|
||||
sess.Authenticate(ident.Number, pubKey, certDER)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue