Skip to content

Commit

Permalink
chore: improve deprecation messages
Browse files Browse the repository at this point in the history
There has been confusion regarding the current deprecation messages as
some are reading them as the algorithms will be removed from the
cryptography library. When in reality they are just being removed from
the module. Make it more explicit about it being removed.

An example of the confusion:
paramiko/paramiko#2421 (comment)
  • Loading branch information
JohnVillalovos committed Aug 8, 2024
1 parent b20e83e commit 75ab9e0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/cryptography/hazmat/primitives/ciphers/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def key_size(self) -> int:
__name__,
"ARC4 has been moved to "
"cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and "
"will be removed from this module in 48.0.0.",
"will be removed from "
"cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.",
utils.DeprecatedIn43,
name="ARC4",
)
Expand All @@ -93,7 +94,8 @@ def key_size(self) -> int:
__name__,
"TripleDES has been moved to "
"cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and "
"will be removed from this module in 48.0.0.",
"will be removed from "
"cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.",
utils.DeprecatedIn43,
name="TripleDES",
)
Expand All @@ -103,7 +105,8 @@ def key_size(self) -> int:
__name__,
"Blowfish has been moved to "
"cryptography.hazmat.decrepit.ciphers.algorithms.Blowfish and "
"will be removed from this module in 45.0.0.",
"will be removed from "
"cryptography.hazmat.primitives.ciphers.algorithms in 45.0.0.",
utils.DeprecatedIn37,
name="Blowfish",
)
Expand All @@ -114,7 +117,8 @@ def key_size(self) -> int:
__name__,
"CAST5 has been moved to "
"cryptography.hazmat.decrepit.ciphers.algorithms.CAST5 and "
"will be removed from this module in 45.0.0.",
"will be removed from "
"cryptography.hazmat.primitives.ciphers.algorithms in 45.0.0.",
utils.DeprecatedIn37,
name="CAST5",
)
Expand All @@ -125,7 +129,8 @@ def key_size(self) -> int:
__name__,
"IDEA has been moved to "
"cryptography.hazmat.decrepit.ciphers.algorithms.IDEA and "
"will be removed from this module in 45.0.0.",
"will be removed from "
"cryptography.hazmat.primitives.ciphers.algorithms in 45.0.0.",
utils.DeprecatedIn37,
name="IDEA",
)
Expand All @@ -136,7 +141,8 @@ def key_size(self) -> int:
__name__,
"SEED has been moved to "
"cryptography.hazmat.decrepit.ciphers.algorithms.SEED and "
"will be removed from this module in 45.0.0.",
"will be removed from "
"cryptography.hazmat.primitives.ciphers.algorithms in 45.0.0.",
utils.DeprecatedIn37,
name="SEED",
)
Expand Down

0 comments on commit 75ab9e0

Please sign in to comment.