Compare commits

..

No commits in common. "5e999a65d378f1935df2a5974f50d53bc535eb8e" and "885db6b94a868d70589e035dfa7ca39bfbac436e" have entirely different histories.

6 changed files with 57 additions and 128 deletions

View File

@ -1,89 +0,0 @@
From 1c304e7886a08fb56485e41614ff3f8685afb59d Mon Sep 17 00:00:00 2001
From: Jiaqing Zhao <jiaqing.zhao@intel.com>
Date: Tue, 8 Mar 2022 15:05:32 +0000
Subject: [PATCH] Add build option for NTLM support
Currently, NTLM plugin is built by default when openssl is available
and STARTTLS is enabled. But in libesmtp 1.0.6, there is a separate
build option. This commits adds the 'ntlm' option back. It's also
disabled by default.
Like 1.0.6, it will check openssl MD4 algorithm support as MD4 is
insecure and modern systems may drop MD4 support.
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
Reference:https://github.com/libesmtp/libESMTP/commit/1c304e7886a08fb56485e41614ff3f8685afb59d
Conflict:NA
---
meson.build | 13 ++++++++++---
meson_options.txt | 1 +
ntlm/meson.build | 2 +-
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 11d6ed8..d2a0e06 100644
--- a/meson.build
+++ b/meson.build
@@ -61,6 +61,7 @@ add_project_arguments(cc.get_supported_arguments(cflags), language: 'c')
################################################################################
dldep = cc.find_library('dl')
ssldep = dependency('openssl', version : '>=1.1.0', required : get_option('tls'))
+ntlmdep = dependency('openssl', version : '>=1.1.0', required : get_option('ntlm'))
threaddep = dependency('threads', required : get_option('pthreads'))
#XXX add test for libbind9.so
@@ -69,6 +70,7 @@ lwresdep = cc.find_library('lwres', required : get_option('lwres'))
deps = [
dldep,
ssldep,
+ ntlmdep,
threaddep,
lwresdep,
]
@@ -237,8 +239,12 @@ include_dir = include_directories('.')
subdir('login')
subdir('plain')
subdir('crammd5')
-if ssldep.found()
- subdir('ntlm')
+if ntlmdep.found()
+ if cc.has_header('openssl/md4.h') and cc.has_function('MD4_Init', dependencies : ntlmdep)
+ subdir('ntlm')
+ else
+ error('MD4 is not supported in current openssl, unable to build NTLM plugin')
+ endif
endif
################################################################################
@@ -264,4 +270,5 @@ summary({'current:revision:age': libesmtp_cra,
'STARTTLS': ssldep.found(),
'CHUNKING': get_option('bdat'),
'ETRN': get_option('etrn'),
- 'XUSR': get_option('xusr')})
+ 'XUSR': get_option('xusr'),
+ 'NTLM': ntlmdep.found()})
diff --git a/meson_options.txt b/meson_options.txt
index 8375e2c..158f38f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,3 +5,4 @@ option('lwres', type : 'feature', value : 'disabled', description : 'use lwres l
option('bdat', type : 'boolean', value : 'true', description : 'enable SMTP BDAT extension')
option('etrn', type : 'boolean', value : 'true', description : 'enable SMTP ETRN extension')
option('xusr', type : 'boolean', value : 'true', description : 'enable sendmail XUSR extension')
+option('ntlm', type : 'feature', value : 'disabled', description : 'build with support for NTLM authentication')
diff --git a/ntlm/meson.build b/ntlm/meson.build
index e0eef58..11d7f58 100644
--- a/ntlm/meson.build
+++ b/ntlm/meson.build
@@ -5,7 +5,7 @@ sasl_ntlm_sources = [
'ntlmstruct.c',
]
-ntlm_deps = [ ssldep, ]
+ntlm_deps = [ ntlmdep, ]
sasl_ntlm = shared_module('ntlm', sasl_ntlm_sources,
name_prefix : 'sasl-',

View File

@ -0,0 +1,14 @@
diff --git a/configure.ac b/configure.ac
index 556f220..2c0693d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,7 +303,7 @@ if test x$with_openssl != xno ; then
)
fi
if test x$with_openssl != xno ; then
- AC_CHECK_LIB(ssl, SSL_library_init, [
+ AC_CHECK_LIB(ssl, SSL_new, [
with_openssl=yes
LIBS="-lssl -lcrypto $LIBS"
], [

BIN
libesmtp-1.0.6.tar.bz2 Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,15 +1,15 @@
%define so_ver 6.2.0
%define plugindir %{_libdir}/esmtp-plugins
Name: libesmtp
Version: 1.1.0
Release: 1
Version: 1.0.6
Release: 18
Summary: A library for posting electronic mail
License: LGPLv2+
URL: https://libesmtp.github.io/
Source: https://github.com/libesmtp/libESMTP/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: backport-add_ntlm.patch
BuildRequires: gcc openssl-devel pkgconfig meson >= 0.50.0 libtool
URL: https://www.stafford.uklinux.net/%{name}/
Source: https://www.stafford.uklinux.net/%{name}/%{name}-%{version}.tar.bz2
Patch0: libesmtp-1.0.6-openssl-1.1.patch
BuildRequires: gcc openssl-devel pkgconfig autoconf automake libtool
%description
%{name} is an SMTP client which manages posting (or submission of) electronic
@ -29,11 +29,35 @@ applications that want to make use of %{name}.
%package_help
%prep
%autosetup -n libESMTP-%{version} -p1
%autosetup -n %{name}-%{version} -p1
autoreconf -fi
chmod a-x htable.c
%build
%meson
%meson_build
if pkg-config openssl ; then
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS `pkg-config --cflags openssl`"
export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
fi
%configure --with-auth-plugin-dir=%{plugindir} --enable-pthreads \
--enable-require-all-recipients --enable-debug \
--enable-etrn --disable-isoc --disable-more-warnings
make %{?_smp_mflags}
cat << "EOF" > %{name}.pc
prefix=%{_prefix}
exec_prefix=%{_prefix}
libdir=%{_libdir}
includedir=%{_includedir}
Name: libESMTP
Version: %{version}
Description: SMTP client library.
Requires: openssl
Libs: -pthread -L${libdir} -lesmtp
Cflags:
EOF
cat << "EOF" > %{name}-config
#! /bin/sh
@ -41,8 +65,8 @@ exec pkg-config "$@" libesmtp
EOF
%install
%meson_install
install -p -m 755 -D %{name}-config %{buildroot}%{_bindir}/%{name}-config
%make_install
install -p -m 644 -D %{name}.pc %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
%delete_la
@ -50,41 +74,25 @@ install -p -m 755 -D %{name}-config %{buildroot}%{_bindir}/%{name}-config
%files
%defattr(-,root,root)
%license LICENSE
%{_libdir}/esmtp-plugins-%{so_ver}
%{_libdir}/libesmtp.so.%{so_ver}
%license COPYING COPYING.LIB
%doc AUTHORS
%{_libdir}/%{name}.so.*
%{plugindir}
%files devel
%defattr(-,root,root)
%doc examples
%{_bindir}/%{name}-config
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/libesmtp-1.0.pc
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/%{name}.a
%{_prefix}/include/*.h
%files help
%defattr(-,root,root)
%doc README.md docs/*
%doc NEWS Notes README
%changelog
* Fri Aug 04 2023 xingwei <xingwei14@h-partners.com> - 1.1.0-1
- Type:requirements
- ID:NA
- SUG:NA
- DESC:update libesmtp to 1.1.0
* Fri Sep 11 2020 lunankun <lunankun@huawei.com> - 1.0.6-20
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix source0 url
* Mon Apr 20 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.0.6-19
- Type:cves
- ID:CVE-2019-19977
- SUG:NA
- DESC:remove ntlm_build_type_2() to fix CVE-2019-19977
* Mon Oct 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.0.6-18
- Type:enhancement
- Id:NA

View File

@ -1,4 +0,0 @@
version_control: github
src_repo: libesmtp/libESMTP
tag_prefix: ^v
seperator: .