Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
c39104ea
Commit
c39104ea
authored
Feb 17, 2018
by
Sietse Ringers
Browse files
Merge branch 'master' into timestamp
parents
4b7eda2a
1cb8de5d
Changes
4
Hide whitespace changes
Inline
Side-by-side
irmaclient/keyshare.go
View file @
c39104ea
...
...
@@ -25,7 +25,7 @@ type keyshareSessionHandler interface {
KeyshareDone
(
message
interface
{})
KeyshareCancelled
()
KeyshareBlocked
(
manager
irma
.
SchemeManagerIdentifier
,
duration
int
)
Keyshare
Registration
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
Keyshare
Enrollment
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
// In errors the manager may be nil, as not all keyshare errors have a clearly associated scheme manager
KeyshareError
(
manager
*
irma
.
SchemeManagerIdentifier
,
err
error
)
KeysharePin
()
...
...
@@ -221,7 +221,7 @@ func (ks *keyshareSession) fail(manager irma.SchemeManagerIdentifier, err error)
if
serr
.
ApiError
!=
nil
&&
len
(
serr
.
ApiError
.
ErrorName
)
>
0
{
switch
serr
.
ApiError
.
ErrorName
{
case
"USER_NOT_REGISTERED"
:
ks
.
sessionHandler
.
Keyshare
Registration
Incomplete
(
manager
)
ks
.
sessionHandler
.
Keyshare
Enrollment
Incomplete
(
manager
)
case
"USER_BLOCKED"
:
duration
,
err
:=
strconv
.
Atoi
(
serr
.
ApiError
.
Message
)
if
err
!=
nil
{
// Not really clear what to do with duration, but should never happen anyway
...
...
irmaclient/manual_session_test.go
View file @
c39104ea
...
...
@@ -73,7 +73,7 @@ func (sh *ManualSessionHandler) RequestSignaturePermission(request irma.Signatur
func
(
sh
*
ManualSessionHandler
)
Cancelled
(
irmaAction
irma
.
Action
)
{
sh
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
New
(
"Session was cancelled"
)})
}
func
(
sh
*
ManualSessionHandler
)
Missing
KeyshareEnrollment
(
manager
irma
.
SchemeManagerIdentifier
)
{
func
(
sh
*
ManualSessionHandler
)
KeyshareEnrollment
Missing
(
manager
irma
.
SchemeManagerIdentifier
)
{
sh
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
Errorf
(
"Missing keyshare server %s"
,
manager
.
String
())})
}
func
(
sh
*
ManualSessionHandler
)
RequestIssuancePermission
(
request
irma
.
IssuanceRequest
,
issuerName
string
,
ph
PermissionHandler
)
{
...
...
@@ -97,6 +97,6 @@ func (sh *ManualSessionHandler) Failure(irmaAction irma.Action, err *irma.Sessio
func
(
sh
*
ManualSessionHandler
)
KeyshareBlocked
(
manager
irma
.
SchemeManagerIdentifier
,
duration
int
)
{
sh
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
New
(
"KeyshareBlocked"
)})
}
func
(
sh
*
ManualSessionHandler
)
Keyshare
Registration
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
{
sh
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
New
(
"Keyshare
Registration
Incomplete"
)})
func
(
sh
*
ManualSessionHandler
)
Keyshare
Enrollment
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
{
sh
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
New
(
"Keyshare
Enrollment
Incomplete"
)})
}
irmaclient/session.go
View file @
c39104ea
...
...
@@ -33,9 +33,9 @@ type Handler interface {
Failure
(
action
irma
.
Action
,
err
*
irma
.
SessionError
)
UnsatisfiableRequest
(
action
irma
.
Action
,
ServerName
string
,
missing
irma
.
AttributeDisjunctionList
)
MissingKeyshareEnrollment
(
manager
irma
.
SchemeManagerIdentifier
)
KeyshareBlocked
(
manager
irma
.
SchemeManagerIdentifier
,
duration
int
)
KeyshareRegistrationIncomplete
(
manager
irma
.
SchemeManagerIdentifier
)
KeyshareEnrollmentIncomplete
(
manager
irma
.
SchemeManagerIdentifier
)
KeyshareEnrollmentMissing
(
manager
irma
.
SchemeManagerIdentifier
)
RequestIssuancePermission
(
request
irma
.
IssuanceRequest
,
ServerName
string
,
callback
PermissionHandler
)
RequestVerificationPermission
(
request
irma
.
DisclosureRequest
,
ServerName
string
,
callback
PermissionHandler
)
...
...
@@ -159,7 +159,7 @@ func (session *session) checkKeyshareEnrollment() bool {
distributed
:=
manager
.
Distributed
()
_
,
enrolled
:=
session
.
client
.
keyshareServers
[
id
]
if
distributed
&&
!
enrolled
{
session
.
Handler
.
Missing
KeyshareEnrollment
(
id
)
session
.
Handler
.
KeyshareEnrollment
Missing
(
id
)
return
false
}
}
...
...
@@ -410,8 +410,8 @@ func (session *session) KeyshareCancelled() {
session
.
cancel
()
}
func
(
session
*
session
)
Keyshare
Registration
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
{
session
.
Handler
.
Keyshare
Registration
Incomplete
(
manager
)
func
(
session
*
session
)
Keyshare
Enrollment
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
{
session
.
Handler
.
Keyshare
Enrollment
Incomplete
(
manager
)
}
func
(
session
*
session
)
KeyshareBlocked
(
manager
irma
.
SchemeManagerIdentifier
,
duration
int
)
{
...
...
irmaclient/session_test.go
View file @
c39104ea
...
...
@@ -21,15 +21,15 @@ type TestHandler struct {
client
*
Client
}
func
(
th
TestHandler
)
Keyshare
Registration
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
{
th
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
New
(
"Keyshare
Registration
Incomplete"
)})
func
(
th
TestHandler
)
Keyshare
Enrollment
Incomplete
(
manager
irma
.
SchemeManagerIdentifier
)
{
th
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
New
(
"Keyshare
Enrollment
Incomplete"
)})
}
func
(
th
TestHandler
)
KeyshareBlocked
(
manager
irma
.
SchemeManagerIdentifier
,
duration
int
)
{
th
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
New
(
"KeyshareBlocked"
)})
}
func
(
th
TestHandler
)
Missing
KeyshareEnrollment
(
manager
irma
.
SchemeManagerIdentifier
)
{
func
(
th
TestHandler
)
KeyshareEnrollment
Missing
(
manager
irma
.
SchemeManagerIdentifier
)
{
th
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
errors
.
Errorf
(
"Missing keyshare server %s"
,
manager
.
String
())})
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment