mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 04:05:15 +00:00
RSA: fix issue with PKCS1 encryption
This commit is contained in:
parent
a431a1959a
commit
88b6337a3f
@ -451,7 +451,8 @@ class PublicKey extends RSA implements Common\PublicKey
|
|||||||
return $this->raw_encrypt($plaintext);
|
return $this->raw_encrypt($plaintext);
|
||||||
case self::ENCRYPTION_PKCS15_COMPAT:
|
case self::ENCRYPTION_PKCS15_COMPAT:
|
||||||
case self::ENCRYPTION_PKCS1:
|
case self::ENCRYPTION_PKCS1:
|
||||||
return $this->rsaes_pkcs1_v1_5_encrypt($plaintext, $padding == self::ENCRYPTION_PKCS15_COMPAT);
|
$pkcs15_compat = $this->encryptionPadding & self::ENCRYPTION_PKCS15_COMPAT;
|
||||||
|
return $this->rsaes_pkcs1_v1_5_encrypt($plaintext, $pkcs15_compat);
|
||||||
//case self::ENCRYPTION_OAEP:
|
//case self::ENCRYPTION_OAEP:
|
||||||
default:
|
default:
|
||||||
return $this->rsaes_oaep_encrypt($plaintext);
|
return $this->rsaes_oaep_encrypt($plaintext);
|
||||||
|
Loading…
Reference in New Issue
Block a user