Compare commits
274 Commits
OpenSSL_1_
...
OpenSSL_1_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7b560c174d | ||
![]() |
c26bfada81 | ||
![]() |
40b8eb792d | ||
![]() |
ab17f6b746 | ||
![]() |
7bc2aee4f1 | ||
![]() |
9bc3665ac9 | ||
![]() |
aa5ab40860 | ||
![]() |
8aa556e1c3 | ||
![]() |
5ef5b9ffa9 | ||
![]() |
d44f89c990 | ||
![]() |
c35e138a58 | ||
![]() |
57e477b9ec | ||
![]() |
39a298a1c0 | ||
![]() |
1fdf36f511 | ||
![]() |
9dcab127e1 | ||
![]() |
3e8f9dc1a0 | ||
![]() |
7cb79c7afb | ||
![]() |
d272599277 | ||
![]() |
b3c02473f7 | ||
![]() |
23cd01ef61 | ||
![]() |
dcad51bc13 | ||
![]() |
80d586d97f | ||
![]() |
cbfec68a79 | ||
![]() |
31909e7968 | ||
![]() |
34cdff92e9 | ||
![]() |
05627d57e5 | ||
![]() |
ac32a77cd6 | ||
![]() |
f877da9ced | ||
![]() |
ba9d44b28d | ||
![]() |
da5fab7325 | ||
![]() |
efd89aa9cc | ||
![]() |
4e3dbe37ca | ||
![]() |
3610719931 | ||
![]() |
af3aa2b5ef | ||
![]() |
adba3b3bf1 | ||
![]() |
ad0fb7f498 | ||
![]() |
b1d5b8a4a4 | ||
![]() |
fb22f74064 | ||
![]() |
858de8718f | ||
![]() |
bd5b5b4c4b | ||
![]() |
188f3f9767 | ||
![]() |
27c76b9b80 | ||
![]() |
8744ba5e42 | ||
![]() |
4d9dc0c269 | ||
![]() |
7e365298ea | ||
![]() |
b6f33dce3b | ||
![]() |
cdc47dcf19 | ||
![]() |
9cab86ee0a | ||
![]() |
e40d7c1f3a | ||
![]() |
3ae6186564 | ||
![]() |
aa1e42215b | ||
![]() |
bec1093cce | ||
![]() |
78ac7fa18d | ||
![]() |
11414f17d9 | ||
![]() |
0a59e2dc30 | ||
![]() |
0945bfcb22 | ||
![]() |
f5d840a079 | ||
![]() |
886ef2b650 | ||
![]() |
8b89cb3307 | ||
![]() |
bf42354620 | ||
![]() |
e4731f76e2 | ||
![]() |
595487ea19 | ||
![]() |
c6eb1cbd1e | ||
![]() |
1a9499cf23 | ||
![]() |
254c01ed54 | ||
![]() |
2d8e705b2a | ||
![]() |
f4d1fb7769 | ||
![]() |
10a70da729 | ||
![]() |
dcbc03ede7 | ||
![]() |
b32aa8e63e | ||
![]() |
82697bc2b9 | ||
![]() |
17b753f23a | ||
![]() |
cdcb94eea7 | ||
![]() |
051b41df41 | ||
![]() |
c59bd61b2e | ||
![]() |
f34b095fab | ||
![]() |
d3bb25e30a | ||
![]() |
eba8bf485a | ||
![]() |
464774d75f | ||
![]() |
833518cf0e | ||
![]() |
8a73e3a0e8 | ||
![]() |
edc2a76ade | ||
![]() |
8dfe1e4dd2 | ||
![]() |
feb96e914a | ||
![]() |
67fb63e9b7 | ||
![]() |
eecc697b65 | ||
![]() |
e4f77bf183 | ||
![]() |
cd5f206c2f | ||
![]() |
3cf40601b7 | ||
![]() |
82e586a90b | ||
![]() |
a659386639 | ||
![]() |
5b38d54753 | ||
![]() |
6b3a315003 | ||
![]() |
f296e411ef | ||
![]() |
5bea7975a6 | ||
![]() |
9c5efc9c65 | ||
![]() |
75862f7741 | ||
![]() |
99ceb2d40c | ||
![]() |
abc7a266a3 | ||
![]() |
33c99f2c81 | ||
![]() |
1a3701f4fe | ||
![]() |
4ce06271aa | ||
![]() |
c5f8cd7bc6 | ||
![]() |
937a766982 | ||
![]() |
07977739f0 | ||
![]() |
c7e78b6bed | ||
![]() |
df6c736fbd | ||
![]() |
c30a1b3b33 | ||
![]() |
9ed55313a7 | ||
![]() |
7238a82c8a | ||
![]() |
6e5d130765 | ||
![]() |
8f0f9ffda3 | ||
![]() |
5c4fd8b515 | ||
![]() |
496c79f60c | ||
![]() |
186578be45 | ||
![]() |
f4c5cd3085 | ||
![]() |
0ddf91c5f3 | ||
![]() |
73824ba8fe | ||
![]() |
e95e22af50 | ||
![]() |
47daa155a3 | ||
![]() |
be856c0391 | ||
![]() |
017a06c7d1 | ||
![]() |
dfd3322d72 | ||
![]() |
6281abc796 | ||
![]() |
3661bb4e79 | ||
![]() |
e697a4c3d7 | ||
![]() |
5613feaacc | ||
![]() |
3b38646d13 | ||
![]() |
bf5b8ff17d | ||
![]() |
a696708ae6 | ||
![]() |
5101c35c91 | ||
![]() |
35bac91676 | ||
![]() |
ea9de25f2f | ||
![]() |
f6cddcccc8 | ||
![]() |
6df777ed50 | ||
![]() |
07395b7a6d | ||
![]() |
784f155e0d | ||
![]() |
42802a94be | ||
![]() |
9e63eeaf76 | ||
![]() |
700c0eb8d9 | ||
![]() |
a4ba716333 | ||
![]() |
d21cbd7d5e | ||
![]() |
ae50d82700 | ||
![]() |
ff864ffef3 | ||
![]() |
0a1f31f7ba | ||
![]() |
5a27a20be3 | ||
![]() |
3d5bb773ec | ||
![]() |
c8ece537e3 | ||
![]() |
8338cf0bdb | ||
![]() |
ddbf312fb4 | ||
![]() |
e7c2ad508d | ||
![]() |
929b0d70c1 | ||
![]() |
b7279ed55c | ||
![]() |
8f8e4e4f52 | ||
![]() |
a20718fa2c | ||
![]() |
4285b85163 | ||
![]() |
fe82be2b33 | ||
![]() |
8509128179 | ||
![]() |
d3a9eaccc1 | ||
![]() |
4ba9a4265b | ||
![]() |
bc0eb82b85 | ||
![]() |
bd891f098b | ||
![]() |
c45dfdc68a | ||
![]() |
b5dc90121c | ||
![]() |
b0b7232877 | ||
![]() |
ece8574ae6 | ||
![]() |
3edf1b98e0 | ||
![]() |
0d6d10d97d | ||
![]() |
3df69d3aef | ||
![]() |
921095d4d3 | ||
![]() |
5cc6509dae | ||
![]() |
18029a3d07 | ||
![]() |
7b22e8d01f | ||
![]() |
da947c9758 | ||
![]() |
128b271c8d | ||
![]() |
a8b1e52ff4 | ||
![]() |
d6e903d188 | ||
![]() |
86f8fb0e34 | ||
![]() |
c0334c2c92 | ||
![]() |
c3c7fb07dc | ||
![]() |
b19d814321 | ||
![]() |
76343947ad | ||
![]() |
4b22cce381 | ||
![]() |
b717b08307 | ||
![]() |
819418110b | ||
![]() |
77c77f0a1b | ||
![]() |
8b84495380 | ||
![]() |
c1559f5046 | ||
![]() |
d8d2e50359 | ||
![]() |
6c4ce00753 | ||
![]() |
fcb61b6c92 | ||
![]() |
b2b8163964 | ||
![]() |
56490fc26f | ||
![]() |
f2e95a02b1 | ||
![]() |
912c8c92b5 | ||
![]() |
94be83127b | ||
![]() |
be109b9eec | ||
![]() |
c0d69ddb33 | ||
![]() |
8cd6714084 | ||
![]() |
327de270d5 | ||
![]() |
8e91b3d991 | ||
![]() |
20223855e4 | ||
![]() |
563fc239d2 | ||
![]() |
15919ecadc | ||
![]() |
289c06823e | ||
![]() |
ff2459b918 | ||
![]() |
8944d10e2d | ||
![]() |
df57e42baa | ||
![]() |
9c5c18500b | ||
![]() |
35fafc4dbc | ||
![]() |
0c14565c5b | ||
![]() |
5a9e9669d8 | ||
![]() |
2b31fcc0b5 | ||
![]() |
b65b4c3481 | ||
![]() |
ef116b0003 | ||
![]() |
0d691e0e27 | ||
![]() |
ae3fcdf1e5 | ||
![]() |
d6ca1cee8b | ||
![]() |
bfa34f551c | ||
![]() |
f9aa27dc78 | ||
![]() |
f417997a32 | ||
![]() |
6ee3997134 | ||
![]() |
f9a21ed069 | ||
![]() |
d6b4a41d10 | ||
![]() |
9fdbaf3a32 | ||
![]() |
6fff54b0ce | ||
![]() |
6e20f55646 | ||
![]() |
87cd297d14 | ||
![]() |
195f6302bb | ||
![]() |
8f51c206b3 | ||
![]() |
f2aff60f6f | ||
![]() |
fbabc6c06e | ||
![]() |
bfb14d724b | ||
![]() |
4d2207f097 | ||
![]() |
b42e4a9f6b | ||
![]() |
78a6b77976 | ||
![]() |
ba5d0113e8 | ||
![]() |
f747572547 | ||
![]() |
36b619a06e | ||
![]() |
13c1807041 | ||
![]() |
f243def213 | ||
![]() |
1f956f9cda | ||
![]() |
98e6f07901 | ||
![]() |
f95519538a | ||
![]() |
79e2e927e6 | ||
![]() |
7f3563b576 | ||
![]() |
458a55af16 | ||
![]() |
681da86ebb | ||
![]() |
872f91c403 | ||
![]() |
ee1ccd0a41 | ||
![]() |
62bfff2d99 | ||
![]() |
95929797a0 | ||
![]() |
bcfaa4eeee | ||
![]() |
cb43fd0467 | ||
![]() |
ba25221226 | ||
![]() |
506805e708 | ||
![]() |
04222b630e | ||
![]() |
16064539ad | ||
![]() |
75c77a71fa | ||
![]() |
3b740cebd5 | ||
![]() |
f17a4ad7d7 | ||
![]() |
79e0285755 | ||
![]() |
8d5d455988 | ||
![]() |
1d5668c258 | ||
![]() |
bc1544d8c5 | ||
![]() |
6ca1dc9737 | ||
![]() |
0ed9ca21ae | ||
![]() |
11b32d6e29 | ||
![]() |
63ac16ccac | ||
![]() |
db7cb7ab9a | ||
![]() |
6d09851694 | ||
![]() |
63c1d16bb8 | ||
![]() |
6fa805f516 | ||
![]() |
06aab26874 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -100,8 +100,12 @@ tags
|
||||
TAGS
|
||||
|
||||
# Windows
|
||||
/tmp32
|
||||
/tmp32.dbg
|
||||
/tmp32dll
|
||||
/tmp32dll.dbg
|
||||
/out32
|
||||
/out32.dbg
|
||||
/out32dll
|
||||
/out32dll.dbg
|
||||
/inc32
|
||||
|
622
CHANGES
622
CHANGES
@@ -2,47 +2,255 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 1.0.2a and 1.0.2b [11 Jun 2015]
|
||||
|
||||
*) Malformed ECParameters causes infinite loop
|
||||
|
||||
When processing an ECParameters structure OpenSSL enters an infinite loop
|
||||
if the curve specified is over a specially malformed binary polynomial
|
||||
field.
|
||||
|
||||
This can be used to perform denial of service against any
|
||||
system which processes public keys, certificate requests or
|
||||
certificates. This includes TLS clients and TLS servers with
|
||||
client authentication enabled.
|
||||
|
||||
This issue was reported to OpenSSL by Joseph Barr-Pixton.
|
||||
(CVE-2015-1788)
|
||||
[Andy Polyakov]
|
||||
|
||||
*) Exploitable out-of-bounds read in X509_cmp_time
|
||||
|
||||
X509_cmp_time does not properly check the length of the ASN1_TIME
|
||||
string and can read a few bytes out of bounds. In addition,
|
||||
X509_cmp_time accepts an arbitrary number of fractional seconds in the
|
||||
time string.
|
||||
|
||||
An attacker can use this to craft malformed certificates and CRLs of
|
||||
various sizes and potentially cause a segmentation fault, resulting in
|
||||
a DoS on applications that verify certificates or CRLs. TLS clients
|
||||
that verify CRLs are affected. TLS clients and servers with client
|
||||
authentication enabled may be affected if they use custom verification
|
||||
callbacks.
|
||||
|
||||
This issue was reported to OpenSSL by Robert Swiecki (Google), and
|
||||
independently by Hanno B<>ck.
|
||||
(CVE-2015-1789)
|
||||
[Emilia K<>sper]
|
||||
|
||||
*) PKCS7 crash with missing EnvelopedContent
|
||||
|
||||
The PKCS#7 parsing code does not handle missing inner EncryptedContent
|
||||
correctly. An attacker can craft malformed ASN.1-encoded PKCS#7 blobs
|
||||
with missing content and trigger a NULL pointer dereference on parsing.
|
||||
|
||||
Applications that decrypt PKCS#7 data or otherwise parse PKCS#7
|
||||
structures from untrusted sources are affected. OpenSSL clients and
|
||||
servers are not affected.
|
||||
|
||||
This issue was reported to OpenSSL by Michal Zalewski (Google).
|
||||
(CVE-2015-1790)
|
||||
[Emilia K<>sper]
|
||||
|
||||
*) CMS verify infinite loop with unknown hash function
|
||||
|
||||
When verifying a signedData message the CMS code can enter an infinite loop
|
||||
if presented with an unknown hash function OID. This can be used to perform
|
||||
denial of service against any system which verifies signedData messages using
|
||||
the CMS code.
|
||||
This issue was reported to OpenSSL by Johannes Bauer.
|
||||
(CVE-2015-1792)
|
||||
[Stephen Henson]
|
||||
|
||||
*) Race condition handling NewSessionTicket
|
||||
|
||||
If a NewSessionTicket is received by a multi-threaded client when attempting to
|
||||
reuse a previous ticket then a race condition can occur potentially leading to
|
||||
a double free of the ticket data.
|
||||
(CVE-2015-1791)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Removed support for the two export grade static DH ciphersuites
|
||||
EXP-DH-RSA-DES-CBC-SHA and EXP-DH-DSS-DES-CBC-SHA. These two ciphersuites
|
||||
were newly added (along with a number of other static DH ciphersuites) to
|
||||
1.0.2. However the two export ones have *never* worked since they were
|
||||
introduced. It seems strange in any case to be adding new export
|
||||
ciphersuites, and given "logjam" it also does not seem correct to fix them.
|
||||
[Matt Caswell]
|
||||
|
||||
*) Only support 256-bit or stronger elliptic curves with the
|
||||
'ecdh_auto' setting (server) or by default (client). Of supported
|
||||
curves, prefer P-256 (both).
|
||||
[Emilia Kasper]
|
||||
|
||||
*) Reject DH handshakes with parameters shorter than 768 bits.
|
||||
[Kurt Roeckx and Emilia Kasper]
|
||||
|
||||
Changes between 1.0.2 and 1.0.2a [19 Mar 2015]
|
||||
|
||||
*) ClientHello sigalgs DoS fix
|
||||
|
||||
If a client connects to an OpenSSL 1.0.2 server and renegotiates with an
|
||||
invalid signature algorithms extension a NULL pointer dereference will
|
||||
occur. This can be exploited in a DoS attack against the server.
|
||||
|
||||
This issue was was reported to OpenSSL by David Ramos of Stanford
|
||||
University.
|
||||
(CVE-2015-0291)
|
||||
[Stephen Henson and Matt Caswell]
|
||||
|
||||
*) Multiblock corrupted pointer fix
|
||||
|
||||
OpenSSL 1.0.2 introduced the "multiblock" performance improvement. This
|
||||
feature only applies on 64 bit x86 architecture platforms that support AES
|
||||
NI instructions. A defect in the implementation of "multiblock" can cause
|
||||
OpenSSL's internal write buffer to become incorrectly set to NULL when
|
||||
using non-blocking IO. Typically, when the user application is using a
|
||||
socket BIO for writing, this will only result in a failed connection.
|
||||
However if some other BIO is used then it is likely that a segmentation
|
||||
fault will be triggered, thus enabling a potential DoS attack.
|
||||
|
||||
This issue was reported to OpenSSL by Daniel Danner and Rainer Mueller.
|
||||
(CVE-2015-0290)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Segmentation fault in DTLSv1_listen fix
|
||||
|
||||
The DTLSv1_listen function is intended to be stateless and processes the
|
||||
initial ClientHello from many peers. It is common for user code to loop
|
||||
over the call to DTLSv1_listen until a valid ClientHello is received with
|
||||
an associated cookie. A defect in the implementation of DTLSv1_listen means
|
||||
that state is preserved in the SSL object from one invocation to the next
|
||||
that can lead to a segmentation fault. Errors processing the initial
|
||||
ClientHello can trigger this scenario. An example of such an error could be
|
||||
that a DTLS1.0 only client is attempting to connect to a DTLS1.2 only
|
||||
server.
|
||||
|
||||
This issue was reported to OpenSSL by Per Allansson.
|
||||
(CVE-2015-0207)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Segmentation fault in ASN1_TYPE_cmp fix
|
||||
|
||||
The function ASN1_TYPE_cmp will crash with an invalid read if an attempt is
|
||||
made to compare ASN.1 boolean types. Since ASN1_TYPE_cmp is used to check
|
||||
certificate signature algorithm consistency 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.
|
||||
(CVE-2015-0286)
|
||||
[Stephen Henson]
|
||||
|
||||
*) Segmentation fault for invalid PSS parameters fix
|
||||
|
||||
The signature verification routines will crash with a NULL pointer
|
||||
dereference if presented with an ASN.1 signature using the RSA PSS
|
||||
algorithm and invalid parameters. 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 was reported to OpenSSL by Brian Carpenter.
|
||||
(CVE-2015-0208)
|
||||
[Stephen Henson]
|
||||
|
||||
*) ASN.1 structure reuse memory corruption fix
|
||||
|
||||
Reusing a structure in ASN.1 parsing may allow an attacker to cause
|
||||
memory corruption via an invalid write. Such reuse is and has been
|
||||
strongly discouraged and is believed to be rare.
|
||||
|
||||
Applications that parse structures containing CHOICE or ANY DEFINED BY
|
||||
components may be affected. Certificate parsing (d2i_X509 and related
|
||||
functions) are however not affected. OpenSSL clients and servers are
|
||||
not affected.
|
||||
(CVE-2015-0287)
|
||||
[Stephen Henson]
|
||||
|
||||
*) PKCS7 NULL pointer dereferences fix
|
||||
|
||||
The PKCS#7 parsing code does not handle missing outer ContentInfo
|
||||
correctly. An attacker can craft malformed ASN.1-encoded PKCS#7 blobs with
|
||||
missing content and trigger a NULL pointer dereference on parsing.
|
||||
|
||||
Applications that verify PKCS#7 signatures, decrypt PKCS#7 data or
|
||||
otherwise parse PKCS#7 structures from untrusted sources are
|
||||
affected. OpenSSL clients and servers are not affected.
|
||||
|
||||
This issue was reported to OpenSSL by Michal Zalewski (Google).
|
||||
(CVE-2015-0289)
|
||||
[Emilia K<>sper]
|
||||
|
||||
*) DoS via reachable assert in SSLv2 servers fix
|
||||
|
||||
A malicious client can trigger an OPENSSL_assert (i.e., an abort) in
|
||||
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<>sper
|
||||
(OpenSSL development team).
|
||||
(CVE-2015-0293)
|
||||
[Emilia K<>sper]
|
||||
|
||||
*) Empty CKE with client auth and DHE fix
|
||||
|
||||
If client auth is used then a server can seg fault in the event of a DHE
|
||||
ciphersuite being selected and a zero length ClientKeyExchange message
|
||||
being sent by the client. This could be exploited in a DoS attack.
|
||||
(CVE-2015-1787)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Handshake with unseeded PRNG fix
|
||||
|
||||
Under certain conditions an OpenSSL 1.0.2 client can complete a handshake
|
||||
with an unseeded PRNG. The conditions are:
|
||||
- The client is on a platform where the PRNG has not been seeded
|
||||
automatically, and the user has not seeded manually
|
||||
- A protocol specific client method version has been used (i.e. not
|
||||
SSL_client_methodv23)
|
||||
- A ciphersuite is used that does not require additional random data from
|
||||
the PRNG beyond the initial ClientHello client random (e.g. PSK-RC4-SHA).
|
||||
|
||||
If the handshake succeeds then the client random that has been used will
|
||||
have been generated from a PRNG with insufficient entropy and therefore the
|
||||
output may be predictable.
|
||||
|
||||
For example using the following command with an unseeded openssl will
|
||||
succeed on an unpatched platform:
|
||||
|
||||
openssl s_client -psk 1a2b3c4d -tls1_2 -cipher PSK-RC4-SHA
|
||||
(CVE-2015-0285)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Use After Free following d2i_ECPrivatekey error fix
|
||||
|
||||
A malformed EC private key file consumed via the d2i_ECPrivateKey function
|
||||
could cause a use after free condition. This, in turn, could cause a double
|
||||
free in several private key parsing functions (such as d2i_PrivateKey
|
||||
or EVP_PKCS82PKEY) and could lead to a DoS attack or memory corruption
|
||||
for applications that receive EC private keys from untrusted
|
||||
sources. This scenario is considered rare.
|
||||
|
||||
This issue was discovered by the BoringSSL project and fixed in their
|
||||
commit 517073cd4b.
|
||||
(CVE-2015-0209)
|
||||
[Matt Caswell]
|
||||
|
||||
*) X509_to_X509_REQ NULL pointer deref fix
|
||||
|
||||
The function X509_to_X509_REQ will crash with a NULL pointer dereference if
|
||||
the certificate key is invalid. This function is rarely used in practice.
|
||||
|
||||
This issue was discovered by Brian Carpenter.
|
||||
(CVE-2015-0288)
|
||||
[Stephen Henson]
|
||||
|
||||
*) Removed the export ciphers from the DEFAULT ciphers
|
||||
[Kurt Roeckx]
|
||||
|
||||
Changes between 1.0.1l and 1.0.2 [22 Jan 2015]
|
||||
|
||||
*) SRTP Memory Leak.
|
||||
|
||||
A flaw in the DTLS SRTP extension parsing code allows an attacker, who
|
||||
sends a carefully crafted handshake message, to cause OpenSSL to fail
|
||||
to free up to 64k of memory causing a memory leak. This could be
|
||||
exploited in a Denial Of Service attack. This issue affects OpenSSL
|
||||
1.0.1 server implementations for both SSL/TLS and DTLS regardless of
|
||||
whether SRTP is used or configured. Implementations of OpenSSL that
|
||||
have been compiled with OPENSSL_NO_SRTP defined are not affected.
|
||||
|
||||
The fix was developed by the OpenSSL team.
|
||||
(CVE-2014-3513)
|
||||
[OpenSSL team]
|
||||
|
||||
*) Session Ticket Memory Leak.
|
||||
|
||||
When an OpenSSL SSL/TLS/DTLS server receives a session ticket the
|
||||
integrity of that ticket is first verified. In the event of a session
|
||||
ticket integrity check failing, OpenSSL will fail to free memory
|
||||
causing a memory leak. By sending a large number of invalid session
|
||||
tickets an attacker could exploit this issue in a Denial Of Service
|
||||
attack.
|
||||
(CVE-2014-3567)
|
||||
[Steve Henson]
|
||||
|
||||
*) Build option no-ssl3 is incomplete.
|
||||
|
||||
When OpenSSL is configured with "no-ssl3" as a build option, servers
|
||||
could accept and complete a SSL 3.0 handshake, and clients could be
|
||||
configured to send them.
|
||||
(CVE-2014-3568)
|
||||
[Akamai and the OpenSSL team]
|
||||
|
||||
*) Add support for TLS_FALLBACK_SCSV.
|
||||
Client applications doing fallback retries should call
|
||||
SSL_set_mode(s, SSL_MODE_SEND_FALLBACK_SCSV).
|
||||
(CVE-2014-3566)
|
||||
[Adam Langley, Bodo Moeller]
|
||||
|
||||
*) Facilitate "universal" ARM builds targeting range of ARM ISAs, e.g.
|
||||
ARMv5 through ARMv8, as opposite to "locking" it to single one.
|
||||
So far those who have to target multiple plaforms would compromise
|
||||
@@ -378,6 +586,29 @@
|
||||
|
||||
Changes between 1.0.1j and 1.0.1k [8 Jan 2015]
|
||||
|
||||
*) Fix DTLS segmentation fault in dtls1_get_record. A carefully crafted DTLS
|
||||
message can cause a segmentation fault in OpenSSL due to a NULL pointer
|
||||
dereference. This could lead to a Denial Of Service attack. Thanks to
|
||||
Markus Stenberg of Cisco Systems, Inc. for reporting this issue.
|
||||
(CVE-2014-3571)
|
||||
[Steve Henson]
|
||||
|
||||
*) Fix DTLS memory leak in dtls1_buffer_record. A memory leak can occur in the
|
||||
dtls1_buffer_record function under certain conditions. In particular this
|
||||
could occur if an attacker sent repeated DTLS records with the same
|
||||
sequence number but for the next epoch. The memory leak could be exploited
|
||||
by an attacker in a Denial of Service attack through memory exhaustion.
|
||||
Thanks to Chris Mueller for reporting this issue.
|
||||
(CVE-2015-0206)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Fix issue where no-ssl3 configuration sets method to NULL. When openssl is
|
||||
built with the no-ssl3 option and a SSL v3 ClientHello is received the ssl
|
||||
method would be set to NULL which could later result in a NULL pointer
|
||||
dereference. Thanks to Frank Schmirler for reporting this issue.
|
||||
(CVE-2014-3569)
|
||||
[Kurt Roeckx]
|
||||
|
||||
*) Abort handshake if server key exchange message is omitted for ephemeral
|
||||
ECDH ciphersuites.
|
||||
|
||||
@@ -395,6 +626,17 @@
|
||||
(CVE-2015-0204)
|
||||
[Steve Henson]
|
||||
|
||||
*) Fixed issue where DH client certificates are accepted without verification.
|
||||
An OpenSSL server will accept a DH certificate for client authentication
|
||||
without the certificate verify message. This effectively allows a client to
|
||||
authenticate without the use of a private key. This only affects servers
|
||||
which trust a client certificate authority which issues certificates
|
||||
containing DH keys: these are extremely rare and hardly ever encountered.
|
||||
Thanks for Karthikeyan Bhargavan of the PROSECCO team at INRIA or reporting
|
||||
this issue.
|
||||
(CVE-2015-0205)
|
||||
[Steve Henson]
|
||||
|
||||
*) Ensure that the session ID context of an SSL is updated when its
|
||||
SSL_CTX is updated via SSL_set_SSL_CTX.
|
||||
|
||||
@@ -439,6 +681,17 @@
|
||||
(CVE-2014-8275)
|
||||
[Steve Henson]
|
||||
|
||||
*) Correct Bignum squaring. Bignum squaring (BN_sqr) may produce incorrect
|
||||
results on some platforms, including x86_64. This bug occurs at random
|
||||
with a very low probability, and is not known to be exploitable in any
|
||||
way, though its exact impact is difficult to determine. Thanks to Pieter
|
||||
Wuille (Blockstream) who reported this issue and also suggested an initial
|
||||
fix. Further analysis was conducted by the OpenSSL development team and
|
||||
Adam Langley of Google. The final fix was developed by Andy Polyakov of
|
||||
the OpenSSL core team.
|
||||
(CVE-2014-3570)
|
||||
[Andy Polyakov]
|
||||
|
||||
*) Do not resume sessions on the server if the negotiated protocol
|
||||
version does not match the session's version. Resuming with a different
|
||||
version, while not strictly forbidden by the RFC, is of questionable
|
||||
@@ -598,18 +851,6 @@
|
||||
bogus results, with non-infinity inputs mapped to infinity too.)
|
||||
[Bodo Moeller]
|
||||
|
||||
Changes between 1.0.1i and 1.0.1j [xx XXX xxxx]
|
||||
|
||||
*) Add additional DigestInfo checks.
|
||||
|
||||
Reencode DigestInto in DER and check against the original when
|
||||
verifying RSA signature: this will reject any improperly encoded
|
||||
DigestInfo structures.
|
||||
|
||||
Note: this is a precautionary measure and no attacks are currently known.
|
||||
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 1.0.1g and 1.0.1h [5 Jun 2014]
|
||||
|
||||
*) Fix for SSL/TLS MITM flaw. An attacker using a carefully crafted
|
||||
@@ -1107,63 +1348,6 @@
|
||||
Add command line options to s_client/s_server.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 1.0.0j and 1.0.0k [5 Feb 2013]
|
||||
|
||||
*) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
|
||||
|
||||
This addresses the flaw in CBC record processing discovered by
|
||||
Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
|
||||
at: http://www.isg.rhul.ac.uk/tls/
|
||||
|
||||
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<>sper for the initial patch.
|
||||
(CVE-2013-0169)
|
||||
[Emilia K<>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
|
||||
|
||||
*) Return an error when checking OCSP signatures when key is NULL.
|
||||
This fixes a DoS attack. (CVE-2013-0166)
|
||||
[Steve Henson]
|
||||
|
||||
*) Call OCSP Stapling callback after ciphersuite has been chosen, so
|
||||
the right response is stapled. Also change SSL_get_certificate()
|
||||
so it returns the certificate actually sent.
|
||||
See http://rt.openssl.org/Ticket/Display.html?id=2836.
|
||||
(This is a backport)
|
||||
[Rob Stradling <rob.stradling@comodo.com>]
|
||||
|
||||
*) Fix possible deadlock when decoding public keys.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 1.0.0i and 1.0.0j [10 May 2012]
|
||||
|
||||
[NB: OpenSSL 1.0.0i and later 1.0.0 patch levels were released after
|
||||
OpenSSL 1.0.1.]
|
||||
|
||||
*) Sanity check record length before skipping explicit IV in DTLS
|
||||
to fix DoS attack.
|
||||
|
||||
Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
|
||||
fuzzing as a service testing platform.
|
||||
(CVE-2012-2333)
|
||||
[Steve Henson]
|
||||
|
||||
*) Initialise tkeylen properly when encrypting CMS messages.
|
||||
Thanks to Solar Designer of Openwall for reporting this issue.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 1.0.0h and 1.0.0i [19 Apr 2012]
|
||||
|
||||
*) Check for potentially exploitable overflows in asn1_d2i_read_bio
|
||||
BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
|
||||
in CRYPTO_realloc_clean.
|
||||
|
||||
Thanks to Tavis Ormandy, Google Security Team, for discovering this
|
||||
issue and to Adam Langley <agl@chromium.org> for fixing it.
|
||||
(CVE-2012-2110)
|
||||
[Adam Langley (Google), Tavis Ormandy, Google Security Team]
|
||||
|
||||
Changes between 1.0.0g and 1.0.0h [12 Mar 2012]
|
||||
|
||||
*) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness
|
||||
@@ -2154,228 +2338,6 @@
|
||||
*) Change 'Configure' script to enable Camellia by default.
|
||||
[NTT]
|
||||
|
||||
Changes between 0.9.8x and 0.9.8y [5 Feb 2013]
|
||||
|
||||
*) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
|
||||
|
||||
This addresses the flaw in CBC record processing discovered by
|
||||
Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
|
||||
at: http://www.isg.rhul.ac.uk/tls/
|
||||
|
||||
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<>sper for the initial patch.
|
||||
(CVE-2013-0169)
|
||||
[Emilia K<>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
|
||||
|
||||
*) Return an error when checking OCSP signatures when key is NULL.
|
||||
This fixes a DoS attack. (CVE-2013-0166)
|
||||
[Steve Henson]
|
||||
|
||||
*) Call OCSP Stapling callback after ciphersuite has been chosen, so
|
||||
the right response is stapled. Also change SSL_get_certificate()
|
||||
so it returns the certificate actually sent.
|
||||
See http://rt.openssl.org/Ticket/Display.html?id=2836.
|
||||
(This is a backport)
|
||||
[Rob Stradling <rob.stradling@comodo.com>]
|
||||
|
||||
*) Fix possible deadlock when decoding public keys.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.8w and 0.9.8x [10 May 2012]
|
||||
|
||||
*) Sanity check record length before skipping explicit IV in DTLS
|
||||
to fix DoS attack.
|
||||
|
||||
Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
|
||||
fuzzing as a service testing platform.
|
||||
(CVE-2012-2333)
|
||||
[Steve Henson]
|
||||
|
||||
*) Initialise tkeylen properly when encrypting CMS messages.
|
||||
Thanks to Solar Designer of Openwall for reporting this issue.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.8v and 0.9.8w [23 Apr 2012]
|
||||
|
||||
*) The fix for CVE-2012-2110 did not take into account that the
|
||||
'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an
|
||||
int in OpenSSL 0.9.8, making it still vulnerable. Fix by
|
||||
rejecting negative len parameter. (CVE-2012-2131)
|
||||
[Tomas Hoger <thoger@redhat.com>]
|
||||
|
||||
Changes between 0.9.8u and 0.9.8v [19 Apr 2012]
|
||||
|
||||
*) Check for potentially exploitable overflows in asn1_d2i_read_bio
|
||||
BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
|
||||
in CRYPTO_realloc_clean.
|
||||
|
||||
Thanks to Tavis Ormandy, Google Security Team, for discovering this
|
||||
issue and to Adam Langley <agl@chromium.org> for fixing it.
|
||||
(CVE-2012-2110)
|
||||
[Adam Langley (Google), Tavis Ormandy, Google Security Team]
|
||||
|
||||
Changes between 0.9.8t and 0.9.8u [12 Mar 2012]
|
||||
|
||||
*) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness
|
||||
in CMS and PKCS7 code. When RSA decryption fails use a random key for
|
||||
content decryption and always return the same error. Note: this attack
|
||||
needs on average 2^20 messages so it only affects automated senders. The
|
||||
old behaviour can be reenabled in the CMS code by setting the
|
||||
CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where
|
||||
an MMA defence is not necessary.
|
||||
Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for discovering
|
||||
this issue. (CVE-2012-0884)
|
||||
[Steve Henson]
|
||||
|
||||
*) Fix CVE-2011-4619: make sure we really are receiving a
|
||||
client hello before rejecting multiple SGC restarts. Thanks to
|
||||
Ivan Nestlerode <inestlerode@us.ibm.com> for discovering this bug.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.8s and 0.9.8t [18 Jan 2012]
|
||||
|
||||
*) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109.
|
||||
Thanks to Antonio Martin, Enterprise Secure Access Research and
|
||||
Development, Cisco Systems, Inc. for discovering this bug and
|
||||
preparing a fix. (CVE-2012-0050)
|
||||
[Antonio Martin]
|
||||
|
||||
Changes between 0.9.8r and 0.9.8s [4 Jan 2012]
|
||||
|
||||
*) Nadhem Alfardan and Kenny Paterson have discovered an extension
|
||||
of the Vaudenay padding oracle attack on CBC mode encryption
|
||||
which enables an efficient plaintext recovery attack against
|
||||
the OpenSSL implementation of DTLS. Their attack exploits timing
|
||||
differences arising during decryption processing. A research
|
||||
paper describing this attack can be found at:
|
||||
http://www.isg.rhul.ac.uk/~kp/dtls.pdf
|
||||
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 to Robin Seggelmann
|
||||
<seggelmann@fh-muenster.de> and Michael Tuexen <tuexen@fh-muenster.de>
|
||||
for preparing the fix. (CVE-2011-4108)
|
||||
[Robin Seggelmann, Michael Tuexen]
|
||||
|
||||
*) Stop policy check failure freeing same buffer twice. (CVE-2011-4109)
|
||||
[Ben Laurie, Kasper <ekasper@google.com>]
|
||||
|
||||
*) Clear bytes used for block padding of SSL 3.0 records.
|
||||
(CVE-2011-4576)
|
||||
[Adam Langley (Google)]
|
||||
|
||||
*) Only allow one SGC handshake restart for SSL/TLS. Thanks to George
|
||||
Kadianakis <desnacked@gmail.com> for discovering this issue and
|
||||
Adam Langley for preparing the fix. (CVE-2011-4619)
|
||||
[Adam Langley (Google)]
|
||||
|
||||
*) Prevent malformed RFC3779 data triggering an assertion failure.
|
||||
Thanks to Andrew Chi, BBN Technologies, for discovering the flaw
|
||||
and Rob Austein <sra@hactrn.net> for fixing it. (CVE-2011-4577)
|
||||
[Rob Austein <sra@hactrn.net>]
|
||||
|
||||
*) Fix ssl_ciph.c set-up race.
|
||||
[Adam Langley (Google)]
|
||||
|
||||
*) Fix spurious failures in ecdsatest.c.
|
||||
[Emilia K<>sper (Google)]
|
||||
|
||||
*) Fix the BIO_f_buffer() implementation (which was mixing different
|
||||
interpretations of the '..._len' fields).
|
||||
[Adam Langley (Google)]
|
||||
|
||||
*) Fix handling of BN_BLINDING: now BN_BLINDING_invert_ex (rather than
|
||||
BN_BLINDING_invert_ex) calls BN_BLINDING_update, ensuring that concurrent
|
||||
threads won't reuse the same blinding coefficients.
|
||||
|
||||
This also avoids the need to obtain the CRYPTO_LOCK_RSA_BLINDING
|
||||
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<>sper (Google)]
|
||||
|
||||
*) Fix SSL memory handling for (EC)DH ciphersuites, in particular
|
||||
for multi-threaded use of ECDH.
|
||||
[Adam Langley (Google)]
|
||||
|
||||
*) Fix x509_name_ex_d2i memory leak on bad inputs.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Add protection against ECDSA timing attacks as mentioned in the paper
|
||||
by Billy Bob Brumley and Nicola Tuveri, see:
|
||||
|
||||
http://eprint.iacr.org/2011/232.pdf
|
||||
|
||||
[Billy Bob Brumley and Nicola Tuveri]
|
||||
|
||||
Changes between 0.9.8q and 0.9.8r [8 Feb 2011]
|
||||
|
||||
*) Fix parsing of OCSP stapling ClientHello extension. CVE-2011-0014
|
||||
[Neel Mehta, Adam Langley, Bodo Moeller (Google)]
|
||||
|
||||
*) Fix bug in string printing code: if *any* escaping is enabled we must
|
||||
escape the escape character (backslash) or the resulting string is
|
||||
ambiguous.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.8p and 0.9.8q [2 Dec 2010]
|
||||
|
||||
*) Disable code workaround for ancient and obsolete Netscape browsers
|
||||
and servers: an attacker can use it in a ciphersuite downgrade attack.
|
||||
Thanks to Martin Rex for discovering this bug. CVE-2010-4180
|
||||
[Steve Henson]
|
||||
|
||||
*) Fixed J-PAKE implementation error, originally discovered by
|
||||
Sebastien Martini, further info and confirmation from Stefan
|
||||
Arentz and Feng Hao. Note that this fix is a security fix. CVE-2010-4252
|
||||
[Ben Laurie]
|
||||
|
||||
Changes between 0.9.8o and 0.9.8p [16 Nov 2010]
|
||||
|
||||
*) Fix extension code to avoid race conditions which can result in a buffer
|
||||
overrun vulnerability: resumed sessions must not be modified as they can
|
||||
be shared by multiple threads. CVE-2010-3864
|
||||
[Steve Henson]
|
||||
|
||||
*) Fix for double free bug in ssl/s3_clnt.c CVE-2010-2939
|
||||
[Steve Henson]
|
||||
|
||||
*) Don't reencode certificate when calculating signature: cache and use
|
||||
the original encoding instead. This makes signature verification of
|
||||
some broken encodings work correctly.
|
||||
[Steve Henson]
|
||||
|
||||
*) ec2_GF2m_simple_mul bugfix: compute correct result if the output EC_POINT
|
||||
is also one of the inputs.
|
||||
[Emilia K<>sper <emilia.kasper@esat.kuleuven.be> (Google)]
|
||||
|
||||
*) Don't repeatedly append PBE algorithms to table if they already exist.
|
||||
Sort table on each new add. This effectively makes the table read only
|
||||
after all algorithms are added and subsequent calls to PKCS12_pbe_add
|
||||
etc are non-op.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.8n and 0.9.8o [01 Jun 2010]
|
||||
|
||||
[NB: OpenSSL 0.9.8o and later 0.9.8 patch levels were released after
|
||||
OpenSSL 1.0.0.]
|
||||
|
||||
*) Correct a typo in the CMS ASN1 module which can result in invalid memory
|
||||
access or freeing data twice (CVE-2010-0742)
|
||||
[Steve Henson, Ronald Moesbergen <intercommit@gmail.com>]
|
||||
|
||||
*) Add SHA2 algorithms to SSL_library_init(). SHA2 is becoming far more
|
||||
common in certificates and some applications which only call
|
||||
SSL_library_init and not OpenSSL_add_all_algorithms() will fail.
|
||||
[Steve Henson]
|
||||
|
||||
*) VMS fixes:
|
||||
Reduce copying into .apps and .test in makevms.com
|
||||
Don't try to use blank CA certificate in CA.com
|
||||
Allow use of C files from original directories in maketests.com
|
||||
[Steven M. Schweda" <sms@antinode.info>]
|
||||
|
||||
Changes between 0.9.8m and 0.9.8n [24 Mar 2010]
|
||||
|
||||
*) When rejecting SSL/TLS records due to an incorrect version number, never
|
||||
|
151
Configure
151
Configure
@@ -105,7 +105,24 @@ 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_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum";
|
||||
# TODO(openssl-team): fix problems and investigate if (at least) the following
|
||||
# warnings can also be enabled:
|
||||
# -Wconditional-uninitialized, -Wswitch-enum, -Wunused-macros,
|
||||
# -Wmissing-field-initializers, -Wmissing-variable-declarations,
|
||||
# -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align,
|
||||
# -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token
|
||||
# -Wextended-offsetof
|
||||
my $clang_disabled_warnings = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof";
|
||||
|
||||
# These are used in addition to $gcc_devteam_warn when the compiler is clang.
|
||||
# TODO(openssl-team): fix problems and investigate if (at least) the
|
||||
# following warnings can also be enabled: -Wconditional-uninitialized,
|
||||
# -Wswitch-enum, -Wunused-macros, -Wmissing-field-initializers,
|
||||
# -Wmissing-variable-declarations,
|
||||
# -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align,
|
||||
# -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token
|
||||
# -Wextended-offsetof
|
||||
my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments";
|
||||
|
||||
my $strict_warnings = 0;
|
||||
|
||||
@@ -188,18 +205,18 @@ my %table=(
|
||||
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-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)",
|
||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-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-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o::des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -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-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o::des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"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 -DTERMIO -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 -DTERMIO -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","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",
|
||||
"dist", "cc:-O::(unknown)::::::",
|
||||
|
||||
# Basic configs that should work on any (32 and less bit) box
|
||||
@@ -233,12 +250,12 @@ my %table=(
|
||||
|
||||
#### SPARC Solaris with GNU C setups
|
||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mcpu=v8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
|
||||
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
||||
####
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=v8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### SPARC Solaris with Sun C setups
|
||||
@@ -255,20 +272,20 @@ my %table=(
|
||||
|
||||
#### SunOS configs, assuming sparc for the gcc one.
|
||||
#"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::",
|
||||
"sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
|
||||
"sunos-gcc","gcc:-O3 -mcpu=v8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
|
||||
|
||||
#### IRIX 5.x configs
|
||||
# -mips2 flag is added by ./config when appropriate.
|
||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-gcc","gcc:-O3 -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
#### IRIX 6.x configs
|
||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
||||
# './Configure irix-cc -o32' manually.
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
# N64 ABI builds.
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
|
||||
#### Unified HP-UX ANSI C configs.
|
||||
# Special notes:
|
||||
@@ -348,8 +365,8 @@ my %table=(
|
||||
####
|
||||
# *-generic* is endian-neutral target, but ./config is free to
|
||||
# throw in -D[BL]_ENDIAN, whichever appropriate...
|
||||
"linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -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)",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-generic32","gcc:-O3 -fomit-frame-pointer -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)",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#######################################################################
|
||||
# Note that -march is not among compiler options in below linux-armv4
|
||||
@@ -378,30 +395,30 @@ my %table=(
|
||||
#
|
||||
# ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
|
||||
#
|
||||
"linux-armv4", "gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-aarch64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-armv4", "gcc: -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-aarch64","gcc: -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# Configure script adds minimally required -march for assembly support,
|
||||
# if no -march was specified at command line. mips32 and mips64 below
|
||||
# refer to contemporary MIPS Architecture specifications, MIPS32 and
|
||||
# MIPS64, rather than to kernel bitness.
|
||||
"linux-mips32", "gcc:-mabi=32 -DTERMIO -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-mips64", "gcc:-mabi=n32 -DTERMIO -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:n32:dlfcn:linux-shared:-fPIC:-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"linux64-mips64", "gcc:-mabi=64 -DTERMIO -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:64:dlfcn:linux-shared:-fPIC:-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-mips32", "gcc:-mabi=32 -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-mips64", "gcc:-mabi=n32 -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:n32:dlfcn:linux-shared:-fPIC:-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"linux64-mips64", "gcc:-mabi=64 -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:64:dlfcn:linux-shared:-fPIC:-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
#### IA-32 targets...
|
||||
"linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2::-D_REENTRANT::-ldl -no_cpprt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
|
||||
"linux-ia32-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-elf", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-aout", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
|
||||
####
|
||||
"linux-generic64","gcc:-DTERMIO -O3 -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)",
|
||||
"linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-ppc64le","gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:$ppc64_asm:linux64le:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::",
|
||||
"linux-generic64","gcc:-O3 -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)",
|
||||
"linux-ppc64", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-ppc64le","gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:$ppc64_asm:linux64le:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt: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 -DTERMIO -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 -DTERMIO -O3 -Weverything $clang_disabled_warnings -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",
|
||||
"linux-x86_64-icc", "icc:-DL_ENDIAN -DTERMIO -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-x32", "gcc:-mx32 -DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
|
||||
"linux64-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -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",
|
||||
"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt: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 -Wextra $clang_disabled_warnings -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",
|
||||
"linux-x86_64-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
|
||||
"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
|
||||
# /proc/cpuinfo. The idea is to preserve most significant bits of
|
||||
@@ -415,16 +432,16 @@ my %table=(
|
||||
# ldconfig and run-time linker to autodiscover. Unfortunately it
|
||||
# doesn't work just yet, because of couple of bugs in glibc
|
||||
# sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
|
||||
"linux32-s390x", "gcc:-m31 -Wa,-mzarch -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$s390x_asm;$asm=~s/bn\-s390x\.o/bn_asm.o/;$asm}.":31:dlfcn:linux-shared:-fPIC:-m31:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/highgprs",
|
||||
"linux32-s390x", "gcc:-m31 -Wa,-mzarch -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$s390x_asm;$asm=~s/bn\-s390x\.o/bn_asm.o/;$asm}.":31:dlfcn:linux-shared:-fPIC:-m31:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/highgprs",
|
||||
#### SPARC Linux setups
|
||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
||||
# assisted with debugging of following two configs.
|
||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-sparcv8","gcc:-mcpu=v8 -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
||||
# -Wa,-Av8plus should do the trick no matter what.
|
||||
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# GCC 3.1 is a requirement
|
||||
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
#### Alpha Linux with GNU C and Compaq C setups
|
||||
# Special notes:
|
||||
# - linux-alpha+bwx-gcc is ment to be used from ./config only. If you
|
||||
@@ -438,31 +455,31 @@ my %table=(
|
||||
#
|
||||
# <appro@fy.chalmers.se>
|
||||
#
|
||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
|
||||
# Android: linux-* but without -DTERMIO and pointers to headers and libs.
|
||||
# Android: linux-* but without pointers to headers and libs.
|
||||
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -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)",
|
||||
"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"android-mips","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### *BSD [do see comment about ${BSDthreads} above!]
|
||||
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-sparcv8", "gcc:-DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-generic32","gcc:-O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-sparcv8", "gcc:-DB_ENDIAN -O3 -mcpu=v8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
"BSD-generic64","gcc:-DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-generic64","gcc:-O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
|
||||
# simply *happens* to work around a compiler bug in gcc 3.3.3,
|
||||
# triggered by RIPEMD160 code.
|
||||
"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-sparc64", "gcc:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-ia64", "gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86_64", "cc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
@@ -474,8 +491,8 @@ my %table=(
|
||||
|
||||
# QNX
|
||||
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
|
||||
"QNX6", "gcc:-DTERMIOS::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"QNX6-i386", "gcc:-DL_ENDIAN -DTERMIOS -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"QNX6", "gcc:::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"QNX6-i386", "gcc:-DL_ENDIAN -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# BeOS
|
||||
"beos-x86-r5", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so",
|
||||
@@ -548,7 +565,7 @@ my %table=(
|
||||
"SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::",
|
||||
|
||||
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
|
||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
||||
|
||||
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
|
||||
# You need to compile using the c89.sh wrapper in the tools directory, because the
|
||||
@@ -607,7 +624,7 @@ my %table=(
|
||||
"netware-libc-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::",
|
||||
|
||||
# DJGPP
|
||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:",
|
||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:",
|
||||
|
||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||
"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
|
||||
@@ -634,7 +651,7 @@ my %table=(
|
||||
"newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
|
||||
|
||||
##### GNU Hurd
|
||||
"hurd-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC",
|
||||
"hurd-x86", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC",
|
||||
|
||||
##### OS/2 EMX
|
||||
"OS2-EMX", "gcc::::::::",
|
||||
@@ -1195,6 +1212,7 @@ my $cc = $fields[$idx_cc];
|
||||
if($ENV{CC}) {
|
||||
$cc = $ENV{CC};
|
||||
}
|
||||
|
||||
my $cflags = $fields[$idx_cflags];
|
||||
my $unistd = $fields[$idx_unistd];
|
||||
my $thread_cflag = $fields[$idx_thread_cflag];
|
||||
@@ -1630,12 +1648,21 @@ 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 or clang" unless ($cc =~ /gcc$/ or $cc =~ /clang$/);
|
||||
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/)
|
||||
}
|
||||
if ($ecc eq "clang")
|
||||
{
|
||||
foreach $wopt (split /\s+/, $clang_devteam_warn)
|
||||
{
|
||||
$cflags .= " $wopt" unless ($cflags =~ /$wopt/)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
|
||||
|
26
Makefile.org
26
Makefile.org
@@ -185,7 +185,7 @@ WTARFILE= $(NAME)-win.tar
|
||||
EXHEADER= e_os2.h
|
||||
HEADER= e_os.h
|
||||
|
||||
all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
|
||||
all: Makefile build_all
|
||||
|
||||
# as we stick to -e, CLEARENV ensures that local variables in lower
|
||||
# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
|
||||
@@ -271,7 +271,10 @@ reflect:
|
||||
sub_all: build_all
|
||||
build_all: build_libs build_apps build_tests build_tools
|
||||
|
||||
build_libs: build_crypto build_ssl build_engines
|
||||
build_libs: build_libcrypto build_libssl openssl.pc
|
||||
|
||||
build_libcrypto: build_crypto build_engines libcrypto.pc
|
||||
build_libssl: build_ssl libssl.pc
|
||||
|
||||
build_crypto:
|
||||
@dir=crypto; target=all; $(BUILD_ONE_CMD)
|
||||
@@ -457,6 +460,9 @@ tests: rehash
|
||||
report:
|
||||
@$(PERL) util/selftest.pl
|
||||
|
||||
update: errors stacks util/libeay.num util/ssleay.num TABLE
|
||||
@set -e; target=update; $(RECURSIVE_BUILD_CMD)
|
||||
|
||||
depend:
|
||||
@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
|
||||
|
||||
@@ -481,26 +487,10 @@ util/libeay.num::
|
||||
util/ssleay.num::
|
||||
$(PERL) util/mkdef.pl ssl update
|
||||
|
||||
crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
|
||||
$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
|
||||
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
|
||||
$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
|
||||
crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
|
||||
$(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
|
||||
|
||||
apps/openssl-vms.cnf: apps/openssl.cnf
|
||||
$(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
|
||||
|
||||
crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
|
||||
$(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
|
||||
|
||||
|
||||
TABLE: Configure
|
||||
(echo 'Output of `Configure TABLE'"':"; \
|
||||
$(PERL) Configure TABLE) > TABLE
|
||||
|
||||
update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
|
||||
|
||||
# Build distribution tar-file. As the list of files returned by "find" is
|
||||
# pretty long, on several platforms a "too many arguments" error or similar
|
||||
# would occur. Therefore the list of files is temporarily stored into a file
|
||||
|
94
NEWS
94
NEWS
@@ -5,6 +5,30 @@
|
||||
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.2a and OpenSSL 1.0.2b [11 Jun 2015]
|
||||
|
||||
o Malformed ECParameters causes infinite loop (CVE-2015-1788)
|
||||
o Exploitable out-of-bounds read in X509_cmp_time (CVE-2015-1789)
|
||||
o PKCS7 crash with missing EnvelopedContent (CVE-2015-1790)
|
||||
o CMS verify infinite loop with unknown hash function (CVE-2015-1792)
|
||||
o Race condition handling NewSessionTicket (CVE-2015-1791)
|
||||
|
||||
Major changes between OpenSSL 1.0.2 and OpenSSL 1.0.2a [19 Mar 2015]
|
||||
|
||||
o OpenSSL 1.0.2 ClientHello sigalgs DoS fix (CVE-2015-0291)
|
||||
o Multiblock corrupted pointer fix (CVE-2015-0290)
|
||||
o Segmentation fault in DTLSv1_listen fix (CVE-2015-0207)
|
||||
o Segmentation fault in ASN1_TYPE_cmp fix (CVE-2015-0286)
|
||||
o Segmentation fault for invalid PSS parameters fix (CVE-2015-0208)
|
||||
o ASN.1 structure reuse memory corruption fix (CVE-2015-0287)
|
||||
o PKCS7 NULL pointer dereferences fix (CVE-2015-0289)
|
||||
o DoS via reachable assert in SSLv2 servers fix (CVE-2015-0293)
|
||||
o Empty CKE with client auth and DHE fix (CVE-2015-1787)
|
||||
o Handshake with unseeded PRNG fix (CVE-2015-0285)
|
||||
o Use After Free following d2i_ECPrivatekey error fix (CVE-2015-0209)
|
||||
o X509_to_X509_REQ NULL pointer deref fix (CVE-2015-0288)
|
||||
o Removed the export ciphers from the DEFAULT ciphers
|
||||
|
||||
Major changes between OpenSSL 1.0.1l and OpenSSL 1.0.2 [22 Jan 2015]:
|
||||
|
||||
o Suite B support for TLS 1.2 and DTLS 1.2
|
||||
@@ -54,6 +78,7 @@
|
||||
|
||||
o Fix for CVE-2014-0224
|
||||
o Fix for CVE-2014-0221
|
||||
o Fix for CVE-2014-0198
|
||||
o Fix for CVE-2014-0195
|
||||
o Fix for CVE-2014-3470
|
||||
o Fix for CVE-2010-5298
|
||||
@@ -113,19 +138,6 @@
|
||||
o Preliminary FIPS capability for unvalidated 2.0 FIPS module.
|
||||
o SRP support.
|
||||
|
||||
Major changes between OpenSSL 1.0.0j and OpenSSL 1.0.0k [5 Feb 2013]:
|
||||
|
||||
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
|
||||
o Fix OCSP bad key DoS attack CVE-2013-0166
|
||||
|
||||
Major changes between OpenSSL 1.0.0i and OpenSSL 1.0.0j [10 May 2012]:
|
||||
|
||||
o Fix DTLS record length checking bug CVE-2012-2333
|
||||
|
||||
Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.0i [19 Apr 2012]:
|
||||
|
||||
o Fix for ASN1 overflow bug CVE-2012-2110
|
||||
|
||||
Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h [12 Mar 2012]:
|
||||
|
||||
o Fix for CMS/PKCS#7 MMA CVE-2012-0884
|
||||
@@ -198,62 +210,6 @@
|
||||
o Opaque PRF Input TLS extension support.
|
||||
o Updated time routines to avoid OS limitations.
|
||||
|
||||
Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y [5 Feb 2013]:
|
||||
|
||||
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
|
||||
o Fix OCSP bad key DoS attack CVE-2013-0166
|
||||
|
||||
Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x [10 May 2012]:
|
||||
|
||||
o Fix DTLS record length checking bug CVE-2012-2333
|
||||
|
||||
Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w [23 Apr 2012]:
|
||||
|
||||
o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110)
|
||||
|
||||
Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v [19 Apr 2012]:
|
||||
|
||||
o Fix for ASN1 overflow bug CVE-2012-2110
|
||||
|
||||
Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u [12 Mar 2012]:
|
||||
|
||||
o Fix for CMS/PKCS#7 MMA CVE-2012-0884
|
||||
o Corrected fix for CVE-2011-4619
|
||||
o Various DTLS fixes.
|
||||
|
||||
Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t [18 Jan 2012]:
|
||||
|
||||
o Fix for DTLS DoS issue CVE-2012-0050
|
||||
|
||||
Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s [4 Jan 2012]:
|
||||
|
||||
o Fix for DTLS plaintext recovery attack CVE-2011-4108
|
||||
o Fix policy check double free error CVE-2011-4109
|
||||
o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
|
||||
o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
|
||||
o Check for malformed RFC3779 data CVE-2011-4577
|
||||
|
||||
Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r [8 Feb 2011]:
|
||||
|
||||
o Fix for security issue CVE-2011-0014
|
||||
|
||||
Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q [2 Dec 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-4180
|
||||
o Fix for CVE-2010-4252
|
||||
|
||||
Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p [16 Nov 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-3864.
|
||||
|
||||
Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o [1 Jun 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-0742.
|
||||
o Various DTLS fixes.
|
||||
o Recognise SHA2 certificates if only SSL algorithms added.
|
||||
o Fix for no-rc4 compilation.
|
||||
o Chil ENGINE unload workaround.
|
||||
|
||||
Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
|
||||
|
||||
o CFB cipher definition fixes.
|
||||
|
2
README
2
README
@@ -1,5 +1,5 @@
|
||||
|
||||
OpenSSL 1.0.2 22 Jan 2015
|
||||
OpenSSL 1.0.2b 11 Jun 2015
|
||||
|
||||
Copyright (c) 1998-2011 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
|
118
TABLE
118
TABLE
@@ -36,7 +36,7 @@ $multilib =
|
||||
|
||||
*** BS2000-OSD
|
||||
$cc = c89
|
||||
$cflags = -O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC
|
||||
$cflags = -O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
@@ -70,7 +70,7 @@ $multilib =
|
||||
|
||||
*** BSD-generic32
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIOS -O3 -fomit-frame-pointer -Wall
|
||||
$cflags = -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -104,7 +104,7 @@ $multilib =
|
||||
|
||||
*** BSD-generic64
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIOS -O3 -Wall
|
||||
$cflags = -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -138,7 +138,7 @@ $multilib =
|
||||
|
||||
*** BSD-ia64
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O3 -Wall
|
||||
$cflags = -DL_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -172,7 +172,7 @@ $multilib =
|
||||
|
||||
*** BSD-sparc64
|
||||
$cc = gcc
|
||||
$cflags = -DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall
|
||||
$cflags = -DB_ENDIAN -O3 -DMD32_REG_T=int -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -206,7 +206,7 @@ $multilib =
|
||||
|
||||
*** BSD-sparcv8
|
||||
$cc = gcc
|
||||
$cflags = -DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall
|
||||
$cflags = -DB_ENDIAN -O3 -mcpu=v8 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -240,7 +240,7 @@ $multilib =
|
||||
|
||||
*** BSD-x86
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall
|
||||
$cflags = -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -274,7 +274,7 @@ $multilib =
|
||||
|
||||
*** BSD-x86-elf
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall
|
||||
$cflags = -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -308,7 +308,7 @@ $multilib =
|
||||
|
||||
*** BSD-x86_64
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O3 -Wall
|
||||
$cflags = -DL_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -410,7 +410,7 @@ $multilib =
|
||||
|
||||
*** DJGPP
|
||||
$cc = gcc
|
||||
$cflags = -I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall
|
||||
$cflags = -I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id = MSDOS
|
||||
@@ -546,7 +546,7 @@ $multilib =
|
||||
|
||||
*** QNX6
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIOS
|
||||
$cflags =
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id =
|
||||
@@ -580,7 +580,7 @@ $multilib =
|
||||
|
||||
*** QNX6-i386
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O2 -Wall
|
||||
$cflags = -DL_ENDIAN -O2 -Wall
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id =
|
||||
@@ -1600,7 +1600,7 @@ $multilib =
|
||||
|
||||
*** debug-BSD-x86-elf
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O3 -Wall -g
|
||||
$cflags = -DL_ENDIAN -O3 -Wall -g
|
||||
$unistd =
|
||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2348,7 +2348,7 @@ $multilib =
|
||||
|
||||
*** debug-levitte-linux-elf-extreme
|
||||
$cc = gcc
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2416,7 +2416,7 @@ $multilib =
|
||||
|
||||
*** debug-levitte-linux-noasm-extreme
|
||||
$cc = gcc
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2450,7 +2450,7 @@ $multilib =
|
||||
|
||||
*** debug-linux-elf
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2484,7 +2484,7 @@ $multilib =
|
||||
|
||||
*** debug-linux-elf-noefence
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2518,7 +2518,7 @@ $multilib =
|
||||
|
||||
*** debug-linux-generic32
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2586,7 +2586,7 @@ $multilib =
|
||||
|
||||
*** debug-linux-ia32-aes
|
||||
$cc = gcc
|
||||
$cflags = -DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
$cflags = -DAES_EXPERIMENTAL -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2620,7 +2620,7 @@ $multilib =
|
||||
|
||||
*** debug-linux-pentium
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentium -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2654,7 +2654,7 @@ $multilib =
|
||||
|
||||
*** debug-linux-ppro
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2688,7 +2688,7 @@ $multilib =
|
||||
|
||||
*** debug-linux-x86_64
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2790,7 +2790,7 @@ $multilib =
|
||||
|
||||
*** debug-solaris-sparcv8-gcc
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=v8 -Wall -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -3708,7 +3708,7 @@ $multilib = /pa20_64
|
||||
|
||||
*** hurd-x86
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall
|
||||
$cflags = -DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -3776,7 +3776,7 @@ $multilib =
|
||||
|
||||
*** irix-cc
|
||||
$cc = cc
|
||||
$cflags = -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN
|
||||
$cflags = -O2 -use_readonly_const -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
@@ -3810,7 +3810,7 @@ $multilib =
|
||||
|
||||
*** irix-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -DTERMIOS -DB_ENDIAN
|
||||
$cflags = -O3 -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
@@ -3844,7 +3844,7 @@ $multilib =
|
||||
|
||||
*** irix-mips3-cc
|
||||
$cc = cc
|
||||
$cflags = -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$cflags = -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = -D_SGI_MP_SOURCE
|
||||
$sys_id =
|
||||
@@ -3878,7 +3878,7 @@ $multilib = 32
|
||||
|
||||
*** irix-mips3-gcc
|
||||
$cc = gcc
|
||||
$cflags = -mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$cflags = -mabi=n32 -O3 -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = -D_SGI_MP_SOURCE
|
||||
$sys_id =
|
||||
@@ -3912,7 +3912,7 @@ $multilib = 32
|
||||
|
||||
*** irix64-mips4-cc
|
||||
$cc = cc
|
||||
$cflags = -64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$cflags = -64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = -D_SGI_MP_SOURCE
|
||||
$sys_id =
|
||||
@@ -3946,7 +3946,7 @@ $multilib = 64
|
||||
|
||||
*** irix64-mips4-gcc
|
||||
$cc = gcc
|
||||
$cflags = -mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$cflags = -mabi=64 -mips4 -O3 -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = -D_SGI_MP_SOURCE
|
||||
$sys_id =
|
||||
@@ -3980,7 +3980,7 @@ $multilib = 64
|
||||
|
||||
*** linux-aarch64
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIO -O3 -Wall
|
||||
$cflags = -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4014,7 +4014,7 @@ $multilib =
|
||||
|
||||
*** linux-alpha+bwx-ccc
|
||||
$cc = ccc
|
||||
$cflags = -fast -readonly_strings -DL_ENDIAN -DTERMIO
|
||||
$cflags = -fast -readonly_strings -DL_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4048,7 +4048,7 @@ $multilib =
|
||||
|
||||
*** linux-alpha+bwx-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -DL_ENDIAN -DTERMIO
|
||||
$cflags = -O3 -DL_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4082,7 +4082,7 @@ $multilib =
|
||||
|
||||
*** linux-alpha-ccc
|
||||
$cc = ccc
|
||||
$cflags = -fast -readonly_strings -DL_ENDIAN -DTERMIO
|
||||
$cflags = -fast -readonly_strings -DL_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4116,7 +4116,7 @@ $multilib =
|
||||
|
||||
*** linux-alpha-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -DL_ENDIAN -DTERMIO
|
||||
$cflags = -O3 -DL_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4150,7 +4150,7 @@ $multilib =
|
||||
|
||||
*** linux-aout
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall
|
||||
$cflags = -DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
@@ -4184,7 +4184,7 @@ $multilib =
|
||||
|
||||
*** linux-armv4
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIO -O3 -Wall
|
||||
$cflags = -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4218,7 +4218,7 @@ $multilib =
|
||||
|
||||
*** linux-elf
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
$cflags = -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4252,7 +4252,7 @@ $multilib =
|
||||
|
||||
*** linux-generic32
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
$cflags = -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4286,7 +4286,7 @@ $multilib =
|
||||
|
||||
*** linux-generic64
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIO -O3 -Wall
|
||||
$cflags = -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4320,7 +4320,7 @@ $multilib =
|
||||
|
||||
*** linux-ia32-icc
|
||||
$cc = icc
|
||||
$cflags = -DL_ENDIAN -DTERMIO -O2
|
||||
$cflags = -DL_ENDIAN -O2
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4388,7 +4388,7 @@ $multilib =
|
||||
|
||||
*** linux-ia64-icc
|
||||
$cc = icc
|
||||
$cflags = -DL_ENDIAN -DTERMIO -O2 -Wall
|
||||
$cflags = -DL_ENDIAN -O2 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4422,7 +4422,7 @@ $multilib =
|
||||
|
||||
*** linux-mips32
|
||||
$cc = gcc
|
||||
$cflags = -mabi=32 -DTERMIO -O3 -Wall -DBN_DIV3W
|
||||
$cflags = -mabi=32 -O3 -Wall -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4456,7 +4456,7 @@ $multilib =
|
||||
|
||||
*** linux-mips64
|
||||
$cc = gcc
|
||||
$cflags = -mabi=n32 -DTERMIO -O3 -Wall -DBN_DIV3W
|
||||
$cflags = -mabi=n32 -O3 -Wall -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4490,7 +4490,7 @@ $multilib = 32
|
||||
|
||||
*** linux-ppc
|
||||
$cc = gcc
|
||||
$cflags = -DB_ENDIAN -DTERMIO -O3 -Wall
|
||||
$cflags = -DB_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4524,7 +4524,7 @@ $multilib =
|
||||
|
||||
*** linux-ppc64
|
||||
$cc = gcc
|
||||
$cflags = -m64 -DB_ENDIAN -DTERMIO -O3 -Wall
|
||||
$cflags = -m64 -DB_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4558,7 +4558,7 @@ $multilib = 64
|
||||
|
||||
*** linux-ppc64le
|
||||
$cc = gcc
|
||||
$cflags = -m64 -DL_ENDIAN -DTERMIO -O3 -Wall
|
||||
$cflags = -m64 -DL_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4592,7 +4592,7 @@ $multilib =
|
||||
|
||||
*** linux-sparcv8
|
||||
$cc = gcc
|
||||
$cflags = -mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W
|
||||
$cflags = -mcpu=v8 -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4626,7 +4626,7 @@ $multilib =
|
||||
|
||||
*** linux-sparcv9
|
||||
$cc = gcc
|
||||
$cflags = -m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W
|
||||
$cflags = -m32 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id = ULTRASPARC
|
||||
@@ -4660,7 +4660,7 @@ $multilib =
|
||||
|
||||
*** linux-x32
|
||||
$cc = gcc
|
||||
$cflags = -mx32 -DL_ENDIAN -DTERMIO -O3 -Wall
|
||||
$cflags = -mx32 -DL_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4694,7 +4694,7 @@ $multilib = x32
|
||||
|
||||
*** linux-x86_64
|
||||
$cc = gcc
|
||||
$cflags = -m64 -DL_ENDIAN -DTERMIO -O3 -Wall
|
||||
$cflags = -m64 -DL_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4728,7 +4728,7 @@ $multilib = 64
|
||||
|
||||
*** linux-x86_64-clang
|
||||
$cc = clang
|
||||
$cflags = -m64 -DL_ENDIAN -DTERMIO -O3 -Weverything -Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum -Qunused-arguments
|
||||
$cflags = -m64 -DL_ENDIAN -O3 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4762,7 +4762,7 @@ $multilib = 64
|
||||
|
||||
*** linux-x86_64-icc
|
||||
$cc = icc
|
||||
$cflags = -DL_ENDIAN -DTERMIO -O2
|
||||
$cflags = -DL_ENDIAN -O2
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4796,7 +4796,7 @@ $multilib = 64
|
||||
|
||||
*** linux32-s390x
|
||||
$cc = gcc
|
||||
$cflags = -m31 -Wa,-mzarch -DB_ENDIAN -DTERMIO -O3 -Wall
|
||||
$cflags = -m31 -Wa,-mzarch -DB_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4830,7 +4830,7 @@ $multilib = /highgprs
|
||||
|
||||
*** linux64-mips64
|
||||
$cc = gcc
|
||||
$cflags = -mabi=64 -DTERMIO -O3 -Wall -DBN_DIV3W
|
||||
$cflags = -mabi=64 -O3 -Wall -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4864,7 +4864,7 @@ $multilib = 64
|
||||
|
||||
*** linux64-s390x
|
||||
$cc = gcc
|
||||
$cflags = -m64 -DB_ENDIAN -DTERMIO -O3 -Wall
|
||||
$cflags = -m64 -DB_ENDIAN -O3 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -4898,7 +4898,7 @@ $multilib = 64
|
||||
|
||||
*** linux64-sparcv9
|
||||
$cc = gcc
|
||||
$cflags = -m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
$cflags = -m64 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id = ULTRASPARC
|
||||
@@ -5748,7 +5748,7 @@ $multilib =
|
||||
|
||||
*** solaris-sparcv8-gcc
|
||||
$cc = gcc
|
||||
$cflags = -mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W
|
||||
$cflags = -mcpu=v8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -6054,7 +6054,7 @@ $multilib = /64
|
||||
|
||||
*** sunos-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -mv8 -Dssize_t=int
|
||||
$cflags = -O3 -mcpu=v8 -Dssize_t=int
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id = SUNOS
|
||||
|
@@ -94,6 +94,9 @@ req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
|
||||
sreq.o: req.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
|
||||
|
||||
openssl-vms.cnf: openssl.cnf
|
||||
$(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
@@ -127,12 +130,12 @@ links:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
depend:
|
||||
@if [ -z "$(THIS)" ]; then \
|
||||
$(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
|
||||
else \
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
|
||||
fi
|
||||
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); \
|
||||
|
||||
dclean:
|
||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||
@@ -144,10 +147,10 @@ clean:
|
||||
rm -f req
|
||||
|
||||
$(DLIBSSL):
|
||||
(cd ..; $(MAKE) DIRS=ssl all)
|
||||
(cd ..; $(MAKE) build_libssl)
|
||||
|
||||
$(DLIBCRYPTO):
|
||||
(cd ..; $(MAKE) DIRS=crypto all)
|
||||
(cd ..; $(MAKE) build_libcrypto)
|
||||
|
||||
$(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||
$(RM) $(EXE)
|
||||
|
15
apps/apps.c
15
apps/apps.c
@@ -574,6 +574,11 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
|
||||
char *prompt = NULL;
|
||||
|
||||
prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
|
||||
if (!prompt) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
UI_free(ui);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ui_flags |= UI_INPUT_FLAG_DEFAULT_PWD;
|
||||
UI_ctrl(ui, UI_CTRL_PRINT_ERRORS, 1, 0, 0);
|
||||
@@ -583,6 +588,12 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
|
||||
PW_MIN_LENGTH, bufsiz - 1);
|
||||
if (ok >= 0 && verify) {
|
||||
buff = (char *)OPENSSL_malloc(bufsiz);
|
||||
if (!buff) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
UI_free(ui);
|
||||
OPENSSL_free(prompt);
|
||||
return 0;
|
||||
}
|
||||
ok = UI_add_verify_string(ui, prompt, ui_flags, buff,
|
||||
PW_MIN_LENGTH, bufsiz - 1, buf);
|
||||
}
|
||||
@@ -2360,6 +2371,8 @@ int args_verify(char ***pargs, int *pargc,
|
||||
flags |= X509_V_FLAG_SUITEB_192_LOS;
|
||||
else if (!strcmp(arg, "-partial_chain"))
|
||||
flags |= X509_V_FLAG_PARTIAL_CHAIN;
|
||||
else if (!strcmp(arg, "-no_alt_chains"))
|
||||
flags |= X509_V_FLAG_NO_ALT_CHAINS;
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -2775,7 +2788,7 @@ void print_cert_checks(BIO *bio, X509 *x,
|
||||
return;
|
||||
if (checkhost) {
|
||||
BIO_printf(bio, "Hostname %s does%s match certificate\n",
|
||||
checkhost, X509_check_host(x, checkhost, 0, 0, NULL)
|
||||
checkhost, X509_check_host(x, checkhost, 0, 0, NULL) == 1
|
||||
? "" : " NOT");
|
||||
}
|
||||
|
||||
|
@@ -375,7 +375,7 @@ static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
|
||||
{
|
||||
CONF *cnf = NULL;
|
||||
int len;
|
||||
long errline;
|
||||
long errline = 0;
|
||||
unsigned char *p;
|
||||
ASN1_TYPE *atyp = NULL;
|
||||
|
||||
|
21
apps/ca.c
21
apps/ca.c
@@ -563,10 +563,18 @@ int MAIN(int argc, char **argv)
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
len = strlen(s) + sizeof(CONFIG_FILE);
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
strcpy(tofree, s);
|
||||
#else
|
||||
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
BUF_strlcpy(tofree, s, len);
|
||||
BUF_strlcat(tofree, "/", len);
|
||||
#endif
|
||||
@@ -2813,6 +2821,11 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
ASN1_GENERALIZEDTIME *comp_time = NULL;
|
||||
tmp = BUF_strdup(str);
|
||||
|
||||
if (!tmp) {
|
||||
BIO_printf(bio_err, "memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
p = strchr(tmp, ',');
|
||||
|
||||
rtime_str = tmp;
|
||||
@@ -2830,6 +2843,10 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
|
||||
if (prevtm) {
|
||||
*prevtm = ASN1_UTCTIME_new();
|
||||
if (!*prevtm) {
|
||||
BIO_printf(bio_err, "memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
if (!ASN1_UTCTIME_set_string(*prevtm, rtime_str)) {
|
||||
BIO_printf(bio_err, "invalid revocation date %s\n", rtime_str);
|
||||
goto err;
|
||||
@@ -2870,6 +2887,10 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
goto err;
|
||||
}
|
||||
comp_time = ASN1_GENERALIZEDTIME_new();
|
||||
if (!comp_time) {
|
||||
BIO_printf(bio_err, "memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
if (!ASN1_GENERALIZEDTIME_set_string(comp_time, arg_str)) {
|
||||
BIO_printf(bio_err, "invalid compromised time %s\n", arg_str);
|
||||
goto err;
|
||||
|
@@ -463,6 +463,10 @@ int MAIN(int argc, char **argv)
|
||||
if (key_param == NULL || key_param->idx != keyidx) {
|
||||
cms_key_param *nparam;
|
||||
nparam = OPENSSL_malloc(sizeof(cms_key_param));
|
||||
if (!nparam) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto argerr;
|
||||
}
|
||||
nparam->idx = keyidx;
|
||||
nparam->param = sk_OPENSSL_STRING_new_null();
|
||||
nparam->next = NULL;
|
||||
@@ -641,6 +645,8 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,
|
||||
"-CApath dir trusted certificates directory\n");
|
||||
BIO_printf(bio_err, "-CAfile file trusted certificates file\n");
|
||||
BIO_printf(bio_err,
|
||||
"-no_alt_chains only ever use the first certificate chain found\n");
|
||||
BIO_printf(bio_err,
|
||||
"-crl_check check revocation status of signer's certificate using CRLs\n");
|
||||
BIO_printf(bio_err,
|
||||
|
15
apps/dgst.c
15
apps/dgst.c
@@ -293,6 +293,11 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
in = BIO_new(BIO_s_file());
|
||||
bmd = BIO_new(BIO_f_md());
|
||||
if ((in == NULL) || (bmd == NULL)) {
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
BIO_set_callback(in, BIO_debug_callback);
|
||||
/* needed for windows 3.1 */
|
||||
@@ -304,11 +309,6 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((in == NULL) || (bmd == NULL)) {
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (out_bin == -1) {
|
||||
if (keyfile)
|
||||
out_bin = 1;
|
||||
@@ -460,6 +460,11 @@ int MAIN(int argc, char **argv)
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (!sigbuf) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
siglen = BIO_read(sigbio, sigbuf, siglen);
|
||||
BIO_free(sigbio);
|
||||
if (siglen <= 0) {
|
||||
|
13
apps/enc.c
13
apps/enc.c
@@ -548,9 +548,14 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
OPENSSL_cleanse(str, strlen(str));
|
||||
}
|
||||
if ((hiv != NULL) && !set_hex(hiv, iv, sizeof iv)) {
|
||||
BIO_printf(bio_err, "invalid hex iv value\n");
|
||||
goto end;
|
||||
if (hiv != NULL) {
|
||||
int siz = EVP_CIPHER_iv_length(cipher);
|
||||
if (siz == 0) {
|
||||
BIO_printf(bio_err, "warning: iv not use by this cipher\n");
|
||||
} else if (!set_hex(hiv, iv, sizeof iv)) {
|
||||
BIO_printf(bio_err, "invalid hex iv value\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
if ((hiv == NULL) && (str == NULL)
|
||||
&& EVP_CIPHER_iv_length(cipher) != 0) {
|
||||
@@ -562,7 +567,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "iv undefined\n");
|
||||
goto end;
|
||||
}
|
||||
if ((hkey != NULL) && !set_hex(hkey, key, sizeof key)) {
|
||||
if ((hkey != NULL) && !set_hex(hkey, key, EVP_CIPHER_key_length(cipher))) {
|
||||
BIO_printf(bio_err, "invalid hex key value\n");
|
||||
goto end;
|
||||
}
|
||||
|
@@ -535,6 +535,8 @@ int MAIN(int argc, char **argv)
|
||||
"-CApath dir trusted certificates directory\n");
|
||||
BIO_printf(bio_err,
|
||||
"-CAfile file trusted certificates file\n");
|
||||
BIO_printf(bio_err,
|
||||
"-no_alt_chains only ever use the first certificate chain found\n");
|
||||
BIO_printf(bio_err,
|
||||
"-VAfile file validator certificates file\n");
|
||||
BIO_printf(bio_err,
|
||||
|
@@ -428,10 +428,6 @@ int main(int Argc, char *ARGV[])
|
||||
if (arg.data != NULL)
|
||||
OPENSSL_free(arg.data);
|
||||
|
||||
if (bio_err != NULL) {
|
||||
BIO_free(bio_err);
|
||||
bio_err = NULL;
|
||||
}
|
||||
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
|
||||
/* Free any duplicate Argv[] storage. */
|
||||
if (free_Argv) {
|
||||
@@ -440,6 +436,10 @@ int main(int Argc, char *ARGV[])
|
||||
#endif
|
||||
apps_shutdown();
|
||||
CRYPTO_mem_leaks(bio_err);
|
||||
if (bio_err != NULL) {
|
||||
BIO_free(bio_err);
|
||||
bio_err = NULL;
|
||||
}
|
||||
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
|
10
apps/pkcs7.c
10
apps/pkcs7.c
@@ -189,11 +189,11 @@ int MAIN(int argc, char **argv)
|
||||
if (infile == NULL)
|
||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
||||
else {
|
||||
if (BIO_read_filename(in, infile) <= 0)
|
||||
if (in == NULL) {
|
||||
perror(infile);
|
||||
goto end;
|
||||
}
|
||||
if (BIO_read_filename(in, infile) <= 0) {
|
||||
BIO_printf(bio_err, "unable to load input file\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (informat == FORMAT_ASN1)
|
||||
|
@@ -268,6 +268,11 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
rsa_in = OPENSSL_malloc(keysize * 2);
|
||||
rsa_out = OPENSSL_malloc(keysize);
|
||||
if (!rsa_in || !rsa_out) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Read the input data */
|
||||
rsa_inlen = BIO_read(in, rsa_in, keysize * 2);
|
||||
|
@@ -111,6 +111,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* for memcpy() and strcmp() */
|
||||
#define USE_SOCKETS
|
||||
#define NON_MAIN
|
||||
#include "apps.h"
|
||||
@@ -456,8 +457,13 @@ int ssl_print_curves(BIO *out, SSL *s, int noshared)
|
||||
if (ncurves <= 0)
|
||||
return 1;
|
||||
curves = OPENSSL_malloc(ncurves * sizeof(int));
|
||||
if (!curves) {
|
||||
BIO_puts(out, "Malloc error getting supported curves\n");
|
||||
return 0;
|
||||
}
|
||||
SSL_get1_curves(s, curves);
|
||||
|
||||
|
||||
BIO_puts(out, "Supported Elliptic Curves: ");
|
||||
for (i = 0; i < ncurves; i++) {
|
||||
if (i)
|
||||
@@ -1007,7 +1013,7 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie,
|
||||
|
||||
/* Initialize a random secret */
|
||||
if (!cookie_initialized) {
|
||||
if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH)) {
|
||||
if (RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH) <= 0) {
|
||||
BIO_printf(bio_err, "error setting random cookie secret\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -331,6 +331,8 @@ static void sc_usage(void)
|
||||
" -pass arg - private key file pass phrase source\n");
|
||||
BIO_printf(bio_err, " -CApath arg - PEM format directory of CA's\n");
|
||||
BIO_printf(bio_err, " -CAfile arg - PEM format file of CA's\n");
|
||||
BIO_printf(bio_err,
|
||||
" -no_alt_chains - only ever use the first certificate chain found\n");
|
||||
BIO_printf(bio_err,
|
||||
" -reconnect - Drop and re-make the connection with the same Session-ID\n");
|
||||
BIO_printf(bio_err,
|
||||
@@ -560,6 +562,11 @@ static char *MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
|
||||
PW_CB_DATA cb_tmp;
|
||||
int l;
|
||||
|
||||
if (!pass) {
|
||||
BIO_printf(bio_err, "Malloc failure\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cb_tmp.password = (char *)srp_arg->srppassin;
|
||||
cb_tmp.prompt_info = "SRP user";
|
||||
if ((l = password_callback(pass, PWD_STRLEN, 0, &cb_tmp)) < 0) {
|
||||
@@ -1295,12 +1302,6 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
if (exc)
|
||||
ssl_ctx_set_excert(ctx, exc);
|
||||
/*
|
||||
* DTLS: partial reads end up discarding unread UDP bytes :-( Setting
|
||||
* read ahead solves this problem.
|
||||
*/
|
||||
if (socket_type == SOCK_DGRAM)
|
||||
SSL_CTX_set_read_ahead(ctx, 1);
|
||||
|
||||
#if !defined(OPENSSL_NO_TLSEXT)
|
||||
# if !defined(OPENSSL_NO_NEXTPROTONEG)
|
||||
@@ -1337,13 +1338,12 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
SSL_CTX_set_verify(ctx, verify, verify_callback);
|
||||
|
||||
if ((!SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) ||
|
||||
(!SSL_CTX_set_default_verify_paths(ctx))) {
|
||||
/*
|
||||
* BIO_printf(bio_err,"error setting default verify locations\n");
|
||||
*/
|
||||
if ((CAfile || CApath)
|
||||
&& !SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) {
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
if (!SSL_CTX_set_default_verify_paths(ctx)) {
|
||||
ERR_print_errors(bio_err);
|
||||
/* goto end; */
|
||||
}
|
||||
|
||||
ssl_ctx_add_crls(ctx, crls, crl_download);
|
||||
|
105
apps/s_server.c
105
apps/s_server.c
@@ -222,7 +222,7 @@ static void init_session_cache_ctx(SSL_CTX *sctx);
|
||||
static void free_sessions(void);
|
||||
#ifndef OPENSSL_NO_DH
|
||||
static DH *load_dh_param(const char *dhfile);
|
||||
static DH *get_dh512(void);
|
||||
static DH *get_dh2048(void);
|
||||
#endif
|
||||
|
||||
#ifdef MONOLITH
|
||||
@@ -230,30 +230,48 @@ static void s_server_init(void);
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_DH
|
||||
static unsigned char dh512_p[] = {
|
||||
0xDA, 0x58, 0x3C, 0x16, 0xD9, 0x85, 0x22, 0x89, 0xD0, 0xE4, 0xAF, 0x75,
|
||||
0x6F, 0x4C, 0xCA, 0x92, 0xDD, 0x4B, 0xE5, 0x33, 0xB8, 0x04, 0xFB, 0x0F,
|
||||
0xED, 0x94, 0xEF, 0x9C, 0x8A, 0x44, 0x03, 0xED, 0x57, 0x46, 0x50, 0xD3,
|
||||
0x69, 0x99, 0xDB, 0x29, 0xD7, 0x76, 0x27, 0x6B, 0xA2, 0xD3, 0xD4, 0x12,
|
||||
0xE2, 0x18, 0xF4, 0xDD, 0x1E, 0x08, 0x4C, 0xF6, 0xD8, 0x00, 0x3E, 0x7C,
|
||||
0x47, 0x74, 0xE8, 0x33,
|
||||
static unsigned char dh2048_p[] = {
|
||||
0xF6,0x42,0x57,0xB7,0x08,0x7F,0x08,0x17,0x72,0xA2,0xBA,0xD6,
|
||||
0xA9,0x42,0xF3,0x05,0xE8,0xF9,0x53,0x11,0x39,0x4F,0xB6,0xF1,
|
||||
0x6E,0xB9,0x4B,0x38,0x20,0xDA,0x01,0xA7,0x56,0xA3,0x14,0xE9,
|
||||
0x8F,0x40,0x55,0xF3,0xD0,0x07,0xC6,0xCB,0x43,0xA9,0x94,0xAD,
|
||||
0xF7,0x4C,0x64,0x86,0x49,0xF8,0x0C,0x83,0xBD,0x65,0xE9,0x17,
|
||||
0xD4,0xA1,0xD3,0x50,0xF8,0xF5,0x59,0x5F,0xDC,0x76,0x52,0x4F,
|
||||
0x3D,0x3D,0x8D,0xDB,0xCE,0x99,0xE1,0x57,0x92,0x59,0xCD,0xFD,
|
||||
0xB8,0xAE,0x74,0x4F,0xC5,0xFC,0x76,0xBC,0x83,0xC5,0x47,0x30,
|
||||
0x61,0xCE,0x7C,0xC9,0x66,0xFF,0x15,0xF9,0xBB,0xFD,0x91,0x5E,
|
||||
0xC7,0x01,0xAA,0xD3,0x5B,0x9E,0x8D,0xA0,0xA5,0x72,0x3A,0xD4,
|
||||
0x1A,0xF0,0xBF,0x46,0x00,0x58,0x2B,0xE5,0xF4,0x88,0xFD,0x58,
|
||||
0x4E,0x49,0xDB,0xCD,0x20,0xB4,0x9D,0xE4,0x91,0x07,0x36,0x6B,
|
||||
0x33,0x6C,0x38,0x0D,0x45,0x1D,0x0F,0x7C,0x88,0xB3,0x1C,0x7C,
|
||||
0x5B,0x2D,0x8E,0xF6,0xF3,0xC9,0x23,0xC0,0x43,0xF0,0xA5,0x5B,
|
||||
0x18,0x8D,0x8E,0xBB,0x55,0x8C,0xB8,0x5D,0x38,0xD3,0x34,0xFD,
|
||||
0x7C,0x17,0x57,0x43,0xA3,0x1D,0x18,0x6C,0xDE,0x33,0x21,0x2C,
|
||||
0xB5,0x2A,0xFF,0x3C,0xE1,0xB1,0x29,0x40,0x18,0x11,0x8D,0x7C,
|
||||
0x84,0xA7,0x0A,0x72,0xD6,0x86,0xC4,0x03,0x19,0xC8,0x07,0x29,
|
||||
0x7A,0xCA,0x95,0x0C,0xD9,0x96,0x9F,0xAB,0xD0,0x0A,0x50,0x9B,
|
||||
0x02,0x46,0xD3,0x08,0x3D,0x66,0xA4,0x5D,0x41,0x9F,0x9C,0x7C,
|
||||
0xBD,0x89,0x4B,0x22,0x19,0x26,0xBA,0xAB,0xA2,0x5E,0xC3,0x55,
|
||||
0xE9,0x32,0x0B,0x3B,
|
||||
};
|
||||
|
||||
static unsigned char dh512_g[] = {
|
||||
static unsigned char dh2048_g[] = {
|
||||
0x02,
|
||||
};
|
||||
|
||||
static DH *get_dh512(void)
|
||||
DH *get_dh2048()
|
||||
{
|
||||
DH *dh = NULL;
|
||||
DH *dh;
|
||||
|
||||
if ((dh = DH_new()) == NULL)
|
||||
return (NULL);
|
||||
dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
|
||||
dh->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
|
||||
if ((dh->p == NULL) || (dh->g == NULL))
|
||||
return (NULL);
|
||||
return (dh);
|
||||
return NULL;
|
||||
dh->p=BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
|
||||
dh->g=BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
|
||||
if (dh->p == NULL || dh->g == NULL) {
|
||||
DH_free(dh);
|
||||
return NULL;
|
||||
}
|
||||
return dh;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -347,7 +365,7 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
|
||||
}
|
||||
if (s_debug)
|
||||
BIO_printf(bio_s_out, "identity_len=%d identity=%s\n",
|
||||
identity ? (int)strlen(identity) : 0, identity);
|
||||
(int)strlen(identity), identity);
|
||||
|
||||
/* here we could lookup the given identity e.g. from a database */
|
||||
if (strcmp(identity, psk_identity) != 0) {
|
||||
@@ -553,6 +571,8 @@ static void sv_usage(void)
|
||||
BIO_printf(bio_err, " -state - Print the SSL states\n");
|
||||
BIO_printf(bio_err, " -CApath arg - PEM format directory of CA's\n");
|
||||
BIO_printf(bio_err, " -CAfile arg - PEM format file of CA's\n");
|
||||
BIO_printf(bio_err,
|
||||
" -no_alt_chains - only ever use the first certificate chain found\n");
|
||||
BIO_printf(bio_err,
|
||||
" -nocert - Don't use any certificates (Anon-DH)\n");
|
||||
BIO_printf(bio_err,
|
||||
@@ -696,6 +716,8 @@ static int ebcdic_new(BIO *bi)
|
||||
EBCDIC_OUTBUFF *wbuf;
|
||||
|
||||
wbuf = (EBCDIC_OUTBUFF *) OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + 1024);
|
||||
if (!wbuf)
|
||||
return 0;
|
||||
wbuf->alloced = 1024;
|
||||
wbuf->buff[0] = '\0';
|
||||
|
||||
@@ -750,9 +772,11 @@ static int ebcdic_write(BIO *b, const char *in, int inl)
|
||||
num = num + num; /* double the size */
|
||||
if (num < inl)
|
||||
num = inl;
|
||||
OPENSSL_free(wbuf);
|
||||
wbuf =
|
||||
(EBCDIC_OUTBUFF *) OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + num);
|
||||
if (!wbuf)
|
||||
return 0;
|
||||
OPENSSL_free(b->ptr);
|
||||
|
||||
wbuf->alloced = num;
|
||||
wbuf->buff[0] = '\0';
|
||||
@@ -1736,12 +1760,6 @@ int MAIN(int argc, char *argv[])
|
||||
SSL_CTX_set_options(ctx, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
|
||||
if (exc)
|
||||
ssl_ctx_set_excert(ctx, exc);
|
||||
/*
|
||||
* DTLS: partial reads end up discarding unread UDP bytes :-( Setting
|
||||
* read ahead solves this problem.
|
||||
*/
|
||||
if (socket_type == SOCK_DGRAM)
|
||||
SSL_CTX_set_read_ahead(ctx, 1);
|
||||
|
||||
if (state)
|
||||
SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
|
||||
@@ -1821,12 +1839,6 @@ int MAIN(int argc, char *argv[])
|
||||
SSL_CTX_set_options(ctx2, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
|
||||
if (exc)
|
||||
ssl_ctx_set_excert(ctx2, exc);
|
||||
/*
|
||||
* DTLS: partial reads end up discarding unread UDP bytes :-(
|
||||
* Setting read ahead solves this problem.
|
||||
*/
|
||||
if (socket_type == SOCK_DGRAM)
|
||||
SSL_CTX_set_read_ahead(ctx2, 1);
|
||||
|
||||
if (state)
|
||||
SSL_CTX_set_info_callback(ctx2, apps_ssl_info_callback);
|
||||
@@ -1873,7 +1885,11 @@ int MAIN(int argc, char *argv[])
|
||||
BIO_printf(bio_s_out, "Setting temp DH parameters\n");
|
||||
} else {
|
||||
BIO_printf(bio_s_out, "Using default temp DH parameters\n");
|
||||
dh = get_dh512();
|
||||
dh = get_dh2048();
|
||||
if (dh == NULL) {
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
(void)BIO_flush(bio_s_out);
|
||||
|
||||
@@ -2461,8 +2477,10 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context)
|
||||
ret = 1;
|
||||
goto err;
|
||||
}
|
||||
l += k;
|
||||
i -= k;
|
||||
if (k > 0) {
|
||||
l += k;
|
||||
i -= k;
|
||||
}
|
||||
if (i <= 0)
|
||||
break;
|
||||
}
|
||||
@@ -2877,7 +2895,7 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context)
|
||||
|
||||
/* else we have data */
|
||||
if (((www == 1) && (strncmp("GET ", buf, 4) == 0)) ||
|
||||
((www == 2) && (strncmp("GET /stats ", buf, 10) == 0))) {
|
||||
((www == 2) && (strncmp("GET /stats ", buf, 11) == 0))) {
|
||||
char *p;
|
||||
X509 *peer;
|
||||
STACK_OF(SSL_CIPHER) *sk;
|
||||
@@ -3289,7 +3307,8 @@ static int generate_session_id(const SSL *ssl, unsigned char *id,
|
||||
{
|
||||
unsigned int count = 0;
|
||||
do {
|
||||
RAND_pseudo_bytes(id, *id_len);
|
||||
if (RAND_pseudo_bytes(id, *id_len) < 0)
|
||||
return 0;
|
||||
/*
|
||||
* Prefix the session_id with the required prefix. NB: If our prefix
|
||||
* is too long, clip it - but there will be worse effects anyway, eg.
|
||||
@@ -3331,6 +3350,10 @@ static int add_session(SSL *ssl, SSL_SESSION *session)
|
||||
unsigned char *p;
|
||||
|
||||
sess = OPENSSL_malloc(sizeof(simple_ssl_session));
|
||||
if (!sess) {
|
||||
BIO_printf(bio_err, "Out of memory adding session to external cache\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SSL_SESSION_get_id(session, &sess->idlen);
|
||||
sess->derlen = i2d_SSL_SESSION(session, NULL);
|
||||
@@ -3338,6 +3361,16 @@ static int add_session(SSL *ssl, SSL_SESSION *session)
|
||||
sess->id = BUF_memdup(SSL_SESSION_get_id(session, NULL), sess->idlen);
|
||||
|
||||
sess->der = OPENSSL_malloc(sess->derlen);
|
||||
if (!sess->id || !sess->der) {
|
||||
BIO_printf(bio_err, "Out of memory adding session to external cache\n");
|
||||
|
||||
if (sess->id)
|
||||
OPENSSL_free(sess->id);
|
||||
if (sess->der)
|
||||
OPENSSL_free(sess->der);
|
||||
OPENSSL_free(sess);
|
||||
return 0;
|
||||
}
|
||||
p = sess->der;
|
||||
i2d_SSL_SESSION(session, &p);
|
||||
|
||||
|
@@ -302,6 +302,10 @@ static int parseArgs(int argc, char **argv)
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
maxTime = atoi(*(++argv));
|
||||
if (maxTime <= 0) {
|
||||
BIO_printf(bio_err, "time must be > 0\n");
|
||||
badop = 1;
|
||||
}
|
||||
} else {
|
||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
||||
badop = 1;
|
||||
@@ -550,7 +554,8 @@ int MAIN(int argc, char **argv)
|
||||
nConn, totalTime, ((double)nConn / totalTime), bytes_read);
|
||||
printf
|
||||
("%d connections in %ld real seconds, %ld bytes read per connection\n",
|
||||
nConn, (long)time(NULL) - finishtime + maxTime, bytes_read / nConn);
|
||||
nConn, (long)time(NULL) - finishtime + maxTime,
|
||||
bytes_read / (nConn?nConn:1));
|
||||
|
||||
ret = 0;
|
||||
end:
|
||||
|
@@ -441,6 +441,8 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,
|
||||
"-CApath dir trusted certificates directory\n");
|
||||
BIO_printf(bio_err, "-CAfile file trusted certificates file\n");
|
||||
BIO_printf(bio_err,
|
||||
"-no_alt_chains only ever use the first certificate chain found\n");
|
||||
BIO_printf(bio_err,
|
||||
"-crl_check check revocation status of signer's certificate using CRLs\n");
|
||||
BIO_printf(bio_err,
|
||||
|
17
apps/speed.c
17
apps/speed.c
@@ -2775,6 +2775,11 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher)
|
||||
|
||||
inp = OPENSSL_malloc(mblengths[num - 1]);
|
||||
out = OPENSSL_malloc(mblengths[num - 1] + 1024);
|
||||
if (!inp || !out) {
|
||||
BIO_printf(bio_err,"Out of memory\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
EVP_CIPHER_CTX_init(&ctx);
|
||||
EVP_EncryptInit_ex(&ctx, evp_cipher, NULL, no_key, no_iv);
|
||||
@@ -2786,7 +2791,7 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher)
|
||||
print_message(alg_name, 0, mblengths[j]);
|
||||
Time_F(START);
|
||||
for (count = 0, run = 1; run && count < 0x7fffffff; count++) {
|
||||
unsigned char aad[13];
|
||||
unsigned char aad[EVP_AEAD_TLS1_AAD_LEN];
|
||||
EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
|
||||
size_t len = mblengths[j];
|
||||
int packlen;
|
||||
@@ -2821,7 +2826,8 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher)
|
||||
aad[11] = len >> 8;
|
||||
aad[12] = len;
|
||||
pad = EVP_CIPHER_CTX_ctrl(&ctx,
|
||||
EVP_CTRL_AEAD_TLS1_AAD, 13, aad);
|
||||
EVP_CTRL_AEAD_TLS1_AAD,
|
||||
EVP_AEAD_TLS1_AAD_LEN, aad);
|
||||
EVP_Cipher(&ctx, out, inp, len + pad);
|
||||
}
|
||||
}
|
||||
@@ -2859,7 +2865,10 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher)
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
OPENSSL_free(inp);
|
||||
OPENSSL_free(out);
|
||||
end:
|
||||
if (inp)
|
||||
OPENSSL_free(inp);
|
||||
if (out)
|
||||
OPENSSL_free(out);
|
||||
}
|
||||
#endif
|
||||
|
@@ -435,10 +435,18 @@ int MAIN(int argc, char **argv)
|
||||
# ifdef OPENSSL_SYS_VMS
|
||||
len = strlen(s) + sizeof(CONFIG_FILE);
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
strcpy(tofree, s);
|
||||
# else
|
||||
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
BUF_strlcpy(tofree, s, len);
|
||||
BUF_strlcat(tofree, "/", len);
|
||||
# endif
|
||||
|
@@ -232,7 +232,7 @@ int MAIN(int argc, char **argv)
|
||||
if (ret == 1) {
|
||||
BIO_printf(bio_err,
|
||||
"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
|
||||
BIO_printf(bio_err, " [-attime timestamp]");
|
||||
BIO_printf(bio_err, " [-no_alt_chains] [-attime timestamp]");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err, " [-engine e]");
|
||||
#endif
|
||||
|
@@ -829,6 +829,11 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
z = i2d_X509(x, NULL);
|
||||
m = OPENSSL_malloc(z);
|
||||
if (!m) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
d = (unsigned char *)m;
|
||||
z = i2d_X509_NAME(X509_get_subject_name(x), &d);
|
||||
|
@@ -125,12 +125,17 @@ install:
|
||||
lint:
|
||||
@target=lint; $(RECURSIVE_MAKE)
|
||||
|
||||
depend:
|
||||
update: local_depend
|
||||
@[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
|
||||
depend: local_depend
|
||||
@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
local_depend:
|
||||
@[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
|
||||
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
@[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
|
||||
@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
|
||||
clean:
|
||||
rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
@@ -72,7 +72,7 @@ aesni-mb-x86_64.s: asm/aesni-mb-x86_64.pl
|
||||
|
||||
aes-sparcv9.s: asm/aes-sparcv9.pl
|
||||
$(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@
|
||||
aest4-sparcv9.s: asm/aest4-sparcv9.pl
|
||||
aest4-sparcv9.s: asm/aest4-sparcv9.pl ../perlasm/sparcv9_modes.pl
|
||||
$(PERL) asm/aest4-sparcv9.pl $(CFLAGS) > $@
|
||||
|
||||
aes-ppc.s: asm/aes-ppc.pl
|
||||
@@ -122,6 +122,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -1130,31 +1130,31 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
* map cipher state to byte array block:
|
||||
*/
|
||||
s0 =
|
||||
(Td4[(t0 >> 24) ] << 24) ^
|
||||
(Td4[(t3 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t2 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t1 ) & 0xff]) ^
|
||||
((u32)Td4[(t0 >> 24) ] << 24) ^
|
||||
((u32)Td4[(t3 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(t2 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(t1 ) & 0xff]) ^
|
||||
rk[0];
|
||||
PUTU32(out , s0);
|
||||
s1 =
|
||||
(Td4[(t1 >> 24) ] << 24) ^
|
||||
(Td4[(t0 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t3 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t2 ) & 0xff]) ^
|
||||
((u32)Td4[(t1 >> 24) ] << 24) ^
|
||||
((u32)Td4[(t0 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(t3 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(t2 ) & 0xff]) ^
|
||||
rk[1];
|
||||
PUTU32(out + 4, s1);
|
||||
s2 =
|
||||
(Td4[(t2 >> 24) ] << 24) ^
|
||||
(Td4[(t1 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t0 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t3 ) & 0xff]) ^
|
||||
((u32)Td4[(t2 >> 24) ] << 24) ^
|
||||
((u32)Td4[(t1 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(t0 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(t3 ) & 0xff]) ^
|
||||
rk[2];
|
||||
PUTU32(out + 8, s2);
|
||||
s3 =
|
||||
(Td4[(t3 >> 24) ] << 24) ^
|
||||
(Td4[(t2 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t1 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t0 ) & 0xff]) ^
|
||||
((u32)Td4[(t3 >> 24) ] << 24) ^
|
||||
((u32)Td4[(t2 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(t1 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(t0 ) & 0xff]) ^
|
||||
rk[3];
|
||||
PUTU32(out + 12, s3);
|
||||
}
|
||||
@@ -1233,10 +1233,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[3];
|
||||
rk[4] = rk[0] ^
|
||||
(Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ]) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
((u32)Te4[(temp ) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp >> 24) ]) ^
|
||||
rcon[i];
|
||||
rk[5] = rk[1] ^ rk[4];
|
||||
rk[6] = rk[2] ^ rk[5];
|
||||
@@ -1253,10 +1253,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[ 5];
|
||||
rk[ 6] = rk[ 0] ^
|
||||
(Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ]) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
((u32)Te4[(temp ) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp >> 24) ]) ^
|
||||
rcon[i];
|
||||
rk[ 7] = rk[ 1] ^ rk[ 6];
|
||||
rk[ 8] = rk[ 2] ^ rk[ 7];
|
||||
@@ -1275,10 +1275,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[ 7];
|
||||
rk[ 8] = rk[ 0] ^
|
||||
(Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ]) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
((u32)Te4[(temp ) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp >> 24) ]) ^
|
||||
rcon[i];
|
||||
rk[ 9] = rk[ 1] ^ rk[ 8];
|
||||
rk[10] = rk[ 2] ^ rk[ 9];
|
||||
@@ -1288,10 +1288,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
}
|
||||
temp = rk[11];
|
||||
rk[12] = rk[ 4] ^
|
||||
(Te4[(temp >> 24) ] << 24) ^
|
||||
(Te4[(temp >> 16) & 0xff] << 16) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 8) ^
|
||||
(Te4[(temp ) & 0xff]);
|
||||
((u32)Te4[(temp >> 24) ] << 24) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 16) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp ) & 0xff]);
|
||||
rk[13] = rk[ 5] ^ rk[12];
|
||||
rk[14] = rk[ 6] ^ rk[13];
|
||||
rk[15] = rk[ 7] ^ rk[14];
|
||||
|
@@ -499,10 +499,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[3];
|
||||
rk[4] = rk[0] ^
|
||||
(Te4[(temp >> 8) & 0xff] ) ^
|
||||
(Te4[(temp >> 16) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 24) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] ) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp >> 24) ] << 16) ^
|
||||
((u32)Te4[(temp ) & 0xff] << 24) ^
|
||||
rcon[i];
|
||||
rk[5] = rk[1] ^ rk[4];
|
||||
rk[6] = rk[2] ^ rk[5];
|
||||
@@ -519,10 +519,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[ 5];
|
||||
rk[ 6] = rk[ 0] ^
|
||||
(Te4[(temp >> 8) & 0xff] ) ^
|
||||
(Te4[(temp >> 16) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 24) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] ) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp >> 24) ] << 16) ^
|
||||
((u32)Te4[(temp ) & 0xff] << 24) ^
|
||||
rcon[i];
|
||||
rk[ 7] = rk[ 1] ^ rk[ 6];
|
||||
rk[ 8] = rk[ 2] ^ rk[ 7];
|
||||
@@ -541,10 +541,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[ 7];
|
||||
rk[ 8] = rk[ 0] ^
|
||||
(Te4[(temp >> 8) & 0xff] ) ^
|
||||
(Te4[(temp >> 16) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 24) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] ) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp >> 24) ] << 16) ^
|
||||
((u32)Te4[(temp ) & 0xff] << 24) ^
|
||||
rcon[i];
|
||||
rk[ 9] = rk[ 1] ^ rk[ 8];
|
||||
rk[10] = rk[ 2] ^ rk[ 9];
|
||||
@@ -554,10 +554,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
}
|
||||
temp = rk[11];
|
||||
rk[12] = rk[ 4] ^
|
||||
(Te4[(temp ) & 0xff] ) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 16) & 0xff] << 16) ^
|
||||
(Te4[(temp >> 24) ] << 24);
|
||||
((u32)Te4[(temp ) & 0xff] ) ^
|
||||
((u32)Te4[(temp >> 8) & 0xff] << 8) ^
|
||||
((u32)Te4[(temp >> 16) & 0xff] << 16) ^
|
||||
((u32)Te4[(temp >> 24) ] << 24);
|
||||
rk[13] = rk[ 5] ^ rk[12];
|
||||
rk[14] = rk[ 6] ^ rk[13];
|
||||
rk[15] = rk[ 7] ^ rk[14];
|
||||
@@ -676,22 +676,22 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
#if defined(AES_COMPACT_IN_OUTER_ROUNDS)
|
||||
prefetch256(Te4);
|
||||
|
||||
t[0] = Te4[(s0 ) & 0xff] ^
|
||||
Te4[(s1 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s2 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s3 >> 24) ] << 24;
|
||||
t[1] = Te4[(s1 ) & 0xff] ^
|
||||
Te4[(s2 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s3 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s0 >> 24) ] << 24;
|
||||
t[2] = Te4[(s2 ) & 0xff] ^
|
||||
Te4[(s3 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s0 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s1 >> 24) ] << 24;
|
||||
t[3] = Te4[(s3 ) & 0xff] ^
|
||||
Te4[(s0 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s1 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s2 >> 24) ] << 24;
|
||||
t[0] = (u32)Te4[(s0 ) & 0xff] ^
|
||||
(u32)Te4[(s1 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s2 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s3 >> 24) ] << 24;
|
||||
t[1] = (u32)Te4[(s1 ) & 0xff] ^
|
||||
(u32)Te4[(s2 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s3 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s0 >> 24) ] << 24;
|
||||
t[2] = (u32)Te4[(s2 ) & 0xff] ^
|
||||
(u32)Te4[(s3 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s0 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s1 >> 24) ] << 24;
|
||||
t[3] = (u32)Te4[(s3 ) & 0xff] ^
|
||||
(u32)Te4[(s0 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s1 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s2 >> 24) ] << 24;
|
||||
|
||||
/* now do the linear transform using words */
|
||||
{ int i;
|
||||
@@ -742,22 +742,22 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
*/
|
||||
for (rk+=8,r=key->rounds-2; r>0; rk+=4,r--) {
|
||||
#if defined(AES_COMPACT_IN_INNER_ROUNDS)
|
||||
t[0] = Te4[(s0 ) & 0xff] ^
|
||||
Te4[(s1 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s2 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s3 >> 24) ] << 24;
|
||||
t[1] = Te4[(s1 ) & 0xff] ^
|
||||
Te4[(s2 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s3 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s0 >> 24) ] << 24;
|
||||
t[2] = Te4[(s2 ) & 0xff] ^
|
||||
Te4[(s3 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s0 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s1 >> 24) ] << 24;
|
||||
t[3] = Te4[(s3 ) & 0xff] ^
|
||||
Te4[(s0 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s1 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s2 >> 24) ] << 24;
|
||||
t[0] = (u32)Te4[(s0 ) & 0xff] ^
|
||||
(u32)Te4[(s1 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s2 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s3 >> 24) ] << 24;
|
||||
t[1] = (u32)Te4[(s1 ) & 0xff] ^
|
||||
(u32)Te4[(s2 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s3 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s0 >> 24) ] << 24;
|
||||
t[2] = (u32)Te4[(s2 ) & 0xff] ^
|
||||
(u32)Te4[(s3 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s0 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s1 >> 24) ] << 24;
|
||||
t[3] = (u32)Te4[(s3 ) & 0xff] ^
|
||||
(u32)Te4[(s0 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s1 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s2 >> 24) ] << 24;
|
||||
|
||||
/* now do the linear transform using words */
|
||||
{
|
||||
@@ -812,28 +812,28 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
prefetch256(Te4);
|
||||
|
||||
*(u32*)(out+0) =
|
||||
Te4[(s0 ) & 0xff] ^
|
||||
Te4[(s1 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s2 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s3 >> 24) ] << 24 ^
|
||||
(u32)Te4[(s0 ) & 0xff] ^
|
||||
(u32)Te4[(s1 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s2 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s3 >> 24) ] << 24 ^
|
||||
rk[0];
|
||||
*(u32*)(out+4) =
|
||||
Te4[(s1 ) & 0xff] ^
|
||||
Te4[(s2 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s3 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s0 >> 24) ] << 24 ^
|
||||
(u32)Te4[(s1 ) & 0xff] ^
|
||||
(u32)Te4[(s2 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s3 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s0 >> 24) ] << 24 ^
|
||||
rk[1];
|
||||
*(u32*)(out+8) =
|
||||
Te4[(s2 ) & 0xff] ^
|
||||
Te4[(s3 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s0 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s1 >> 24) ] << 24 ^
|
||||
(u32)Te4[(s2 ) & 0xff] ^
|
||||
(u32)Te4[(s3 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s0 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s1 >> 24) ] << 24 ^
|
||||
rk[2];
|
||||
*(u32*)(out+12) =
|
||||
Te4[(s3 ) & 0xff] ^
|
||||
Te4[(s0 >> 8) & 0xff] << 8 ^
|
||||
Te4[(s1 >> 16) & 0xff] << 16 ^
|
||||
Te4[(s2 >> 24) ] << 24 ^
|
||||
(u32)Te4[(s3 ) & 0xff] ^
|
||||
(u32)Te4[(s0 >> 8) & 0xff] << 8 ^
|
||||
(u32)Te4[(s1 >> 16) & 0xff] << 16 ^
|
||||
(u32)Te4[(s2 >> 24) ] << 24 ^
|
||||
rk[3];
|
||||
#else
|
||||
*(u32*)(out+0) =
|
||||
@@ -890,22 +890,22 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
#if defined(AES_COMPACT_IN_OUTER_ROUNDS)
|
||||
prefetch256(Td4);
|
||||
|
||||
t[0] = Td4[(s0 ) & 0xff] ^
|
||||
Td4[(s3 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s2 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s1 >> 24) ] << 24;
|
||||
t[1] = Td4[(s1 ) & 0xff] ^
|
||||
Td4[(s0 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s3 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s2 >> 24) ] << 24;
|
||||
t[2] = Td4[(s2 ) & 0xff] ^
|
||||
Td4[(s1 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s0 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s3 >> 24) ] << 24;
|
||||
t[3] = Td4[(s3 ) & 0xff] ^
|
||||
Td4[(s2 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s1 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s0 >> 24) ] << 24;
|
||||
t[0] = (u32)Td4[(s0 ) & 0xff] ^
|
||||
(u32)Td4[(s3 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s2 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s1 >> 24) ] << 24;
|
||||
t[1] = (u32)Td4[(s1 ) & 0xff] ^
|
||||
(u32)Td4[(s0 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s3 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s2 >> 24) ] << 24;
|
||||
t[2] = (u32)Td4[(s2 ) & 0xff] ^
|
||||
(u32)Td4[(s1 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s0 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s3 >> 24) ] << 24;
|
||||
t[3] = (u32)Td4[(s3 ) & 0xff] ^
|
||||
(u32)Td4[(s2 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s1 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s0 >> 24) ] << 24;
|
||||
|
||||
/* now do the linear transform using words */
|
||||
{
|
||||
@@ -967,22 +967,22 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
*/
|
||||
for (rk+=8,r=key->rounds-2; r>0; rk+=4,r--) {
|
||||
#if defined(AES_COMPACT_IN_INNER_ROUNDS)
|
||||
t[0] = Td4[(s0 ) & 0xff] ^
|
||||
Td4[(s3 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s2 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s1 >> 24) ] << 24;
|
||||
t[1] = Td4[(s1 ) & 0xff] ^
|
||||
Td4[(s0 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s3 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s2 >> 24) ] << 24;
|
||||
t[2] = Td4[(s2 ) & 0xff] ^
|
||||
Td4[(s1 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s0 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s3 >> 24) ] << 24;
|
||||
t[3] = Td4[(s3 ) & 0xff] ^
|
||||
Td4[(s2 >> 8) & 0xff] << 8 ^
|
||||
Td4[(s1 >> 16) & 0xff] << 16 ^
|
||||
Td4[(s0 >> 24) ] << 24;
|
||||
t[0] = (u32)Td4[(s0 ) & 0xff] ^
|
||||
(u32)Td4[(s3 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s2 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s1 >> 24) ] << 24;
|
||||
t[1] = (u32)Td4[(s1 ) & 0xff] ^
|
||||
(u32)Td4[(s0 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s3 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s2 >> 24) ] << 24;
|
||||
t[2] = (u32)Td4[(s2 ) & 0xff] ^
|
||||
(u32)Td4[(s1 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s0 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s3 >> 24) ] << 24;
|
||||
t[3] = (u32)Td4[(s3 ) & 0xff] ^
|
||||
(u32)Td4[(s2 >> 8) & 0xff] << 8 ^
|
||||
(u32)Td4[(s1 >> 16) & 0xff] << 16 ^
|
||||
(u32)Td4[(s0 >> 24) ] << 24;
|
||||
|
||||
/* now do the linear transform using words */
|
||||
{
|
||||
@@ -1046,27 +1046,27 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
prefetch256(Td4);
|
||||
|
||||
*(u32*)(out+0) =
|
||||
(Td4[(s0 ) & 0xff]) ^
|
||||
(Td4[(s3 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(s2 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(s1 >> 24) ] << 24) ^
|
||||
((u32)Td4[(s0 ) & 0xff]) ^
|
||||
((u32)Td4[(s3 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(s2 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(s1 >> 24) ] << 24) ^
|
||||
rk[0];
|
||||
*(u32*)(out+4) =
|
||||
(Td4[(s1 ) & 0xff]) ^
|
||||
(Td4[(s0 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(s3 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(s2 >> 24) ] << 24) ^
|
||||
((u32)Td4[(s1 ) & 0xff]) ^
|
||||
((u32)Td4[(s0 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(s3 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(s2 >> 24) ] << 24) ^
|
||||
rk[1];
|
||||
*(u32*)(out+8) =
|
||||
(Td4[(s2 ) & 0xff]) ^
|
||||
(Td4[(s1 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(s0 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(s3 >> 24) ] << 24) ^
|
||||
((u32)Td4[(s2 ) & 0xff]) ^
|
||||
((u32)Td4[(s1 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(s0 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(s3 >> 24) ] << 24) ^
|
||||
rk[2];
|
||||
*(u32*)(out+12) =
|
||||
(Td4[(s3 ) & 0xff]) ^
|
||||
(Td4[(s2 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(s1 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(s0 >> 24) ] << 24) ^
|
||||
((u32)Td4[(s3 ) & 0xff]) ^
|
||||
((u32)Td4[(s2 >> 8) & 0xff] << 8) ^
|
||||
((u32)Td4[(s1 >> 16) & 0xff] << 16) ^
|
||||
((u32)Td4[(s0 >> 24) ] << 24) ^
|
||||
rk[3];
|
||||
}
|
||||
|
@@ -1499,13 +1499,13 @@ ___
|
||||
|
||||
# EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,
|
||||
# CONTEXT *context,DISPATCHER_CONTEXT *disp)
|
||||
if ($win64) {
|
||||
if ($win64 && $avx) {
|
||||
$rec="%rcx";
|
||||
$frame="%rdx";
|
||||
$context="%r8";
|
||||
$disp="%r9";
|
||||
|
||||
$code.=<<___ if ($avx);
|
||||
$code.=<<___;
|
||||
.extern __imp_RtlVirtualUnwind
|
||||
.type se_handler,\@abi-omnipotent
|
||||
.align 16
|
||||
@@ -1643,7 +1643,7 @@ $code.=<<___ if ($shaext);
|
||||
.rva .LSEH_end_${func}_shaext
|
||||
.rva .LSEH_info_${func}_shaext
|
||||
___
|
||||
$code.=<<___ if ($avx);
|
||||
$code.=<<___;
|
||||
.section .xdata
|
||||
.align 8
|
||||
.LSEH_info_${func}_xop:
|
||||
|
@@ -51,7 +51,7 @@
|
||||
# Westmere 3.77/1.37 1.37 1.52 1.27
|
||||
# * Bridge 5.07/0.98 0.99 1.09 0.91
|
||||
# Haswell 4.44/0.80 0.97 1.03 0.72
|
||||
# Atom 5.77/3.56 3.67 4.03 3.46
|
||||
# Silvermont 5.77/3.56 3.67 4.03 3.46
|
||||
# Bulldozer 5.80/0.98 1.05 1.24 0.93
|
||||
|
||||
$PREFIX="aesni"; # if $PREFIX is set to "AES", the script
|
||||
@@ -65,6 +65,9 @@ require "x86asm.pl";
|
||||
|
||||
&asm_init($ARGV[0],$0);
|
||||
|
||||
&external_label("OPENSSL_ia32cap_P");
|
||||
&static_label("key_const");
|
||||
|
||||
if ($PREFIX eq "aesni") { $movekey=\&movups; }
|
||||
else { $movekey=\&movups; }
|
||||
|
||||
@@ -181,7 +184,10 @@ sub aesni_generate1 # fully unrolled loop
|
||||
{ &aesni_inline_generate1("enc"); }
|
||||
else
|
||||
{ &call ("_aesni_encrypt1"); }
|
||||
&pxor ($rndkey0,$rndkey0); # clear register bank
|
||||
&pxor ($rndkey1,$rndkey1);
|
||||
&movups (&QWP(0,"eax"),$inout0);
|
||||
&pxor ($inout0,$inout0);
|
||||
&ret ();
|
||||
&function_end_B("${PREFIX}_encrypt");
|
||||
|
||||
@@ -197,7 +203,10 @@ sub aesni_generate1 # fully unrolled loop
|
||||
{ &aesni_inline_generate1("dec"); }
|
||||
else
|
||||
{ &call ("_aesni_decrypt1"); }
|
||||
&pxor ($rndkey0,$rndkey0); # clear register bank
|
||||
&pxor ($rndkey1,$rndkey1);
|
||||
&movups (&QWP(0,"eax"),$inout0);
|
||||
&pxor ($inout0,$inout0);
|
||||
&ret ();
|
||||
&function_end_B("${PREFIX}_decrypt");
|
||||
|
||||
@@ -349,17 +358,15 @@ sub aesni_generate6
|
||||
&neg ($rounds);
|
||||
eval"&aes${p} ($inout2,$rndkey1)";
|
||||
&pxor ($inout5,$rndkey0);
|
||||
&$movekey ($rndkey0,&QWP(0,$key,$rounds));
|
||||
&add ($rounds,16);
|
||||
eval"&aes${p} ($inout3,$rndkey1)";
|
||||
eval"&aes${p} ($inout4,$rndkey1)";
|
||||
eval"&aes${p} ($inout5,$rndkey1)";
|
||||
&$movekey ($rndkey0,&QWP(-16,$key,$rounds));
|
||||
&jmp (&label("_aesni_${p}rypt6_enter"));
|
||||
&jmp (&label("_aesni_${p}rypt6_inner"));
|
||||
|
||||
&set_label("${p}6_loop",16);
|
||||
eval"&aes${p} ($inout0,$rndkey1)";
|
||||
eval"&aes${p} ($inout1,$rndkey1)";
|
||||
eval"&aes${p} ($inout2,$rndkey1)";
|
||||
&set_label("_aesni_${p}rypt6_inner");
|
||||
eval"&aes${p} ($inout3,$rndkey1)";
|
||||
eval"&aes${p} ($inout4,$rndkey1)";
|
||||
eval"&aes${p} ($inout5,$rndkey1)";
|
||||
@@ -615,6 +622,14 @@ if ($PREFIX eq "aesni") {
|
||||
&movups (&QWP(0x30,$out),$inout3);
|
||||
|
||||
&set_label("ecb_ret");
|
||||
&pxor ("xmm0","xmm0"); # clear register bank
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&pxor ("xmm3","xmm3");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&pxor ("xmm5","xmm5");
|
||||
&pxor ("xmm6","xmm6");
|
||||
&pxor ("xmm7","xmm7");
|
||||
&function_end("aesni_ecb_encrypt");
|
||||
|
||||
######################################################################
|
||||
@@ -704,6 +719,15 @@ if ($PREFIX eq "aesni") {
|
||||
&mov ("esp",&DWP(48,"esp"));
|
||||
&mov ($out,&wparam(5));
|
||||
&movups (&QWP(0,$out),$cmac);
|
||||
|
||||
&pxor ("xmm0","xmm0"); # clear register bank
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&pxor ("xmm3","xmm3");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&pxor ("xmm5","xmm5");
|
||||
&pxor ("xmm6","xmm6");
|
||||
&pxor ("xmm7","xmm7");
|
||||
&function_end("aesni_ccm64_encrypt_blocks");
|
||||
|
||||
&function_begin("aesni_ccm64_decrypt_blocks");
|
||||
@@ -804,6 +828,15 @@ if ($PREFIX eq "aesni") {
|
||||
&mov ("esp",&DWP(48,"esp"));
|
||||
&mov ($out,&wparam(5));
|
||||
&movups (&QWP(0,$out),$cmac);
|
||||
|
||||
&pxor ("xmm0","xmm0"); # clear register bank
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&pxor ("xmm3","xmm3");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&pxor ("xmm5","xmm5");
|
||||
&pxor ("xmm6","xmm6");
|
||||
&pxor ("xmm7","xmm7");
|
||||
&function_end("aesni_ccm64_decrypt_blocks");
|
||||
}
|
||||
|
||||
@@ -1053,6 +1086,17 @@ if ($PREFIX eq "aesni") {
|
||||
&movups (&QWP(0x30,$out),$inout3);
|
||||
|
||||
&set_label("ctr32_ret");
|
||||
&pxor ("xmm0","xmm0"); # clear register bank
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&pxor ("xmm3","xmm3");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&movdqa (&QWP(32,"esp"),"xmm0"); # clear stack
|
||||
&pxor ("xmm5","xmm5");
|
||||
&movdqa (&QWP(48,"esp"),"xmm0");
|
||||
&pxor ("xmm6","xmm6");
|
||||
&movdqa (&QWP(64,"esp"),"xmm0");
|
||||
&pxor ("xmm7","xmm7");
|
||||
&mov ("esp",&DWP(80,"esp"));
|
||||
&function_end("aesni_ctr32_encrypt_blocks");
|
||||
|
||||
@@ -1394,6 +1438,20 @@ if ($PREFIX eq "aesni") {
|
||||
&movups (&QWP(-16,$out),$inout0); # write output
|
||||
|
||||
&set_label("xts_enc_ret");
|
||||
&pxor ("xmm0","xmm0"); # clear register bank
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&movdqa (&QWP(16*0,"esp"),"xmm0"); # clear stack
|
||||
&pxor ("xmm3","xmm3");
|
||||
&movdqa (&QWP(16*1,"esp"),"xmm0");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&movdqa (&QWP(16*2,"esp"),"xmm0");
|
||||
&pxor ("xmm5","xmm5");
|
||||
&movdqa (&QWP(16*3,"esp"),"xmm0");
|
||||
&pxor ("xmm6","xmm6");
|
||||
&movdqa (&QWP(16*4,"esp"),"xmm0");
|
||||
&pxor ("xmm7","xmm7");
|
||||
&movdqa (&QWP(16*5,"esp"),"xmm0");
|
||||
&mov ("esp",&DWP(16*7+4,"esp")); # restore %esp
|
||||
&function_end("aesni_xts_encrypt");
|
||||
|
||||
@@ -1756,6 +1814,20 @@ if ($PREFIX eq "aesni") {
|
||||
&movups (&QWP(0,$out),$inout0); # write output
|
||||
|
||||
&set_label("xts_dec_ret");
|
||||
&pxor ("xmm0","xmm0"); # clear register bank
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&movdqa (&QWP(16*0,"esp"),"xmm0"); # clear stack
|
||||
&pxor ("xmm3","xmm3");
|
||||
&movdqa (&QWP(16*1,"esp"),"xmm0");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&movdqa (&QWP(16*2,"esp"),"xmm0");
|
||||
&pxor ("xmm5","xmm5");
|
||||
&movdqa (&QWP(16*3,"esp"),"xmm0");
|
||||
&pxor ("xmm6","xmm6");
|
||||
&movdqa (&QWP(16*4,"esp"),"xmm0");
|
||||
&pxor ("xmm7","xmm7");
|
||||
&movdqa (&QWP(16*5,"esp"),"xmm0");
|
||||
&mov ("esp",&DWP(16*7+4,"esp")); # restore %esp
|
||||
&function_end("aesni_xts_decrypt");
|
||||
}
|
||||
@@ -1808,6 +1880,7 @@ if ($PREFIX eq "aesni") {
|
||||
&add ($len,16);
|
||||
&jnz (&label("cbc_enc_tail"));
|
||||
&movaps ($ivec,$inout0);
|
||||
&pxor ($inout0,$inout0);
|
||||
&jmp (&label("cbc_ret"));
|
||||
|
||||
&set_label("cbc_enc_tail");
|
||||
@@ -1871,7 +1944,7 @@ if ($PREFIX eq "aesni") {
|
||||
&movaps ($inout0,$inout5);
|
||||
&movaps ($ivec,$rndkey0);
|
||||
&add ($len,0x50);
|
||||
&jle (&label("cbc_dec_tail_collected"));
|
||||
&jle (&label("cbc_dec_clear_tail_collected"));
|
||||
&movups (&QWP(0,$out),$inout0);
|
||||
&lea ($out,&DWP(0x10,$out));
|
||||
&set_label("cbc_dec_tail");
|
||||
@@ -1910,10 +1983,14 @@ if ($PREFIX eq "aesni") {
|
||||
&xorps ($inout4,$rndkey0);
|
||||
&movups (&QWP(0,$out),$inout0);
|
||||
&movups (&QWP(0x10,$out),$inout1);
|
||||
&pxor ($inout1,$inout1);
|
||||
&movups (&QWP(0x20,$out),$inout2);
|
||||
&pxor ($inout2,$inout2);
|
||||
&movups (&QWP(0x30,$out),$inout3);
|
||||
&pxor ($inout3,$inout3);
|
||||
&lea ($out,&DWP(0x40,$out));
|
||||
&movaps ($inout0,$inout4);
|
||||
&pxor ($inout4,$inout4);
|
||||
&sub ($len,0x50);
|
||||
&jmp (&label("cbc_dec_tail_collected"));
|
||||
|
||||
@@ -1933,6 +2010,7 @@ if ($PREFIX eq "aesni") {
|
||||
&xorps ($inout1,$in0);
|
||||
&movups (&QWP(0,$out),$inout0);
|
||||
&movaps ($inout0,$inout1);
|
||||
&pxor ($inout1,$inout1);
|
||||
&lea ($out,&DWP(0x10,$out));
|
||||
&movaps ($ivec,$in1);
|
||||
&sub ($len,0x20);
|
||||
@@ -1945,7 +2023,9 @@ if ($PREFIX eq "aesni") {
|
||||
&xorps ($inout2,$in1);
|
||||
&movups (&QWP(0,$out),$inout0);
|
||||
&movaps ($inout0,$inout2);
|
||||
&pxor ($inout2,$inout2);
|
||||
&movups (&QWP(0x10,$out),$inout1);
|
||||
&pxor ($inout1,$inout1);
|
||||
&lea ($out,&DWP(0x20,$out));
|
||||
&movups ($ivec,&QWP(0x20,$inp));
|
||||
&sub ($len,0x30);
|
||||
@@ -1961,29 +2041,44 @@ if ($PREFIX eq "aesni") {
|
||||
&movups (&QWP(0,$out),$inout0);
|
||||
&xorps ($inout2,$rndkey1);
|
||||
&movups (&QWP(0x10,$out),$inout1);
|
||||
&pxor ($inout1,$inout1);
|
||||
&xorps ($inout3,$rndkey0);
|
||||
&movups (&QWP(0x20,$out),$inout2);
|
||||
&pxor ($inout2,$inout2);
|
||||
&lea ($out,&DWP(0x30,$out));
|
||||
&movaps ($inout0,$inout3);
|
||||
&pxor ($inout3,$inout3);
|
||||
&sub ($len,0x40);
|
||||
&jmp (&label("cbc_dec_tail_collected"));
|
||||
|
||||
&set_label("cbc_dec_clear_tail_collected",16);
|
||||
&pxor ($inout1,$inout1);
|
||||
&pxor ($inout2,$inout2);
|
||||
&pxor ($inout3,$inout3);
|
||||
&pxor ($inout4,$inout4);
|
||||
&set_label("cbc_dec_tail_collected");
|
||||
&and ($len,15);
|
||||
&jnz (&label("cbc_dec_tail_partial"));
|
||||
&movups (&QWP(0,$out),$inout0);
|
||||
&pxor ($rndkey0,$rndkey0);
|
||||
&jmp (&label("cbc_ret"));
|
||||
|
||||
&set_label("cbc_dec_tail_partial",16);
|
||||
&movaps (&QWP(0,"esp"),$inout0);
|
||||
&pxor ($rndkey0,$rndkey0);
|
||||
&mov ("ecx",16);
|
||||
&mov ($inp,"esp");
|
||||
&sub ("ecx",$len);
|
||||
&data_word(0xA4F3F689); # rep movsb
|
||||
&movdqa (&QWP(0,"esp"),$inout0);
|
||||
|
||||
&set_label("cbc_ret");
|
||||
&mov ("esp",&DWP(16,"esp")); # pull original %esp
|
||||
&mov ($key_,&wparam(4));
|
||||
&pxor ($inout0,$inout0);
|
||||
&pxor ($rndkey1,$rndkey1);
|
||||
&movups (&QWP(0,$key_),$ivec); # output IV
|
||||
&pxor ($ivec,$ivec);
|
||||
&set_label("cbc_abort");
|
||||
&function_end("${PREFIX}_cbc_encrypt");
|
||||
|
||||
@@ -2000,14 +2095,24 @@ if ($PREFIX eq "aesni") {
|
||||
# $round rounds
|
||||
|
||||
&function_begin_B("_aesni_set_encrypt_key");
|
||||
&push ("ebp");
|
||||
&push ("ebx");
|
||||
&test ("eax","eax");
|
||||
&jz (&label("bad_pointer"));
|
||||
&test ($key,$key);
|
||||
&jz (&label("bad_pointer"));
|
||||
|
||||
&call (&label("pic"));
|
||||
&set_label("pic");
|
||||
&blindpop("ebx");
|
||||
&lea ("ebx",&DWP(&label("key_const")."-".&label("pic"),"ebx"));
|
||||
|
||||
&picmeup("ebp","OPENSSL_ia32cap_P","ebx",&label("key_const"));
|
||||
&movups ("xmm0",&QWP(0,"eax")); # pull first 128 bits of *userKey
|
||||
&xorps ("xmm4","xmm4"); # low dword of xmm4 is assumed 0
|
||||
&mov ("ebp",&DWP(4,"ebp"));
|
||||
&lea ($key,&DWP(16,$key));
|
||||
&and ("ebp",1<<28|1<<11); # AVX and XOP bits
|
||||
&cmp ($rounds,256);
|
||||
&je (&label("14rounds"));
|
||||
&cmp ($rounds,192);
|
||||
@@ -2016,6 +2121,9 @@ if ($PREFIX eq "aesni") {
|
||||
&jne (&label("bad_keybits"));
|
||||
|
||||
&set_label("10rounds",16);
|
||||
&cmp ("ebp",1<<28);
|
||||
&je (&label("10rounds_alt"));
|
||||
|
||||
&mov ($rounds,9);
|
||||
&$movekey (&QWP(-16,$key),"xmm0"); # round 0
|
||||
&aeskeygenassist("xmm1","xmm0",0x01); # round 1
|
||||
@@ -2040,8 +2148,8 @@ if ($PREFIX eq "aesni") {
|
||||
&call (&label("key_128"));
|
||||
&$movekey (&QWP(0,$key),"xmm0");
|
||||
&mov (&DWP(80,$key),$rounds);
|
||||
&xor ("eax","eax");
|
||||
&ret();
|
||||
|
||||
&jmp (&label("good_key"));
|
||||
|
||||
&set_label("key_128",16);
|
||||
&$movekey (&QWP(0,$key),"xmm0");
|
||||
@@ -2055,8 +2163,76 @@ if ($PREFIX eq "aesni") {
|
||||
&xorps ("xmm0","xmm1");
|
||||
&ret();
|
||||
|
||||
&set_label("10rounds_alt",16);
|
||||
&movdqa ("xmm5",&QWP(0x00,"ebx"));
|
||||
&mov ($rounds,8);
|
||||
&movdqa ("xmm4",&QWP(0x20,"ebx"));
|
||||
&movdqa ("xmm2","xmm0");
|
||||
&movdqu (&QWP(-16,$key),"xmm0");
|
||||
|
||||
&set_label("loop_key128");
|
||||
&pshufb ("xmm0","xmm5");
|
||||
&aesenclast ("xmm0","xmm4");
|
||||
&pslld ("xmm4",1);
|
||||
&lea ($key,&DWP(16,$key));
|
||||
|
||||
&movdqa ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm2","xmm3");
|
||||
|
||||
&pxor ("xmm0","xmm2");
|
||||
&movdqu (&QWP(-16,$key),"xmm0");
|
||||
&movdqa ("xmm2","xmm0");
|
||||
|
||||
&dec ($rounds);
|
||||
&jnz (&label("loop_key128"));
|
||||
|
||||
&movdqa ("xmm4",&QWP(0x30,"ebx"));
|
||||
|
||||
&pshufb ("xmm0","xmm5");
|
||||
&aesenclast ("xmm0","xmm4");
|
||||
&pslld ("xmm4",1);
|
||||
|
||||
&movdqa ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm2","xmm3");
|
||||
|
||||
&pxor ("xmm0","xmm2");
|
||||
&movdqu (&QWP(0,$key),"xmm0");
|
||||
|
||||
&movdqa ("xmm2","xmm0");
|
||||
&pshufb ("xmm0","xmm5");
|
||||
&aesenclast ("xmm0","xmm4");
|
||||
|
||||
&movdqa ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pslldq ("xmm2",4);
|
||||
&pxor ("xmm2","xmm3");
|
||||
|
||||
&pxor ("xmm0","xmm2");
|
||||
&movdqu (&QWP(16,$key),"xmm0");
|
||||
|
||||
&mov ($rounds,9);
|
||||
&mov (&DWP(96,$key),$rounds);
|
||||
|
||||
&jmp (&label("good_key"));
|
||||
|
||||
&set_label("12rounds",16);
|
||||
&movq ("xmm2",&QWP(16,"eax")); # remaining 1/3 of *userKey
|
||||
&cmp ("ebp",1<<28);
|
||||
&je (&label("12rounds_alt"));
|
||||
|
||||
&mov ($rounds,11);
|
||||
&$movekey (&QWP(-16,$key),"xmm0"); # round 0
|
||||
&aeskeygenassist("xmm1","xmm2",0x01); # round 1,2
|
||||
@@ -2077,8 +2253,8 @@ if ($PREFIX eq "aesni") {
|
||||
&call (&label("key_192b"));
|
||||
&$movekey (&QWP(0,$key),"xmm0");
|
||||
&mov (&DWP(48,$key),$rounds);
|
||||
&xor ("eax","eax");
|
||||
&ret();
|
||||
|
||||
&jmp (&label("good_key"));
|
||||
|
||||
&set_label("key_192a",16);
|
||||
&$movekey (&QWP(0,$key),"xmm0");
|
||||
@@ -2108,10 +2284,52 @@ if ($PREFIX eq "aesni") {
|
||||
&lea ($key,&DWP(32,$key));
|
||||
&jmp (&label("key_192b_warm"));
|
||||
|
||||
&set_label("12rounds_alt",16);
|
||||
&movdqa ("xmm5",&QWP(0x10,"ebx"));
|
||||
&movdqa ("xmm4",&QWP(0x20,"ebx"));
|
||||
&mov ($rounds,8);
|
||||
&movdqu (&QWP(-16,$key),"xmm0");
|
||||
|
||||
&set_label("loop_key192");
|
||||
&movq (&QWP(0,$key),"xmm2");
|
||||
&movdqa ("xmm1","xmm2");
|
||||
&pshufb ("xmm2","xmm5");
|
||||
&aesenclast ("xmm2","xmm4");
|
||||
&pslld ("xmm4",1);
|
||||
&lea ($key,&DWP(24,$key));
|
||||
|
||||
&movdqa ("xmm3","xmm0");
|
||||
&pslldq ("xmm0",4);
|
||||
&pxor ("xmm3","xmm0");
|
||||
&pslldq ("xmm0",4);
|
||||
&pxor ("xmm3","xmm0");
|
||||
&pslldq ("xmm0",4);
|
||||
&pxor ("xmm0","xmm3");
|
||||
|
||||
&pshufd ("xmm3","xmm0",0xff);
|
||||
&pxor ("xmm3","xmm1");
|
||||
&pslldq ("xmm1",4);
|
||||
&pxor ("xmm3","xmm1");
|
||||
|
||||
&pxor ("xmm0","xmm2");
|
||||
&pxor ("xmm2","xmm3");
|
||||
&movdqu (&QWP(-16,$key),"xmm0");
|
||||
|
||||
&dec ($rounds);
|
||||
&jnz (&label("loop_key192"));
|
||||
|
||||
&mov ($rounds,11);
|
||||
&mov (&DWP(32,$key),$rounds);
|
||||
|
||||
&jmp (&label("good_key"));
|
||||
|
||||
&set_label("14rounds",16);
|
||||
&movups ("xmm2",&QWP(16,"eax")); # remaining half of *userKey
|
||||
&mov ($rounds,13);
|
||||
&lea ($key,&DWP(16,$key));
|
||||
&cmp ("ebp",1<<28);
|
||||
&je (&label("14rounds_alt"));
|
||||
|
||||
&mov ($rounds,13);
|
||||
&$movekey (&QWP(-32,$key),"xmm0"); # round 0
|
||||
&$movekey (&QWP(-16,$key),"xmm2"); # round 1
|
||||
&aeskeygenassist("xmm1","xmm2",0x01); # round 2
|
||||
@@ -2143,7 +2361,8 @@ if ($PREFIX eq "aesni") {
|
||||
&$movekey (&QWP(0,$key),"xmm0");
|
||||
&mov (&DWP(16,$key),$rounds);
|
||||
&xor ("eax","eax");
|
||||
&ret();
|
||||
|
||||
&jmp (&label("good_key"));
|
||||
|
||||
&set_label("key_256a",16);
|
||||
&$movekey (&QWP(0,$key),"xmm2");
|
||||
@@ -2169,11 +2388,77 @@ if ($PREFIX eq "aesni") {
|
||||
&xorps ("xmm2","xmm1");
|
||||
&ret();
|
||||
|
||||
&set_label("14rounds_alt",16);
|
||||
&movdqa ("xmm5",&QWP(0x00,"ebx"));
|
||||
&movdqa ("xmm4",&QWP(0x20,"ebx"));
|
||||
&mov ($rounds,7);
|
||||
&movdqu (&QWP(-32,$key),"xmm0");
|
||||
&movdqa ("xmm1","xmm2");
|
||||
&movdqu (&QWP(-16,$key),"xmm2");
|
||||
|
||||
&set_label("loop_key256");
|
||||
&pshufb ("xmm2","xmm5");
|
||||
&aesenclast ("xmm2","xmm4");
|
||||
|
||||
&movdqa ("xmm3","xmm0");
|
||||
&pslldq ("xmm0",4);
|
||||
&pxor ("xmm3","xmm0");
|
||||
&pslldq ("xmm0",4);
|
||||
&pxor ("xmm3","xmm0");
|
||||
&pslldq ("xmm0",4);
|
||||
&pxor ("xmm0","xmm3");
|
||||
&pslld ("xmm4",1);
|
||||
|
||||
&pxor ("xmm0","xmm2");
|
||||
&movdqu (&QWP(0,$key),"xmm0");
|
||||
|
||||
&dec ($rounds);
|
||||
&jz (&label("done_key256"));
|
||||
|
||||
&pshufd ("xmm2","xmm0",0xff);
|
||||
&pxor ("xmm3","xmm3");
|
||||
&aesenclast ("xmm2","xmm3");
|
||||
|
||||
&movdqa ("xmm3","xmm1")
|
||||
&pslldq ("xmm1",4);
|
||||
&pxor ("xmm3","xmm1");
|
||||
&pslldq ("xmm1",4);
|
||||
&pxor ("xmm3","xmm1");
|
||||
&pslldq ("xmm1",4);
|
||||
&pxor ("xmm1","xmm3");
|
||||
|
||||
&pxor ("xmm2","xmm1");
|
||||
&movdqu (&QWP(16,$key),"xmm2");
|
||||
&lea ($key,&DWP(32,$key));
|
||||
&movdqa ("xmm1","xmm2");
|
||||
&jmp (&label("loop_key256"));
|
||||
|
||||
&set_label("done_key256");
|
||||
&mov ($rounds,13);
|
||||
&mov (&DWP(16,$key),$rounds);
|
||||
|
||||
&set_label("good_key");
|
||||
&pxor ("xmm0","xmm0");
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&pxor ("xmm3","xmm3");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&pxor ("xmm5","xmm5");
|
||||
&xor ("eax","eax");
|
||||
&pop ("ebx");
|
||||
&pop ("ebp");
|
||||
&ret ();
|
||||
|
||||
&set_label("bad_pointer",4);
|
||||
&mov ("eax",-1);
|
||||
&pop ("ebx");
|
||||
&pop ("ebp");
|
||||
&ret ();
|
||||
&set_label("bad_keybits",4);
|
||||
&pxor ("xmm0","xmm0");
|
||||
&mov ("eax",-2);
|
||||
&pop ("ebx");
|
||||
&pop ("ebp");
|
||||
&ret ();
|
||||
&function_end_B("_aesni_set_encrypt_key");
|
||||
|
||||
@@ -2223,10 +2508,18 @@ if ($PREFIX eq "aesni") {
|
||||
&aesimc ("xmm0","xmm0");
|
||||
&$movekey (&QWP(0,$key),"xmm0");
|
||||
|
||||
&pxor ("xmm0","xmm0");
|
||||
&pxor ("xmm1","xmm1");
|
||||
&xor ("eax","eax"); # return success
|
||||
&set_label("dec_key_ret");
|
||||
&ret ();
|
||||
&function_end_B("${PREFIX}_set_decrypt_key");
|
||||
|
||||
&set_label("key_const",64);
|
||||
&data_word(0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d);
|
||||
&data_word(0x04070605,0x04070605,0x04070605,0x04070605);
|
||||
&data_word(1,1,1,1);
|
||||
&data_word(0x1b,0x1b,0x1b,0x1b);
|
||||
&asciz("AES for Intel AES-NI, CRYPTOGAMS by <appro\@openssl.org>");
|
||||
|
||||
&asm_finish();
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -24,8 +24,12 @@
|
||||
#
|
||||
# CBC enc CBC dec CTR
|
||||
# Apple A7 2.39 1.20 1.20
|
||||
# Cortex-A53 2.45 1.87 1.94
|
||||
# Cortex-A57 3.64 1.34 1.32
|
||||
# Cortex-A53 1.32 1.29 1.46
|
||||
# Cortex-A57(*) 1.95 0.85 0.93
|
||||
# Denver 1.96 0.86 0.80
|
||||
#
|
||||
# (*) original 3.64/1.34/1.32 results were for r0p0 revision
|
||||
# and are still same even for updated module;
|
||||
|
||||
$flavour = shift;
|
||||
open STDOUT,">".shift;
|
||||
@@ -308,17 +312,17 @@ ${prefix}_${dir}crypt:
|
||||
|
||||
.Loop_${dir}c:
|
||||
aes$e $inout,$rndkey0
|
||||
vld1.32 {$rndkey0},[$key],#16
|
||||
aes$mc $inout,$inout
|
||||
vld1.32 {$rndkey0},[$key],#16
|
||||
subs $rounds,$rounds,#2
|
||||
aes$e $inout,$rndkey1
|
||||
vld1.32 {$rndkey1},[$key],#16
|
||||
aes$mc $inout,$inout
|
||||
vld1.32 {$rndkey1},[$key],#16
|
||||
b.gt .Loop_${dir}c
|
||||
|
||||
aes$e $inout,$rndkey0
|
||||
vld1.32 {$rndkey0},[$key]
|
||||
aes$mc $inout,$inout
|
||||
vld1.32 {$rndkey0},[$key]
|
||||
aes$e $inout,$rndkey1
|
||||
veor $inout,$inout,$rndkey0
|
||||
|
||||
@@ -336,6 +340,7 @@ my ($rounds,$cnt,$key_,$step,$step1)=($enc,"w6","x7","x8","x12");
|
||||
my ($dat0,$dat1,$in0,$in1,$tmp0,$tmp1,$ivec,$rndlast)=map("q$_",(0..7));
|
||||
|
||||
my ($dat,$tmp,$rndzero_n_last)=($dat0,$tmp0,$tmp1);
|
||||
my ($key4,$key5,$key6,$key7)=("x6","x12","x14",$key);
|
||||
|
||||
### q8-q15 preloaded key schedule
|
||||
|
||||
@@ -385,16 +390,42 @@ $code.=<<___;
|
||||
veor $rndzero_n_last,q8,$rndlast
|
||||
b.eq .Lcbc_enc128
|
||||
|
||||
vld1.32 {$in0-$in1},[$key_]
|
||||
add $key_,$key,#16
|
||||
add $key4,$key,#16*4
|
||||
add $key5,$key,#16*5
|
||||
aese $dat,q8
|
||||
aesmc $dat,$dat
|
||||
add $key6,$key,#16*6
|
||||
add $key7,$key,#16*7
|
||||
b .Lenter_cbc_enc
|
||||
|
||||
.align 4
|
||||
.Loop_cbc_enc:
|
||||
aese $dat,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesmc $dat,$dat
|
||||
subs $cnt,$cnt,#2
|
||||
vst1.8 {$ivec},[$out],#16
|
||||
.Lenter_cbc_enc:
|
||||
aese $dat,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesmc $dat,$dat
|
||||
b.gt .Loop_cbc_enc
|
||||
aese $dat,$in0
|
||||
aesmc $dat,$dat
|
||||
vld1.32 {q8},[$key4]
|
||||
cmp $rounds,#4
|
||||
aese $dat,$in1
|
||||
aesmc $dat,$dat
|
||||
vld1.32 {q9},[$key5]
|
||||
b.eq .Lcbc_enc192
|
||||
|
||||
aese $dat,q8
|
||||
aesmc $dat,$dat
|
||||
vld1.32 {q8},[$key6]
|
||||
aese $dat,q9
|
||||
aesmc $dat,$dat
|
||||
vld1.32 {q9},[$key7]
|
||||
nop
|
||||
|
||||
.Lcbc_enc192:
|
||||
aese $dat,q8
|
||||
aesmc $dat,$dat
|
||||
subs $len,$len,#16
|
||||
@@ -403,7 +434,6 @@ $code.=<<___;
|
||||
cclr $step,eq
|
||||
aese $dat,q10
|
||||
aesmc $dat,$dat
|
||||
add $key_,$key,#16
|
||||
aese $dat,q11
|
||||
aesmc $dat,$dat
|
||||
vld1.8 {q8},[$inp],$step
|
||||
@@ -412,16 +442,14 @@ $code.=<<___;
|
||||
veor q8,q8,$rndzero_n_last
|
||||
aese $dat,q13
|
||||
aesmc $dat,$dat
|
||||
vld1.32 {q9},[$key_],#16 // re-pre-load rndkey[1]
|
||||
vld1.32 {q9},[$key_] // re-pre-load rndkey[1]
|
||||
aese $dat,q14
|
||||
aesmc $dat,$dat
|
||||
aese $dat,q15
|
||||
|
||||
mov $cnt,$rounds
|
||||
veor $ivec,$dat,$rndlast
|
||||
vst1.8 {$ivec},[$out],#16
|
||||
b.hs .Loop_cbc_enc
|
||||
|
||||
vst1.8 {$ivec},[$out],#16
|
||||
b .Lcbc_done
|
||||
|
||||
.align 5
|
||||
@@ -483,79 +511,78 @@ $code.=<<___;
|
||||
|
||||
.Loop3x_cbc_dec:
|
||||
aesd $dat0,q8
|
||||
aesd $dat1,q8
|
||||
aesd $dat2,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesimc $dat0,$dat0
|
||||
aesd $dat1,q8
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q8
|
||||
aesimc $dat2,$dat2
|
||||
vld1.32 {q8},[$key_],#16
|
||||
subs $cnt,$cnt,#2
|
||||
aesd $dat0,q9
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesimc $dat0,$dat0
|
||||
aesd $dat1,q9
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q9
|
||||
aesimc $dat2,$dat2
|
||||
vld1.32 {q9},[$key_],#16
|
||||
b.gt .Loop3x_cbc_dec
|
||||
|
||||
aesd $dat0,q8
|
||||
aesimc $dat0,$dat0
|
||||
aesd $dat1,q8
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q8
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp0,$ivec,$rndlast
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp1,$in0,$rndlast
|
||||
aesd $dat0,q9
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
veor $tmp2,$in1,$rndlast
|
||||
subs $len,$len,#0x30
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
vorr $ivec,$in2,$in2
|
||||
veor $tmp1,$in0,$rndlast
|
||||
mov.lo x6,$len // x6, $cnt, is zero at this point
|
||||
aesd $dat0,q12
|
||||
aesd $dat1,q12
|
||||
aesd $dat2,q12
|
||||
aesd $dat0,q9
|
||||
aesimc $dat0,$dat0
|
||||
aesd $dat1,q9
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q9
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp2,$in1,$rndlast
|
||||
add $inp,$inp,x6 // $inp is adjusted in such way that
|
||||
// at exit from the loop $dat1-$dat2
|
||||
// are loaded with last "words"
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
vorr $ivec,$in2,$in2
|
||||
mov $key_,$key
|
||||
aesd $dat0,q13
|
||||
aesd $dat1,q13
|
||||
aesd $dat2,q13
|
||||
vld1.8 {$in0},[$inp],#16
|
||||
aesd $dat0,q12
|
||||
aesimc $dat0,$dat0
|
||||
aesd $dat1,q12
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q12
|
||||
aesimc $dat2,$dat2
|
||||
vld1.8 {$in0},[$inp],#16
|
||||
aesd $dat0,q13
|
||||
aesimc $dat0,$dat0
|
||||
aesd $dat1,q13
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q13
|
||||
aesimc $dat2,$dat2
|
||||
vld1.8 {$in1},[$inp],#16
|
||||
aesd $dat0,q14
|
||||
aesd $dat1,q14
|
||||
aesd $dat2,q14
|
||||
vld1.8 {$in2},[$inp],#16
|
||||
aesimc $dat0,$dat0
|
||||
aesd $dat1,q14
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q14
|
||||
aesimc $dat2,$dat2
|
||||
vld1.32 {q8},[$key_],#16 // re-pre-load rndkey[0]
|
||||
vld1.8 {$in2},[$inp],#16
|
||||
aesd $dat0,q15
|
||||
aesd $dat1,q15
|
||||
aesd $dat2,q15
|
||||
|
||||
vld1.32 {q8},[$key_],#16 // re-pre-load rndkey[0]
|
||||
add $cnt,$rounds,#2
|
||||
veor $tmp0,$tmp0,$dat0
|
||||
veor $tmp1,$tmp1,$dat1
|
||||
veor $dat2,$dat2,$tmp2
|
||||
vld1.32 {q9},[$key_],#16 // re-pre-load rndkey[1]
|
||||
vorr $dat0,$in0,$in0
|
||||
vst1.8 {$tmp0},[$out],#16
|
||||
vorr $dat1,$in1,$in1
|
||||
vorr $dat0,$in0,$in0
|
||||
vst1.8 {$tmp1},[$out],#16
|
||||
vorr $dat1,$in1,$in1
|
||||
vst1.8 {$dat2},[$out],#16
|
||||
vorr $dat2,$in2,$in2
|
||||
b.hs .Loop3x_cbc_dec
|
||||
@@ -566,39 +593,39 @@ $code.=<<___;
|
||||
|
||||
.Lcbc_dec_tail:
|
||||
aesd $dat1,q8
|
||||
aesd $dat2,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q8
|
||||
aesimc $dat2,$dat2
|
||||
vld1.32 {q8},[$key_],#16
|
||||
subs $cnt,$cnt,#2
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q9
|
||||
aesimc $dat2,$dat2
|
||||
vld1.32 {q9},[$key_],#16
|
||||
b.gt .Lcbc_dec_tail
|
||||
|
||||
aesd $dat1,q8
|
||||
aesd $dat2,q8
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q8
|
||||
aesimc $dat2,$dat2
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q9
|
||||
aesimc $dat2,$dat2
|
||||
aesd $dat1,q12
|
||||
aesd $dat2,q12
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q12
|
||||
aesimc $dat2,$dat2
|
||||
cmn $len,#0x20
|
||||
aesd $dat1,q13
|
||||
aesd $dat2,q13
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q13
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp1,$ivec,$rndlast
|
||||
aesd $dat1,q14
|
||||
aesd $dat2,q14
|
||||
aesimc $dat1,$dat1
|
||||
aesd $dat2,q14
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp2,$in1,$rndlast
|
||||
aesd $dat1,q15
|
||||
@@ -699,70 +726,69 @@ $code.=<<___;
|
||||
.align 4
|
||||
.Loop3x_ctr32:
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
aese $dat2,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q8
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat2,q8
|
||||
aesmc $dat2,$dat2
|
||||
vld1.32 {q8},[$key_],#16
|
||||
subs $cnt,$cnt,#2
|
||||
aese $dat0,q9
|
||||
aese $dat1,q9
|
||||
aese $dat2,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q9
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat2,q9
|
||||
aesmc $dat2,$dat2
|
||||
vld1.32 {q9},[$key_],#16
|
||||
b.gt .Loop3x_ctr32
|
||||
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
aese $dat2,q8
|
||||
mov $key_,$key
|
||||
aesmc $tmp0,$dat0
|
||||
vld1.8 {$in0},[$inp],#16
|
||||
aese $dat1,q8
|
||||
aesmc $tmp1,$dat1
|
||||
aesmc $dat2,$dat2
|
||||
vld1.8 {$in0},[$inp],#16
|
||||
vorr $dat0,$ivec,$ivec
|
||||
aese $tmp0,q9
|
||||
aese $dat2,q8
|
||||
aesmc $dat2,$dat2
|
||||
vld1.8 {$in1},[$inp],#16
|
||||
aese $tmp1,q9
|
||||
aese $dat2,q9
|
||||
vorr $dat1,$ivec,$ivec
|
||||
aese $tmp0,q9
|
||||
aesmc $tmp0,$tmp0
|
||||
vld1.8 {$in2},[$inp],#16
|
||||
aese $tmp1,q9
|
||||
aesmc $tmp1,$tmp1
|
||||
vld1.8 {$in2},[$inp],#16
|
||||
mov $key_,$key
|
||||
aese $dat2,q9
|
||||
aesmc $tmp2,$dat2
|
||||
vorr $dat2,$ivec,$ivec
|
||||
add $tctr0,$ctr,#1
|
||||
aese $tmp0,q12
|
||||
aesmc $tmp0,$tmp0
|
||||
aese $tmp1,q12
|
||||
aese $tmp2,q12
|
||||
aesmc $tmp1,$tmp1
|
||||
veor $in0,$in0,$rndlast
|
||||
add $tctr1,$ctr,#2
|
||||
aesmc $tmp0,$tmp0
|
||||
aesmc $tmp1,$tmp1
|
||||
aese $tmp2,q12
|
||||
aesmc $tmp2,$tmp2
|
||||
veor $in1,$in1,$rndlast
|
||||
add $ctr,$ctr,#3
|
||||
aese $tmp0,q13
|
||||
aesmc $tmp0,$tmp0
|
||||
aese $tmp1,q13
|
||||
aese $tmp2,q13
|
||||
aesmc $tmp1,$tmp1
|
||||
veor $in2,$in2,$rndlast
|
||||
rev $tctr0,$tctr0
|
||||
aesmc $tmp0,$tmp0
|
||||
vld1.32 {q8},[$key_],#16 // re-pre-load rndkey[0]
|
||||
aesmc $tmp1,$tmp1
|
||||
aese $tmp2,q13
|
||||
aesmc $tmp2,$tmp2
|
||||
vmov.32 ${dat0}[3], $tctr0
|
||||
rev $tctr1,$tctr1
|
||||
aese $tmp0,q14
|
||||
aesmc $tmp0,$tmp0
|
||||
aese $tmp1,q14
|
||||
aese $tmp2,q14
|
||||
aesmc $tmp1,$tmp1
|
||||
vmov.32 ${dat1}[3], $tctr1
|
||||
rev $tctr2,$ctr
|
||||
aesmc $tmp0,$tmp0
|
||||
aesmc $tmp1,$tmp1
|
||||
aese $tmp2,q14
|
||||
aesmc $tmp2,$tmp2
|
||||
vmov.32 ${dat2}[3], $tctr2
|
||||
subs $len,$len,#3
|
||||
@@ -770,13 +796,14 @@ $code.=<<___;
|
||||
aese $tmp1,q15
|
||||
aese $tmp2,q15
|
||||
|
||||
mov $cnt,$rounds
|
||||
veor $in0,$in0,$tmp0
|
||||
vld1.32 {q8},[$key_],#16 // re-pre-load rndkey[0]
|
||||
vst1.8 {$in0},[$out],#16
|
||||
veor $in1,$in1,$tmp1
|
||||
mov $cnt,$rounds
|
||||
vst1.8 {$in1},[$out],#16
|
||||
veor $in2,$in2,$tmp2
|
||||
vld1.32 {q9},[$key_],#16 // re-pre-load rndkey[1]
|
||||
vst1.8 {$in0},[$out],#16
|
||||
vst1.8 {$in1},[$out],#16
|
||||
vst1.8 {$in2},[$out],#16
|
||||
b.hs .Loop3x_ctr32
|
||||
|
||||
@@ -788,40 +815,40 @@ $code.=<<___;
|
||||
|
||||
.Lctr32_tail:
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q8
|
||||
aesmc $dat1,$dat1
|
||||
vld1.32 {q8},[$key_],#16
|
||||
subs $cnt,$cnt,#2
|
||||
aese $dat0,q9
|
||||
aese $dat1,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q9
|
||||
aesmc $dat1,$dat1
|
||||
vld1.32 {q9},[$key_],#16
|
||||
b.gt .Lctr32_tail
|
||||
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q8
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat0,q9
|
||||
aese $dat1,q9
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q9
|
||||
aesmc $dat1,$dat1
|
||||
vld1.8 {$in0},[$inp],$step
|
||||
aese $dat0,q12
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q12
|
||||
aesmc $dat1,$dat1
|
||||
vld1.8 {$in1},[$inp]
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat0,q13
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q13
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat0,q14
|
||||
aese $dat1,q14
|
||||
veor $in0,$in0,$rndlast
|
||||
aese $dat0,q14
|
||||
aesmc $dat0,$dat0
|
||||
aese $dat1,q14
|
||||
aesmc $dat1,$dat1
|
||||
veor $in1,$in1,$rndlast
|
||||
aese $dat0,q15
|
||||
|
@@ -93,6 +93,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -124,6 +124,8 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
|
||||
else {
|
||||
ret = a->length;
|
||||
i = a->data[0];
|
||||
if (ret == 1 && i == 0)
|
||||
neg = 0;
|
||||
if (!neg && (i > 127)) {
|
||||
pad = 1;
|
||||
pb = 0;
|
||||
@@ -162,7 +164,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
|
||||
p += a->length - 1;
|
||||
i = a->length;
|
||||
/* Copy zeros to destination as long as source is zero */
|
||||
while (!*n) {
|
||||
while (!*n && i > 1) {
|
||||
*(p--) = 0;
|
||||
n--;
|
||||
i--;
|
||||
@@ -419,7 +421,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
|
||||
ASN1err(ASN1_F_BN_TO_ASN1_INTEGER, ERR_R_NESTED_ASN1_ERROR);
|
||||
goto err;
|
||||
}
|
||||
if (BN_is_negative(bn))
|
||||
if (BN_is_negative(bn) && !BN_is_zero(bn))
|
||||
ret->type = V_ASN1_NEG_INTEGER;
|
||||
else
|
||||
ret->type = V_ASN1_INTEGER;
|
||||
|
@@ -119,6 +119,9 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
|
||||
case V_ASN1_OBJECT:
|
||||
result = OBJ_cmp(a->value.object, b->value.object);
|
||||
break;
|
||||
case V_ASN1_BOOLEAN:
|
||||
result = a->value.boolean - b->value.boolean;
|
||||
break;
|
||||
case V_ASN1_NULL:
|
||||
result = 0; /* They do not have content. */
|
||||
break;
|
||||
|
@@ -297,7 +297,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
|
||||
if (!OPENSSL_gmtime(&t, &ttm))
|
||||
return -2;
|
||||
|
||||
if (!OPENSSL_gmtime_diff(&day, &sec, &stm, &ttm))
|
||||
if (!OPENSSL_gmtime_diff(&day, &sec, &ttm, &stm))
|
||||
return -2;
|
||||
|
||||
if (day > 0)
|
||||
|
@@ -464,3 +464,21 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
|
||||
{
|
||||
ameth->pkey_ctrl = pkey_ctrl;
|
||||
}
|
||||
|
||||
void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,
|
||||
int (*item_verify) (EVP_MD_CTX *ctx,
|
||||
const ASN1_ITEM *it,
|
||||
void *asn,
|
||||
X509_ALGOR *a,
|
||||
ASN1_BIT_STRING *sig,
|
||||
EVP_PKEY *pkey),
|
||||
int (*item_sign) (EVP_MD_CTX *ctx,
|
||||
const ASN1_ITEM *it,
|
||||
void *asn,
|
||||
X509_ALGOR *alg1,
|
||||
X509_ALGOR *alg2,
|
||||
ASN1_BIT_STRING *sig))
|
||||
{
|
||||
ameth->item_sign = item_sign;
|
||||
ameth->item_verify = item_verify;
|
||||
}
|
||||
|
@@ -795,6 +795,7 @@ DECLARE_ASN1_SET_OF(ASN1_OBJECT)
|
||||
|
||||
ASN1_STRING *ASN1_STRING_new(void);
|
||||
void ASN1_STRING_free(ASN1_STRING *a);
|
||||
void ASN1_STRING_clear_free(ASN1_STRING *a);
|
||||
int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
|
||||
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
|
||||
ASN1_STRING *ASN1_STRING_type_new(int type);
|
||||
|
@@ -74,6 +74,8 @@
|
||||
#define ASN1_GEN_STR(str,val) {str, sizeof(str) - 1, val}
|
||||
|
||||
#define ASN1_FLAG_EXP_MAX 20
|
||||
/* Maximum number of nested sequences */
|
||||
#define ASN1_GEN_SEQ_MAX_DEPTH 50
|
||||
|
||||
/* Input formats */
|
||||
|
||||
@@ -110,13 +112,16 @@ typedef struct {
|
||||
int exp_count;
|
||||
} tag_exp_arg;
|
||||
|
||||
static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
|
||||
int *perr);
|
||||
static int bitstr_cb(const char *elem, int len, void *bitstr);
|
||||
static int asn1_cb(const char *elem, int len, void *bitstr);
|
||||
static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class,
|
||||
int exp_constructed, int exp_pad, int imp_ok);
|
||||
static int parse_tagging(const char *vstart, int vlen, int *ptag,
|
||||
int *pclass);
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf);
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
|
||||
int depth, int *perr);
|
||||
static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype);
|
||||
static int asn1_str2tag(const char *tagstr, int len);
|
||||
|
||||
@@ -132,6 +137,16 @@ ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf)
|
||||
}
|
||||
|
||||
ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
|
||||
{
|
||||
int err = 0;
|
||||
ASN1_TYPE *ret = generate_v3(str, cnf, 0, &err);
|
||||
if (err)
|
||||
ASN1err(ASN1_F_ASN1_GENERATE_V3, err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
|
||||
int *perr)
|
||||
{
|
||||
ASN1_TYPE *ret;
|
||||
tag_exp_arg asn1_tags;
|
||||
@@ -152,17 +167,22 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
|
||||
asn1_tags.imp_class = -1;
|
||||
asn1_tags.format = ASN1_GEN_FORMAT_ASCII;
|
||||
asn1_tags.exp_count = 0;
|
||||
if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0)
|
||||
if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0) {
|
||||
*perr = ASN1_R_UNKNOWN_TAG;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((asn1_tags.utype == V_ASN1_SEQUENCE)
|
||||
|| (asn1_tags.utype == V_ASN1_SET)) {
|
||||
if (!cnf) {
|
||||
ASN1err(ASN1_F_ASN1_GENERATE_V3,
|
||||
ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG);
|
||||
*perr = ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG;
|
||||
return NULL;
|
||||
}
|
||||
ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf);
|
||||
if (depth >= ASN1_GEN_SEQ_MAX_DEPTH) {
|
||||
*perr = ASN1_R_ILLEGAL_NESTED_TAGGING;
|
||||
return NULL;
|
||||
}
|
||||
ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf, depth, perr);
|
||||
} else
|
||||
ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype);
|
||||
|
||||
@@ -279,6 +299,9 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
|
||||
|
||||
int tmp_tag, tmp_class;
|
||||
|
||||
if (elem == NULL)
|
||||
return -1;
|
||||
|
||||
for (i = 0, p = elem; i < len; p++, i++) {
|
||||
/* Look for the ':' in name value pairs */
|
||||
if (*p == ':') {
|
||||
@@ -350,13 +373,17 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
|
||||
break;
|
||||
|
||||
case ASN1_GEN_FLAG_FORMAT:
|
||||
if (!vstart) {
|
||||
ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
|
||||
return -1;
|
||||
}
|
||||
if (!strncmp(vstart, "ASCII", 5))
|
||||
arg->format = ASN1_GEN_FORMAT_ASCII;
|
||||
else if (!strncmp(vstart, "UTF8", 4))
|
||||
arg->format = ASN1_GEN_FORMAT_UTF8;
|
||||
else if (!strncmp(vstart, "HEX", 3))
|
||||
arg->format = ASN1_GEN_FORMAT_HEX;
|
||||
else if (!strncmp(vstart, "BITLIST", 3))
|
||||
else if (!strncmp(vstart, "BITLIST", 7))
|
||||
arg->format = ASN1_GEN_FORMAT_BITLIST;
|
||||
else {
|
||||
ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKOWN_FORMAT);
|
||||
@@ -428,7 +455,8 @@ static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass)
|
||||
|
||||
/* Handle multiple types: SET and SEQUENCE */
|
||||
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
|
||||
int depth, int *perr)
|
||||
{
|
||||
ASN1_TYPE *ret = NULL;
|
||||
STACK_OF(ASN1_TYPE) *sk = NULL;
|
||||
@@ -447,7 +475,8 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
|
||||
goto bad;
|
||||
for (i = 0; i < sk_CONF_VALUE_num(sect); i++) {
|
||||
ASN1_TYPE *typ =
|
||||
ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);
|
||||
generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf,
|
||||
depth + 1, perr);
|
||||
if (!typ)
|
||||
goto bad;
|
||||
if (!sk_ASN1_TYPE_push(sk, typ))
|
||||
|
@@ -430,6 +430,13 @@ void ASN1_STRING_free(ASN1_STRING *a)
|
||||
OPENSSL_free(a);
|
||||
}
|
||||
|
||||
void ASN1_STRING_clear_free(ASN1_STRING *a)
|
||||
{
|
||||
if (a && a->data && !(a->flags & ASN1_STRING_FLAG_NDEF))
|
||||
OPENSSL_cleanse(a->data, a->length);
|
||||
ASN1_STRING_free(a);
|
||||
}
|
||||
|
||||
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
|
||||
{
|
||||
int i;
|
||||
|
@@ -337,7 +337,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
if (BIO_write(bp, "BAD ENUMERATED", 11) <= 0)
|
||||
if (BIO_write(bp, "BAD ENUMERATED", 14) <= 0)
|
||||
goto end;
|
||||
}
|
||||
M_ASN1_ENUMERATED_free(bs);
|
||||
|
@@ -289,7 +289,8 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
|
||||
if ((flags & SMIME_DETACHED) && data) {
|
||||
/* We want multipart/signed */
|
||||
/* Generate a random boundary */
|
||||
RAND_pseudo_bytes((unsigned char *)bound, 32);
|
||||
if (RAND_pseudo_bytes((unsigned char *)bound, 32) < 0)
|
||||
return 0;
|
||||
for (i = 0; i < 32; i++) {
|
||||
c = bound[i] & 0xf;
|
||||
if (c < 10)
|
||||
|
@@ -162,6 +162,9 @@ static int ndef_prefix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
|
||||
|
||||
derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it);
|
||||
p = OPENSSL_malloc(derlen);
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
ndef_aux->derbuf = p;
|
||||
*pbuf = p;
|
||||
derlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
|
||||
@@ -229,6 +232,9 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
|
||||
|
||||
derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it);
|
||||
p = OPENSSL_malloc(derlen);
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
ndef_aux->derbuf = p;
|
||||
*pbuf = p;
|
||||
derlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
|
||||
|
@@ -69,7 +69,8 @@ static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
/* Since the structure must still be valid use ASN1_OP_FREE_PRE */
|
||||
if (operation == ASN1_OP_FREE_PRE) {
|
||||
PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval;
|
||||
if (key->pkey->value.octet_string)
|
||||
if (key->pkey && key->pkey->type == V_ASN1_OCTET_STRING
|
||||
&& key->pkey->value.octet_string != NULL)
|
||||
OPENSSL_cleanse(key->pkey->value.octet_string->data,
|
||||
key->pkey->value.octet_string->length);
|
||||
}
|
||||
|
@@ -304,9 +304,16 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
case ASN1_ITYPE_CHOICE:
|
||||
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
|
||||
goto auxerr;
|
||||
|
||||
/* Allocate structure */
|
||||
if (!*pval && !ASN1_item_ex_new(pval, it)) {
|
||||
if (*pval) {
|
||||
/* Free up and zero CHOICE value if initialised */
|
||||
i = asn1_get_choice_selector(pval, it);
|
||||
if ((i >= 0) && (i < it->tcount)) {
|
||||
tt = it->templates + i;
|
||||
pchptr = asn1_get_field_ptr(pval, tt);
|
||||
ASN1_template_free(pchptr, tt);
|
||||
asn1_set_choice_selector(pval, -1, it);
|
||||
}
|
||||
} else if (!ASN1_item_ex_new(pval, it)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR);
|
||||
goto err;
|
||||
}
|
||||
@@ -386,6 +393,17 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
|
||||
goto auxerr;
|
||||
|
||||
/* Free up and zero any ADB found */
|
||||
for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
|
||||
if (tt->flags & ASN1_TFLG_ADB_MASK) {
|
||||
const ASN1_TEMPLATE *seqtt;
|
||||
ASN1_VALUE **pseqval;
|
||||
seqtt = asn1_do_adb(pval, tt, 1);
|
||||
pseqval = asn1_get_field_ptr(pval, seqtt);
|
||||
ASN1_template_free(pseqval, seqtt);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get each field entry */
|
||||
for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
|
||||
const ASN1_TEMPLATE *seqtt;
|
||||
|
@@ -100,9 +100,6 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
else
|
||||
asn1_cb = 0;
|
||||
|
||||
if (!combine)
|
||||
*pval = NULL;
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
if (it->sname)
|
||||
CRYPTO_push_info(it->sname);
|
||||
@@ -315,13 +312,16 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
||||
ASN1_STRING *str;
|
||||
int utype;
|
||||
|
||||
if (it && it->funcs) {
|
||||
if (!it)
|
||||
return 0;
|
||||
|
||||
if (it->funcs) {
|
||||
const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
|
||||
if (pf->prim_new)
|
||||
return pf->prim_new(pval, it);
|
||||
}
|
||||
|
||||
if (!it || (it->itype == ASN1_ITYPE_MSTRING))
|
||||
if (it->itype == ASN1_ITYPE_MSTRING)
|
||||
utype = -1;
|
||||
else
|
||||
utype = it->utype;
|
||||
|
@@ -220,6 +220,7 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
|
||||
if (!asn1_template_print_ctx(out, fld, indent,
|
||||
it->templates, pctx))
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
/* fall thru */
|
||||
case ASN1_ITYPE_MSTRING:
|
||||
@@ -289,6 +290,8 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
|
||||
for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
|
||||
const ASN1_TEMPLATE *seqtt;
|
||||
seqtt = asn1_do_adb(fld, tt, 1);
|
||||
if (!seqtt)
|
||||
return 0;
|
||||
tmpfld = asn1_get_field_ptr(fld, seqtt);
|
||||
if (!asn1_template_print_ctx(out, tmpfld,
|
||||
indent + 2, seqtt, pctx))
|
||||
|
@@ -98,46 +98,55 @@ ASN1_ITEM_end(CBIGNUM)
|
||||
|
||||
static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
||||
{
|
||||
*pval = (ASN1_VALUE *)BN_new();
|
||||
if(*pval) return 1;
|
||||
else return 0;
|
||||
*pval = (ASN1_VALUE *)BN_new();
|
||||
if (*pval)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
||||
{
|
||||
if(!*pval) return;
|
||||
if(it->size & BN_SENSITIVE) BN_clear_free((BIGNUM *)*pval);
|
||||
else BN_free((BIGNUM *)*pval);
|
||||
*pval = NULL;
|
||||
if (!*pval)
|
||||
return;
|
||||
if (it->size & BN_SENSITIVE)
|
||||
BN_clear_free((BIGNUM *)*pval);
|
||||
else
|
||||
BN_free((BIGNUM *)*pval);
|
||||
*pval = NULL;
|
||||
}
|
||||
|
||||
static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it)
|
||||
static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
|
||||
const ASN1_ITEM *it)
|
||||
{
|
||||
BIGNUM *bn;
|
||||
int pad;
|
||||
if(!*pval) return -1;
|
||||
bn = (BIGNUM *)*pval;
|
||||
/* If MSB set in an octet we need a padding byte */
|
||||
if(BN_num_bits(bn) & 0x7) pad = 0;
|
||||
else pad = 1;
|
||||
if(cont) {
|
||||
if(pad) *cont++ = 0;
|
||||
BN_bn2bin(bn, cont);
|
||||
}
|
||||
return pad + BN_num_bytes(bn);
|
||||
BIGNUM *bn;
|
||||
int pad;
|
||||
if (!*pval)
|
||||
return -1;
|
||||
bn = (BIGNUM *)*pval;
|
||||
/* If MSB set in an octet we need a padding byte */
|
||||
if (BN_num_bits(bn) & 0x7)
|
||||
pad = 0;
|
||||
else
|
||||
pad = 1;
|
||||
if (cont) {
|
||||
if (pad)
|
||||
*cont++ = 0;
|
||||
BN_bn2bin(bn, cont);
|
||||
}
|
||||
return pad + BN_num_bytes(bn);
|
||||
}
|
||||
|
||||
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);
|
||||
bn = (BIGNUM *)*pval;
|
||||
if(!BN_bin2bn(cont, len, bn)) {
|
||||
bn_free(pval, it);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
BIGNUM *bn;
|
||||
if (!*pval)
|
||||
bn_new(pval, it);
|
||||
bn = (BIGNUM *)*pval;
|
||||
if (!BN_bin2bn(cont, len, bn)) {
|
||||
bn_free(pval, it);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -97,87 +97,100 @@ ASN1_ITEM_end(ZLONG)
|
||||
|
||||
static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
||||
{
|
||||
*(long *)pval = it->size;
|
||||
return 1;
|
||||
*(long *)pval = it->size;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
||||
{
|
||||
*(long *)pval = it->size;
|
||||
*(long *)pval = it->size;
|
||||
}
|
||||
|
||||
static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it)
|
||||
static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
|
||||
const ASN1_ITEM *it)
|
||||
{
|
||||
long ltmp;
|
||||
unsigned long utmp;
|
||||
int clen, pad, i;
|
||||
/* this exists to bypass broken gcc optimization */
|
||||
char *cp = (char *)pval;
|
||||
long ltmp;
|
||||
unsigned long utmp;
|
||||
int clen, pad, i;
|
||||
/* this exists to bypass broken gcc optimization */
|
||||
char *cp = (char *)pval;
|
||||
|
||||
/* use memcpy, because we may not be long aligned */
|
||||
memcpy(<mp, cp, sizeof(long));
|
||||
/* use memcpy, because we may not be long aligned */
|
||||
memcpy(<mp, cp, sizeof(long));
|
||||
|
||||
if(ltmp == it->size) return -1;
|
||||
/* Convert the long to positive: we subtract one if negative so
|
||||
* we can cleanly handle the padding if only the MSB of the leading
|
||||
* octet is set.
|
||||
*/
|
||||
if(ltmp < 0) utmp = -ltmp - 1;
|
||||
else utmp = ltmp;
|
||||
clen = BN_num_bits_word(utmp);
|
||||
/* If MSB of leading octet set we need to pad */
|
||||
if(!(clen & 0x7)) pad = 1;
|
||||
else pad = 0;
|
||||
if (ltmp == it->size)
|
||||
return -1;
|
||||
/*
|
||||
* Convert the long to positive: we subtract one if negative so we can
|
||||
* cleanly handle the padding if only the MSB of the leading octet is
|
||||
* set.
|
||||
*/
|
||||
if (ltmp < 0)
|
||||
utmp = -ltmp - 1;
|
||||
else
|
||||
utmp = ltmp;
|
||||
clen = BN_num_bits_word(utmp);
|
||||
/* If MSB of leading octet set we need to pad */
|
||||
if (!(clen & 0x7))
|
||||
pad = 1;
|
||||
else
|
||||
pad = 0;
|
||||
|
||||
/* Convert number of bits to number of octets */
|
||||
clen = (clen + 7) >> 3;
|
||||
/* Convert number of bits to number of octets */
|
||||
clen = (clen + 7) >> 3;
|
||||
|
||||
if(cont) {
|
||||
if(pad) *cont++ = (ltmp < 0) ? 0xff : 0;
|
||||
for(i = clen - 1; i >= 0; i--) {
|
||||
cont[i] = (unsigned char)(utmp & 0xff);
|
||||
if(ltmp < 0) cont[i] ^= 0xff;
|
||||
utmp >>= 8;
|
||||
}
|
||||
if (cont) {
|
||||
if (pad)
|
||||
*cont++ = (ltmp < 0) ? 0xff : 0;
|
||||
for (i = clen - 1; i >= 0; i--) {
|
||||
cont[i] = (unsigned char)(utmp & 0xff);
|
||||
if (ltmp < 0)
|
||||
cont[i] ^= 0xff;
|
||||
utmp >>= 8;
|
||||
}
|
||||
return clen + pad;
|
||||
}
|
||||
return clen + pad;
|
||||
}
|
||||
|
||||
static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
||||
int utype, char *free_cont, const ASN1_ITEM *it)
|
||||
{
|
||||
int neg, i;
|
||||
long ltmp;
|
||||
unsigned long utmp = 0;
|
||||
char *cp = (char *)pval;
|
||||
if(len > (int)sizeof(long)) {
|
||||
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
|
||||
return 0;
|
||||
}
|
||||
/* Is it negative? */
|
||||
if(len && (cont[0] & 0x80)) neg = 1;
|
||||
else neg = 0;
|
||||
utmp = 0;
|
||||
for(i = 0; i < len; i++) {
|
||||
utmp <<= 8;
|
||||
if(neg) utmp |= cont[i] ^ 0xff;
|
||||
else utmp |= cont[i];
|
||||
}
|
||||
ltmp = (long)utmp;
|
||||
if(neg) {
|
||||
ltmp++;
|
||||
ltmp = -ltmp;
|
||||
}
|
||||
if(ltmp == it->size) {
|
||||
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
|
||||
return 0;
|
||||
}
|
||||
memcpy(cp, <mp, sizeof(long));
|
||||
return 1;
|
||||
int neg, i;
|
||||
long ltmp;
|
||||
unsigned long utmp = 0;
|
||||
char *cp = (char *)pval;
|
||||
if (len > (int)sizeof(long)) {
|
||||
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
|
||||
return 0;
|
||||
}
|
||||
/* Is it negative? */
|
||||
if (len && (cont[0] & 0x80))
|
||||
neg = 1;
|
||||
else
|
||||
neg = 0;
|
||||
utmp = 0;
|
||||
for (i = 0; i < len; i++) {
|
||||
utmp <<= 8;
|
||||
if (neg)
|
||||
utmp |= cont[i] ^ 0xff;
|
||||
else
|
||||
utmp |= cont[i];
|
||||
}
|
||||
ltmp = (long)utmp;
|
||||
if (neg) {
|
||||
ltmp++;
|
||||
ltmp = -ltmp;
|
||||
}
|
||||
if (ltmp == it->size) {
|
||||
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
|
||||
return 0;
|
||||
}
|
||||
memcpy(cp, <mp, sizeof(long));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
int indent, const ASN1_PCTX *pctx)
|
||||
{
|
||||
return BIO_printf(out, "%ld\n", *(long *)pval);
|
||||
}
|
||||
int indent, const ASN1_PCTX *pctx)
|
||||
{
|
||||
return BIO_printf(out, "%ld\n", *(long *)pval);
|
||||
}
|
||||
|
@@ -172,8 +172,14 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
|
||||
{
|
||||
const unsigned char *q;
|
||||
X509 *ret;
|
||||
int freeret = 0;
|
||||
|
||||
/* Save start position */
|
||||
q = *pp;
|
||||
|
||||
if (!a || *a == NULL) {
|
||||
freeret = 1;
|
||||
}
|
||||
ret = d2i_X509(a, pp, length);
|
||||
/* If certificate unreadable then forget it */
|
||||
if (!ret)
|
||||
@@ -186,7 +192,11 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
|
||||
goto err;
|
||||
return ret;
|
||||
err:
|
||||
X509_free(ret);
|
||||
if (freeret) {
|
||||
X509_free(ret);
|
||||
if (a)
|
||||
*a = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -72,6 +72,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -73,6 +73,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -592,7 +592,6 @@ fmtfp(char **sbuffer,
|
||||
int fplace = 0;
|
||||
int padlen = 0;
|
||||
int zpadlen = 0;
|
||||
int caps = 0;
|
||||
long intpart;
|
||||
long fracpart;
|
||||
long max10;
|
||||
@@ -630,8 +629,7 @@ fmtfp(char **sbuffer,
|
||||
|
||||
/* convert integer part */
|
||||
do {
|
||||
iconvert[iplace++] =
|
||||
(caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10];
|
||||
iconvert[iplace++] = "0123456789"[intpart % 10];
|
||||
intpart = (intpart / 10);
|
||||
} while (intpart && (iplace < (int)sizeof(iconvert)));
|
||||
if (iplace == sizeof iconvert)
|
||||
@@ -640,8 +638,7 @@ fmtfp(char **sbuffer,
|
||||
|
||||
/* convert fractional part */
|
||||
do {
|
||||
fconvert[fplace++] =
|
||||
(caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10];
|
||||
fconvert[fplace++] = "0123456789"[fracpart % 10];
|
||||
fracpart = (fracpart / 10);
|
||||
} while (fplace < max);
|
||||
if (fplace == sizeof fconvert)
|
||||
@@ -707,24 +704,29 @@ doapr_outch(char **sbuffer,
|
||||
/* If we haven't at least one buffer, someone has doe a big booboo */
|
||||
assert(*sbuffer != NULL || buffer != NULL);
|
||||
|
||||
if (buffer) {
|
||||
while (*currlen >= *maxlen) {
|
||||
if (*buffer == NULL) {
|
||||
if (*maxlen == 0)
|
||||
*maxlen = 1024;
|
||||
*buffer = OPENSSL_malloc(*maxlen);
|
||||
if (*currlen > 0) {
|
||||
assert(*sbuffer != NULL);
|
||||
memcpy(*buffer, *sbuffer, *currlen);
|
||||
}
|
||||
*sbuffer = NULL;
|
||||
} else {
|
||||
*maxlen += 1024;
|
||||
*buffer = OPENSSL_realloc(*buffer, *maxlen);
|
||||
/* |currlen| must always be <= |*maxlen| */
|
||||
assert(*currlen <= *maxlen);
|
||||
|
||||
if (buffer && *currlen == *maxlen) {
|
||||
*maxlen += 1024;
|
||||
if (*buffer == NULL) {
|
||||
*buffer = OPENSSL_malloc(*maxlen);
|
||||
if (!*buffer) {
|
||||
/* Panic! Can't really do anything sensible. Just return */
|
||||
return;
|
||||
}
|
||||
if (*currlen > 0) {
|
||||
assert(*sbuffer != NULL);
|
||||
memcpy(*buffer, *sbuffer, *currlen);
|
||||
}
|
||||
*sbuffer = NULL;
|
||||
} else {
|
||||
*buffer = OPENSSL_realloc(*buffer, *maxlen);
|
||||
if (!*buffer) {
|
||||
/* Panic! Can't really do anything sensible. Just return */
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* What to do if *buffer is NULL? */
|
||||
assert(*sbuffer != NULL || *buffer != NULL);
|
||||
}
|
||||
|
||||
if (*currlen < *maxlen) {
|
||||
|
@@ -139,7 +139,8 @@ static int nbiof_read(BIO *b, char *out, int outl)
|
||||
|
||||
BIO_clear_retry_flags(b);
|
||||
#if 1
|
||||
RAND_pseudo_bytes(&n, 1);
|
||||
if (RAND_pseudo_bytes(&n, 1) < 0)
|
||||
return -1;
|
||||
num = (n & 0x07);
|
||||
|
||||
if (outl > num)
|
||||
@@ -178,7 +179,8 @@ static int nbiof_write(BIO *b, const char *in, int inl)
|
||||
num = nt->lwn;
|
||||
nt->lwn = 0;
|
||||
} else {
|
||||
RAND_pseudo_bytes(&n, 1);
|
||||
if (RAND_pseudo_bytes(&n, 1) < 0)
|
||||
return -1;
|
||||
num = (n & 7);
|
||||
}
|
||||
|
||||
|
@@ -833,6 +833,7 @@ void ERR_load_BIO_strings(void);
|
||||
# define BIO_F_CONN_CTRL 127
|
||||
# define BIO_F_CONN_STATE 115
|
||||
# define BIO_F_DGRAM_SCTP_READ 132
|
||||
# define BIO_F_DGRAM_SCTP_WRITE 133
|
||||
# define BIO_F_FILE_CTRL 116
|
||||
# define BIO_F_FILE_READ 130
|
||||
# define BIO_F_LINEBUFFER_CTRL 129
|
||||
|
@@ -70,14 +70,17 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp,
|
||||
MS_STATIC char buf[256];
|
||||
char *p;
|
||||
long r = 1;
|
||||
int len;
|
||||
size_t p_maxlen;
|
||||
|
||||
if (BIO_CB_RETURN & cmd)
|
||||
r = ret;
|
||||
|
||||
BIO_snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
|
||||
p = &(buf[14]);
|
||||
p_maxlen = sizeof buf - 14;
|
||||
len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
|
||||
|
||||
p = buf + len;
|
||||
p_maxlen = sizeof(buf) - len;
|
||||
|
||||
switch (cmd) {
|
||||
case BIO_CB_FREE:
|
||||
BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/bio/bio_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -96,6 +96,7 @@ static ERR_STRING_DATA BIO_str_functs[] = {
|
||||
{ERR_FUNC(BIO_F_CONN_CTRL), "CONN_CTRL"},
|
||||
{ERR_FUNC(BIO_F_CONN_STATE), "CONN_STATE"},
|
||||
{ERR_FUNC(BIO_F_DGRAM_SCTP_READ), "DGRAM_SCTP_READ"},
|
||||
{ERR_FUNC(BIO_F_DGRAM_SCTP_WRITE), "DGRAM_SCTP_WRITE"},
|
||||
{ERR_FUNC(BIO_F_FILE_CTRL), "FILE_CTRL"},
|
||||
{ERR_FUNC(BIO_F_FILE_READ), "FILE_READ"},
|
||||
{ERR_FUNC(BIO_F_LINEBUFFER_CTRL), "LINEBUFFER_CTRL"},
|
||||
|
@@ -536,8 +536,10 @@ BIO *BIO_dup_chain(BIO *in)
|
||||
|
||||
/* copy app data */
|
||||
if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new_bio->ex_data,
|
||||
&bio->ex_data))
|
||||
&bio->ex_data)) {
|
||||
BIO_free(new_bio);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (ret == NULL) {
|
||||
eoc = new_bio;
|
||||
@@ -549,8 +551,8 @@ BIO *BIO_dup_chain(BIO *in)
|
||||
}
|
||||
return (ret);
|
||||
err:
|
||||
if (ret != NULL)
|
||||
BIO_free(ret);
|
||||
BIO_free_all(ret);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
@@ -303,16 +303,17 @@ static void dgram_adjust_rcv_timeout(BIO *b)
|
||||
|
||||
/* Calculate time left until timer expires */
|
||||
memcpy(&timeleft, &(data->next_timeout), sizeof(struct timeval));
|
||||
timeleft.tv_sec -= timenow.tv_sec;
|
||||
timeleft.tv_usec -= timenow.tv_usec;
|
||||
if (timeleft.tv_usec < 0) {
|
||||
if (timeleft.tv_usec < timenow.tv_usec) {
|
||||
timeleft.tv_usec = 1000000 - timenow.tv_usec + timeleft.tv_usec;
|
||||
timeleft.tv_sec--;
|
||||
timeleft.tv_usec += 1000000;
|
||||
} else {
|
||||
timeleft.tv_usec -= timenow.tv_usec;
|
||||
}
|
||||
|
||||
if (timeleft.tv_sec < 0) {
|
||||
if (timeleft.tv_sec < timenow.tv_sec) {
|
||||
timeleft.tv_sec = 0;
|
||||
timeleft.tv_usec = 1;
|
||||
} else {
|
||||
timeleft.tv_sec -= timenow.tv_sec;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -896,7 +897,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
perror("setsockopt");
|
||||
ret = -1;
|
||||
}
|
||||
# elif defined(OPENSSL_SYS_LINUX) && defined(IP_MTUDISCOVER)
|
||||
# elif defined(OPENSSL_SYS_LINUX) && defined(IP_MTU_DISCOVER) && defined (IP_PMTUDISC_PROBE)
|
||||
if ((sockopt_val = num ? IP_PMTUDISC_PROBE : IP_PMTUDISC_DONT),
|
||||
(ret = setsockopt(b->num, IPPROTO_IP, IP_MTU_DISCOVER,
|
||||
&sockopt_val, sizeof(sockopt_val))) < 0) {
|
||||
@@ -1012,6 +1013,10 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag)
|
||||
*/
|
||||
sockopt_len = (socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
|
||||
authchunks = OPENSSL_malloc(sockopt_len);
|
||||
if (!authchunks) {
|
||||
BIO_vfree(bio);
|
||||
return (NULL);
|
||||
}
|
||||
memset(authchunks, 0, sizeof(sockopt_len));
|
||||
ret =
|
||||
getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks,
|
||||
@@ -1347,6 +1352,10 @@ static int dgram_sctp_read(BIO *b, char *out, int outl)
|
||||
optlen =
|
||||
(socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
|
||||
authchunks = OPENSSL_malloc(optlen);
|
||||
if (!authchunks) {
|
||||
BIOerr(BIO_F_DGRAM_SCTP_READ, ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
memset(authchunks, 0, sizeof(optlen));
|
||||
ii = getsockopt(b->num, IPPROTO_SCTP, SCTP_PEER_AUTH_CHUNKS,
|
||||
authchunks, &optlen);
|
||||
@@ -1413,10 +1422,15 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl)
|
||||
* yet, we have to save it and send it as soon as the socket gets dry.
|
||||
*/
|
||||
if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) {
|
||||
char *tmp;
|
||||
data->saved_message.bio = b;
|
||||
if (!(tmp = OPENSSL_malloc(inl))) {
|
||||
BIOerr(BIO_F_DGRAM_SCTP_WRITE, ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
if (data->saved_message.data)
|
||||
OPENSSL_free(data->saved_message.data);
|
||||
data->saved_message.data = OPENSSL_malloc(inl);
|
||||
data->saved_message.data = tmp;
|
||||
memcpy(data->saved_message.data, in, inl);
|
||||
data->saved_message.length = inl;
|
||||
return inl;
|
||||
|
@@ -108,8 +108,6 @@ x86_64-mont5.s: asm/x86_64-mont5.pl
|
||||
$(PERL) asm/x86_64-mont5.pl $(PERLASM_SCHEME) > $@
|
||||
x86_64-gf2m.s: asm/x86_64-gf2m.pl
|
||||
$(PERL) asm/x86_64-gf2m.pl $(PERLASM_SCHEME) > $@
|
||||
modexp512-x86_64.s: asm/modexp512-x86_64.pl
|
||||
$(PERL) asm/modexp512-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
rsaz-x86_64.s: asm/rsaz-x86_64.pl
|
||||
$(PERL) asm/rsaz-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
rsaz-avx2.s: asm/rsaz-avx2.pl
|
||||
@@ -178,6 +176,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: bn_prime.h depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -100,7 +100,7 @@ $code.=<<___;
|
||||
ld [$ap+12], $t3
|
||||
or $t0, $aj, $aj
|
||||
add $ap, 16, $ap
|
||||
stxa $aj, [$anp]0xe2 ! converted ap[0]
|
||||
stx $aj, [$anp] ! converted ap[0]
|
||||
|
||||
mulx $aj, $m0, $lo0 ! ap[0]*bp[0]
|
||||
umulxhi $aj, $m0, $hi0
|
||||
@@ -150,7 +150,7 @@ $code.=<<___;
|
||||
sllx $t1, 32, $aj
|
||||
add $ap, 8, $ap
|
||||
or $t0, $aj, $aj
|
||||
stxa $aj, [$anp]0xe2 ! converted ap[j]
|
||||
stx $aj, [$anp] ! converted ap[j]
|
||||
|
||||
ld [$np+0], $t2 ! np[j]
|
||||
addcc $nlo, $hi1, $lo1
|
||||
@@ -169,7 +169,7 @@ $code.=<<___;
|
||||
addcc $lo0, $lo1, $lo1 ! np[j]*m1+ap[j]*bp[0]
|
||||
umulxhi $nj, $m1, $nj ! nhi=nj
|
||||
addxc %g0, $hi1, $hi1
|
||||
stxa $lo1, [$tp]0xe2 ! tp[j-1]
|
||||
stx $lo1, [$tp] ! tp[j-1]
|
||||
add $tp, 8, $tp ! tp++
|
||||
|
||||
brnz,pt $cnt, .L1st
|
||||
@@ -182,12 +182,12 @@ $code.=<<___;
|
||||
addxc $nj, %g0, $hi1
|
||||
addcc $lo0, $lo1, $lo1 ! np[j]*m1+ap[j]*bp[0]
|
||||
addxc %g0, $hi1, $hi1
|
||||
stxa $lo1, [$tp]0xe2 ! tp[j-1]
|
||||
stx $lo1, [$tp] ! tp[j-1]
|
||||
add $tp, 8, $tp
|
||||
|
||||
addcc $hi0, $hi1, $hi1
|
||||
addxc %g0, %g0, $ovf ! upmost overflow bit
|
||||
stxa $hi1, [$tp]0xe2
|
||||
stx $hi1, [$tp]
|
||||
add $tp, 8, $tp
|
||||
|
||||
ba .Louter
|
||||
|
@@ -3226,11 +3226,16 @@ $code.=<<___;
|
||||
.type bn_get_bits5,\@abi-omnipotent
|
||||
.align 16
|
||||
bn_get_bits5:
|
||||
mov $inp,%r10
|
||||
lea 0($inp),%r10
|
||||
lea 1($inp),%r11
|
||||
mov $num,%ecx
|
||||
shr \$3,$num
|
||||
movzw (%r10,$num),%eax
|
||||
and \$7,%ecx
|
||||
shr \$4,$num
|
||||
and \$15,%ecx
|
||||
lea -8(%ecx),%eax
|
||||
cmp \$11,%ecx
|
||||
cmova %r11,%r10
|
||||
cmova %eax,%ecx
|
||||
movzw (%r10,$num,2),%eax
|
||||
shrl %cl,%eax
|
||||
and \$31,%eax
|
||||
ret
|
||||
|
@@ -779,6 +779,7 @@ int RAND_pseudo_bytes(unsigned char *buf, int num);
|
||||
* wouldn't be constructed with top!=dmax. */ \
|
||||
BN_ULONG *_not_const; \
|
||||
memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
|
||||
/* Debug only - safe to ignore error return */ \
|
||||
RAND_pseudo_bytes(&_tmp_char, 1); \
|
||||
memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
|
||||
(_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
|
||||
@@ -892,6 +893,7 @@ void ERR_load_BN_strings(void);
|
||||
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
|
||||
# define BN_F_BN_GF2M_MOD_SQR 136
|
||||
# define BN_F_BN_GF2M_MOD_SQRT 137
|
||||
# define BN_F_BN_LSHIFT 145
|
||||
# define BN_F_BN_MOD_EXP2_MONT 118
|
||||
# define BN_F_BN_MOD_EXP_MONT 109
|
||||
# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
|
||||
@@ -907,12 +909,14 @@ void ERR_load_BN_strings(void);
|
||||
# define BN_F_BN_NEW 113
|
||||
# define BN_F_BN_RAND 114
|
||||
# define BN_F_BN_RAND_RANGE 122
|
||||
# define BN_F_BN_RSHIFT 146
|
||||
# define BN_F_BN_USUB 115
|
||||
|
||||
/* Reason codes. */
|
||||
# define BN_R_ARG2_LT_ARG3 100
|
||||
# define BN_R_BAD_RECIPROCAL 101
|
||||
# define BN_R_BIGNUM_TOO_LONG 114
|
||||
# define BN_R_BITS_TOO_SMALL 118
|
||||
# define BN_R_CALLED_WITH_EVEN_MODULUS 102
|
||||
# define BN_R_DIV_BY_ZERO 103
|
||||
# define BN_R_ENCODING_ERROR 104
|
||||
@@ -920,6 +924,7 @@ void ERR_load_BN_strings(void);
|
||||
# define BN_R_INPUT_NOT_REDUCED 110
|
||||
# define BN_R_INVALID_LENGTH 106
|
||||
# define BN_R_INVALID_RANGE 115
|
||||
# define BN_R_INVALID_SHIFT 119
|
||||
# define BN_R_NOT_A_SQUARE 111
|
||||
# define BN_R_NOT_INITIALIZED 107
|
||||
# define BN_R_NO_INVERSE 108
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/bn/bn_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -94,6 +94,7 @@ static ERR_STRING_DATA BN_str_functs[] = {
|
||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR), "BN_GF2m_mod_solve_quad_arr"},
|
||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_SQR), "BN_GF2m_mod_sqr"},
|
||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_SQRT), "BN_GF2m_mod_sqrt"},
|
||||
{ERR_FUNC(BN_F_BN_LSHIFT), "BN_lshift"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_EXP2_MONT), "BN_mod_exp2_mont"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT), "BN_mod_exp_mont"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT_CONSTTIME), "BN_mod_exp_mont_consttime"},
|
||||
@@ -109,6 +110,7 @@ static ERR_STRING_DATA BN_str_functs[] = {
|
||||
{ERR_FUNC(BN_F_BN_NEW), "BN_new"},
|
||||
{ERR_FUNC(BN_F_BN_RAND), "BN_rand"},
|
||||
{ERR_FUNC(BN_F_BN_RAND_RANGE), "BN_rand_range"},
|
||||
{ERR_FUNC(BN_F_BN_RSHIFT), "BN_rshift"},
|
||||
{ERR_FUNC(BN_F_BN_USUB), "BN_usub"},
|
||||
{0, NULL}
|
||||
};
|
||||
@@ -117,6 +119,7 @@ static ERR_STRING_DATA BN_str_reasons[] = {
|
||||
{ERR_REASON(BN_R_ARG2_LT_ARG3), "arg2 lt arg3"},
|
||||
{ERR_REASON(BN_R_BAD_RECIPROCAL), "bad reciprocal"},
|
||||
{ERR_REASON(BN_R_BIGNUM_TOO_LONG), "bignum too long"},
|
||||
{ERR_REASON(BN_R_BITS_TOO_SMALL), "bits too small"},
|
||||
{ERR_REASON(BN_R_CALLED_WITH_EVEN_MODULUS), "called with even modulus"},
|
||||
{ERR_REASON(BN_R_DIV_BY_ZERO), "div by zero"},
|
||||
{ERR_REASON(BN_R_ENCODING_ERROR), "encoding error"},
|
||||
@@ -125,6 +128,7 @@ static ERR_STRING_DATA BN_str_reasons[] = {
|
||||
{ERR_REASON(BN_R_INPUT_NOT_REDUCED), "input not reduced"},
|
||||
{ERR_REASON(BN_R_INVALID_LENGTH), "invalid length"},
|
||||
{ERR_REASON(BN_R_INVALID_RANGE), "invalid range"},
|
||||
{ERR_REASON(BN_R_INVALID_SHIFT), "invalid shift"},
|
||||
{ERR_REASON(BN_R_NOT_A_SQUARE), "not a square"},
|
||||
{ERR_REASON(BN_R_NOT_INITIALIZED), "not initialized"},
|
||||
{ERR_REASON(BN_R_NO_INVERSE), "no inverse"},
|
||||
|
@@ -185,10 +185,10 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
ret = 1;
|
||||
err:
|
||||
if (r != rr)
|
||||
BN_copy(r, rr);
|
||||
ret = 1;
|
||||
err:
|
||||
BN_CTX_end(ctx);
|
||||
bn_check_top(r);
|
||||
return (ret);
|
||||
|
@@ -450,8 +450,7 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])
|
||||
d0 = p[k] % BN_BITS2;
|
||||
d1 = BN_BITS2 - d0;
|
||||
z[n] ^= (zz << d0);
|
||||
tmp_ulong = zz >> d1;
|
||||
if (d0 && tmp_ulong)
|
||||
if (d0 && (tmp_ulong = zz >> d1))
|
||||
z[n + 1] ^= tmp_ulong;
|
||||
}
|
||||
|
||||
@@ -694,9 +693,10 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
||||
}
|
||||
# else
|
||||
{
|
||||
int i, ubits = BN_num_bits(u), vbits = BN_num_bits(v), /* v is copy
|
||||
* of p */
|
||||
top = p->top;
|
||||
int i;
|
||||
int ubits = BN_num_bits(u);
|
||||
int vbits = BN_num_bits(v); /* v is copy of p */
|
||||
int top = p->top;
|
||||
BN_ULONG *udp, *bdp, *vdp, *cdp;
|
||||
|
||||
bn_wexpand(u, top);
|
||||
@@ -740,8 +740,12 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
||||
ubits--;
|
||||
}
|
||||
|
||||
if (ubits <= BN_BITS2 && udp[0] == 1)
|
||||
break;
|
||||
if (ubits <= BN_BITS2) {
|
||||
if (udp[0] == 0) /* poly was reducible */
|
||||
goto err;
|
||||
if (udp[0] == 1)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ubits < vbits) {
|
||||
i = ubits;
|
||||
|
@@ -294,7 +294,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
|
||||
# endif
|
||||
# elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG))
|
||||
# if defined(__GNUC__) && __GNUC__>=2
|
||||
# if __GNUC__>=4 && __GNUC_MINOR__>=4
|
||||
# if __GNUC__>4 || (__GNUC__>=4 && __GNUC_MINOR__>=4)
|
||||
/* "h" constraint is no more since 4.4 */
|
||||
# define BN_UMULT_HIGH(a,b) (((__uint128_t)(a)*(b))>>64)
|
||||
# define BN_UMULT_LOHI(low,high,a,b) ({ \
|
||||
|
@@ -71,7 +71,12 @@ char *BN_bn2hex(const BIGNUM *a)
|
||||
char *buf;
|
||||
char *p;
|
||||
|
||||
buf = (char *)OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
|
||||
if (a->neg && BN_is_zero(a)) {
|
||||
/* "-0" == 3 bytes including NULL terminator */
|
||||
buf = OPENSSL_malloc(3);
|
||||
} else {
|
||||
buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
|
||||
}
|
||||
if (buf == NULL) {
|
||||
BNerr(BN_F_BN_BN2HEX, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
|
@@ -121,6 +121,11 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
|
||||
int ret = 0, bit, bytes, mask;
|
||||
time_t tim;
|
||||
|
||||
if (bits < 0 || (bits == 1 && top > 0)) {
|
||||
BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bits == 0) {
|
||||
BN_zero(rnd);
|
||||
return 1;
|
||||
@@ -157,7 +162,8 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
|
||||
unsigned char c;
|
||||
|
||||
for (i = 0; i < bytes; i++) {
|
||||
RAND_pseudo_bytes(&c, 1);
|
||||
if (RAND_pseudo_bytes(&c, 1) < 0)
|
||||
goto err;
|
||||
if (c >= 128 && i > 0)
|
||||
buf[i] = buf[i - 1];
|
||||
else if (c < 42)
|
||||
@@ -168,7 +174,7 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (top != -1) {
|
||||
if (top >= 0) {
|
||||
if (top) {
|
||||
if (bit == 0) {
|
||||
buf[0] = 1;
|
||||
|
@@ -137,6 +137,11 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
|
||||
bn_check_top(r);
|
||||
bn_check_top(a);
|
||||
|
||||
if (n < 0) {
|
||||
BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
r->neg = a->neg;
|
||||
nw = n / BN_BITS2;
|
||||
if (bn_wexpand(r, a->top + nw + 1) == NULL)
|
||||
@@ -174,6 +179,11 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
|
||||
bn_check_top(r);
|
||||
bn_check_top(a);
|
||||
|
||||
if (n < 0) {
|
||||
BNerr(BN_F_BN_RSHIFT, BN_R_INVALID_SHIFT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
nw = n / BN_BITS2;
|
||||
rb = n % BN_BITS2;
|
||||
lb = BN_BITS2 - rb;
|
||||
|
@@ -61,6 +61,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -88,7 +88,7 @@ void BUF_MEM_free(BUF_MEM *a)
|
||||
return;
|
||||
|
||||
if (a->data != NULL) {
|
||||
memset(a->data, 0, (unsigned int)a->max);
|
||||
OPENSSL_cleanse(a->data, a->max);
|
||||
OPENSSL_free(a->data);
|
||||
}
|
||||
OPENSSL_free(a);
|
||||
|
@@ -48,7 +48,7 @@ cmll-x86.s: asm/cmll-x86.pl ../perlasm/x86asm.pl
|
||||
$(PERL) asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
||||
cmll-x86_64.s: asm/cmll-x86_64.pl
|
||||
$(PERL) asm/cmll-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
cmllt4-sparcv9.s: asm/cmllt4-sparcv9.pl
|
||||
cmllt4-sparcv9.s: asm/cmllt4-sparcv9.pl ../perlasm/sparcv9_modes.pl
|
||||
$(PERL) asm/cmllt4-sparcv9.pl $(CFLAGS) > $@
|
||||
|
||||
files:
|
||||
@@ -75,6 +75,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -69,6 +69,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -61,6 +61,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -126,6 +126,8 @@ EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx)
|
||||
|
||||
void CMAC_CTX_free(CMAC_CTX *ctx)
|
||||
{
|
||||
if (!ctx)
|
||||
return;
|
||||
CMAC_CTX_cleanup(ctx);
|
||||
OPENSSL_free(ctx);
|
||||
}
|
||||
|
@@ -67,6 +67,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -66,6 +66,7 @@
|
||||
DECLARE_ASN1_ITEM(CMS_KeyAgreeRecipientInfo)
|
||||
DECLARE_ASN1_ITEM(CMS_RecipientEncryptedKey)
|
||||
DECLARE_ASN1_ITEM(CMS_OriginatorPublicKey)
|
||||
DECLARE_ASN1_ITEM(CMS_RecipientKeyIdentifier)
|
||||
|
||||
/* Key Agreement Recipient Info (KARI) routines */
|
||||
|
||||
@@ -362,6 +363,9 @@ int cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip,
|
||||
|
||||
if (flags & CMS_USE_KEYID) {
|
||||
rek->rid->type = CMS_REK_KEYIDENTIFIER;
|
||||
rek->rid->d.rKeyId = M_ASN1_new_of(CMS_RecipientKeyIdentifier);
|
||||
if (rek->rid->d.rKeyId == NULL)
|
||||
return 0;
|
||||
if (!cms_set1_keyid(&rek->rid->d.rKeyId->subjectKeyIdentifier, recip))
|
||||
return 0;
|
||||
} else {
|
||||
|
@@ -231,6 +231,8 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen,
|
||||
return 0;
|
||||
}
|
||||
tmp = OPENSSL_malloc(inlen);
|
||||
if (!tmp)
|
||||
return 0;
|
||||
/* setup IV by decrypting last two blocks */
|
||||
EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
|
||||
in + inlen - 2 * blocklen, blocklen * 2);
|
||||
@@ -295,8 +297,9 @@ static int kek_wrap_key(unsigned char *out, size_t *outlen,
|
||||
out[3] = in[2] ^ 0xFF;
|
||||
memcpy(out + 4, in, inlen);
|
||||
/* Add random padding to end */
|
||||
if (olen > inlen + 4)
|
||||
RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen);
|
||||
if (olen > inlen + 4
|
||||
&& RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen) < 0)
|
||||
return 0;
|
||||
/* Encrypt twice */
|
||||
EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
|
||||
EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
|
||||
|
@@ -132,7 +132,7 @@ static void do_free_upto(BIO *f, BIO *upto)
|
||||
BIO_free(f);
|
||||
f = tbio;
|
||||
}
|
||||
while (f != upto);
|
||||
while (f && f != upto);
|
||||
} else
|
||||
BIO_free_all(f);
|
||||
}
|
||||
|
@@ -64,6 +64,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
|
||||
|
@@ -64,6 +64,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
|
||||
|
@@ -585,7 +585,11 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
|
||||
CONFerr(CONF_F_STR_COPY, CONF_R_VARIABLE_HAS_NO_VALUE);
|
||||
goto err;
|
||||
}
|
||||
BUF_MEM_grow_clean(buf, (strlen(p) + buf->length - (e - from)));
|
||||
if (!BUF_MEM_grow_clean(buf,
|
||||
(strlen(p) + buf->length - (e - from)))) {
|
||||
CONFerr(CONF_F_STR_COPY, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
while (*p)
|
||||
buf->data[to++] = *(p++);
|
||||
|
||||
|
@@ -86,23 +86,10 @@ void OPENSSL_config(const char *config_name)
|
||||
/* Need to load ENGINEs */
|
||||
ENGINE_load_builtin_engines();
|
||||
#endif
|
||||
/* Add others here? */
|
||||
|
||||
ERR_clear_error();
|
||||
if (CONF_modules_load_file(NULL, config_name,
|
||||
CONF_modules_load_file(NULL, config_name,
|
||||
CONF_MFLAGS_DEFAULT_SECTION |
|
||||
CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) {
|
||||
BIO *bio_err;
|
||||
ERR_load_crypto_strings();
|
||||
if ((bio_err = BIO_new_fp(stderr, BIO_NOCLOSE)) != NULL) {
|
||||
BIO_printf(bio_err, "Auto configuration failed\n");
|
||||
ERR_print_errors(bio_err);
|
||||
BIO_free(bio_err);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return;
|
||||
CONF_MFLAGS_IGNORE_MISSING_FILE);
|
||||
}
|
||||
|
||||
void OPENSSL_no_config()
|
||||
|
@@ -825,8 +825,6 @@ int OPENSSL_isservice(void)
|
||||
if (_OPENSSL_isservice.p != (void *)-1)
|
||||
return (*_OPENSSL_isservice.f) ();
|
||||
|
||||
(void)GetDesktopWindow(); /* return value is ignored */
|
||||
|
||||
h = GetProcessWindowStation();
|
||||
if (h == NULL)
|
||||
return -1;
|
||||
|
@@ -96,6 +96,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -455,8 +455,10 @@ void doencryption(void)
|
||||
rem = l % 8;
|
||||
len = l - rem;
|
||||
if (feof(DES_IN)) {
|
||||
for (i = 7 - rem; i > 0; i--)
|
||||
RAND_pseudo_bytes(buf + l++, 1);
|
||||
for (i = 7 - rem; i > 0; i--) {
|
||||
if (RAND_pseudo_bytes(buf + l++, 1) < 0)
|
||||
goto problems;
|
||||
}
|
||||
buf[l++] = rem;
|
||||
ex = 1;
|
||||
len += rem;
|
||||
|
@@ -96,6 +96,9 @@ int DES_enc_write(int fd, const void *_buf, int len,
|
||||
const unsigned char *cp;
|
||||
static int start = 1;
|
||||
|
||||
if (len < 0)
|
||||
return -1;
|
||||
|
||||
if (outbuf == NULL) {
|
||||
outbuf = OPENSSL_malloc(BSIZE + HDRSIZE);
|
||||
if (outbuf == NULL)
|
||||
@@ -132,7 +135,9 @@ int DES_enc_write(int fd, const void *_buf, int len,
|
||||
if (len < 8) {
|
||||
cp = shortbuf;
|
||||
memcpy(shortbuf, buf, len);
|
||||
RAND_pseudo_bytes(shortbuf + len, 8 - len);
|
||||
if (RAND_pseudo_bytes(shortbuf + len, 8 - len) < 0) {
|
||||
return -1;
|
||||
}
|
||||
rnum = 8;
|
||||
} else {
|
||||
cp = buf;
|
||||
|
327
crypto/des/spr.h
327
crypto/des/spr.h
@@ -58,180 +58,155 @@
|
||||
|
||||
OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64] = {
|
||||
{
|
||||
/* nibble 0 */
|
||||
0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
|
||||
0x02000000L, 0x00080802L, 0x00080002L, 0x02000002L,
|
||||
0x00080802L, 0x02080800L, 0x02080000L, 0x00000802L,
|
||||
0x02000802L, 0x02000000L, 0x00000000L, 0x00080002L,
|
||||
0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L,
|
||||
0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L,
|
||||
0x00000002L, 0x00000800L, 0x00080800L, 0x02080002L,
|
||||
0x00000800L, 0x02000802L, 0x02080002L, 0x00000000L,
|
||||
0x00000000L, 0x02080802L, 0x02000800L, 0x00080002L,
|
||||
0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L,
|
||||
0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L,
|
||||
0x00080802L, 0x00000002L, 0x02000002L, 0x02080000L,
|
||||
0x02080802L, 0x00080800L, 0x02080000L, 0x02000802L,
|
||||
0x02000000L, 0x00000802L, 0x00080002L, 0x00000000L,
|
||||
0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L,
|
||||
0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L,
|
||||
}, {
|
||||
/* nibble 1 */
|
||||
0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L,
|
||||
0x40000010L, 0x00008010L, 0x40008000L, 0x00108000L,
|
||||
0x00008000L, 0x40100010L, 0x00000010L, 0x40008000L,
|
||||
0x00100010L, 0x40108000L, 0x40100000L, 0x00000010L,
|
||||
0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L,
|
||||
0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L,
|
||||
0x40008010L, 0x00108010L, 0x40108000L, 0x40000010L,
|
||||
0x40000000L, 0x00100000L, 0x00008010L, 0x40108010L,
|
||||
0x00100010L, 0x40108000L, 0x40008000L, 0x00108010L,
|
||||
0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L,
|
||||
0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L,
|
||||
0x00008000L, 0x40000000L, 0x00108010L, 0x40008010L,
|
||||
0x40108000L, 0x00008000L, 0x00000000L, 0x40000010L,
|
||||
0x00000010L, 0x40108010L, 0x00108000L, 0x40100000L,
|
||||
0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L,
|
||||
0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L,
|
||||
}, {
|
||||
/* nibble 2 */
|
||||
0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L,
|
||||
0x00040001L, 0x04000000L, 0x04000101L, 0x00040100L,
|
||||
0x04000100L, 0x00040000L, 0x04040000L, 0x00000001L,
|
||||
0x04040101L, 0x00000101L, 0x00000001L, 0x04040001L,
|
||||
0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L,
|
||||
0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L,
|
||||
0x04040001L, 0x04000100L, 0x00040101L, 0x04040000L,
|
||||
0x00040100L, 0x00000000L, 0x04000000L, 0x00040101L,
|
||||
0x04040100L, 0x00000100L, 0x00000001L, 0x00040000L,
|
||||
0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L,
|
||||
0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L,
|
||||
0x00040001L, 0x04000000L, 0x04040101L, 0x00000001L,
|
||||
0x00040101L, 0x04000001L, 0x04000000L, 0x04040101L,
|
||||
0x00040000L, 0x04000100L, 0x04000101L, 0x00040100L,
|
||||
0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L,
|
||||
0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L,
|
||||
}, {
|
||||
/* nibble 3 */
|
||||
0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L,
|
||||
0x00000000L, 0x10400000L, 0x10001008L, 0x00400008L,
|
||||
0x10401000L, 0x10000008L, 0x10000000L, 0x00001008L,
|
||||
0x10000008L, 0x00401008L, 0x00400000L, 0x10000000L,
|
||||
0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L,
|
||||
0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L,
|
||||
0x00001008L, 0x00000000L, 0x00400008L, 0x10401000L,
|
||||
0x10001000L, 0x10400008L, 0x10401008L, 0x00400000L,
|
||||
0x10400008L, 0x00001008L, 0x00400000L, 0x10000008L,
|
||||
0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L,
|
||||
0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L,
|
||||
0x00000000L, 0x10400008L, 0x10401000L, 0x00001000L,
|
||||
0x10000000L, 0x10401008L, 0x00401008L, 0x00400000L,
|
||||
0x10401008L, 0x00000008L, 0x10001000L, 0x00401008L,
|
||||
0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L,
|
||||
0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L,
|
||||
}, {
|
||||
/* nibble 4 */
|
||||
0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L,
|
||||
0x08010020L, 0x08000400L, 0x00010420L, 0x08010000L,
|
||||
0x00010000L, 0x00000020L, 0x08000020L, 0x00010400L,
|
||||
0x08000420L, 0x08010020L, 0x08010400L, 0x00000000L,
|
||||
0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L,
|
||||
0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L,
|
||||
0x00000020L, 0x08000420L, 0x08010420L, 0x00010020L,
|
||||
0x08010000L, 0x00000400L, 0x00000420L, 0x08010400L,
|
||||
0x08010400L, 0x08000420L, 0x00010020L, 0x08010000L,
|
||||
0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L,
|
||||
0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L,
|
||||
0x00010420L, 0x08000000L, 0x00000400L, 0x00010020L,
|
||||
0x08000420L, 0x00000400L, 0x00000000L, 0x08010420L,
|
||||
0x08010020L, 0x08010400L, 0x00000420L, 0x00010000L,
|
||||
0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L,
|
||||
0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L,
|
||||
}, {
|
||||
/* nibble 5 */
|
||||
0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L,
|
||||
0x00200040L, 0x00002000L, 0x80002040L, 0x00200000L,
|
||||
0x00002040L, 0x80202040L, 0x00202000L, 0x80000000L,
|
||||
0x80002000L, 0x80000040L, 0x80200000L, 0x00202040L,
|
||||
0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L,
|
||||
0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L,
|
||||
0x80202040L, 0x80200000L, 0x80000000L, 0x00002040L,
|
||||
0x00000040L, 0x00202000L, 0x00202040L, 0x80002000L,
|
||||
0x00002040L, 0x80000000L, 0x80002000L, 0x00202040L,
|
||||
0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L,
|
||||
0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L,
|
||||
0x00200040L, 0x80202040L, 0x00202000L, 0x00000040L,
|
||||
0x80202040L, 0x00202000L, 0x00200000L, 0x80002040L,
|
||||
0x80000040L, 0x80200000L, 0x00202040L, 0x00000000L,
|
||||
0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L,
|
||||
0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L,
|
||||
}, {
|
||||
/* nibble 6 */
|
||||
0x00004000L, 0x00000200L, 0x01000200L,
|
||||
0x01000004L,
|
||||
0x01004204L, 0x00004004L, 0x00004200L,
|
||||
0x00000000L,
|
||||
0x01000000L, 0x01000204L, 0x00000204L,
|
||||
0x01004000L,
|
||||
0x00000004L, 0x01004200L, 0x01004000L,
|
||||
0x00000204L,
|
||||
0x01000204L, 0x00004000L, 0x00004004L,
|
||||
0x01004204L,
|
||||
0x00000000L, 0x01000200L, 0x01000004L,
|
||||
0x00004200L,
|
||||
0x01004004L, 0x00004204L, 0x01004200L,
|
||||
0x00000004L,
|
||||
0x00004204L, 0x01004004L, 0x00000200L,
|
||||
0x01000000L,
|
||||
0x00004204L, 0x01004000L, 0x01004004L,
|
||||
0x00000204L,
|
||||
0x00004000L, 0x00000200L, 0x01000000L,
|
||||
0x01004004L,
|
||||
0x01000204L, 0x00004204L, 0x00004200L,
|
||||
0x00000000L,
|
||||
0x00000200L, 0x01000004L, 0x00000004L,
|
||||
0x01000200L,
|
||||
0x00000000L, 0x01000204L, 0x01000200L,
|
||||
0x00004200L,
|
||||
0x00000204L, 0x00004000L, 0x01004204L,
|
||||
0x01000000L,
|
||||
0x01004200L, 0x00000004L, 0x00004004L,
|
||||
0x01004204L,
|
||||
0x01000004L, 0x01004200L, 0x01004000L,
|
||||
0x00004004L,
|
||||
}, {
|
||||
/* nibble 7 */
|
||||
0x20800080L, 0x20820000L, 0x00020080L,
|
||||
0x00000000L,
|
||||
0x20020000L, 0x00800080L, 0x20800000L,
|
||||
0x20820080L,
|
||||
0x00000080L, 0x20000000L, 0x00820000L,
|
||||
0x00020080L,
|
||||
0x00820080L, 0x20020080L, 0x20000080L,
|
||||
0x20800000L,
|
||||
0x00020000L, 0x00820080L, 0x00800080L,
|
||||
0x20020000L,
|
||||
0x20820080L, 0x20000080L, 0x00000000L,
|
||||
0x00820000L,
|
||||
0x20000000L, 0x00800000L, 0x20020080L,
|
||||
0x20800080L,
|
||||
0x00800000L, 0x00020000L, 0x20820000L,
|
||||
0x00000080L,
|
||||
0x00800000L, 0x00020000L, 0x20000080L,
|
||||
0x20820080L,
|
||||
0x00020080L, 0x20000000L, 0x00000000L,
|
||||
0x00820000L,
|
||||
0x20800080L, 0x20020080L, 0x20020000L,
|
||||
0x00800080L,
|
||||
0x20820000L, 0x00000080L, 0x00800080L,
|
||||
0x20020000L,
|
||||
0x20820080L, 0x00800000L, 0x20800000L,
|
||||
0x20000080L,
|
||||
0x00820000L, 0x00020080L, 0x20020080L,
|
||||
0x20800000L,
|
||||
0x00000080L, 0x20820000L, 0x00820080L,
|
||||
0x00000000L,
|
||||
0x20000000L, 0x20800080L, 0x00020000L,
|
||||
0x00820080L,
|
||||
}
|
||||
/* nibble 0 */
|
||||
0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
|
||||
0x02000000L, 0x00080802L, 0x00080002L, 0x02000002L,
|
||||
0x00080802L, 0x02080800L, 0x02080000L, 0x00000802L,
|
||||
0x02000802L, 0x02000000L, 0x00000000L, 0x00080002L,
|
||||
0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L,
|
||||
0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L,
|
||||
0x00000002L, 0x00000800L, 0x00080800L, 0x02080002L,
|
||||
0x00000800L, 0x02000802L, 0x02080002L, 0x00000000L,
|
||||
0x00000000L, 0x02080802L, 0x02000800L, 0x00080002L,
|
||||
0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L,
|
||||
0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L,
|
||||
0x00080802L, 0x00000002L, 0x02000002L, 0x02080000L,
|
||||
0x02080802L, 0x00080800L, 0x02080000L, 0x02000802L,
|
||||
0x02000000L, 0x00000802L, 0x00080002L, 0x00000000L,
|
||||
0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L,
|
||||
0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L,
|
||||
},
|
||||
{
|
||||
/* nibble 1 */
|
||||
0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L,
|
||||
0x40000010L, 0x00008010L, 0x40008000L, 0x00108000L,
|
||||
0x00008000L, 0x40100010L, 0x00000010L, 0x40008000L,
|
||||
0x00100010L, 0x40108000L, 0x40100000L, 0x00000010L,
|
||||
0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L,
|
||||
0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L,
|
||||
0x40008010L, 0x00108010L, 0x40108000L, 0x40000010L,
|
||||
0x40000000L, 0x00100000L, 0x00008010L, 0x40108010L,
|
||||
0x00100010L, 0x40108000L, 0x40008000L, 0x00108010L,
|
||||
0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L,
|
||||
0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L,
|
||||
0x00008000L, 0x40000000L, 0x00108010L, 0x40008010L,
|
||||
0x40108000L, 0x00008000L, 0x00000000L, 0x40000010L,
|
||||
0x00000010L, 0x40108010L, 0x00108000L, 0x40100000L,
|
||||
0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L,
|
||||
0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L,
|
||||
},
|
||||
{
|
||||
/* nibble 2 */
|
||||
0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L,
|
||||
0x00040001L, 0x04000000L, 0x04000101L, 0x00040100L,
|
||||
0x04000100L, 0x00040000L, 0x04040000L, 0x00000001L,
|
||||
0x04040101L, 0x00000101L, 0x00000001L, 0x04040001L,
|
||||
0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L,
|
||||
0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L,
|
||||
0x04040001L, 0x04000100L, 0x00040101L, 0x04040000L,
|
||||
0x00040100L, 0x00000000L, 0x04000000L, 0x00040101L,
|
||||
0x04040100L, 0x00000100L, 0x00000001L, 0x00040000L,
|
||||
0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L,
|
||||
0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L,
|
||||
0x00040001L, 0x04000000L, 0x04040101L, 0x00000001L,
|
||||
0x00040101L, 0x04000001L, 0x04000000L, 0x04040101L,
|
||||
0x00040000L, 0x04000100L, 0x04000101L, 0x00040100L,
|
||||
0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L,
|
||||
0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L,
|
||||
},
|
||||
{
|
||||
/* nibble 3 */
|
||||
0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L,
|
||||
0x00000000L, 0x10400000L, 0x10001008L, 0x00400008L,
|
||||
0x10401000L, 0x10000008L, 0x10000000L, 0x00001008L,
|
||||
0x10000008L, 0x00401008L, 0x00400000L, 0x10000000L,
|
||||
0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L,
|
||||
0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L,
|
||||
0x00001008L, 0x00000000L, 0x00400008L, 0x10401000L,
|
||||
0x10001000L, 0x10400008L, 0x10401008L, 0x00400000L,
|
||||
0x10400008L, 0x00001008L, 0x00400000L, 0x10000008L,
|
||||
0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L,
|
||||
0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L,
|
||||
0x00000000L, 0x10400008L, 0x10401000L, 0x00001000L,
|
||||
0x10000000L, 0x10401008L, 0x00401008L, 0x00400000L,
|
||||
0x10401008L, 0x00000008L, 0x10001000L, 0x00401008L,
|
||||
0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L,
|
||||
0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L,
|
||||
},
|
||||
{
|
||||
/* nibble 4 */
|
||||
0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L,
|
||||
0x08010020L, 0x08000400L, 0x00010420L, 0x08010000L,
|
||||
0x00010000L, 0x00000020L, 0x08000020L, 0x00010400L,
|
||||
0x08000420L, 0x08010020L, 0x08010400L, 0x00000000L,
|
||||
0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L,
|
||||
0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L,
|
||||
0x00000020L, 0x08000420L, 0x08010420L, 0x00010020L,
|
||||
0x08010000L, 0x00000400L, 0x00000420L, 0x08010400L,
|
||||
0x08010400L, 0x08000420L, 0x00010020L, 0x08010000L,
|
||||
0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L,
|
||||
0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L,
|
||||
0x00010420L, 0x08000000L, 0x00000400L, 0x00010020L,
|
||||
0x08000420L, 0x00000400L, 0x00000000L, 0x08010420L,
|
||||
0x08010020L, 0x08010400L, 0x00000420L, 0x00010000L,
|
||||
0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L,
|
||||
0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L,
|
||||
},
|
||||
{
|
||||
/* nibble 5 */
|
||||
0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L,
|
||||
0x00200040L, 0x00002000L, 0x80002040L, 0x00200000L,
|
||||
0x00002040L, 0x80202040L, 0x00202000L, 0x80000000L,
|
||||
0x80002000L, 0x80000040L, 0x80200000L, 0x00202040L,
|
||||
0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L,
|
||||
0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L,
|
||||
0x80202040L, 0x80200000L, 0x80000000L, 0x00002040L,
|
||||
0x00000040L, 0x00202000L, 0x00202040L, 0x80002000L,
|
||||
0x00002040L, 0x80000000L, 0x80002000L, 0x00202040L,
|
||||
0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L,
|
||||
0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L,
|
||||
0x00200040L, 0x80202040L, 0x00202000L, 0x00000040L,
|
||||
0x80202040L, 0x00202000L, 0x00200000L, 0x80002040L,
|
||||
0x80000040L, 0x80200000L, 0x00202040L, 0x00000000L,
|
||||
0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L,
|
||||
0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L,
|
||||
},
|
||||
{
|
||||
/* nibble 6 */
|
||||
0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L,
|
||||
0x01004204L, 0x00004004L, 0x00004200L, 0x00000000L,
|
||||
0x01000000L, 0x01000204L, 0x00000204L, 0x01004000L,
|
||||
0x00000004L, 0x01004200L, 0x01004000L, 0x00000204L,
|
||||
0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L,
|
||||
0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L,
|
||||
0x01004004L, 0x00004204L, 0x01004200L, 0x00000004L,
|
||||
0x00004204L, 0x01004004L, 0x00000200L, 0x01000000L,
|
||||
0x00004204L, 0x01004000L, 0x01004004L, 0x00000204L,
|
||||
0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L,
|
||||
0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L,
|
||||
0x00000200L, 0x01000004L, 0x00000004L, 0x01000200L,
|
||||
0x00000000L, 0x01000204L, 0x01000200L, 0x00004200L,
|
||||
0x00000204L, 0x00004000L, 0x01004204L, 0x01000000L,
|
||||
0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L,
|
||||
0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L,
|
||||
},
|
||||
{
|
||||
/* nibble 7 */
|
||||
0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L,
|
||||
0x20020000L, 0x00800080L, 0x20800000L, 0x20820080L,
|
||||
0x00000080L, 0x20000000L, 0x00820000L, 0x00020080L,
|
||||
0x00820080L, 0x20020080L, 0x20000080L, 0x20800000L,
|
||||
0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L,
|
||||
0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L,
|
||||
0x20000000L, 0x00800000L, 0x20020080L, 0x20800080L,
|
||||
0x00800000L, 0x00020000L, 0x20820000L, 0x00000080L,
|
||||
0x00800000L, 0x00020000L, 0x20000080L, 0x20820080L,
|
||||
0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L,
|
||||
0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L,
|
||||
0x20820000L, 0x00000080L, 0x00800080L, 0x20020000L,
|
||||
0x20820080L, 0x00800000L, 0x20800000L, 0x20000080L,
|
||||
0x00820000L, 0x00020080L, 0x20020080L, 0x20800000L,
|
||||
0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L,
|
||||
0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L,
|
||||
}
|
||||
};
|
||||
|
@@ -63,6 +63,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -151,7 +151,6 @@ static int dh_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
|
||||
static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
|
||||
{
|
||||
DH *dh;
|
||||
void *pval = NULL;
|
||||
int ptype;
|
||||
unsigned char *penc = NULL;
|
||||
int penclen;
|
||||
@@ -161,12 +160,15 @@ static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
|
||||
dh = pkey->pkey.dh;
|
||||
|
||||
str = ASN1_STRING_new();
|
||||
if (!str) {
|
||||
DHerr(DH_F_DH_PUB_ENCODE, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
str->length = i2d_dhp(pkey, dh, &str->data);
|
||||
if (str->length <= 0) {
|
||||
DHerr(DH_F_DH_PUB_ENCODE, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
pval = str;
|
||||
ptype = V_ASN1_SEQUENCE;
|
||||
|
||||
pub_key = BN_to_ASN1_INTEGER(dh->pub_key, NULL);
|
||||
@@ -183,14 +185,14 @@ static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
|
||||
}
|
||||
|
||||
if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(pkey->ameth->pkey_id),
|
||||
ptype, pval, penc, penclen))
|
||||
ptype, str, penc, penclen))
|
||||
return 1;
|
||||
|
||||
err:
|
||||
if (penc)
|
||||
OPENSSL_free(penc);
|
||||
if (pval)
|
||||
ASN1_STRING_free(pval);
|
||||
if (str)
|
||||
ASN1_STRING_free(str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -240,7 +242,7 @@ static int dh_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
|
||||
|
||||
EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh);
|
||||
|
||||
ASN1_INTEGER_free(privkey);
|
||||
ASN1_STRING_clear_free(privkey);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -248,6 +250,7 @@ static int dh_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
|
||||
DHerr(DH_F_DH_PRIV_DECODE, EVP_R_DECODE_ERROR);
|
||||
dherr:
|
||||
DH_free(dh);
|
||||
ASN1_STRING_clear_free(privkey);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -282,7 +285,8 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
|
||||
dplen = i2d_ASN1_INTEGER(prkey, &dp);
|
||||
|
||||
ASN1_INTEGER_free(prkey);
|
||||
ASN1_STRING_clear_free(prkey);
|
||||
prkey = NULL;
|
||||
|
||||
if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0,
|
||||
V_ASN1_SEQUENCE, params, dp, dplen))
|
||||
@@ -296,7 +300,7 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
if (params != NULL)
|
||||
ASN1_STRING_free(params);
|
||||
if (prkey != NULL)
|
||||
ASN1_INTEGER_free(prkey);
|
||||
ASN1_STRING_clear_free(prkey);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -462,6 +462,9 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
|
||||
ret = 0;
|
||||
Zlen = DH_size(dh);
|
||||
Z = OPENSSL_malloc(Zlen);
|
||||
if (!Z) {
|
||||
goto err;
|
||||
}
|
||||
if (DH_compute_key_padded(Z, dhpub, dh) <= 0)
|
||||
goto err;
|
||||
if (!DH_KDF_X9_42(key, *keylen, Z, Zlen, dctx->kdf_oid,
|
||||
|
@@ -63,6 +63,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
@@ -129,21 +129,23 @@ static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
|
||||
static int dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
|
||||
{
|
||||
DSA *dsa;
|
||||
void *pval = NULL;
|
||||
int ptype;
|
||||
unsigned char *penc = NULL;
|
||||
int penclen;
|
||||
ASN1_STRING *str = NULL;
|
||||
|
||||
dsa = pkey->pkey.dsa;
|
||||
if (pkey->save_parameters && dsa->p && dsa->q && dsa->g) {
|
||||
ASN1_STRING *str;
|
||||
str = ASN1_STRING_new();
|
||||
if (!str) {
|
||||
DSAerr(DSA_F_DSA_PUB_ENCODE, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
str->length = i2d_DSAparams(dsa, &str->data);
|
||||
if (str->length <= 0) {
|
||||
DSAerr(DSA_F_DSA_PUB_ENCODE, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
pval = str;
|
||||
ptype = V_ASN1_SEQUENCE;
|
||||
} else
|
||||
ptype = V_ASN1_UNDEF;
|
||||
@@ -158,14 +160,14 @@ static int dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
|
||||
}
|
||||
|
||||
if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_DSA),
|
||||
ptype, pval, penc, penclen))
|
||||
ptype, str, penc, penclen))
|
||||
return 1;
|
||||
|
||||
err:
|
||||
if (penc)
|
||||
OPENSSL_free(penc);
|
||||
if (pval)
|
||||
ASN1_STRING_free(pval);
|
||||
if (str)
|
||||
ASN1_STRING_free(str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -226,7 +228,7 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
|
||||
goto decerr;
|
||||
if (privkey->type == V_ASN1_NEG_INTEGER) {
|
||||
p8->broken = PKCS8_NEG_PRIVKEY;
|
||||
ASN1_INTEGER_free(privkey);
|
||||
ASN1_STRING_clear_free(privkey);
|
||||
if (!(privkey = d2i_ASN1_UINTEGER(NULL, &q, pklen)))
|
||||
goto decerr;
|
||||
}
|
||||
@@ -264,7 +266,7 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
|
||||
if (ndsa)
|
||||
sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
|
||||
else
|
||||
ASN1_INTEGER_free(privkey);
|
||||
ASN1_STRING_clear_free(privkey);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -273,7 +275,7 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
|
||||
dsaerr:
|
||||
BN_CTX_free(ctx);
|
||||
if (privkey)
|
||||
ASN1_INTEGER_free(privkey);
|
||||
ASN1_STRING_clear_free(privkey);
|
||||
sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
|
||||
DSA_free(dsa);
|
||||
return 0;
|
||||
@@ -315,7 +317,7 @@ static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
|
||||
dplen = i2d_ASN1_INTEGER(prkey, &dp);
|
||||
|
||||
ASN1_INTEGER_free(prkey);
|
||||
ASN1_STRING_clear_free(prkey);
|
||||
|
||||
if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_dsa), 0,
|
||||
V_ASN1_SEQUENCE, params, dp, dplen))
|
||||
@@ -329,7 +331,7 @@ static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
if (params != NULL)
|
||||
ASN1_STRING_free(params);
|
||||
if (prkey != NULL)
|
||||
ASN1_INTEGER_free(prkey);
|
||||
ASN1_STRING_clear_free(prkey);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -204,7 +204,8 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
|
||||
goto err;
|
||||
|
||||
if (!seed_len) {
|
||||
RAND_pseudo_bytes(seed, qsize);
|
||||
if (RAND_pseudo_bytes(seed, qsize) < 0)
|
||||
goto err;
|
||||
seed_is_random = 1;
|
||||
} else {
|
||||
seed_is_random = 0;
|
||||
|
@@ -106,23 +106,23 @@ static DSA_METHOD openssl_dsa_meth = {
|
||||
#define DSA_MOD_EXP(err_instr,dsa,rr,a1,p1,a2,p2,m,ctx,in_mont) \
|
||||
do { \
|
||||
int _tmp_res53; \
|
||||
if((dsa)->meth->dsa_mod_exp) \
|
||||
if ((dsa)->meth->dsa_mod_exp) \
|
||||
_tmp_res53 = (dsa)->meth->dsa_mod_exp((dsa), (rr), (a1), (p1), \
|
||||
(a2), (p2), (m), (ctx), (in_mont)); \
|
||||
else \
|
||||
_tmp_res53 = BN_mod_exp2_mont((rr), (a1), (p1), (a2), (p2), \
|
||||
(m), (ctx), (in_mont)); \
|
||||
if(!_tmp_res53) err_instr; \
|
||||
if (!_tmp_res53) err_instr; \
|
||||
} while(0)
|
||||
#define DSA_BN_MOD_EXP(err_instr,dsa,r,a,p,m,ctx,m_ctx) \
|
||||
do { \
|
||||
int _tmp_res53; \
|
||||
if((dsa)->meth->bn_mod_exp) \
|
||||
if ((dsa)->meth->bn_mod_exp) \
|
||||
_tmp_res53 = (dsa)->meth->bn_mod_exp((dsa), (r), (a), (p), \
|
||||
(m), (ctx), (m_ctx)); \
|
||||
else \
|
||||
_tmp_res53 = BN_mod_exp_mont((r), (a), (p), (m), (ctx), (m_ctx)); \
|
||||
if(!_tmp_res53) err_instr; \
|
||||
if (!_tmp_res53) err_instr; \
|
||||
} while(0)
|
||||
|
||||
const DSA_METHOD *DSA_OpenSSL(void)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user