Compare commits

...

2 Commits

Author SHA1 Message Date
347fbb1d73 fixed cures for current cryptography
Some checks failed
Tox Tests / unit-tests (macos-10.15, 3.10) (push) Has been cancelled
Tox Tests / unit-tests (macos-10.15, 3.6) (push) Has been cancelled
Tox Tests / unit-tests (macos-10.15, 3.7) (push) Has been cancelled
Tox Tests / unit-tests (macos-10.15, 3.8) (push) Has been cancelled
Tox Tests / unit-tests (macos-10.15, 3.9) (push) Has been cancelled
Tox Tests / unit-tests (ubuntu-18.04, 3.10) (push) Has been cancelled
Tox Tests / unit-tests (ubuntu-18.04, 3.6) (push) Has been cancelled
Tox Tests / unit-tests (ubuntu-18.04, 3.7) (push) Has been cancelled
Tox Tests / unit-tests (ubuntu-18.04, 3.8) (push) Has been cancelled
Tox Tests / unit-tests (ubuntu-18.04, 3.9) (push) Has been cancelled
Tox Tests / c-locale-test (push) Has been cancelled
Tox Tests / test-setup (py310-setup, 3.10) (push) Has been cancelled
Tox Tests / test-setup (py36-setup, 3.6) (push) Has been cancelled
Tox Tests / test-setup (py37-setup, 3.7) (push) Has been cancelled
Tox Tests / test-setup (py38-setup, 3.8) (push) Has been cancelled
Tox Tests / test-setup (py39-setup, 3.9) (push) Has been cancelled
Tox Tests / pep8 (push) Has been cancelled
Tox Tests / finish-coveralls (push) Has been cancelled
2026-02-07 10:56:19 +03:00
f76636b9f8 removed imghdr dependency 2026-02-07 10:54:35 +03:00
2 changed files with 6 additions and 3 deletions

View File

@@ -47,30 +47,35 @@ if use_legacy_cryptography_decorator():
class BrainpoolP256R1(object):
name = 'brainpoolP256r1'
key_size = 256
group_order = 0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7
@utils.register_interface(ec.EllipticCurve) # noqa: E303
class BrainpoolP384R1(object):
name = 'brainpoolP384r1'
key_size = 384
group_order = 0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565
@utils.register_interface(ec.EllipticCurve) # noqa: E303
class BrainpoolP512R1(object):
name = 'brainpoolP512r1'
key_size = 512
group_order = 0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069
@utils.register_interface(ec.EllipticCurve) # noqa: E303
class X25519(object):
name = 'X25519'
key_size = 256
group_order = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed
@utils.register_interface(ec.EllipticCurve) # noqa: E303
class Ed25519(object):
name = 'ed25519'
key_size = 256
group_order = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed
else:
class BrainpoolP256R1(ec.EllipticCurve):
name = 'brainpoolP256r1'

View File

@@ -2,7 +2,6 @@
"""
import bz2
import hashlib
import imghdr
import os
import zlib
import warnings
@@ -429,8 +428,7 @@ class ImageEncoding(IntEnum):
@classmethod
def encodingof(cls, imagebytes):
type = imghdr.what(None, h=imagebytes)
if type == 'jpeg':
if imagebytes[6:10] in (b'JFIF', b'Exif') or imagebytes[:4] == b'\xff\xd8\xff\xdb':
return ImageEncoding.JPEG
return ImageEncoding.Unknown # pragma: no cover