Skip to content

Commit

Permalink
Use ALL cipher list for building with LC
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Sep 26, 2023
1 parent 313d87c commit 6a06d06
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,8 +1879,7 @@ hashlib_md_meth_names(PyObject *module)
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
// get algorithms from all activated providers in default context
EVP_MD_do_all_provided(NULL, &_openssl_hash_name_mapper, &state);
#elif !defined(OPENSSL_IS_AWSLC)
// TODO [childw]
#else
EVP_MD_do_all(&_openssl_hash_name_mapper, &state);
#endif

Expand Down
14 changes: 10 additions & 4 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
#include <sys/poll.h>
#endif

#if defined(OPENSSL_IS_AWSLC)
#define SSL_OP_NO_TLSv1_3
#endif

/* Include OpenSSL header files */
#include "openssl/rsa.h"
#include "openssl/crypto.h"
Expand Down Expand Up @@ -3170,7 +3174,8 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
/* stick to OpenSSL's default settings */
result = 1;
#else
result = SSL_CTX_set_cipher_list(ctx, PY_SSL_DEFAULT_CIPHER_STRING);
// TODO [childw]
result = SSL_CTX_set_cipher_list(ctx, "ALL"/*PY_SSL_DEFAULT_CIPHER_STRING*/);
#endif
} else {
/* SSLv2 needs MD5 */
Expand All @@ -3180,7 +3185,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
Py_DECREF(self);
ERR_clear_error();
PyErr_SetString(get_state_ctx(self)->PySSLErrorObject,
"No cipher can be selected.");
"No cipher can be selected. 1");
goto error;
}
#ifdef PY_SSL_MIN_PROTOCOL
Expand Down Expand Up @@ -3276,14 +3281,15 @@ static PyObject *
_ssl__SSLContext_set_ciphers_impl(PySSLContext *self, const char *cipherlist)
/*[clinic end generated code: output=3a3162f3557c0f3f input=a7ac931b9f3ca7fc]*/
{
int ret = SSL_CTX_set_cipher_list(self->ctx, cipherlist);
// TODO [childw]
int ret = SSL_CTX_set_cipher_list(self->ctx, "ALL");
if (ret == 0) {
/* Clearing the error queue is necessary on some OpenSSL versions,
otherwise the error will be reported again when another SSL call
is done. */
ERR_clear_error();
PyErr_SetString(get_state_ctx(self)->PySSLErrorObject,
"No cipher can be selected.");
"No cipher can be selected. 2");
return NULL;
}
Py_RETURN_NONE;
Expand Down
5 changes: 0 additions & 5 deletions Modules/_ssl/debughelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,7 @@ _PySSLContext_set_keylog_filename(PySSLContext *self, PyObject *arg, void *c) {
if (fp == NULL)
return -1;

#if defined(OPENSSL_IS_AWSLC)
self->keylog_bio = BIO_new_fp(fp, BIO_CLOSE);
#else
self->keylog_bio = BIO_new_fp(fp, BIO_CLOSE | BIO_FP_TEXT);
#endif
self->keylog_bio = BIO_new_fp(fp, BIO_CLOSE);
if (self->keylog_bio == NULL) {
PyErr_SetString(get_state_ctx(self)->PySSLErrorObject,
"Can't malloc memory for keylog file");
Expand Down

0 comments on commit 6a06d06

Please sign in to comment.