mirror of
https://github.com/bitwarden/browser
synced 2025-12-31 15:43:28 +00:00
change email/password adjustments
This commit is contained in:
@@ -77,7 +77,6 @@ angular
|
||||
|
||||
return {
|
||||
id: encryptedFolder.Id,
|
||||
'type': 0,
|
||||
name: cryptoService.decrypt(encryptedFolder.Name)
|
||||
};
|
||||
};
|
||||
@@ -179,7 +178,6 @@ angular
|
||||
|
||||
return {
|
||||
id: unencryptedFolder.id,
|
||||
'type': 0,
|
||||
name: cryptoService.encrypt(unencryptedFolder.name, key)
|
||||
};
|
||||
};
|
||||
|
||||
@@ -116,14 +116,26 @@ angular
|
||||
return buffer.getBytes(16);
|
||||
};
|
||||
|
||||
_service.getPrivateKey = function () {
|
||||
_service.getPrivateKey = function (outputEncoding) {
|
||||
outputEncoding = outputEncoding || 'native';
|
||||
|
||||
if (_privateKey) {
|
||||
if (outputEncoding === 'raw') {
|
||||
var privateKeyAsn1 = forge.pki.privateKeyToAsn1(_privateKey);
|
||||
var privateKeyPkcs8 = forge.pki.wrapRsaPrivateKey(privateKeyAsn1);
|
||||
return forge.asn1.toDer(privateKeyPkcs8).getBytes();
|
||||
}
|
||||
|
||||
return _privateKey;
|
||||
}
|
||||
|
||||
if ($sessionStorage.privateKey) {
|
||||
var privateKeyBytes = forge.util.decode64($sessionStorage.privateKey);
|
||||
_privateKey = forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(privateKeyBytes));
|
||||
|
||||
if (outputEncoding === 'raw') {
|
||||
return privateKeyBytes;
|
||||
}
|
||||
}
|
||||
|
||||
return _privateKey;
|
||||
|
||||
Reference in New Issue
Block a user