mirror of
https://github.com/bitwarden/browser
synced 2026-02-18 10:23:52 +00:00
Cleanup
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { SigningKeyType } from "@bitwarden/key-management";
|
||||
import { SignedPublicKeyOwnershipClaim } from "@bitwarden/common/key-management/types";
|
||||
import { SigningKey, SigningKeyType, VerifyingKey } from "@bitwarden/key-management";
|
||||
|
||||
// This request contains other account-owned keys that are encrypted with the user key.
|
||||
export class AccountKeysRequest {
|
||||
// Other keys encrypted by the userkey
|
||||
userKeyEncryptedAccountPrivateKey: string;
|
||||
accountPublicKey: string;
|
||||
signedPublicKeyOwnershipClaim: string | null;
|
||||
@@ -13,16 +14,15 @@ export class AccountKeysRequest {
|
||||
constructor(
|
||||
userKeyEncryptedAccountPrivateKey: string,
|
||||
accountPublicKey: string,
|
||||
signedPublicKeyOwnershipClaim: string | null,
|
||||
userKeyEncryptedSigningKey: string | null,
|
||||
verifyingKey: string | null,
|
||||
signingKeyType: SigningKeyType | null,
|
||||
signedPublicKeyOwnershipClaim: SignedPublicKeyOwnershipClaim | null,
|
||||
userKeyEncryptedSigningKey: SigningKey | null,
|
||||
verifyingKey: VerifyingKey | null,
|
||||
) {
|
||||
this.userKeyEncryptedAccountPrivateKey = userKeyEncryptedAccountPrivateKey;
|
||||
this.accountPublicKey = accountPublicKey;
|
||||
this.signedPublicKeyOwnershipClaim = signedPublicKeyOwnershipClaim;
|
||||
this.userKeyEncryptedSigningKey = userKeyEncryptedSigningKey;
|
||||
this.verifyingKey = verifyingKey;
|
||||
this.signingKeyType = signingKeyType;
|
||||
this.userKeyEncryptedSigningKey = userKeyEncryptedSigningKey.toString();
|
||||
this.verifyingKey = verifyingKey.toString();
|
||||
this.signingKeyType = verifyingKey?.algorithm();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
|
||||
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
|
||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||
import { DialogService, ToastService } from "@bitwarden/components";
|
||||
import { KdfConfig, KeyService, UserSigningKey, VerifyingKey } from "@bitwarden/key-management";
|
||||
import { KdfConfig, KeyService, SigningKey, VerifyingKey } from "@bitwarden/key-management";
|
||||
import {
|
||||
AccountRecoveryTrustComponent,
|
||||
EmergencyAccessTrustComponent,
|
||||
@@ -136,9 +136,8 @@ export class UserKeyRotationService {
|
||||
wrappedPrivateKey.encryptedString!,
|
||||
publicKey,
|
||||
signedPublicKeyOwnershipClaim,
|
||||
signingKey.inner(),
|
||||
verifyingKey.toString(),
|
||||
verifyingKey.algorithm(),
|
||||
signingKey,
|
||||
verifyingKey,
|
||||
) as AccountKeysRequest;
|
||||
|
||||
// Methods to unlock the user (access the user key)
|
||||
@@ -184,7 +183,7 @@ export class UserKeyRotationService {
|
||||
kdfConfig: KdfConfig,
|
||||
): Promise<{
|
||||
userKey: UserKey;
|
||||
signingKey?: UserSigningKey;
|
||||
signingKey?: SigningKey;
|
||||
verifyingKey?: VerifyingKey;
|
||||
signedPublicKeyOwnershipClaim?: string;
|
||||
wrappedPrivateKey: EncString;
|
||||
@@ -217,7 +216,7 @@ export class UserKeyRotationService {
|
||||
signingKey: signingKeyEncString,
|
||||
} = noSigningKeySdkClient.crypto().make_signing_keys();
|
||||
const verifyingKey = new VerifyingKey(verifyingKeyString);
|
||||
const signingKey = new UserSigningKey(signingKeyEncString);
|
||||
const signingKey = new SigningKey(signingKeyEncString);
|
||||
return {
|
||||
userKey: newUserKey,
|
||||
signingKey,
|
||||
@@ -238,7 +237,7 @@ export class UserKeyRotationService {
|
||||
publicKey: Utils.fromBufferToB64(publicKey),
|
||||
};
|
||||
} else {
|
||||
const existingSigningKey: UserSigningKey = null;
|
||||
const existingSigningKey: SigningKey = null;
|
||||
const existingVerifyingKey: VerifyingKey = null;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user