| Conditions | 4 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 30 | 7 | private static function getFidoAaguidExtensionValue(CertificateDetailsInterface $cert): ?Aaguid |
|
| 31 | { |
||
| 32 | 7 | $extension = $cert->getExtensionData(self::OID_FIDO_GEN_CE_AAGUID); |
|
| 33 | 7 | if ($extension === null) { |
|
| 34 | 2 | return null; |
|
| 35 | } |
||
| 36 | |||
| 37 | 5 | if ($extension->isCritical()) { |
|
| 38 | 1 | throw new VerificationException('FIDO AAGUID extension must not be critical.'); |
|
| 39 | } |
||
| 40 | |||
| 41 | try { |
||
| 42 | 4 | $rawAaguid = UnspecifiedType::fromDER($extension->getValue()->getBinaryString())->asOctetString()->string(); |
|
| 43 | 3 | return new Aaguid(new ByteBuffer($rawAaguid)); |
|
| 44 | 1 | } catch (Exception $e) { |
|
| 45 | 1 | throw new ParseException('Failed to parse AAGUID extension', 0, $e); |
|
| 46 | } |
||
| 49 |