Comments (4)
Look like OpenSSL doesn't provide any error message with some malformed public keys. Will dive into it when I have enough free time. Thanks for your report.
from lua-resty-rsa.
@zcong2333
我追了下 OpenSSL 的内部实现,发现在 PEM_read_bio
里面,如果 EVP_DecodeFinal
没有更新传进去的长度参数,那么就不会有报错。这一块应该是 OpenSSL 实现的问题。我改了下代码,如果 OpenSSL 没有提供错误信息,那么返回一个 "internal error"。
另外,对于 -----BEGIN PUBLIC
开头的公钥,记得加上 key_type = resty_rsa.KEY_TYPE.PKCS8,
,参考文档:
https://github.com/spacewander/lua-resty-rsa#new
from lua-resty-rsa.
@spacewander
好的,多谢提醒。多问一句,我这边更新版本就可以了吧
from lua-resty-rsa.
我更新了rsa.lua.可以了。多谢
from lua-resty-rsa.
Related Issues (20)
- 当前库无法用私钥解密其他js库加密的密文 HOT 4
- The opm package contains unwanted files HOT 2
- how sign or verify with specified charset, GBK? HOT 2
- failed to encrypt client secret: wrong tag: nested asn1 error: Type=RSA: ASN1 lib HOT 2
- 如何让这个库接受二进制加密内容 HOT 3
- Support OpenResty 1.17.8 and OpenSSL 1.1.1 HOT 1
- 有时候会一直报 Unknown message digest HOT 1
- 需求
- Luarocks.org reflects version 0.04 only HOT 7
- verify(): verify err: wrong signature length
- 支付宝开放平台开发助手 生成的公私钥对(pkcs#1)格式问题 HOT 5
- 请问是否支持PSS_PADDING模式呢 HOT 1
- support lua version HOT 1
- 请问怎么在apisix中使用
- Couldn't extract archive, unrecognized filename extension
- "data greater than mod len" 异常错误 HOT 2
- Decrypted err: wrong tag: nested asn1 error: nested asn1 error: Field=n, Type=RSA: RSA lib: data greater than mod len HOT 1
- 加密后都是乱码 HOT 1
- 私钥加密需求(private key encrypt demand) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-resty-rsa.