Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit e57316f

Browse files
metsmamrts
authored andcommitted
build(deps): bump phpseclib to 3.0.34
WE2-843 Signed-off-by: Raul Metsma <[email protected]>
1 parent b2c3470 commit e57316f

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require-dev": {
13-
"phpunit/phpunit": "^9.5"
13+
"phpunit/phpunit": "^9.6.14"
1414
},
1515
"autoload": {
1616
"psr-4": {
@@ -27,11 +27,12 @@
2727
}
2828
},
2929
"require": {
30-
"phpseclib/phpseclib": "3.0.19"
30+
"phpseclib/phpseclib": "3.0.34"
3131
},
3232
"scripts": {
3333
"fix-php": [
3434
"prettier src/**/* --write", "prettier src/* --write"
35-
]
35+
],
36+
"test": "phpunit"
3637
}
3738
}

src/OcspResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class OcspResponse
4141
public function __construct(string $encodedBER)
4242
{
4343
$decoded = ASN1::decodeBER($encodedBER);
44-
if (!$decoded[0]) {
44+
if (!is_array($decoded)) {
4545
throw new OcspResponseDecodeException();
4646
}
4747

src/certificate/CertificateLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ public function fromFile(string $pathToFile)
7171
public function fromString(string $certString)
7272
{
7373
$certificate = new X509();
74-
$loaded = $certificate->loadX509($certString);
74+
$loaded = false;
75+
try {
76+
$loaded = $certificate->loadX509($certString);
77+
} catch (Exception $e) {
78+
}
7579
if (!$loaded) {
7680
throw new OcspCertificateException(
7781
"Certificate decoding from Base64 or parsing failed"

0 commit comments

Comments
 (0)