GmSSL icon indicating copy to clipboard operation
GmSSL copied to clipboard

支持国密SM2/SM3/SM4/SM9/SSL的密码工具箱

Results 336 GmSSL issues
Sort by recently updated
recently updated
newest added

目前在mac电脑上编译出的dylib是x86_64架构的。 Non-fat file: libgmssl.3.0.dylib is architecture: x86_64 想要编译出arm64架构的,要怎么操作?

这个函数的声明了一个int型的type变量,但是实际只写入了最低字节,高三字节是未知的,使用时会出异常,应该改成uin8_t。

如果证书的时间超过2038年,解析出来的时间会变成1970年。 这个接口timegm会返回-1。 cygwin 32位有问题,64位不会。

```bash /root/GmSSL-master/php/ext/openssl/xp_ssl.c: 在函数‘php_openssl_tcp_sockop_accept’中: /root/GmSSL-master/php/ext/openssl/xp_ssl.c:2342:29: 错误:自增操作数必须是左值 GC_REFCOUNT(stream->ctx)++; ``` > 此问题 #782 ,2019 年提出来的问题,到现在还没有修复。 ```bash # xp_ssl.c 2339 static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *sock, php_stream_xport_param *xparam STREAMS_DC) /* {{{ */ {...

SM9_encrypt(加密) 调用 SM9_wrap_key(封装) ,入参keylen = inlen + EVP_MD_size(md); 根据《GM∕T 0044.4-2016 SM9标识密码算法 第4部分:密钥封装机制和公钥加密算法.pdf 》 文档中封装是整个k是否为0,加密只需要k的mlen部分不全为0 实际加密代码SM9_encrypt没有判断mlen而是和封装一样判断k了 详见下面文档和代码截图。 封装的流程 ![image](https://user-images.githubusercontent.com/35227072/165895922-7472c29a-7825-48ba-8cb6-7a8b3100b9c5.png) 加密的流程 ![image](https://user-images.githubusercontent.com/35227072/165895900-a3949ab5-bdc9-4eaa-8921-9e15d7e87cc7.png) 代码:sm9_enc.c 封装判断非0 ![image](https://user-images.githubusercontent.com/35227072/165896873-15eb89bb-253e-4d2f-9a2f-9820c6ba9a20.png) 加密判断非0的长度入参 ![image](https://user-images.githubusercontent.com/35227072/165896962-86b92638-25ee-4984-a377-be78f4e3aab2.png)

服务端配置 ![image](https://user-images.githubusercontent.com/92156397/165210386-0c36acc8-7941-4c56-8e15-fa64062d2695.png) 这个是用服务器上充当客户端的返回 [root@localhost sm2Certs]# gmssl s_client -connect localhost:443 -key ./CS.key.pem -cert ./CS.cert.pem -CAfile ./CA.cert.pem [GMTLS_DEBUG] set sm2 signing certificate [GMTLS_DEBUG] set sm2 signing private key CONNECTED(00000003) depth=1 C =...

``` test_ctr32(): if (memcmp(out1, out2, sizeof(out1)) != 0) { error_print(); return -1; // it always returns -1 now } return 0; ``` ``` test_sm4(): if (!test_ctr32(0)) { // (!-1) is...

Signed-off-by: DavidLiu

修改了密码套件 SM9-WITH-SMS4-SM3 握手过程中的 bug。

**Describe the bug** ./Configure enable-skfeng 之后进行make 编译会出错,在engine中找不到e_skf.c

no-issue-activity