Compare commits
152 Commits
OpenSSL_1_
...
OpenSSL_1_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
55615e8d48 | ||
![]() |
56edb20184 | ||
![]() |
ac3dd9b7e6 | ||
![]() |
d8541d7e9e | ||
![]() |
b29ffa392e | ||
![]() |
005f4893dc | ||
![]() |
d585cc32a5 | ||
![]() |
fb35ea28f4 | ||
![]() |
41d049e1cd | ||
![]() |
98b94544e5 | ||
![]() |
844de56ed6 | ||
![]() |
784934498f | ||
![]() |
0b5f9ce37b | ||
![]() |
fc45da0535 | ||
![]() |
5844c9453f | ||
![]() |
88883f2ebf | ||
![]() |
638856f40c | ||
![]() |
a5184a6c89 | ||
![]() |
e71aab1c02 | ||
![]() |
b77390a2ff | ||
![]() |
78b9d13474 | ||
![]() |
e83009840a | ||
![]() |
84d0c40f3f | ||
![]() |
c8cc43108d | ||
![]() |
1fe1c65c3b | ||
![]() |
22ec08d7b7 | ||
![]() |
0f5fdb73d7 | ||
![]() |
9f82c7b3aa | ||
![]() |
200c8ed4f5 | ||
![]() |
a5524e534b | ||
![]() |
edd0f5c201 | ||
![]() |
020bc42893 | ||
![]() |
61587d65ea | ||
![]() |
71d5679cd3 | ||
![]() |
418c051161 | ||
![]() |
6a3dd58678 | ||
![]() |
2d404dc380 | ||
![]() |
b2593839da | ||
![]() |
bfc19297cd | ||
![]() |
978b5d709a | ||
![]() |
ec1f125512 | ||
![]() |
363c8fd572 | ||
![]() |
91dc4497de | ||
![]() |
11ca27c912 | ||
![]() |
a0ba92ccde | ||
![]() |
f141376ae2 | ||
![]() |
e4840c88c5 | ||
![]() |
67d4253174 | ||
![]() |
978c8aa8b7 | ||
![]() |
72ac982306 | ||
![]() |
b0c8e38e33 | ||
![]() |
64ec479559 | ||
![]() |
7794c355ea | ||
![]() |
dfa08ea750 | ||
![]() |
2bd918696b | ||
![]() |
456b9820eb | ||
![]() |
e56c77b8ee | ||
![]() |
6905187488 | ||
![]() |
9d1fcbebbc | ||
![]() |
21d8f24485 | ||
![]() |
f9394bd7a0 | ||
![]() |
b2a6718819 | ||
![]() |
34a0eade7f | ||
![]() |
2bc914eb29 | ||
![]() |
2ab1e7fde3 | ||
![]() |
628c15039f | ||
![]() |
a50a8a76dd | ||
![]() |
7ac2c47583 | ||
![]() |
76067c75fd | ||
![]() |
f95d1af064 | ||
![]() |
83fcd322f7 | ||
![]() |
12650153ec | ||
![]() |
8f42c34f8f | ||
![]() |
421baf1862 | ||
![]() |
8b5ac90e5e | ||
![]() |
4cb23e12a3 | ||
![]() |
dd642deea8 | ||
![]() |
927f7a8703 | ||
![]() |
525e13612e | ||
![]() |
5999b897ff | ||
![]() |
bae16c98c1 | ||
![]() |
9d4798a9e0 | ||
![]() |
246a010b78 | ||
![]() |
1915a22184 | ||
![]() |
a6ce498b2a | ||
![]() |
d46e946d26 | ||
![]() |
c88f65f5b5 | ||
![]() |
fc90ab42db | ||
![]() |
8d677c10f9 | ||
![]() |
cb5320014d | ||
![]() |
9a97446468 | ||
![]() |
80c25ba676 | ||
![]() |
eb55a6f455 | ||
![]() |
be8b8603d6 | ||
![]() |
86de216da3 | ||
![]() |
bedcd9385f | ||
![]() |
2507c8cfb3 | ||
![]() |
98e75c0b69 | ||
![]() |
2cf51451f3 | ||
![]() |
50e56c1d8c | ||
![]() |
2d17250368 | ||
![]() |
aa701624b1 | ||
![]() |
396e300449 | ||
![]() |
402634f8aa | ||
![]() |
b11980d79a | ||
![]() |
f15c99f4d4 | ||
![]() |
507ea77b82 | ||
![]() |
556803fc3d | ||
![]() |
1a9a506cfb | ||
![]() |
5030cc69ff | ||
![]() |
721cbae7e6 | ||
![]() |
372e74903e | ||
![]() |
728432aed0 | ||
![]() |
8e75dcf587 | ||
![]() |
396a2dc071 | ||
![]() |
001c957676 | ||
![]() |
2507d846e1 | ||
![]() |
432785095c | ||
![]() |
a027bba22a | ||
![]() |
13e742a439 | ||
![]() |
2794dec7b2 | ||
![]() |
2035e2db68 | ||
![]() |
be85620419 | ||
![]() |
b5e972fdd3 | ||
![]() |
a15ba3cca3 | ||
![]() |
7c17c20a56 | ||
![]() |
5ab53da9fb | ||
![]() |
245daa2b73 | ||
![]() |
cb22d2ae5a | ||
![]() |
b3b1eb5735 | ||
![]() |
d42d100433 | ||
![]() |
9a0db453ba | ||
![]() |
cb6e0ed17a | ||
![]() |
e5d5019a23 | ||
![]() |
d6be3124f2 | ||
![]() |
eb0e2a5c5d | ||
![]() |
0d25eb7800 | ||
![]() |
ae2f46597a | ||
![]() |
9ad2eb6a6e | ||
![]() |
f4961dc2af | ||
![]() |
40ced6c187 | ||
![]() |
f1817dd4d0 | ||
![]() |
5891dae67c | ||
![]() |
1d6d4efea5 | ||
![]() |
0fee334404 | ||
![]() |
141f7d263b | ||
![]() |
ae3254a52d | ||
![]() |
9720dd4314 | ||
![]() |
83d6620986 | ||
![]() |
347fc5d8cd | ||
![]() |
a5d8c1c291 | ||
![]() |
902795b2f1 |
22
.cvsignore
22
.cvsignore
@@ -1,22 +0,0 @@
|
||||
openssl.pc
|
||||
libcrypto.pc
|
||||
libssl.pc
|
||||
MINFO
|
||||
makefile.one
|
||||
tmp
|
||||
out
|
||||
outinc
|
||||
rehash.time
|
||||
testlog
|
||||
make.log
|
||||
maketest.log
|
||||
cctest
|
||||
cctest.c
|
||||
cctest.a
|
||||
*.flc
|
||||
semantic.cache
|
||||
Makefile
|
||||
*.dll*
|
||||
*.so*
|
||||
*.sl*
|
||||
*.dylib*
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,6 +7,7 @@
|
||||
.#*
|
||||
#*#
|
||||
*~
|
||||
/.dir-locals.el
|
||||
|
||||
# Top level excludes
|
||||
/Makefile.bak
|
||||
|
54
.travis.yml
Normal file
54
.travis.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
language: c
|
||||
|
||||
addons:
|
||||
apt_packages:
|
||||
- binutils-mingw-w64
|
||||
- gcc-mingw-w64
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
- i686-w64-mingw32-gcc
|
||||
- x86_64-w64-mingw32-gcc
|
||||
|
||||
env:
|
||||
- CONFIG_OPTS=""
|
||||
- CONFIG_OPTS="shared"
|
||||
- CONFIG_OPTS="-d --strict-warnings"
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- os: osx
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
- os: osx
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
- compiler: i686-w64-mingw32-gcc
|
||||
env: CONFIG_OPTS="-d --strict-warnings"
|
||||
- compiler: x86_64-w64-mingw32-gcc
|
||||
env: CONFIG_OPTS="-d --strict-warnings"
|
||||
|
||||
before_script:
|
||||
- if [ "$CC" == i686-w64-mingw32-gcc ]; then
|
||||
export CROSS_COMPILE=${CC%%gcc}; unset CC;
|
||||
./Configure mingw $CONFIG_OPTS;
|
||||
elif [ "$CC" == x86_64-w64-mingw32-gcc ]; then
|
||||
export CROSS_COMPILE=${CC%%gcc}; unset CC;
|
||||
./Configure mingw64 $CONFIG_OPTS;
|
||||
else
|
||||
./config $CONFIG_OPTS;
|
||||
fi
|
||||
|
||||
script:
|
||||
- make
|
||||
- if [ -z "$CROSS_COMPILE" ]; then make test; fi
|
||||
|
||||
notifications:
|
||||
recipient:
|
||||
- openssl-commits@openssl.org
|
||||
email:
|
||||
on_success: change
|
||||
on_failure: always
|
236
CHANGES
236
CHANGES
@@ -2,8 +2,71 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 1.0.1n and 1.0.1o [12 Jun 2015]
|
||||
Changes between 1.0.1p and 1.0.1q [3 Dec 2015]
|
||||
|
||||
*) Certificate verify crash with missing PSS parameter
|
||||
|
||||
The signature verification routines will crash with a NULL pointer
|
||||
dereference if presented with an ASN.1 signature using the RSA PSS
|
||||
algorithm and absent mask generation function parameter. Since these
|
||||
routines are used to verify certificate signature algorithms this can be
|
||||
used to crash any certificate verification operation and exploited in a
|
||||
DoS attack. Any application which performs certificate verification is
|
||||
vulnerable including OpenSSL clients and servers which enable client
|
||||
authentication.
|
||||
|
||||
This issue was reported to OpenSSL by Loïc Jonas Etienne (Qnective AG).
|
||||
(CVE-2015-3194)
|
||||
[Stephen Henson]
|
||||
|
||||
*) X509_ATTRIBUTE memory leak
|
||||
|
||||
When presented with a malformed X509_ATTRIBUTE structure OpenSSL will leak
|
||||
memory. This structure is used by the PKCS#7 and CMS routines so any
|
||||
application which reads PKCS#7 or CMS data from untrusted sources is
|
||||
affected. SSL/TLS is not affected.
|
||||
|
||||
This issue was reported to OpenSSL by Adam Langley (Google/BoringSSL) using
|
||||
libFuzzer.
|
||||
(CVE-2015-3195)
|
||||
[Stephen Henson]
|
||||
|
||||
*) Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs.
|
||||
This changes the decoding behaviour for some invalid messages,
|
||||
though the change is mostly in the more lenient direction, and
|
||||
legacy behaviour is preserved as much as possible.
|
||||
[Emilia Käsper]
|
||||
|
||||
*) In DSA_generate_parameters_ex, if the provided seed is too short,
|
||||
return an error
|
||||
[Rich Salz and Ismo Puustinen <ismo.puustinen@intel.com>]
|
||||
|
||||
Changes between 1.0.1o and 1.0.1p [9 Jul 2015]
|
||||
|
||||
*) Alternate chains certificate forgery
|
||||
|
||||
During certificate verfification, OpenSSL will attempt to find an
|
||||
alternative certificate chain if the first attempt to build such a chain
|
||||
fails. An error in the implementation of this logic can mean that an
|
||||
attacker could cause certain checks on untrusted certificates to be
|
||||
bypassed, such as the CA flag, enabling them to use a valid leaf
|
||||
certificate to act as a CA and "issue" an invalid certificate.
|
||||
|
||||
This issue was reported to OpenSSL by Adam Langley/David Benjamin
|
||||
(Google/BoringSSL).
|
||||
(CVE-2015-1793)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Race condition handling PSK identify hint
|
||||
|
||||
If PSK identity hints are received by a multi-threaded client then
|
||||
the values are wrongly updated in the parent SSL_CTX structure. This can
|
||||
result in a race condition potentially leading to a double free of the
|
||||
identify hint data.
|
||||
(CVE-2015-3196)
|
||||
[Stephen Henson]
|
||||
|
||||
Changes between 1.0.1n and 1.0.1o [12 Jun 2015]
|
||||
*) Fix HMAC ABI incompatibility. The previous version introduced an ABI
|
||||
incompatibility in the handling of HMAC. The previous ABI has now been
|
||||
restored.
|
||||
@@ -40,9 +103,9 @@
|
||||
callbacks.
|
||||
|
||||
This issue was reported to OpenSSL by Robert Swiecki (Google), and
|
||||
independently by Hanno B<EFBFBD>ck.
|
||||
independently by Hanno Böck.
|
||||
(CVE-2015-1789)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) PKCS7 crash with missing EnvelopedContent
|
||||
|
||||
@@ -56,7 +119,7 @@
|
||||
|
||||
This issue was reported to OpenSSL by Michal Zalewski (Google).
|
||||
(CVE-2015-1790)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) CMS verify infinite loop with unknown hash function
|
||||
|
||||
@@ -79,6 +142,9 @@
|
||||
*) Reject DH handshakes with parameters shorter than 768 bits.
|
||||
[Kurt Roeckx and Emilia Kasper]
|
||||
|
||||
*) dhparam: generate 2048-bit parameters by default.
|
||||
[Kurt Roeckx and Emilia Kasper]
|
||||
|
||||
Changes between 1.0.1l and 1.0.1m [19 Mar 2015]
|
||||
|
||||
*) Segmentation fault in ASN1_TYPE_cmp fix
|
||||
@@ -117,7 +183,7 @@
|
||||
|
||||
This issue was reported to OpenSSL by Michal Zalewski (Google).
|
||||
(CVE-2015-0289)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) DoS via reachable assert in SSLv2 servers fix
|
||||
|
||||
@@ -125,10 +191,10 @@
|
||||
servers that both support SSLv2 and enable export cipher suites by sending
|
||||
a specially crafted SSLv2 CLIENT-MASTER-KEY message.
|
||||
|
||||
This issue was discovered by Sean Burford (Google) and Emilia K<EFBFBD>sper
|
||||
This issue was discovered by Sean Burford (Google) and Emilia Käsper
|
||||
(OpenSSL development team).
|
||||
(CVE-2015-0293)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) Use After Free following d2i_ECPrivatekey error fix
|
||||
|
||||
@@ -273,12 +339,12 @@
|
||||
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<EFBFBD>sper]
|
||||
[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<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) Tighten client-side session ticket handling during renegotiation:
|
||||
ensure that the client only accepts a session ticket if the server sends
|
||||
@@ -289,7 +355,7 @@
|
||||
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<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
Changes between 1.0.1i and 1.0.1j [15 Oct 2014]
|
||||
|
||||
@@ -369,10 +435,10 @@
|
||||
with a null pointer dereference (read) by specifying an anonymous (EC)DH
|
||||
ciphersuite and sending carefully crafted handshake messages.
|
||||
|
||||
Thanks to Felix Gr<EFBFBD>bert (Google) for discovering and researching this
|
||||
Thanks to Felix Gröbert (Google) for discovering and researching this
|
||||
issue.
|
||||
(CVE-2014-3510)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) By sending carefully crafted DTLS packets an attacker could cause openssl
|
||||
to leak memory. This can be exploited through a Denial of Service attack.
|
||||
@@ -409,7 +475,7 @@
|
||||
properly negotiated with the client. This can be exploited through a
|
||||
Denial of Service attack.
|
||||
|
||||
Thanks to Joonas Kuorilehto and Riku Hietam<EFBFBD>ki (Codenomicon) for
|
||||
Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for
|
||||
discovering and researching this issue.
|
||||
(CVE-2014-5139)
|
||||
[Steve Henson]
|
||||
@@ -421,7 +487,7 @@
|
||||
|
||||
Thanks to Ivan Fratric (Google) for discovering this issue.
|
||||
(CVE-2014-3508)
|
||||
[Emilia K<EFBFBD>sper, and Steve Henson]
|
||||
[Emilia Käsper, and Steve Henson]
|
||||
|
||||
*) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.)
|
||||
for corner cases. (Certain input points at infinity could lead to
|
||||
@@ -451,15 +517,15 @@
|
||||
client or server. This is potentially exploitable to run arbitrary
|
||||
code on a vulnerable client or server.
|
||||
|
||||
Thanks to J<EFBFBD>ri Aedla for reporting this issue. (CVE-2014-0195)
|
||||
[J<EFBFBD>ri Aedla, Steve Henson]
|
||||
Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195)
|
||||
[Jüri Aedla, Steve Henson]
|
||||
|
||||
*) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites
|
||||
are subject to a denial of service attack.
|
||||
|
||||
Thanks to Felix Gr<EFBFBD>bert and Ivan Fratric at Google for discovering
|
||||
Thanks to Felix Gröbert and Ivan Fratric at Google for discovering
|
||||
this issue. (CVE-2014-3470)
|
||||
[Felix Gr<EFBFBD>bert, Ivan Fratric, Steve Henson]
|
||||
[Felix Gröbert, Ivan Fratric, Steve Henson]
|
||||
|
||||
*) Harmonize version and its documentation. -f flag is used to display
|
||||
compilation flags.
|
||||
@@ -538,9 +604,9 @@
|
||||
Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
|
||||
Security Group at Royal Holloway, University of London
|
||||
(www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
|
||||
Emilia K<EFBFBD>sper for the initial patch.
|
||||
Emilia Käsper for the initial patch.
|
||||
(CVE-2013-0169)
|
||||
[Emilia K<EFBFBD>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
|
||||
[Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
|
||||
|
||||
*) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode
|
||||
ciphersuites which can be exploited in a denial of service attack.
|
||||
@@ -715,7 +781,7 @@
|
||||
EC_GROUP_new_by_curve_name() will automatically use these (while
|
||||
EC_GROUP_new_curve_GFp() currently prefers the more flexible
|
||||
implementations).
|
||||
[Emilia K<EFBFBD>sper, Adam Langley, Bodo Moeller (Google)]
|
||||
[Emilia Käsper, Adam Langley, Bodo Moeller (Google)]
|
||||
|
||||
*) Use type ossl_ssize_t instad of ssize_t which isn't available on
|
||||
all platforms. Move ssize_t definition from e_os.h to the public
|
||||
@@ -991,7 +1057,7 @@
|
||||
[Adam Langley (Google)]
|
||||
|
||||
*) Fix spurious failures in ecdsatest.c.
|
||||
[Emilia K<EFBFBD>sper (Google)]
|
||||
[Emilia Käsper (Google)]
|
||||
|
||||
*) Fix the BIO_f_buffer() implementation (which was mixing different
|
||||
interpretations of the '..._len' fields).
|
||||
@@ -1005,7 +1071,7 @@
|
||||
lock to call BN_BLINDING_invert_ex, and avoids one use of
|
||||
BN_BLINDING_update for each BN_BLINDING structure (previously,
|
||||
the last update always remained unused).
|
||||
[Emilia K<EFBFBD>sper (Google)]
|
||||
[Emilia Käsper (Google)]
|
||||
|
||||
*) In ssl3_clear, preserve s3->init_extra along with s3->rbuf.
|
||||
[Bob Buckholz (Google)]
|
||||
@@ -1814,7 +1880,7 @@
|
||||
|
||||
*) Add RFC 3161 compliant time stamp request creation, response generation
|
||||
and response verification functionality.
|
||||
[Zolt<EFBFBD>n Gl<EFBFBD>zik <zglozik@opentsa.org>, The OpenTSA Project]
|
||||
[Zoltán Glózik <zglozik@opentsa.org>, The OpenTSA Project]
|
||||
|
||||
*) Add initial support for TLS extensions, specifically for the server_name
|
||||
extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now
|
||||
@@ -2982,7 +3048,7 @@
|
||||
|
||||
*) BN_CTX_get() should return zero-valued bignums, providing the same
|
||||
initialised value as BN_new().
|
||||
[Geoff Thorpe, suggested by Ulf M<EFBFBD>ller]
|
||||
[Geoff Thorpe, suggested by Ulf Möller]
|
||||
|
||||
*) Support for inhibitAnyPolicy certificate extension.
|
||||
[Steve Henson]
|
||||
@@ -3001,7 +3067,7 @@
|
||||
some point, these tighter rules will become openssl's default to improve
|
||||
maintainability, though the assert()s and other overheads will remain only
|
||||
in debugging configurations. See bn.h for more details.
|
||||
[Geoff Thorpe, Nils Larsch, Ulf M<EFBFBD>ller]
|
||||
[Geoff Thorpe, Nils Larsch, Ulf Möller]
|
||||
|
||||
*) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure
|
||||
that can only be obtained through BN_CTX_new() (which implicitly
|
||||
@@ -3068,7 +3134,7 @@
|
||||
[Douglas Stebila (Sun Microsystems Laboratories)]
|
||||
|
||||
*) Add the possibility to load symbols globally with DSO.
|
||||
[G<EFBFBD>tz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
|
||||
[Götz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
|
||||
|
||||
*) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better
|
||||
control of the error stack.
|
||||
@@ -3783,7 +3849,7 @@
|
||||
[Steve Henson]
|
||||
|
||||
*) Undo Cygwin change.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Added support for proxy certificates according to RFC 3820.
|
||||
Because they may be a security thread to unaware applications,
|
||||
@@ -3816,11 +3882,11 @@
|
||||
[Stephen Henson, reported by UK NISCC]
|
||||
|
||||
*) Use Windows randomness collection on Cygwin.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix hang in EGD/PRNGD query when communication socket is closed
|
||||
prematurely by EGD/PRNGD.
|
||||
[Darren Tucker <dtucker@zip.com.au> via Lutz J<EFBFBD>nicke, resolves #1014]
|
||||
[Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014]
|
||||
|
||||
*) Prompt for pass phrases when appropriate for PKCS12 input format.
|
||||
[Steve Henson]
|
||||
@@ -4282,7 +4348,7 @@
|
||||
pointers passed to them whenever necessary. Otherwise it is possible
|
||||
the caller may have overwritten (or deallocated) the original string
|
||||
data when a later ENGINE operation tries to use the stored values.
|
||||
[G<EFBFBD>tz Babin-Ebell <babinebell@trustcenter.de>]
|
||||
[Götz Babin-Ebell <babinebell@trustcenter.de>]
|
||||
|
||||
*) Improve diagnostics in file reading and command-line digests.
|
||||
[Ben Laurie aided and abetted by Solar Designer <solar@openwall.com>]
|
||||
@@ -6387,7 +6453,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) BN_sqr() bug fix.
|
||||
[Ulf M<EFBFBD>ller, reported by Jim Ellis <jim.ellis@cavium.com>]
|
||||
[Ulf Möller, reported by Jim Ellis <jim.ellis@cavium.com>]
|
||||
|
||||
*) Rabin-Miller test analyses assume uniformly distributed witnesses,
|
||||
so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
|
||||
@@ -6547,7 +6613,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Fix OAEP check.
|
||||
[Ulf M<EFBFBD>ller, Bodo M<EFBFBD>ller]
|
||||
[Ulf Möller, Bodo Möller]
|
||||
|
||||
*) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
|
||||
RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
|
||||
@@ -6809,10 +6875,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Use better test patterns in bntest.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) rand_win.c fix for Borland C.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) BN_rshift bugfix for n == 0.
|
||||
[Bodo Moeller]
|
||||
@@ -6957,14 +7023,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) New BIO_shutdown_wr macro, which invokes the BIO_C_SHUTDOWN_WR
|
||||
BIO_ctrl (for BIO pairs).
|
||||
[Bodo M<EFBFBD>ller]
|
||||
[Bodo Möller]
|
||||
|
||||
*) Add DSO method for VMS.
|
||||
[Richard Levitte]
|
||||
|
||||
*) Bug fix: Montgomery multiplication could produce results with the
|
||||
wrong sign.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add RPM specification openssl.spec and modify it to build three
|
||||
packages. The default package contains applications, application
|
||||
@@ -6982,7 +7048,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Don't set the two most significant bits to one when generating a
|
||||
random number < q in the DSA library.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) New SSL API mode 'SSL_MODE_AUTO_RETRY'. This disables the default
|
||||
behaviour that SSL_read may result in SSL_ERROR_WANT_READ (even if
|
||||
@@ -7248,7 +7314,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Randomness polling function for Win9x, as described in:
|
||||
Peter Gutmann, Software Generation of Practically Strong
|
||||
Random Numbers.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix so PRNG is seeded in req if using an already existing
|
||||
DSA key.
|
||||
@@ -7468,7 +7534,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Eliminate non-ANSI declarations in crypto.h and stack.h.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix for SSL server purpose checking. Server checking was
|
||||
rejecting certificates which had extended key usage present
|
||||
@@ -7500,7 +7566,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Bugfix for linux-elf makefile.one.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) RSA_get_default_method() will now cause a default
|
||||
RSA_METHOD to be chosen if one doesn't exist already.
|
||||
@@ -7589,7 +7655,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) des_quad_cksum() byte order bug fix.
|
||||
[Ulf M<EFBFBD>ller, using the problem description in krb4-0.9.7, where
|
||||
[Ulf Möller, using the problem description in krb4-0.9.7, where
|
||||
the solution is attributed to Derrick J Brashear <shadow@DEMENTIA.ORG>]
|
||||
|
||||
*) Fix so V_ASN1_APP_CHOOSE works again: however its use is strongly
|
||||
@@ -7690,7 +7756,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Rolf Haberrecker <rolf@suse.de>]
|
||||
|
||||
*) Assembler module support for Mingw32.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Shared library support for HPUX (in shlib/).
|
||||
[Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous]
|
||||
@@ -7709,7 +7775,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n]
|
||||
case was implemented. This caused BN_div_recp() to fail occasionally.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add an optional second argument to the set_label() in the perl
|
||||
assembly language builder. If this argument exists and is set
|
||||
@@ -7739,14 +7805,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Fix potential buffer overrun problem in BIO_printf().
|
||||
[Ulf M<EFBFBD>ller, using public domain code by Patrick Powell; problem
|
||||
[Ulf Möller, using public domain code by Patrick Powell; problem
|
||||
pointed out by David Sacerdote <das33@cornell.edu>]
|
||||
|
||||
*) Support EGD <http://www.lothar.com/tech/crypto/>. New functions
|
||||
RAND_egd() and RAND_status(). In the command line application,
|
||||
the EGD socket can be specified like a seed file using RANDFILE
|
||||
or -rand.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Allow the string CERTIFICATE to be tolerated in PKCS#7 structures.
|
||||
Some CAs (e.g. Verisign) distribute certificates in this form.
|
||||
@@ -7779,7 +7845,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
#define OPENSSL_ALGORITHM_DEFINES
|
||||
#include <openssl/opensslconf.h>
|
||||
defines all pertinent NO_<algo> symbols, such as NO_IDEA, NO_RSA, etc.
|
||||
[Richard Levitte, Ulf and Bodo M<EFBFBD>ller]
|
||||
[Richard Levitte, Ulf and Bodo Möller]
|
||||
|
||||
*) Bugfix: Tolerate fragmentation and interleaving in the SSL 3/TLS
|
||||
record layer.
|
||||
@@ -7830,17 +7896,17 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Bug fix for BN_div_recp() for numerators with an even number of
|
||||
bits.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) More tests in bntest.c, and changed test_bn output.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) ./config recognizes MacOS X now.
|
||||
[Andy Polyakov]
|
||||
|
||||
*) Bug fix for BN_div() when the first words of num and divsor are
|
||||
equal (it gave wrong results if (rem=(n1-q*d0)&BN_MASK2) < d0).
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add support for various broken PKCS#8 formats, and command line
|
||||
options to produce them.
|
||||
@@ -7848,11 +7914,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) New functions BN_CTX_start(), BN_CTX_get() and BT_CTX_end() to
|
||||
get temporary BIGNUMs from a BN_CTX.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont()
|
||||
for p == 0.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Change the SSLeay_add_all_*() functions to OpenSSL_add_all_*() and
|
||||
include a #define from the old name to the new. The original intent
|
||||
@@ -7876,7 +7942,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Source code cleanups: use const where appropriate, eliminate casts,
|
||||
use void * instead of char * in lhash.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Bugfix: ssl3_send_server_key_exchange was not restartable
|
||||
(the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of
|
||||
@@ -7921,13 +7987,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) New function BN_pseudo_rand().
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Clean up BN_mod_mul_montgomery(): replace the broken (and unreadable)
|
||||
bignum version of BN_from_montgomery() with the working code from
|
||||
SSLeay 0.9.0 (the word based version is faster anyway), and clean up
|
||||
the comments.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Avoid a race condition in s2_clnt.c (function get_server_hello) that
|
||||
made it impossible to use the same SSL_SESSION data structure in
|
||||
@@ -7937,25 +8003,25 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) The return value of RAND_load_file() no longer counts bytes obtained
|
||||
by stat(). RAND_load_file(..., -1) is new and uses the complete file
|
||||
to seed the PRNG (previously an explicit byte count was required).
|
||||
[Ulf M<EFBFBD>ller, Bodo M<EFBFBD>ller]
|
||||
[Ulf Möller, Bodo Möller]
|
||||
|
||||
*) Clean up CRYPTO_EX_DATA functions, some of these didn't have prototypes
|
||||
used (char *) instead of (void *) and had casts all over the place.
|
||||
[Steve Henson]
|
||||
|
||||
*) Make BN_generate_prime() return NULL on error if ret!=NULL.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Retain source code compatibility for BN_prime_checks macro:
|
||||
BN_is_prime(..., BN_prime_checks, ...) now uses
|
||||
BN_prime_checks_for_size to determine the appropriate number of
|
||||
Rabin-Miller iterations.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Diffie-Hellman uses "safe" primes: DH_check() return code renamed to
|
||||
DH_CHECK_P_NOT_SAFE_PRIME.
|
||||
(Check if this is true? OpenPGP calls them "strong".)
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Merge the functionality of "dh" and "gendh" programs into a new program
|
||||
"dhparam". The old programs are retained for now but will handle DH keys
|
||||
@@ -8011,7 +8077,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Add missing #ifndefs that caused missing symbols when building libssl
|
||||
as a shared library without RSA. Use #ifndef NO_SSL2 instead of
|
||||
NO_RSA in ssl/s2*.c.
|
||||
[Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf M<EFBFBD>ller]
|
||||
[Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf Möller]
|
||||
|
||||
*) Precautions against using the PRNG uninitialized: RAND_bytes() now
|
||||
has a return value which indicates the quality of the random data
|
||||
@@ -8020,7 +8086,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
guaranteed to be unique but not unpredictable. RAND_add is like
|
||||
RAND_seed, but takes an extra argument for an entropy estimate
|
||||
(RAND_seed always assumes full entropy).
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Do more iterations of Rabin-Miller probable prime test (specifically,
|
||||
3 for 1024-bit primes, 6 for 512-bit primes, 12 for 256-bit primes
|
||||
@@ -8050,7 +8116,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Honor the no-xxx Configure options when creating .DEF files.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add PKCS#10 attributes to field table: challengePassword,
|
||||
unstructuredName and unstructuredAddress. These are taken from
|
||||
@@ -8884,7 +8950,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) More DES library cleanups: remove references to srand/rand and
|
||||
delete an unused file.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add support for the the free Netwide assembler (NASM) under Win32,
|
||||
since not many people have MASM (ml) and it can be hard to obtain.
|
||||
@@ -8973,7 +9039,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
worked.
|
||||
|
||||
*) Fix problems with no-hmac etc.
|
||||
[Ulf M<EFBFBD>ller, pointed out by Brian Wellington <bwelling@tislabs.com>]
|
||||
[Ulf Möller, pointed out by Brian Wellington <bwelling@tislabs.com>]
|
||||
|
||||
*) New functions RSA_get_default_method(), RSA_set_method() and
|
||||
RSA_get_method(). These allows replacement of RSA_METHODs without having
|
||||
@@ -9090,7 +9156,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Ben Laurie]
|
||||
|
||||
*) DES library cleanups.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add support for PKCS#5 v2.0 PBE algorithms. This will permit PKCS#8 to be
|
||||
used with any cipher unlike PKCS#5 v1.5 which can at most handle 64 bit
|
||||
@@ -9133,7 +9199,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Christian Forster <fo@hawo.stw.uni-erlangen.de>]
|
||||
|
||||
*) config now generates no-xxx options for missing ciphers.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Support the EBCDIC character set (work in progress).
|
||||
File ebcdic.c not yet included because it has a different license.
|
||||
@@ -9246,7 +9312,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Move openssl.cnf out of lib/.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix various things to let OpenSSL even pass ``egcc -pipe -O2 -Wall
|
||||
-Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes
|
||||
@@ -9303,10 +9369,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Ben Laurie]
|
||||
|
||||
*) Support Borland C++ builder.
|
||||
[Janez Jere <jj@void.si>, modified by Ulf M<EFBFBD>ller]
|
||||
[Janez Jere <jj@void.si>, modified by Ulf Möller]
|
||||
|
||||
*) Support Mingw32.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) SHA-1 cleanups and performance enhancements.
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
@@ -9315,7 +9381,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
|
||||
*) Accept any -xxx and +xxx compiler options in Configure.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Update HPUX configuration.
|
||||
[Anonymous]
|
||||
@@ -9348,7 +9414,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) OAEP decoding bug fix.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Support INSTALL_PREFIX for package builders, as proposed by
|
||||
David Harris.
|
||||
@@ -9371,21 +9437,21 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Niels Poppe <niels@netbox.org>]
|
||||
|
||||
*) New Configure option no-<cipher> (rsa, idea, rc5, ...).
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for
|
||||
extension adding in x509 utility.
|
||||
[Steve Henson]
|
||||
|
||||
*) Remove NOPROTO sections and error code comments.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Partial rewrite of the DEF file generator to now parse the ANSI
|
||||
prototypes.
|
||||
[Steve Henson]
|
||||
|
||||
*) New Configure options --prefix=DIR and --openssldir=DIR.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Complete rewrite of the error code script(s). It is all now handled
|
||||
by one script at the top level which handles error code gathering,
|
||||
@@ -9414,7 +9480,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Move the autogenerated header file parts to crypto/opensslconf.h.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of
|
||||
8 of keying material. Merlin has also confirmed interop with this fix
|
||||
@@ -9432,13 +9498,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
|
||||
*) Change functions to ANSI C.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix typos in error codes.
|
||||
[Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf M<EFBFBD>ller]
|
||||
[Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]
|
||||
|
||||
*) Remove defunct assembler files from Configure.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) SPARC v8 assembler BIGNUM implementation.
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
@@ -9475,7 +9541,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) New Configure option "rsaref".
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Don't auto-generate pem.h.
|
||||
[Bodo Moeller]
|
||||
@@ -9523,7 +9589,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) New functions DSA_do_sign and DSA_do_verify to provide access to
|
||||
the raw DSA values prior to ASN.1 encoding.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Tweaks to Configure
|
||||
[Niels Poppe <niels@netbox.org>]
|
||||
@@ -9533,11 +9599,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) New variables $(RANLIB) and $(PERL) in the Makefiles.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) New config option to avoid instructions that are illegal on the 80386.
|
||||
The default code is faster, but requires at least a 486.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and
|
||||
SSL2_SERVER_VERSION (not used at all) macros, which are now the
|
||||
@@ -10076,7 +10142,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
Hagino <itojun@kame.net>]
|
||||
|
||||
*) File was opened incorrectly in randfile.c.
|
||||
[Ulf M<EFBFBD>ller <ulf@fitug.de>]
|
||||
[Ulf Möller <ulf@fitug.de>]
|
||||
|
||||
*) Beginning of support for GeneralizedTime. d2i, i2d, check and print
|
||||
functions. Also ASN1_TIME suite which is a CHOICE of UTCTime or
|
||||
@@ -10086,7 +10152,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Correct Linux 1 recognition in config.
|
||||
[Ulf M<EFBFBD>ller <ulf@fitug.de>]
|
||||
[Ulf Möller <ulf@fitug.de>]
|
||||
|
||||
*) Remove pointless MD5 hash when using DSA keys in ca.
|
||||
[Anonymous <nobody@replay.com>]
|
||||
@@ -10233,7 +10299,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Fix the RSA header declarations that hid a bug I fixed in 0.9.0b but
|
||||
was already fixed by Eric for 0.9.1 it seems.
|
||||
[Ben Laurie - pointed out by Ulf M<EFBFBD>ller <ulf@fitug.de>]
|
||||
[Ben Laurie - pointed out by Ulf Möller <ulf@fitug.de>]
|
||||
|
||||
*) Autodetect FreeBSD3.
|
||||
[Ben Laurie]
|
||||
|
38
CONTRIBUTING
Normal file
38
CONTRIBUTING
Normal file
@@ -0,0 +1,38 @@
|
||||
HOW TO CONTRIBUTE TO OpenSSL
|
||||
----------------------------
|
||||
|
||||
Development is coordinated on the openssl-dev mailing list (see
|
||||
http://www.openssl.org for information on subscribing). If you
|
||||
would like to submit a patch, send it to rt@openssl.org with
|
||||
the string "[PATCH]" in the subject. Please be sure to include a
|
||||
textual explanation of what your patch does.
|
||||
|
||||
You can also make GitHub pull requests. If you do this, please also send
|
||||
mail to rt@openssl.org with a brief description and a link to the PR so
|
||||
that we can more easily keep track of it.
|
||||
|
||||
If you are unsure as to whether a feature will be useful for the general
|
||||
OpenSSL community please discuss it on the openssl-dev mailing list first.
|
||||
Someone may be already working on the same thing or there may be a good
|
||||
reason as to why that feature isn't implemented.
|
||||
|
||||
Patches should be as up to date as possible, preferably relative to the
|
||||
current Git or the last snapshot. They should follow our coding style
|
||||
(see https://www.openssl.org/policies/codingstyle.html) and compile without
|
||||
warnings using the --strict-warnings flag. OpenSSL compiles on many varied
|
||||
platforms: try to ensure you only use portable features.
|
||||
|
||||
Our preferred format for patch files is "git format-patch" output. For example
|
||||
to provide a patch file containing the last commit in your local git repository
|
||||
use the following command:
|
||||
|
||||
# git format-patch --stdout HEAD^ >mydiffs.patch
|
||||
|
||||
Another method of creating an acceptable patch file without using git is as
|
||||
follows:
|
||||
|
||||
# cd openssl-work
|
||||
# [your changes]
|
||||
# ./Configure dist; make clean
|
||||
# cd ..
|
||||
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
17
Configure
17
Configure
@@ -105,6 +105,8 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
|
||||
|
||||
my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
|
||||
|
||||
my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments";
|
||||
|
||||
my $strict_warnings = 0;
|
||||
|
||||
my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
|
||||
@@ -197,6 +199,7 @@ my %table=(
|
||||
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"debug-linux-x86_64-clang","clang: -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"dist", "cc:-O::(unknown)::::::",
|
||||
|
||||
# Basic configs that should work on any (32 and less bit) box
|
||||
@@ -361,6 +364,7 @@ my %table=(
|
||||
"linux-ia64-ecc","ecc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-x86_64-clang","clang: -m64 -DL_ENDIAN -O3 -Wall -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
#### So called "highgprs" target for z/Architecture CPUs
|
||||
# "Highgprs" is kernel feature first implemented in Linux 2.6.32, see
|
||||
@@ -1574,11 +1578,20 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
|
||||
|
||||
if ($strict_warnings)
|
||||
{
|
||||
my $ecc = $cc;
|
||||
$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
|
||||
my $wopt;
|
||||
die "ERROR --strict-warnings requires gcc" unless ($cc =~ /gcc$/);
|
||||
die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
|
||||
foreach $wopt (split /\s+/, $gcc_devteam_warn)
|
||||
{
|
||||
$cflags .= " $wopt" unless ($cflags =~ /$wopt/)
|
||||
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
|
||||
}
|
||||
if ($ecc eq "clang")
|
||||
{
|
||||
foreach $wopt (split /\s+/, $clang_devteam_warn)
|
||||
{
|
||||
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
42
Makefile.org
42
Makefile.org
@@ -268,6 +268,7 @@ reflect:
|
||||
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
|
||||
|
||||
sub_all: build_all
|
||||
|
||||
build_all: build_libs build_apps build_tests build_tools
|
||||
|
||||
build_libs: build_libcrypto build_libssl openssl.pc
|
||||
@@ -277,15 +278,15 @@ build_libssl: build_ssl libssl.pc
|
||||
|
||||
build_crypto:
|
||||
@dir=crypto; target=all; $(BUILD_ONE_CMD)
|
||||
build_ssl:
|
||||
build_ssl: build_crypto
|
||||
@dir=ssl; target=all; $(BUILD_ONE_CMD)
|
||||
build_engines:
|
||||
build_engines: build_crypto
|
||||
@dir=engines; target=all; $(BUILD_ONE_CMD)
|
||||
build_apps:
|
||||
build_apps: build_libs
|
||||
@dir=apps; target=all; $(BUILD_ONE_CMD)
|
||||
build_tests:
|
||||
build_tests: build_libs
|
||||
@dir=test; target=all; $(BUILD_ONE_CMD)
|
||||
build_tools:
|
||||
build_tools: build_libs
|
||||
@dir=tools; target=all; $(BUILD_ONE_CMD)
|
||||
|
||||
all_testapps: build_libs build_testapps
|
||||
@@ -498,25 +499,28 @@ TABLE: Configure
|
||||
# would occur. Therefore the list of files is temporarily stored into a file
|
||||
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
|
||||
# tar does not support the --files-from option.
|
||||
tar:
|
||||
TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
|
||||
--owner openssl:0 --group openssl:0 \
|
||||
--transform 's|^|openssl-$(VERSION)/|' \
|
||||
-cvf -
|
||||
|
||||
../$(TARFILE).list:
|
||||
find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
|
||||
\! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
|
||||
\! -name '*test' \! -name '.#*' \! -name '*~' \
|
||||
| sort > ../$(TARFILE).list
|
||||
|
||||
tar: ../$(TARFILE).list
|
||||
find . -type d -print | xargs chmod 755
|
||||
find . -type f -print | xargs chmod a+r
|
||||
find . -type f -perm -0100 -print | xargs chmod a+x
|
||||
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
|
||||
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
|
||||
tardy --user_number=0 --user_name=openssl \
|
||||
--group_number=0 --group_name=openssl \
|
||||
--prefix=openssl-$(VERSION) - |\
|
||||
gzip --best >../$(TARFILE).gz; \
|
||||
rm -f ../$(TARFILE).list; \
|
||||
$(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
|
||||
rm -f ../$(TARFILE).list
|
||||
ls -l ../$(TARFILE).gz
|
||||
|
||||
tar-snap:
|
||||
@$(TAR) $(TARFLAGS) -cvf - \
|
||||
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
|
||||
tardy --user_number=0 --user_name=openssl \
|
||||
--group_number=0 --group_name=openssl \
|
||||
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
|
||||
tar-snap: ../$(TARFILE).list
|
||||
$(TAR_COMMAND) > ../$(TARFILE)
|
||||
rm -f ../$(TARFILE).list
|
||||
ls -l ../$(TARFILE)
|
||||
|
||||
dist:
|
||||
|
13
NEWS
13
NEWS
@@ -5,6 +5,19 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 1.0.1p and OpenSSL 1.0.1q [3 Dec 2015]
|
||||
|
||||
o Certificate verify crash with missing PSS parameter (CVE-2015-3194)
|
||||
o X509_ATTRIBUTE memory leak (CVE-2015-3195)
|
||||
o Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs
|
||||
o In DSA_generate_parameters_ex, if the provided seed is too short,
|
||||
return an error
|
||||
|
||||
Major changes between OpenSSL 1.0.1o and OpenSSL 1.0.1p [9 Jul 2015]
|
||||
|
||||
o Alternate chains certificate forgery (CVE-2015-1793)
|
||||
o Race condition handling PSK identify hint (CVE-2015-3196)
|
||||
|
||||
Major changes between OpenSSL 1.0.1n and OpenSSL 1.0.1o [12 Jun 2015]
|
||||
|
||||
o Fix HMAC ABI incompatibility
|
||||
|
204
README
204
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 1.0.1o 12 Jun 2015
|
||||
OpenSSL 1.0.1q 3 Dec 2015
|
||||
|
||||
Copyright (c) 1998-2011 The OpenSSL Project
|
||||
Copyright (c) 1998-2015 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
|
||||
The OpenSSL Project is a collaborative effort to develop a robust,
|
||||
commercial-grade, fully featured, and 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.
|
||||
The project is managed by a worldwide community of volunteers that use the
|
||||
Internet to communicate, plan, and develop the OpenSSL toolkit and its
|
||||
related documentation.
|
||||
Secure Sockets Layer (SSLv3) and Transport Layer Security (TLS) protocols as
|
||||
well as a full-strength general purpose cryptograpic library. The project is
|
||||
managed by a worldwide community of volunteers that use the Internet to
|
||||
communicate, plan, and develop the OpenSSL toolkit and its related
|
||||
documentation.
|
||||
|
||||
OpenSSL is based on the excellent SSLeay library developed from Eric A. Young
|
||||
OpenSSL is descended from the SSLeay library developed by 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.
|
||||
OpenSSL license plus the SSLeay license), which 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.
|
||||
|
||||
OVERVIEW
|
||||
--------
|
||||
@@ -28,116 +28,39 @@
|
||||
The OpenSSL toolkit includes:
|
||||
|
||||
libssl.a:
|
||||
Implementation of SSLv2, SSLv3, TLSv1 and the required code to support
|
||||
both SSLv2, SSLv3 and TLSv1 in the one server and client.
|
||||
Provides the client and server-side implementations for SSLv3 and TLS.
|
||||
|
||||
libcrypto.a:
|
||||
General encryption and X.509 v1/v3 stuff needed by SSL/TLS but not
|
||||
actually logically part of it. It includes routines for the following:
|
||||
|
||||
Ciphers
|
||||
libdes - EAY's libdes DES encryption package which was floating
|
||||
around the net for a few years, and was then relicensed by
|
||||
him as part of SSLeay. It includes 15 'modes/variations'
|
||||
of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb;
|
||||
pcbc and a more general form of cfb and ofb) including desx
|
||||
in cbc mode, a fast crypt(3), and routines to read
|
||||
passwords from the keyboard.
|
||||
RC4 encryption,
|
||||
RC2 encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||
Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||
IDEA encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||
|
||||
Digests
|
||||
MD5 and MD2 message digest algorithms, fast implementations,
|
||||
SHA (SHA-0) and SHA-1 message digest algorithms,
|
||||
MDC2 message digest. A DES based hash that is popular on smart cards.
|
||||
|
||||
Public Key
|
||||
RSA encryption/decryption/generation.
|
||||
There is no limit on the number of bits.
|
||||
DSA encryption/decryption/generation.
|
||||
There is no limit on the number of bits.
|
||||
Diffie-Hellman key-exchange/key generation.
|
||||
There is no limit on the number of bits.
|
||||
|
||||
X.509v3 certificates
|
||||
X509 encoding/decoding into/from binary ASN1 and a PEM
|
||||
based ASCII-binary encoding which supports encryption with a
|
||||
private key. Program to generate RSA and DSA certificate
|
||||
requests and to generate RSA and DSA certificates.
|
||||
|
||||
Systems
|
||||
The normal digital envelope routines and base64 encoding. Higher
|
||||
level access to ciphers and digests by name. New ciphers can be
|
||||
loaded at run time. The BIO io system which is a simple non-blocking
|
||||
IO abstraction. Current methods supported are file descriptors,
|
||||
sockets, socket accept, socket connect, memory buffer, buffering, SSL
|
||||
client/server, file pointer, encryption, digest, non-blocking testing
|
||||
and null.
|
||||
|
||||
Data structures
|
||||
A dynamically growing hashing system
|
||||
A simple stack.
|
||||
A Configuration loader that uses a format similar to MS .ini files.
|
||||
Provides general cryptographic and X.509 support needed by SSL/TLS but
|
||||
not logically part of it.
|
||||
|
||||
openssl:
|
||||
A command line tool that can be used for:
|
||||
Creation of RSA, DH and DSA key parameters
|
||||
Creation of key parameters
|
||||
Creation of X.509 certificates, CSRs and CRLs
|
||||
Calculation of Message Digests
|
||||
Encryption and Decryption with Ciphers
|
||||
SSL/TLS Client and Server Tests
|
||||
Calculation of message digests
|
||||
Encryption and decryption
|
||||
SSL/TLS client and server tests
|
||||
Handling of S/MIME signed or encrypted mail
|
||||
|
||||
|
||||
PATENTS
|
||||
-------
|
||||
|
||||
Various companies hold various patents for various algorithms in various
|
||||
locations around the world. _YOU_ are responsible for ensuring that your use
|
||||
of any algorithms is legal by checking if there are any patents in your
|
||||
country. The file contains some of the patents that we know about or are
|
||||
rumored to exist. This is not a definitive list.
|
||||
|
||||
RSA Security holds software patents on the RC5 algorithm. If you
|
||||
intend to use this cipher, you must contact RSA Security for
|
||||
licensing conditions. Their web page is http://www.rsasecurity.com/.
|
||||
|
||||
RC4 is a trademark of RSA Security, so use of this label should perhaps
|
||||
only be used with RSA Security's permission.
|
||||
|
||||
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
|
||||
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They
|
||||
should be contacted if that algorithm is to be used; their web page is
|
||||
http://www.ascom.ch/.
|
||||
|
||||
NTT and Mitsubishi have patents and pending patents on the Camellia
|
||||
algorithm, but allow use at no charge without requiring an explicit
|
||||
licensing agreement: http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html
|
||||
And more...
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
To install this package under a Unix derivative, read the INSTALL file. For
|
||||
a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read
|
||||
INSTALL.VMS.
|
||||
|
||||
Read the documentation in the doc/ directory. It is quite rough, but it
|
||||
lists the functions; you will probably have to look at the code to work out
|
||||
how to use them. Look at the example programs.
|
||||
|
||||
PROBLEMS
|
||||
--------
|
||||
|
||||
For some platforms, there are some known problems that may affect the user
|
||||
or application author. We try to collect those in doc/PROBLEMS, with current
|
||||
thoughts on how they should be solved in a future of OpenSSL.
|
||||
See the appropriate file:
|
||||
INSTALL Linux, Unix, etc.
|
||||
INSTALL.DJGPP DOS platform with DJGPP
|
||||
INSTALL.NW Netware
|
||||
INSTALL.OS2 OS/2
|
||||
INSTALL.VMS VMS
|
||||
INSTALL.W32 Windows (32bit)
|
||||
INSTALL.W64 Windows (64bit)
|
||||
INSTALL.WCE Windows CE
|
||||
|
||||
SUPPORT
|
||||
-------
|
||||
|
||||
See the OpenSSL website www.openssl.org for details of how to obtain
|
||||
See the OpenSSL website www.openssl.org for details on how to obtain
|
||||
commercial technical support.
|
||||
|
||||
If you have any problems with OpenSSL then please take the following steps
|
||||
@@ -161,58 +84,35 @@
|
||||
- Problem Description (steps that will reproduce the problem, if known)
|
||||
- Stack Traceback (if the application dumps core)
|
||||
|
||||
Report the bug to the OpenSSL project via the Request Tracker
|
||||
(http://www.openssl.org/support/rt.html) by mail to:
|
||||
Email the report to:
|
||||
|
||||
openssl-bugs@openssl.org
|
||||
rt@openssl.org
|
||||
|
||||
Note that the request tracker should NOT be used for general assistance
|
||||
or support queries. Just because something doesn't work the way you expect
|
||||
does not mean it is necessarily a bug in OpenSSL.
|
||||
In order to avoid spam, this is a moderated mailing list, and it might
|
||||
take a day for the ticket to show up. (We also scan posts to make sure
|
||||
that security disclosures aren't publically posted by mistake.) Mail to
|
||||
this address is recorded in the public RT (request tracker) database (see
|
||||
https://www.openssl.org/support/rt.html for details) and also forwarded
|
||||
the public openssl-dev mailing list. Confidential mail may be sent to
|
||||
openssl-security@openssl.org (PGP key available from the key servers).
|
||||
|
||||
Note that mail to openssl-bugs@openssl.org is recorded in the publicly
|
||||
readable request tracker database and is forwarded to a public
|
||||
mailing list. Confidential mail may be sent to openssl-security@openssl.org
|
||||
(PGP key available from the key servers).
|
||||
Please do NOT use this for general assistance or support queries.
|
||||
Just because something doesn't work the way you expect does not mean it
|
||||
is necessarily a bug in OpenSSL.
|
||||
|
||||
You can also make GitHub pull requests. If you do this, please also send
|
||||
mail to rt@openssl.org with a link to the PR so that we can more easily
|
||||
keep track of it.
|
||||
|
||||
HOW TO CONTRIBUTE TO OpenSSL
|
||||
----------------------------
|
||||
|
||||
Development is coordinated on the openssl-dev mailing list (see
|
||||
http://www.openssl.org for information on subscribing). If you
|
||||
would like to submit a patch, send it to openssl-bugs@openssl.org with
|
||||
the string "[PATCH]" in the subject. Please be sure to include a
|
||||
textual explanation of what your patch does.
|
||||
See CONTRIBUTING
|
||||
|
||||
If you are unsure as to whether a feature will be useful for the general
|
||||
OpenSSL community please discuss it on the openssl-dev mailing list first.
|
||||
Someone may be already working on the same thing or there may be a good
|
||||
reason as to why that feature isn't implemented.
|
||||
|
||||
Patches should be as up to date as possible, preferably relative to the
|
||||
current Git or the last snapshot. They should follow the coding style of
|
||||
OpenSSL and compile without warnings. Some of the core team developer targets
|
||||
can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
|
||||
compiles on many varied platforms: try to ensure you only use portable
|
||||
features.
|
||||
|
||||
Note: For legal reasons, contributions from the US can be accepted only
|
||||
if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
|
||||
(formerly BXA) with a copy to the ENC Encryption Request Coordinator;
|
||||
please take some time to look at
|
||||
http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
|
||||
and
|
||||
http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e))
|
||||
for the details. If "your encryption source code is too large to serve as
|
||||
an email attachment", they are glad to receive it by fax instead; hope you
|
||||
have a cheap long-distance plan.
|
||||
|
||||
Our preferred format for changes is "diff -u" output. You might
|
||||
generate it like this:
|
||||
|
||||
# cd openssl-work
|
||||
# [your changes]
|
||||
# ./Configure dist; make clean
|
||||
# cd ..
|
||||
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
||||
LEGALITIES
|
||||
----------
|
||||
|
||||
A number of nations, in particular the U.S., restrict the use or export
|
||||
of cryptography. If you are potentially subject to such restrictions
|
||||
you should seek competent professional legal advice before attempting to
|
||||
develop or distribute cryptographic code.
|
||||
|
@@ -1,8 +0,0 @@
|
||||
openssl
|
||||
Makefile.save
|
||||
der_chop
|
||||
der_chop.bak
|
||||
CA.pl
|
||||
*.flc
|
||||
semantic.cache
|
||||
*.dll
|
@@ -135,7 +135,7 @@ update: openssl-vms.cnf local_depend
|
||||
depend: local_depend
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
local_depend:
|
||||
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
|
||||
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC)
|
||||
|
||||
dclean:
|
||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||
|
@@ -119,9 +119,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(NETWARE_CLIB)
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@@ -1247,7 +1244,11 @@ int set_name_ex(unsigned long *flags, const char *arg)
|
||||
{"ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
return set_multi_opts(flags, arg, ex_tbl);
|
||||
if (set_multi_opts(flags, arg, ex_tbl) == 0)
|
||||
return 0;
|
||||
if ((*flags & XN_FLAG_SEP_MASK) == 0)
|
||||
*flags |= XN_FLAG_SEP_CPLUS_SPC;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int set_ext_copy(int *copy_type, const char *arg)
|
||||
|
@@ -313,9 +313,9 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
typ = ASN1_TYPE_get(at);
|
||||
if ((typ == V_ASN1_OBJECT)
|
||||
|| (typ == V_ASN1_BOOLEAN)
|
||||
|| (typ == V_ASN1_NULL)) {
|
||||
BIO_printf(bio_err, "Can't parse %s type\n",
|
||||
typ == V_ASN1_NULL ? "NULL" : "OBJECT");
|
||||
BIO_printf(bio_err, "Can't parse %s type\n", ASN1_tag2str(typ));
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
14
apps/ca.c
14
apps/ca.c
@@ -99,25 +99,19 @@
|
||||
#undef PROG
|
||||
#define PROG ca_main
|
||||
|
||||
#define BASE_SECTION "ca"
|
||||
#define CONFIG_FILE "openssl.cnf"
|
||||
#define BASE_SECTION "ca"
|
||||
#define CONFIG_FILE "openssl.cnf"
|
||||
|
||||
#define ENV_DEFAULT_CA "default_ca"
|
||||
|
||||
#define STRING_MASK "string_mask"
|
||||
#define STRING_MASK "string_mask"
|
||||
#define UTF8_IN "utf8"
|
||||
|
||||
#define ENV_DIR "dir"
|
||||
#define ENV_CERTS "certs"
|
||||
#define ENV_CRL_DIR "crl_dir"
|
||||
#define ENV_CA_DB "CA_DB"
|
||||
#define ENV_NEW_CERTS_DIR "new_certs_dir"
|
||||
#define ENV_CERTIFICATE "certificate"
|
||||
#define ENV_SERIAL "serial"
|
||||
#define ENV_CRLNUMBER "crlnumber"
|
||||
#define ENV_CRL "crl"
|
||||
#define ENV_PRIVATE_KEY "private_key"
|
||||
#define ENV_RANDFILE "RANDFILE"
|
||||
#define ENV_DEFAULT_DAYS "default_days"
|
||||
#define ENV_DEFAULT_STARTDATE "default_startdate"
|
||||
#define ENV_DEFAULT_ENDDATE "default_enddate"
|
||||
@@ -2520,6 +2514,8 @@ static int do_updatedb(CA_DB *db)
|
||||
char **rrow, *a_tm_s;
|
||||
|
||||
a_tm = ASN1_UTCTIME_new();
|
||||
if (a_tm == NULL)
|
||||
return -1;
|
||||
|
||||
/* get actual time and make a string */
|
||||
a_tm = X509_gmtime_adj(a_tm, 0);
|
||||
|
@@ -413,14 +413,13 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (check) {
|
||||
if (group == NULL)
|
||||
BIO_printf(bio_err, "no elliptic curve parameters\n");
|
||||
BIO_printf(bio_err, "checking elliptic curve parameters: ");
|
||||
if (!EC_GROUP_check(group, NULL)) {
|
||||
BIO_printf(bio_err, "failed\n");
|
||||
ERR_print_errors(bio_err);
|
||||
} else
|
||||
BIO_printf(bio_err, "ok\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err, "ok\n");
|
||||
|
||||
}
|
||||
|
||||
|
@@ -99,8 +99,6 @@ static void identity(char *ptr)
|
||||
|
||||
static int append_buf(char **buf, const char *s, int *size, int step)
|
||||
{
|
||||
int l = strlen(s);
|
||||
|
||||
if (*buf == NULL) {
|
||||
*size = step;
|
||||
*buf = OPENSSL_malloc(*size);
|
||||
@@ -109,9 +107,6 @@ static int append_buf(char **buf, const char *s, int *size, int step)
|
||||
**buf = '\0';
|
||||
}
|
||||
|
||||
if (**buf != '\0')
|
||||
l += 2; /* ", " */
|
||||
|
||||
if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
|
||||
*size += step;
|
||||
*buf = OPENSSL_realloc(*buf, *size);
|
||||
|
@@ -1220,8 +1220,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (BIO_get_fd(cbio, &fd) <= 0) {
|
||||
BIO_puts(err, "Can't get connection fd\n");
|
||||
if (BIO_get_fd(cbio, &fd) < 0) {
|
||||
BIO_puts(bio_err, "Can't get connection fd\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
@@ -134,13 +134,6 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
apps_startup();
|
||||
|
||||
# ifdef OPENSSL_FIPS
|
||||
if (FIPS_mode())
|
||||
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
else
|
||||
# endif
|
||||
cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
|
||||
enc = EVP_des_ede3_cbc();
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
@@ -148,6 +141,13 @@ int MAIN(int argc, char **argv)
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
# ifdef OPENSSL_FIPS
|
||||
if (FIPS_mode())
|
||||
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
else
|
||||
# endif
|
||||
cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
|
||||
args = argv + 1;
|
||||
|
||||
while (*args) {
|
||||
|
@@ -1884,6 +1884,9 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY_free(key);
|
||||
if (pass)
|
||||
OPENSSL_free(pass);
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
OPENSSL_free(srp_arg.srppassin);
|
||||
#endif
|
||||
if (vpm)
|
||||
X509_VERIFY_PARAM_free(vpm);
|
||||
if (cbuf != NULL) {
|
||||
|
@@ -2654,6 +2654,21 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
goto err;
|
||||
} else {
|
||||
BIO_printf(bio_s_out, "read R BLOCK\n");
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
if (BIO_should_io_special(io)
|
||||
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
|
||||
BIO_printf(bio_s_out, "LOOKUP renego during read\n");
|
||||
srp_callback_parm.user =
|
||||
SRP_VBASE_get_by_user(srp_callback_parm.vb,
|
||||
srp_callback_parm.login);
|
||||
if (srp_callback_parm.user)
|
||||
BIO_printf(bio_s_out, "LOOKUP done %s\n",
|
||||
srp_callback_parm.user->info);
|
||||
else
|
||||
BIO_printf(bio_s_out, "LOOKUP not successful\n");
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if defined(OPENSSL_SYS_NETWARE)
|
||||
delay(1000);
|
||||
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
|
||||
|
60
appveyor.yml
Normal file
60
appveyor.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- VSVER: 9
|
||||
- VSVER: 10
|
||||
- VSVER: 11
|
||||
- VSVER: 12
|
||||
- VSVER: 14
|
||||
|
||||
configuration:
|
||||
- plain
|
||||
- shared
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- platform: x64
|
||||
VSVER: 9
|
||||
- platform: x64
|
||||
VSVER: 10
|
||||
- platform: x64
|
||||
VSVER: 11
|
||||
|
||||
before_build:
|
||||
- ps: >-
|
||||
If ($env:Platform -Match "x86") {
|
||||
$env:VCVARS_PLATFORM="x86"
|
||||
$env:TARGET="VC-WIN32"
|
||||
$env:DO="do_ms"
|
||||
} Else {
|
||||
$env:VCVARS_PLATFORM="amd64"
|
||||
$env:TARGET="VC-WIN64A"
|
||||
$env:DO="do_win64a"
|
||||
}
|
||||
- ps: >-
|
||||
If ($env:Configuration -Like "*shared*") {
|
||||
$env:MAK="ntdll.mak"
|
||||
} Else {
|
||||
$env:MAK="nt.mak"
|
||||
}
|
||||
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
|
||||
- call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
|
||||
- perl Configure %TARGET% no-asm
|
||||
- call ms\%DO%
|
||||
|
||||
build_script:
|
||||
- nmake /f ms\%MAK%
|
||||
|
||||
test_script:
|
||||
- nmake /f ms\%MAK% test
|
||||
|
||||
notifications:
|
||||
- provider: Email
|
||||
to:
|
||||
- openssl-commits@openssl.org
|
||||
on_build_success: false
|
||||
on_build_failure: true
|
||||
on_build_status_changed: true
|
@@ -1,8 +0,0 @@
|
||||
lib
|
||||
buildinf.h
|
||||
opensslconf.h
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
*cpuid.s
|
||||
uplink-cof.s
|
@@ -1,5 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
aes-*.s
|
@@ -45,7 +45,7 @@
|
||||
# the undertaken effort was that it appeared that in tight IA-32
|
||||
# register window little-endian flavor could achieve slightly higher
|
||||
# Instruction Level Parallelism, and it indeed resulted in up to 15%
|
||||
# better performance on most recent <EFBFBD>-archs...
|
||||
# better performance on most recent µ-archs...
|
||||
#
|
||||
# Third version adds AES_cbc_encrypt implementation, which resulted in
|
||||
# up to 40% performance imrovement of CBC benchmark results. 40% was
|
||||
@@ -223,7 +223,7 @@ sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
|
||||
$speed_limit=512; # chunks smaller than $speed_limit are
|
||||
# processed with compact routine in CBC mode
|
||||
$small_footprint=1; # $small_footprint=1 code is ~5% slower [on
|
||||
# recent <EFBFBD>-archs], but ~5 times smaller!
|
||||
# recent µ-archs], but ~5 times smaller!
|
||||
# I favor compact code to minimize cache
|
||||
# contention and in hope to "collect" 5% back
|
||||
# in real-life applications...
|
||||
@@ -562,7 +562,7 @@ sub enctransform()
|
||||
# Performance is not actually extraordinary in comparison to pure
|
||||
# x86 code. In particular encrypt performance is virtually the same.
|
||||
# Decrypt performance on the other hand is 15-20% better on newer
|
||||
# <EFBFBD>-archs [but we're thankful for *any* improvement here], and ~50%
|
||||
# µ-archs [but we're thankful for *any* improvement here], and ~50%
|
||||
# better on PIII:-) And additionally on the pros side this code
|
||||
# eliminates redundant references to stack and thus relieves/
|
||||
# minimizes the pressure on the memory bus.
|
||||
|
@@ -74,7 +74,7 @@ $inout3="xmm5"; $in1="xmm5";
|
||||
$inout4="xmm6"; $in0="xmm6";
|
||||
$inout5="xmm7"; $ivec="xmm7";
|
||||
|
||||
# AESNI extenstion
|
||||
# AESNI extension
|
||||
sub aeskeygenassist
|
||||
{ my($dst,$src,$imm)=@_;
|
||||
if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/)
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -62,6 +62,10 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
#ifndef ASN1_PARSE_MAXDEPTH
|
||||
#define ASN1_PARSE_MAXDEPTH 128
|
||||
#endif
|
||||
|
||||
static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
|
||||
int indent);
|
||||
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
|
||||
@@ -128,6 +132,12 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
|
||||
#else
|
||||
dump_indent = 6; /* Because we know BIO_dump_indent() */
|
||||
#endif
|
||||
|
||||
if (depth > ASN1_PARSE_MAXDEPTH) {
|
||||
BIO_puts(bp, "BAD RECURSION DEPTH\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
p = *pp;
|
||||
tot = p + length;
|
||||
op = p - 1;
|
||||
|
@@ -72,6 +72,7 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
EVP_PKEY *ret;
|
||||
const unsigned char *p = *pp;
|
||||
|
||||
if ((a == NULL) || (*a == NULL)) {
|
||||
if ((ret = EVP_PKEY_new()) == NULL) {
|
||||
@@ -94,21 +95,23 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
}
|
||||
|
||||
if (!ret->ameth->old_priv_decode ||
|
||||
!ret->ameth->old_priv_decode(ret, pp, length)) {
|
||||
!ret->ameth->old_priv_decode(ret, &p, length)) {
|
||||
if (ret->ameth->priv_decode) {
|
||||
PKCS8_PRIV_KEY_INFO *p8 = NULL;
|
||||
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length);
|
||||
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
|
||||
if (!p8)
|
||||
goto err;
|
||||
EVP_PKEY_free(ret);
|
||||
ret = EVP_PKCS82PKEY(p8);
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
|
||||
if (ret == NULL)
|
||||
goto err;
|
||||
} else {
|
||||
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
*pp = p;
|
||||
if (a != NULL)
|
||||
(*a) = ret;
|
||||
return (ret);
|
||||
@@ -136,6 +139,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
|
||||
* input is surrounded by an ASN1 SEQUENCE.
|
||||
*/
|
||||
inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length);
|
||||
p = *pp;
|
||||
/*
|
||||
* Since we only need to discern "traditional format" RSA and DSA keys we
|
||||
* can just count the elements.
|
||||
@@ -146,7 +150,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
|
||||
keytype = EVP_PKEY_EC;
|
||||
else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not
|
||||
* traditional format */
|
||||
PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length);
|
||||
PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
|
||||
EVP_PKEY *ret;
|
||||
|
||||
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
|
||||
@@ -157,6 +161,9 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
|
||||
}
|
||||
ret = EVP_PKCS82PKEY(p8);
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
*pp = p;
|
||||
if (a) {
|
||||
*a = ret;
|
||||
}
|
||||
|
@@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
int otag;
|
||||
int ret = 0;
|
||||
ASN1_VALUE **pchptr, *ptmpval;
|
||||
int combine = aclass & ASN1_TFLG_COMBINE;
|
||||
aclass &= ~ASN1_TFLG_COMBINE;
|
||||
if (!pval)
|
||||
return 0;
|
||||
if (aux && aux->asn1_cb)
|
||||
@@ -350,9 +352,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
}
|
||||
|
||||
asn1_set_choice_selector(pval, i, it);
|
||||
*in = p;
|
||||
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
|
||||
goto auxerr;
|
||||
*in = p;
|
||||
return 1;
|
||||
|
||||
case ASN1_ITYPE_NDEF_SEQUENCE:
|
||||
@@ -489,9 +491,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
/* Save encoding */
|
||||
if (!asn1_enc_save(pval, *in, p - *in, it))
|
||||
goto auxerr;
|
||||
*in = p;
|
||||
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
|
||||
goto auxerr;
|
||||
*in = p;
|
||||
return 1;
|
||||
|
||||
default:
|
||||
@@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
auxerr:
|
||||
ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR);
|
||||
err:
|
||||
ASN1_item_ex_free(pval, it);
|
||||
if (combine == 0)
|
||||
ASN1_item_ex_free(pval, it);
|
||||
if (errtt)
|
||||
ERR_add_error_data(4, "Field=", errtt->field_name,
|
||||
", Type=", it->sname);
|
||||
@@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
|
||||
} else {
|
||||
/* Nothing special */
|
||||
ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
|
||||
-1, 0, opt, ctx);
|
||||
-1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx);
|
||||
if (!ret) {
|
||||
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR);
|
||||
goto err;
|
||||
|
@@ -141,8 +141,9 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
||||
int utype, char *free_cont, const ASN1_ITEM *it)
|
||||
{
|
||||
BIGNUM *bn;
|
||||
if (!*pval)
|
||||
bn_new(pval, it);
|
||||
|
||||
if (*pval == NULL && !bn_new(pval, it))
|
||||
return 0;
|
||||
bn = (BIGNUM *)*pval;
|
||||
if (!BN_bin2bn(cont, len, bn)) {
|
||||
bn_free(pval, it);
|
||||
|
@@ -188,13 +188,16 @@ EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length)
|
||||
{
|
||||
X509_PUBKEY *xpk;
|
||||
EVP_PKEY *pktmp;
|
||||
xpk = d2i_X509_PUBKEY(NULL, pp, length);
|
||||
const unsigned char *q;
|
||||
q = *pp;
|
||||
xpk = d2i_X509_PUBKEY(NULL, &q, length);
|
||||
if (!xpk)
|
||||
return NULL;
|
||||
pktmp = X509_PUBKEY_get(xpk);
|
||||
X509_PUBKEY_free(xpk);
|
||||
if (!pktmp)
|
||||
return NULL;
|
||||
*pp = q;
|
||||
if (a) {
|
||||
EVP_PKEY_free(*a);
|
||||
*a = pktmp;
|
||||
|
@@ -180,16 +180,15 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
|
||||
if (!a || *a == NULL) {
|
||||
freeret = 1;
|
||||
}
|
||||
ret = d2i_X509(a, pp, length);
|
||||
ret = d2i_X509(a, &q, length);
|
||||
/* If certificate unreadable then forget it */
|
||||
if (!ret)
|
||||
return NULL;
|
||||
/* update length */
|
||||
length -= *pp - q;
|
||||
if (!length)
|
||||
return ret;
|
||||
if (!d2i_X509_CERT_AUX(&ret->aux, pp, length))
|
||||
length -= q - *pp;
|
||||
if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length))
|
||||
goto err;
|
||||
*pp = q;
|
||||
return ret;
|
||||
err:
|
||||
if (freeret) {
|
||||
|
@@ -1,5 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
bf-*.s
|
@@ -1,4 +0,0 @@
|
||||
bx86unix.cpp
|
||||
bx86-elf.s
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -104,7 +104,6 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
if ((rows * dump_width) < len)
|
||||
rows++;
|
||||
for (i = 0; i < rows; i++) {
|
||||
buf[0] = '\0'; /* start with empty string */
|
||||
BUF_strlcpy(buf, str, sizeof buf);
|
||||
BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
|
||||
BUF_strlcat(buf, tmp, sizeof buf);
|
||||
|
@@ -290,7 +290,7 @@ void BIO_clear_flags(BIO *b, int flags);
|
||||
* BIO_CB_RETURN flag indicates if it is after the call
|
||||
*/
|
||||
# define BIO_CB_RETURN 0x80
|
||||
# define BIO_CB_return(a) ((a)|BIO_CB_RETURN))
|
||||
# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
|
||||
# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
|
||||
# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
|
||||
|
||||
|
@@ -115,9 +115,8 @@ static BIO_METHOD methods_filep = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
BIO *BIO_new_file(const char *filename, const char *mode)
|
||||
static FILE *file_fopen(const char *filename, const char *mode)
|
||||
{
|
||||
BIO *ret;
|
||||
FILE *file = NULL;
|
||||
|
||||
# if defined(_WIN32) && defined(CP_UTF8)
|
||||
@@ -164,6 +163,14 @@ BIO *BIO_new_file(const char *filename, const char *mode)
|
||||
# else
|
||||
file = fopen(filename, mode);
|
||||
# endif
|
||||
return (file);
|
||||
}
|
||||
|
||||
BIO *BIO_new_file(const char *filename, const char *mode)
|
||||
{
|
||||
BIO *ret;
|
||||
FILE *file = file_fopen(filename, mode);
|
||||
|
||||
if (file == NULL) {
|
||||
SYSerr(SYS_F_FOPEN, get_last_sys_error());
|
||||
ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
|
||||
@@ -386,7 +393,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
else
|
||||
strcat(p, "t");
|
||||
# endif
|
||||
fp = fopen(ptr, p);
|
||||
fp = file_fopen(ptr, p);
|
||||
if (fp == NULL) {
|
||||
SYSerr(SYS_F_FOPEN, get_last_sys_error());
|
||||
ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");
|
||||
|
@@ -1,7 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
co-*.s
|
||||
bn-*.s
|
||||
*-mont.s
|
@@ -1,6 +0,0 @@
|
||||
bn86unix.cpp
|
||||
co86unix.cpp
|
||||
bn86-elf.s
|
||||
co86-elf.s
|
||||
*.flc
|
||||
semantic.cache
|
@@ -41,13 +41,13 @@ $code=<<___;
|
||||
.align 5
|
||||
mul_1x1_neon:
|
||||
vshl.u64 `&Dlo("q1")`,d16,#8 @ q1-q3 are slided $a
|
||||
vmull.p8 `&Q("d0")`,d16,d17 @ a<EFBFBD>bb
|
||||
vmull.p8 `&Q("d0")`,d16,d17 @ a·bb
|
||||
vshl.u64 `&Dlo("q2")`,d16,#16
|
||||
vmull.p8 q1,`&Dlo("q1")`,d17 @ a<<8<EFBFBD>bb
|
||||
vmull.p8 q1,`&Dlo("q1")`,d17 @ a<<8·bb
|
||||
vshl.u64 `&Dlo("q3")`,d16,#24
|
||||
vmull.p8 q2,`&Dlo("q2")`,d17 @ a<<16<EFBFBD>bb
|
||||
vmull.p8 q2,`&Dlo("q2")`,d17 @ a<<16·bb
|
||||
vshr.u64 `&Dlo("q1")`,#8
|
||||
vmull.p8 q3,`&Dlo("q3")`,d17 @ a<<24<EFBFBD>bb
|
||||
vmull.p8 q3,`&Dlo("q3")`,d17 @ a<<24·bb
|
||||
vshl.u64 `&Dhi("q1")`,#24
|
||||
veor d0,`&Dlo("q1")`
|
||||
vshr.u64 `&Dlo("q2")`,#16
|
||||
@@ -158,7 +158,7 @@ ___
|
||||
################
|
||||
# void bn_GF2m_mul_2x2(BN_ULONG *r,
|
||||
# BN_ULONG a1,BN_ULONG a0,
|
||||
# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0<EFBFBD>b1b0
|
||||
# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0·b1b0
|
||||
|
||||
($A1,$B1,$A0,$B0,$A1B1,$A0B0)=map("d$_",(18..23));
|
||||
|
||||
@@ -184,20 +184,20 @@ bn_GF2m_mul_2x2:
|
||||
|
||||
vmov d16,$A1
|
||||
vmov d17,$B1
|
||||
bl mul_1x1_neon @ a1<EFBFBD>b1
|
||||
bl mul_1x1_neon @ a1·b1
|
||||
vmov $A1B1,d0
|
||||
|
||||
vmov d16,$A0
|
||||
vmov d17,$B0
|
||||
bl mul_1x1_neon @ a0<EFBFBD>b0
|
||||
bl mul_1x1_neon @ a0·b0
|
||||
vmov $A0B0,d0
|
||||
|
||||
veor d16,$A0,$A1
|
||||
veor d17,$B0,$B1
|
||||
veor $A0,$A0B0,$A1B1
|
||||
bl mul_1x1_neon @ (a0+a1)<EFBFBD>(b0+b1)
|
||||
bl mul_1x1_neon @ (a0+a1)·(b0+b1)
|
||||
|
||||
veor d0,$A0 @ (a0+a1)<EFBFBD>(b0+b1)-a0<EFBFBD>b0-a1<EFBFBD>b1
|
||||
veor d0,$A0 @ (a0+a1)·(b0+b1)-a0·b0-a1·b1
|
||||
vshl.u64 d1,d0,#32
|
||||
vshr.u64 d0,d0,#32
|
||||
veor $A0B0,d1
|
||||
@@ -220,7 +220,7 @@ $code.=<<___;
|
||||
mov $mask,#7<<2
|
||||
sub sp,sp,#32 @ allocate tab[8]
|
||||
|
||||
bl mul_1x1_ialu @ a1<EFBFBD>b1
|
||||
bl mul_1x1_ialu @ a1·b1
|
||||
str $lo,[$ret,#8]
|
||||
str $hi,[$ret,#12]
|
||||
|
||||
@@ -230,13 +230,13 @@ $code.=<<___;
|
||||
eor r2,r2,$a
|
||||
eor $b,$b,r3
|
||||
eor $a,$a,r2
|
||||
bl mul_1x1_ialu @ a0<EFBFBD>b0
|
||||
bl mul_1x1_ialu @ a0·b0
|
||||
str $lo,[$ret]
|
||||
str $hi,[$ret,#4]
|
||||
|
||||
eor $a,$a,r2
|
||||
eor $b,$b,r3
|
||||
bl mul_1x1_ialu @ (a1+a0)<EFBFBD>(b1+b0)
|
||||
bl mul_1x1_ialu @ (a1+a0)·(b1+b0)
|
||||
___
|
||||
@r=map("r$_",(6..9));
|
||||
$code.=<<___;
|
||||
|
@@ -422,7 +422,7 @@ bn_mul_add_words:
|
||||
|
||||
// This loop spins in 3*(n+10) ticks on Itanium and in 2*(n+10) on
|
||||
// Itanium 2. Yes, unlike previous versions it scales:-) Previous
|
||||
// version was peforming *all* additions in IALU and was starving
|
||||
// version was performing *all* additions in IALU and was starving
|
||||
// for those even on Itanium 2. In this version one addition is
|
||||
// moved to FPU and is folded with multiplication. This is at cost
|
||||
// of propogating the result from previous call to this subroutine
|
||||
@@ -568,7 +568,7 @@ bn_sqr_comba8:
|
||||
// I've estimated this routine to run in ~120 ticks, but in reality
|
||||
// (i.e. according to ar.itc) it takes ~160 ticks. Are those extra
|
||||
// cycles consumed for instructions fetch? Or did I misinterpret some
|
||||
// clause in Itanium <EFBFBD>-architecture manual? Comments are welcomed and
|
||||
// clause in Itanium µ-architecture manual? Comments are welcomed and
|
||||
// highly appreciated.
|
||||
//
|
||||
// On Itanium 2 it takes ~190 ticks. This is because of stalls on
|
||||
|
@@ -172,19 +172,19 @@ ___
|
||||
if ($SIZE_T==8) {
|
||||
my @r=map("%r$_",(6..9));
|
||||
$code.=<<___;
|
||||
bras $ra,_mul_1x1 # a1<EFBFBD>b1
|
||||
bras $ra,_mul_1x1 # a1·b1
|
||||
stmg $lo,$hi,16($rp)
|
||||
|
||||
lg $a,`$stdframe+128+4*$SIZE_T`($sp)
|
||||
lg $b,`$stdframe+128+6*$SIZE_T`($sp)
|
||||
bras $ra,_mul_1x1 # a0<EFBFBD>b0
|
||||
bras $ra,_mul_1x1 # a0·b0
|
||||
stmg $lo,$hi,0($rp)
|
||||
|
||||
lg $a,`$stdframe+128+3*$SIZE_T`($sp)
|
||||
lg $b,`$stdframe+128+5*$SIZE_T`($sp)
|
||||
xg $a,`$stdframe+128+4*$SIZE_T`($sp)
|
||||
xg $b,`$stdframe+128+6*$SIZE_T`($sp)
|
||||
bras $ra,_mul_1x1 # (a0+a1)<EFBFBD>(b0+b1)
|
||||
bras $ra,_mul_1x1 # (a0+a1)·(b0+b1)
|
||||
lmg @r[0],@r[3],0($rp)
|
||||
|
||||
xgr $lo,$hi
|
||||
|
@@ -14,7 +14,7 @@
|
||||
# the time being... Except that it has three code paths: pure integer
|
||||
# code suitable for any x86 CPU, MMX code suitable for PIII and later
|
||||
# and PCLMULQDQ suitable for Westmere and later. Improvement varies
|
||||
# from one benchmark and <EFBFBD>-arch to another. Below are interval values
|
||||
# from one benchmark and µ-arch to another. Below are interval values
|
||||
# for 163- and 571-bit ECDH benchmarks relative to compiler-generated
|
||||
# code:
|
||||
#
|
||||
@@ -226,22 +226,22 @@ if ($sse2) {
|
||||
&push ("edi");
|
||||
&mov ($a,&wparam(1));
|
||||
&mov ($b,&wparam(3));
|
||||
&call ("_mul_1x1_mmx"); # a1<EFBFBD>b1
|
||||
&call ("_mul_1x1_mmx"); # a1·b1
|
||||
&movq ("mm7",$R);
|
||||
|
||||
&mov ($a,&wparam(2));
|
||||
&mov ($b,&wparam(4));
|
||||
&call ("_mul_1x1_mmx"); # a0<EFBFBD>b0
|
||||
&call ("_mul_1x1_mmx"); # a0·b0
|
||||
&movq ("mm6",$R);
|
||||
|
||||
&mov ($a,&wparam(1));
|
||||
&mov ($b,&wparam(3));
|
||||
&xor ($a,&wparam(2));
|
||||
&xor ($b,&wparam(4));
|
||||
&call ("_mul_1x1_mmx"); # (a0+a1)<EFBFBD>(b0+b1)
|
||||
&call ("_mul_1x1_mmx"); # (a0+a1)·(b0+b1)
|
||||
&pxor ($R,"mm7");
|
||||
&mov ($a,&wparam(0));
|
||||
&pxor ($R,"mm6"); # (a0+a1)<EFBFBD>(b0+b1)-a1<EFBFBD>b1-a0<EFBFBD>b0
|
||||
&pxor ($R,"mm6"); # (a0+a1)·(b0+b1)-a1·b1-a0·b0
|
||||
|
||||
&movq ($A,$R);
|
||||
&psllq ($R,32);
|
||||
@@ -266,13 +266,13 @@ if ($sse2) {
|
||||
|
||||
&mov ($a,&wparam(1));
|
||||
&mov ($b,&wparam(3));
|
||||
&call ("_mul_1x1_ialu"); # a1<EFBFBD>b1
|
||||
&call ("_mul_1x1_ialu"); # a1·b1
|
||||
&mov (&DWP(8,"esp"),$lo);
|
||||
&mov (&DWP(12,"esp"),$hi);
|
||||
|
||||
&mov ($a,&wparam(2));
|
||||
&mov ($b,&wparam(4));
|
||||
&call ("_mul_1x1_ialu"); # a0<EFBFBD>b0
|
||||
&call ("_mul_1x1_ialu"); # a0·b0
|
||||
&mov (&DWP(0,"esp"),$lo);
|
||||
&mov (&DWP(4,"esp"),$hi);
|
||||
|
||||
@@ -280,7 +280,7 @@ if ($sse2) {
|
||||
&mov ($b,&wparam(3));
|
||||
&xor ($a,&wparam(2));
|
||||
&xor ($b,&wparam(4));
|
||||
&call ("_mul_1x1_ialu"); # (a0+a1)<EFBFBD>(b0+b1)
|
||||
&call ("_mul_1x1_ialu"); # (a0+a1)·(b0+b1)
|
||||
|
||||
&mov ("ebp",&wparam(0));
|
||||
@r=("ebx","ecx","edi","esi");
|
||||
|
@@ -66,7 +66,7 @@
|
||||
# undef sqr
|
||||
|
||||
/*-
|
||||
* "m"(a), "+m"(r) is the way to favor DirectPath <EFBFBD>-code;
|
||||
* "m"(a), "+m"(r) is the way to favor DirectPath µ-code;
|
||||
* "g"(0) let the compiler to decide where does it
|
||||
* want to keep the value of zero;
|
||||
*/
|
||||
|
@@ -13,7 +13,7 @@
|
||||
# in bn_gf2m.c. It's kind of low-hanging mechanical port from C for
|
||||
# the time being... Except that it has two code paths: code suitable
|
||||
# for any x86_64 CPU and PCLMULQDQ one suitable for Westmere and
|
||||
# later. Improvement varies from one benchmark and <EFBFBD>-arch to another.
|
||||
# later. Improvement varies from one benchmark and µ-arch to another.
|
||||
# Vanilla code path is at most 20% faster than compiler-generated code
|
||||
# [not very impressive], while PCLMULQDQ - whole 85%-160% better on
|
||||
# 163- and 571-bit ECDH benchmarks on Intel CPUs. Keep in mind that
|
||||
@@ -184,13 +184,13 @@ ___
|
||||
$code.=<<___;
|
||||
movdqa %xmm0,%xmm4
|
||||
movdqa %xmm1,%xmm5
|
||||
pclmulqdq \$0,%xmm1,%xmm0 # a1<EFBFBD>b1
|
||||
pclmulqdq \$0,%xmm1,%xmm0 # a1·b1
|
||||
pxor %xmm2,%xmm4
|
||||
pxor %xmm3,%xmm5
|
||||
pclmulqdq \$0,%xmm3,%xmm2 # a0<EFBFBD>b0
|
||||
pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)<EFBFBD>(b0+b1)
|
||||
pclmulqdq \$0,%xmm3,%xmm2 # a0·b0
|
||||
pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)·(b0+b1)
|
||||
xorps %xmm0,%xmm4
|
||||
xorps %xmm2,%xmm4 # (a0+a1)<EFBFBD>(b0+b1)-a0<EFBFBD>b0-a1<EFBFBD>b1
|
||||
xorps %xmm2,%xmm4 # (a0+a1)·(b0+b1)-a0·b0-a1·b1
|
||||
movdqa %xmm4,%xmm5
|
||||
pslldq \$8,%xmm4
|
||||
psrldq \$8,%xmm5
|
||||
@@ -225,13 +225,13 @@ $code.=<<___;
|
||||
mov \$0xf,$mask
|
||||
mov $a1,$a
|
||||
mov $b1,$b
|
||||
call _mul_1x1 # a1<EFBFBD>b1
|
||||
call _mul_1x1 # a1·b1
|
||||
mov $lo,16(%rsp)
|
||||
mov $hi,24(%rsp)
|
||||
|
||||
mov 48(%rsp),$a
|
||||
mov 64(%rsp),$b
|
||||
call _mul_1x1 # a0<EFBFBD>b0
|
||||
call _mul_1x1 # a0·b0
|
||||
mov $lo,0(%rsp)
|
||||
mov $hi,8(%rsp)
|
||||
|
||||
@@ -239,7 +239,7 @@ $code.=<<___;
|
||||
mov 56(%rsp),$b
|
||||
xor 48(%rsp),$a
|
||||
xor 64(%rsp),$b
|
||||
call _mul_1x1 # (a0+a1)<EFBFBD>(b0+b1)
|
||||
call _mul_1x1 # (a0+a1)·(b0+b1)
|
||||
___
|
||||
@r=("%rbx","%rcx","%rdi","%rsi");
|
||||
$code.=<<___;
|
||||
|
@@ -599,12 +599,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
bn_check_top(p);
|
||||
bn_check_top(m);
|
||||
|
||||
top = m->top;
|
||||
|
||||
if (!(m->d[0] & 1)) {
|
||||
if (!BN_is_odd(m)) {
|
||||
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
|
||||
return (0);
|
||||
}
|
||||
|
||||
top = m->top;
|
||||
|
||||
bits = BN_num_bits(p);
|
||||
if (bits == 0) {
|
||||
ret = BN_one(rr);
|
||||
|
@@ -583,6 +583,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
|
||||
* BN_div_no_branch will be called eventually.
|
||||
*/
|
||||
pB = &local_B;
|
||||
local_B.flags = 0;
|
||||
BN_with_flags(pB, B, BN_FLG_CONSTTIME);
|
||||
if (!BN_nnmod(B, pB, A, ctx))
|
||||
goto err;
|
||||
@@ -610,6 +611,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
|
||||
* BN_div_no_branch will be called eventually.
|
||||
*/
|
||||
pA = &local_A;
|
||||
local_A.flags = 0;
|
||||
BN_with_flags(pA, A, BN_FLG_CONSTTIME);
|
||||
|
||||
/* (D, M) := (A/B, A%B) ... */
|
||||
|
@@ -576,7 +576,7 @@ int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
|
||||
bn_check_top(a);
|
||||
BN_CTX_start(ctx);
|
||||
if ((s = BN_CTX_get(ctx)) == NULL)
|
||||
return 0;
|
||||
goto err;
|
||||
if (!bn_wexpand(s, 2 * a->top))
|
||||
goto err;
|
||||
|
||||
@@ -700,18 +700,21 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
||||
int top = p->top;
|
||||
BN_ULONG *udp, *bdp, *vdp, *cdp;
|
||||
|
||||
bn_wexpand(u, top);
|
||||
if (!bn_wexpand(u, top))
|
||||
goto err;
|
||||
udp = u->d;
|
||||
for (i = u->top; i < top; i++)
|
||||
udp[i] = 0;
|
||||
u->top = top;
|
||||
bn_wexpand(b, top);
|
||||
if (!bn_wexpand(b, top))
|
||||
goto err;
|
||||
bdp = b->d;
|
||||
bdp[0] = 1;
|
||||
for (i = 1; i < top; i++)
|
||||
bdp[i] = 0;
|
||||
b->top = top;
|
||||
bn_wexpand(c, top);
|
||||
if (!bn_wexpand(c, top))
|
||||
goto err;
|
||||
cdp = c->d;
|
||||
for (i = 0; i < top; i++)
|
||||
cdp[i] = 0;
|
||||
|
@@ -361,9 +361,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont)
|
||||
if (mont == NULL)
|
||||
return;
|
||||
|
||||
BN_free(&(mont->RR));
|
||||
BN_free(&(mont->N));
|
||||
BN_free(&(mont->Ni));
|
||||
BN_clear_free(&(mont->RR));
|
||||
BN_clear_free(&(mont->N));
|
||||
BN_clear_free(&(mont->Ni));
|
||||
if (mont->flags & BN_FLG_MALLOCED)
|
||||
OPENSSL_free(mont);
|
||||
}
|
||||
@@ -373,6 +373,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
|
||||
int ret = 0;
|
||||
BIGNUM *Ri, *R;
|
||||
|
||||
if (BN_is_zero(mod))
|
||||
return 0;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
if ((Ri = BN_CTX_get(ctx)) == NULL)
|
||||
goto err;
|
||||
|
@@ -152,8 +152,10 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
|
||||
|
||||
if (BN_ucmp(m, &(recp->N)) < 0) {
|
||||
BN_zero(d);
|
||||
if (!BN_copy(r, m))
|
||||
if (!BN_copy(r, m)) {
|
||||
BN_CTX_end(ctx);
|
||||
return 0;
|
||||
}
|
||||
BN_CTX_end(ctx);
|
||||
return (1);
|
||||
}
|
||||
|
@@ -213,14 +213,14 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
|
||||
* exceeded.
|
||||
*/
|
||||
if (!BN_rand(Xp, nbits, 1, 0))
|
||||
return 0;
|
||||
goto err;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
t = BN_CTX_get(ctx);
|
||||
|
||||
for (i = 0; i < 1000; i++) {
|
||||
if (!BN_rand(Xq, nbits, 1, 0))
|
||||
return 0;
|
||||
goto err;
|
||||
/* Check that |Xp - Xq| > 2^(nbits - 100) */
|
||||
BN_sub(t, Xp, Xq);
|
||||
if (BN_num_bits(t) > (nbits - 100))
|
||||
@@ -234,6 +234,9 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
BN_CTX_end(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -441,6 +441,14 @@ int test_div(BIO *bp, BN_CTX *ctx)
|
||||
BN_init(&d);
|
||||
BN_init(&e);
|
||||
|
||||
BN_one(&a);
|
||||
BN_zero(&b);
|
||||
|
||||
if (BN_div(&d, &c, &a, &b, ctx)) {
|
||||
fprintf(stderr, "Division by zero succeeded!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < num0 + num1; i++) {
|
||||
if (i < num1) {
|
||||
BN_bntest_rand(&a, 400, 0, 0);
|
||||
@@ -516,9 +524,9 @@ int test_div_word(BIO *bp)
|
||||
do {
|
||||
BN_bntest_rand(&a, 512, -1, 0);
|
||||
BN_bntest_rand(&b, BN_BITS2, -1, 0);
|
||||
s = b.d[0];
|
||||
} while (!s);
|
||||
} while (BN_is_zero(&b));
|
||||
|
||||
s = b.d[0];
|
||||
BN_copy(&b, &a);
|
||||
r = BN_div_word(&b, s);
|
||||
|
||||
@@ -781,6 +789,18 @@ int test_mont(BIO *bp, BN_CTX *ctx)
|
||||
if (mont == NULL)
|
||||
return 0;
|
||||
|
||||
BN_zero(&n);
|
||||
if (BN_MONT_CTX_set(mont, &n, ctx)) {
|
||||
fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_set_word(&n, 16);
|
||||
if (BN_MONT_CTX_set(mont, &n, ctx)) {
|
||||
fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_bntest_rand(&a, 100, 0, 0);
|
||||
BN_bntest_rand(&b, 100, 0, 0);
|
||||
for (i = 0; i < num2; i++) {
|
||||
@@ -887,6 +907,14 @@ int test_mod_mul(BIO *bp, BN_CTX *ctx)
|
||||
d = BN_new();
|
||||
e = BN_new();
|
||||
|
||||
BN_one(a);
|
||||
BN_one(b);
|
||||
BN_zero(c);
|
||||
if (BN_mod_mul(e, a, b, c, ctx)) {
|
||||
fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
BN_bntest_rand(c, 1024, 0, 0);
|
||||
for (i = 0; i < num0; i++) {
|
||||
@@ -952,6 +980,14 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
|
||||
d = BN_new();
|
||||
e = BN_new();
|
||||
|
||||
BN_one(a);
|
||||
BN_one(b);
|
||||
BN_zero(c);
|
||||
if (BN_mod_exp(d, a, b, c, ctx)) {
|
||||
fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
|
||||
for (i = 0; i < num2; i++) {
|
||||
BN_bntest_rand(a, 20 + i * 5, 0, 0);
|
||||
@@ -999,6 +1035,22 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
|
||||
d = BN_new();
|
||||
e = BN_new();
|
||||
|
||||
BN_one(a);
|
||||
BN_one(b);
|
||||
BN_zero(c);
|
||||
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
|
||||
fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
|
||||
"succeeded\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_set_word(c, 16);
|
||||
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
|
||||
fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
|
||||
"succeeded\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
|
||||
for (i = 0; i < num2; i++) {
|
||||
BN_bntest_rand(a, 20 + i * 5, 0, 0);
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -58,12 +58,13 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "cryptlib.h"
|
||||
#include <limits.h>
|
||||
#include <openssl/buffer.h>
|
||||
|
||||
char *BUF_strdup(const char *str)
|
||||
{
|
||||
if (str == NULL)
|
||||
return (NULL);
|
||||
return NULL;
|
||||
return BUF_strndup(str, strlen(str));
|
||||
}
|
||||
|
||||
@@ -72,14 +73,20 @@ char *BUF_strndup(const char *str, size_t siz)
|
||||
char *ret;
|
||||
|
||||
if (str == NULL)
|
||||
return (NULL);
|
||||
return NULL;
|
||||
|
||||
if (siz >= INT_MAX)
|
||||
return NULL;
|
||||
|
||||
ret = OPENSSL_malloc(siz + 1);
|
||||
if (ret == NULL) {
|
||||
BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
BUF_strlcpy(ret, str, siz + 1);
|
||||
|
||||
memcpy(ret, str, siz);
|
||||
ret[siz] = '\0';
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
@@ -87,13 +94,13 @@ void *BUF_memdup(const void *data, size_t siz)
|
||||
{
|
||||
void *ret;
|
||||
|
||||
if (data == NULL)
|
||||
return (NULL);
|
||||
if (data == NULL || siz >= INT_MAX)
|
||||
return NULL;
|
||||
|
||||
ret = OPENSSL_malloc(siz);
|
||||
if (ret == NULL) {
|
||||
BUFerr(BUF_F_BUF_MEMDUP, ERR_R_MALLOC_FAILURE);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
return memcpy(ret, data, siz);
|
||||
}
|
||||
|
@@ -85,7 +85,13 @@ void BUF_MEM_free(BUF_MEM *a);
|
||||
int BUF_MEM_grow(BUF_MEM *str, size_t len);
|
||||
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
|
||||
char *BUF_strdup(const char *str);
|
||||
|
||||
/*
|
||||
* Like strndup, but in addition, explicitly guarantees to never read past the
|
||||
* first |siz| bytes of |str|.
|
||||
*/
|
||||
char *BUF_strndup(const char *str, size_t siz);
|
||||
|
||||
void *BUF_memdup(const void *data, size_t siz);
|
||||
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
cmll-*.s
|
@@ -1,6 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
cx86-*.s
|
||||
cast-586.s
|
@@ -1,4 +0,0 @@
|
||||
cx86unix.cpp
|
||||
cx86-elf.s
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
|
||||
ok = 1;
|
||||
|
||||
err:
|
||||
if (ec->key && !keep_key) {
|
||||
if (ec->key && (!keep_key || !ok)) {
|
||||
OPENSSL_cleanse(ec->key, ec->keylen);
|
||||
OPENSSL_free(ec->key);
|
||||
ec->key = NULL;
|
||||
|
@@ -121,6 +121,9 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
|
||||
|
||||
/* Setup algorithm identifier for cipher */
|
||||
encalg = X509_ALGOR_new();
|
||||
if (encalg == NULL) {
|
||||
goto merr;
|
||||
}
|
||||
EVP_CIPHER_CTX_init(&ctx);
|
||||
|
||||
if (EVP_EncryptInit_ex(&ctx, kekciph, NULL, NULL, NULL) <= 0) {
|
||||
|
@@ -714,7 +714,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)
|
||||
BIO *cmsbio;
|
||||
int ret = 0;
|
||||
if (!(cmsbio = CMS_dataInit(cms, dcont))) {
|
||||
CMSerr(CMS_F_CMS_FINAL, ERR_R_MALLOC_FAILURE);
|
||||
CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -404,8 +404,9 @@ COMP_METHOD *COMP_zlib(void)
|
||||
void COMP_zlib_cleanup(void)
|
||||
{
|
||||
#ifdef ZLIB_SHARED
|
||||
if (zlib_dso)
|
||||
if (zlib_dso != NULL)
|
||||
DSO_free(zlib_dso);
|
||||
zlib_dso = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -225,12 +225,11 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
|
||||
goto err;
|
||||
}
|
||||
|
||||
section = (char *)OPENSSL_malloc(10);
|
||||
section = BUF_strdup("default");
|
||||
if (section == NULL) {
|
||||
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
BUF_strlcpy(section, "default", 10);
|
||||
|
||||
if (_CONF_new_data(conf) == 0) {
|
||||
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
|
||||
|
@@ -90,6 +90,7 @@ void OPENSSL_config(const char *config_name)
|
||||
CONF_modules_load_file(NULL, config_name,
|
||||
CONF_MFLAGS_DEFAULT_SECTION |
|
||||
CONF_MFLAGS_IGNORE_MISSING_FILE);
|
||||
openssl_configured = 1;
|
||||
}
|
||||
|
||||
void OPENSSL_no_config()
|
||||
|
@@ -930,13 +930,29 @@ void OPENSSL_showfatal(const char *fmta, ...)
|
||||
# if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
|
||||
/* this -------------v--- guards NT-specific calls */
|
||||
if (check_winnt() && OPENSSL_isservice() > 0) {
|
||||
HANDLE h = RegisterEventSource(0, _T("OPENSSL"));
|
||||
const TCHAR *pmsg = buf;
|
||||
ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 0, 0, 1, 0, &pmsg, 0);
|
||||
DeregisterEventSource(h);
|
||||
HANDLE hEventLog = RegisterEventSource(NULL, _T("OpenSSL"));
|
||||
|
||||
if (hEventLog != NULL) {
|
||||
const TCHAR *pmsg = buf;
|
||||
|
||||
if (!ReportEvent(hEventLog, EVENTLOG_ERROR_TYPE, 0, 0, NULL,
|
||||
1, 0, &pmsg, NULL)) {
|
||||
#if defined(DEBUG)
|
||||
/*
|
||||
* We are in a situation where we tried to report a critical
|
||||
* error and this failed for some reason. As a last resort,
|
||||
* in debug builds, send output to the debugger or any other
|
||||
* tool like DebugView which can monitor the output.
|
||||
*/
|
||||
OutputDebugString(pmsg);
|
||||
#endif
|
||||
}
|
||||
|
||||
(void)DeregisterEventSource(hEventLog);
|
||||
}
|
||||
} else
|
||||
# endif
|
||||
MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONSTOP);
|
||||
MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONERROR);
|
||||
}
|
||||
#else
|
||||
void OPENSSL_showfatal(const char *fmta, ...)
|
||||
|
@@ -1,7 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
des
|
||||
*.flc
|
||||
semantic.cache
|
||||
crypt*.s
|
||||
des-*.s
|
@@ -1,7 +0,0 @@
|
||||
dx86unix.cpp
|
||||
yx86unix.cpp
|
||||
des_enc-sparc.S
|
||||
dx86-elf.s
|
||||
yx86-elf.s
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -318,6 +318,7 @@ static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
dplen = i2d_ASN1_INTEGER(prkey, &dp);
|
||||
|
||||
ASN1_STRING_clear_free(prkey);
|
||||
prkey = NULL;
|
||||
|
||||
if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_dsa), 0,
|
||||
V_ASN1_SEQUENCE, params, dp, dplen))
|
||||
|
@@ -112,16 +112,8 @@ int DSA_generate_parameters_ex(DSA *ret, int bits,
|
||||
}
|
||||
# endif
|
||||
else {
|
||||
const EVP_MD *evpmd;
|
||||
size_t qbits = bits >= 2048 ? 256 : 160;
|
||||
|
||||
if (bits >= 2048) {
|
||||
qbits = 256;
|
||||
evpmd = EVP_sha256();
|
||||
} else {
|
||||
qbits = 160;
|
||||
evpmd = EVP_sha1();
|
||||
}
|
||||
const EVP_MD *evpmd = bits >= 2048 ? EVP_sha256() : EVP_sha1();
|
||||
size_t qbits = EVP_MD_size(evpmd) * 8;
|
||||
|
||||
return dsa_builtin_paramgen(ret, bits, qbits, evpmd,
|
||||
seed_in, seed_len, NULL, counter_ret,
|
||||
@@ -174,13 +166,14 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
|
||||
if (seed_in != NULL)
|
||||
memcpy(seed, seed_in, seed_len);
|
||||
|
||||
if ((ctx = BN_CTX_new()) == NULL)
|
||||
goto err;
|
||||
|
||||
if ((mont = BN_MONT_CTX_new()) == NULL)
|
||||
goto err;
|
||||
|
||||
if ((ctx = BN_CTX_new()) == NULL)
|
||||
goto err;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
|
||||
r0 = BN_CTX_get(ctx);
|
||||
g = BN_CTX_get(ctx);
|
||||
W = BN_CTX_get(ctx);
|
||||
@@ -201,7 +194,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
|
||||
if (!BN_GENCB_call(cb, 0, m++))
|
||||
goto err;
|
||||
|
||||
if (!seed_len) {
|
||||
if (!seed_len || !seed_in) {
|
||||
if (RAND_pseudo_bytes(seed, qsize) < 0)
|
||||
goto err;
|
||||
seed_is_random = 1;
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -106,7 +106,7 @@ typedef enum {
|
||||
/** the point is encoded as z||x, where the octet z specifies
|
||||
* which solution of the quadratic equation y is */
|
||||
POINT_CONVERSION_COMPRESSED = 2,
|
||||
/** the point is encoded as z||x||y, where z is the octet 0x02 */
|
||||
/** the point is encoded as z||x||y, where z is the octet 0x04 */
|
||||
POINT_CONVERSION_UNCOMPRESSED = 4,
|
||||
/** the point is encoded as z||x||y, where the octet z specifies
|
||||
* which solution of the quadratic equation y is */
|
||||
|
@@ -970,8 +970,9 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)
|
||||
{
|
||||
EC_GROUP *group = NULL;
|
||||
ECPKPARAMETERS *params = NULL;
|
||||
const unsigned char *p = *in;
|
||||
|
||||
if ((params = d2i_ECPKPARAMETERS(NULL, in, len)) == NULL) {
|
||||
if ((params = d2i_ECPKPARAMETERS(NULL, &p, len)) == NULL) {
|
||||
ECerr(EC_F_D2I_ECPKPARAMETERS, EC_R_D2I_ECPKPARAMETERS_FAILURE);
|
||||
ECPKPARAMETERS_free(params);
|
||||
return NULL;
|
||||
@@ -989,6 +990,7 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)
|
||||
*a = group;
|
||||
|
||||
ECPKPARAMETERS_free(params);
|
||||
*in = p;
|
||||
return (group);
|
||||
}
|
||||
|
||||
@@ -1016,8 +1018,9 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
|
||||
int ok = 0;
|
||||
EC_KEY *ret = NULL;
|
||||
EC_PRIVATEKEY *priv_key = NULL;
|
||||
const unsigned char *p = *in;
|
||||
|
||||
if ((priv_key = d2i_EC_PRIVATEKEY(NULL, in, len)) == NULL) {
|
||||
if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) {
|
||||
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1096,6 +1099,7 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
|
||||
|
||||
if (a)
|
||||
*a = ret;
|
||||
*in = p;
|
||||
ok = 1;
|
||||
err:
|
||||
if (!ok) {
|
||||
|
@@ -366,7 +366,10 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
|
||||
BN_CTX *ctx = NULL;
|
||||
BIGNUM *tx, *ty;
|
||||
EC_POINT *point = NULL;
|
||||
int ok = 0, tmp_nid, is_char_two = 0;
|
||||
int ok = 0;
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
int tmp_nid, is_char_two = 0;
|
||||
#endif
|
||||
|
||||
if (!key || !key->group || !x || !y) {
|
||||
ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES,
|
||||
@@ -382,14 +385,15 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
|
||||
if (!point)
|
||||
goto err;
|
||||
|
||||
tx = BN_CTX_get(ctx);
|
||||
ty = BN_CTX_get(ctx);
|
||||
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group));
|
||||
|
||||
if (tmp_nid == NID_X9_62_characteristic_two_field)
|
||||
is_char_two = 1;
|
||||
|
||||
tx = BN_CTX_get(ctx);
|
||||
ty = BN_CTX_get(ctx);
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
if (is_char_two) {
|
||||
if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point,
|
||||
x, y, ctx))
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,2 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1230,15 +1230,18 @@ static DSA_SIG *cryptodev_dsa_do_sign(const unsigned char *dgst, int dlen,
|
||||
if (cryptodev_asym(&kop, BN_num_bytes(dsa->q), r,
|
||||
BN_num_bytes(dsa->q), s) == 0) {
|
||||
dsaret = DSA_SIG_new();
|
||||
if (dsaret == NULL)
|
||||
goto err;
|
||||
dsaret->r = r;
|
||||
dsaret->s = s;
|
||||
r = s = NULL;
|
||||
} else {
|
||||
const DSA_METHOD *meth = DSA_OpenSSL();
|
||||
BN_free(r);
|
||||
BN_free(s);
|
||||
dsaret = (meth->dsa_do_sign) (dgst, dlen, dsa);
|
||||
}
|
||||
err:
|
||||
BN_free(r);
|
||||
BN_free(s);
|
||||
kop.crk_param[0].crp_p = NULL;
|
||||
zapparams(&kop);
|
||||
return (dsaret);
|
||||
|
@@ -260,6 +260,7 @@ int ENGINE_add(ENGINE *e)
|
||||
}
|
||||
if ((e->id == NULL) || (e->name == NULL)) {
|
||||
ENGINEerr(ENGINE_F_ENGINE_ADD, ENGINE_R_ID_OR_NAME_MISSING);
|
||||
return 0;
|
||||
}
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
|
||||
if (!engine_list_add(e)) {
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1146,7 +1146,7 @@ static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
|
||||
case EVP_CTRL_CCM_SET_TAG:
|
||||
if ((arg & 1) || arg < 4 || arg > 16)
|
||||
return 0;
|
||||
if ((c->encrypt && ptr) || (!c->encrypt && !ptr))
|
||||
if (c->encrypt && ptr)
|
||||
return 0;
|
||||
if (ptr) {
|
||||
cctx->tag_set = 1;
|
||||
|
@@ -241,7 +241,7 @@ static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
DES_cblock *deskey = (DES_cblock *)key;
|
||||
# ifdef EVP_CHECK_DES_KEY
|
||||
if (DES_set_key_checked(&deskey[0], &data(ctx)->ks1)
|
||||
! !DES_set_key_checked(&deskey[1], &data(ctx)->ks2))
|
||||
|| DES_set_key_checked(&deskey[1], &data(ctx)->ks2))
|
||||
return 0;
|
||||
# else
|
||||
DES_set_key_unchecked(&deskey[0], &data(ctx)->ks1);
|
||||
|
@@ -60,9 +60,9 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/evp.h>
|
||||
|
||||
static unsigned char conv_ascii2bin(unsigned char a);
|
||||
#ifndef CHARSET_EBCDIC
|
||||
# define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
|
||||
# define conv_ascii2bin(a) (data_ascii2bin[(a)&0x7f])
|
||||
#else
|
||||
/*
|
||||
* We assume that PEM encoded files are EBCDIC files (i.e., printable text
|
||||
@@ -71,7 +71,6 @@
|
||||
* as the underlying textstring data_bin2ascii[] is already EBCDIC)
|
||||
*/
|
||||
# define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
|
||||
# define conv_ascii2bin(a) (data_ascii2bin[os_toascii[a]&0x7f])
|
||||
#endif
|
||||
|
||||
/*-
|
||||
@@ -103,6 +102,7 @@ abcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
#define B64_WS 0xE0
|
||||
#define B64_ERROR 0xFF
|
||||
#define B64_NOT_BASE64(a) (((a)|0x13) == 0xF3)
|
||||
#define B64_BASE64(a) !B64_NOT_BASE64(a)
|
||||
|
||||
static const unsigned char data_ascii2bin[128] = {
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
@@ -123,6 +123,23 @@ static const unsigned char data_ascii2bin[128] = {
|
||||
0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
};
|
||||
|
||||
#ifndef CHARSET_EBCDIC
|
||||
static unsigned char conv_ascii2bin(unsigned char a)
|
||||
{
|
||||
if (a & 0x80)
|
||||
return B64_ERROR;
|
||||
return data_ascii2bin[a];
|
||||
}
|
||||
#else
|
||||
static unsigned char conv_ascii2bin(unsigned char a)
|
||||
{
|
||||
a = os_toascii[a];
|
||||
if (a & 0x80)
|
||||
return B64_ERROR;
|
||||
return data_ascii2bin[a];
|
||||
}
|
||||
#endif
|
||||
|
||||
void EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
|
||||
{
|
||||
ctx->length = 48;
|
||||
@@ -218,8 +235,9 @@ int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)
|
||||
|
||||
void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
|
||||
{
|
||||
ctx->length = 30;
|
||||
/* Only ctx->num is used during decoding. */
|
||||
ctx->num = 0;
|
||||
ctx->length = 0;
|
||||
ctx->line_num = 0;
|
||||
ctx->expect_nl = 0;
|
||||
}
|
||||
@@ -228,139 +246,123 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
|
||||
* -1 for error
|
||||
* 0 for last line
|
||||
* 1 for full line
|
||||
*
|
||||
* Note: even though EVP_DecodeUpdate attempts to detect and report end of
|
||||
* content, the context doesn't currently remember it and will accept more data
|
||||
* in the next call. Therefore, the caller is responsible for checking and
|
||||
* rejecting a 0 return value in the middle of content.
|
||||
*
|
||||
* Note: even though EVP_DecodeUpdate has historically tried to detect end of
|
||||
* content based on line length, this has never worked properly. Therefore,
|
||||
* we now return 0 when one of the following is true:
|
||||
* - Padding or B64_EOF was detected and the last block is complete.
|
||||
* - Input has zero-length.
|
||||
* -1 is returned if:
|
||||
* - Invalid characters are detected.
|
||||
* - There is extra trailing padding, or data after padding.
|
||||
* - B64_EOF is detected after an incomplete base64 block.
|
||||
*/
|
||||
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
|
||||
const unsigned char *in, int inl)
|
||||
{
|
||||
int seof = -1, eof = 0, rv = -1, ret = 0, i, v, tmp, n, ln, exp_nl;
|
||||
int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;
|
||||
unsigned char *d;
|
||||
|
||||
n = ctx->num;
|
||||
d = ctx->enc_data;
|
||||
ln = ctx->line_num;
|
||||
exp_nl = ctx->expect_nl;
|
||||
|
||||
/* last line of input. */
|
||||
if ((inl == 0) || ((n == 0) && (conv_ascii2bin(in[0]) == B64_EOF))) {
|
||||
if (n > 0 && d[n - 1] == '=') {
|
||||
eof++;
|
||||
if (n > 1 && d[n - 2] == '=')
|
||||
eof++;
|
||||
}
|
||||
|
||||
/* Legacy behaviour: an empty input chunk signals end of input. */
|
||||
if (inl == 0) {
|
||||
rv = 0;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* We parse the input data */
|
||||
for (i = 0; i < inl; i++) {
|
||||
/* If the current line is > 80 characters, scream alot */
|
||||
if (ln >= 80) {
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Get char and put it into the buffer */
|
||||
tmp = *(in++);
|
||||
v = conv_ascii2bin(tmp);
|
||||
/* only save the good data :-) */
|
||||
if (!B64_NOT_BASE64(v)) {
|
||||
OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
|
||||
d[n++] = tmp;
|
||||
ln++;
|
||||
} else if (v == B64_ERROR) {
|
||||
if (v == B64_ERROR) {
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*
|
||||
* have we seen a '=' which is 'definitly' the last input line. seof
|
||||
* will point to the character that holds it. and eof will hold how
|
||||
* many characters to chop off.
|
||||
*/
|
||||
if (tmp == '=') {
|
||||
if (seof == -1)
|
||||
seof = n;
|
||||
eof++;
|
||||
} else if (eof > 0 && B64_BASE64(v)) {
|
||||
/* More data after padding. */
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (v == B64_CR) {
|
||||
ln = 0;
|
||||
if (exp_nl)
|
||||
continue;
|
||||
if (eof > 2) {
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* eoln */
|
||||
if (v == B64_EOLN) {
|
||||
ln = 0;
|
||||
if (exp_nl) {
|
||||
exp_nl = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
exp_nl = 0;
|
||||
|
||||
/*
|
||||
* If we are at the end of input and it looks like a line, process
|
||||
* it.
|
||||
*/
|
||||
if (((i + 1) == inl) && (((n & 3) == 0) || eof)) {
|
||||
v = B64_EOF;
|
||||
/*
|
||||
* In case things were given us in really small records (so two
|
||||
* '=' were given in separate updates), eof may contain the
|
||||
* incorrect number of ending bytes to skip, so let's redo the
|
||||
* count
|
||||
*/
|
||||
eof = 0;
|
||||
if (d[n - 1] == '=')
|
||||
eof++;
|
||||
if (d[n - 2] == '=')
|
||||
eof++;
|
||||
/* There will never be more than two '=' */
|
||||
if (v == B64_EOF) {
|
||||
seof = 1;
|
||||
goto tail;
|
||||
}
|
||||
|
||||
if ((v == B64_EOF && (n & 3) == 0) || (n >= 64)) {
|
||||
/*
|
||||
* This is needed to work correctly on 64 byte input lines. We
|
||||
* process the line and then need to accept the '\n'
|
||||
*/
|
||||
if ((v != B64_EOF) && (n >= 64))
|
||||
exp_nl = 1;
|
||||
if (n > 0) {
|
||||
v = EVP_DecodeBlock(out, d, n);
|
||||
n = 0;
|
||||
if (v < 0) {
|
||||
rv = 0;
|
||||
goto end;
|
||||
}
|
||||
if (eof > v) {
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
ret += (v - eof);
|
||||
} else {
|
||||
eof = 1;
|
||||
v = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the case where we have had a short but valid input
|
||||
* line
|
||||
*/
|
||||
if ((v < ctx->length) && eof) {
|
||||
rv = 0;
|
||||
goto end;
|
||||
} else
|
||||
ctx->length = v;
|
||||
|
||||
if (seof >= 0) {
|
||||
rv = 0;
|
||||
/* Only save valid base64 characters. */
|
||||
if (B64_BASE64(v)) {
|
||||
if (n >= 64) {
|
||||
/*
|
||||
* We increment n once per loop, and empty the buffer as soon as
|
||||
* we reach 64 characters, so this can only happen if someone's
|
||||
* manually messed with the ctx. Refuse to write any more data.
|
||||
*/
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
out += v;
|
||||
OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
|
||||
d[n++] = tmp;
|
||||
}
|
||||
|
||||
if (n == 64) {
|
||||
decoded_len = EVP_DecodeBlock(out, d, n);
|
||||
n = 0;
|
||||
if (decoded_len < 0 || eof > decoded_len) {
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
ret += decoded_len - eof;
|
||||
out += decoded_len - eof;
|
||||
}
|
||||
}
|
||||
rv = 1;
|
||||
end:
|
||||
|
||||
/*
|
||||
* Legacy behaviour: if the current line is a full base64-block (i.e., has
|
||||
* 0 mod 4 base64 characters), it is processed immediately. We keep this
|
||||
* behaviour as applications may not be calling EVP_DecodeFinal properly.
|
||||
*/
|
||||
tail:
|
||||
if (n > 0) {
|
||||
if ((n & 3) == 0) {
|
||||
decoded_len = EVP_DecodeBlock(out, d, n);
|
||||
n = 0;
|
||||
if (decoded_len < 0 || eof > decoded_len) {
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
ret += (decoded_len - eof);
|
||||
} else if (seof) {
|
||||
/* EOF in the middle of a base64 block. */
|
||||
rv = -1;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
rv = seof || (n == 0 && eof) ? 0 : 1;
|
||||
end:
|
||||
/* Legacy behaviour. This should probably rather be zeroed on error. */
|
||||
*outl = ret;
|
||||
ctx->num = n;
|
||||
ctx->line_num = ln;
|
||||
ctx->expect_nl = exp_nl;
|
||||
return (rv);
|
||||
}
|
||||
|
||||
|
@@ -104,6 +104,8 @@ int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt,
|
||||
if ((prompt == NULL) && (prompt_string[0] != '\0'))
|
||||
prompt = prompt_string;
|
||||
ui = UI_new();
|
||||
if (ui == NULL)
|
||||
return -1;
|
||||
UI_add_input_string(ui, prompt, 0, buf, min,
|
||||
(len >= BUFSIZ) ? BUFSIZ - 1 : len);
|
||||
if (verify)
|
||||
@@ -137,7 +139,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
|
||||
EVP_MD_CTX_init(&c);
|
||||
for (;;) {
|
||||
if (!EVP_DigestInit_ex(&c, md, NULL))
|
||||
return 0;
|
||||
goto err;
|
||||
if (addmd++)
|
||||
if (!EVP_DigestUpdate(&c, &(md_buf[0]), mds))
|
||||
goto err;
|
||||
@@ -188,6 +190,6 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
|
||||
rv = type->key_len;
|
||||
err:
|
||||
EVP_MD_CTX_cleanup(&c);
|
||||
OPENSSL_cleanse(&(md_buf[0]), EVP_MAX_MD_SIZE);
|
||||
OPENSSL_cleanse(md_buf, sizeof(md_buf));
|
||||
return rv;
|
||||
}
|
||||
|
@@ -67,9 +67,19 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
|
||||
|
||||
if (c->cipher->set_asn1_parameters != NULL)
|
||||
ret = c->cipher->set_asn1_parameters(c, type);
|
||||
else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1)
|
||||
ret = EVP_CIPHER_set_asn1_iv(c, type);
|
||||
else
|
||||
else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) {
|
||||
switch (EVP_CIPHER_CTX_mode(c)) {
|
||||
|
||||
case EVP_CIPH_GCM_MODE:
|
||||
case EVP_CIPH_CCM_MODE:
|
||||
case EVP_CIPH_XTS_MODE:
|
||||
ret = -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = EVP_CIPHER_set_asn1_iv(c, type);
|
||||
}
|
||||
} else
|
||||
ret = -1;
|
||||
return (ret);
|
||||
}
|
||||
@@ -80,9 +90,20 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
|
||||
|
||||
if (c->cipher->get_asn1_parameters != NULL)
|
||||
ret = c->cipher->get_asn1_parameters(c, type);
|
||||
else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1)
|
||||
ret = EVP_CIPHER_get_asn1_iv(c, type);
|
||||
else
|
||||
else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) {
|
||||
switch (EVP_CIPHER_CTX_mode(c)) {
|
||||
|
||||
case EVP_CIPH_GCM_MODE:
|
||||
case EVP_CIPH_CCM_MODE:
|
||||
case EVP_CIPH_XTS_MODE:
|
||||
ret = -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = EVP_CIPHER_get_asn1_iv(c, type);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
ret = -1;
|
||||
return (ret);
|
||||
}
|
||||
|
@@ -228,12 +228,16 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
|
||||
int md_nid, EVP_PBE_KEYGEN *keygen)
|
||||
{
|
||||
EVP_PBE_CTL *pbe_tmp;
|
||||
if (!pbe_algs)
|
||||
|
||||
if (pbe_algs == NULL) {
|
||||
pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
|
||||
if (!(pbe_tmp = (EVP_PBE_CTL *)OPENSSL_malloc(sizeof(EVP_PBE_CTL)))) {
|
||||
EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
if (pbe_algs == NULL)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL)
|
||||
goto err;
|
||||
|
||||
pbe_tmp->pbe_type = pbe_type;
|
||||
pbe_tmp->pbe_nid = pbe_nid;
|
||||
pbe_tmp->cipher_nid = cipher_nid;
|
||||
@@ -242,6 +246,10 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
|
||||
|
||||
sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp);
|
||||
return 1;
|
||||
|
||||
err:
|
||||
EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
|
||||
|
@@ -253,7 +253,7 @@ int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len)
|
||||
|
||||
int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key)
|
||||
{
|
||||
if (!EVP_PKEY_set_type(pkey, type))
|
||||
if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
|
||||
return 0;
|
||||
pkey->pkey.ptr = key;
|
||||
return (key != NULL);
|
||||
|
@@ -96,12 +96,17 @@ int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!ppkey)
|
||||
if (ppkey == NULL)
|
||||
return -1;
|
||||
|
||||
if (!*ppkey)
|
||||
if (*ppkey == NULL)
|
||||
*ppkey = EVP_PKEY_new();
|
||||
|
||||
if (*ppkey == NULL) {
|
||||
EVPerr(EVP_F_EVP_PKEY_PARAMGEN, ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = ctx->pmeth->paramgen(ctx, *ppkey);
|
||||
if (ret <= 0) {
|
||||
EVP_PKEY_free(*ppkey);
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -108,9 +108,14 @@ static int old_hmac_decode(EVP_PKEY *pkey,
|
||||
ASN1_OCTET_STRING *os;
|
||||
os = ASN1_OCTET_STRING_new();
|
||||
if (!os || !ASN1_OCTET_STRING_set(os, *pder, derlen))
|
||||
return 0;
|
||||
EVP_PKEY_assign(pkey, EVP_PKEY_HMAC, os);
|
||||
goto err;
|
||||
if (!EVP_PKEY_assign(pkey, EVP_PKEY_HMAC, os))
|
||||
goto err;
|
||||
return 1;
|
||||
|
||||
err:
|
||||
ASN1_OCTET_STRING_free(os);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int old_hmac_encode(const EVP_PKEY *pkey, unsigned char **pder)
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user