Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 673986 - mail-mta/sendmail-8.14.9-r1 - tls.c: error: dereferencing pointer to incomplete type ‘‘DH’ {aka ‘struct dh_st’} and X509_STORE_CTX’ {aka ‘struct x509_store_ctx_st’}
Summary: mail-mta/sendmail-8.14.9-r1 - tls.c: error: dereferencing pointer to incomple...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: openssl-1.1
  Show dependency tree
 
Reported: 2018-12-29 14:39 UTC by Juergen Rose
Modified: 2019-07-15 05:11 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,82.49 KB, text/plain)
2018-12-29 14:39 UTC, Juergen Rose
Details
sendmail-8.15.2.ebuild (sendmail-8.15.2.ebuild,7.14 KB, text/plain)
2019-01-10 07:27 UTC, Attila Tóth
Details
sendmail-8.14.8-sasl2-in-etc.patch (sendmail-8.14.8-sasl2-in-etc.patch,947 bytes, patch)
2019-01-10 07:28 UTC, Attila Tóth
Details | Diff
sendmail-8.15.2-openssl-1.1.0-ecdhe-fix.patch (sendmail-8.15.2-openssl-1.1.0-ecdhe-fix.patch,571 bytes, patch)
2019-01-10 07:29 UTC, Attila Tóth
Details | Diff
sendmail-8.15.2-openssl-1.1.0-fix.patch (sendmail-8.15.2-openssl-1.1.0-fix.patch,4.46 KB, patch)
2019-01-10 07:29 UTC, Attila Tóth
Details | Diff
sendmail-8.15.2-smtp-session-reuse-fix.patch (sendmail-8.15.2-smtp-session-reuse-fix.patch,5.76 KB, patch)
2019-01-10 07:30 UTC, Attila Tóth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2018-12-29 14:39:37 UTC
Created attachment 558818 [details]
build.log

'MAKEOPTS=-j1 emerge -v1 sendmail' fails with:
...
x86_64-pc-linux-gnu-gcc -O2 -I. -I../../include  -DNEWDB -DMAP_REGEX -DLDAPMAP  -DSASL=2 -DTCPWRAPPERS -DSTARTTLS -D_FFR_DEAL_WITH_ERROR_SSL -D_FFR_TLS_1 -DNETINET6 -DSOCKETMAP  -march=broadwell -O2 -pipe -I/usr/include/sasl     -c -o tls.o tls.c
tls.c: In function ‘get_dh512’:
tls.c:70:4: error: dereferencing pointer to incomplete type ‘DH’ {aka ‘struct dh_st’}
  dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
    ^~
tls.c: In function ‘inittls’:
tls.c:751:22: warning: implicit declaration of function ‘BIO_s_file_internal’; did you mean ‘BIO_s_file’? [-Wimplicit-function-declaration]
   crl_file = BIO_new(BIO_s_file_internal());
                      ^~~~~~~~~~~~~~~~~~~
                      BIO_s_file
tls.c:751:22: warning: passing argument 1 of ‘BIO_new’ makes pointer from integer without a cast [-Wint-conversion]
   crl_file = BIO_new(BIO_s_file_internal());
                      ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/ssl.h:48,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/bio.h:535:6: note: expected ‘const BIO_METHOD *’ {aka ‘const struct bio_method_st *’} but argument is of type ‘int’
 BIO *BIO_new(const BIO_METHOD *type);
      ^~~~~~~
