Ubuntu 22.04虚拟机无法识别Gemalto Gemplus虚拟智能卡,AlmaLinux 9可正常识别
Ubuntu 22.04虚拟机无法识别Gemalto Gemplus虚拟智能卡,AlmaLinux 9可正常识别
我最近碰到个头疼的问题:用libvirt的智能卡模块给Ubuntu 22.04虚拟机挂载虚拟智能卡,结果虚拟机完全识别不了这张卡;但一模一样的配置换到AlmaLinux 9虚拟机里,智能卡却能正常被识别。
一开始我在Ubuntu 22.04里执行了这条命令排查:
pkcs11-tool --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so -L
得到的反馈是:
Slot 0 (0x0): Gemalto Gemplus USB SmartCard Reader 433-Swap [CCID interface...
(token not recognized)
后来折腾了半天发现,问题出在Ubuntu 22.04自带的libccid库上——系统预装的是1.5.0-2版本。我自己编译了1.4.34版本的libccid,替换掉系统里的libccid.so文件后,一切就正常了!
替换完重新执行之前的命令,就能看到智能卡被正确识别的输出了:
Available slots: Slot 0 (0x0): Gemalto Gemplus USB SmartCard Reader 433-Swap [CCID Interface... token label : cert1 token manufacturer : Common Access Card token model : PKCS#15 emulated token flags : login required, PIN pad present, rng, token initialized, PIN initialized hardware version : 0.0 firmware version : 0.0 serial num : 22ef84d3518c711b pin min/max : 4/8
目前还不确定具体原因,不知道是libccid 1.5.0-2版本存在代码回归,还是编译参数有问题,或者单纯是和我的虚拟智能卡不兼容。
备注:内容来源于stack exchange,提问作者silverduck
相关产品推荐
相关产品推荐

