Skip to content

Commit

Permalink
Revert: delete keyshare session fail method
Browse files Browse the repository at this point in the history
  • Loading branch information
ivard committed Sep 5, 2023
1 parent 1fee6f9 commit 028be57
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions irmaclient/keyshare.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,30 @@ func (kss *keyshareServer) tokenValid(conf *irma.Configuration) bool {
return true
}

func (ks *keyshareSession) fail(manager irma.SchemeManagerIdentifier, err error) {
serr, ok := err.(*irma.SessionError)
if ok {
if serr.RemoteError != nil && len(serr.RemoteError.ErrorName) > 0 {
switch serr.RemoteError.ErrorName {
case "USER_NOT_FOUND":
ks.sessionHandler.KeyshareEnrollmentDeleted(manager)
case "USER_NOT_REGISTERED":
ks.sessionHandler.KeyshareEnrollmentIncomplete(manager)
case "USER_BLOCKED":
duration, err := strconv.Atoi(serr.RemoteError.Message)
if err != nil { // Not really clear what to do with duration, but should never happen anyway
duration = -1
}
ks.sessionHandler.KeyshareBlocked(manager, duration)
default:
ks.sessionHandler.KeyshareError(&manager, err)
}
}
} else {
ks.sessionHandler.KeyshareError(&manager, err)
}
}

// VerifyPin asks for a pin, repeatedly if necessary, informing the handler of success or failure.
// It returns whether the authentication was successful or not.
func (ks *keyshareSession) VerifyPin(attempts int) bool {
Expand Down

0 comments on commit 028be57

Please sign in to comment.