Skip to content

Commit 45a34df

Browse files
committed
Call out insecure PKCS ruby#1 v1.5 default padding for RSA
1 parent de8a644 commit 45a34df

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

ext/openssl/ossl_pkey_rsa.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,9 @@ ossl_rsa_to_der(VALUE self)
417417
* rsa.public_encrypt(string) => String
418418
* rsa.public_encrypt(string, padding) => String
419419
*
420-
* Encrypt _string_ with the public key. _padding_ defaults to PKCS1_PADDING.
421-
* The encrypted string output can be decrypted using #private_decrypt.
420+
* Encrypt _string_ with the public key. _padding_ defaults to PKCS1_PADDING,
421+
* which is known to be insecure but is kept for backwards compatibility. The
422+
* encrypted string output can be decrypted using #private_decrypt.
422423
*/
423424
static VALUE
424425
ossl_rsa_public_encrypt(int argc, VALUE *argv, VALUE self)
@@ -450,7 +451,8 @@ ossl_rsa_public_encrypt(int argc, VALUE *argv, VALUE self)
450451
* rsa.public_decrypt(string, padding) => String
451452
*
452453
* Decrypt _string_, which has been encrypted with the private key, with the
453-
* public key. _padding_ defaults to PKCS1_PADDING.
454+
* public key. _padding_ defaults to PKCS1_PADDING, which is known to be
455+
* insecure but is kept for backwards compatibility.
454456
*/
455457
static VALUE
456458
ossl_rsa_public_decrypt(int argc, VALUE *argv, VALUE self)
@@ -481,8 +483,9 @@ ossl_rsa_public_decrypt(int argc, VALUE *argv, VALUE self)
481483
* rsa.private_encrypt(string) => String
482484
* rsa.private_encrypt(string, padding) => String
483485
*
484-
* Encrypt _string_ with the private key. _padding_ defaults to PKCS1_PADDING.
485-
* The encrypted string output can be decrypted using #public_decrypt.
486+
* Encrypt _string_ with the private key. _padding_ defaults to PKCS1_PADDING,
487+
* which is known to be insecure but is kept for backwards compatibility. The
488+
* encrypted string output can be decrypted using #public_decrypt.
486489
*/
487490
static VALUE
488491
ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self)
@@ -516,7 +519,8 @@ ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self)
516519
* rsa.private_decrypt(string, padding) => String
517520
*
518521
* Decrypt _string_, which has been encrypted with the public key, with the
519-
* private key. _padding_ defaults to PKCS1_PADDING.
522+
* private key. _padding_ defaults to PKCS1_PADDING, which is known to be
523+
* insecure but is kept for backwards compatibility.
520524
*/
521525
static VALUE
522526
ossl_rsa_private_decrypt(int argc, VALUE *argv, VALUE self)

0 commit comments

Comments
 (0)