Closed (fixed)
Project:
DataBase Email Encryption
Version:
7.x-2.0
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
15 Dec 2014 at 15:15 UTC
Updated:
27 Dec 2014 at 16:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mrharolda commentedI fixed it by altering the AES settings, and then setting it back as it was, but that's not how this module should behave ...
Comment #2
thedut commentedHello MrHaroldA,
Thank you for reporting this issue.
I'm glab you finally succeed in using the Database Email Encryption (dbee) module. And you are right, that's not how this module should behave : emails should be encrypted on installing the module.
I can't reproduce this issue.
I tried with :
Test units succeed to.
About debuging :
On the 'admin/config/system/dbee' page : This sentence is always displayed : there is no check about email encryption.
If you want to make sure about email encryption, look into the database (as you did) or go to the user/1 (or any user) page with the 'Administer database email encryption' permission : look for the 'Contact email' section : it will display if the email is encrypted or not.
Regarding what you describe, it seems that the hook_enable() function was not called on install (but it should be called).
Anyway, when enabling the dbee module or making changes on the AES admin setting page (as you did), all users are encrypted again. That why you finally succeed in encrypting all users.
I close this issue but feel free to re open it if you or someone meet this issue again.
Comment #3
mrharolda commentedI've used drush to enable the modules. I'll try to reproduce it tomorrow, and test enabling it with features too, as I have to deploy this anyway...
Comment #4
thedut commentedHello,
I did not try to reproduce this issue enabling the module using drush.
I may find the cause of this issue thanks to the Drupal API documentation for the hook_enable() function :
The dbee_enable() function is stored into the dbee.module file, but I should be stored into the dbee.install file instead.
Could you test if it solves your issue ?
Comment #5
thedut commentedComment #6
mrharolda commentedWell, I think it's actually an other problem. Drush runs as user 0, aka 'anonymous'. In dbee_update_crypt_all() there's this access check:
That check seems out-of-place, as the only way to trigger a full en/decrypt is by enabling/disabling the module, or changing AES settings. All these actions call for administration permissions, server access, or the dreadful php-filter enabled (which is the biggest security hole of 'em all!).
You could argue that this is a 'security feature', but is someone has server access, you're fully hacked anyway as they will also have access to the decryption key, php, database, etc.
To enable Drush support, this check has to go, or has to be extended with something like this:
Comment #7
mrharolda commentedNeedless to say, our deploy failed too as the module can't be enabled by a feature that is reverted from Drush/CLI/Jenkins/etc.
Comment #8
mrharolda commentedHere are 2 patches: one that removes the access check, and one that adds the Drush check.
I prefer to remove the access check.
Comment #9
thedut commentedComment #11
thedut commentedI agree with you : I have removed the access check (I have used this patch : dbee-no-access-check-2393517-8.patch).
Thank you MrHaroldA for your contribution on the DaBase Email Encryption module.
Comment #12
thedut commentedFixed into the dbee 7.x-2.1 version.
Comment #13
thedut commented