1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-31 00:33:33 +00:00

Merge branch 'km/tsgo-compat-auth' into ts7

This commit is contained in:
Bernd Schoolmann
2026-01-09 15:15:49 +01:00
5 changed files with 11 additions and 8 deletions

View File

@@ -676,7 +676,7 @@ export class LoginViaAuthRequestComponent implements OnInit, OnDestroy {
private async decryptViaApprovedAuthRequest(
authRequestResponse: AuthRequestResponse,
privateKey: ArrayBuffer,
privateKey: Uint8Array,
userId: UserId,
): Promise<void> {
/**

View File

@@ -72,7 +72,7 @@ export abstract class AuthRequestServiceAbstraction {
*/
abstract setUserKeyAfterDecryptingSharedUserKey(
authReqResponse: AuthRequestResponse,
authReqPrivateKey: ArrayBuffer,
authReqPrivateKey: Uint8Array,
userId: UserId,
): Promise<void>;
/**
@@ -83,7 +83,7 @@ export abstract class AuthRequestServiceAbstraction {
*/
abstract setKeysAfterDecryptingSharedMasterKeyAndHash(
authReqResponse: AuthRequestResponse,
authReqPrivateKey: ArrayBuffer,
authReqPrivateKey: Uint8Array,
userId: UserId,
): Promise<void>;
/**
@@ -94,7 +94,7 @@ export abstract class AuthRequestServiceAbstraction {
*/
abstract decryptPubKeyEncryptedUserKey(
pubKeyEncryptedUserKey: string,
privateKey: ArrayBuffer,
privateKey: Uint8Array,
): Promise<UserKey>;
/**
* Decrypts a `MasterKey` and `MasterKeyHash` from a public key encrypted `MasterKey` and `MasterKeyHash`.
@@ -106,7 +106,7 @@ export abstract class AuthRequestServiceAbstraction {
abstract decryptPubKeyEncryptedMasterKeyAndHash(
pubKeyEncryptedMasterKey: string,
pubKeyEncryptedMasterKeyHash: string,
privateKey: ArrayBuffer,
privateKey: Uint8Array,
): Promise<{ masterKey: MasterKey; masterKeyHash: string }>;
/**

View File

@@ -213,7 +213,9 @@ export class AuthRequestService implements AuthRequestServiceAbstraction {
);
const masterKey = new SymmetricCryptoKey(decryptedMasterKeyArrayBuffer) as MasterKey;
const masterKeyHash = Utils.fromBufferToUtf8(decryptedMasterKeyHashArrayBuffer);
const masterKeyHash = Utils.fromBufferToUtf8(
decryptedMasterKeyHashArrayBuffer.buffer as ArrayBuffer,
);
return {
masterKey,

View File

@@ -17,7 +17,7 @@ export class AdminAuthRequestStorable {
toJSON() {
return {
id: this.id,
privateKey: Utils.fromBufferToByteString(this.privateKey),
privateKey: Utils.fromBufferToByteString(this.privateKey.buffer as ArrayBuffer),
};
}

View File

@@ -41,7 +41,8 @@ export class ChallengeResponse extends BaseResponse implements PublicKeyCredenti
super(response);
this.attestation = this.getResponseProperty("attestation");
this.authenticatorSelection = this.getResponseProperty("authenticatorSelection");
this.challenge = Utils.fromUrlB64ToArray(this.getResponseProperty("challenge"));
this.challenge = Utils.fromUrlB64ToArray(this.getResponseProperty("challenge"))
.buffer as ArrayBuffer;
this.excludeCredentials = this.getResponseProperty("excludeCredentials").map((c: any) => {
c.id = Utils.fromUrlB64ToArray(c.id).buffer;
return c;