Bug 1089476 - Firefox crashes when using opensc-pkcs11 authentication module
Summary: Firefox crashes when using opensc-pkcs11 authentication module
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: 20
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Gecko Maintainer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-19 13:42 UTC by Luca Giuzzi
Modified: 2014-04-28 12:17 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-28 12:17:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Mozilla Foundation 998786 0 None None None Never

Description Luca Giuzzi 2014-04-19 13:42:42 UTC
Description of problem:

The pkcs#11 opensc plugin corrupts the memory of firefox; it is thus unusable.

Version-Release number of selected component (if applicable):

opensc-0.13.0-11.fc20.x86_64
firefox-28.0-3.fc20.x86_64

[I have the same problem with the 32 bit version of the packages, though]


How reproducible:

Try to authenticate using a smartcard; the browser prompts for the pin of
the card and shows the relative certificate; however, after the data have been
confirmed, the memory of the browser is corrupted and either

a) there is a segmentation fault and firefox closes
b) no SSL using site is accessible and the error
security library: memory allocation failure
is presented


Steps to Reproduce:
1. try to authenticate using a smartcard (pkcs#11, via opensc) on some site

Actual results:

Firefox crashes

Expected results:

Authentication is successful and firefox does not crash.

Additional info:

The card reader I use is
Bus 006 Device 004: ID 058f:9520 Alcor Micro Corp. EMV Certified Smart Card Reader

The actual smartcard is the italian "Regione lombardia CNS" (which is supported by opensc as "Italian CNS/CNR"). 

I point out that this configuration used to work last time I checked (I reckon it was between 4 and 6 months ago).

Comment 1 Luca Giuzzi 2014-04-19 13:48:25 UTC
The error messages presented by firefox (when it does not crash right away) upon attempting a secure connection are:

a) 
An error occurred during a connection to serviziweb2.inps.it. Received incorrect handshakes hash values from peer. (Error code: ssl_error_bad_handshake_hash_value)

b)
An error occurred during a connection to serviziweb2.inps.it. security library: memory allocation failure. (Error code: sec_error_no_memory)

Actually, I suppose that the first error is due to memory corruption rather than a wrong hash being sent from the peer.

Comment 2 Luca Giuzzi 2014-04-19 14:15:07 UTC
I have also opened an issue on the OpenSC bug tracker:
https://github.com/OpenSC/OpenSC/issues/232

Comment 3 Luca Giuzzi 2014-04-20 09:45:25 UTC
I add some further detail; perhaps the problem is with firefox NSS interface rather than opensc.

1) running opensc with debug options does not show anything abnormal
2) I have the exact same problem with the aurora version of firefox
3) usign opensc with google-chrome  (after I enabled it with the following
modutil -dbdir sql:.pki/nssdb/ -add "OpenSC" -libfile /usr/lib64/pkcs11/opensc-pkcs11.so
)
does not show any corruption.

Comment 4 Nikos Mavrogiannopoulos 2014-04-21 12:46:59 UTC
Should that be reassigned to firefox then?

Note that the authors of opensc have a mode called opensc-onepin that enables some hacks especially for firefox. I don't know whether that is relevant with your case though: https://bugzilla.redhat.com/show_bug.cgi?id=1077167#c3

Comment 5 Luca Giuzzi 2014-04-21 15:48:14 UTC
I agree that the bug should be reassigned.

Comment 6 Luca Giuzzi 2014-04-21 15:49:13 UTC
(actually I have filed in the above referenced bug report on their bugzilla)

Comment 7 Martin Stransky 2014-04-28 12:17:49 UTC
Let's track this upstream.


Note You need to log in before you can comment on or make changes to this bug.