Skip to content

Commit

Permalink
Merge pull request #83 from FissionAndFusion/issues-81-signature
Browse files Browse the repository at this point in the history
UPD(gateway): change service-req signature
  • Loading branch information
mytharcher authored Nov 12, 2018
2 parents 0f4a2d4 + 06f22e7 commit cbb5b16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/gateway/mqtt/serviceReq.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ func VerifyAddress(s *ServicePayload, payload []byte) bool {
if uint8(s.Address[0]) == 1 {
// 验证签名
log.Printf("VerifyAddress with address type = 1 \n")
return edwards25519.Verify(s.Address[1:], payload[:messageLen], s.ServSignature)
signatureHash := blake2b.Sum256(payload[:messageLen])
return edwards25519.Verify(s.Address[1:], signatureHash[:], s.ServSignature)
}
log.Printf("VerifyAddress with address type = 2 \n")
// 验证 模版地址
Expand Down

0 comments on commit cbb5b16

Please sign in to comment.