Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce deprecation warnings from cryptography module #445

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 28, 2023

  1. Avoid spurious CryptographyDeprecationWarning

    If someone actually wants to use IDEA, CAST5, or Blowfish, we want to
    see the CryptographyDeprecationWarning objects emitted by
    cryptography.hazmat.primitives.ciphers.  But if we're just looking up
    a non-deprecated cipher we should just return it directly.
    
    This avoids the following kinds of warnings:
    
    pgpy/pgpy/constants.py:191: CryptographyDeprecationWarning: IDEA has been deprecated
      bs = {SymmetricKeyAlgorithm.IDEA: algorithms.IDEA,
    pgpy/pgpy/constants.py:193: CryptographyDeprecationWarning: CAST5 has been deprecated
      SymmetricKeyAlgorithm.CAST5: algorithms.CAST5,
    pgpy/pgpy/constants.py:194: CryptographyDeprecationWarning: Blowfish has been deprecated
      SymmetricKeyAlgorithm.Blowfish: algorithms.Blowfish,
    dkg committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    ba04c11 View commit details
    Browse the repository at this point in the history
  2. Fix test: ensure that deprecation warnings don't interfere with test …

    …suite
    
    Once CAST5 is deprecated, a deprecation warning might arise in
    addition to the warnings about already-protected secret keys might not
    be the first warning.
    
    Instead, we have the test look through the warnings and validate the
    content of any matching warning.
    dkg committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    fb885e6 View commit details
    Browse the repository at this point in the history