Skip to content

Fix deprecation cryptography deprecation warning in tests #94

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

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

WFT
Copy link
Contributor

@WFT WFT commented Jun 6, 2024

This use of the cryptography package generates a warning, seen below.

/Users/Will/dev/forks/app-store-server-library-python/tests/util.py:22: CryptographyDeprecationWarning: Curve argument must be an instance of an EllipticCurve class. Did you pass a class by mistake? This will be an exception in a future version of cryptography.
  public_key = ec.generate_private_key(ec.SECP256R1).public_key().public_bytes(encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo).decode()

I noticed this while preparing #93 & thought I'd toss this up as well. It passes the tests on my local machine, now without this warning.

This use of the cryptography package generates a warning, seen below.

```
/Users/Will/dev/forks/app-store-server-library-python/tests/util.py:22: CryptographyDeprecationWarning: Curve argument must be an instance of an EllipticCurve class. Did you pass a class by mistake? This will be an exception in a future version of cryptography.
  public_key = ec.generate_private_key(ec.SECP256R1).public_key().public_bytes(encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo).decode()
```

I noticed this while preparing apple#93 & thought I'd toss this up as well. It passes the tests on my local machine, now without this warning.
Copy link
Collaborator

@alexanderjordanbaker alexanderjordanbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@alexanderjordanbaker alexanderjordanbaker merged commit 4234c96 into apple:main Jun 9, 2024
5 checks passed
@WFT WFT deleted the fix-crypto-deprecation branch June 10, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants