Skip to content

Commit fd5eaa6

Browse files
committed
Call out insecure PKCS #1 v1.5 default padding for RSA
1 parent 173be66 commit fd5eaa6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/openssl/pkey.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ def new(*args, &blk) # :nodoc:
363363
# rsa.private_encrypt(string, padding) -> String
364364
#
365365
# Encrypt +string+ with the private key. +padding+ defaults to
366-
# PKCS1_PADDING. The encrypted string output can be decrypted using
366+
# PKCS1_PADDING, which is known to be insecure but is kept for backwards
367+
# compatibility. The encrypted string output can be decrypted using
367368
# #public_decrypt.
368369
#
369370
# <b>Deprecated in version 3.0</b>.
@@ -386,7 +387,8 @@ def private_encrypt(string, padding = PKCS1_PADDING)
386387
# rsa.public_decrypt(string, padding) -> String
387388
#
388389
# Decrypt +string+, which has been encrypted with the private key, with the
389-
# public key. +padding+ defaults to PKCS1_PADDING.
390+
# public key. +padding+ defaults to PKCS1_PADDING which is known to be
391+
# insecure but is kept for backwards compatibility.
390392
#
391393
# <b>Deprecated in version 3.0</b>.
392394
# Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw, and
@@ -407,7 +409,8 @@ def public_decrypt(string, padding = PKCS1_PADDING)
407409
# rsa.public_encrypt(string, padding) -> String
408410
#
409411
# Encrypt +string+ with the public key. +padding+ defaults to
410-
# PKCS1_PADDING. The encrypted string output can be decrypted using
412+
# PKCS1_PADDING, which is known to be insecure but is kept for backwards
413+
# compatibility. The encrypted string output can be decrypted using
411414
# #private_decrypt.
412415
#
413416
# <b>Deprecated in version 3.0</b>.
@@ -428,7 +431,8 @@ def public_encrypt(data, padding = PKCS1_PADDING)
428431
# rsa.private_decrypt(string, padding) -> String
429432
#
430433
# Decrypt +string+, which has been encrypted with the public key, with the
431-
# private key. +padding+ defaults to PKCS1_PADDING.
434+
# private key. +padding+ defaults to PKCS1_PADDING, which is known to be
435+
# insecure but is kept for backwards compatibility.
432436
#
433437
# <b>Deprecated in version 3.0</b>.
434438
# Consider using PKey::PKey#encrypt and PKey::PKey#decrypt instead.

0 commit comments

Comments
 (0)