Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
irmago
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
IRMA
Github mirrors
irmago
Commits
ca06aa7f
Commit
ca06aa7f
authored
Nov 20, 2019
by
Sietse Ringers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: client checks consistency of revocation and revocationUpdates fields of session request
parent
710254b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
irmaclient/credential.go
irmaclient/credential.go
+7
-2
requests.go
requests.go
+12
-0
No files found.
irmaclient/credential.go
View file @
ca06aa7f
...
...
@@ -49,13 +49,18 @@ func (cred *credential) AttributeList() *irma.AttributeList {
// persist the updated credential to storage.
func
(
cred
*
credential
)
NonrevPrepare
(
conf
*
irma
.
Configuration
,
request
irma
.
SessionRequest
)
(
bool
,
error
)
{
credtype
:=
cred
.
CredentialType
()
.
Identifier
()
if
!
request
.
Base
()
.
RequestsRevocation
(
credtype
)
{
base
:=
request
.
Base
()
if
!
base
.
RequestsRevocation
(
credtype
)
{
return
false
,
nil
}
if
err
:=
base
.
RevocationConsistent
();
err
!=
nil
{
return
false
,
err
}
// first try to update witness by applying the revocation update messages attached to the session request
keys
:=
irma
.
RevocationKeys
{
Conf
:
conf
}
revupdates
:=
request
.
Base
()
.
RevocationUpdates
[
credtype
]
revupdates
:=
base
.
RevocationUpdates
[
credtype
]
updated
,
err
:=
cred
.
NonrevApplyUpdates
(
revupdates
,
keys
)
if
err
!=
nil
{
return
updated
,
err
...
...
requests.go
View file @
ca06aa7f
...
...
@@ -239,6 +239,18 @@ func (b *BaseRequest) RequestsRevocation(id CredentialTypeIdentifier) bool {
return
len
(
b
.
RevocationUpdates
)
>
0
&&
len
(
b
.
RevocationUpdates
[
id
])
>
0
}
func
(
b
*
BaseRequest
)
RevocationConsistent
()
error
{
if
len
(
b
.
Revocation
)
!=
len
(
b
.
RevocationUpdates
)
{
return
errors
.
New
(
"revocation and revocationUpdates do not have the same length"
)
}
for
_
,
typ
:=
range
b
.
Revocation
{
if
_
,
present
:=
b
.
RevocationUpdates
[
typ
];
!
present
{
return
errors
.
Errorf
(
"type %s not present in revocationUpdates"
,
typ
)
}
}
return
nil
}
// CredentialTypes returns an array of all credential types occuring in this conjunction.
func
(
c
AttributeCon
)
CredentialTypes
()
[]
CredentialTypeIdentifier
{
var
result
[]
CredentialTypeIdentifier
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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