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

Fix build

This commit is contained in:
Bernd Schoolmann
2025-12-12 17:14:38 +01:00
parent fb134e4751
commit 2efe985e13
4 changed files with 10 additions and 11 deletions

View File

@@ -13,10 +13,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { getUserId } from "@bitwarden/common/auth/services/account.service";
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
import {
EncryptedString,
EncString,
} from "@bitwarden/common/key-management/crypto/models/enc-string";
import { EncString } from "@bitwarden/common/key-management/crypto/models/enc-string";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { OrganizationId, UserId } from "@bitwarden/common/types/guid";
@@ -29,6 +26,7 @@ import {
KeyService,
KdfType,
} from "@bitwarden/key-management";
import { UnsignedSharedKey } from "@bitwarden/sdk-internal";
import { OrganizationUserResetPasswordEntry } from "./organization-user-reset-password-entry";
@@ -63,7 +61,7 @@ export class OrganizationUserResetPasswordService
orgId: string,
userKey: UserKey,
trustedPublicKeys: Uint8Array[],
): Promise<EncryptedString> {
): Promise<UnsignedSharedKey> {
if (userKey == null) {
throw new Error("User key is required for recovery.");
}
@@ -87,7 +85,7 @@ export class OrganizationUserResetPasswordService
// RSA Encrypt user key with organization's public key
const encryptedKey = await this.encryptService.encapsulateKeyUnsigned(userKey, publicKey);
return encryptedKey.encryptedString;
return encryptedKey;
}
/**
@@ -132,7 +130,7 @@ export class OrganizationUserResetPasswordService
// Decrypt User's Reset Password Key to get UserKey
const userKey = await this.encryptService.decapsulateKeyUnsigned(
new EncString(response.resetPasswordKey),
response.resetPasswordKey,
decPrivateKey,
);
const existingUserKey = userKey as UserKey;

View File

@@ -3,6 +3,7 @@
import { EncString } from "@bitwarden/common/key-management/crypto/models/enc-string";
import { RotateableKeySet } from "@bitwarden/common/key-management/keys/models/rotateable-key-set";
import { BaseResponse } from "@bitwarden/common/models/response/base.response";
import { UnsignedSharedKey } from "@bitwarden/sdk-internal";
import { WebauthnLoginCredentialPrfStatus } from "../../../enums/webauthn-login-credential-prf-status.enum";
@@ -14,7 +15,7 @@ export class WebauthnLoginCredentialResponse extends BaseResponse {
name: string;
prfStatus: WebauthnLoginCredentialPrfStatus;
encryptedPublicKey?: string;
encryptedUserKey?: string;
encryptedUserKey?: UnsignedSharedKey;
constructor(response: unknown) {
super(response);

View File

@@ -204,7 +204,7 @@ export class WebauthnLoginAdminService
request.token = credential.createOptions.token;
request.name = name;
request.supportsPrf = credential.supportsPrf;
request.encryptedUserKey = prfKeySet?.encapsulatedDownstreamKey.encryptedString;
request.encryptedUserKey = prfKeySet?.encapsulatedDownstreamKey;
request.encryptedPublicKey = prfKeySet?.encryptedPublicKey.encryptedString;
request.encryptedPrivateKey = prfKeySet?.encryptedPrivateKey.encryptedString;
await this.apiService.saveCredential(request);
@@ -242,7 +242,7 @@ export class WebauthnLoginAdminService
const request = new EnableCredentialEncryptionRequest();
request.token = assertionOptions.token;
request.deviceResponse = assertionOptions.deviceResponse;
request.encryptedUserKey = prfKeySet.encapsulatedDownstreamKey.encryptedString;
request.encryptedUserKey = prfKeySet.encapsulatedDownstreamKey;
request.encryptedPublicKey = prfKeySet.encryptedPublicKey.encryptedString;
request.encryptedPrivateKey = prfKeySet.encryptedPrivateKey.encryptedString;
await this.apiService.updateCredential(request);

View File

@@ -277,7 +277,7 @@ export class MembersComponent extends BaseMembersComponent<ProviderUser> {
const key = await this.encryptService.encapsulateKeyUnsigned(providerKey, publicKey);
const request = new ProviderUserConfirmRequest();
request.key = key.encryptedString;
request.key = key;
await this.apiService.postProviderUserConfirm(this.providerId, user.id, request);
return { success: true };
} catch (error) {