mirror of
https://github.com/bitwarden/web
synced 2025-12-10 13:23:15 +00:00
Use the new KDF constants (#1559)
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 9950fb42a1...5b7b2a03dd
@@ -1,11 +1,6 @@
|
|||||||
import "core-js/stable";
|
import "core-js/stable";
|
||||||
require("zone.js/dist/zone");
|
require("zone.js/dist/zone");
|
||||||
|
|
||||||
// IE11 fix, ref: https://github.com/angular/angular/issues/24769
|
|
||||||
if (!Element.prototype.matches && (Element.prototype as any).msMatchesSelector) {
|
|
||||||
Element.prototype.matches = (Element.prototype as any).msMatchesSelector;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
// Production
|
// Production
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
|||||||
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
import { SEND_KDF_ITERATIONS } from "jslib-common/enums/kdfType";
|
||||||
import { SendType } from "jslib-common/enums/sendType";
|
import { SendType } from "jslib-common/enums/sendType";
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
import { SendAccess } from "jslib-common/models/domain/sendAccess";
|
import { SendAccess } from "jslib-common/models/domain/sendAccess";
|
||||||
@@ -140,7 +141,7 @@ export class AccessComponent implements OnInit {
|
|||||||
this.password,
|
this.password,
|
||||||
keyArray,
|
keyArray,
|
||||||
"sha256",
|
"sha256",
|
||||||
100000
|
SEND_KDF_ITERATIONS
|
||||||
);
|
);
|
||||||
this.accessRequest.password = Utils.fromBufferToB64(passwordHash);
|
this.accessRequest.password = Utils.fromBufferToB64(passwordHash);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="small form-text text-muted">
|
<div class="small form-text text-muted">
|
||||||
<p>{{ "kdfIterationsDesc" | i18n: (100000 | number) }}</p>
|
<p>{{ "kdfIterationsDesc" | i18n: (recommendedKdfIterations | number) }}</p>
|
||||||
<strong>{{ "warning" | i18n }}</strong
|
<strong>{{ "warning" | i18n }}</strong
|
||||||
>: {{ "kdfIterationsWarning" | i18n: (50000 | number) }}
|
>: {{ "kdfIterationsWarning" | i18n: (50000 | number) }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { LogService } from "jslib-common/abstractions/log.service";
|
|||||||
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { KdfType } from "jslib-common/enums/kdfType";
|
import { DEFAULT_KDF_ITERATIONS, KdfType } from "jslib-common/enums/kdfType";
|
||||||
import { KdfRequest } from "jslib-common/models/request/kdfRequest";
|
import { KdfRequest } from "jslib-common/models/request/kdfRequest";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -20,6 +20,7 @@ export class ChangeKdfComponent implements OnInit {
|
|||||||
kdf = KdfType.PBKDF2_SHA256;
|
kdf = KdfType.PBKDF2_SHA256;
|
||||||
kdfOptions: any[] = [];
|
kdfOptions: any[] = [];
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
recommendedKdfIterations = DEFAULT_KDF_ITERATIONS;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
|
|||||||
@@ -85,10 +85,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
|||||||
return this.getDevice() === DeviceType.SafariBrowser;
|
return this.getDevice() === DeviceType.SafariBrowser;
|
||||||
}
|
}
|
||||||
|
|
||||||
isIE(): boolean {
|
|
||||||
return this.getDevice() === DeviceType.IEBrowser;
|
|
||||||
}
|
|
||||||
|
|
||||||
isMacAppStore(): boolean {
|
isMacAppStore(): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -139,26 +135,23 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
|||||||
blobOptions.type = type;
|
blobOptions.type = type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (blobOptions != null && !this.isIE()) {
|
if (blobOptions != null) {
|
||||||
blob = new Blob([blobData], blobOptions);
|
blob = new Blob([blobData], blobOptions);
|
||||||
} else {
|
} else {
|
||||||
blob = new Blob([blobData]);
|
blob = new Blob([blobData]);
|
||||||
}
|
}
|
||||||
if (navigator.msSaveOrOpenBlob) {
|
|
||||||
navigator.msSaveBlob(blob, fileName);
|
const a = win.document.createElement("a");
|
||||||
} else {
|
if (doDownload) {
|
||||||
const a = win.document.createElement("a");
|
a.download = fileName;
|
||||||
if (doDownload) {
|
} else if (!this.isSafari()) {
|
||||||
a.download = fileName;
|
a.target = "_blank";
|
||||||
} else if (!this.isSafari()) {
|
|
||||||
a.target = "_blank";
|
|
||||||
}
|
|
||||||
a.href = URL.createObjectURL(blob);
|
|
||||||
a.style.position = "fixed";
|
|
||||||
win.document.body.appendChild(a);
|
|
||||||
a.click();
|
|
||||||
win.document.body.removeChild(a);
|
|
||||||
}
|
}
|
||||||
|
a.href = URL.createObjectURL(blob);
|
||||||
|
a.style.position = "fixed";
|
||||||
|
win.document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
win.document.body.removeChild(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
getApplicationVersion(): Promise<string> {
|
getApplicationVersion(): Promise<string> {
|
||||||
|
|||||||
Reference in New Issue
Block a user