Re: How to create minidriver on OpenSC

Frank Morgner <[email protected]> Fri, 25 Nov 2022 12:43:35 +0100
Newsgroups gmane.comp.encryption.opensc.devel
Message-ID <CAO8bUynoj=uDzmmoM8qFdM2Jr2ZM9tCdXfbXgMogyqgVpcdLQA@mail.gmail.com>
Does your token work with `pkcs11-tool --test --login` and your configuration?

You need to make debug_file an absolute path, otherwise the
application uses some home directory which may be quite obscure in
some cases. opensc-minidriver.dll is loaded into the applications
memory space, say iexplore.exe, for example. You can attach to that
process and set a breakpoint in some minidriver function.

for OpenSC, you need to modify the registry so that your token is
recognized by the OpenSC MD, see
https://github.com/OpenSC/OpenSC/wiki/MS-BaseCSP-MiniDriver-(for-Windows-XP,-Windows-Vista,-Windows-7)

for PIV, you may need to disable the Windows' builtin MD for PIV.
(disable smartcard plug&play)

Regards, Frank.

Am Fr., 25. Nov. 2022 um 11:08 Uhr schrieb Cui Alan <[email protected]>:
>
> Hi,
> I'm the developer of the Minidriver of Canokey(https://www.canokeys.org/)
> I recently build OpenSC 0.22.0. Using /DDEBUG and following conf file:
>
> app default {
>        debug = 100;
>        debug_file = opensc-debug.txt;
> }
> app cardmod {
>        debug = 1000;
>        debug_file = opensc-debug.txt;
>        framework pkcs15 {
>               # use_file_caching = public;
>        }
>        reader_driver pcsc {
>        }
>        card_atr 3b:f7:11:00:00:81:31:fe:65:43:61:6e:6f:6b:65:79:99 {
>               name = "Canokey Piegon";
>               driver = "PIV-II";
>               flags = "keep_alive";
>        }
> }
> And I got no output both in C:/tmp and C:\Program Files\OpenSC Project\OpenSC\tools\opensc-debug.txt
> At the same time, the notice of pluging in popped out as normal.
> I have no idea about how to config or debug it.
> Thank you.
>
> Alan.
>
>
>
> _______________________________________________
> Opensc-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel