OpenSC/OpenSC — pull request #31 by hongquan (2012-05-03 08:26:43+00:00)
Title: Fix a crash when trying to list objects via opensc-pkcs11

When listing objects on uninitialized CryptoStick, I saw opensc-pkcs11 crash when trying to get Modulus_bits of pubkey:
$ pkcs11-tool --module=/usr/lib/opensc-pkcs11.so -O -l
Using slot 1 with a present token (0x1)
Logging in to "OpenPGP Card (Signature PIN)".
Please enter User PIN:
Private Key Object; RSA
label: Signature key
ID: 01
Usage: sign
Segmentation fault
After fix:
$ pkcs11-tool --module=/usr/lib/opensc-pkcs11.so -O -l
Using slot 1 with a present token (0x1)
Logging in to "OpenPGP Card (Signature PIN)".
Please enter User PIN:
Private Key Object; RSA
label: Signature key
ID: 01
Usage: sign
Public Key Object; RSA 0 bits
label: Signature key
ID: 01
Usage: verify