Skip to content

Commit

Permalink
Fixes for ruff in preview mode (#10912)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Apr 30, 2024
1 parent d796f44 commit 302372b
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/cryptography/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from __future__ import annotations

__all__ = [
"__version__",
"__author__",
"__copyright__",
"__version__",
]

__version__ = "43.0.0.dev1"
Expand Down
2 changes: 1 addition & 1 deletion src/cryptography/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from cryptography.__about__ import __author__, __copyright__, __version__

__all__ = [
"__version__",
"__author__",
"__copyright__",
"__version__",
]
12 changes: 6 additions & 6 deletions src/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ from cryptography.hazmat.bindings._rust.openssl import (
)

__all__ = [
"openssl_version",
"openssl_version_text",
"raise_openssl_error",
"aead",
"ciphers",
"cmac",
"dh",
"dsa",
"ec",
"ed448",
"ed25519",
"hashes",
"hmac",
"kdf",
"keys",
"ed448",
"ed25519",
"rsa",
"openssl_version",
"openssl_version_text",
"poly1305",
"raise_openssl_error",
"rsa",
"x448",
"x25519",
]
Expand Down
8 changes: 4 additions & 4 deletions src/cryptography/hazmat/primitives/ciphers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
)

__all__ = [
"Cipher",
"CipherAlgorithm",
"BlockCipherAlgorithm",
"CipherContext",
"AEADCipherContext",
"AEADDecryptionContext",
"AEADEncryptionContext",
"BlockCipherAlgorithm",
"Cipher",
"CipherAlgorithm",
"CipherContext",
]
2 changes: 1 addition & 1 deletion src/cryptography/hazmat/primitives/ciphers/aead.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from cryptography.hazmat.bindings._rust import openssl as rust_openssl

__all__ = [
"ChaCha20Poly1305",
"AESCCM",
"AESGCM",
"AESGCMSIV",
"AESOCB3",
"AESSIV",
"ChaCha20Poly1305",
]

AESGCM = rust_openssl.aead.AESGCM
Expand Down
24 changes: 12 additions & 12 deletions src/cryptography/hazmat/primitives/hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
from cryptography.hazmat.bindings._rust import openssl as rust_openssl

__all__ = [
"HashAlgorithm",
"HashContext",
"Hash",
"ExtendableOutputFunction",
"MD5",
"SHA1",
"SHA512_224",
"SHA512_256",
"SHA224",
"SHA256",
"SHA384",
"SHA512",
"SHA3_224",
"SHA3_256",
"SHA3_384",
"SHA3_512",
"SHA224",
"SHA256",
"SHA384",
"SHA512",
"SHA512_224",
"SHA512_256",
"SHAKE128",
"SHAKE256",
"MD5",
"SM3",
"BLAKE2b",
"BLAKE2s",
"SM3",
"ExtendableOutputFunction",
"Hash",
"HashAlgorithm",
"HashContext",
]


Expand Down
30 changes: 15 additions & 15 deletions src/cryptography/hazmat/primitives/serialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@
)

__all__ = [
"BestAvailableEncryption",
"Encoding",
"KeySerializationEncryption",
"NoEncryption",
"ParameterFormat",
"PrivateFormat",
"PublicFormat",
"SSHCertPrivateKeyTypes",
"SSHCertPublicKeyTypes",
"SSHCertificate",
"SSHCertificateBuilder",
"SSHCertificateType",
"SSHPrivateKeyTypes",
"SSHPublicKeyTypes",
"_KeySerializationEncryption",
"load_der_parameters",
"load_der_private_key",
"load_der_public_key",
Expand All @@ -45,19 +60,4 @@
"load_ssh_private_key",
"load_ssh_public_identity",
"load_ssh_public_key",
"Encoding",
"PrivateFormat",
"PublicFormat",
"ParameterFormat",
"KeySerializationEncryption",
"BestAvailableEncryption",
"NoEncryption",
"_KeySerializationEncryption",
"SSHCertificateBuilder",
"SSHCertificate",
"SSHCertificateType",
"SSHCertPublicKeyTypes",
"SSHCertPrivateKeyTypes",
"SSHPrivateKeyTypes",
"SSHPublicKeyTypes",
]
2 changes: 1 addition & 1 deletion src/cryptography/hazmat/primitives/serialization/pkcs12.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

