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