Skip to content

Commit 42e59e8

Browse files
committed
跨链国密的情况
1 parent bd1e3f9 commit 42e59e8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

kernel/contract/sandbox/cross_query_cache.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,15 @@ func isEndorsorSignValid(signsValid []*pb.SignatureInfo, queryInfo *pb.CrossQuer
248248
//log.Info("Marshal Response failed", "err", err)
249249
return false
250250
}
251-
cryptoClient, err := crypto_client.CreateCryptoClient(crypto_client.CryptoTypeDefault)
251+
//bug(springrain) 需要定义一个参数,用于标示目标链的的加密方式,默认非国密
252+
m := queryInfo.GetRequest().Request.GetArgs()
253+
cryptoType := crypto_client.CryptoTypeDefault
254+
if crypto, ok := m["cryptotype"]; ok {
255+
if string(crypto) == "gm" {
256+
cryptoType = "gm"
257+
}
258+
}
259+
cryptoClient, err := crypto_client.CreateCryptoClient(cryptoType)
252260
data := append(reqData[:], resData[:]...)
253261
digest := hash.UsingSha256(data)
254262
for idx := range signsValid {

0 commit comments

Comments
 (0)