Skip to content

Commit 8085da5

Browse files
committed
Deprecated old modules, and slated them for removal in 4.0
1 parent 31a8012 commit 8085da5

4 files changed

Lines changed: 22 additions & 9 deletions

File tree

CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Version 3.4 - in development
1010
- Deprecated the VARBLOCK format and rsa.bigfile module due to security issues, see
1111
https://github.com/sybrenstuvel/python-rsa/issues/13
1212
- Integration with Travis-CI [1] and Coveralls [2]
13+
- Deprecated the old rsa._version133 and rsa._version200 submodules, they will be
14+
completely removed in version 4.0.
1315
- Fixed bugs #12, #14, #27, #30
1416

1517
[1] https://travis-ci.org/sybrenstuvel/python-rsa

doc/upgrading.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Upgrading from older versions
33

44
Previous versions of Python-RSA were less secure than the current
55
version. In order to be able to gradually upgrade your software, those
6-
old versions are still available.
6+
old versions will be available until Python-RSA 4.0.
77

88
To use version 1.3.3, use this::
99

@@ -26,6 +26,12 @@ re-encrypt them::
2626
Those import statements *will create warnings* as they import much
2727
less secure code into your project.
2828

29+
.. warning::
30+
31+
These modules are included to allow upgrading to the latest version
32+
of Python-RSA, and not as a way to keep using those old versions.
33+
They will be removed in version 4.0.
34+
2935
The random padding introduced in version 3.0 made things much more
3036
secure, but also requires a larger key to encrypt the same message.
3137
You can either generate a new key with :py:func:`rsa.newkeys`, or use

rsa/_version133.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
"""RSA module
18-
pri = k[1] //Private part of keys d,p,q
17+
"""Deprecated version of the RSA module
18+
19+
.. deprecated:: 2.0
20+
21+
This submodule is deprecated and will be completely removed as of version 4.0.
1922
2023
Module for calculating large primes, and RSA encryption, decryption,
2124
signing and verification. Includes generating public and private keys.
@@ -53,6 +56,9 @@
5356
import warnings
5457
warnings.warn('Insecure version of the RSA module is imported as %s, be careful'
5558
% __name__)
59+
warnings.warn('This submodule is deprecated and will be completely removed as of version 4.0.',
60+
DeprecationWarning)
61+
5662

5763
def gcd(p, q):
5864
"""Returns the greatest common divisor of p and q

rsa/_version200.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
"""RSA module
17+
"""Deprecated version of the RSA module
1818
19-
Module for calculating large primes, and RSA encryption, decryption,
20-
signing and verification. Includes generating public and private keys.
19+
.. deprecated:: 3.0
2120
22-
WARNING: this implementation does not use random padding, compression of the
23-
cleartext input to prevent repetitions, or other common security improvements.
24-
Use with care.
21+
This submodule is deprecated and will be completely removed as of version 4.0.
2522
2623
"""
2724

@@ -39,6 +36,8 @@
3936
# Display a warning that this insecure version is imported.
4037
import warnings
4138
warnings.warn('Insecure version of the RSA module is imported as %s' % __name__)
39+
warnings.warn('This submodule is deprecated and will be completely removed as of version 4.0.',
40+
DeprecationWarning)
4241

4342

4443
def bit_size(number):

0 commit comments

Comments
 (0)