mirror of
https://gitee.com/BTAJL/repchain.git
synced 2024-12-05 05:08:29 +08:00
fix: signUpAllTypeCertificate的hash需要加上NetID
This commit is contained in:
parent
503995527b
commit
1e7a4d0767
@ -67,7 +67,7 @@ object CertOperation extends DidOperation {
|
||||
} else if (customCert.certType.isCertAuthentication || customCert.certType.isCertUndefined) {
|
||||
// 身份校验证书通过signer注册指定,或通过 signUpAllTypeCertificate
|
||||
throw ContractException(toJsonErrMsg(canNotSignUpAuthCertificate))
|
||||
} else if (!ctx.api.getSha256Tool.hashstr(ctx.api.getChainNetId+IdTool.DIDPrefixSeparator+IdTool.deleteLine(customCert.certificate)).equals(customCert.certHash)) {
|
||||
} else if (!ctx.api.getSha256Tool.hashstr(ctx.api.getChainNetId + IdTool.DIDPrefixSeparator + IdTool.deleteLine(customCert.certificate)).equals(customCert.certHash)) {
|
||||
throw ContractException(toJsonErrMsg(hashNotMatch))
|
||||
} else {
|
||||
ctx.api.setVal(certKey, customCert)
|
||||
@ -133,7 +133,7 @@ object CertOperation extends DidOperation {
|
||||
val certHashKey = hashPrefix + customCert.certHash
|
||||
if (ctx.api.getVal(certKey) != null || ctx.api.getVal(certHashKey) != null) {
|
||||
throw ContractException(toJsonErrMsg(certExists))
|
||||
} else if (!ctx.api.getSha256Tool.hashstr(IdTool.deleteLine(customCert.certificate)).equals(customCert.certHash)) {
|
||||
} else if (!ctx.api.getSha256Tool.hashstr(ctx.api.getChainNetId + IdTool.DIDPrefixSeparator + IdTool.deleteLine(customCert.certificate)).equals(customCert.certHash)) {
|
||||
throw ContractException(toJsonErrMsg(hashNotMatch))
|
||||
} else {
|
||||
ctx.api.setVal(certKey, customCert)
|
||||
|
Loading…
Reference in New Issue
Block a user