Skip to content

Commit

Permalink
bug #833 KeyLoaderInterface::getPassphrase() might return null and we…
Browse files Browse the repository at this point in the history
… need a string. (drupol)

This PR was merged into the 2.x branch.

Discussion
----------

KeyLoaderInterface::getPassphrase() might return null and we need a string.

Commits
-------

6eeeabb KeyLoaderInterface::getPassphrase() might return null and we need a string here.
  • Loading branch information
chalasr committed Feb 9, 2021
2 parents 966f9b0 + 6eeeabb commit 060c58a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Services/JWSProvider/LcobucciJWSProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ private function getSignerForAlgorithm($signatureAlgorithm)
private function getSignedToken(Builder $jws)
{
if (class_exists(InMemory::class)) {
$key = InMemory::plainText($this->keyLoader->loadKey(RawKeyLoader::TYPE_PRIVATE), $this->signer instanceof Hmac ? '' : $this->keyLoader->getPassphrase());
$key = InMemory::plainText($this->keyLoader->loadKey(RawKeyLoader::TYPE_PRIVATE), $this->signer instanceof Hmac ? '' : (string) $this->keyLoader->getPassphrase());
} else {
$key = new Key($this->keyLoader->loadKey(RawKeyLoader::TYPE_PRIVATE), $this->signer instanceof Hmac ? '' : $this->keyLoader->getPassphrase());
$key = new Key($this->keyLoader->loadKey(RawKeyLoader::TYPE_PRIVATE), $this->signer instanceof Hmac ? '' : (string) $this->keyLoader->getPassphrase());
}

$token = $jws->getToken($this->signer, $key);
Expand Down

0 comments on commit 060c58a

Please sign in to comment.