Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 887833

Summary: net-misc/curl-7.87.0[gnutls,openssl]: md4.c:500:3: error: unknown type name 'MD4_CTX'
Product: Gentoo Linux Reporter: Leonid Kopylov <leonchik1976>
Component: Current packagesAssignee: Anthony Basile <blueness>
Status: RESOLVED FIXED    
Severity: normal CC: Adrian.Bassett, grknight, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/curl/curl/issues/10110
https://github.com/curl/curl/pull/10142
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 887745    
Attachments: build.log

Description Leonid Kopylov 2022-12-22 07:31:27 UTC
# emerge -pqv '=net-misc/curl-7.87.0::gentoo'
[ebuild     U ] net-misc/curl-7.87.0 [7.86.0-r3] USE="adns alt-svc brotli ftp gnutls gopher hsts http2 idn imap ipv6 kerberos ldap mbedtls nss openssl pop3 progress-meter quiche rtmp rustls samba smtp ssh ssl telnet tftp zstd (-nghttp3) -sslv3 -static-libs -test -verify-sig -websockets" ABI_X86="32 (64) (-x32)" CURL_SSL="openssl -gnutls -mbedtls -nss -rustls"

# emerge --info '=net-misc/curl-7.87.0::gentoo'
Portage 3.0.41 (python 3.10.9-final-0, default/linux/amd64/17.1/systemd/merged-usr, gcc-12, glibc-2.36-r6, 6.1.0-gentoo-amd64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.0-gentoo-amd64-x86_64-12th_Gen_Intel-R-_Core-TM-_i7-1260P-with-glibc2.36
KiB Mem:    65423908 total,  44955708 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Thu, 22 Dec 2022 06:30:01 +0000
Head commit of repository gentoo: ed9638e15b1303d2624901422c42d305f1bc9d06
sh bash 5.2_p15
ld GNU ld (Gentoo 2.39 p5) 2.39.0
ccache version 4.7.4 [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.2_p15::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.10.9::gentoo, 3.11.1::gentoo, 3.12.0_alpha3-r1::gentoo
dev-lang/rust:             1.66.0::gentoo
dev-util/ccache:           4.7.4::gentoo
dev-util/cmake:            3.25.1::gentoo
dev-util/meson:            0.64.1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          252.4::gentoo
sys-devel/autoconf:        2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.3.1_p20221209::gentoo, 12.2.1_p20221210::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            15.0.6::gentoo
sys-devel/make:            4.4::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24

darkelf
    location: /var/lib/layman/darkelf
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/user/darkelf.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="https://mirror.isoc.org.il/pub/gentoo/"
LANG="en_US.utf8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j10"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac aalib acl alsa amd64 aspell audit berkdb bidi bluetooth bluray boost branding brotli btrfs bzip2 cairo cddb cdio cgi cli client colord contrib corefonts cron crypt cryptsetup cups curl dbi dbus device-mapper djvu doc dri dts dvb emacs enchant examples executable exif expat experimental extra extras fam fastcgi fbcon ffmpeg fftw firebird flac fontconfig fontforge fortran fpx freetds ftp fuse games gcrypt gd gdbm gdk-pixbuf geoip gif git glib glusterfs gme gmp gnutls go gpg gphoto2 gpm graphite graphviz gsm gssapi gtk-doc guile harfbuzz hdf5 hdri heif highlight hscolour html http http2 iconv icu idn imagemagick imap imlib introspection iodbc ipv6 jack java javascript jbig jemalloc jpeg jpeg2k jpegxl json kerberos ladspa latex lcms ldap libass libcaca libevent libglvnd libsamplerate libtirpc libxml2 lm-sensors lmdb lqr lua lv2 lvm lz4 lzma lzo mad magic maildir mbedtls mbox memcached midi mmap mng modplug mongodb mp3 mpi mssql multilib musepack mysql nas ncurses netlink nettle nfs nls nptl nss ntlm odbc offensive ogg openexr openmp openssl opus pam pango pcap pcre pdf perl pkcs11 plugins png policykit portaudio postgres postscript python qdbm qrcode raw rdma readline redis samba sasl screencast sctp sdl seccomp sftp smtp snappy sndfile sndio snmp sound source speex spell sqlite ssh ssl svg symlink syslog systemd tcl test-rust theora threads tiff tools tpm truetype twolame udev unicode unwind upower usb utils uuid v4l vala vcd vim-syntax vnc vorbis vpx wavpack webkit webp wifi wmf x264 x265 xattr xface xft xinerama xml xpm xv xvid yaml zeroconf zip zlib zstd" ABI_X86="64 32" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev joystick libinput" KERNEL="linux" L10N="en en-US he ru" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27 ruby30 ruby31" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Leonid Kopylov 2022-12-22 07:31:42 UTC
Created attachment 844611 [details]
build.log
Comment 2 Maxim Britov 2022-12-22 14:55:45 UTC
USE='-gnutls' emerge curl

should workaround this issue.

Something wrong in this logic:

#if defined(USE_GNUTLS)
#include <nettle/md4.h>
#elif defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
#include <wolfssl/openssl/md4.h>
#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
#include <openssl/md4.h>


PS. FYI: configure: WARNING: unrecognized options: --with-nettle
Comment 3 Stephan Hartmann (RETIRED) gentoo-dev 2022-12-22 15:59:05 UTC
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -86,11 +86,7 @@
 #include "memdebug.h"


-#if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
-
-#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
-
-#elif defined(USE_GNUTLS)
+#if defined(USE_GNUTLS)

 typedef struct md4_ctx MD4_CTX;

@@ -109,6 +105,10 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
   md4_digest(ctx, MD4_DIGEST_SIZE, result);
 }

+#elif defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
+
+#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
+
 #elif defined(AN_APPLE_OS)
 typedef CC_MD4_CTX MD4_CTX;
Comment 4 Maxim Britov 2022-12-22 18:12:36 UTC
upstream bug https://github.com/curl/curl/issues/10110
upstream pull request https://github.com/curl/curl/pull/10142
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-23 01:20:12 UTC
(In reply to Maxim Britov from comment #2)
> PS. FYI: configure: WARNING: unrecognized options: --with-nettle

That part seems to be from 7.86.0: https://github.com/curl/curl/pull/6625. I'll fix while backporting.
Comment 6 Larry the Git Cow gentoo-dev 2022-12-23 01:29:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26ad093791c6f0d4953b939e87eb259b49eb3b89

commit 26ad093791c6f0d4953b939e87eb259b49eb3b89
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-12-23 01:28:08 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-12-23 01:28:42 +0000

    net-misc/curl: fix build w/ USE='gnutls openssl'
    
    Closes: https://bugs.gentoo.org/887833
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/curl/curl-7.87.0.ebuild                   | 16 +++++----
 .../files/curl-7.87.0-gnutls-openssl-build.patch   | 39 ++++++++++++++++++++++
 2 files changed, 48 insertions(+), 7 deletions(-)