mirror of
https://github.com/moparisthebest/mail
synced 2025-02-16 07:00:09 -05:00
commit
c94c419b38
@ -13,7 +13,7 @@ module.exports = appCfg;
|
|||||||
*/
|
*/
|
||||||
appCfg.config = {
|
appCfg.config = {
|
||||||
cloudUrl: 'https://keys.whiteout.io',
|
cloudUrl: 'https://keys.whiteout.io',
|
||||||
hkpUrl: 'https://pgp.mit.edu',
|
hkpUrl: 'http://keyserver.ubuntu.com',
|
||||||
privkeyServerUrl: 'https://keychain.whiteout.io',
|
privkeyServerUrl: 'https://keychain.whiteout.io',
|
||||||
adminUrl: 'https://admin-node.whiteout.io',
|
adminUrl: 'https://admin-node.whiteout.io',
|
||||||
settingsUrl: 'https://settings.whiteout.io/autodiscovery/',
|
settingsUrl: 'https://settings.whiteout.io/autodiscovery/',
|
||||||
|
@ -20,7 +20,7 @@ var PublickeyImportCtrl = function($scope, $q, keychain, pgp, hkp, dialog, appCo
|
|||||||
// scope variables
|
// scope variables
|
||||||
//
|
//
|
||||||
|
|
||||||
$scope.hkpUrl = appConfig.config.hkpUrl.replace('https://', '');
|
$scope.hkpUrl = appConfig.config.hkpUrl.replace(/http[s]?:\/\//, '');
|
||||||
|
|
||||||
//
|
//
|
||||||
// scope functions
|
// scope functions
|
||||||
|
@ -28,8 +28,8 @@ PGP.prototype.generateKeys = function(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generate keypair
|
// generate keypair
|
||||||
name = options.realname ? options.realname.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, '').trim() + ' ' : '';
|
name = options.realname ? options.realname.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, '').trim() : '';
|
||||||
userId = name + '<' + options.emailAddress + '>';
|
userId = name + ' <' + options.emailAddress + '>';
|
||||||
passphrase = (options.passphrase) ? options.passphrase : undefined;
|
passphrase = (options.passphrase) ? options.passphrase : undefined;
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
|
@ -86,6 +86,10 @@ describe('PGP Crypto Api unit tests', function() {
|
|||||||
publicKeyArmored: keys.publicKeyArmored
|
publicKeyArmored: keys.publicKeyArmored
|
||||||
});
|
});
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
|
var keyParams = pgp.getKeyParams();
|
||||||
|
expect(keyParams.userIds[0].name).to.equal('');
|
||||||
|
expect(keyParams.userIds[0].emailAddress).to.equal(user);
|
||||||
|
|
||||||
return pgp.encrypt('secret', [keyObject.publicKeyArmored]);
|
return pgp.encrypt('secret', [keyObject.publicKeyArmored]);
|
||||||
}).then(function(ct) {
|
}).then(function(ct) {
|
||||||
expect(ct).to.exist;
|
expect(ct).to.exist;
|
||||||
@ -117,7 +121,9 @@ describe('PGP Crypto Api unit tests', function() {
|
|||||||
publicKeyArmored: keys.publicKeyArmored
|
publicKeyArmored: keys.publicKeyArmored
|
||||||
});
|
});
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
expect(pgp.getKeyParams().userIds[0].name).to.equal('Jon Doe');
|
var keyParams = pgp.getKeyParams();
|
||||||
|
expect(keyParams.userIds[0].name).to.equal('Jon Doe');
|
||||||
|
expect(keyParams.userIds[0].emailAddress).to.equal(user);
|
||||||
|
|
||||||
return pgp.encrypt('secret', [keyObject.publicKeyArmored]);
|
return pgp.encrypt('secret', [keyObject.publicKeyArmored]);
|
||||||
}).then(function(ct) {
|
}).then(function(ct) {
|
||||||
@ -150,7 +156,9 @@ describe('PGP Crypto Api unit tests', function() {
|
|||||||
publicKeyArmored: keys.publicKeyArmored
|
publicKeyArmored: keys.publicKeyArmored
|
||||||
});
|
});
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
expect(pgp.getKeyParams().userIds[0].name).to.equal('Jon Doe');
|
var keyParams = pgp.getKeyParams();
|
||||||
|
expect(keyParams.userIds[0].name).to.equal('Jon Doe');
|
||||||
|
expect(keyParams.userIds[0].emailAddress).to.equal(user);
|
||||||
|
|
||||||
return pgp.encrypt('secret', [keyObject.publicKeyArmored]);
|
return pgp.encrypt('secret', [keyObject.publicKeyArmored]);
|
||||||
}).then(function(ct) {
|
}).then(function(ct) {
|
||||||
|
Loading…
Reference in New Issue
Block a user