Skip to content
GitLab
Menu
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
7b612610
Commit
7b612610
authored
May 10, 2018
by
Sietse Ringers
Browse files
Remove pointer from IrmaSignedMessage.Signature
parent
183c7256
Changes
4
Hide whitespace changes
Inline
Side-by-side
irma_signature.go
View file @
7b612610
...
...
@@ -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"`
...
...
requests.go
View file @
7b612610
...
...
@@ -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
,
...
...
timestamp.go
View file @
7b612610
...
...
@@ -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
...
...
verify.go
View file @
7b612610
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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