diff --git a/src/Exceptions/UziCaException.php b/src/Exceptions/UziCaException.php deleted file mode 100644 index b8087f3..0000000 --- a/src/Exceptions/UziCaException.php +++ /dev/null @@ -1,13 +0,0 @@ -strictCAcheck === true && - $uziInfo->getOidCa() !== UziConstants::OID_CA_CARE_PROVIDER && - $uziInfo->getOidCa() !== UziConstants::OID_CA_NAMED_EMPLOYEE - ) { - throw new UziCaException('CA OID not UZI register Care Provider or named employee'); - } - if (! $x509->validateSignature(count($this->caCerts) > 0)) { throw new UziCertificateException('Uzi certificate path not valid'); } diff --git a/tests/UziValidatorTest.php b/tests/UziValidatorTest.php index 1e859a4..1af074a 100644 --- a/tests/UziValidatorTest.php +++ b/tests/UziValidatorTest.php @@ -4,7 +4,6 @@ use MinVWS\PUZI\Exceptions\UziAllowedRoleException; use MinVWS\PUZI\Exceptions\UziAllowedTypeException; -use MinVWS\PUZI\Exceptions\UziCaException; use MinVWS\PUZI\Exceptions\UziCertificateException; use MinVWS\PUZI\Exceptions\UziVersionException; use MinVWS\PUZI\UziConstants; @@ -60,42 +59,6 @@ public function testInvalidCert(): void $validator->validate($request); } - public function testValidateIncorectOIDca(): void - { - $user = new UziUser(); - $user->setOidCa("1.2.3.4"); - - $this->expectException(UziCaException::class); - $this->expectExceptionMessage("CA OID not UZI register Care Provider or named employee"); - - $request = new Request(); - $request->server->set('SSL_CLIENT_VERIFY', "SUCCESS"); - $request->server->set('SSL_CLIENT_CERT', file_get_contents(__DIR__ . '/certs/mock-020-incorrect-oidca.cert')); - - $reader = new UziReader(); - $validator = new UziValidator($reader, true, [], []); - $validator->validate($request); - } - - public function testValidateIncorectOIDcaWithoutStrictCheck(): void - { - $user = new UziUser(); - $user->setOidCa("1.2.3.4"); - - $request = new Request(); - $request->server->set('SSL_CLIENT_VERIFY', "SUCCESS"); - $request->server->set('SSL_CLIENT_CERT', file_get_contents(__DIR__ . '/certs/mock-020-incorrect-oidca.cert')); - - $reader = new UziReader(); - $validator = new UziValidator( - $reader, - false, - [UziConstants::UZI_TYPE_NAMED_EMPLOYEE], - [UziConstants::UZI_ROLE_DOCTOR] - ); - $this->assertTrue($validator->isValid($request)); - } - public function testIncorrectVersion(): void { $request = new Request();