diff --git a/composer.json b/composer.json index a790db7..a24dea6 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ } }, "require": { - "php": "^8.5", + "php": ">=8.3", "phpseclib/phpseclib": "^3.0.0", "guzzlehttp/psr7": "^2.6.0", "psr/log": "^3.0.0" diff --git a/composer.lock b/composer.lock index 566728b..c398360 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "32d597ce88ab60048bdcb1bb3133528f", + "content-hash": "9b2171ad029496bb6df2257c628ce533", "packages": [ { "name": "guzzlehttp/psr7", @@ -244,16 +244,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.51", + "version": "3.0.52", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "d59c94077f9c9915abb51ddb52ce85188ece1748" + "reference": "2adaefc83df2ec548558307690f376dd7d4f4fce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d59c94077f9c9915abb51ddb52ce85188ece1748", - "reference": "d59c94077f9c9915abb51ddb52ce85188ece1748", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/2adaefc83df2ec548558307690f376dd7d4f4fce", + "reference": "2adaefc83df2ec548558307690f376dd7d4f4fce", "shasum": "" }, "require": { @@ -334,7 +334,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.51" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.52" }, "funding": [ { @@ -350,7 +350,7 @@ "type": "tidelift" } ], - "time": "2026-04-10T01:33:53+00:00" + "time": "2026-04-27T07:02:15+00:00" }, { "name": "psr/http-factory", @@ -2307,12 +2307,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.5" + "php": ">=8.3" }, - "platform-dev": {}, - "plugin-api-version": "2.9.0" + "platform-dev": [], + "plugin-api-version": "2.6.0" } diff --git a/example/composer.json b/example/composer.json index 71148f7..3572e90 100644 --- a/example/composer.json +++ b/example/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "php": ">=8.5", + "php": ">=8.3", "web-eid/web-eid-authtoken-validation-php": "1.3.*", "altorouter/altorouter": "^2.0.3", "psr/log": "^3.0" diff --git a/example/composer.lock b/example/composer.lock index c0e3064..88775ac 100644 --- a/example/composer.lock +++ b/example/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d29d3d9f3ffeb008268e2c34cad77194", + "content-hash": "3bd721c89d5a35e55d1c4e040dd1bc43", "packages": [ { "name": "altorouter/altorouter", @@ -302,16 +302,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.51", + "version": "3.0.52", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "d59c94077f9c9915abb51ddb52ce85188ece1748" + "reference": "2adaefc83df2ec548558307690f376dd7d4f4fce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d59c94077f9c9915abb51ddb52ce85188ece1748", - "reference": "d59c94077f9c9915abb51ddb52ce85188ece1748", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/2adaefc83df2ec548558307690f376dd7d4f4fce", + "reference": "2adaefc83df2ec548558307690f376dd7d4f4fce", "shasum": "" }, "require": { @@ -392,7 +392,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.51" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.52" }, "funding": [ { @@ -408,7 +408,7 @@ "type": "tidelift" } ], - "time": "2026-04-10T01:33:53+00:00" + "time": "2026-04-27T07:02:15+00:00" }, { "name": "psr/http-factory", @@ -667,12 +667,12 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.5" + "php": ">=8.3" }, - "platform-dev": {}, - "plugin-api-version": "2.9.0" + "platform-dev": [], + "plugin-api-version": "2.6.0" } diff --git a/example/public/index.php b/example/public/index.php index 094c1c1..b8494a8 100644 --- a/example/public/index.php +++ b/example/public/index.php @@ -24,12 +24,14 @@ header('Content-type: text/html; charset=UTF-8'); +ini_set('display_errors', '0'); + session_start(); // Uncomment following line to define the custom log location (by default the server log is used) //define("LOGFILE", dirname(__FILE__) . "/../log/web-eid-authtoken-validation-php.log"); -require __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; $configArr = require_once __DIR__ . '/../src/app.conf.php'; $config = Config::fromArray($configArr)->overrideFromEnv(); diff --git a/example/src/Auth.php b/example/src/Auth.php index 3c8d4c8..293eb0d 100644 --- a/example/src/Auth.php +++ b/example/src/Auth.php @@ -73,7 +73,7 @@ public function validate() try { /* Get and remove nonce from store */ - $challengeNonce = new ChallengeNonceStore()->getAndRemove(); + $challengeNonce = (new ChallengeNonceStore())->getAndRemove(); $authResult = $this->ctx->authenticate( $authToken, diff --git a/example/src/AuthContext.php b/example/src/AuthContext.php index 34788ca..849b119 100644 --- a/example/src/AuthContext.php +++ b/example/src/AuthContext.php @@ -136,14 +136,14 @@ public function trustedIntermediateCACertificates(): array public function nonceGenerator(): ChallengeNonceGenerator { - return new ChallengeNonceGeneratorBuilder()->withNonceTtl(300)->build(); + return (new ChallengeNonceGeneratorBuilder())->withNonceTtl(300)->build(); } public function tokenValidator(): AuthTokenValidator { $logger = new Logger(); - return new AuthTokenValidatorBuilder($logger) + return (new AuthTokenValidatorBuilder($logger)) ->withSiteOrigin(new Uri($this->config->get("origin_url"))) ->withTrustedCertificateAuthorities( ...$this->trustedIntermediateCACertificates(), diff --git a/src/validator/certvalidators/SubjectCertificateNotRevokedValidator.php b/src/validator/certvalidators/SubjectCertificateNotRevokedValidator.php index f437a8f..50dde42 100644 --- a/src/validator/certvalidators/SubjectCertificateNotRevokedValidator.php +++ b/src/validator/certvalidators/SubjectCertificateNotRevokedValidator.php @@ -77,11 +77,11 @@ public function validate(X509 $subjectCertificate): void $this->logger?->debug("Disabling OCSP nonce extension"); } - $certificateId = new Ocsp()->generateCertificateId( + $certificateId = (new Ocsp())->generateCertificateId( $subjectCertificate, $this->trustValidator->getSubjectCertificateIssuerCertificate(), ); - $request = new OcspRequestBuilder() + $request = (new OcspRequestBuilder()) ->withCertificateId($certificateId) ->enableOcspNonce($ocspService->doesSupportNonce()) ->build();