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

Remove Key Leak 8.4.x #1359

Merged
merged 2 commits into from Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [8.4.2] - released 2023-07-xx
### Security
- If a key string is provided to the CryptKey constructor with an invalid
passphrase, the LogicException message generated will contain the given key.
The key is no longer leaked via this exception (PR #1353)

## [8.4.1] - released 2023-03-22
### Fixed
- Fix deprecation notices for PHP 8.x (PR #1329)
Expand Down
2 changes: 1 addition & 1 deletion src/CryptKey.php
Expand Up @@ -64,7 +64,7 @@ public function __construct($keyPath, $passPhrase = null, $keyPermissionsCheck =
throw new LogicException('Unable to read key from file ' . $keyPath);
}
} else {
throw new LogicException('Unable to read key from file ' . $keyPath);
throw new LogicException('Invalid key supplied');
}

if ($keyPermissionsCheck === true) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/CryptKeyTest.php
Expand Up @@ -55,7 +55,7 @@ public function testKeyString()
public function testUnsupportedKeyType()
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('Unable to read key');
$this->expectExceptionMessage('Invalid key supplied');

try {
// Create the keypair
Expand Down