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
cd5c2b18
Commit
cd5c2b18
authored
Sep 01, 2017
by
Sietse Ringers
Browse files
Cleanup
parent
53d543b0
Changes
5
Hide whitespace changes
Inline
Side-by-side
manager.go
View file @
cd5c2b18
...
...
@@ -322,7 +322,7 @@ func (cm *CredentialManager) Proofs(choice *DisclosureChoice, request Session, i
// IssueCommitments computes issuance commitments, along with disclosure proofs
// specified by choice.
func
(
cm
*
CredentialManager
)
IssueCommitments
(
choice
*
DisclosureChoice
,
request
*
IssuanceRequest
)
(
*
gabi
.
IssueCommitmentMessage
,
error
)
{
state
,
err
:=
newIssuanceState
(
request
)
state
,
err
:=
newIssuanceState
()
if
err
!=
nil
{
return
nil
,
err
}
...
...
protocol/messages.go
View file @
cd5c2b18
...
...
@@ -33,7 +33,6 @@ type Error struct {
const
(
StatusConnected
=
Status
(
"connected"
)
StatusCommunicating
=
Status
(
"communicating"
)
StatusDone
=
Status
(
"done"
)
)
// Actions
...
...
@@ -48,8 +47,6 @@ const (
const
(
// Protocol version not supported
ErrorProtocolVersionNotSupported
=
ErrorCode
(
"versionNotSupported"
)
// Server URL invalid
ErrorInvalidURL
=
ErrorCode
(
"invalidUrl"
)
// Error in HTTP communication
ErrorTransport
=
ErrorCode
(
"httpError"
)
// Invalid client JWT in first IRMA message
...
...
protocol/session_test.go
View file @
cd5c2b18
...
...
@@ -91,12 +91,10 @@ func (th TestHandler) AskSignaturePermission(request irmago.SignatureRequest, Se
func
getDisclosureJwt
(
name
string
,
id
irmago
.
AttributeTypeIdentifier
)
interface
{}
{
return
NewServiceProviderJwt
(
name
,
&
irmago
.
DisclosureRequest
{
Content
:
irmago
.
AttributeDisjunctionList
([]
*
irmago
.
AttributeDisjunction
{
&
irmago
.
AttributeDisjunction
{
Label
:
"foo"
,
Attributes
:
[]
irmago
.
AttributeTypeIdentifier
{
id
},
},
}),
Content
:
irmago
.
AttributeDisjunctionList
([]
*
irmago
.
AttributeDisjunction
{{
Label
:
"foo"
,
Attributes
:
[]
irmago
.
AttributeTypeIdentifier
{
id
},
}}),
})
}
...
...
@@ -105,12 +103,10 @@ func getSigningJwt(name string, id irmago.AttributeTypeIdentifier) interface{} {
Message
:
"test"
,
MessageType
:
"STRING"
,
DisclosureRequest
:
irmago
.
DisclosureRequest
{
Content
:
irmago
.
AttributeDisjunctionList
([]
*
irmago
.
AttributeDisjunction
{
&
irmago
.
AttributeDisjunction
{
Label
:
"foo"
,
Attributes
:
[]
irmago
.
AttributeTypeIdentifier
{
id
},
},
}),
Content
:
irmago
.
AttributeDisjunctionList
([]
*
irmago
.
AttributeDisjunction
{{
Label
:
"foo"
,
Attributes
:
[]
irmago
.
AttributeTypeIdentifier
{
id
},
}}),
},
})
}
...
...
@@ -121,7 +117,7 @@ func getIssuanceJwt(name string, id irmago.AttributeTypeIdentifier) interface{}
credid2
:=
irmago
.
NewCredentialTypeIdentifier
(
"irma-demo.MijnOverheid.root"
)
return
NewIdentityProviderJwt
(
name
,
&
irmago
.
IssuanceRequest
{
Credentials
:
[]
*
irmago
.
CredentialRequest
{
&
irmago
.
CredentialRequest
{
{
Validity
:
&
expiry
,
Credential
:
&
credid1
,
Attributes
:
map
[
string
]
string
{
...
...
@@ -130,8 +126,7 @@ func getIssuanceJwt(name string, id irmago.AttributeTypeIdentifier) interface{}
"studentID"
:
"s1234567"
,
"level"
:
"42"
,
},
},
&
irmago
.
CredentialRequest
{
},
{
Validity
:
&
expiry
,
Credential
:
&
credid2
,
Attributes
:
map
[
string
]
string
{
...
...
requests.go
View file @
cd5c2b18
...
...
@@ -91,7 +91,7 @@ func (cr *CredentialRequest) AttributeList() (*AttributeList, error) {
return
NewAttributeListFromInts
(
attrs
),
nil
}
func
newIssuanceState
(
request
*
IssuanceRequest
)
(
*
issuanceState
,
error
)
{
func
newIssuanceState
()
(
*
issuanceState
,
error
)
{
nonce2
,
err
:=
gabi
.
RandomBigInt
(
gabi
.
DefaultSystemParameters
[
4096
]
.
Lstatzk
)
if
err
!=
nil
{
return
nil
,
err
...
...
storage.go
View file @
cd5c2b18
...
...
@@ -130,12 +130,12 @@ func (cm *CredentialManager) storeAttributes() (err error) {
}
func
(
cm
*
CredentialManager
)
loadSignature
(
id
CredentialTypeIdentifier
,
counter
int
)
(
signature
*
gabi
.
CLSignature
,
err
error
)
{
path
:=
cm
.
signatureFilename
(
id
.
String
(),
counter
)
exists
,
err
:=
PathExists
(
path
)
sig
path
:=
cm
.
signatureFilename
(
id
.
String
(),
counter
)
exists
,
err
:=
PathExists
(
sig
path
)
if
err
!=
nil
||
!
exists
{
return
}
bytes
,
err
:=
ioutil
.
ReadFile
(
path
)
bytes
,
err
:=
ioutil
.
ReadFile
(
sig
path
)
if
err
!=
nil
{
return
}
...
...
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