Commit c9c8d085 authored by Koen van Ingen's avatar Koen van Ingen
Browse files

Fixes after rebase

parent dfc27bea
......@@ -32,8 +32,8 @@ type AttributeResult struct {
type AttributeProofStatus string
const (
PRESENT = AttributeProofStatus("PRESENT") // Attribute is disclosed and matches the value
EXTRA = AttributeProofStatus("EXTRA")
PRESENT = AttributeProofStatus("PRESENT") // Attribute is disclosed and matches the value
EXTRA = AttributeProofStatus("EXTRA") // Attribute is disclosed, but wasn't requested in request
MISSING = AttributeProofStatus("MISSING") // Attribute is NOT disclosed, but should be according to request
INVALID_VALUE = AttributeProofStatus("INVALID_VALUE") // Attribute is disclosed, but has invalid value according to request
)
......@@ -313,7 +313,7 @@ type AttributeDisjunction struct {
selected *AttributeTypeIdentifier
}
// AttributeDisjunction with the disclosed value. Label, Attributes,Valued can be nil if there is no matching disjunction
// AttributeDisjunction with the disclosed value that is used to satisfy the disjunction
type DisclosedAttributeDisjunction struct {
AttributeDisjunction
......
......@@ -3,7 +3,6 @@ package irma
import (
"math/big"
"strings"
"github.com/privacybydesign/irmago/internal/fs"
"time"
)
......
......@@ -5,8 +5,8 @@ import (
"fmt"
"github.com/go-errors/errors"
"github.com/privacybydesign/irmago/internal/test"
"github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/internal/test"
"testing"
)
......@@ -26,7 +26,7 @@ var client *Client
func issue(t *testing.T, ms ManualSessionHandler) {
name := "testip"
jwtcontents := getIssuanceJwt(name)
jwtcontents := getIssuanceJwt(name, true)
sessionHandlerHelper(t, jwtcontents, "issue", client, &ms)
}
......@@ -79,7 +79,7 @@ func TestManualSession(t *testing.T) {
client.NewManualSession(request, &ms)
if err := <-ms.errorChannel; err != nil {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
......@@ -108,7 +108,7 @@ func TestManualSessionUnsatisfiable(t *testing.T) {
// Fail test if we won't get UnsatisfiableRequest error
if err := <-ms.errorChannel; err.ErrorType != irma.ErrorType("UnsatisfiableRequest") {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
test.ClearTestStorage(t)
......@@ -127,7 +127,7 @@ func TestManualSessionInvalidNonce(t *testing.T) {
client.NewManualSession(request, &ms)
if err := <-ms.errorChannel; err != nil {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
......@@ -152,7 +152,7 @@ func TestManualSessionInvalidRequest(t *testing.T) {
client.NewManualSession(request, &ms)
if err := <-ms.errorChannel; err != nil {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
......@@ -189,7 +189,7 @@ func TestManualSessionInvalidAttributeValue(t *testing.T) {
client.NewManualSession(request, &ms)
if err := <-ms.errorChannel; err != nil {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
......@@ -217,7 +217,7 @@ func TestManualKeyShareSession(t *testing.T) {
client.NewManualSession(request, &ms)
if err := <-ms.errorChannel; err != nil {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
......@@ -249,7 +249,7 @@ func TestManualSessionMultiProof(t *testing.T) {
client.NewManualSession(request, &ms)
if err := <-ms.errorChannel; err != nil {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
......@@ -280,7 +280,7 @@ func TestManualSessionInvalidProof(t *testing.T) {
client.NewManualSession(request, &ms)
if err := <-ms.errorChannel; err != nil {
test.ClearTestStorage(t)
test.ClearTestStorage(t)
t.Fatal(*err)
}
......@@ -304,7 +304,7 @@ func (sh *ManualSessionHandler) Success(irmaAction irma.Action, result string) {
}
sh.errorChannel <- nil
}
func (sh *ManualSessionHandler) UnsatisfiableRequest(irmaAction irma.Action, missingAttributes irma.AttributeDisjunctionList) {
func (sh *ManualSessionHandler) UnsatisfiableRequest(irmaAction irma.Action, serverName string, missingAttributes irma.AttributeDisjunctionList) {
// This function is called from main thread, which blocks go channel, so need go routine here
go func() {
sh.errorChannel <- &irma.SessionError{
......@@ -347,3 +347,12 @@ func (sh *ManualSessionHandler) Failure(irmaAction irma.Action, err *irma.Sessio
fmt.Println(err.Err)
sh.errorChannel <- err
}
func (sh *ManualSessionHandler) KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int) {
sh.errorChannel <- &irma.SessionError{Err: errors.New("KeyshareBlocked")}
}
func (sh *ManualSessionHandler) KeyshareEnrollmentIncomplete(manager irma.SchemeManagerIdentifier) {
sh.errorChannel <- &irma.SessionError{Err: errors.New("KeyshareEnrollmentIncomplete")}
}
func (sh *ManualSessionHandler) KeyshareEnrollmentMissing(manager irma.SchemeManagerIdentifier) {
sh.errorChannel <- &irma.SessionError{Err: errors.Errorf("Missing keyshare server %s", manager.String())}
}
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