Mail Archives: djgpp/2015/01/11/00:41:52
This is a port of OpenSSL 1.0.1k to MSDOS/DJGPP.
The OpenSSL Project is an Open Source toolkit implementing the Secure Sockets
Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as
a full-strength general purpose cryptography library. OpenSSL is based on
the excellent SSLeay library developed from Eric A. Young and Tim J. Hudson.
The OpenSSL toolkit is licensed under a dual-license (the OpenSSL license
plus the SSLeay license) situation, which basically means that you are free
to get and use it for commercial and non-commercial purposes as long as you
fulfill the conditions of both licenses.
DJGPP specific changes.
=======================
Fortunately, OpenSSL supports DJGPP out-of-the-box so there is no need to
adjust the source code itself. Neitherless there are assumptions made about
the file system used and its capabilities that require some changes in the
perl configuration scripts and in the way source package is unzipped.
- all new DJGPP specific files are store in the /djgpp directory.
- to install, configure and compile the sources LFN support is required.
- all links (linked files) in the archive have been removed. Depending on if
djtar or tar is used and depending on if they are from DJGPP 2.03 or 2.04
all these tar programs create different kind of files to represent those
links and this breaks either the configuration step or later the building
step.
- the /djgpp directory contains unpack.sh. This small shell script uses
djtar to create a file list of the archive, identifies the links, extract
the sources using djtar and removes all links. Of course, if you download
the DJGPP port all this has already been done.
- as usual the /djgpp directory contains also the diffs file. It shows how
I have changed some of the perl scripts used during the configuration and
building steps to check for the OS used and to copy the files instead of
trying to create links even if this is possible.
- the binaries, headers and libraries will be installed in the corresponding
directories of the DJGPP installation tree. All documentation will be
installend in /dev/env/DJDIR/share/ssl/man. This means that you will have
to adjust your MANPATH in djgpp.env if you want that the man program finds
these new manpages.
- to be able to configure and compile this port, the DJGPP port of perl must
be installed. openssl uses a mix of perl scripts and Makefiles to configure
and compile the sources. I have used perl588b but the previous one may work
as well but I have never tested this.
- to be able to configure and compile this port, the DJGPP port of WATT32
must be installed. It can be downloaded as:
ftp://ftp.delorie.com/pub/djgpp/current/v2tk/wat3222br3.zip
or:
ftp://ftp.delorie.com/pub/djgpp/beta/v2tk/wat3222br3.zip
As usual the version from the /current directory is for the use with
djdev203 and the one from the /beta directory is for the use with djdev204.
After having installed the port make sure that the WATT_ROOT environment
variable points to the directory where the headers and the library reside.
This is:
set WATT_ROOT=/dev/env/DJDIR/net/watt
Due to the dependency of WATT-32 and the required value of the WATT_ROOT
environment variable, the source package is not configured at all. You
have to install WATT-32 first and then you can configure and build openssl
as described in the original INSTALL.DJGPP file.
- the port has been configured and compiled to support for zlib compression.
The zlib port used is
ftp://ftp.delorie.com/pub/djgpp/current/v2tk/zlib128b.zip
or:
ftp://ftp.delorie.com/pub/djgpp/beta/v2tk/zlib128b.zip
but any other version of the port may work as well. As usual the version
from the /current directory is for the use with djdev203 and the one from
the /beta directory is for the use with djdev204.
- the test suite passes for both djdev203 and djdev204 except for the last
test that requires some certificate that needs to be requested. For some
test, it is also required that the port of GNU bc is installed.
- the binary package of openssl ist not completely SFN clean. But this
concerns the manpages only. Neither the libraries nor the headers are
affected. I do not have the time to invent SFN clean names for hundreds
of manpages which names may change and become useless with the next openssl
update. Of course, the headers and libraries are 8.3 clean and the use of
the libraries do not require LFN support at all.
- as any cryptographic software, openssl needs a source of unpredictable data
to work correctly. Many open source operating systems provide a "randomness
device" (/dev/urandom or /dev/random) that serves this purpose. As of
version 0.9.7f of openssl the DJGPP port checks upon /dev/urandom$ for a
3rd party "randomness" DOS driver. One such driver, NOISE.SYS, can be
obtained from "http://www.rahul.net/dkaufman/index.html" as:
<http://www.rahul.net/dkaufman/noise063a2.zip>
Please read the instructions carefully. This driver works on DOS and may
be on some versions of Windows but it does not work for all versions of
Windows. For XP it does not work and I have found no replacement. This
means that for WinXP and probably for Win2K there is there is no "randomness"
support for openssl available.
- most but not all programs of the /examples directory can be successfully
compiled but they may not work. I have no intention to fix them, neither
less they may serve as example how to use the library and how to compile
and link your application with this library together with the WAT32 library
and the zlib library.
- The port has been configured and compiled on WinXP SP3. There is no
guarantee that this may be possible with any other DOS-like OS. Due
to the massive use of long file names it will not be possible to configure
and compile without LFN support.
- The DJGPP 2.03 version of the port has been compiled using gcc473 and
bnu225. The DJGPP 2.04 version of the port has been compiled using
gcc492 and bnu225. But instead of using the libc.a provided djdev204,
a libc version compiled from the repository code has been used.
The repository code has been patched with the memory patch as provided by
Andris Pavenis in:
http://ap1.pp.fi/djgpp/djdev/djgpp/20140421/use_nmalloc.diff
The goal is to test how well the new memory system and the current libc
code works. The repository code can be downloaded from Martin Strömberg's
site as:
http://www.ludd.luth.se/~ams/djgpp/cvs/djgpp.cvs.tar.gz
Configuring, compiling and running the test suite takes around 01:30 h.
For further information about OpenSSL please read the man pages,
various README files and NEWS file. Also visit the home page of openssl.
Please note that I am not an user of openssl. I have only ported it because
I needed it to create another port. This means that I am not able to answer
openssl specific questions.
This is an verbatim extract of the CHANGES file:
-------------------------------------------------------------------------------
Changes between 1.0.1j and 1.0.1k [8 Jan 2015]
*) Fix DTLS segmentation fault in dtls1_get_record. A carefully crafted DTLS
message can cause a segmentation fault in OpenSSL due to a NULL pointer
dereference. This could lead to a Denial Of Service attack. Thanks to
Markus Stenberg of Cisco Systems, Inc. for reporting this issue.
(CVE-2014-3571)
[Steve Henson]
*) Fix DTLS memory leak in dtls1_buffer_record. A memory leak can occur in the
dtls1_buffer_record function under certain conditions. In particular this
could occur if an attacker sent repeated DTLS records with the same
sequence number but for the next epoch. The memory leak could be exploited
by an attacker in a Denial of Service attack through memory exhaustion.
Thanks to Chris Mueller for reporting this issue.
(CVE-2015-0206)
[Matt Caswell]
*) Fix issue where no-ssl3 configuration sets method to NULL. When openssl is
built with the no-ssl3 option and a SSL v3 ClientHello is received the ssl
method would be set to NULL which could later result in a NULL pointer
dereference. Thanks to Frank Schmirler for reporting this issue.
(CVE-2014-3569)
[Kurt Roeckx]
*) Abort handshake if server key exchange message is omitted for ephemeral
ECDH ciphersuites.
Thanks to Karthikeyan Bhargavan of the PROSECCO team at INRIA for
reporting this issue.
(CVE-2014-3572)
[Steve Henson]
*) Remove non-export ephemeral RSA code on client and server. This code
violated the TLS standard by allowing the use of temporary RSA keys in
non-export ciphersuites and could be used by a server to effectively
downgrade the RSA key length used to a value smaller than the server
certificate. Thanks for Karthikeyan Bhargavan of the PROSECCO team at
INRIA or reporting this issue.
(CVE-2015-0204)
[Steve Henson]
*) Fixed issue where DH client certificates are accepted without verification.
An OpenSSL server will accept a DH certificate for client authentication
without the certificate verify message. This effectively allows a client to
authenticate without the use of a private key. This only affects servers
which trust a client certificate authority which issues certificates
containing DH keys: these are extremely rare and hardly ever encountered.
Thanks for Karthikeyan Bhargavan of the PROSECCO team at INRIA or reporting
this issue.
(CVE-2015-0205)
[Steve Henson]
*) Ensure that the session ID context of an SSL is updated when its
SSL_CTX is updated via SSL_set_SSL_CTX.
The session ID context is typically set from the parent SSL_CTX,
and can vary with the CTX.
[Adam Langley]
*) Fix various certificate fingerprint issues.
By using non-DER or invalid encodings outside the signed portion of a
certificate the fingerprint can be changed without breaking the signature.
Although no details of the signed portion of the certificate can be changed
this can cause problems with some applications: e.g. those using the
certificate fingerprint for blacklists.
1. Reject signatures with non zero unused bits.
If the BIT STRING containing the signature has non zero unused bits reject
the signature. All current signature algorithms require zero unused bits.
2. Check certificate algorithm consistency.
Check the AlgorithmIdentifier inside TBS matches the one in the
certificate signature. NB: this will result in signature failure
errors for some broken certificates.
Thanks to Konrad Kraszewski from Google for reporting this issue.
3. Check DSA/ECDSA signatures use DER.
Reencode DSA/ECDSA signatures and compare with the original received
signature. Return an error if there is a mismatch.
This will reject various cases including garbage after signature
(thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS
program for discovering this case) and use of BER or invalid ASN.1 INTEGERs
(negative or with leading zeroes).
Further analysis was conducted and fixes were developed by Stephen Henson
of the OpenSSL core team.
(CVE-2014-8275)
[Steve Henson]
*) Correct Bignum squaring. Bignum squaring (BN_sqr) may produce incorrect
results on some platforms, including x86_64. This bug occurs at random
with a very low probability, and is not known to be exploitable in any
way, though its exact impact is difficult to determine. Thanks to Pieter
Wuille (Blockstream) who reported this issue and also suggested an initial
fix. Further analysis was conducted by the OpenSSL development team and
Adam Langley of Google. The final fix was developed by Andy Polyakov of
the OpenSSL core team.
(CVE-2014-3570)
[Andy Polyakov]
*) Do not resume sessions on the server if the negotiated protocol
version does not match the session's version. Resuming with a different
version, while not strictly forbidden by the RFC, is of questionable
sanity and breaks all known clients.
[David Benjamin, Emilia Käsper]
*) Tighten handling of the ChangeCipherSpec (CCS) message: reject
early CCS messages during renegotiation. (Note that because
renegotiation is encrypted, this early CCS was not exploitable.)
[Emilia Käsper]
*) Tighten client-side session ticket handling during renegotiation:
ensure that the client only accepts a session ticket if the server sends
the extension anew in the ServerHello. Previously, a TLS client would
reuse the old extension state and thus accept a session ticket if one was
announced in the initial ServerHello.
Similarly, ensure that the client requires a session ticket if one
was advertised in the ServerHello. Previously, a TLS client would
ignore a missing NewSessionTicket message.
[Emilia Käsper]
-------------------------------------------------------------------------------
The port has been compiled using stock djdev203 (patchlevel 2) and consists
of two packages that can be downloaded from ftp.delorie.com and mirrors as
(time stamp 2015-01-09):
OpenSSL 1.0.1k binary, headers, libraries and man format documentation:
ftp://ftp.delorie.com/pub/djgpp/current/v2tk/ssl101kb.zip
OpenSSL 1.0.1k source:
ftp://ftp.delorie.com/pub/djgpp/current/v2tk/ssl101ks.zip
The binaries and library have been produced a second time using a libc.a
version compiled from current repository code and patched with the new
malloc code. This package is available at ftp.delorie.com and mirrors
as (times tamp 2015-01-09):
OpenSSL 1.0.1k binary, headers, libraries and man format documentation:
ftp://ftp.delorie.com/pub/djgpp/current/v2tk/ssl101kb.zip
Send openssl specific bug reports to <openssl-bugs AT openssl DOT org>.
Send suggestions and bug reports concerning the DJGPP port to
comp.os.msdos.djgpp or <djgpp AT delorie DOT com>.
If you are not sure if the failure is really a openssl failure
or a djgpp specific failure, report it here and *not* to
<openssl-bugs AT openssl DOT org>.
Enjoy.
Guerrero, Juan Manuel <juan DOT guerrero AT gmx DOT de>
- Raw text -