RSA_padding_check_PKCS1_type_2 is not constant time.
authorEmilia Kasper <emilia@openssl.org>
Tue, 18 Jul 2017 09:26:34 +0000 (11:26 +0200)
committerEmilia Kasper <emilia@openssl.org>
Tue, 18 Jul 2017 09:26:34 +0000 (11:26 +0200)
This is an inherent weakness of the padding mode. We can't make the
implementation constant time (see the comments in rsa_pk1.c), so add a
warning to the docs.

Reviewed-by: Rich Salz <rsalz@openssl.org>
doc/crypto/RSA_padding_add_PKCS1_type_1.pod
doc/crypto/RSA_public_encrypt.pod

index 30899440ad1c524f9a72995591ecb08ce77375c6..5b53eb9e959358f90149c4e98c03e2a81b2b75fa 100644 (file)
@@ -104,6 +104,13 @@ The RSA_padding_check_xxx() functions return the length of the
 recovered data, -1 on error. Error codes can be obtained by calling
 L<ERR_get_error(3)>.
 
+=head1 WARNING
+
+The RSA_padding_check_PKCS1_type_2() padding check leaks timing
+information which can potentially be used to mount a Bleichenbacher
+padding oracle attack. This is an inherent weakness in the PKCS #1
+v1.5 padding design. Prefer PKCS1_OAEP padding.
+
 =head1 SEE ALSO
 
 L<RSA_public_encrypt(3)>,
index 05eda9446f3cb88d9909c028ade0a009c215eb8c..b1dd50d752fc425c718cbc9599685ad377eed70c 100644 (file)
@@ -67,6 +67,13 @@ recovered plaintext.
 On error, -1 is returned; the error codes can be
 obtained by L<ERR_get_error(3)>.
 
+=head1 WARNING
+
+Decryption failures in the RSA_PKCS1_PADDING mode leak information
+which can potentially be used to mount a Bleichenbacher padding oracle
+attack. This is an inherent weakness in the PKCS #1 v1.5 padding
+design. Prefer RSA_PKCS1_OAEP_PADDING.
+
 =head1 CONFORMING TO
 
 SSL, PKCS #1 v2.0