mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[EC-598] feat: add counter to fido2key
This commit is contained in:
@@ -7,6 +7,7 @@ export class Fido2KeyApi extends BaseResponse {
|
|||||||
keyValue: string;
|
keyValue: string;
|
||||||
rpId: string;
|
rpId: string;
|
||||||
userHandle: string;
|
userHandle: string;
|
||||||
|
counter: number;
|
||||||
|
|
||||||
// Extras
|
// Extras
|
||||||
rpName: string;
|
rpName: string;
|
||||||
@@ -24,9 +25,10 @@ export class Fido2KeyApi extends BaseResponse {
|
|||||||
this.keyCurve = this.getResponseProperty("KeyCurve");
|
this.keyCurve = this.getResponseProperty("KeyCurve");
|
||||||
this.keyValue = this.getResponseProperty("keyValue");
|
this.keyValue = this.getResponseProperty("keyValue");
|
||||||
this.rpId = this.getResponseProperty("RpId");
|
this.rpId = this.getResponseProperty("RpId");
|
||||||
|
this.userHandle = this.getResponseProperty("UserHandle");
|
||||||
|
this.counter = this.getResponseProperty("Counter");
|
||||||
this.rpName = this.getResponseProperty("RpName");
|
this.rpName = this.getResponseProperty("RpName");
|
||||||
this.userName = this.getResponseProperty("UserName");
|
this.userName = this.getResponseProperty("UserName");
|
||||||
this.userHandle = this.getResponseProperty("UserHandle");
|
|
||||||
this.origin = this.getResponseProperty("Origin");
|
this.origin = this.getResponseProperty("Origin");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export class Fido2KeyData {
|
|||||||
keyValue: string;
|
keyValue: string;
|
||||||
rpId: string;
|
rpId: string;
|
||||||
userHandle: string;
|
userHandle: string;
|
||||||
|
counter: number;
|
||||||
|
|
||||||
// Extras
|
// Extras
|
||||||
rpName: string;
|
rpName: string;
|
||||||
@@ -24,6 +25,7 @@ export class Fido2KeyData {
|
|||||||
this.keyValue = data.keyValue;
|
this.keyValue = data.keyValue;
|
||||||
this.rpId = data.rpId;
|
this.rpId = data.rpId;
|
||||||
this.userHandle = data.userHandle;
|
this.userHandle = data.userHandle;
|
||||||
|
this.counter = data.counter;
|
||||||
this.rpName = data.rpName;
|
this.rpName = data.rpName;
|
||||||
this.userName = data.userName;
|
this.userName = data.userName;
|
||||||
this.origin = data.origin;
|
this.origin = data.origin;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export class Fido2Key extends Domain {
|
|||||||
keyValue: EncString;
|
keyValue: EncString;
|
||||||
rpId: EncString;
|
rpId: EncString;
|
||||||
userHandle: EncString;
|
userHandle: EncString;
|
||||||
|
counter: EncString;
|
||||||
|
|
||||||
// Extras
|
// Extras
|
||||||
rpName: EncString;
|
rpName: EncString;
|
||||||
@@ -35,6 +36,7 @@ export class Fido2Key extends Domain {
|
|||||||
keyValue: null,
|
keyValue: null,
|
||||||
rpId: null,
|
rpId: null,
|
||||||
userHandle: null,
|
userHandle: null,
|
||||||
|
counter: null,
|
||||||
rpName: null,
|
rpName: null,
|
||||||
userName: null,
|
userName: null,
|
||||||
origin: null,
|
origin: null,
|
||||||
@@ -53,6 +55,7 @@ export class Fido2Key extends Domain {
|
|||||||
keyValue: null,
|
keyValue: null,
|
||||||
rpId: null,
|
rpId: null,
|
||||||
userHandle: null,
|
userHandle: null,
|
||||||
|
counter: null,
|
||||||
rpName: null,
|
rpName: null,
|
||||||
userName: null,
|
userName: null,
|
||||||
origin: null,
|
origin: null,
|
||||||
@@ -71,6 +74,7 @@ export class Fido2Key extends Domain {
|
|||||||
keyValue: null,
|
keyValue: null,
|
||||||
rpId: null,
|
rpId: null,
|
||||||
userHandle: null,
|
userHandle: null,
|
||||||
|
counter: null,
|
||||||
rpName: null,
|
rpName: null,
|
||||||
userName: null,
|
userName: null,
|
||||||
origin: null,
|
origin: null,
|
||||||
@@ -89,6 +93,7 @@ export class Fido2Key extends Domain {
|
|||||||
const keyValue = EncString.fromJSON(obj.keyValue);
|
const keyValue = EncString.fromJSON(obj.keyValue);
|
||||||
const rpId = EncString.fromJSON(obj.rpId);
|
const rpId = EncString.fromJSON(obj.rpId);
|
||||||
const userHandle = EncString.fromJSON(obj.userHandle);
|
const userHandle = EncString.fromJSON(obj.userHandle);
|
||||||
|
const counter = EncString.fromJSON(obj.counter);
|
||||||
const rpName = EncString.fromJSON(obj.rpName);
|
const rpName = EncString.fromJSON(obj.rpName);
|
||||||
const userName = EncString.fromJSON(obj.userName);
|
const userName = EncString.fromJSON(obj.userName);
|
||||||
const origin = EncString.fromJSON(obj.origin);
|
const origin = EncString.fromJSON(obj.origin);
|
||||||
@@ -100,6 +105,7 @@ export class Fido2Key extends Domain {
|
|||||||
keyValue,
|
keyValue,
|
||||||
rpId,
|
rpId,
|
||||||
userHandle,
|
userHandle,
|
||||||
|
counter,
|
||||||
rpName,
|
rpName,
|
||||||
userName,
|
userName,
|
||||||
origin,
|
origin,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export class Fido2KeyView extends ItemView {
|
|||||||
keyValue: string;
|
keyValue: string;
|
||||||
rpId: string;
|
rpId: string;
|
||||||
userHandle: string;
|
userHandle: string;
|
||||||
|
counter: number;
|
||||||
|
|
||||||
// Extras
|
// Extras
|
||||||
rpName: string;
|
rpName: string;
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ describe("FidoAuthenticatorService", () => {
|
|||||||
rpId: params.rpEntity.id,
|
rpId: params.rpEntity.id,
|
||||||
rpName: params.rpEntity.name,
|
rpName: params.rpEntity.name,
|
||||||
userHandle: Fido2Utils.bufferToString(params.userEntity.id),
|
userHandle: Fido2Utils.bufferToString(params.userEntity.id),
|
||||||
|
counter: 0,
|
||||||
userName: params.userEntity.name,
|
userName: params.userEntity.name,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
@@ -268,6 +269,7 @@ describe("FidoAuthenticatorService", () => {
|
|||||||
rpId: params.rpEntity.id,
|
rpId: params.rpEntity.id,
|
||||||
rpName: params.rpEntity.name,
|
rpName: params.rpEntity.name,
|
||||||
userHandle: Fido2Utils.bufferToString(params.userEntity.id),
|
userHandle: Fido2Utils.bufferToString(params.userEntity.id),
|
||||||
|
counter: 0,
|
||||||
userName: params.userEntity.name,
|
userName: params.userEntity.name,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -139,8 +139,9 @@ export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstr
|
|||||||
fido2Key.keyCurve = "P-256";
|
fido2Key.keyCurve = "P-256";
|
||||||
fido2Key.keyValue = Fido2Utils.bufferToString(pcks8Key);
|
fido2Key.keyValue = Fido2Utils.bufferToString(pcks8Key);
|
||||||
fido2Key.rpId = params.rpEntity.id;
|
fido2Key.rpId = params.rpEntity.id;
|
||||||
fido2Key.rpName = params.rpEntity.name;
|
|
||||||
fido2Key.userHandle = Fido2Utils.bufferToString(params.userEntity.id);
|
fido2Key.userHandle = Fido2Utils.bufferToString(params.userEntity.id);
|
||||||
|
fido2Key.counter = 0;
|
||||||
|
fido2Key.rpName = params.rpEntity.name;
|
||||||
fido2Key.userName = params.userEntity.name;
|
fido2Key.userName = params.userEntity.name;
|
||||||
|
|
||||||
return fido2Key;
|
return fido2Key;
|
||||||
|
|||||||
Reference in New Issue
Block a user