Commit cd5c2b18 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Cleanup

parent 53d543b0
......@@ -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
}
......
......@@ -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
......
......@@ -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{
......
......@@ -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
......
......@@ -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)
sigpath := cm.signatureFilename(id.String(), counter)
exists, err := PathExists(sigpath)
if err != nil || !exists {
return
}
bytes, err := ioutil.ReadFile(path)
bytes, err := ioutil.ReadFile(sigpath)
if err != nil {
return
}
......
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