Skip to content

Commit

Permalink
Fix property access for rpId (#546)
Browse files Browse the repository at this point in the history
Fix property access for rpId
  • Loading branch information
abcang committed Feb 2, 2024
1 parent 54d2713 commit 4ad5b42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/webauthn/src/CeremonyStep/CheckOrigin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function process(
): void {
$authData = $authenticatorResponse instanceof AuthenticatorAssertionResponse ? $authenticatorResponse->authenticatorData : $authenticatorResponse->attestationObject->authData;
$C = $authenticatorResponse->clientDataJSON;
$rpId = $publicKeyCredentialOptions->rpId ?? $host;
$rpId = $publicKeyCredentialOptions->rpId ?? $publicKeyCredentialOptions->rp->id ?? $host;

Check failure on line 37 in src/webauthn/src/CeremonyStep/CheckOrigin.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static Analysis

Access to an undefined property Webauthn\PublicKeyCredentialCreationOptions|Webauthn\PublicKeyCredentialRequestOptions::$rp.
$facetId = $this->getFacetId($rpId, $publicKeyCredentialOptions->extensions, $authData->extensions);
$parsedRelyingPartyId = parse_url($C->origin);
is_array($parsedRelyingPartyId) || throw AuthenticatorResponseVerificationException::create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function process(
'No public key available.'
);
$isU2F = U2FPublicKey::isU2FKey($credentialPublicKey);
$rpId = $publicKeyCredentialOptions->rpId ?? $host;
$rpId = $publicKeyCredentialOptions->rpId ?? $publicKeyCredentialOptions->rp->id ?? $host;

Check failure on line 34 in src/webauthn/src/CeremonyStep/CheckRelyingPartyIdIdHash.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static Analysis

Access to an undefined property Webauthn\PublicKeyCredentialCreationOptions|Webauthn\PublicKeyCredentialRequestOptions::$rp.
$facetId = $this->getFacetId($rpId, $publicKeyCredentialOptions->extensions, $authData ->extensions);
$rpIdHash = hash('sha256', $isU2F ? $C->origin : $facetId, true);
hash_equals(
Expand Down

0 comments on commit 4ad5b42

Please sign in to comment.