Skip to content
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

python下导出主密钥报OSError: exception: access violation writing 0x0000000000000024 #9

Open
Jinkeee opened this issue Nov 22, 2023 · 11 comments

Comments

@Jinkeee
Copy link

Jinkeee commented Nov 22, 2023

python下导出主密钥报OSError: exception: access violation writing 0x0000000000000024‘;
image
请问该如何解决?

@sqs404
Copy link

sqs404 commented Dec 31, 2023

同问

@KKKGod
Copy link

KKKGod commented Jan 2, 2024

同问,sm9 sm2 的test都是这个类似问题

@monkeyyang
Copy link

也是遇到了这个问题,请问楼主解决了吗?
gmssl.sm2_private_key_info_decrypt_from_pem(byref(self), c_char_p(passwd), c_void_p(fp)) != 1:
OSError: exception: access violation writing 0x0000000000000024

1 similar comment
@99tyw
Copy link

99tyw commented Mar 26, 2024

也是遇到了这个问题,请问楼主解决了吗?
gmssl.sm2_private_key_info_decrypt_from_pem(byref(self), c_char_p(passwd), c_void_p(fp)) != 1:
OSError: exception: access violation writing 0x0000000000000024

@yujingyue9166
Copy link

同问

@j-z10
Copy link

j-z10 commented Mar 28, 2024

you guys should install GmSSLv3.1.1 instead of GmSSL@master

git clone -b 'v3.1.1' --depth 1 https://github.com/guanzhi/GmSSL.git
cd GmSSL && mkdir build && cd build && cmake ..
make && make test && sudo make install
sudo ldconfig

# check it's version. should be GmSSL 3.1.1
gmssl version

@monkeyyang
Copy link

monkeyyang commented Mar 28, 2024

感谢您的回复!
遇到了一个新的问题,在Windows下Visual Studio命令提示符下执行:

mkdir build
cd build
cmake .. -G "NMake Makefiles"
nmake
D:\wwwroot\GmSSL\build>nmake

报以下错误,请问如何解决呢?

[ 1%] Building C object CMakeFiles/gmssl.dir/src/tls.c.obj
tls.c
D:\wwwroot\GmSSL\src\tls.c(2323): warning C4013: “fcntl”未定义;假设外部返回 int
D:\wwwroot\GmSSL\src\tls.c(2323): error C2065: “F_GETFL”: 未声明的标识符
D:\wwwroot\GmSSL\src\tls.c(2328): error C2065: “O_NONBLOCK”: 未声明的标识符
NMAKE : fatal error U1077: “"C:\Program Files\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\gmssl.dir\src\tls.c.obj.d --working-dir=D:\wwwroot\GmSSL\build --filter-prefix="注意: 包含文件: " -- C:\PROGRA1\MIB0551\2022\COMMUN1\VC\Tools\MSVC\14371.328\bin\Hostx86\x86\cl.exe @C:\Users\YANGYA~1\AppData\Local\Temp\nm7200.tmp”: 返回代 码“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x86\nmake.exe" -s -f CMakeFiles\gmssl.dir\build.make /nologo -SL CMakeFiles\gmssl.dir\build”: 返回代 码“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x86\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S all”: 返回代码“0x2”
Stop.

@Zhanghanhan1
Copy link

同问 已安装gmssl3.1.1和gmssl-python

@j-z10
Copy link

j-z10 commented Mar 30, 2024

you guys should install GmSSLv3.1.1 instead of GmSSL@master

git clone -b 'v3.1.1' --depth 1 https://github.com/guanzhi/GmSSL.git
cd GmSSL && mkdir build && cd build && cmake ..
make && make test && sudo make install
sudo ldconfig

# check it's version. should be GmSSL 3.1.1
gmssl version

看起来是windows下 pem_write 和 pem_read 导致的问题,我这个PR针对windows做了临时处理,把这一步放在python里面执行
你们可以参考一下 j-z10/pygmssl#9

@FloocX
Copy link

FloocX commented Mar 31, 2024

这不是一个包吧,j-z10师傅

@FloocX
Copy link

FloocX commented Apr 1, 2024

j-z10师傅给出的代码是pygmssl的,我试了一下,是可以用的,感谢师傅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants