Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ private static function verify($msg, $signature, $key, $alg)
switch($function) {
case 'openssl':
$success = openssl_verify($msg, $signature, $key, $algorithm);
if (!$success) {
throw new DomainException("OpenSSL unable to verify data: " . openssl_error_string());
if(in_array($success, array(0, 1))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would love to see this in a switch statement. Also, I would love to see tests.

return $success === 1;
} else {
return $signature;
throw new DomainException("OpenSSL unable to verify data: " . openssl_error_string());
}
case 'hash_hmac':
default:
Expand Down