Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/Horde/Crypt/Pgp/Keyserver.php: Newer keyserver implementations UR… #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunweaver
Copy link
Contributor

…L-encode the body returned by index lookups.

To handle this gracefully, we first check whether the returned body is
URL-encoded and if so, urldecode() it.

…L-encode the body returned by index lookups.

 To handle this gracefully, we first check whether the returned body is
 URL-encoded and if so, urldecode() it.
$output = urldecode($body);
} else {
$output = $body;
}
Copy link
Contributor Author

@sunweaver sunweaver Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that this should work in theory, but fails sometimes in reality.

I have reverted this on my running instance back to

-                $output = $response->getBody();
+                $body = $response->getBody();
+                $output = urldecode($body);

And I only use a keyserver that returns results urlencoded.

@yunosh
Copy link
Member

yunosh commented Nov 17, 2022

Weird. And these servers still send the response as text/plain? Do they differ in any other HTTP response headers from those that don't urlencode the body?

@sunweaver
Copy link
Contributor Author

I use https://keys.openpgp.org/, feel free to test it with that. Unfortunately, I haven't tested this any further. I simply saw that the body came in urlencoded, so I added the urldecode() call and tadaaa... the key retrieval worked again (together with the 16-digit PR #6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants