mirror of
https://github.com/arnaucube/go-dvote.git
synced 2026-02-28 05:26:46 +01:00
CensusService: add method field required for signature
Signed-off-by: p4u <p4u@dabax.net>
This commit is contained in:
@@ -43,7 +43,7 @@ The next table shows the available methods and its relation with the fields.
|
|||||||
|
|
||||||
## Signature
|
## Signature
|
||||||
|
|
||||||
The signature provides authentication by signing a concatenation of the following strings (even if empty) without spaces: `censusId rootHash claimData timeStamp`.
|
The signature provides authentication by signing a concatenation of the following strings (even if empty) without spaces: `method censusId rootHash claimData timeStamp`.
|
||||||
|
|
||||||
The `timeStamp` when received on the server side must not differ more than 10 seconds from the current UNIX time.
|
The `timeStamp` when received on the server side must not differ more than 10 seconds from the current UNIX time.
|
||||||
|
|
||||||
|
|||||||
@@ -118,9 +118,9 @@ func opHandler(c *Claim) *Result {
|
|||||||
var err error
|
var err error
|
||||||
|
|
||||||
// Process data
|
// Process data
|
||||||
log.Printf("censusId:{%s} rootHash:{%s} claimData:{%s} proofData:{%s} timeStamp:{%s} signature:{%s}\n",
|
log.Printf("censusId:{%s} method:{%s} rootHash:{%s} claimData:{%s} proofData:{%s} timeStamp:{%s} signature:{%s}\n",
|
||||||
c.CensusID, c.RootHash, c.ClaimData, c.ProofData, c.TimeStamp, c.Signature)
|
c.CensusID, c.Method, c.RootHash, c.ClaimData, c.ProofData, c.TimeStamp, c.Signature)
|
||||||
authString := fmt.Sprintf("%s%s%s%s", c.CensusID, c.RootHash, c.ClaimData, c.TimeStamp)
|
authString := fmt.Sprintf("%s%s%s%s%s", c.Method, c.CensusID, c.RootHash, c.ClaimData, c.TimeStamp)
|
||||||
resp.Error = false
|
resp.Error = false
|
||||||
resp.Response = ""
|
resp.Response = ""
|
||||||
censusFound := false
|
censusFound := false
|
||||||
|
|||||||
Reference in New Issue
Block a user