Skip to content
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

Avoid writing S/MIME plaintext to disk entirely #38

Open
fabacab opened this issue Dec 14, 2018 · 3 comments
Open

Avoid writing S/MIME plaintext to disk entirely #38

fabacab opened this issue Dec 14, 2018 · 3 comments

Comments

@fabacab
Copy link
Owner

fabacab commented Dec 14, 2018

Two options come to mind:

  • Using /dev/shm/$some_path if the plugin is running in a GNU/Linux environment with a mounted tmpfs as 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://memory or php://temp streams and manually constructing the PKCS#7 formatted S/MIME message from strings instead of using openssl_pkcs7_encrypt(), since that function requires file paths. This would be more work but will also be more portable across operating systems.
@p7996619
Copy link
Contributor

p7996619 commented Dec 14, 2018

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

@fabacab
Copy link
Owner Author

fabacab commented Dec 23, 2018

I'll submit a PR if you think it's ready for it

@GithubuserX Sure!

@DanielRuf
Copy link

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants