-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
国密TLS1.1构造certificateverify时,握手数据为何做了2次sm3哈希? #12
Comments
rfc5246规范里是digitally-signed(msg);0024里面是digitally-signed(sm3(msg)) |
digitally-signed操作包含摘要和签名 |
tls1.1(rfc 4346) 4.7章节找到了如下描述,0024是基于rfc4346,但是没有如下章节,所以也造成了歧义。 4.7. Cryptographic Attributes In digital signing, one-way hash functions are used as input for a In RSA signing, a 36-byte structure of two hashes (one SHA and one Note: The standard reference for PKCS#1 is now RFC 3447 [PKCS1B]. In DSS, the 20 bytes of the SHA hash are run directly through the |
@xbguo 在0024和tlcp里,服务端的签名数据和客户端的签名数据是不一样的。需要注意区分。 |
@yanshichao0226 @zzl360 多谢二位回复 在tls1.0(rfc2246)和tls1.1(rfc4346)中都使用了“digitally-signed struct ”字样,但是在https://www.rfc-editor.org/rfc/rfc4346#section-4.7 章节,又对签名做了描述,直接进行私钥加密,查看openssl的实现,也确实没有做额外的哈希。 这可能是造成对“digitally-signed struct ”理解不一样的原因,但额外最一次哈希看上去确实很奇怪。 PS:按我目前的认知,觉得签名需要做哈希,主要原因是公钥算法太耗时,从这个角度看再做一次哈希也不会再有改善了,出于好奇,才查了一下SM2签名相关的文档,在各位的回复后,我才意识到方向是错的,需要查看0024和TLCP,因为这2个标准规定对什么数据进行签名,与RFC对比后发现了上面的不同。 |
@yanshichao0226 |
查询了国密相关标准,sm2签名时,Z值生产涉及1次哈希,但是不包含待签名数据,待签名数据理论上只参与1次哈希。
The text was updated successfully, but these errors were encountered: