-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
PoC: Make it possible to write code that interacts with OpenSSL in Rust #6695
Changes from all commits
37c02ca
accb232
e7d71a3
71c8424
e5f9407
68214d4
d68c685
d07fd9a
b895314
add33fa
8a6f0f9
c11218a
b087223
1ef6259
65340cb
a9aa151
e36ba2b
21208ff
916716c
a114535
2eea530
1377cee
9518ea1
0604d80
50a751a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,12 @@ def build_ffi( | |
verify_source += '\n#define CRYPTOGRAPHY_PACKAGE_VERSION "{}"'.format( | ||
about["__version__"] | ||
) | ||
verify_source += r""" | ||
|
||
int make_cryptography_openssl_module(void) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's name this |
||
return cffi_start_python(); | ||
} | ||
""" | ||
ffi.cdef(cdef_source) | ||
ffi.set_source( | ||
module_name, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# An empty file to make mypy recognize this module |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,11 @@ | |
import cryptography | ||
from cryptography import utils | ||
from cryptography.exceptions import InternalError | ||
from cryptography.hazmat.bindings._openssl import ffi, lib | ||
from cryptography.hazmat.bindings._rust import _openssl | ||
from cryptography.hazmat.bindings.openssl._conditional import CONDITIONAL_NAMES | ||
|
||
ffi = _openssl.ffi # type: ignore | ||
lib = _openssl.lib # type: ignore | ||
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What actually uses these? Theoretically everything should go through a |
||
_OpenSSLErrorWithText = typing.NamedTuple( | ||
"_OpenSSLErrorWithText", | ||
[("code", int), ("lib", int), ("reason", int), ("reason_text", bytes)], | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment explaining what this is for?