tls.c:829:6: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
      (rsa_tmp = RSA_generate_key(RSA_KEYLENGTH, RSA_F4, NULL,
      ^
In file included from /usr/include/openssl/opensslconf.h:10,
                 from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:45,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/rsa.h:193:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
tls.c:1024:4: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
    dsa = DSA_generate_parameters(bits, NULL, 0, NULL,
    ^~~
In file included from /usr/include/openssl/opensslconf.h:10,
                 from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:45,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/dsa.h:122:1: note: declared here
 DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
 ^~~~~~~~~~~~~~~~~~
tls.c: In function ‘tls_get_info’:
tls.c:1242:4: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  s = SSL_CIPHER_get_version(c);
    ^
tls.c: In function ‘tmp_rsa_key’:
tls.c:1529:2: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
  rsa_tmp = RSA_generate_key(RSA_KEYLENGTH, RSA_F4, NULL, NULL);
  ^~~~~~~
In file included from /usr/include/openssl/opensslconf.h:10,
                 from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:45,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/rsa.h:193:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
tls.c: In function ‘x509_verify_cb’:
tls.c:1768:10: error: dereferencing pointer to incomplete type ‘X509_STORE_CTX’ {aka ‘struct x509_store_ctx_st’}
   if (ctx->error == X509_V_ERR_UNABLE_TO_GET_CRL)
          ^~
make: *** [<builtin>: tls.o] Error 1



root@lynx:/usr/local/portage/dev-java/jython(94)# emerge --info '=mail-mta/sendmail-8.14.9-r1::gentoo'
Portage 2.3.53 (python 3.6.6-final-0, default/linux/amd64/17.0/desktop, gcc-8.2.0, glibc-2.28-r4, 4.20.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.20.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-6700HQ_CPU_@_2.60GHz-with-gentoo-2.6
KiB Mem:    15904032 total,   2803696 free
KiB Swap:   50331644 total,  50230616 free
Timestamp of repository gentoo: Sat, 29 Dec 2018 10:30:01 +0000
Head commit of repository gentoo: 8487d4215c53e191bf3b88e821c1ecc4dc7324e2
sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
distcc[19969] (dcc_trace_version) distcc 3.3.2 x86_64-pc-linux-gnu; built Dec 10 2018 00:43:48 [disabled]
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15-r100::sage-on-gentoo, 3.6.6::gentoo, 3.7.0::gentoo
dev-util/cmake:           3.11.4-r1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.14::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r3::gentoo
sys-devel/gcc:            8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r4::gentoo
Repositories:

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

haskell
    location: /var/lib/layman/haskell
    masters: gentoo
    priority: 0

local
    location: /usr/local/portage
    masters: gentoo
    priority: 1

g-cpan
    location: /var/lib/cpan
    masters: gentoo
    priority: 2

ago
    location: /var/lib/layman/ago
    masters: gentoo
    priority: 50

imaging
    location: /var/lib/layman/imaging
    masters: gentoo
    priority: 50

octave
    location: /var/lib/layman/octave
    masters: gentoo
    priority: 50

sage-on-gentoo
    location: /var/lib/layman/sage-on-gentoo
    masters: gentoo science
    priority: 50

science
    location: /var/lib/layman/science
    masters: gentoo
    priority: 50

tlp
    location: /var/lib/layman/tlp
    masters: gentoo
    priority: 50

torbrowser
    location: /var/lib/layman/torbrowser
    masters: gentoo
    priority: 50

x11
    location: /var/lib/layman/x11
    masters: gentoo
    priority: 50

Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL Intel-SDP dlj-1.1 skype-eula skype-4.0.0.7-copyright googleearth AdobeFlash-11.x cadsoft Oracle-BCLA-JavaSE MakeMKV-EULA NVIDIA-CUDA Nero-AAC-EULA GIMPS"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=broadwell -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=broadwell -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=broadwell -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en fr ru"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
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"
USE="64bit R X Xaw3d a52 aac acl acpi admin afs alsa amd64 amr ao apache2 apng applet archive armadillo arpack asf aspell assistant atlas audacious audiofile aufs automap automount barcode bash-completion berkdb blas blast bluetooth bluray boost branding btrfs bzip2 cairo cdda cddb cdf cdio cdparanoia cdr cgi chm cilk clang cli cmake collada consolekit contrib crypt css cups curl cxx daap db dbi dbm dbus declarative designer devhelp device-mapper dga dia digitalradio djvu doc dot dri ds2490 ds9097 ds9097u dts dv dvb dvd dvdr dvi dynamicplugin eds egl elf emacs emboss emf encode epiphany evdev evo examples excel exif expat extensions extra extras faac faad fam ffmpeg fftw firefox fits flac fltk fontconfig foomaticdb fortran fortran95 fpm fpx ftp fuse gcj gd gdal gdbm gedit geoip geolocation geos gfortran gif gimp git glade glamor glib glpk gml gmp gnome gnome-keyring gnuplot gnutls gold gphoto2 gpm grammar graphics graphtft graphviz grass gsl gsm gstreamer gtk gtk3 gudev guile hdaps hddtemp hdf hdf5 hdri html http httpd hvm hwdb iconv icq icu id3tag ide imagemagick imap initramfs inotify introspection ipod ipv6 irda ithreads jadetex java jbig jit john jpeg jpeg2k kate kde kdepim kdrive kerberos keymap kpathsea kvm ladspa lame lapack latex lcms ldap lensfun libffi libgda libkms libnotify libsamplerate libtirpc live lm_sensors lua lzma lzo mad mail maildir mapnik math matroska media-library mercurial mikmod mng mod mono motif mozilla mp3 mp4 mpeg mpi mpi-threads mplayer mtp multilib multimedia musepack musicbrainz mysql mysqli nautilus ncurses neXt netcdf netpbm network networking nfs nls nntp nptl nsplugin ntfs ntp numpy obex objc ocaml ocr octave odbc ofa ogdi ogg opencv openexr opengl openmp openvg pam pango pcre pda pdf pdl2 perl plasma plotutils plugins png podcast policykit portaudio posix postgres postscript ppds ppp preview-latex proj projectm pstricks pulseaudio python q16 q32 qemu qhull qml qt5 quicktime raw readline reiserfs reports rle romio rpc rrdcgi rrdtool rtlsdr sage samba sasl schroedinger science sdk sdl seccomp secure-delete server session shout sip slang slp smart smbclient smp sms sndfile snmp soap sockets sound soup sox speex spell sql sqlite ssl startup-notification stlport subtitles subversion sudo suexec svg svm swig systemd szip t1lib tbb tcl tcpd tex tex4ht theora thesaurus thinkpad threads thunderbird tidy tiff tk tools truetype udev udisks unicode upower usb utempter v4l v4l2 vaapi vala valgrind vdpau video vim-syntax virt-network virtualbox visio vorbis vpx vtk wav wayland webdav webdav-serf webkit wifi wmf wxwidgets x264 x265 xa xattr xcb xen xetex xft xine xml xmlreader xmlrpc xpm xps xv xvid xvmc yaml youtube zlib zsh-completion zvbi" ABI_X86="64" ALSA_CARDS="intel8x0" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_core authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info lbmethod_byrequests log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif slotmem_shm so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon plan sheets stage words" CAMERAS="canon fuji ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog sensors thermal" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="aivdm ashtech earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 navcom ntrip oceanserver oncore rtcm104v2 rtcm104v3 sirf superstar2 tnt tripmate tsip ublox nmea0183 nmea2000 passthrough" GRUB_PLATFORMS="emu efi-64 pc xen" INPUT_DEVICES="keyboard mouse evdev synaptics void" KERNEL="linux" L10N="de en fr ru" LCD_DEVICES="cfontz framebuffer glcd hd44780 mtxorb ncurses X lcd2usb lcdlinux png usblcd SureElec" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="devinput" LLVM_TARGETS="NVPTX X86" NETBEANS_MODULES="apisupport cnd dlight enterprise ergonomics groovy gsf harness ide identity j2ee java mobility nb php profiler websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby23 ruby24" USERLAND="GNU" VIDEO_CARDS="nouveau displaylink" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

mail-mta/sendmail-8.14.9-r1::gentoo was built with the following:
USE="ipv6 ldap sasl sockets ssl tcpd -libressl -mbox -nis" ABI_X86="(64)"




root@lynx:/usr/local/portage/dev-java/jython(95)# emerge -pqv '=mail-mta/sendmail-8.14.9-r1::gentoo'
[ebuild   R   ] mail-mta/sendmail-8.14.9-r1  USE="ipv6 ldap sasl sockets ssl tcpd -libressl -mbox -nis"
Comment 1 Juergen Rose 2018-12-29 16:06:24 UTC
See also https://bugs.gentoo.org/674004 .


root@lynx:/usr/local/portage/dev-java/jython(107)# genlop -t openssl | tail

     Tue Nov 13 16:03:33 2018 >>> dev-libs/openssl-1.0.2p-r1
       merge time: 3 minutes and 51 seconds.

     Tue Nov 20 23:55:37 2018 >>> dev-libs/openssl-1.0.2q
       merge time: 3 minutes and 58 seconds.

     Sat Dec 29 02:58:38 2018 >>> dev-libs/openssl-1.1.0j
       merge time: 2 minutes and 35 seconds.

root@lynx:/usr/local/portage/dev-java/jython(108)# qlist -Iv openssl
dev-libs/openssl-1.1.0j
dev-python/pyopenssl-17.5.0
Comment 2 David Kredba 2019-01-05 09:53:30 UTC
At the snapshot of sendmail-8.16.0.29 authors
states in the file RELEASE_NOTES that:
8.16.1/8.16.1   201X/XX/XX
        ---
        OpenSSL versions before 0.9.8 are no longer supported.
        OpenSSL version 1.1.0 is supported.

I am going to give it a try.
Comment 3 David Kredba 2019-01-05 10:12:01 UTC
It needs small fixes from build system patch that does not apply itself. When the patch is not applied -ldb -lnsl -lresolv are missing at link time in the install phase and it want to install to /usr/adm folder.
Comment 4 David Kredba 2019-01-09 20:42:09 UTC
"-DNEWDB" is missing at the devtools/Site/site.config.m4 file. Without it makemap can't hash. Linking can be partially fixed there too by appending -ldb -lnsl -lresolv. Remaining are Makefiles of vacation, editmap, makemap, praliases and final re-link of editmap at emerge install stage where -ldb is missing.
Comment 5 Attila Tóth 2019-01-10 07:27:53 UTC
Created attachment 560594 [details]
sendmail-8.15.2.ebuild

Proposed sendmail-8.15.2.ebuild
Comment 6 Attila Tóth 2019-01-10 07:28:40 UTC
Created attachment 560596 [details, diff]
sendmail-8.14.8-sasl2-in-etc.patch

Source: https://aur.archlinux.org/packages/sendmail/
Comment 7 Attila Tóth 2019-01-10 07:29:16 UTC
Created attachment 560598 [details, diff]
sendmail-8.15.2-openssl-1.1.0-ecdhe-fix.patch

Source: https://aur.archlinux.org/packages/sendmail/
Comment 8 Attila Tóth 2019-01-10 07:29:52 UTC
Created attachment 560600 [details, diff]
sendmail-8.15.2-openssl-1.1.0-fix.patch

Source: https://aur.archlinux.org/packages/sendmail/
Comment 9 Attila Tóth 2019-01-10 07:30:27 UTC
Created attachment 560602 [details, diff]
sendmail-8.15.2-smtp-session-reuse-fix.patch

Source: https://aur.archlinux.org/packages/sendmail/
Comment 10 Juergen Rose 2019-01-19 12:25:30 UTC
Could anybody integrade the patches in the standard portage tree?
Comment 11 Arnim Eijkhoudt 2019-01-24 22:15:29 UTC
Please send this upstream into portage; it is currently blocking upgrades/rebuilds of sendmail!
Comment 12 Arnim Eijkhoudt 2019-02-20 11:31:19 UTC
Can we get the fix and new sendmail, please?
Comment 13 Arnim Eijkhoudt 2019-06-13 18:48:00 UTC
*bump*, please send the new version + patch upstream
Comment 14 Andreas Sturmlechner gentoo-dev 2019-06-27 17:33:04 UTC
This package has no maintainer. It depends on the patch author to send it upstream.
Comment 15 John Covici 2019-07-01 06:03:02 UTC
I successfully emerged the 8.15.2 ebuild after downloading all the patches, how can we get this into the official tree?  I am willing to help do this, depending what it entails.
Comment 16 Larry the Git Cow gentoo-dev 2019-07-13 08:58:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79dcc59215c5153cebc5b8c4c3e999f035045f69

commit 79dcc59215c5153cebc5b8c4c3e999f035045f69
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: 2019-07-13 08:57:43 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2019-07-13 08:58:12 +0000

    mail-mta/sendmail: add 8.15.2
    
    Fixes: https://bugs.gentoo.org/673986
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>
    Package-Manager: Portage-2.3.66, Repoman-2.3.11

 mail-mta/sendmail/Manifest               |   1 +
 mail-mta/sendmail/sendmail-8.15.2.ebuild | 206 +++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+)
Comment 17 Hans de Graaff gentoo-dev Security 2019-07-13 09:01:25 UTC
(In reply to Attila Tóth from comment #5)
> Created attachment 560594 [details]
> sendmail-8.15.2.ebuild
> 
> Proposed sendmail-8.15.2.ebuild

I have added the vanilla upstream sendmail 8.15.2. I have not included your patches because I could not properly review them, given my available time and that I'm not a maintainer or user of sendmail. My main concern is to fix compatibility with openssl 1.1.1 and sendmail 8.15.2 does that.

Please work with upstream instead to get changes incorporated there.
Comment 18 Arnim Eijkhoudt 2019-07-14 20:04:44 UTC
Unfortunately, 8.15.2 seems to fail with the exact same issue for me?

>>> Install mail-mta/sendmail-8.15.2 into /var/tmp/portage/mail-mta/sendmail-8.15.2/image/
make: Entering directory '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2/obj.Linux.5.1.15-gentoo.x86_64/libsmutil'
make: Nothing to be done for 'install'.
make: Leaving directory '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2/obj.Linux.5.1.15-gentoo.x86_64/libsmutil'
make: Entering directory '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2/obj.Linux.5.1.15-gentoo.x86_64/sendmail'
if [ ! -d "/var/tmp/portage/mail-mta/sendmail-8.15.2/image//etc/mail" ]; then mkdir -p "/var/tmp/portage/mail-mta/sendmail-8.15.2/image//etc/mail"; else :; fi
install -c -o root -g root -m 444 helpfile "/var/tmp/portage/mail-mta/sendmail-8.15.2/image//etc/mail/helpfile"
if [ ! -d "/var/tmp/portage/mail-mta/sendmail-8.15.2/image//etc/mail" ]; then mkdir -p "/var/tmp/portage/mail-mta/sendmail-8.15.2/image//etc/mail"; else :; fi
install -c -o root -g root -m 0600 statistics "/var/tmp/portage/mail-mta/sendmail-8.15.2/image//etc/mail/statistics"
x86_64-pc-linux-gnu-gcc -O2 -I. -I../../include  -DMAP_REGEX  -DSASL=2 -DTCPWRAPPERS -DSTARTTLS -D_FFR_DEAL_WITH_ERROR_SSL -D_FFR_TLS_1 -DNETINET6 -DSOCKETMAP  -march=native -O3 -pipe -fomit-frame-pointer -I/usr/include/sasl     -c -o tls.o tls.c
tls.c: In function ‘get_dh512’:
tls.c:70:4: error: dereferencing pointer to incomplete type ‘DH’ {aka ‘struct dh_st’}
   70 |  dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
      |    ^~
tls.c: In function ‘inittls’:
tls.c:929:22: warning: implicit declaration of function ‘BIO_s_file_internal’ [-Wimplicit-function-declaration]
  929 |   crl_file = BIO_new(BIO_s_file_internal());
      |                      ^~~~~~~~~~~~~~~~~~~
tls.c:929:22: warning: passing argument 1 of ‘BIO_new’ makes pointer from integer without a cast [-Wint-conversion]
  929 |   crl_file = BIO_new(BIO_s_file_internal());
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      |
      |                      int
In file included from /usr/include/openssl/ssl.h:48,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/bio.h:535:6: note: expected ‘const BIO_METHOD *’ {aka ‘const struct bio_method_st *’} but argument is of type ‘int’
  535 | BIO *BIO_new(const BIO_METHOD *type);
      |      ^~~~~~~
tls.c:1007:6: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
 1007 |      (rsa_tmp = RSA_generate_key(RSA_KEYLENGTH, RSA_F4, NULL,
      |      ^
In file included from /usr/include/openssl/opensslconf.h:10,
                 from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:45,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/rsa.h:193:1: note: declared here
  193 | DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
      | ^~~~~~~~~~~~~~~~~~
tls.c:1214:4: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
 1214 |    dsa = DSA_generate_parameters(bits, NULL, 0, NULL,
      |    ^~~
In file included from /usr/include/openssl/opensslconf.h:10,
                 from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:45,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/dsa.h:122:1: note: declared here
  122 | DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
      | ^~~~~~~~~~~~~~~~~~
tls.c: In function ‘tmp_rsa_key’:
tls.c:1748:2: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
 1748 |  rsa_tmp = RSA_generate_key(RSA_KEYLENGTH, RSA_F4, NULL, NULL);
      |  ^~~~~~~
In file included from /usr/include/openssl/opensslconf.h:10,
                 from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:45,
                 from ./sendmail.h:125,
                 from tls.c:11:
/usr/include/openssl/rsa.h:193:1: note: declared here
  193 | DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
      | ^~~~~~~~~~~~~~~~~~
tls.c: In function ‘x509_verify_cb’:
tls.c:1975:10: error: dereferencing pointer to incomplete type ‘X509_STORE_CTX’ {aka ‘struct x509_store_ctx_st’}
 1975 |   if (ctx->error == X509_V_ERR_UNABLE_TO_GET_CRL)
      |          ^~
make: *** [<builtin>: tls.o] Error 1
make: Leaving directory '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2/obj.Linux.5.1.15-gentoo.x86_64/sendmail'
 * ERROR: mail-mta/sendmail-8.15.2::gentoo failed (install phase):
 *   install failed
 * 
 * Call stack:
 *     ebuild.sh, line 125:  Called src_install
 *   environment, line 1587:  Called die
 * The specific snippet of code:
 *           make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root MANOWN=root MANGRP=root INCOWN=root INCGRP=root LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root MSPQOWN=root CFOWN=root CFGRP=root install -C "${MY_OBJDIR}/${dir}" || die "install failed";
 * 
 * If you need support, post the output of `emerge --info '=mail-mta/sendmail-8.15.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=mail-mta/sendmail-8.15.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/mail-mta/sendmail-8.15.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/mail-mta/sendmail-8.15.2/temp/environment'.
 * Working directory: '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2'
 * S: '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2'

>>> Failed to emerge mail-mta/sendmail-8.15.2, Log file:

>>>  '/var/tmp/portage/mail-mta/sendmail-8.15.2/temp/build.log'

 * Messages for package mail-mta/sendmail-8.15.2:

 * ERROR: mail-mta/sendmail-8.15.2::gentoo failed (install phase):
 *   install failed
 * 
 * Call stack:
 *     ebuild.sh, line 125:  Called src_install
 *   environment, line 1587:  Called die
 * The specific snippet of code:
 *           make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root MANOWN=root MANGRP=root INCOWN=root INCGRP=root LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root MSPQOWN=root CFOWN=root CFGRP=root install -C "${MY_OBJDIR}/${dir}" || die "install failed";
 * 
 * If you need support, post the output of `emerge --info '=mail-mta/sendmail-8.15.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=mail-mta/sendmail-8.15.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/mail-mta/sendmail-8.15.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/mail-mta/sendmail-8.15.2/temp/environment'.
 * Working directory: '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2'
 * S: '/var/tmp/portage/mail-mta/sendmail-8.15.2/work/sendmail-8.15.2'
Comment 19 Attila Tóth 2019-07-14 20:12:10 UTC
(In reply to Arnim Eijkhoudt from comment #18)
> Unfortunately, 8.15.2 seems to fail with the exact same issue for me?
> 
> >>> Install mail-mta/sendmail-8.15.2 into /var/tmp/portage/mail-mta/sendmail-8.15.2/image/

Hans de Graaff told he omitted unreviewed patches, however at least the one patch must be included to address the problem outlined by this bug:
sendmail-8.15.2-openssl-1.1.0-fix.patch
referenced in the 8th comment.
Comment 20 Hans de Graaff gentoo-dev Security 2019-07-15 05:11:26 UTC
(In reply to Attila Tóth from comment #19)
> (In reply to Arnim Eijkhoudt from comment #18)
> > Unfortunately, 8.15.2 seems to fail with the exact same issue for me?
> > 
> > >>> Install mail-mta/sendmail-8.15.2 into /var/tmp/portage/mail-mta/sendmail-8.15.2/image/
> 
> Hans de Graaff told he omitted unreviewed patches, however at least the one
> patch must be included to address the problem outlined by this bug:
> sendmail-8.15.2-openssl-1.1.0-fix.patch
> referenced in the 8th comment.

My testing was incomplete and I missed that sendmail also compiles code in the install phase which is where this error occurs. I have now reviewed this patch and added to the ebuild.
Comment 21 Larry the Git Cow gentoo-dev 2019-07-15 05:11:35 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ea0eb3d0c4f9085d7dcd4a333d5a094f9eae9a7

commit 1ea0eb3d0c4f9085d7dcd4a333d5a094f9eae9a7
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: 2019-07-15 05:09:51 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2019-07-15 05:10:38 +0000

    mail-mta/sendmail: fix openssl 1.1.x compatibility
    
    Patch provided by Attila Tóth.
    
    Fixes: https://bugs.gentoo.org/673986
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>
    Package-Manager: Portage-2.3.66, Repoman-2.3.11

 .../files/sendmail-8.15.2-openssl-1.1.0-fix.patch  | 182 ++++++++++++++++++
 mail-mta/sendmail/sendmail-8.15.2-r1.ebuild        | 207 +++++++++++++++++++++
 2 files changed, 389 insertions(+)