Commit 63e7d5ac authored by duanjinfei's avatar duanjinfei

change sign

parent 7a1ea28c
...@@ -3,6 +3,7 @@ package controllers ...@@ -3,6 +3,7 @@ package controllers
import ( import (
"bytes" "bytes"
"crypto/ecdsa" "crypto/ecdsa"
"crypto/rand"
"encoding/json" "encoding/json"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -27,7 +28,7 @@ func (c *LLMController) GetContainerSign() { ...@@ -27,7 +28,7 @@ func (c *LLMController) GetContainerSign() {
signPrv := beego.AppConfig.String("sign_prv") signPrv := beego.AppConfig.String("sign_prv")
bridgePrv := stringToPrivateKey(signPrv) bridgePrv := stringToPrivateKey(signPrv)
hash := crypto.Keccak256Hash(bytes.NewBufferString(signData.TaskId).Bytes()) hash := crypto.Keccak256Hash(bytes.NewBufferString(signData.TaskId).Bytes())
signature, err := ecdsa.SignASN1(nil, bridgePrv, hash.Bytes()) signature, err := ecdsa.SignASN1(rand.Reader, bridgePrv, hash.Bytes())
if err != nil { if err != nil {
return return
} }
......
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