secvarctl/0001-Fix-OpenSSL-4.0-compatibility.patch
2026-05-11 11:57:29 +02:00

55 lines
1.8 KiB
Diff

From 7f6aae0cc929818a07ffcdbfbfbcd18b4c8352ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= <pzacik@redhat.com>
Date: Mon, 11 May 2026 11:29:28 +0200
Subject: [PATCH] Fix OpenSSL 4.0 compatibility
Use const qualifiers and ASN1_STRING accessor functions.
---
external/libstb-secvar/src/crypto_openssl.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/external/libstb-secvar/src/crypto_openssl.c b/external/libstb-secvar/src/crypto_openssl.c
index e6dd5e5..9fe8303 100644
--- a/external/libstb-secvar/src/crypto_openssl.c
+++ b/external/libstb-secvar/src/crypto_openssl.c
@@ -124,7 +124,7 @@ err_out:
int crypto_x509_get_sig_len (crypto_x509_t *x509)
{
int rc;
- ASN1_BIT_STRING *sig;
+ const ASN1_BIT_STRING *sig;
sig = X509_get0_pubkey_bitstr (x509);
if (!sig)
@@ -139,7 +139,7 @@ int crypto_x509_get_sig_len (crypto_x509_t *x509)
return rc;
}
- return sig->length;
+ return ASN1_STRING_length(sig);
}
int crypto_x509_oid_is_pkcs1_sha256 (crypto_x509_t *x509)
@@ -262,7 +262,7 @@ int crypto_pkcs7_signed_hash_verify (crypto_pkcs7_t *pkcs7, crypto_x509_t *x509,
unsigned char *hash, int hash_len)
{
int exp_size, md_nid, num_signers, rc = ERR_R_INTERNAL_ERROR;
- unsigned char *exp_sig;
+ const unsigned char *exp_sig;
EVP_PKEY *pk;
EVP_PKEY_CTX *pk_ctx;
X509_ALGOR *alg;
@@ -346,8 +346,8 @@ int crypto_pkcs7_signed_hash_verify (crypto_pkcs7_t *pkcs7, crypto_x509_t *x509,
goto out;
}
- exp_size = signer_info->enc_digest->length;
- exp_sig = signer_info->enc_digest->data;
+ exp_size = ASN1_STRING_length(signer_info->enc_digest);
+ exp_sig = ASN1_STRING_get0_data(signer_info->enc_digest);
if (exp_size <= 0 || !exp_sig)
{
--
2.53.0