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

pod导入后 调用sm2加密 结果返回nil #10

Closed
MYStrict opened this issue Mar 20, 2020 · 4 comments
Closed

pod导入后 调用sm2加密 结果返回nil #10

MYStrict opened this issue Mar 20, 2020 · 4 comments

Comments

@MYStrict
Copy link

你好,首先表达感谢,可以有这么好的工具用来使用国密相关加解密。
现在遇到问题,我在导入 GMObjc 后,使用sm2加密 ,返回结果为nil,通过断点调试,发现EC_GROUP *group = EC_GROUP_new_by_curve_name(NID_sm2); // 椭圆曲线
返回结果 group 为null,但是我单独新建demo调试的时候,是可以加密成功的
不知道什么原因,请大神解惑

@muzipiao
Copy link
Owner

这是由于你项目中可能有多个 OpenSSL 库,且另外一个版本小于 1.1.1 版本,并且低版本的编译顺序在前,将低版本 OpenSSL 库移除,使用目前最新的 1.1.1c 版本即可。
使用 pod 集成 GMObjC 时,会自动集成我编译好的 OpenSSL 1.1.1c 版本的库,把项目中旧版本 OpenSSL 库去掉即可。

@MYStrict
Copy link
Author

您的意思是说我项目中本身含有openssl库,但是我看了我的pod文件,并没有包含啊
pod 'MBProgressHUD', '> 1.0.0'
pod 'Reachability', '
> 3.2'
pod 'CocoaAsyncSocket', '> 7.5.0'
pod 'Masonry', '
> 1.0.1'
pod 'AFNetworking', '> 3.1.0'
pod 'MJRefresh', '
> 3.1.12'
pod 'SobotKit'
pod 'MJExtension'
pod 'Bugly'
pod 'BMKLocationKit'
pod 'BaiduMapKit'
这是项目目前用到的三方库
可以加个联系方式吗(qq:1650880533)

@muzipiao
Copy link
Owner

是项目中可能依赖的已有编译旧版 OpenSSL 库,例如阿里的 IFAAOpenSSL.framewok。
加你 QQ 了,注意一下。

@LCBbest
Copy link

LCBbest commented May 11, 2020

请问解决了吗 我也引入百度地图了,导致百度地图初始化失败

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

3 participants