@pairling/runtime-darwin-x64 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +1 -1
  2. package/bin/pairling-connectd +0 -0
  3. package/manifest.json +4 -4
  4. package/package.json +3 -3
  5. package/python/bin/python3 +0 -0
  6. package/python/bin/python3.12 +0 -0
  7. package/python/lib/libpython3.12.dylib +0 -0
  8. package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
  9. package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
  10. package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
  11. package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
  12. package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
  13. package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
  14. package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
  15. package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
  16. package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
  17. package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
  18. package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
  19. package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
  20. package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
  21. package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
  22. package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
  23. package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
  24. package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
  25. package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
  26. package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
  27. package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
  28. package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
  29. package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +216 -0
  30. package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1084 -0
  31. package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
  32. package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
  33. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/INSTALLER +1 -0
  34. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/LICENSE +26 -0
  35. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/METADATA +40 -0
  36. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD +30 -0
  37. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/WHEEL +5 -0
  38. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/entry_points.txt +2 -0
  39. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/top_level.txt +2 -0
  40. package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
  41. package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
  42. package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
  43. package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
  44. package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
  45. package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
  46. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
  47. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
  48. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
  49. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
  50. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
  51. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
  52. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
  53. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
  54. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
  55. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
  56. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
  57. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
  58. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
  59. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
  60. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
  61. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
  62. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
  63. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
  64. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
  65. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
  66. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
  67. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
  68. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
  69. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
  70. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
  71. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
  72. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
  73. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
  74. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
  75. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
  76. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
  77. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
  78. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
  79. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
  80. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
  81. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
  82. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
  83. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
  84. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
  85. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
  86. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
  87. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
  88. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
  89. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
  90. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
  91. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
  92. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
  93. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
  94. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
  95. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
  96. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
  97. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
  98. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
  99. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
  100. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
  101. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
  102. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
  103. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
  104. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
  105. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
  106. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
  107. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
  108. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
  109. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
  110. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
  111. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
  112. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
  113. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
  114. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
  115. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
  116. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
  117. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
  118. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
  119. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
  120. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
  121. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
  122. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
  123. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
  124. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
  125. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
  126. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
  127. package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
  128. package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
  129. package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
  130. package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
  131. package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
  132. package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
  133. package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
  134. package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
  135. package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
  136. package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
  137. package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
  138. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
  139. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
  140. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
  141. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
  142. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
  143. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
  144. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
  145. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
  146. package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
  147. package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
  148. package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
  149. package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
  150. package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
  151. package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
  152. package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
  153. package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
  154. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
  155. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
  156. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
  157. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
  158. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
  159. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,306 @@
