oscrypto
oscrypto copied to clipboard
v1.3.0 - TLSSocket.__init__() raises OverflowError on macOS 14.7 on ARM 64
First of all, thanks a lot for oscrypto! Unfortunately, it does not seem to work under macOS 14.7 on Apple Silicon.
System
$ uname -mor
Darwin 23.6.0 arm64
$ python3 --version
Python 3.9.6
MWE
$ python3 -mvenv foo
$ . foo/bin/activate
$ pip install -U pip
Requirement already satisfied: pip in ./foo/lib/python3.9/site-packages (21.2.4)
Collecting pip
Using cached pip-24.3.1-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.2.4
Uninstalling pip-21.2.4:
Successfully uninstalled pip-21.2.4
Successfully installed pip-24.3.1
$ pip install oscrypto
Collecting oscrypto
Using cached oscrypto-1.3.0-py2.py3-none-any.whl.metadata (15 kB)
Collecting asn1crypto>=1.5.1 (from oscrypto)
Using cached asn1crypto-1.5.1-py2.py3-none-any.whl.metadata (13 kB)
Using cached oscrypto-1.3.0-py2.py3-none-any.whl (194 kB)
Using cached asn1crypto-1.5.1-py2.py3-none-any.whl (105 kB)
Installing collected packages: asn1crypto, oscrypto
Successfully installed asn1crypto-1.5.1 oscrypto-1.3.0
$ python3
Python 3.9.6 (default, Feb 3 2024, 15:58:27)
[Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from oscrypto.tls import TLSSocket
>>> TLSSocket('www.debian.org', 443)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/odin/repos/sievemgr/foo/lib/python3.9/site-packages/oscrypto/_mac/tls.py", line 532, in __init__
self._handshake()
File "/Users/odin/repos/sievemgr/foo/lib/python3.9/site-packages/oscrypto/_mac/tls.py", line 654, in _handshake
cipher_suite = int_to_bytes(supported_cipher_suite, width=2)
File "/Users/odin/repos/sievemgr/foo/lib/python3.9/site-packages/asn1crypto/util.py", line 243, in int_to_bytes
return value.to_bytes(width, byteorder='big', signed=signed)
OverflowError: int too big to convert
I can reproduce the issue with Python 3.13 installed via Homebrew.