mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
[EC-598] feat: properly check for presence
This commit is contained in:
@@ -32,7 +32,7 @@ export class Fido2Service implements Fido2ServiceAbstraction {
|
|||||||
async createCredential(
|
async createCredential(
|
||||||
params: CredentialRegistrationParams
|
params: CredentialRegistrationParams
|
||||||
): Promise<CredentialRegistrationResult> {
|
): Promise<CredentialRegistrationResult> {
|
||||||
await this.fido2UserInterfaceService.confirmNewCredential();
|
const presence = await this.fido2UserInterfaceService.confirmNewCredential();
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log("Fido2Service.createCredential", params);
|
console.log("Fido2Service.createCredential", params);
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ export class Fido2Service implements Fido2ServiceAbstraction {
|
|||||||
const authData = await generateAuthData({
|
const authData = await generateAuthData({
|
||||||
rpId: params.rp.id,
|
rpId: params.rp.id,
|
||||||
credentialId,
|
credentialId,
|
||||||
userPresence: true,
|
userPresence: presence,
|
||||||
userVerification: false,
|
userVerification: false,
|
||||||
keyPair,
|
keyPair,
|
||||||
attestationFormat: STANDARD_ATTESTATION_FORMAT,
|
attestationFormat: STANDARD_ATTESTATION_FORMAT,
|
||||||
@@ -105,6 +105,8 @@ export class Fido2Service implements Fido2ServiceAbstraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async assertCredential(params: CredentialAssertParams): Promise<CredentialAssertResult> {
|
async assertCredential(params: CredentialAssertParams): Promise<CredentialAssertResult> {
|
||||||
|
const presence = await this.fido2UserInterfaceService.verifyPresence();
|
||||||
|
|
||||||
let credential: BitCredential | undefined;
|
let credential: BitCredential | undefined;
|
||||||
|
|
||||||
if (params.allowedCredentialIds && params.allowedCredentialIds.length > 0) {
|
if (params.allowedCredentialIds && params.allowedCredentialIds.length > 0) {
|
||||||
@@ -135,8 +137,8 @@ export class Fido2Service implements Fido2ServiceAbstraction {
|
|||||||
const authData = await generateAuthData({
|
const authData = await generateAuthData({
|
||||||
credentialId: credential.credentialId,
|
credentialId: credential.credentialId,
|
||||||
rpId: params.rpId,
|
rpId: params.rpId,
|
||||||
userPresence: true,
|
userPresence: presence,
|
||||||
userVerification: true,
|
userVerification: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const signature = await generateSignature({
|
const signature = await generateSignature({
|
||||||
|
|||||||
Reference in New Issue
Block a user