Unify general encryption options in composer window
Categories
(MailNews Core :: Security: OpenPGP, enhancement)
Tracking
(Not tracked)
People
(Reporter: KaiE, Assigned: KaiE)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 2 external files, 3 obsolete files)
|
2.03 KB,
text/plain
|
Details | |
|
203.84 KB,
patch
|
patrick
:
review+
|
Details | Diff | Splinter Review |
|
36.39 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
This is about a small subset of OpenPGP UI that we'll require. It's a UI subset that we'll need very early for testing.
Currently, composer window allows switching of some encryption settings:
- sign with S/MIME or not
- encrypt with S/MIME or not
I suggest that the user should be able to switch the encryption that will be used for the current email being composed, either S/MIME or OpenPGP. For that, we should have a new menu command. Suggestion is to use a nested submenu, labeled "Encryption Technology", with two radio items in it, to select between S/MIME and OpenPGP. (Thanks to :aleca for the guidance.)
I suggest the existing sign/encrypt switches should apply regardless of the technology selection.
To implement this, some refactoring of the existing S/MIME code will be necessary. Today, enabling S/MIME options, while not yet having configured S/MIME for that account, will trigger prompts to set up etc. We might want to change that, because it's tricky if encryption is enabled, and the user switches the technology to S/MIME, although that's not yet set up.
| Assignee | ||
Comment 1•6 years ago
|
||
For the encryption setting, I suggest that we use a radio button:
(*) Do not encrypt
( ) Require encryption
Why not a checkbox?
The reason is, we consider to implement a third setting at a later time, "allow encryption". I'd like to skip that mode initially, but once we'll work on it, we can easily extend it with another radio button like this:
(*) Do not encrypt
( ) Allow encryption
( ) Require encryption
I want to postpone the "Allow encryption" mode for now. It's more difficult to implement correctly.
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
Attached is a first cut of (working) refactoring, and initial UI for testing.
With openpgp disabled at build time, S/MIME behavior is unmodified, so this should be safe for nightly landing.
With openpgp enabled:
- it's still possible to send s/mime as before.
- the security button and options menu has a new entry for encryption technology, and if openpgp is selected, to attach own's public key
- key selection is currently done automatically based on email address, both when attaching your own public key, and when sending an encrypted message
- currently no key verification is done, non-expired and non-revoked keys are silently accepted (this is an initial state for testing, this will behave differently later)
- only works when manually copying RNP libraries into your openpgp enabled build, e.g. from https://kuix.de/mozilla/openpgp/libs-20191115/
| Assignee | ||
Comment 4•6 years ago
|
||
| Assignee | ||
Comment 5•6 years ago
|
||
Note the patch attachment is mostly a backup. I need to merge to latest comm-central and verify it still works. When I have done that, I'll create a try build, as an initial demo.
| Assignee | ||
Comment 6•6 years ago
|
||
Subset of changes that apply to the global files (output of openpgp directory).
For the UI unification, it moves some code from the S/MIME specific files into the global code.
I don't claim this will be the final UI, just something that we can use during our initial development. It's fine if Alessandro already wants to give feedback, but it could also be done in a follow-up step.
| Assignee | ||
Comment 7•6 years ago
|
||
The other subset, the changes to the enigmail code, mostly for the composer window.
Requesting review for "ok to commit".
Calling GPG no longer worked, so I'm returning early in many functions, to prevent their execution. To be cleaned up later. Regarding the "engine" pref, we can probably remove it later, because we currently don't consider to offer two complete separate engine implementations, but might only optionally, potentially use the GPG engine for a subset of operations. I'll handle that later.
The patch removes a lot of functionality from the enigmail composer code, because I'd like to change how we track the encryption/signing state. Whenever I have code that I don't need immediately, but which I still might need to look at later, I'm not removing it, but keep it commented out. The code for "original was encrypted, so reply should be encrypted, too" isn't ready yet. I'd like to track that with a separate flag (gIsRelatedToEncryptedOriginal) instead of the old approach that used a complex mode variable to track multiple things (sendMode).
Removed some legacy code that was intended for older TB versions.
AIUI, enigmail handled sending of all signed/encrypted email, for both S/MIME and OpenPGP. I'd like to change how that works. I'd like to have the global TB code handle the sending, if S/MIME is used. The enigmail code should only have to handle sending of OpenPGP messages.
Added code that uses RNP to search by email address and obtains a public key, for attaching it to outgoing email.
I changed key generation to use RSA for now, for greater compatibility during testing. Also changed defauly expiry to 1 month, to limit trouble if people generate keys during testing and accidentally use them for real world purposes.
The enigmail composer overlay no longer handles the status icons for "what does the user want", that's now done in global code (identically for both S/MIME and OpenPGP). We'll later have to introduce new code to visualize the "is encryption possible or not".
I'm removing code for "inline encryption". We've agreed we only want to limit "inline OpenPGP" to plain text signed emails without attachments (if we'll support inline at all).
Handling the enigmail draft flags correctly is a todo for later.
I'd like to use the old enablePgp pref for migration purposes, for checking if PGP was previously enabled with Enigmail installed. For future "PGP is enabled", I'd like to use something else, so I'm removing that pref from the default list.
| Assignee | ||
Comment 8•6 years ago
•
|
||
| Assignee | ||
Comment 9•6 years ago
|
||
| Assignee | ||
Comment 10•6 years ago
|
||
| Assignee | ||
Comment 11•6 years ago
|
||
Patrick, are you able to create an account at https://phabricator.services.mozilla.com/ ?
Even if you don't plan to do your reviews over there, it will allow me to specify you as reviewer. Otherwise I need to set a dummy person as reviewer, or I cannot submit it.
Reading patches in phabricator is easier than in bugzilla.
You should be able to click the attachment in comment 10, instead of attachment 9126952 [details] [diff] [review].
Also, most developers use some sort of nickname, and edit their bugzilla name to include it, prefixed with colon ':'. Would you like to do that, too? If you don't use a nickname, it seems :patrick isn't yet used.
| Assignee | ||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
(In reply to Kai Engert (:KaiE:) from comment #11)
Patrick, are you able to create an account at https://phabricator.services.mozilla.com/ ?
Yes, I created an account now ("Patrick Brunschwig").
Comment 14•6 years ago
|
||
| Assignee | ||
Comment 15•6 years ago
|
||
| Assignee | ||
Comment 16•6 years ago
|
||
(In reply to Patrick Brunschwig from comment #14)
modules/rnp.jsm:
getKeyHandleByIdentifier():
if RNP supports PGPv3 keys, you should also accept fingerprints with
length == 32.
ok
ui/enigmailMsgComposeOverlay.js:
for my taste, the whole part about migrating
identityEnigmailPrefsMigrated=true does not belong into UI code. There is
configure.jsm, which is meant to take care of such functionality.
Yes, fully agree. That code hasn't arrived in the final place yet. I'll add a TODO comment.
| Assignee | ||
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 19•6 years ago
|
||
This tries to address all of Magnus' concerns on the global patch.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 20•6 years ago
|
||
Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/7937d619f3d8
Unify general encryption options in composer window. r=mkmelin
https://hg.mozilla.org/comm-central/rev/826a884758f8
pgp changes for composer. r=PatrickBrunschwig
https://hg.mozilla.org/comm-central/rev/e80f11af3975
Key expiration is relative. r=PatrickBrunschwig
| Assignee | ||
Updated•6 years ago
|
Description
•