-
Notifications
You must be signed in to change notification settings - Fork 6
add support for ML-DSA-* etc., various small fixes; C23 and OpenSSL 4.0 compat #72
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
Changes from all commits
6ae9ee6
f4d42e6
ee388c9
3bb6050
5936937
3ccdb6f
0ea037e
8894e53
b4323b4
6c69d06
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 |
|---|---|---|
|
|
@@ -16,14 +16,22 @@ | |
| #ifndef SECUTILS_CONN_H_ | ||
| # define SECUTILS_CONN_H_ | ||
|
|
||
| # include "../basic.h" | ||
| # include "../util/util.h" | ||
|
|
||
| # if OPENSSL_VERSION_NUMBER < OPENSSL_V_3_0_0 | ||
| # undef OSSL_HTTP_PREFIX | ||
| # define OSSL_HTTP_PREFIX "http://" | ||
| # undef OSSL_HTTPS_PREFIX | ||
| # define OSSL_HTTPS_PREFIX "https://" | ||
| # else | ||
| # include <openssl/http.h> | ||
| # endif | ||
| static const char* const CONN_scheme_postfix = "://"; | ||
| static const char* const CONN_http_prefix = "http://"; | ||
| static const char* const CONN_https_prefix = "https://"; | ||
| static const char* const CONN_http_prefix = OSSL_HTTP_PREFIX; | ||
| static const char* const CONN_https_prefix = OSSL_HTTPS_PREFIX; | ||
|
|
||
| #define CONN_IS_HTTP( uri) ((uri) != NULL && HAS_PREFIX(uri, OSSL_HTTP_PREFIX )) | ||
| #define CONN_IS_HTTPS(uri) ((uri) != NULL && HAS_PREFIX(uri, OSSL_HTTPS_PREFIX)) | ||
| #define CONN_IS_HTTP( uri) ((uri) != NULL && HAS_CASE_PREFIX(uri, OSSL_HTTP_PREFIX )) | ||
| #define CONN_IS_HTTPS(uri) ((uri) != NULL && HAS_CASE_PREFIX(uri, OSSL_HTTPS_PREFIX)) | ||
|
DDvO marked this conversation as resolved.
|
||
| #define CONN_IS_IP_ADDR(host) CONN_is_IP_address(host) | ||
|
DDvO marked this conversation as resolved.
|
||
|
|
||
| /*!***************************************************************************** | ||
|
|
@@ -35,15 +43,15 @@ static const char* const CONN_https_prefix = "https://"; | |
| bool CONN_is_IP_address(OPTIONAL const char *host); | ||
|
DDvO marked this conversation as resolved.
|
||
|
|
||
| /*!***************************************************************************** | ||
| * @brief parse hostname or URI of the form "[http[s]://][<userinfo>@]<host>[:<port>][/<path>]" | ||
| * @brief parse hostname or URI of the form "[http[s]://][<userinfo>@]<host>[:port][/<path>]" | ||
|
Collaborator
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. why remove the <> for port and not for the others?
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. Good spotting - I removed the |
||
| * @note an IPv6 address must be enclosed in '[' and ']'. | ||
| * @param p_uri pointer to variable holding the URI to be parsed. | ||
| * The variable is advanced past any leading "http[s]://" and "<userinfo>@" parts to the host name/address; | ||
| * anything following it (i.e., <port> and/or <path> URI components) are chopped in the input string buffer. | ||
| * anything following it (i.e., port and/or path URI components) are chopped in the input string buffer. | ||
| * @param default_port specifies the default port to return: | ||
| * may give an actual default port number or 0, which is replaced by 443 for https else by 80 | ||
| * @param p_path if this pointer is not null it will be used to assign on success | ||
| * the pointer to any <path> component (including and query and fragment parts) | ||
| * the pointer to any path component (including any query and fragment parts) | ||
| * included in the input string, or null if not included. | ||
| * @param desc description of the server to connect to, for use in diagnostic messages, or null | ||
| * @return valid port number from input string or default, or <= 0 on error | ||
|
|
||
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.
is this still relevant or can it be deleted?
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.
I had added this TODO as a reminder for myself to complete it when doing the next release.
It is not yet fully done, as more changes are to be expected.