-
Notifications
You must be signed in to change notification settings - Fork 869
Resolve OpenSSL 4.0 build issues #13476
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
base: master
Are you sure you want to change the base?
Changes from all commits
c683d55
d8a37f9
6874c51
a94e4f6
42e630c
172defe
24666dd
73f63c2
e3d7f5d
3f4d065
45809f6
01b9317
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 |
|---|---|---|
|
|
@@ -8316,9 +8316,9 @@ TSSslServerCertUpdate(const char *cert_path, const char *key_path) | |
| } | ||
|
|
||
| // Extract common name | ||
| int pos = X509_NAME_get_index_by_NID(X509_get_subject_name(cert.get()), NID_commonName, -1); | ||
| X509_NAME_ENTRY *common_name = X509_NAME_get_entry(X509_get_subject_name(cert.get()), pos); | ||
| ASN1_STRING *common_name_asn1 = X509_NAME_ENTRY_get_data(common_name); | ||
| const int pos = X509_NAME_get_index_by_NID(X509_get_subject_name(cert.get()), NID_commonName, -1); | ||
| const X509_NAME_ENTRY *common_name = X509_NAME_get_entry(X509_get_subject_name(cert.get()), pos); | ||
| const ASN1_STRING *common_name_asn1 = X509_NAME_ENTRY_get_data(common_name); | ||
| char *common_name_str = reinterpret_cast<char *>(const_cast<unsigned char *>(ASN1_STRING_get0_data(common_name_asn1))); | ||
| if (ASN1_STRING_length(common_name_asn1) != static_cast<int>(strlen(common_name_str))) { | ||
|
Comment on lines
+8319
to
8323
Member
Author
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. Confirmed real, but pre-existing on master since 2024, unrelated to this PR's OpenSSL 4 changes. Filed as #13484. |
||
| // Embedded null char | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,12 +206,12 @@ do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, const unsigned cha | |
| { | ||
| bool retval = false; | ||
|
|
||
| if (!a->data || !a->length || cmp_type != a->type) { | ||
| if (!ASN1_STRING_get0_data(a) || !ASN1_STRING_length(a) || cmp_type != ASN1_STRING_type(a)) { | ||
| return false; | ||
| } | ||
| retval = equal(a->data, a->length, b, blen); | ||
| retval = equal(ASN1_STRING_get0_data(a), ASN1_STRING_length(a), b, blen); | ||
| if (retval && peername) { | ||
| *peername = ats_strndup((char *)a->data, a->length); | ||
| *peername = ats_strndup(reinterpret_cast<const char *>(ASN1_STRING_get0_data(a)), ASN1_STRING_length(a)); | ||
| } | ||
|
maskit marked this conversation as resolved.
|
||
| return retval; | ||
| } | ||
|
|
@@ -220,7 +220,6 @@ bool | |
| validate_hostname(X509 *x, std::string_view hostname, bool is_ip, char **peername) | ||
| { | ||
| GENERAL_NAMES *gens = nullptr; | ||
| X509_NAME *name = nullptr; | ||
| int i; | ||
| int alt_type; | ||
| bool retval = false; | ||
|
|
@@ -269,13 +268,13 @@ validate_hostname(X509 *x, std::string_view hostname, bool is_ip, char **peernam | |
| } | ||
| } | ||
| // No SAN match -- check the subject | ||
| i = -1; | ||
| name = X509_get_subject_name(x); | ||
| i = -1; | ||
| auto *name = X509_get_subject_name(x); | ||
|
|
||
| while ((i = X509_NAME_get_index_by_NID(name, NID_commonName, i)) >= 0) { | ||
| ASN1_STRING *str; | ||
| int astrlen; | ||
| unsigned char *astr; | ||
| const ASN1_STRING *str; | ||
| int astrlen; | ||
| unsigned char *astr; | ||
| str = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, i)); | ||
| // Convert to UTF-8 | ||
| astrlen = ASN1_STRING_to_UTF8(&astr, str); | ||
|
Member
Author
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. Confirmed real, but pre-existing on master since the function's original addition in 2015, unrelated to this PR's OpenSSL 4 changes. Filed as #13483. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.