Commit 282c2382 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

WIP on new disclosure message


Co-authored-by: default avatarDavid Venhoek <david@venhoek.nl>
parent 21d89a4f
......@@ -189,7 +189,7 @@ func HandleProtocolMessage(
}
if noun == "commitments" && session.action == irma.ActionIssuing {
commitments := &gabi.IssueCommitmentMessage{}
commitments := &irma.IssueCommitmentMessage{}
if err := irma.UnmarshalValidate(message, commitments); err != nil {
status, output = server.JsonResponse(nil, session.fail(server.ErrorMalformedInput, ""))
return
......@@ -198,12 +198,12 @@ func HandleProtocolMessage(
return
}
if noun == "proofs" && session.action == irma.ActionDisclosing {
proofs := gabi.ProofList{}
if err := irma.UnmarshalValidate(message, &proofs); err != nil {
disclosure := irma.Disclosure{}
if err := irma.UnmarshalValidate(message, &disclosure); err != nil {
status, output = server.JsonResponse(nil, session.fail(server.ErrorMalformedInput, ""))
return
}
status, output = server.JsonResponse(session.handlePostProofs(proofs))
status, output = server.JsonResponse(session.handlePostDisclosure(disclosure))
return
}
if noun == "proofs" && session.action == irma.ActionSigning {
......
......@@ -63,7 +63,7 @@ func (session *session) handlePostSignature(signature *irma.SignedMessage) (*irm
return &session.result.ProofStatus, rerr
}
func (session *session) handlePostProofs(proofs gabi.ProofList) (*irma.ProofStatus, *irma.RemoteError) {
func (session *session) handlePostDisclosure(disclosure irma.Disclosure) (*irma.ProofStatus, *irma.RemoteError) {
if session.status != server.StatusConnected {
return nil, server.RemoteError(server.ErrorUnexpectedRequest, "Session not yet started or already finished")
}
......@@ -71,7 +71,7 @@ func (session *session) handlePostProofs(proofs gabi.ProofList) (*irma.ProofStat
var err error
var rerr *irma.RemoteError
session.result.Disclosed, session.result.ProofStatus, err = irma.ProofList(proofs).Verify(
session.result.Disclosed, session.result.ProofStatus, err = disclosure.Verify(
conf.IrmaConfiguration, session.request.(*irma.DisclosureRequest))
if err == nil {
session.setStatus(server.StatusDone)
......@@ -86,7 +86,7 @@ func (session *session) handlePostProofs(proofs gabi.ProofList) (*irma.ProofStat
return &session.result.ProofStatus, rerr
}
func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentMessage) ([]*gabi.IssueSignatureMessage, *irma.RemoteError) {
func (session *session) handlePostCommitments(commitments *irma.IssueCommitmentMessage) ([]*gabi.IssueSignatureMessage, *irma.RemoteError) {
if session.status != server.StatusConnected {
return nil, server.RemoteError(server.ErrorUnexpectedRequest, "Session not yet started or already finished")
}
......@@ -124,7 +124,7 @@ func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentM
}
// Verify all proofs and check disclosed attributes, if any, against request
session.result.Disclosed, session.result.ProofStatus, err = irma.ProofList(commitments.Proofs).VerifyAgainstDisjunctions(
session.result.Disclosed, session.result.ProofStatus, err = commitments.Disclosure().VerifyAgainstDisjunctions(
conf.IrmaConfiguration, request.Disclose, request.Context, request.Nonce, pubkeys, false)
if err != nil {
if err == irma.ErrorMissingPublicKey {
......
......@@ -72,7 +72,7 @@ func validateIssuanceRequest(request *irma.IssuanceRequest) error {
return nil
}
func (session *session) getProofP(commitments *gabi.IssueCommitmentMessage, scheme irma.SchemeManagerIdentifier) (*gabi.ProofP, error) {
func (session *session) getProofP(commitments *irma.IssueCommitmentMessage, scheme irma.SchemeManagerIdentifier) (*gabi.ProofP, error) {
if session.kssProofs == nil {
session.kssProofs = make(map[irma.SchemeManagerIdentifier]*gabi.ProofP)
}
......
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