-
Notifications
You must be signed in to change notification settings - Fork 6
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
Windows环境下SM2调用导入导出密钥函数panic #5
Comments
使用C demo测试了sm2 pem密钥载入,目前用msvc编译demo,工作正常的,但是用mingw64 gcc编译,就会segment fault cgo只能使用gcc编译,就导致了上面的异常 gdb调试堆栈信息: |
|
没有解决,暂时放弃了使用SM2非对称加密的功能,仅使用了SM3 |
由于你题了issue我猜测走win32就会死,绕道mingw就可以。你不提我可能还以为自己倒霉读一份 |
GO version: 1.21.6
GmSSL version: 1.3.1
GmSSL Library version: 3.1.1
调用 gmssl.ImportSm2EncryptedPrivateKeyInfoPem 载入加密私钥时,panic
Exception 0xc0000005 0x1 0x24 0x7ffe12b03aca
PC=0x7ffe12b03aca
signal arrived during external code execution
runtime.cgocall(0x1b6b92, 0xc00007bdc8)
C:/Program Files/Go/src/runtime/cgocall.go:157 +0x3e fp=0xc00007bda0 sp=0xc00007bd68 pc=0x13467e
github.com/GmSSL/GmSSL-Go._Cfunc_sm2_private_key_info_decrypt_from_pem(0xc000010230, 0x15f3b6816a0, 0x7ffe129c8a90)
_cgo_gotypes.go:553 +0x55 fp=0xc00007bdc8 sp=0xc00007bda0 pc=0x1b54f5
github.com/GmSSL/GmSSL-Go.ImportSm2EncryptedPrivateKeyInfoPem.func4(0xc000010230, 0x15f3b6816e0?, 0x7ffe129c8a90?)
C:/Users/froze/go/pkg/mod/github.com/!gm!s!s!l/!gm!s!s!l-!go@v1.3.1/sm2.go:70 +0x54 fp=0xc00007be08 sp=0xc00007bdc8 pc=0x1b5994
github.com/GmSSL/GmSSL-Go.ImportSm2EncryptedPrivateKeyInfoPem({0x1e3993?, 0x189a05?}, {0x1e37b3, 0x8})
另外,windows下所有涉及密钥导入导出到pem的函数,均会panic,相同代码,linux环境无此问题
The text was updated successfully, but these errors were encountered: