Signing certificates become unsusable losing their dbkey pref on the first use.
Categories
(Thunderbird :: Security, defect)
Tracking
(Not tracked)
People
(Reporter: peci1, Unassigned)
Details
(Keywords: regression, regressionwindow-wanted, Whiteboard: [regression:TB5?])
Attachments
(4 files)
| Reporter | ||
Comment 1•8 years ago
|
||
Comment 2•8 years ago
|
||
| Reporter | ||
Comment 3•8 years ago
|
||
| Reporter | ||
Comment 5•7 years ago
|
||
| Reporter | ||
Comment 6•7 years ago
|
||
| Reporter | ||
Comment 7•7 years ago
|
||
| Reporter | ||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
| Reporter | ||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
| Reporter | ||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
| Reporter | ||
Comment 16•7 years ago
|
||
| Reporter | ||
Comment 17•7 years ago
|
||
| Reporter | ||
Comment 18•7 years ago
|
||
Comment 19•7 years ago
|
||
| Reporter | ||
Comment 20•7 years ago
|
||
Comment 21•7 years ago
|
||
| Reporter | ||
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
Comment 24•7 years ago
|
||
Comment 25•7 years ago
|
||
Comment 26•6 years ago
|
||
It's generally difficult for me to reproduce and analyze smartcard bugs, because I don't have the devices that you use. So it's difficult to say if the issue is caused by the smartcard device, the driver being used, or if it the problem is related to specific properties of the certificates you are using.
I suggest that you try to help to eliminate the possibility that the smartcard or its driver software are the cause of the problem.
Ideally, please try to reproduce the issue without using a smartcard. In other words, by using a certificate that is stored inside the profile directory (NSS software security device).
If the problem doesn't occur without a smartcard, then please check if the issue can be reproduced using a virtual smartcard. The softhsm virtual smartcard is available on Linux, and I'd prefer that: https://www.opendnssec.org/softhsm/
If you can reproduce using softhsm, and if you can provide instructions how you setup the certificate, then I could try to reproduce and debug.
Comment 27•6 years ago
|
||
(In reply to Kai Engert (:kaie:) from comment #26)
It's generally difficult for me to reproduce and analyze smartcard bugs, because I don't have the devices that you use. So it's difficult to say if the issue is caused by the smartcard device, the driver being used, or if it the problem is related to specific properties of the certificates you are using.
I suggest that you try to help to eliminate the possibility that the smartcard or its driver software are the cause of the problem.
Ideally, please try to reproduce the issue without using a smartcard. In other words, by using a certificate that is stored inside the profile directory (NSS software security device).
If the problem doesn't occur without a smartcard, then please check if the issue can be reproduced using a virtual smartcard. The softhsm virtual smartcard is available on Linux, and I'd prefer that: https://www.opendnssec.org/softhsm/
If you can reproduce using softhsm, and if you can provide instructions how you setup the certificate, then I could try to reproduce and debug.
The "Login" box bug in Device Manager (Security Devices) is reproducible with ANY pkcs11 device. The error message is what Mr. Martin Pecka found, whenever a PKCS11 smartcard device entry is selected inside the Security Devices dialog box:
TypeError: Services.policies is undefined[Learn More] device_manager.js:166:11
enableButtons chrome://pippki/content/device_manager.js:166:11
onselect chrome://pippki/content/device_manager.xul:1:1
onxblmousedown chrome://global/content/bindings/tree.xml:1156:14
openOptionsDialog chrome://messenger/content/mailCore.js:446:7
oncommand chrome://messenger/content/messenger.xul:1:1
Previously in V52, I could click on the "Login" button, when I select the right smartcard device, but now it is always grayed out due to this bug.
I am using Thunderbird v60.8 stable.
| Reporter | ||
Comment 28•6 years ago
|
||
Wow... This also happens with the key stored in Software security device... I'll attach the certificate I'm using. I won't however send the whole p12 file with the private key as I'm currently using the key I used for this test.
| Reporter | ||
Comment 29•6 years ago
|
||
| Reporter | ||
Comment 30•6 years ago
|
||
Okay, I also created a bogus self-signed cert for testing, the same results. I'll share it here.
| Reporter | ||
Comment 31•6 years ago
|
||
Created following the guide at https://gist.github.com/richieforeman/3166387 .
Comment 32•6 years ago
|
||
Martin, the certificate you attached in comment 29 has been issued by the StartCom CA. Mozilla has revoked all trust on the StartCom CA, that's why your certificate is no longer considered valid by Mozilla software.
The bogus self-signed cert from comment 30 doesn't follow recommendations for certs. For example, it doesn't even have a "Certificate Basic Constraints" extension which usually marks certs as either a CA or as not a CA, so I'm not surprised this certificate is rejected.
| Reporter | ||
Comment 33•6 years ago
|
||
The problem is not in validity of the certificates. Both of them appear as options when selecting a signing cert in identity manager. Right after the selection, the "readonly" field showing the selected signing cert is showing some value, but after I try to send an email, it displays the "no nickname" value or something similarly wrong.
If you tell me a way how to generate a proper self-signed cert, I'll try. But I'm sure this was happenning earlier than Mozilla removed the trusted root of Startcom.
Comment 34•6 years ago
|
||
Thanks for explaining again what your bug is.
Unfortunately I cannot reproduce the bug, and I have never seen it with the certificates I'm using.
I set up a new profile, and I've tried with both TB 60.8 and 68.0
I set my email to address to the addressed listed in your attached self signed certificate. I configured account security to use it for s/mime. I confirm. I go back to the dialog, and the select is still correct, NOT no nickname.
If you have reproduced the bug yourself using that certificate, could you please describe how you reproduce it using a fresh profile and that certificate?
| Reporter | ||
Comment 35•6 years ago
|
||
I tried to replicate the bug on a brand new profile in TB 60.8 (Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0). Windows 10 1809 build. It's still there.
| Reporter | ||
Comment 36•6 years ago
|
||
Kai, Could you try reproducing once more, now with an attempt to send a signed email after setting up the certs? As you can see from my screenshots, after the sending fails, the cert selection field loses track of the certificate's serial.
| Reporter | ||
Updated•6 years ago
|
| Reporter | ||
Updated•6 years ago
|
| Reporter | ||
Comment 37•6 years ago
|
||
I've just replicated the bug on a fresh install of nightly to a completely new location with a fresh profile. So if there are some differences in the outcome between me and other people, they should be definitely given by the system properties and not by some leftovers in my TB folders (I hope).
| Reporter | ||
Comment 38•6 years ago
|
||
One more test now - it happens even with earlybird 31, which is weird. I'm pretty sure that at the time I was using TB 31, cert signing was working. Might it be a problem of the signing certificate? But I remember that when this bug started for me, it immediately started happening for all identities (I have about 4 with different signing certs and email addresses). So it shouldn't be caused just by exchanging my old certificate for a new one. Much more it seems to be caused by some system-related thing that changed in the meantime.
| Reporter | ||
Comment 39•6 years ago
|
||
Now I tried on Linux (on the same machine), and the result is still the same! The bug is there, even if the cert is stored in software security device...
Comment 40•6 years ago
|
||
Hi everyone, I'm following this thread since a year ago. I'm using the same token (Athena ID Protect) and CA reported by Nicolas T. The problem is that every time I want to sign in Thunderbird I have to associate again the cert in the configuration of the account. That was the situation in Thunderbird 60.2.1. Downgrading to version Thunderbird 50.b2 I was able to sign without problems.
Now I'm triying to reproduce the scenario and the behavior is different. Testing with:
Ubuntu bionic 64 bits
Thunderbird 60.8.0 (64-bits)
Token Athena ID Protect
Sometimes when I sign it fails after asking for the token password showing the message:
"Sending of the message failed.
Unable to sign message. Please check that the certificates specified in Mail & Newsgroups Account Settings for this mail account are valid and trusted for mail."
But If I hit the button send again the message is dilivered correctly. Other times the message is send correctly in the first attemp. I tried conecting the device before and after starting Thunderbird, but that is not the reason of the diffent behaviors.
Comment 41•6 years ago
|
||
Thanks for the screenshots. I can reproduce what happens with the test certificate. I don't know if this explains the failures you saw with other certificates.
The attached "self signed certificate" cannot be used with Thunderbird, because they aren't supported. Only certificates that are issued from a CA are supported.
The reason is, only certificates that can be verified as "valid" by Thunderbird are allowed. But Thunderbird doesn't allow to set explicit trust for a self-signed certificate.
If you create a test CA certificate, then use that CA to issue a test certificate, import both into Thunderbird, and mark the CA cert as valid for email, then you can use your own certificate.
At the time you try to send a signed email, we execute code that verifies the certificate. If it cannot be validated, we clear the preference. That explains why you see the signing_cert_dbkey being erased.
The same can happen with any certificate that is no longer valid. For example, if your certificate was previously valid, but then expired, it is no longer valid, and you'd get the same experience.
There's only scenario we could accept this as a bug report:
If you're trying to use a certificate that is still valid, but Thunderbird still complains about it and clears the pref.
Comment 42•6 years ago
|
||
None of the attached certificates is valid. The first one is expired. The second one is issued by Startcom, which is no longer trusted. The third one is self-signed and cannot be marked as trusted in Thunderbird.
Comment 43•6 years ago
|
||
You can check if Thunderbird considers your certificate valid. Open certificate manager, switch to the your certificates tab, find your cert, click view. The top area shows information if your cert seems valid/verified or not.
I'm closing this bug for now. Please feel free to attach more information. If you see a problem with a valid certificate, then we can reopen.
| Reporter | ||
Comment 44•6 years ago
|
||
Thanks for the info, I'll test later with a better cert. However, shouldn't the same validity check be done at the time the user is selecting the certificate? I know that the checks are needed every time you send an email (because the cert may become invalid over time), but I'm strongly for having the same check applied to the certs that show up in the cert selection dialog.
Comment 45•6 years ago
|
||
(In reply to Kai Engert (:kaie:) from comment #43)
You can check if Thunderbird considers your certificate valid. Open certificate manager, switch to the your certificates tab, find your cert, click view. The top area shows information if your cert seems valid/verified or not.
I'm closing this bug for now. Please feel free to attach more information. If you see a problem with a valid certificate, then we can reopen.
Kai Engert, what about pkcs devices scenario?
Now, on v68.0, happends exactly what "charlyfeck" described at comment 40.
You've changed something in all this months.
Before:
"mail.identity.id1.signing_cert_name" = "FIRMA DIGITAL:le-aea9c492-1629-447a-911a-035e2d33e370" (Security Device label + ":" + default container).
Account > Security > Selected certificate = the same value as signing_cert_name.
Now:
"mail.identity.id1.signing_cert_name" = "My full name" (CN)
Account > Security > Selected certificate = CN + "[" + Certificate's Serial Number + "]".
Before, I could fully restore functionality by manually deleting dbkey preference.
Now, it's not longer possible, because if that preference is removed, it will always fail at sending attempt. So I guess you've removed the fallback mechanism that was present before.
Every time you open up Thunderbird, the first digitally signed mail sending attempt will fail. If you retry it will be send, though. And it won't fail again until you close thunderbird.
Comment 46•6 years ago
|
||
If there's an additional scenario for the described failure, which happens with valid certificates, then we need to identify how it can be reproduced. I don't know how to reproduce it yet.
Comment 47•6 years ago
|
||
(In reply to Nicolas T from comment #45)
You've changed something in all this months.
The change I'm aware of is bug 1319185, which affects Thunderbird 53 and later.
Because Firefox had removed some core functionality, the TB maintainers were forced to adopt. The way it was changed in TB wasn't ideal IMO because the preference name was kept, but its contents were changed. Now we have to live with that change.
Before:
"mail.identity.id1.signing_cert_name" = "FIRMA DIGITAL:le-aea9c492-1629-447a-911a-035e2d33e370" (Security Device label + ":" + default container).
Account > Security > Selected certificate = the same value as signing_cert_name.Now:
"mail.identity.id1.signing_cert_name" = "My full name" (CN)
Account > Security > Selected certificate = CN + "[" + Certificate's Serial Number + "]".
Right, instead of the nickname, now the display name is shown:
https://hg.mozilla.org/releases/comm-esr68/rev/e47002b53b5f9294a331d8b84e291ed6c362fb01#l1.83
Before, I could fully restore functionality by manually deleting dbkey preference.
You shouldn't tweak prefs.js manually. Could you use the user interface to re-select the correct certificate, which would then hopefully set the corect preference values to remember the correct cert?
Comment 48•6 years ago
|
||
(In reply to Kai Engert (:kaie:) from comment #47)
You shouldn't tweak prefs.js manually. Could you use the user interface to re-select the correct certificate, which would then hopefully set the corect preference values to remember the correct cert?
I work for a State Court, and back then they needed to implement some backup mechanism with digitally signed emails when the primary system fails. I coudn't wait for a proper fix so, I created a simple vbs script to automate the process.
My certificate is valid, but it will expire in a few days. I don't know if they will give me a new one, because they only gave it to me for this specific purpose.
Now, I wanted to inform you that you've almost fixed the bug in v68.0. The only problem that remains is that error at first sending attempt, but no preference is cleared or lost. If you retry, it works as it should and will never fail again until you close Thunderbird.
Comment 49•6 years ago
|
||
(In reply to Nicolas T from comment #48)
Now, I wanted to inform you that you've almost fixed the bug in v68.0. The only problem that remains is that error at first sending attempt, but no preference is cleared or lost. If you retry, it works as it should and will never fail again until you close Thunderbird.
If only we knew why!
| Reporter | ||
Comment 50•6 years ago
|
||
(In reply to Kai Engert (:kaie:) from comment #42)
None of the attached certificates is valid. The first one is expired. The second one is issued by Startcom, which is no longer trusted. The third one is self-signed and cannot be marked as trusted in Thunderbird.
You're right! I probably haven't noticed Mozilla stopped trusting Comodo and Startcom. But now you see how impossible for the user is to "debug" this kind of issue. Maybe the culprit of this bug may be therefore marked as invalid, but I think it triggers a few more "UX" bugs. Should I report them?
I've got another address for which I have a trusted cert, and with that one, this bug doesn't happen. I also verified with a self-signed cert for which I added the CA to the trusted list. Later, I'll test with a cert on smartcard to see if this is finally resolved for all my use-cases.
| Reporter | ||
Comment 51•6 years ago
|
||
Tested with a cert on SmartCard. It basically seems to be working, too. If I have the SC in, choose a valid cert, I can send a signed email as expected. If I remove the card and try to send a signed email, TB tells me it cannot find the cert and the serial number in signing options is lost, but CN stays. If I re-insert the card again, TB correctly finds the previously selected cert and uses it. I think this is how it should work ;)
Description
•