error in PKCS11_enumerate_slots from libp11

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

error in PKCS11_enumerate_slots from libp11

Paulo Soto de Miranda
I'm found one error in PKCS11_enumerate_slots from libp11.
There is only one smart card reader connected but this function return 8
readers.
The code and the output are the following:

--------------------------------------------------------------------------
code--------------------------------------------------
returnedValue = PKCS11_enumerate_slots(pkcs11_context,&slots,&slotCount);
    if (returnedValue != 0) {
        cout << "Error getting the numbers of slots";
    }

    cout << "The number of slots is:" << slotCount << endl;
   
    for(unsigned int i = 0;i < slotCount;i++){
        cout << "Slot " << i << ": " << endl;
        cout << "    Manufacturer: " << (slots+i)->manufacturer <<endl;
        cout << "    Description: " << (slots+i)->description <<endl;
        cout << "    Has token: ";
        if((slots+i)->token == NULL) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
--------------------------------------------------------------------------
output--------------------------------------------------

The number of slots is:8
Slot 0:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: Towitoko Chipdrive Micro
        Has token: Yes
Slot 1:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: Towitoko Chipdrive Micro
        Has token: Yes
Slot 2:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: Towitoko Chipdrive Micro
        Has token: Yes
Slot 3:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: Towitoko Chipdrive Micro
        Has token: Yes
Slot 4:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: OpenCT reader (detached)
        Has token: No
Slot 5:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: OpenCT reader (detached)
        Has token: No
Slot 6:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: OpenCT reader (detached)
        Has token: No
Slot 7:
        Manufacturer: OpenSC project (www.opensc.org)
        Description: OpenCT reader (detached)
        Has token: No

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: error in PKCS11_enumerate_slots from libp11 [u]

Andreas Jellinghaus-2
On Friday 26 August 2005 22:07, Paulo Soto de Miranda wrote:
> I'm found one error in PKCS11_enumerate_slots from libp11.
> There is only one smart card reader connected but this function return 8
> readers.
> The code and the output are the following:

no, that is normal. several virtual readers, several virtual slots per reader.

virtual readers: so you can plugin a usb reader to fill that slot.
virtual slots: if a smart card has two different pins, pkcs#11 can't handle
it. we solve that by showing the same card in two slots.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: error in PKCS11_enumerate_slots from libp11 [u]

Douglas de Oliveira Mendes-2
    There shouldn't be a way of asking how many real readers there are?

Andreas Jellinghaus [c] wrote:
On Friday 26 August 2005 22:07, Paulo Soto de Miranda wrote:
  
I'm found one error in PKCS11_enumerate_slots from libp11.
There is only one smart card reader connected but this function return 8 
readers.
The code and the output are the following:
    

no, that is normal. several virtual readers, several virtual slots per reader.

virtual readers: so you can plugin a usb reader to fill that slot.
virtual slots: if a smart card has two different pins, pkcs#11 can't handle
it. we solve that by showing the same card in two slots.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

  

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: error in PKCS11_enumerate_slots from libp11 [u]

Andreas Jellinghaus-2
On Saturday 27 August 2005 01:59, Douglas de Oliveira Mendes wrote:
>     There shouldn't be a way of asking how many real readers there are?

No, pkcs#11 only knows slots. but you can edit opensc.cong and
change num_slots (number of slots per reader) or enable
hide_empty_tokens (show only virtual slots if you have several
pins).

Also I would like to make the number of virtual readers in
openct configureable. if anyone wants to write a patch ... :)

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel