8000 [Demo] [Incomplete] Allow compilation and linking against BoringSSL by gpshead · Pull Request #116399 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[Demo] [Incomplete] Allow compilation and linking against BoringSSL #116399

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

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove keylog_bio patch, obsolete.
BoringSSL was originally missing BIO_FP_TEXT preventing the keylog
callback API from working.  That was added to BoringSSL.
  • Loading branch information
gpshead committed Mar 27, 2024
commit 29fedb430b033e71a8e1ebca22b316e10346c1ca
8 changes: 0 additions & 8 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,8 @@ typedef struct {
int post_handshake_auth;
#endif
PyObject *msg_cb;
#ifndef OPENSSL_IS_BORINGSSL
PyObject *keylog_filename;
BIO *keylog_bio;
#endif
/* Cached module state, also used in SSLSocket and SSLSession code. */
_sslmodulestate *state;
#ifndef OPENSSL_NO_PSK
Expand Down Expand Up @@ -3142,10 +3140,8 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
self->hostflags = X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS;
self->protocol = proto_version;
self->msg_cb = NULL;
#ifndef OPENSSL_IS_BORINGSSL
self->keylog_filename = NULL;
self->keylog_bio = NULL;
#endif
self->alpn_protocols = NULL;
self->set_sni_cb = NULL;
self->state = get_ssl_state(module);
Expand Down Expand Up @@ -3265,7 +3261,6 @@ context_clear(PySSLContext *self)
{
Py_CLEAR(self->set_sni_cb);
Py_CLEAR(self->msg_cb);
#ifndef OPENSSL_IS_BORINGSSL
Py_CLEAR(self->keylog_filename);
#ifndef OPENSSL_NO_PSK
Py_CLEAR(self->psk_client_callback);
Expand All @@ -3277,7 +3272,6 @@ context_clear(PySSLContext *self)
PySSL_END_ALLOW_THREADS
self->keylog_bio = NULL;
}
#endif
return 0;
}

Expand Down Expand Up @@ -4946,10 +4940,8 @@ static PyGetSetDef context_getsetlist[] = {
(setter) set_minimum_version, NULL},
{"maximum_version", (getter) get_maximum_version,
(setter) set_maximum_version, NULL},
#ifndef OPENSSL_IS_BORINGSSL
{"keylog_filename", (getter) _PySSLContext_get_keylog_filename,
(setter) _PySSLContext_set_keylog_filename, NULL},
#endif
{"_msg_callback", (getter) _PySSLContext_get_msg_callback,
(setter) _PySSLContext_set_msg_callback, NULL},
{"sni_callback", (getter) get_sni_callback,
Expand Down
2 changes: 0 additions & 2 deletions Modules/_ssl/debughelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ _PySSLContext_set_msg_callback(PySSLContext *self, PyObject *arg, void *c) {
return 0;
}

#ifndef OPENSSL_IS_BORINGSSL
static void
_PySSL_keylog_callback(const SSL *ssl, const char *line)
{
Expand Down Expand Up @@ -205,4 +204,3 @@ _PySSLContext_set_keylog_filename(PySSLContext *self, PyObject *arg, void *c) {
SSL_CTX_set_keylog_callback(self->ctx, _PySSL_keylog_callback);
return 0;
}
#endif /* OPENSSL_IS_BORINGSSL */
0