Skip to content

Commit

Permalink
Enigma: Fix key generation in Safari by upgrade to OpenPGP 2.6.2 (#6149)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Feb 12, 2018
1 parent b46cd5d commit 674eac1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ CHANGELOG Roundcube Webmail
- Managesieve: Fix missing Save button in Edit Filter Set page of Classic skin (#6154)
- Fix duplicated labels in Test SMTP Config section (#6166)
- Fix PHP Warning: exif_read_data(...): Illegal IFD size (#6169)
- Enigma: Fix key generation in Safari by upgrade to OpenPGP 2.6.2 (#6149)

RELEASE 1.3.4
-------------
Expand Down
8 changes: 4 additions & 4 deletions jsdeps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@
{
"lib": "openpgp",
"name": "OpenPGP.js",
"version": "1.6.2",
"url": "https://raw.githubusercontent.com/openpgpjs/openpgpjs/v1.6.2/dist/openpgp.min.js",
"version": "2.6.2",
"url": "https://raw.githubusercontent.com/openpgpjs/openpgpjs/v2.6.2/dist/openpgp.min.js",
"dest": "plugins/enigma/openpgp.min.js",
"sha1": "de75af6883019f490f69211e506377c84f49a85b",
"sha1": "cce0087eb20328453b9378a2b01cc6339cef97b2",
"license": "LGPL",
"copyright": "Copyright (c) OpenPGP Development Team",
"source": "https://github.com/openpgpjs/openpgpjs/blob/v1.6.2/dist/openpgp.js"
"source": "https://github.com/openpgpjs/openpgpjs/blob/v2.6.2/dist/openpgp.js"
},
{
"lib": "codemirror",
Expand Down
7 changes: 4 additions & 3 deletions plugins/enigma/enigma.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ rcube_webmail.prototype.enigma_key_create_save = function()
size = $('#key-size').val();

$('[name="identity[]"]:checked').each(function() {
users.push(this.value);
users.push({name: $(this).data('name') || '', email: $(this).data('email')});
});

// validate the form
Expand All @@ -155,11 +155,11 @@ rcube_webmail.prototype.enigma_key_create_save = function()
lock = this.set_busy(true, 'enigma.keygenerating');
options = {
numBits: size,
userId: users,
userIds: users,
passphrase: password
};

openpgp.generateKeyPair(options).then(function(keypair) {
openpgp.generateKey(options).then(function(keypair) {
// success
var post = {_a: 'import', _keys: keypair.privateKeyArmored, _generated: 1,
_passwd: password, _keyid: keypair.key.primaryKey.fingerprint};
Expand All @@ -168,6 +168,7 @@ rcube_webmail.prototype.enigma_key_create_save = function()
rcmail.http_post('plugin.enigmakeys', post, lock);
}, function(error) {
// failure
console.error(error);
rcmail.set_busy(false, null, lock);
rcmail.display_message(rcmail.get_label('enigma.keygenerateerror'), 'error');
});
Expand Down
3 changes: 2 additions & 1 deletion plugins/enigma/lib/enigma_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ function tpl_key_create_form($attrib)
$checkbox = new html_checkbox(array('name' => 'identity[]'));
foreach ((array) $identities as $idx => $ident) {
$name = empty($ident['name']) ? ($ident['email']) : $ident['ident'];
$identities[$idx] = html::tag('li', null, html::label(null, $checkbox->show($name, array('value' => $name)) . rcube::Q($name)));
$attr = array('value' => $idx, 'data-name' => $ident['name'], 'data-email' => $ident['email']);
$identities[$idx] = html::tag('li', null, html::label(null, $checkbox->show($idx, $attr) . rcube::Q($name)));
}

$table->add('title', html::label('key-name', rcube::Q($this->enigma->gettext('newkeyident'))));
Expand Down

0 comments on commit 674eac1

Please sign in to comment.