niklasfemerstrand / rc_openpgpjs

OpenPGP for Roundcube via JavaScript
GNU General Public License v2.0
109 stars 45 forks source link

Key lookup failing, no error #129

Closed sporkman closed 10 years ago

sporkman commented 11 years ago

I'm in the middle of testing this out and I'm finding that the public keyserver search doesn't seem to be working for me. Since I'm only working with a test account, I'll supply the email in use, whose key has been uploaded to the sks keyservers: chiptest@bway.net

Initially (probably before the key was ingested by the keyserver and replicated) I did get the JS popup telling me the key was not found. After waiting a bit, I now simply get the "seach" button greyed out for a second and then nothing - no error displayed in the UI, no error in the RC or php logs. From the same host I'm able to perform a query using the same URL I see in the plugin's code:

[root@mbox /usr/local/www/apache22/data/webmail2/plugins/rc_openpgpjs]# fetch -o - "http://pool.sks-keyservers.net:11371/pks/lookup?op=index&search=chiptest@bway.net"
-                                               0% of  826  B    0  Bps<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Search results for 'net chiptest bway'</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
 .uid { color: green; text-decoration: underline; }
 .warn { color: red; font-weight: bold; }
/*]]>*/
</style></head><body><h1>Search results for 'net chiptest bway'</h1><pre>Type bits/keyID     Date       User ID
</pre><hr /><pre>
pub  2048R/<a href="/pks/lookup?op=get&amp;search=0x154B8DE6FF53BF67">FF53BF67</a> 2013-11-15 <a href="/pks/lookup?op=vindex&amp;search=0x154B8DE6FF53BF67">Chip Test &lt;chiptest@bway.net&gt;</a>
</pre></body></html>
-                                             100% of  826  B 4405 kBps

Anything else I can supply?

n4rky commented 11 years ago

On 2013-11-15 02:13, sporkman wrote:

I'm in the middle of testing this out and I'm finding that the public keyserver search doesn't seem to be working for me. Since I'm only working with a test account, I'll supply the email in use, whose key has been uploaded to the sks keyservers: chiptest@bway.net

Initially (probably before the key was ingested by the keyserver and replicated) I did get the JS popup telling me the key was not found. After waiting a bit, I now simply get the "seach" button greyed out for a second and then nothing - no error displayed in the UI, no error in the RC or php logs. From the same host I'm able to perform a query using the same URL I see in the plugin's code:

[root@mbox /usr/local/www/apache22/data/webmail2/plugins/rc_openpgpjs]# fetch -o - "http://pool.sks-keyservers.net:11371/pks/lookup?op=index&search=chiptest@bway.net"

If you're trying to retrieve a key, this is not the correct URL to use. I think you want:

http://pool.sks-keyservers.net:11371/pks/lookup?search=chiptest%40bway.net&op=get [1]

Links:

[1] http://sks.disunitedstates.com/pks/lookup?search=chiptest%40bway.net&amp;op=get

sporkman commented 11 years ago

I'm using the same URL the plugin uses to do the initial search. Where things apparently go wrong is somewhere between there and parsing out the key hash and then searching on that hash. This is all inside hkp_search() in rc_openpgpjs.php. I don't quite follow the regex parsing, or I'd be trying to commit a fix. :)

n4rky commented 11 years ago

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512

On 11/14/2013 10:51 PM, sporkman wrote:

I'm using the same URL the plugin uses to do the initial search. Where things apparently go wrong is somewhere between there and parsing out the key hash and then searching on that hash. This is all inside |hkp_search()| in |rc_openpgpjs.php|. I don't quite follow the regex parsing, or I'd be trying to commit a fix. :)

Well, you are getting the expected response for the URL you're supplying.

I'm guessing you want to parse out the portion following what is here pub 2048R/, which is <a href="/pks/lookup?op=get&search=0x154B8DE6FF53BF67">FF53BF67 . The relative URL in there contains what I think you're trying to get.


David Benfell see https://parts-unknown.org/node/2 if you don't understand the attachment -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCgAGBQJShcwrAAoJEKrN0Ha7pkCOMykP/2m73ymVQetZVmrRbLgTYJP1 3D+sjYnVUS3kIRIJaG0Buin3znaVZvQO2xW/2R09Szal5yURhTFehRr5JX/TjIxM cPhA1AO5NUWbQYggp8G3dzq3KyuX8uNWUjLMcqepaCEl5R8Q+fCIcztAlICh47NS l+zRIdCuEr9NBt/CndnPQkguYgj5fn+KOfXKADc5qG3W3sidvzGPACWH8dnzD+zs TpW02Bg8fMSh+HPi15XryeHifWOIUxuJHDzRdhxlA7i6oRS5baXJ9h9ZpDDW+kxj /gH15G212v8iUhnyyyCBariAqrG0o+5oFmRdvakJsUjvRdxYeokn64PDI4kRFt2q GSj9GYdvslrqqyAkjD0rI6IoM9mo7dxlPXmPq2QsHCU5siY7+j/7WoceZvtj0V75 6RYaxEu8o66UvoJg/u0Yj7HRF+1f/jc6tkL7tvIQr92Bxl4Eqys17qUlzxHpPyhq 7REedhj5WgwdhOUNVv2LbggbAKnk77QHy69rSJJlfADT2I5YRjP5Ad9xO13iB2f1 HgAos22VolBYEY90L3HmmDBIDXk5nzakM49Jj9txlD7eGf5GMqgZhRgcUSb4RszR 54PhkNj+B1wUklVbFdqw8n7j6p8nlYUcrbp9ZtgWymjF+zLxDhKFeoquPUsaUed0 G0jCh/xw+U3GUInPcOy4 =LZAs -----END PGP SIGNATURE-----

hennegwath commented 10 years ago

For me this is valid as well. I am not able to obtain any public keys from the search engine. Apache/php5 does not throw any error messages.

Does this have something to do with SSL? There is some hint in the description of function "hkp_search" in rc_openpgpjs.php.

jseidl commented 10 years ago

Fixed on https://github.com/jseidl/rc_openpgpjs/commit/f108cd434c2329dbac5652feb21e2638f427cf75

Pull request incoming =)

laclaro commented 10 years ago

Thank you! With those changes, key lookup works.

sporkman commented 10 years ago

I can confirm the pull above fixes the problem I reported. Thanks!

I assume I shouldn't "close" this until the jseidl's pull is accepted, correct?