1
+ #
2
+ # DEPRECATED: implementation for ffi.verify()
3
+ #
4
+ import sys, os, binascii, shutil, io
5
+ from . import __version_verifier_modules__
6
+ from . import ffiplatform
7
+ from .error import VerificationError
8
+
9
+ if sys.version_info >= (3, 3):
10
+ import importlib.machinery
11
+ def _extension_suffixes():
12
+ return importlib.machinery.EXTENSION_SUFFIXES[:]
13
+ else:
14
+ import imp
15
+ def _extension_suffixes():
16
+ return [suffix for suffix, _, type in imp.get_suffixes()
17
+ if type == imp.C_EXTENSION]
18
+
19
+
20
+ if sys.version_info >= (3,):
21
+ NativeIO = io.StringIO
22
+ else:
23
+ class NativeIO(io.BytesIO):
24
+ def write(self, s):
25
+ if isinstance(s, unicode):
26
+ s = s.encode('ascii')
27
+ super(NativeIO, self).write(s)
28
+
29
+
30
+ class Verifier(object):
31
+
32
+ def __init__(self, ffi, preamble, tmpdir=None, modulename=None,
33
+ ext_package=None, tag='', force_generic_engine=False,
34
+ source_extension='.c', flags=None, relative_to=None, **kwds):
35
+ if ffi._parser._uses_new_feature:
36
+ raise VerificationError(
37
+ "feature not supported with ffi.verify(), but only "
38
+ "with ffi.set_source(): %s" % (ffi._parser._uses_new_feature,))
39
+ self.ffi = ffi
40
+ self.preamble = preamble
41
+ if not modulename:
42
+ flattened_kwds = ffiplatform.flatten(kwds)
43
+ vengine_class = _locate_engine_class(ffi, force_generic_engine)
44
+ self._vengine = vengine_class(self)
45
+ self._vengine.patch_extension_kwds(kwds)
46
+ self.flags = flags
47
+ self.kwds = self.make_relative_to(kwds, relative_to)
48
+ #
49
+ if modulename:
50
+ if tag:
51
+ raise TypeError("can't specify both 'modulename' and 'tag'")
52
+ else:
53
+ key = '\x00'.join(['%d.%d' % sys.version_info[:2],
54
+ __version_verifier_modules__,
55
+ preamble, flattened_kwds] +
56
+ ffi._cdefsources)
57
+ if sys.version_info >= (3,):
58
+ key = key.encode('utf-8')
59
+ k1 = hex(binascii.crc32(key[0::2]) & 0xffffffff)
60
+ k1 = k1.lstrip('0x').rstrip('L')
61
+ k2 = hex(binascii.crc32(key[1::2]) & 0xffffffff)
62
+ k2 = k2.lstrip('0').rstrip('L')
63
+ modulename = '_cffi_%s_%s%s%s' % (tag, self._vengine._class_key,
64
+ k1, k2)
65
+ suffix = _get_so_suffixes()[0]
66
+ self.tmpdir = tmpdir or _caller_dir_pycache()
67
+ self.sourcefilename = os.path.join(self.tmpdir, modulename + source_extension)
68
+ self.modulefilename = os.path.join(self.tmpdir, modulename + suffix)
69
+ self.ext_package = ext_package
70
+ self._has_source = False
71
+ self._has_module = False
72
+
73
+ def write_source(self, file=None):
74
+ """Write the C source code. It is produced in 'self.sourcefilename',
75
+ which can be tweaked beforehand."""
76
+ with self.ffi._lock:
77
+ if self._has_source and file is None:
78
+ raise VerificationError(
79
+ "source code already written")
80
+ self._write_source(file)
81
+
82
+ def compile_module(self):
83
+ """Write the C source code (if not done already) and compile it.
84
+ This produces a dynamic link library in 'self.modulefilename'."""
85
+ with self.ffi._lock:
86
+ if self._has_module:
87
+ raise VerificationError("module already compiled")
88
+ if not self._has_source:
89
+ self._write_source()
90
+ self._compile_module()
91
+
92
+ def load_library(self):
93
+ """Get a C module from this Verifier instance.
94
+ Returns an instance of a FFILibrary class that behaves like the
95
+ objects returned by ffi.dlopen(), but that delegates all
96
+ operations to the C module. If necessary, the C code is written
97
+ and compiled first.
98
+ """
99
+ with self.ffi._lock:
100
+ if not self._has_module:
101
+ self._locate_module()
102
+ if not self._has_module:
103
+ if not self._has_source:
104
+ self._write_source()
105
+ self._compile_module()
106
+ return self._load_library()
107
+
108
+ def get_module_name(self):
109
+ basename = os.path.basename(self.modulefilename)
110
+ # kill both the .so extension and the other .'s, as introduced
111
+ # by Python 3: 'basename.cpython-33m.so'
112
+ basename = basename.split('.', 1)[0]
113
+ # and the _d added in Python 2 debug builds --- but try to be
114
+ # conservative and not kill a legitimate _d
115
+ if basename.endswith('_d') and hasattr(sys, 'gettotalrefcount'):
116
+ basename = basename[:-2]
117
+ return basename
118
+
119
+ def get_extension(self):
120
+ if not self._has_source:
121
+ with self.ffi._lock:
122
+ if not self._has_source:
123
+ self._write_source()
124
+ sourcename = ffiplatform.maybe_relative_path(self.sourcefilename)
125
+ modname = self.get_module_name()
126
+ return ffiplatform.get_extension(sourcename, modname, **self.kwds)
127
+
128
+ def generates_python_module(self):
129
+ return self._vengine._gen_python_module
130
+
131
+ def make_relative_to(self, kwds, relative_to):
132
+ if relative_to and os.path.dirname(relative_to):
133
+ dirname = os.path.dirname(relative_to)
134
+ kwds = kwds.copy()
135
+ for key in ffiplatform.LIST_OF_FILE_NAMES:
136
+ if key in kwds:
137
+ lst = kwds[key]
138
+ if not isinstance(lst, (list, tuple)):
139
+ raise TypeError("keyword '%s' should be a list or tuple"
140
+ % (key,))
141
+ lst = [os.path.join(dirname, fn) for fn in lst]
142
+ kwds[key] = lst
143
+ return kwds
144
+
145
+ # ----------
146
+
147
+ def _locate_module(self):
148
+ if not os.path.isfile(self.modulefilename):
149
+ if self.ext_package:
150
+ try:
151
+ pkg = __import__(self.ext_package, None, None, ['__doc__'])
152
+ except ImportError:
153
+ return # cannot import the package itself, give up
154
+ # (e.g. it might be called differently before installation)
155
+ path = pkg.__path__
156
+ else:
157
+ path = None
158
+ filename = self._vengine.find_module(self.get_module_name(), path,
159
+ _get_so_suffixes())
160
+ if filename is None:
161
+ return
162
+ self.modulefilename = filename
163
+ self._vengine.collect_types()
164
+ self._has_module = True
165
+
166
+ def _write_source_to(self, file):
167
+ self._vengine._f = file
168
+ try:
169
+ self._vengine.write_source_to_f()
170
+ finally:
171
+ del self._vengine._f
172
+
173
+ def _write_source(self, file=None):
174
+ if file is not None:
175
+ self._write_source_to(file)
176
+ else:
177
+ # Write our source file to an in memory file.
178
+ f = NativeIO()
179
+ self._write_source_to(f)
180
+ source_data = f.getvalue()
181
+
182
+ # Determine if this matches the current file
183
+ if os.path.exists(self.sourcefilename):
184
+ with open(self.sourcefilename, "r") as fp:
185
+ needs_written = not (fp.read() == source_data)
186
+ else:
187
+ needs_written = True
188
+
189
+ # Actually write the file out if it doesn't match
190
+ if needs_written:
191
+ _ensure_dir(self.sourcefilename)
192
+ with open(self.sourcefilename, "w") as fp:
193
+ fp.write(source_data)
194
+
195
+ # Set this flag
196
+ self._has_source = True
197
+
198
+ def _compile_module(self):
199
+ # compile this C source
200
+ tmpdir = os.path.dirname(self.sourcefilename)
201
+ outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
202
+ try:
203
+ same = ffiplatform.samefile(outputfilename, self.modulefilename)
204
+ except OSError:
205
+ same = False
206
+ if not same:
207
+ _ensure_dir(self.modulefilename)
208
+ shutil.move(outputfilename, self.modulefilename)
209
+ self._has_module = True
210
+
211
+ def _load_library(self):
212
+ assert self._has_module
213
+ if self.flags is not None:
214
+ return self._vengine.load_library(self.flags)
215
+ else:
216
+ return self._vengine.load_library()
217
+
218
+ # ____________________________________________________________
219
+
220
+ _FORCE_GENERIC_ENGINE = False # for tests
221
+
222
+ def _locate_engine_class(ffi, force_generic_engine):
223
+ if _FORCE_GENERIC_ENGINE:
224
+ force_generic_engine = True
225
+ if not force_generic_engine:
226
+ if '__pypy__' in sys.builtin_module_names:
227
+ force_generic_engine = True
228
+ else:
229
+ try:
230
+ import _cffi_backend
231
+ except ImportError:
232
+ _cffi_backend = '?'
233
+ if ffi._backend is not _cffi_backend:
234
+ force_generic_engine = True
235
+ if force_generic_engine:
236
+ from . import vengine_gen
237
+ return vengine_gen.VGenericEngine
238
+ else:
239
+ from . import vengine_cpy
240
+ return vengine_cpy.VCPythonEngine
241
+
242
+ # ____________________________________________________________
243
+
244
+ _TMPDIR = None
245
+
246
+ def _caller_dir_pycache():
247
+ if _TMPDIR:
248
+ return _TMPDIR
249
+ result = os.environ.get('CFFI_TMPDIR')
250
+ if result:
251
+ return result
252
+ filename = sys._getframe(2).f_code.co_filename
253
+ return os.path.abspath(os.path.join(os.path.dirname(filename),
254
+ '__pycache__'))
255
+
256
+ def set_tmpdir(dirname):
257
+ """Set the temporary directory to use instead of __pycache__."""
258
+ global _TMPDIR
259
+ _TMPDIR = dirname
260
+
261
+ def cleanup_tmpdir(tmpdir=None, keep_so=False):
262
+ """Clean up the temporary directory by removing all files in it
263
+ called `_cffi_*.{c,so}` as well as the `build` subdirectory."""
264
+ tmpdir = tmpdir or _caller_dir_pycache()
265
+ try:
266
+ filelist = os.listdir(tmpdir)
267
+ except OSError:
268
+ return
269
+ if keep_so:
270
+ suffix = '.c' # only remove .c files
271
+ else:
272
+ suffix = _get_so_suffixes()[0].lower()
273
+ for fn in filelist:
274
+ if fn.lower().startswith('_cffi_') and (
275
+ fn.lower().endswith(suffix) or fn.lower().endswith('.c')):
276
+ try:
277
+ os.unlink(os.path.join(tmpdir, fn))
278
+ except OSError:
279
+ pass
280
+ clean_dir = [os.path.join(tmpdir, 'build')]
281
+ for dir in clean_dir:
282
+ try:
283
+ for fn in os.listdir(dir):
284
+ fn = os.path.join(dir, fn)
285
+ if os.path.isdir(fn):
286
+ clean_dir.append(fn)
287
+ else:
288
+ os.unlink(fn)
289
+ except OSError:
290
+ pass
291
+
292
+ def _get_so_suffixes():
293
+ suffixes = _extension_suffixes()
294
+ if not suffixes:
295
+ # bah, no C_EXTENSION available. Occurs on pypy without cpyext
296
+ if sys.platform == 'win32':
297
+ suffixes = [".pyd"]
298
+ else:
299
+ suffixes = [".so"]
300
+
301
+ return suffixes
302
+
303
+ def _ensure_dir(filename):
304
+ dirname = os.path.dirname(filename)
305
+ if dirname and not os.path.isdir(dirname):
306
+ os.makedirs(dirname)
@@ -0,0 +1,26 @@
1
+
2
+ Except when otherwise stated (look for LICENSE files in directories or
3
+ information at the beginning of each file) all software and
4
+ documentation is licensed as follows:
5
+
6
+ The MIT License
7
+
8
+ Permission is hereby granted, free of charge, to any person
9
+ obtaining a copy of this software and associated documentation
10
+ files (the "Software"), to deal in the Software without
11
+ restriction, including without limitation the rights to use,
12
+ copy, modify, merge, publish, distribute, sublicense, and/or
13
+ sell copies of the Software, and to permit persons to whom the
14
+ Software is furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included
17
+ in all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
+ DEALINGS IN THE SOFTWARE.
26
+
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.1
2
+ Name: cffi
3
+ Version: 1.17.1
4
+ Summary: Foreign Function Interface for Python calling C code.
5
+ Home-page: http://cffi.readthedocs.org
6
+ Author: Armin Rigo, Maciej Fijalkowski
7
+ Author-email: python-cffi@googlegroups.com
8
+ License: MIT
9
+ Project-URL: Documentation, http://cffi.readthedocs.org/
10
+ Project-URL: Source Code, https://github.com/python-cffi/cffi
11
+ Project-URL: Issue Tracker, https://github.com/python-cffi/cffi/issues
12
+ Project-URL: Changelog, https://cffi.readthedocs.io/en/latest/whatsnew.html
13
+ Project-URL: Downloads, https://github.com/python-cffi/cffi/releases
14
+ Project-URL: Contact, https://groups.google.com/forum/#!forum/python-cffi
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: Implementation :: CPython
24
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
25
+ Classifier: License :: OSI Approved :: MIT License
26
+ Requires-Python: >=3.8
27
+ License-File: LICENSE
28
+ Requires-Dist: pycparser
29
+
30
+
31
+ CFFI
32
+ ====
33
+
34
+ Foreign Function Interface for Python calling C code.
35
+ Please see the `Documentation <http://cffi.readthedocs.org/>`_.
36
+
37
+ Contact
38
+ -------
39
+
40
+ `Mailing list <https://groups.google.com/forum/#!forum/python-cffi>`_
@@ -0,0 +1,30 @@
1
+ _cffi_backend.cpython-312-darwin.so,sha256=GWWmFOOvfrGVnwqlJ9EQIIv_0qXGglXx3PQ_I5E_wa8,197768
2
+ cffi-1.17.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
3
+ cffi-1.17.1.dist-info/LICENSE,sha256=BLgPWwd7vtaICM_rreteNSPyqMmpZJXFh72W3x6sKjM,1294
4
+ cffi-1.17.1.dist-info/METADATA,sha256=u6nuvP_qPJKu2zvIbi2zkGzVu7KjnnRIYUFyIrOY3j4,1531
5
+ cffi-1.17.1.dist-info/RECORD,,
6
+ cffi-1.17.1.dist-info/WHEEL,sha256=GyWN8nmH3grmtfgTCh3KbBI2pYYEaTpvCYzaNE7iJ_c,110
7
+ cffi-1.17.1.dist-info/entry_points.txt,sha256=y6jTxnyeuLnL-XJcDv8uML3n6wyYiGRg8MTp_QGJ9Ho,75
8
+ cffi-1.17.1.dist-info/top_level.txt,sha256=rE7WR3rZfNKxWI9-jn6hsHCAl7MDkB-FmuQbxWjFehQ,19
9
+ cffi/__init__.py,sha256=H6t_ebva6EeHpUuItFLW1gbRp94eZRNJODLaWKdbx1I,513
10
+ cffi/_cffi_errors.h,sha256=zQXt7uR_m8gUW-fI2hJg0KoSkJFwXv8RGUkEDZ177dQ,3908
11
+ cffi/_cffi_include.h,sha256=Exhmgm9qzHWzWivjfTe0D7Xp4rPUkVxdNuwGhMTMzbw,15055
12
+ cffi/_embedding.h,sha256=EDKw5QrLvQoe3uosXB3H1xPVTYxsn33eV3A43zsA_Fw,18787
13
+ cffi/_imp_emulation.py,sha256=RxREG8zAbI2RPGBww90u_5fi8sWdahpdipOoPzkp7C0,2960
14
+ cffi/_shimmed_dist_utils.py,sha256=Bjj2wm8yZbvFvWEx5AEfmqaqZyZFhYfoyLLQHkXZuao,2230
15
+ cffi/api.py,sha256=alBv6hZQkjpmZplBphdaRn2lPO9-CORs_M7ixabvZWI,42169
16
+ cffi/backend_ctypes.py,sha256=h5ZIzLc6BFVXnGyc9xPqZWUS7qGy7yFSDqXe68Sa8z4,42454
17
+ cffi/cffi_opcode.py,sha256=JDV5l0R0_OadBX_uE7xPPTYtMdmpp8I9UYd6av7aiDU,5731
18
+ cffi/commontypes.py,sha256=7N6zPtCFlvxXMWhHV08psUjdYIK2XgsN3yo5dgua_v4,2805
19
+ cffi/cparser.py,sha256=0qI3mEzZSNVcCangoyXOoAcL-RhpQL08eG8798T024s,44789
20
+ cffi/error.py,sha256=v6xTiS4U0kvDcy4h_BDRo5v39ZQuj-IMRYLv5ETddZs,877
21
+ cffi/ffiplatform.py,sha256=avxFjdikYGJoEtmJO7ewVmwG_VEVl6EZ_WaNhZYCqv4,3584
22
+ cffi/lock.py,sha256=l9TTdwMIMpi6jDkJGnQgE9cvTIR7CAntIJr8EGHt3pY,747
23
+ cffi/model.py,sha256=W30UFQZE73jL5Mx5N81YT77us2W2iJjTm0XYfnwz1cg,21797
24
+ cffi/parse_c_type.h,sha256=OdwQfwM9ktq6vlCB43exFQmxDBtj2MBNdK8LYl15tjw,5976
25
+ cffi/pkgconfig.py,sha256=LP1w7vmWvmKwyqLaU1Z243FOWGNQMrgMUZrvgFuOlco,4374
26
+ cffi/recompiler.py,sha256=sim4Tm7lamt2Jn8uzKN0wMYp6ODByk3g7of47-h9LD4,65367
27
+ cffi/setuptools_ext.py,sha256=-ebj79lO2_AUH-kRcaja2pKY1Z_5tloGwsJgzK8P3Cc,8871
28
+ cffi/vengine_cpy.py,sha256=8UagT6ZEOZf6Dju7_CfNulue8CnsHLEzJYhnqUhoF04,43752
29
+ cffi/vengine_gen.py,sha256=DUlEIrDiVin1Pnhn1sfoamnS5NLqfJcOdhRoeSNeJRg,26939
30
+ cffi/verifier.py,sha256=oX8jpaohg2Qm3aHcznidAdvrVm5N4sQYG0a3Eo5mIl4,11182
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (74.1.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp312-cp312-macosx_10_9_x86_64
5
+
@@ -0,0 +1,2 @@
1
+ [distutils.setup_keywords]
2
+ cffi_modules = cffi.setuptools_ext:cffi_modules
@@ -0,0 +1,17 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ __all__ = [
8
+ "__author__",
9
+ "__copyright__",
10
+ "__version__",
11
+ ]
12
+
13
+ __version__ = "45.0.7"
14
+
15
+
16
+ __author__ = "The Python Cryptographic Authority and individual contributors"
17
+ __copyright__ = f"Copyright 2013-2025 {__author__}"
@@ -0,0 +1,26 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import sys
8
+ import warnings
9
+
10
+ from cryptography import utils
11
+ from cryptography.__about__ import __author__, __copyright__, __version__
12
+
13
+ __all__ = [
14
+ "__author__",
15
+ "__copyright__",
16
+ "__version__",
17
+ ]
18
+
19
+ if sys.version_info[:2] == (3, 7):
20
+ warnings.warn(
21
+ "Python 3.7 is no longer supported by the Python core team "
22
+ "and support for it is deprecated in cryptography. The next release "
23
+ "of cryptography will remove support for Python 3.7.",
24
+ utils.CryptographyDeprecationWarning,
25
+ stacklevel=2,
26
+ )
@@ -0,0 +1,52 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+
9
+ from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
10
+
11
+ if typing.TYPE_CHECKING:
12
+ from cryptography.hazmat.bindings._rust import openssl as rust_openssl
13
+
14
+ _Reasons = rust_exceptions._Reasons
15
+
16
+
17
+ class UnsupportedAlgorithm(Exception):
18
+ def __init__(self, message: str, reason: _Reasons | None = None) -> None:
19
+ super().__init__(message)
20
+ self._reason = reason
21
+
22
+
23
+ class AlreadyFinalized(Exception):
24
+ pass
25
+
26
+
27
+ class AlreadyUpdated(Exception):
28
+ pass
29
+
30
+
31
+ class NotYetFinalized(Exception):
32
+ pass
33
+
34
+
35
+ class InvalidTag(Exception):
36
+ pass
37
+
38
+
39
+ class InvalidSignature(Exception):
40
+ pass
41
+
42
+
43
+ class InternalError(Exception):
44
+ def __init__(
45
+ self, msg: str, err_code: list[rust_openssl.OpenSSLError]
46
+ ) -> None:
47
+ super().__init__(msg)
48
+ self.err_code = err_code
49
+
50
+
51
+ class InvalidKey(Exception):
52
+ pass