Commit 0ced297e authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Send PIN status events

parent bfde049d
...@@ -26,6 +26,8 @@ type keyshareSessionHandler interface { ...@@ -26,6 +26,8 @@ type keyshareSessionHandler interface {
KeyshareCancelled() KeyshareCancelled()
KeyshareBlocked(duration int) KeyshareBlocked(duration int)
KeyshareError(err error) KeyshareError(err error)
KeysharePin()
KeysharePinOK()
} }
type keyshareSession struct { type keyshareSession struct {
...@@ -198,6 +200,7 @@ func startKeyshareSession( ...@@ -198,6 +200,7 @@ func startKeyshareSession(
} }
if requestPin { if requestPin {
ks.sessionHandler.KeysharePin()
ks.VerifyPin(-1) ks.VerifyPin(-1)
} else { } else {
ks.GetCommitments() ks.GetCommitments()
...@@ -222,6 +225,7 @@ func (ks *keyshareSession) VerifyPin(attempts int) { ...@@ -222,6 +225,7 @@ func (ks *keyshareSession) VerifyPin(attempts int) {
return return
} }
if success { if success {
ks.sessionHandler.KeysharePinOK()
ks.GetCommitments() ks.GetCommitments()
return return
} }
......
...@@ -325,6 +325,14 @@ func (session *session) KeyshareError(err error) { ...@@ -325,6 +325,14 @@ func (session *session) KeyshareError(err error) {
session.fail(&irma.SessionError{ErrorType: irma.ErrorKeyshare, Err: err}) session.fail(&irma.SessionError{ErrorType: irma.ErrorKeyshare, Err: err})
} }
func (session *session) KeysharePin() {
session.Handler.StatusUpdate(session.Action, irma.StatusConnected)
}
func (session *session) KeysharePinOK() {
session.Handler.StatusUpdate(session.Action, irma.StatusCommunicating)
}
type disclosureResponse string type disclosureResponse string
func (session *session) sendResponse(message interface{}) { func (session *session) sendResponse(message interface{}) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment