From 3a2fcde2c57c5eb0b876971543ae3e3d71f0f24d Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Sun, 13 Sep 2026 16:32:02 +0300 Subject: [PATCH] clamav: upgrade 1.4.4 -> 1.4.6 Upgrade to 1.4.6 and apply an outstanding upstream PR that adds OpenSSL 4.0 support. Release notes: https://github.com/Cisco-Talos/clamav/releases/tag/clamav-1.4.5 https://github.com/Cisco-Talos/clamav/releases/tag/clamav-1.4.6 Signed-off-by: Scott Murray --- .../{clamav_1.4.4.bb => clamav_1.4.6.bb} | 3 +- ...ed-OpenSSL-accessors-for-ASN1_STRING.patch | 122 ++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) rename recipes-scanners/clamav/{clamav_1.4.4.bb => clamav_1.4.6.bb} (98%) create mode 100644 recipes-scanners/clamav/files/0001-Use-non-deprecated-OpenSSL-accessors-for-ASN1_STRING.patch diff --git a/recipes-scanners/clamav/clamav_1.4.4.bb b/recipes-scanners/clamav/clamav_1.4.6.bb similarity index 98% rename from recipes-scanners/clamav/clamav_1.4.4.bb rename to recipes-scanners/clamav/clamav_1.4.6.bb index b3f14cd..01eaf2b 100644 --- a/recipes-scanners/clamav/clamav_1.4.4.bb +++ b/recipes-scanners/clamav/clamav_1.4.6.bb @@ -16,13 +16,14 @@ LIC_FILES_CHKSUM = "file://COPYING.txt;md5=2c0b5770a62017a3121c69bb9f680b0c \ DEPENDS = "glibc llvm libtool db openssl zlib curl libxml2 bison pcre2 json-c libcheck rust-native cargo-native" SRC_URI = "git://github.com/Cisco-Talos/clamav;branch=rel/1.4;protocol=https \ + file://0001-Use-non-deprecated-OpenSSL-accessors-for-ASN1_STRING.patch \ file://clamd.conf \ file://freshclam.conf \ file://volatiles.03_clamav \ file://tmpfiles.clamav \ " -# ClamAV version 1.4.4 +# ClamAV version 1.4.6 SRCREV = "f6d84be3c0048deb15c54d67e140dae062e5b82b" COMPATIBLE_HOST:libc-musl:class-target = "null" diff --git a/recipes-scanners/clamav/files/0001-Use-non-deprecated-OpenSSL-accessors-for-ASN1_STRING.patch b/recipes-scanners/clamav/files/0001-Use-non-deprecated-OpenSSL-accessors-for-ASN1_STRING.patch new file mode 100644 index 0000000..ca17e2c --- /dev/null +++ b/recipes-scanners/clamav/files/0001-Use-non-deprecated-OpenSSL-accessors-for-ASN1_STRING.patch @@ -0,0 +1,122 @@ +From 13ff91836da6f85e16a6db0aa0517dccab76aa82 Mon Sep 17 00:00:00 2001 +From: Bob Beck +Date: Fri, 5 Dec 2025 15:50:23 -0700 +Subject: [PATCH] Use non deprecated OpenSSL accessors for ASN1_STRING values. + +This changes your time conversion routine to use +ASN1_STRING_get0_data() and ASN1_STRING_length() rather than +directly using the values from the object. + +OpenSSL plans to make ASN1_STRING opaque soon: +https://github.com/openssl/openssl/issues/29117 + +The accessor in question is in OpenSSL 1.1 as well as +BoringSSL and LibreSSL so should be widely available. + +As the returned value is const, and you are changing it +to pass to strptime, I've made it make a copy to work with. + +Since I added another allocation I converted it to single +return to ensure everything gets freed appropriately. + +Upstream-Status: Pending [https://github.com/Cisco-Talos/clamav/pull/1642] +Signed-off-by: Scott Murray +--- + libclamav/crypto.c | 46 +++++++++++++++++++++++++++------------------- + 1 file changed, 27 insertions(+), 19 deletions(-) + +diff --git a/libclamav/crypto.c b/libclamav/crypto.c +index 8b398e402..61c6d5434 100644 +--- a/libclamav/crypto.c ++++ b/libclamav/crypto.c +@@ -1748,9 +1748,10 @@ X509 *cl_load_cert(const char *certpath) + + struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj) + { +- struct tm *t; +- char *str; +- const char *fmt = NULL; ++ struct tm *ret = NULL; ++ struct tm *t = NULL; ++ char *str = NULL; ++ const char *data, *fmt = NULL; + time_t localt; + #ifdef _WIN32 + struct tm localtm, *ltm; +@@ -1758,18 +1759,21 @@ struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj) + struct tm localtm; + #endif + +- if (!(timeobj) || !(timeobj->data)) +- return NULL; ++ if (timeobj == NULL || (data = ASN1_STRING_get0_data(timeobj)) == NULL) ++ goto done; ++ ++ str = CLI_STRNDUP(data, ASN1_STRING_length(timeobj)); ++ if (NULL == str) ++ goto done; + +- str = (char *)(timeobj->data); + if (strlen(str) < 12) +- return NULL; ++ goto done; + + t = (struct tm *)calloc(1, sizeof(struct tm)); + if (!(t)) +- return NULL; ++ goto done; + +- if (timeobj->type == V_ASN1_UTCTIME) { ++ if (ASN1_STRING_type(timeobj) == V_ASN1_UTCTIME) { + /* two digit year */ + fmt = "%y%m%d%H%M%S"; + if (str[3] == '0') { +@@ -1778,7 +1782,7 @@ struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj) + } else { + str[3]--; + } +- } else if (timeobj->type == V_ASN1_GENERALIZEDTIME) { ++ } else if (ASN1_STRING_type(timeobj) == V_ASN1_GENERALIZEDTIME) { + /* four digit year */ + fmt = "%Y%m%d%H%M%S"; + if (str[5] == '0') { +@@ -1789,15 +1793,11 @@ struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj) + } + } + +- if (!(fmt)) { +- free(t); +- return NULL; +- } ++ if (!(fmt)) ++ goto done; + +- if (!strptime(str, fmt, t)) { +- free(t); +- return NULL; +- } ++ if (!strptime(str, fmt, t)) ++ goto done; + + /* Convert to local time */ + localt = time(NULL); +@@ -1808,7 +1808,15 @@ struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj) + localtime_r(&localt, &localtm); + #endif + t->tm_isdst = localtm.tm_isdst; +- return t; ++ ++ ret = t; ++ t = NULL; ++ ++done: ++ free(t); ++ free(str); ++ ++ return ret; + } + + X509_CRL *cl_load_crl(const char *file) +-- +2.47.3 +