mirror of
https://github.com/arnaucube/go-dvote.git
synced 2026-02-27 21:16:43 +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
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -118,9 +118,9 @@ func opHandler(c *Claim) *Result {
|
||||
var err error
|
||||
|
||||
// Process data
|
||||
log.Printf("censusId:{%s} rootHash:{%s} claimData:{%s} proofData:{%s} timeStamp:{%s} signature:{%s}\n",
|
||||
c.CensusID, 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)
|
||||
log.Printf("censusId:{%s} method:{%s} rootHash:{%s} claimData:{%s} proofData:{%s} timeStamp:{%s} signature:{%s}\n",
|
||||
c.CensusID, c.Method, c.RootHash, c.ClaimData, c.ProofData, c.TimeStamp, c.Signature)
|
||||
authString := fmt.Sprintf("%s%s%s%s%s", c.Method, c.CensusID, c.RootHash, c.ClaimData, c.TimeStamp)
|
||||
resp.Error = false
|
||||
resp.Response = ""
|
||||
censusFound := false
|
||||
|
||||
Reference in New Issue
Block a user