Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Attestation/AuthenticatorData.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ private function _readCredentialPublicKey($binary, $offset, &$endOffset) {
*/
private function _readCredentialPublicKeyEDDSA(&$credPKey, $enc) {
$credPKey->crv = $enc[self::$_COSE_CRV];

if (!isset($enc[self::$_COSE_X])) {
throw new WebAuthnException('public key missing', WebAuthnException::MISSING_PUBLIC_KEY);
}
$credPKey->x = $enc[self::$_COSE_X] instanceof ByteBuffer ? $enc[self::$_COSE_X]->getBinaryString() : null;
unset ($enc);

Expand Down
1 change: 1 addition & 0 deletions src/WebAuthnException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class WebAuthnException extends \Exception {
const BYTEBUFFER = 14;
const CBOR = 15;
const ANDROID_NOT_TRUSTED = 16;
const MISSING_PUBLIC_KEY = 17;

public function __construct($message = "", $code = 0, $previous = null) {
parent::__construct($message, $code, $previous);
Expand Down