Commit 7b612610 authored by Sietse Ringers's avatar Sietse Ringers

Remove pointer from IrmaSignedMessage.Signature

parent 183c7256
......@@ -12,9 +12,8 @@ import (
// IrmaSignedMessage is a message signed with an attribute-based signature
// The 'realnonce' will be calculated as: SigRequest.GetNonce() = ASN1(sha256(message), sha256(nonce))
// // TODO: remove pointer from Signature
type IrmaSignedMessage struct {
Signature *gabi.ProofList `json:"signature"`
Signature gabi.ProofList `json:"signature"`
Nonce *big.Int `json:"nonce"`
Context *big.Int `json:"context"`
Message string `json:"message"`
......
......@@ -345,7 +345,7 @@ func (sr *SignatureRequest) SignatureFromMessage(message interface{}) (*IrmaSign
}
return &IrmaSignedMessage{
Signature: &signature,
Signature: signature,
Nonce: sr.Nonce,
Context: sr.Context,
Message: sr.Message,
......
......@@ -58,10 +58,10 @@ func VerifyTimestamp(irmaSignature *IrmaSignedMessage, message string, conf *Con
// Extract the disclosed attributes and randomized CL-signatures from the proofs in order to
// construct the nonce that should be signed by the timestamp server.
zero := big.NewInt(0)
size := len(*irmaSignature.Signature)
size := len(irmaSignature.Signature)
sigs := make([]*big.Int, size)
disclosed := make([][]*big.Int, size)
for i, proof := range *irmaSignature.Signature {
for i, proof := range irmaSignature.Signature {
proofd := proof.(*gabi.ProofD)
meta := MetadataFromInt(proofd.ADisclosed[1], conf)
sigs[i] = proofd.A
......
......@@ -233,7 +233,7 @@ func addExtraAttributes(disclosed DisclosedCredentialList, proofResult *ProofRes
// Check an gabi prooflist against a signature proofrequest
func checkProofWithRequest(configuration *Configuration, irmaSignature *IrmaSignedMessage, sigRequest *SignatureRequest) *SignatureProofResult {
disclosed, err := extractDisclosedCredentials(configuration, *irmaSignature.Signature)
disclosed, err := extractDisclosedCredentials(configuration, irmaSignature.Signature)
if err != nil {
fmt.Println(err)
......@@ -310,7 +310,7 @@ func VerifySig(configuration *Configuration, irmaSignature *IrmaSignedMessage, s
}
// Now, cryptographically verify the signature
if !verify(configuration, *irmaSignature.Signature, sigRequest.GetContext(), sigRequest.GetNonce(), true) {
if !verify(configuration, irmaSignature.Signature, sigRequest.GetContext(), sigRequest.GetNonce(), true) {
return &SignatureProofResult{
ProofResult: &ProofResult{
ProofStatus: INVALID_CRYPTO,
......@@ -332,12 +332,12 @@ func VerifySigWithoutRequest(configuration *Configuration, irmaSignature *IrmaSi
}
// Cryptographically verify the signature
if !verify(configuration, *irmaSignature.Signature, irmaSignature.Context, irmaSignature.GetNonce(), true) {
if !verify(configuration, irmaSignature.Signature, irmaSignature.Context, irmaSignature.GetNonce(), true) {
return INVALID_CRYPTO, nil
}
// Extract attributes and return result
disclosed, err := extractDisclosedCredentials(configuration, *irmaSignature.Signature)
disclosed, err := extractDisclosedCredentials(configuration, irmaSignature.Signature)
if err != nil {
fmt.Println(err)
......
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