Skip to content
Permalink
Browse files
[WebAuthn] Fix crash when making assertions
https://bugs.webkit.org/show_bug.cgi?id=241814
rdar://95618710

Reviewed by Brent Fulgham.

We return an NSData inside _WKAuthenticatorAssertionResponse with ref count 0. To fix this,
we use autorelease as we do in the _WKAuthenticatorAttestationResponse case.

* Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(wkAuthenticatorAssertionResponse):

Canonical link: https://commits.webkit.org/251707@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pascoej committed Jun 21, 2022
1 parent e7abdad commit 1090246
Showing 1 changed file with 1 addition and 1 deletion.
@@ -929,7 +929,7 @@ - (void)makeCredentialWithClientDataHash:(NSData *)clientDataHash options:(_WKPu
if (data.userHandle)
userHandle = [NSData dataWithBytes:data.userHandle->data() length:data.userHandle->byteLength()];

return adoptNS([[_WKAuthenticatorAssertionResponse alloc] initWithClientDataJSON:clientDataJSON rawId:[NSData dataWithBytes:data.rawId->data() length:data.rawId->byteLength()] extensionOutputsCBOR:toNSData(data.extensionOutputs->toCBOR()).get() authenticatorData:[NSData dataWithBytes:data.authenticatorData->data() length:data.authenticatorData->byteLength()] signature:[NSData dataWithBytes:data.signature->data() length:data.signature->byteLength()] userHandle:userHandle attachment:authenticatorAttachmentToWKAuthenticatorAttachment(attachment)]);
return adoptNS([[_WKAuthenticatorAssertionResponse alloc] initWithClientDataJSON:clientDataJSON rawId:[NSData dataWithBytes:data.rawId->data() length:data.rawId->byteLength()] extensionOutputsCBOR:toNSData(data.extensionOutputs->toCBOR()).autorelease() authenticatorData:[NSData dataWithBytes:data.authenticatorData->data() length:data.authenticatorData->byteLength()] signature:[NSData dataWithBytes:data.signature->data() length:data.signature->byteLength()] userHandle:userHandle attachment:authenticatorAttachmentToWKAuthenticatorAttachment(attachment)]);
}
#endif

0 comments on commit 1090246

Please sign in to comment.