Skip to content

Commit

Permalink
Merge pull request #1359 from jeffhuys/fix-snyk-vulnerability
Browse files Browse the repository at this point in the history
Remove Key Leak 8.4.x
  • Loading branch information
Sephster authored Aug 2, 2023
2 parents eed31d8 + 5aba3df commit cb9ae79
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit cb9ae79

Please sign in to comment.