mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 19:53:43 +00:00
refactor for enc type header and CryptoKey
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
var userService = $injector.get('userService');
|
||||
var cryptoService = $injector.get('cryptoService');
|
||||
|
||||
cryptoService.getKey(false, function (key) {
|
||||
cryptoService.getKey(function (key) {
|
||||
userService.isAuthenticated(function (isAuthenticated) {
|
||||
if (isAuthenticated) {
|
||||
if (!key) {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
userService.getEmail(function (email) {
|
||||
var key = cryptoService.makeKey($scope.masterPassword, email);
|
||||
cryptoService.hashPassword($scope.masterPassword, key, function (keyHash) {
|
||||
cryptoService.getKeyHash(true, function (storedKeyHash) {
|
||||
cryptoService.getKeyHash(function (storedKeyHash) {
|
||||
if (storedKeyHash && keyHash && storedKeyHash === keyHash) {
|
||||
cryptoService.setKey(key, function () {
|
||||
chrome.runtime.sendMessage({ command: 'unlocked' });
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
chrome.storage.local.set(obj, function () {
|
||||
cryptoService.getKeyHash(false, function (keyHash) {
|
||||
cryptoService.getKeyHash(function (keyHash) {
|
||||
if (keyHash) {
|
||||
cryptoService.toggleKey(function () { });
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
userService.getEmail(function (email) {
|
||||
var key = cryptoService.makeKey($scope.masterPassword, email);
|
||||
cryptoService.hashPassword($scope.masterPassword, key, function (keyHash) {
|
||||
cryptoService.getKeyHash(true, function (storedKeyHash) {
|
||||
cryptoService.getKeyHash(function (storedKeyHash) {
|
||||
if (storedKeyHash && keyHash && storedKeyHash === keyHash) {
|
||||
deferred.resolve();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user