Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

DNIe 4.0: `C_Sign` fails with `CKR_USER_NOT_LOGGED_IN` after successful login

未关闭
#3,613 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

  • #3614 来自 @cprecioso —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
c
领域
security

调研方向

Start by reproducing the failure with pkcs11-tool --test --login --pin <PIN> -v using a DNIe 4.0 card, then trace the C_Sign path and how login state is handled between consecutive signatures. The issue reports that the first signature succeeds and the second returns CKR_USER_NOT_LOGGED_IN; done means all signature tests pass in the same session.

由索引模型根据 Issue 内容生成。

描述

bug Input needed
Describe the bug

After a successful C_Login, the second C_Sign operation fails with CKR_USER_NOT_LOGGED_IN (0x101). The first signature succeeds, but any subsequent signature in the same session fails.

Steps to reproduce
  1. Insert DNIe 4.0 card
  2. Run pkcs11-tool --test --login --pin <PIN> -v
Expected behavior

All signature tests pass.

Actual behavior

The first signature succeeds, but the second fails:

Signatures (currently only for RSA)
  testing key 0 (KprivAutenticacion)
error: PKCS11 function C_Sign failed: rv = CKR_USER_NOT_LOGGED_IN (0x101)
Aborting.
OpenSC version

master (at 34d750a)

Operating system

macOS Tahoe 26.3.1 (25D2128)

Smart card model or security token

DNIe 4.0

Application used with smart card

pkcs11-tool

Logs and debug output
C_SeedRandom() and C_GenerateRandom():
  seeding (C_SeedRandom) not supported
  seems to be OK
Digests:
  all 4 digest functions seem to work
  MD5: OK
  RIPEMD160: OK
  SHA-1: OK
  SHA256: OK
Signatures (currently only for RSA)
  testing key 0 (KprivAutenticacion) 
error: PKCS11 function C_Sign failed: rv = CKR_USER_NOT_LOGGED_IN (0x101)
Aborting.
Checklist
  • I am using a supported OpenSC version
  • I have searched existing issues to avoid duplicates
主要语言
C
星标
3.1k
派生
858
平均合并
4 天 4 小时
30 天内合并 PR
16

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenSC/OpenSC 的其他 Issue

查看 OpenSC/OpenSC 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。