Unpacking search (SearchIter) fails with PK data from Nexus Personal
还没有人认领这个 Issue。
评估
调研方向
Reproduce the failure with the shown SearchIter usage and inspect pkcs11/_utils.pyx:_unpack_attributes, pkcs11/_pkcs11.pyx:Object.getitem, and SearchIter.next. Determine how the Nexus Personal PKCS11 data reaches the boolean unpacking path, then verify that list(q) completes without the reported struct.error or cleanup exception.
由索引模型根据 Issue 内容生成。
描述
Using this code on version 0.7.0:
pk_query_params = {
pkcs11.Attribute.CLASS: pkcs11.ObjectClass.PRIVATE_KEY
}
q = session.get_objects(pk_query_params)
results = list(q)
on Nexus Personal PKCS11 driver fails with:
results = list(q)
File "pkcs11/_pkcs11.pyx", line 322, in pkcs11._pkcs11.SearchIter.__next__
File "pkcs11/_pkcs11.pyx", line 692, in pkcs11._pkcs11.Object._make
File "pkcs11/_pkcs11.pyx", line 723, in pkcs11._pkcs11.Object.__getitem__
File "pkcs11/_utils.pyx", line 35, in pkcs11._pkcs11._unpack_attributes
File "/home/miha/.local/lib/python3.10/site-packages/pkcs11/defaults.py", line 116, in <lambda>
_bool = (Struct('?').pack, lambda v: Struct('?').unpack(v)[0])
struct.error: unpack requires a buffer of 1 bytes
Exception ignored in: <cyfunction SearchIter.__del__ at 0x7f58cf9cea80>
Traceback (most recent call last):
File "pkcs11/_pkcs11.pyx", line 326, in pkcs11._pkcs11.SearchIter.__del__
File "pkcs11/_pkcs11.pyx", line 336, in pkcs11._pkcs11.SearchIter._finalize
File "pkcs11/_errors.pyx", line 88, in pkcs11._pkcs11.assertRV
pkcs11.exceptions.SessionHandleInvalid:
- 主要语言
- Python
- 星标
- 171
- 派生
- 79
- 平均合并
- 14 小时 23 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pyauth/python-pkcs11 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
pyauth/python-pkcs11#225 ·
-
难度 4/5 3-5 天 新手友好度 35/100
pyauth/python-pkcs11#233 ·
-
难度 3/5 1-2 天 新手友好度 55/100
pyauth/python-pkcs11#228 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
pyauth/python-pkcs11#220 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
pyauth/python-pkcs11#211 · 1 条评论 ·
查看 pyauth/python-pkcs11 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
ok-oldking/ok-wuthering-waves#1785 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
healthchecks/healthchecks#1349 ·
-
deployment release-lag
难度 1/5 1 小时以内 新手友好度 68/100
nolte/kamerplanter#2374 ·
维护者通常 1 天内回复
-
bug v1 v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/python-sdk#3725 ·
维护者通常 1 天内回复
-
batchterms() drops queries without a similar() clause, misaligning results with inputs可能已有人在做 @MohammadHijjawi97 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复