Closed mbStavola closed 6 years ago
Additionally, here are some relevant lines from the Dockerfile:
FROM debian:stretch
RUN apt-get -y update && \
apt-get -y install \
acl \
git \
curl \
build-essential \
libsodium-dev \
libcurl4-openssl-dev \
libxml2-dev \
pkg-config \
adduser \
debianutils \
libacl1 \
libcap2 \
libmemcached11 \
libmemcachedutil2 \
libncurses5 \
libpam-runtime \
libpam0g \
libpcre3 \
libtinfo5 \
libwrap0 \
lsb-base \
netbase \
sed \
ucf \
zlib1g \
openssl \
openbsd-inetd \
libssl-dev \
default-libmysqlclient-dev
RUN cd proftpd && ./configure --enable-openssl --enable-ctrls \
--with-includes=/usr/include/libxml2 \
--with-libraries=/usr/lib \
--with-modules=mod_vroot:mod_case:mod_unique_id:mod_ban:mod_tls:mod_sftp:mod_sql:mod_sql_mysql:mod_sql_passwd:mod_sftp_sql:mod_aws \
&& make \
&& make install
If there's anything else I could provide, I'd be more than happy to do so.
Hmm. There were some mod_sftp changes needed for OpenSSL-1.1.x; you might see if using the latest proftpd source code, from the master branch, behaves any better.
Checked out master, same issue unfortunately.
Not super familiar with the codebase (or really C either), but I tried patching cipher.c
with the assumption that this might be the problem (even though it should be fixed...?). Gets a little further than before after adjusting L475 and L664, but then breaks down because the client payload is too large?
Additionally, it seems that on master environment variable substitutions in config files don't work as they do in 1.3.6? I didn't see anything about this in RELEASE_NOTES
, should I report this as a separate issue?
For the environment variable issue, please do open a separate ticket/issue for that.
Looks like OpenSSL Issue #4347 is indeed the root cause here; I checked the OpenSSL 1.1.0f source and verified that it does not contain the fix; OpenSSL 1.1.0g does have the fix.
I think that the fix for ProFTPD here is to check for OpenSSL support for EVP_CipherInit_ex
, and use that instead of EVP_CipherInit
, if present; that is the preferred direction of OpenSSL, and per the bug report, EVP_CipherInit_ex
is not subject to this buggy behavior in OpenSSL 1.1.0f.
Awesome! Will verify shortly, going to fill out that separate issue for you regarding the environment variables.
It works! Thanks for all the help.
I assume this won't be backported to 1.3.6 since it's branched off of master?
Thanks for confirming that it works!
I was planning on backporting that change to the 1.3.6 branch, yes. I usually develop my PRs on master, than backport/cherry-pick the changes to the release branches as needed.
Merged to master, and backported to the 1.3.6 branch.
What I Did
Trying to connect to my local test server via SFTP using both Filezilla and Cyberduck, but neither succeeded.
Checking the
mod_sftp
logs, it seems as though there is some issue with OpenSSL? Seems related to https://github.com/proftpd/proftpd/issues/547.What I Expected/Wanted
Logging in.
ProFTPD Version and Configuration
I made an image for Docker where I built ProFTPD and select modules from source. Here is what I got:
OpenSSL version: OpenSSL 1.1.0f (25 May 2017) ProFTPD version: 1.3.6 @ 5d19bfa Modules:
We can also see that
mod_sftp
is usingOpenSSL 1.1.0f
when we check the logs on startup:ProFTPD config file:
(Apologies for the Frankenstein config file, I'm still finding my away around ProFTPD!)