1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-06 05:58:53 +01:00

RSA: the salt length isn't saved for new keys

This commit is contained in:
terrafrost 2021-01-16 09:59:45 -06:00
parent 3e32d5a853
commit c1b70c21cb
2 changed files with 2 additions and 2 deletions

View File

@ -512,7 +512,7 @@ class PrivateKey extends RSA implements Common\PrivateKey
$options+= [ $options+= [
'hash' => $this->hash->getHash(), 'hash' => $this->hash->getHash(),
'MGFHash' => $this->mgfHash->getHash(), 'MGFHash' => $this->mgfHash->getHash(),
'saltLength' => $this->sLen 'saltLength' => $this->getSaltLength()
]; ];
} else { } else {
throw new UnsupportedFormatException('The PSS format can only be used when the signature method has been explicitly set to PSS'); throw new UnsupportedFormatException('The PSS format can only be used when the signature method has been explicitly set to PSS');

View File

@ -475,7 +475,7 @@ class PublicKey extends RSA implements Common\PublicKey
$options+= [ $options+= [
'hash' => $this->hash->getHash(), 'hash' => $this->hash->getHash(),
'MGFHash' => $this->mgfHash->getHash(), 'MGFHash' => $this->mgfHash->getHash(),
'saltLength' => $this->sLen 'saltLength' => $this->getSaltLength()
]; ];
} else { } else {
throw new UnsupportedFormatException('The PSS format can only be used when the signature method has been explicitly set to PSS'); throw new UnsupportedFormatException('The PSS format can only be used when the signature method has been explicitly set to PSS');