GmSSL icon indicating copy to clipboard operation
GmSSL copied to clipboard

请教sm2证书签名中Z值的id字段是否是证书的serial number

Open BoltedSnail opened this issue 9 years ago • 9 comments

Z=H256(ID长度+ID+a+b+gx+gy+公钥x+公钥y)

BoltedSnail avatar May 19 '17 11:05 BoltedSnail

两者间没有关系

guanzhi avatar May 19 '17 11:05 guanzhi

“1234567812345678”吧

eshrf avatar May 23 '17 07:05 eshrf

把ID换成“0x31……0x38,0x31……0x38”计算z值,再计算sm3(z值+m),验签还是失败了

BoltedSnail avatar May 23 '17 07:05 BoltedSnail

应该是1234567887654321 发自网易邮箱大师 在2017年05月23日 15:51,BoltedSnail 写道: 把ID换成“0x31……0x38,0x31……0x38”计算z值,再计算sm3(z值+m),验签还是失败了 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

songgeng87 avatar May 23 '17 08:05 songgeng87

经验证,1234567887654321也失败了,我的证书是cfca签发的,他们也用默认的用户ID吗

BoltedSnail avatar May 23 '17 08:05 BoltedSnail

《GM/T 0003.5--2012 》文档中给出的ID值为 “1234567812345678”,我实现的算法中,证书验证以及SSL握手均可行。 你的签名算法实现是否有问题呢?

AivenYoung avatar May 23 '17 09:05 AivenYoung

签名算法在我自己写的demo里用国密局的例子验过了,集成到openssl里的验签步骤和关老师的步骤、自己的demo里的步骤对照了两遍,是符合的。请问您验签通过的证书是哪个机构签发的

BoltedSnail avatar May 23 '17 09:05 BoltedSnail

我是做的SSL握手,验证服务器端证书为 https://ebssec.boc.cn中行使用的国密证书。应该是CFCA签发的。

AivenYoung avatar May 23 '17 09:05 AivenYoung

id是1234567812345678,我把gmssl的ecdsa_do_verify替换过去,然后就验签通过了,捂脸.jpg

BoltedSnail avatar May 23 '17 11:05 BoltedSnail