Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
5e999a65d3
!8 update libesmtp to 1.1.0
From: @XWwalker 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2023-08-09 03:19:03 +00:00
xingwei
9ce978f339 update libesmtp to 1.1.0 2023-08-09 02:33:12 +00:00
openeuler-ci-bot
bafa1f3ff8 !7 fix source0 url
From: @lunankun
Reviewed-by: @wangxp006
Signed-off-by: @wangxp006
2020-09-15 17:25:36 +08:00
lunankun
8006115729 fix source0 url 2020-09-11 09:54:41 +08:00
openeuler-ci-bot
60029eec40 !5 update yaml file
Merge pull request !5 from yixiangzhike/master
2020-07-06 20:13:59 +08:00
yixiangzhike
1ef0b4b0bc add yaml file 2020-07-06 17:54:00 +08:00
openeuler-ci-bot
7efa59198a !3 add yaml file
Merge pull request !3 from yixiangzhike/master
2020-07-02 22:54:40 +08:00
yixiangzhike
bbbf13b1dd add yaml file 2020-06-12 18:07:42 +08:00
openeuler-ci-bot
5261333412 !1 fix CVE-2019-19977
Merge pull request !1 from Vchanger/master
2020-04-20 14:54:17 +08:00
Vchanger
14d3517f17 libesmtp: fix CVE-2019-19977 2020-04-20 14:39:15 +08:00
6 changed files with 128 additions and 57 deletions

89
backport-add_ntlm.patch Normal file
View File

@ -0,0 +1,89 @@
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

@ -1,14 +0,0 @@
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"
], [

Binary file not shown.

BIN
libesmtp-1.1.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,15 +1,15 @@
%define plugindir %{_libdir}/esmtp-plugins
%define so_ver 6.2.0
Name: libesmtp
Version: 1.0.6
Release: 18
Version: 1.1.0
Release: 1
Summary: A library for posting electronic mail
License: LGPLv2+
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
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
%description
%{name} is an SMTP client which manages posting (or submission of) electronic
@ -29,35 +29,11 @@ applications that want to make use of %{name}.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1
autoreconf -fi
chmod a-x htable.c
%autosetup -n libESMTP-%{version} -p1
%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
%meson
%meson_build
cat << "EOF" > %{name}-config
#! /bin/sh
@ -65,8 +41,8 @@ exec pkg-config "$@" libesmtp
EOF
%install
%make_install
install -p -m 644 -D %{name}.pc %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
%meson_install
install -p -m 755 -D %{name}-config %{buildroot}%{_bindir}/%{name}-config
%delete_la
@ -74,25 +50,41 @@ install -p -m 644 -D %{name}.pc %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
%files
%defattr(-,root,root)
%license COPYING COPYING.LIB
%doc AUTHORS
%{_libdir}/%{name}.so.*
%{plugindir}
%license LICENSE
%{_libdir}/esmtp-plugins-%{so_ver}
%{_libdir}/libesmtp.so.%{so_ver}
%files devel
%defattr(-,root,root)
%doc examples
%{_bindir}/%{name}-config
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/%{name}.a
%{_libdir}/pkgconfig/libesmtp-1.0.pc
%{_prefix}/include/*.h
%files help
%defattr(-,root,root)
%doc NEWS Notes README
%doc README.md docs/*
%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

4
libesmtp.yaml Normal file
View File

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