-
Notifications
You must be signed in to change notification settings - Fork 95
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
getPrivateKey() can disclose private key to error logs / cron emails #18
Comments
Good call, I'd be very happy with a PR which adds a file_exists check before the is_file call. This should prevent the warning. I can merge the PR and ask one of the other league members to tag the release. Could you ping me on Twitter if you have a PR up? I can then put the other things into motion. |
@weshooper I'm in Australia on holidays now and my laptop broke down :( that's why it's a bit difficult for me to write this fix. Mobile is all I have now. |
@frankdejonge thanks for the reply, sorry to hear about the laptop! Looks like
Checking the first few chars of
If that approach would be ok, I'll open up a PR... |
That's ok then, please add a comment to the line so I and others know what it's for. |
@frankdejonge I've fixed this over in #42 :) |
We've recently had the contents of private keys emailed to us by cron when a connection fails, with the email contents looking something like the following:
Traced it down to the
is_file()
check ingetPrivateKey()
and wondered if there might be a better way to check?Two options we came up with were:
$this->privatekey
starts with '-----' and only do theis_file
check if it doesn'tis_file
Any thoughts, or preference on approach?
The text was updated successfully, but these errors were encountered: