1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Rename CipherString and CipherArrayBuffer to Enc (#352)

This commit is contained in:
Matt Gibson
2021-04-20 19:16:19 -05:00
committed by GitHub
parent a5ccca05da
commit 3a1087456f
44 changed files with 200 additions and 200 deletions

View File

@@ -8,7 +8,7 @@ import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
import { PolicyService } from '../../abstractions/policy.service';
import { UserService } from '../../abstractions/user.service';
import { CipherString } from '../../models/domain/cipherString';
import { EncString } from '../../models/domain/encString';
import { MasterPasswordPolicyOptions } from '../../models/domain/masterPasswordPolicyOptions';
import { SymmetricCryptoKey } from '../../models/domain/symmetricCryptoKey';
@@ -77,7 +77,7 @@ export class ChangePasswordComponent implements OnInit {
this.kdf, this.kdfIterations);
const masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, key);
let encKey: [SymmetricCryptoKey, CipherString] = null;
let encKey: [SymmetricCryptoKey, EncString] = null;
const existingEncKey = await this.cryptoService.getEncKey();
if (existingEncKey == null) {
encKey = await this.cryptoService.makeEncKey(key);
@@ -95,7 +95,7 @@ export class ChangePasswordComponent implements OnInit {
}
async performSubmitActions(masterPasswordHash: string, key: SymmetricCryptoKey,
encKey: [SymmetricCryptoKey, CipherString]) {
encKey: [SymmetricCryptoKey, EncString]) {
// Override in sub-class
}

View File

@@ -14,7 +14,7 @@ import { VaultTimeoutService } from '../../abstractions/vaultTimeout.service';
import { ConstantsService } from '../../services/constants.service';
import { CipherString } from '../../models/domain/cipherString';
import { EncString } from '../../models/domain/encString';
import { SymmetricCryptoKey } from '../../models/domain/symmetricCryptoKey';
import { PasswordVerificationRequest } from '../../models/request/passwordVerificationRequest';
@@ -83,7 +83,7 @@ export class LockComponent implements OnInit {
this.vaultTimeoutService.pinProtectedKey);
const encKey = await this.cryptoService.getEncKey(key);
const protectedPin = await this.storageService.get<string>(ConstantsService.protectedPin);
const decPin = await this.cryptoService.decryptToUtf8(new CipherString(protectedPin), encKey);
const decPin = await this.cryptoService.decryptToUtf8(new EncString(protectedPin), encKey);
failed = decPin !== this.pin;
if (!failed) {
await this.setKeyAndContinue(key);
@@ -132,7 +132,7 @@ export class LockComponent implements OnInit {
if (this.pinSet[0]) {
const protectedPin = await this.storageService.get<string>(ConstantsService.protectedPin);
const encKey = await this.cryptoService.getEncKey(key);
const decPin = await this.cryptoService.decryptToUtf8(new CipherString(protectedPin), encKey);
const decPin = await this.cryptoService.decryptToUtf8(new EncString(protectedPin), encKey);
const pinKey = await this.cryptoService.makePinKey(decPin, this.email, kdf, kdfIterations);
this.vaultTimeoutService.pinProtectedKey = await this.cryptoService.encrypt(key.key, pinKey);
}

View File

@@ -23,7 +23,7 @@ import { SendFileView } from '../../../models/view/sendFileView';
import { SendTextView } from '../../../models/view/sendTextView';
import { SendView } from '../../../models/view/sendView';
import { CipherArrayBuffer } from '../../../models/domain/cipherArrayBuffer';
import { EncArrayBuffer } from '../../../models/domain/encArrayBuffer';
import { Send } from '../../../models/domain/send';
// TimeOption is used for the dropdown implementation of custom times
@@ -384,7 +384,7 @@ export class AddEditComponent implements OnInit {
return this.sendService.get(this.sendId);
}
protected async encryptSend(file: File): Promise<[Send, CipherArrayBuffer]> {
protected async encryptSend(file: File): Promise<[Send, EncArrayBuffer]> {
const sendData = await this.sendService.encrypt(this.send, file, this.password, null);
// Parse dates

View File

@@ -13,7 +13,7 @@ import { PolicyService } from '../../abstractions/policy.service';
import { SyncService } from '../../abstractions/sync.service';
import { UserService } from '../../abstractions/user.service';
import { CipherString } from '../../models/domain/cipherString';
import { EncString } from '../../models/domain/encString';
import { SymmetricCryptoKey } from '../../models/domain/symmetricCryptoKey';
import { KeysRequest } from '../../models/request/keysRequest';
@@ -65,7 +65,7 @@ export class SetPasswordComponent extends BaseChangePasswordComponent {
}
async performSubmitActions(masterPasswordHash: string, key: SymmetricCryptoKey,
encKey: [SymmetricCryptoKey, CipherString]) {
encKey: [SymmetricCryptoKey, EncString]) {
const request = new SetPasswordRequest();
request.masterPasswordHash = masterPasswordHash;
request.key = encKey[1].encryptedString;