Package: imapfilter
Followup-For: Bug #1138453
X-Debbugs-Cc: [email protected]
Control: tags -1 patch ftbfs

Dear Maintainer,

The patch fixes the build issue.

-- System Information:
Debian Release: trixie/sid
  APT prefers noble-updates
  APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble'), 
(100, 'noble-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.8.0-124-generic (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Description: Use ASN1_STRING accessors instead of accessing struct members 
directly
 OpenSSL 4.0 made ASN1_INTEGER (aka ASN1_STRING) opaque. Use the
 accessor functions ASN1_STRING_length(), ASN1_STRING_type(), and
 ASN1_STRING_get0_data() instead of accessing ->length, ->type, and
 ->data directly.
Author: Ravi Kant Sharma <[email protected]>
Bug-Ubuntu: https://launchpad.net/bugs/2155005
Bug-Debian: https://bugs.debian.org/1138453
Forwarded: https://github.com/lefcha/imapfilter/pull/317
Last-Update: 2026-08-03

Index: imapfilter/src/cert.c
===================================================================
--- a/src/cert.c
+++ b/src/cert.c
@@ -186,21 +186,21 @@
        serial = X509_get_serialNumber(cert);
        buf = xmalloc(LINE_MAX);
        *buf = '\0';
-       if (serial->length <= (int)sizeof(long)) {
+       if (ASN1_STRING_length(serial) <= (int)sizeof(long)) {
                num = ASN1_INTEGER_get(serial);
-               if (serial->type == V_ASN1_NEG_INTEGER) {
+               if (ASN1_STRING_type(serial) == V_ASN1_NEG_INTEGER) {
                        snprintf(buf, LINE_MAX, "-%lX", -num);
                } else {
                        snprintf(buf, LINE_MAX, "%lX", num);
                }
        } else {
-               if (serial->type == V_ASN1_NEG_INTEGER) {
+               if (ASN1_STRING_type(serial) == V_ASN1_NEG_INTEGER) {
                        snprintf(buf, LINE_MAX, "-");
                }
-               for (i = 0; i < serial->length; i++) {
+               for (i = 0; i < ASN1_STRING_length(serial); i++) {
                        len = strlen(buf);
                        snprintf(buf + len, LINE_MAX - len, "%02X",
-                           serial->data[i]);
+                           ASN1_STRING_get0_data(serial)[i]);
                }
        }
        return buf;

Reply via email to