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

Improvements to getJwtVerificationKeys #75

Merged
merged 3 commits into from
Jan 23, 2019
Merged

Conversation

mcetkovsky
Copy link

This PR improves getJwtVerificationKeys in two ways:

  • It uses chunk_split intead of wordwrap as chunk_split is made exactly for this purpose.
  • It returns public keys instead of whole certificates as openssl_verify is documented to expect keys (even it currently works with certificates as well).

Copy link
Member

@hajekj hajekj left a comment

Choose a reason for hiding this comment

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

I am quite unsure about the line endings... Can you please confirm that \r\n will also work on Linux distributions? I liked that you can PHP_EOL there before.

$key .= PHP_EOL . '-----END CERTIFICATE-----';
$keys[$keyinfo['kid']] = $key;
$cert =
"-----BEGIN CERTIFICATE-----\r\n"
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there be PHP_EOL instead? Same goes for line 251.

@mcetkovsky
Copy link
Author

PR updated to use PHP_EOL.

@mcetkovsky
Copy link
Author

I run it inside an official PHP docker image. I have not tested it on Windows yet.

@hajekj hajekj merged commit 1bd7890 into TheNetworg:master Jan 23, 2019
@hajekj
Copy link
Member

hajekj commented Jan 23, 2019

Merged, thanks for the PR.

@hajekj hajekj mentioned this pull request Jan 23, 2019
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