-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enigma smime signed messages verification #6043
base: master
Are you sure you want to change the base?
Conversation
Looks very promising. Looking forward to this being merged. |
Looks good. I'm not sure it should be merged with master. Maybe a separate branch would be better. Or we implement an option that will disable the whole S/MIME functionality by default. |
20d1ee0
to
d803cdb
Compare
The S/MIME functionality (as it is implemented so far) is completely unobtrusive. Once I add more UI for it (e.g. Certificate Management and a column to enable/disable S/MIME functions in the main Enigma config panel), the existing config override system can be used to disable S/MIME entirely and it's fine to set it disabled by default. Is that agreeable? |
Does it support retrieving S/MIME certificates from DNS according to IETF RFC 8162? |
Can you share a screenshot of how this should look? PS, I also tried direct install from the branch, but still with 0 success on any indication for valid s/mime signed email on the UI. |
@G00sfraba It looks as follows after I've applied the (corrected) resulting patch against v1.3.9 today: |
Any update on this? Would love to see that feature :-) |
I ended up customising |
@G00sfraba, would you have a fork/branch/repo with these changes? |
Thank you for submitting a Pull Request (PR) to the Roundcube GitHub project. You are receiving this message because your PR has conflicts which need to be resolved. We are trying to catch up on our backlog of old PRs and get them merged in (where appropriate). Therefor, we request the following: Step 1. Rebase from the latest Roundcube branch master into your PR.
Step 2. Re-test to make sure your new code still works as expected Step 3. Comment back here once it has been tested and will merge cleanly. Once this has been done we will treat it like a new Pull Request and consider it for acceptance. Apologies for the inconvenience. Thank you for contributing to Roundcube! |
@@ -37,6 +38,7 @@ function __construct($user) | |||
function init() | |||
{ | |||
$homedir = $this->rc->config->get('enigma_smime_homedir', INSTALL_PATH . '/plugins/enigma/home'); | |||
$this->cainfo = $this->rc->config->get('enigma_smime_ca', array()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using short array syntax now.
@@ -65,6 +67,15 @@ function init() | |||
|
|||
$this->homedir = $homedir; | |||
|
|||
#XXX: Workaround for https://bugs.php.net/bug.php?id=75494 | |||
if (count($this->cainfo) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a warning if the option in config is not an array.
if ($sig !== true) { | ||
// try with server trusted certificate verification | ||
$sig = openssl_pkcs7_verify($msg_file, 0, $cert_file); | ||
$validity = enigma_error::SERVER_VERIFIED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would that be an error? Find another way to pass this info, e.g. involving enigma_signature::$partial.
@@ -229,6 +245,8 @@ private function parse_sig_cert($file, $validity) | |||
// $data->comment = ''; | |||
$data->email = $cert['subject']['emailAddress']; | |||
|
|||
rcube::write_log('errors', 'Decrypted sig: ' . $data->name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed.
@@ -30,6 +30,7 @@ class enigma_error | |||
const BADPASS = 5; | |||
const EXPIRED = 6; | |||
const UNVERIFIED = 7; | |||
const SERVER_VERIFIED = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is conflict that needs to be resolved.
@@ -19,6 +19,8 @@ class enigma_mime_message extends Mail_mime | |||
{ | |||
const PGP_SIGNED = 1; | |||
const PGP_ENCRYPTED = 2; | |||
const SMIME_SIGNED = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new const aren't used/implemented yet. I would remove them.
This is the first step to address #4977.
I made this PR to familiarise myself with the enigma plugin and show a first proof-of-concept.
Description
It does the following things:
What it doesn't do:
What I am finding out here is that the php openssl module is severely limited in what it can do. Things I would like to do but seemingly can't using php openssl:
It may be necessary to invoke an openssl executable directly to actually implement all the features users would expect.
How to test
Test basic verification:
Test verification of configured CAs:
$config['enigma_smime_ca'] = array('/');
(a directory without certificates)$config['enigma_smime_ca'] = array('/path/to/ca.cert');
referencing the correct root ca