lbuchs / WebAuthn

A simple PHP WebAuthn (FIDO2/Passkey) server library

Home Page:https://webauthn.lubu.ch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP error AttestationObject.php line 90

wagner-robert opened this issue · comments

I am getting PHP errors in AttestationObject.php line 90 for YubiKey.
Undefined Index: OU
Undefined Index: O
Line: if ($certInfo['issuer']['O'] || $certInfo['issuer']['OU']) {....

This appears to be looking for the O and OU in the Issuer field. However, this YubiKey shows:

Issuer: CN=Yubico U2F Root CA Serial ...

There isn't a O or OU in the Issuer field. Only in the Subject Field.

https://gitmemory.com/issue/lbuchs/WebAuthn/36/856706312

I solved it by adding in the first function

if (empty($certInfo['issuer']['OU'])) {
$certInfo['issuer']['OU'] = '';
}

and in the second

if (empty($certInfo['subject']['OU'])) {
$certInfo['subject']['OU'] = '';
}

commented

duplicate of #13