wp-pgp-encrypted-emails
wp-pgp-encrypted-emails copied to clipboard
Avoid writing S/MIME plaintext to disk entirely
Two options come to mind:
- Using
/dev/shm/$some_pathif the plugin is running in a GNU/Linux environment with a mountedtmpfsas the S/MIME$infile. This would not be portable to, for example, Windows-based servers. We could auto-detect our environment and simply perform the optimization if possible, falling back to the existing implementation if it is not. - Using
php://memoryorphp://tempstreams and manually constructing the PKCS#7 formatted S/MIME message from strings instead of usingopenssl_pkcs7_encrypt(), since that function requires file paths. This would be more work but will also be more portable across operating systems.
I actually have a branch (7f69e8d) waiting regarding "secure" deletion :) Also looked into streams and I think that would be the best approach in the long run, but seems like much work.
I'll submit a PR if you think it's ready for it
I'll submit a PR if you think it's ready for it
@githubuserx Sure!
- php://memory
Is a good idea. I've done two small experiments in the past with a few small benchmarks. https://github.com/DanielRuf/inmemory-benchmarks