__all__ = [
"PBES",
"PKCS12PrivateKeyTypes",
"PKCS12Certificate",
"PKCS12KeyAndCertificates",
"PKCS12PrivateKeyTypes",
"load_key_and_certificates",
"load_pkcs12",
"serialize_key_and_certificates",
Expand Down
4 changes: 2 additions & 2 deletions src/cryptography/hazmat/primitives/serialization/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def load_public(
) -> tuple[ed25519.Ed25519PublicKey, memoryview]:
"""Make Ed25519 public key from data."""
public_key, data = _lookup_kformat(_SSH_ED25519).load_public(data)
application, data = load_application(data)
_, data = load_application(data)
return public_key, data


Expand All @@ -622,7 +622,7 @@ def load_public(
) -> tuple[ec.EllipticCurvePublicKey, memoryview]:
"""Make Ed25519 public key from data."""
public_key, data = _lookup_kformat(_ECDSA_NISTP256).load_public(data)
application, data = load_application(data)
_, data = load_application(data)
return public_key, data


Expand Down
134 changes: 67 additions & 67 deletions src/cryptography/x509/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,89 +171,89 @@
OID_OCSP = AuthorityInformationAccessOID.OCSP

__all__ = [
"certificate_transparency",
"verification",
"load_pem_x509_certificate",
"load_pem_x509_certificates",
"load_der_x509_certificate",
"load_pem_x509_csr",
"load_der_x509_csr",
"load_pem_x509_crl",
"load_der_x509_crl",
"random_serial_number",
"verification",
"OID_CA_ISSUERS",
"OID_OCSP",
"AccessDescription",
"Attribute",
"AttributeNotFound",
"Attributes",
"InvalidVersion",
"AuthorityInformationAccess",
"AuthorityKeyIdentifier",
"BasicConstraints",
"CRLDistributionPoints",
"CRLNumber",
"CRLReason",
"Certificate",
"CertificateBuilder",
"CertificateIssuer",
"CertificatePolicies",
"CertificateRevocationList",
"CertificateRevocationListBuilder",
"CertificateSigningRequest",
"CertificateSigningRequestBuilder",
"DNSName",
"DeltaCRLIndicator",
"DirectoryName",
"DistributionPoint",
"DuplicateExtension",
"ExtendedKeyUsage",
"Extension",
"ExtensionNotFound",
"UnsupportedGeneralNameType",
"NameAttribute",
"Name",
"RelativeDistinguishedName",
"ObjectIdentifier",
"ExtensionType",
"Extensions",
"Extension",
"ExtendedKeyUsage",
"FreshestCRL",
"GeneralName",
"GeneralNames",
"IPAddress",
"InhibitAnyPolicy",
"InvalidVersion",
"InvalidityDate",
"IssuerAlternativeName",
"IssuingDistributionPoint",
"TLSFeature",
"TLSFeatureType",
"KeyUsage",
"MSCertificateTemplate",
"Name",
"NameAttribute",
"NameConstraints",
"NameOID",
"NoticeReference",
"OCSPAcceptableResponses",
"OCSPNoCheck",
"BasicConstraints",
"CRLNumber",
"KeyUsage",
"AuthorityInformationAccess",
"SubjectInformationAccess",
"AccessDescription",
"CertificatePolicies",
"OCSPNonce",
"ObjectIdentifier",
"OtherName",
"PolicyConstraints",
"PolicyInformation",
"UserNotice",
"NoticeReference",
"SubjectKeyIdentifier",
"NameConstraints",
"CRLDistributionPoints",
"DistributionPoint",
"ReasonFlags",
"InhibitAnyPolicy",
"SubjectAlternativeName",
"IssuerAlternativeName",
"AuthorityKeyIdentifier",
"GeneralNames",
"GeneralName",
"PrecertPoison",
"PrecertificateSignedCertificateTimestamps",
"PublicKeyAlgorithmOID",
"RFC822Name",
"DNSName",
"UniformResourceIdentifier",
"ReasonFlags",
"RegisteredID",
"DirectoryName",
"IPAddress",
"OtherName",
"Certificate",
"CertificateRevocationList",
"CertificateRevocationListBuilder",
"CertificateSigningRequest",
"RelativeDistinguishedName",
"RevokedCertificate",
"RevokedCertificateBuilder",
"CertificateSigningRequestBuilder",
"CertificateBuilder",
"Version",
"OID_CA_ISSUERS",
"OID_OCSP",
"CertificateIssuer",
"CRLReason",
"InvalidityDate",
"UnrecognizedExtension",
"PolicyConstraints",
"PrecertificateSignedCertificateTimestamps",
"PrecertPoison",
"OCSPNonce",
"PublicKeyAlgorithmOID",
"SignedCertificateTimestamps",
"SignatureAlgorithmOID",
"NameOID",
"MSCertificateTemplate",
"SignedCertificateTimestamps",
"SubjectAlternativeName",
"SubjectInformationAccess",
"SubjectKeyIdentifier",
"TLSFeature",
"TLSFeatureType",
"UniformResourceIdentifier",
"UnrecognizedExtension",
"UnsupportedGeneralNameType",
"UserNotice",
"Version",
"certificate_transparency",
"load_der_x509_certificate",
"load_der_x509_crl",
"load_der_x509_csr",
"load_pem_x509_certificate",
"load_pem_x509_certificates",
"load_pem_x509_crl",
"load_pem_x509_csr",
"random_serial_number",
"verification",
"verification",
]
8 changes: 4 additions & 4 deletions src/cryptography/x509/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from cryptography.x509.general_name import DNSName, IPAddress

__all__ = [
"Store",
"Subject",
"VerifiedClient",
"ClientVerifier",
"ServerVerifier",
"PolicyBuilder",
"ServerVerifier",
"Store",
"Subject",
"VerificationError",
"VerifiedClient",
]

Store = rust_x509.Store
Expand Down

0 comments on commit 302372b

Please sign in to comment.