Skip to content

Commit cb93a0f

Browse files
authored
Merge pull request #1353 from Sephster/fix-iss-1351
Remove Key Leak
2 parents 8ab731e + 605f6f0 commit cb93a0f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [8.5.3] - released 2023-07-06
10+
### Security
11+
- If a key string is provided to the CryptKey constructor with an invalid
12+
passphrase, the LogicException message generated will expose the given key.
13+
The key is no longer leaked via this exception (PR #1353)
14+
915
## [8.5.2] - released 2023-06-16
1016
### Changed
1117
- Bumped the versions for laminas/diactoros and psr/http-message to support

src/CryptKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function __construct($keyPath, $passPhrase = null, $keyPermissionsCheck =
6464
throw new LogicException('Unable to read key from file ' . $keyPath);
6565
}
6666
} else {
67-
throw new LogicException('Unable to read key from file ' . $keyPath);
67+
throw new LogicException('Invalid key supplied');
6868
}
6969

7070
if ($keyPermissionsCheck === true) {

tests/Utils/CryptKeyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testKeyString()
5555
public function testUnsupportedKeyType()
5656
{
5757
$this->expectException(\LogicException::class);
58-
$this->expectExceptionMessage('Unable to read key');
58+
$this->expectExceptionMessage('Invalid key supplied');
5959

6060
try {
6161
// Create the keypair

0 commit comments

Comments
 (0)