Commit 14e1e13b authored by Sietse Ringers's avatar Sietse Ringers
Browse files

feat: add revocation callback to irmaclient handler interface

parent 037e8b24
......@@ -19,6 +19,7 @@ type TestClientHandler struct {
func (i *TestClientHandler) UpdateConfiguration(new *irma.IrmaIdentifierSet) {}
func (i *TestClientHandler) UpdateAttributes() {}
func (i *TestClientHandler) Revoked(cred *irma.CredentialIdentifier) {}
func (i *TestClientHandler) EnrollmentSuccess(manager irma.SchemeManagerIdentifier) {
select {
case i.c <- nil: // nop
......
......@@ -10,6 +10,7 @@ import (
"github.com/go-errors/errors"
"github.com/privacybydesign/gabi"
"github.com/privacybydesign/gabi/big"
"github.com/privacybydesign/gabi/revocation"
"github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/internal/fs"
"github.com/privacybydesign/keyproof/common"
......@@ -97,6 +98,7 @@ type ClientHandler interface {
UpdateConfiguration(new *irma.IrmaIdentifierSet)
UpdateAttributes()
Revoked(cred *irma.CredentialIdentifier)
}
// MissingAttributes contains all attribute requests that the client cannot satisfy with its
......@@ -787,6 +789,12 @@ func (client *Client) NonrevPreprare(request irma.SessionRequest) error {
return err
}
if updated, err = cred.NonrevPrepare(client.Configuration, request); err != nil {
if err == revocation.ErrorRevoked {
client.handler.Revoked(&irma.CredentialIdentifier{
Type: cred.CredentialType().Identifier(),
Hash: cred.attrs.Hash(),
})
}
return err
}
if updated {
......
......@@ -397,6 +397,7 @@ type TestClientHandler struct {
func (i *TestClientHandler) UpdateConfiguration(new *irma.IrmaIdentifierSet) {}
func (i *TestClientHandler) UpdateAttributes() {}
func (i *TestClientHandler) Revoked(cred *irma.CredentialIdentifier) {}
func (i *TestClientHandler) EnrollmentSuccess(manager irma.SchemeManagerIdentifier) {
select {
case i.c <- nil: // nop
......
Markdown is supported
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