public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Crypt-SMIME] openssl4: Patch for openssl4 asn1 string
@ 2026-07-30 12:22 Steve Traylen
  0 siblings, 0 replies; only message in thread
From: Steve Traylen @ 2026-07-30 12:22 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/perl-Crypt-SMIME
            Branch : openssl4
            Commit : 0f9423b51f90831b2c044544db9ae32e4d600cae
            Author : Steve Traylen <steve.traylen@cern.ch>
            Date   : 2026-07-30T14:21:50+02:00
            Stats  : +18/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/perl-Crypt-SMIME/c/0f9423b51f90831b2c044544db9ae32e4d600cae?branch=openssl4

            Log:
            Patch for openssl4 asn1 string

- Resolves: rhbz#2491638
- Resolves: rhbz#2506883

OpenSSL 4.0 made the ASN1_STRING structure opaque
(https://github.com/openssl/openssl/releases/tag/openssl-4.0.0), so
CMS_get_smimecaps() no longer compiles: it reaches through
cap->value.sequence->data and cap->value.sequence->length directly.
Use the public accessors ASN1_STRING_get0_data() and
ASN1_STRING_length() instead. Both have been available since OpenSSL
1.1.0 and behave identically against 3.x, so this is a portability
fix rather than a version-specific #ifdef.

Also make `cap` a const ASN1_TYPE*, matching the const return type
of X509_ATTRIBUTE_get0_type(), to clear the pre-existing
-Wdiscarded-qualifiers warning at the same call site.

---
diff --git a/perl-Crypt-SMIME-openssl4-asn1-string.patch b/perl-Crypt-SMIME-openssl4-asn1-string.patch
new file mode 100644
index 0000000..91db71d
--- /dev/null
+++ b/perl-Crypt-SMIME-openssl4-asn1-string.patch
@@ -0,0 +1,15 @@
+diff '--color=auto' -uNr Crypt-SMIME-0.33.ORIG/SMIME.xs Crypt-SMIME-0.33/SMIME.xs
+--- Crypt-SMIME-0.33.ORIG/SMIME.xs	2026-07-30 14:09:16.443914887 +0200
++++ Crypt-SMIME-0.33/SMIME.xs	2026-07-30 14:09:31.091557942 +0200
+@@ -439,9 +439,9 @@
+     cap = X509_ATTRIBUTE_get0_type(attr, 0);
+     if (!cap || (cap->type != V_ASN1_SEQUENCE))
+         return NULL;
+-    p = cap->value.sequence->data;
++    p = ASN1_STRING_get0_data(cap->value.sequence);
+     return (STACK_OF(X509_ALGOR) *)
+-        ASN1_item_d2i(NULL, &p, cap->value.sequence->length, ASN1_ITEM_rptr(X509_ALGORS));
++        ASN1_item_d2i(NULL, &p, ASN1_STRING_length(cap->value.sequence), ASN1_ITEM_rptr(X509_ALGORS));
+ }
+ 
+ static void seed_rng() {

diff --git a/perl-Crypt-SMIME.spec b/perl-Crypt-SMIME.spec
index 222a4e8..f247144 100644
--- a/perl-Crypt-SMIME.spec
+++ b/perl-Crypt-SMIME.spec
@@ -5,6 +5,8 @@ Summary:        S/MIME message signing, verification, encryption and decryption
 License:        GPL-1.0-or-later OR Artistic-1.0-Perl
 URL:            https://metacpan.org/release/Crypt-SMIME
 Source0:        https://cpan.metacpan.org/authors/id/M/MI/MIKAGE/Crypt-SMIME-%{version}.tar.gz
+# https://rt.cpan.org/Ticket/Display.html?id=180472
+Patch0:         perl-Crypt-SMIME-openssl4-asn1-string.patch
 
 BuildRequires:  coreutils
 BuildRequires:  gcc
@@ -49,6 +51,7 @@ verify, encrypt and decrypt messages. It requires libcrypto
 # As part of the rpm process we generate some files which
 # then cause t/manifest.t to fail.
 printf '\\.list$\n^\\.package_note\n' >> MANIFEST.SKIP
+%patch 0 -p1
 
 
 %build

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-30 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-30 12:22 [rpms/perl-Crypt-SMIME] openssl4: Patch for openssl4 asn1 string Steve Traylen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox