8000 fix OpenSSL 3.5 compatibility by jluebbe · Pull Request #1697 · rauc/rauc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix OpenSSL 3.5 compatibility #1697

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

Merged
merged 2 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion src/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ void r_context_register_progress_callback(progress_callback progress_cb)

RaucContext *r_context_conf(void)
{
if (context == NULL) {
static gboolean initialized = FALSE;

if (!initialized) {
GError *ierror = NULL;

// let us handle broken pipes explicitly
Expand All @@ -797,6 +799,10 @@ RaucContext *r_context_conf(void)
return NULL;
}

initialized = TRUE;
}

if (context == NULL) {
context = g_new0(RaucContext, 1);
context->progress = NULL;
context->install_info = g_new0(RContextInstallationInfo, 1);
Expand Down
8000
14 changes: 6 additions & 8 deletions src/signature.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ gboolean signature_init(GError **error)
return FALSE;
}

id = X509_PURPOSE_get_count() + 1;
if (X509_PURPOSE_get_by_id(id) >= 0) {
g_set_error_literal(
error,
R_SIGNATURE_ERROR,
R_SIGNATURE_ERROR_CRYPTOINIT_FAILED,
"Failed to calculate free OpenSSL X509 purpose id");
return FALSE;
/* OpenSSL 3.5 warns that there may be gaps, so we need to search.
* When we have 3.5 as the minimum version, we can use
* X509_PURPOSE_get_unused_id instead. */
id = X509_PURPOSE_MAX + 1;
while (X509_PURPOSE_get_by_id(id) != -1) {
id++;
}

/* X509_TRUST_OBJECT_SIGN maps to the Code Signing ID (via OpenSSL's NID_code_sign) */
Expand Down
Loading
0