Compare commits
378 Commits
OpenSSL_1_
...
OpenSSL_1_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bfe07df40c | ||
![]() |
33223e733a | ||
![]() |
9330fbd07f | ||
![]() |
00456fded4 | ||
![]() |
c394a48894 | ||
![]() |
d73cc256c8 | ||
![]() |
cc598f321f | ||
![]() |
fb4f46763f | ||
![]() |
babe434c99 | ||
![]() |
87bc193bc1 | ||
![]() |
15c62b0dfd | ||
![]() |
94f98a9019 | ||
![]() |
301a6dcd45 | ||
![]() |
ed02493567 | ||
![]() |
296f7bd1ac | ||
![]() |
a5b63f8073 | ||
![]() |
3a9328e3f7 | ||
![]() |
943c4ca62b | ||
![]() |
d88ef40a1e | ||
![]() |
9252d71557 | ||
![]() |
fb92839c93 | ||
![]() |
6d31885d4a | ||
![]() |
03bf712780 | ||
![]() |
56d9134675 | ||
![]() |
cb70eede8b | ||
![]() |
01d625e2c3 | ||
![]() |
bc2ab6ed2f | ||
![]() |
bef7693860 | ||
![]() |
c6a5fddf6c | ||
![]() |
817ddb9fb0 | ||
![]() |
f236ef27bd | ||
![]() |
48008008af | ||
![]() |
d40ec4ab8e | ||
![]() |
15a7164eb7 | ||
![]() |
822d265ced | ||
![]() |
903738ac63 | ||
![]() |
a89dda8cd0 | ||
![]() |
fdbe4a3fa6 | ||
![]() |
0c0f1361b2 | ||
![]() |
ca3658e000 | ||
![]() |
8f486d793b | ||
![]() |
706c85da79 | ||
![]() |
dfb23a5ac8 | ||
![]() |
b62a2f8a37 | ||
![]() |
a8bd9f90ed | ||
![]() |
43679fc35e | ||
![]() |
ec3a7c9b37 | ||
![]() |
72895f5112 | ||
![]() |
e90f1d9b74 | ||
![]() |
5a1e6b1342 | ||
![]() |
51a1cc4ffc | ||
![]() |
8d43c0053b | ||
![]() |
e272f8ef8f | ||
![]() |
c97c7f8d53 | ||
![]() |
a20d9422cf | ||
![]() |
bf9d61d1ab | ||
![]() |
6868346585 | ||
![]() |
985abd1fd8 | ||
![]() |
b00424792f | ||
![]() |
bb7b893d7c | ||
![]() |
cc1cdc5df5 | ||
![]() |
738b8e6bc2 | ||
![]() |
6481be7346 | ||
![]() |
cba8745395 | ||
![]() |
61dfe3a720 | ||
![]() |
184718baab | ||
![]() |
6b247c1817 | ||
![]() |
d62c64b947 | ||
![]() |
6f997dc365 | ||
![]() |
21b538d616 | ||
![]() |
92ea6fe597 | ||
![]() |
920f7cf897 | ||
![]() |
605a54ef1c | ||
![]() |
51ff683c12 | ||
![]() |
be250ee2d3 | ||
![]() |
f5afe9ce3f | ||
![]() |
f61216ba9d | ||
![]() |
c038e6b504 | ||
![]() |
0ea050e743 | ||
![]() |
d601b9b50c | ||
![]() |
b21b330bf1 | ||
![]() |
325bb1ac25 | ||
![]() |
2e3a21e152 | ||
![]() |
8748519f64 | ||
![]() |
6be18a2219 | ||
![]() |
197db2143c | ||
![]() |
cb71f17dc7 | ||
![]() |
37faf11796 | ||
![]() |
0711826ae9 | ||
![]() |
929f6d6f55 | ||
![]() |
beb841c5d1 | ||
![]() |
3be39dc1e3 | ||
![]() |
728bcd59d3 | ||
![]() |
5116aeeacb | ||
![]() |
2aa5a2c766 | ||
![]() |
eac2b837d6 | ||
![]() |
ce5ae63ab2 | ||
![]() |
4dcdde120b | ||
![]() |
7b8a999202 | ||
![]() |
2df619b06c | ||
![]() |
cef9dcbb45 | ||
![]() |
40d5689458 | ||
![]() |
39c76ceb2d | ||
![]() |
0a1682d8b5 | ||
![]() |
31472acf61 | ||
![]() |
28643a1615 | ||
![]() |
dc0c888811 | ||
![]() |
9a931208d7 | ||
![]() |
41fe7d2380 | ||
![]() |
cc42e4af2c | ||
![]() |
59793f5c1e | ||
![]() |
5f623eb616 | ||
![]() |
5425917406 | ||
![]() |
cae70cfd46 | ||
![]() |
df1565ed9c | ||
![]() |
cf633fa002 | ||
![]() |
732a6b5522 | ||
![]() |
43613c0a02 | ||
![]() |
254b259ef0 | ||
![]() |
9c989aaa74 | ||
![]() |
f21fb858d3 | ||
![]() |
c8491de393 | ||
![]() |
1d7df236dc | ||
![]() |
a7cb67f4f2 | ||
![]() |
6cc31d4212 | ||
![]() |
06f6c55107 | ||
![]() |
2d07f60a02 | ||
![]() |
2f2295a596 | ||
![]() |
8e0b56b996 | ||
![]() |
d72c446213 | ||
![]() |
b012b497ea | ||
![]() |
6786c70ec1 | ||
![]() |
40356e4914 | ||
![]() |
3d23b2c255 | ||
![]() |
8d2e7c0dec | ||
![]() |
56353962e7 | ||
![]() |
25efcb44ac | ||
![]() |
5859bc62f3 | ||
![]() |
056df45ed1 | ||
![]() |
e9da86627a | ||
![]() |
0b12fa75c9 | ||
![]() |
b3a62dc032 | ||
![]() |
512368c9ed | ||
![]() |
ada57746b6 | ||
![]() |
5d786e9e2d | ||
![]() |
9ea70e5b40 | ||
![]() |
5438e17de0 | ||
![]() |
49cc3f4038 | ||
![]() |
a5e26349f7 | ||
![]() |
b68fa4d19e | ||
![]() |
602af7d01d | ||
![]() |
d0c9a90640 | ||
![]() |
9e43fe9a2b | ||
![]() |
374fd385c2 | ||
![]() |
6b7d872e81 | ||
![]() |
f0348c842e | ||
![]() |
09368c044b | ||
![]() |
4102d1a503 | ||
![]() |
fd9631bbbd | ||
![]() |
405f43bc2a | ||
![]() |
033b558181 | ||
![]() |
9e56a32e39 | ||
![]() |
9f0b86c68b | ||
![]() |
5a3ce86e21 | ||
![]() |
8a1dbda755 | ||
![]() |
0ed08a7a98 | ||
![]() |
efb1a50f37 | ||
![]() |
ded7eee8c2 | ||
![]() |
fdd6d00952 | ||
![]() |
2a7059c56f | ||
![]() |
a7ef1e9072 | ||
![]() |
33dd083206 | ||
![]() |
5627e0f77d | ||
![]() |
9dee5244e1 | ||
![]() |
692f07c3e0 | ||
![]() |
f404943bca | ||
![]() |
21376d8ae3 | ||
![]() |
c0b674b7cb | ||
![]() |
a229c2b805 | ||
![]() |
3c66a669df | ||
![]() |
f8f75a7e4a | ||
![]() |
7c1dae55d4 | ||
![]() |
edbc9050be | ||
![]() |
c00206c326 | ||
![]() |
4ce5ed5f39 | ||
![]() |
295c629ab1 | ||
![]() |
c61bb1abaf | ||
![]() |
f59186e436 | ||
![]() |
0abf610447 | ||
![]() |
57bd71b45b | ||
![]() |
4475451164 | ||
![]() |
220b9519eb | ||
![]() |
710e28ef93 | ||
![]() |
05d20833e3 | ||
![]() |
90ee3c1646 | ||
![]() |
7ef465050e | ||
![]() |
8ca211707a | ||
![]() |
9007dfa203 | ||
![]() |
603bebc0e7 | ||
![]() |
56f0733145 | ||
![]() |
8e6bb99979 | ||
![]() |
8615d8b4ec | ||
![]() |
4f0812cc28 | ||
![]() |
3bf9adaa2b | ||
![]() |
54ae378c9e | ||
![]() |
0ee5fcde06 | ||
![]() |
d4c1763858 | ||
![]() |
fe64245aa1 | ||
![]() |
1030f89f5e | ||
![]() |
b6ed991731 | ||
![]() |
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 |
22
.cvsignore
22
.cvsignore
@@ -1,22 +0,0 @@
|
||||
openssl.pc
|
||||
libcrypto.pc
|
||||
libssl.pc
|
||||
MINFO
|
||||
makefile.one
|
||||
tmp
|
||||
out
|
||||
outinc
|
||||
rehash.time
|
||||
testlog
|
||||
make.log
|
||||
maketest.log
|
||||
cctest
|
||||
cctest.c
|
||||
cctest.a
|
||||
*.flc
|
||||
semantic.cache
|
||||
Makefile
|
||||
*.dll*
|
||||
*.so*
|
||||
*.sl*
|
||||
*.dylib*
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -7,6 +7,7 @@
|
||||
.#*
|
||||
#*#
|
||||
*~
|
||||
/.dir-locals.el
|
||||
|
||||
# Top level excludes
|
||||
/Makefile.bak
|
||||
@@ -100,8 +101,12 @@ tags
|
||||
TAGS
|
||||
|
||||
# Windows
|
||||
/tmp32
|
||||
/tmp32.dbg
|
||||
/tmp32dll
|
||||
/tmp32dll.dbg
|
||||
/out32
|
||||
/out32.dbg
|
||||
/out32dll
|
||||
/out32dll.dbg
|
||||
/inc32
|
||||
|
54
.travis.yml
Normal file
54
.travis.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
language: c
|
||||
|
||||
addons:
|
||||
apt_packages:
|
||||
- binutils-mingw-w64
|
||||
- gcc-mingw-w64
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
- i686-w64-mingw32-gcc
|
||||
- x86_64-w64-mingw32-gcc
|
||||
|
||||
env:
|
||||
- CONFIG_OPTS=""
|
||||
- CONFIG_OPTS="shared"
|
||||
- CONFIG_OPTS="-d --strict-warnings"
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- os: osx
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
- os: osx
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
- compiler: i686-w64-mingw32-gcc
|
||||
env: CONFIG_OPTS="-d --strict-warnings"
|
||||
- compiler: x86_64-w64-mingw32-gcc
|
||||
env: CONFIG_OPTS="-d --strict-warnings"
|
||||
|
||||
before_script:
|
||||
- if [ "$CC" == i686-w64-mingw32-gcc ]; then
|
||||
export CROSS_COMPILE=${CC%%gcc}; unset CC;
|
||||
./Configure mingw $CONFIG_OPTS;
|
||||
elif [ "$CC" == x86_64-w64-mingw32-gcc ]; then
|
||||
export CROSS_COMPILE=${CC%%gcc}; unset CC;
|
||||
./Configure mingw64 $CONFIG_OPTS;
|
||||
else
|
||||
if [ "$CC" == gcc ]; then
|
||||
export CONFIG_OPTS="$CONFIG_OPTS -Wno-error=shadow";
|
||||
fi;
|
||||
./config $CONFIG_OPTS;
|
||||
fi
|
||||
|
||||
script:
|
||||
- make
|
||||
- if [ -z "$CROSS_COMPILE" ]; then make test; fi
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- openssl-commits@openssl.org
|
341
CHANGES
341
CHANGES
@@ -2,6 +2,179 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 1.0.2d and 1.0.2e [3 Dec 2015]
|
||||
|
||||
*) BN_mod_exp may produce incorrect results on x86_64
|
||||
|
||||
There is a carry propagating bug in the x86_64 Montgomery squaring
|
||||
procedure. No EC algorithms are affected. Analysis suggests that attacks
|
||||
against RSA and DSA as a result of this defect would be very difficult to
|
||||
perform and are not believed likely. Attacks against DH are considered just
|
||||
feasible (although very difficult) because most of the work necessary to
|
||||
deduce information about a private key may be performed offline. The amount
|
||||
of resources required for such an attack would be very significant and
|
||||
likely only accessible to a limited number of attackers. An attacker would
|
||||
additionally need online access to an unpatched system using the target
|
||||
private key in a scenario with persistent DH parameters and a private
|
||||
key that is shared between multiple clients. For example this can occur by
|
||||
default in OpenSSL DHE based SSL/TLS ciphersuites.
|
||||
|
||||
This issue was reported to OpenSSL by Hanno Böck.
|
||||
(CVE-2015-3193)
|
||||
[Andy Polyakov]
|
||||
|
||||
*) Certificate verify crash with missing PSS parameter
|
||||
|
||||
The signature verification routines will crash with a NULL pointer
|
||||
dereference if presented with an ASN.1 signature using the RSA PSS
|
||||
algorithm and absent mask generation function parameter. Since these
|
||||
routines are used to verify certificate signature algorithms this can be
|
||||
used to crash any certificate verification operation and exploited in a
|
||||
DoS attack. Any application which performs certificate verification is
|
||||
vulnerable including OpenSSL clients and servers which enable client
|
||||
authentication.
|
||||
|
||||
This issue was reported to OpenSSL by Loïc Jonas Etienne (Qnective AG).
|
||||
(CVE-2015-3194)
|
||||
[Stephen Henson]
|
||||
|
||||
*) X509_ATTRIBUTE memory leak
|
||||
|
||||
When presented with a malformed X509_ATTRIBUTE structure OpenSSL will leak
|
||||
memory. This structure is used by the PKCS#7 and CMS routines so any
|
||||
application which reads PKCS#7 or CMS data from untrusted sources is
|
||||
affected. SSL/TLS is not affected.
|
||||
|
||||
This issue was reported to OpenSSL by Adam Langley (Google/BoringSSL) using
|
||||
libFuzzer.
|
||||
(CVE-2015-3195)
|
||||
[Stephen Henson]
|
||||
|
||||
*) Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs.
|
||||
This changes the decoding behaviour for some invalid messages,
|
||||
though the change is mostly in the more lenient direction, and
|
||||
legacy behaviour is preserved as much as possible.
|
||||
[Emilia Käsper]
|
||||
|
||||
*) In DSA_generate_parameters_ex, if the provided seed is too short,
|
||||
return an error
|
||||
[Rich Salz and Ismo Puustinen <ismo.puustinen@intel.com>]
|
||||
|
||||
Changes between 1.0.2c and 1.0.2d [9 Jul 2015]
|
||||
|
||||
*) Alternate chains certificate forgery
|
||||
|
||||
During certificate verfification, OpenSSL will attempt to find an
|
||||
alternative certificate chain if the first attempt to build such a chain
|
||||
fails. An error in the implementation of this logic can mean that an
|
||||
attacker could cause certain checks on untrusted certificates to be
|
||||
bypassed, such as the CA flag, enabling them to use a valid leaf
|
||||
certificate to act as a CA and "issue" an invalid certificate.
|
||||
|
||||
This issue was reported to OpenSSL by Adam Langley/David Benjamin
|
||||
(Google/BoringSSL).
|
||||
(CVE-2015-1793)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Race condition handling PSK identify hint
|
||||
|
||||
If PSK identity hints are received by a multi-threaded client then
|
||||
the values are wrongly updated in the parent SSL_CTX structure. This can
|
||||
result in a race condition potentially leading to a double free of the
|
||||
identify hint data.
|
||||
(CVE-2015-3196)
|
||||
[Stephen Henson]
|
||||
|
||||
Changes between 1.0.2b and 1.0.2c [12 Jun 2015]
|
||||
|
||||
*) Fix HMAC ABI incompatibility. The previous version introduced an ABI
|
||||
incompatibility in the handling of HMAC. The previous ABI has now been
|
||||
restored.
|
||||
|
||||
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
|
||||
@@ -96,7 +269,7 @@
|
||||
|
||||
This issue was reported to OpenSSL by Michal Zalewski (Google).
|
||||
(CVE-2015-0289)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) DoS via reachable assert in SSLv2 servers fix
|
||||
|
||||
@@ -104,10 +277,10 @@
|
||||
servers that both support SSLv2 and enable export cipher suites by sending
|
||||
a specially crafted SSLv2 CLIENT-MASTER-KEY message.
|
||||
|
||||
This issue was discovered by Sean Burford (Google) and Emilia K<EFBFBD>sper
|
||||
This issue was discovered by Sean Burford (Google) and Emilia Käsper
|
||||
(OpenSSL development team).
|
||||
(CVE-2015-0293)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) Empty CKE with client auth and DHE fix
|
||||
|
||||
@@ -167,6 +340,10 @@
|
||||
|
||||
Changes between 1.0.1l and 1.0.2 [22 Jan 2015]
|
||||
|
||||
*) Change RSA and DH/DSA key generation apps to generate 2048-bit
|
||||
keys by default.
|
||||
[Kurt Roeckx]
|
||||
|
||||
*) 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
|
||||
@@ -612,12 +789,12 @@
|
||||
version does not match the session's version. Resuming with a different
|
||||
version, while not strictly forbidden by the RFC, is of questionable
|
||||
sanity and breaks all known clients.
|
||||
[David Benjamin, Emilia K<EFBFBD>sper]
|
||||
[David Benjamin, Emilia Käsper]
|
||||
|
||||
*) Tighten handling of the ChangeCipherSpec (CCS) message: reject
|
||||
early CCS messages during renegotiation. (Note that because
|
||||
renegotiation is encrypted, this early CCS was not exploitable.)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) Tighten client-side session ticket handling during renegotiation:
|
||||
ensure that the client only accepts a session ticket if the server sends
|
||||
@@ -628,7 +805,7 @@
|
||||
Similarly, ensure that the client requires a session ticket if one
|
||||
was advertised in the ServerHello. Previously, a TLS client would
|
||||
ignore a missing NewSessionTicket message.
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
Changes between 1.0.1i and 1.0.1j [15 Oct 2014]
|
||||
|
||||
@@ -708,10 +885,10 @@
|
||||
with a null pointer dereference (read) by specifying an anonymous (EC)DH
|
||||
ciphersuite and sending carefully crafted handshake messages.
|
||||
|
||||
Thanks to Felix Gr<EFBFBD>bert (Google) for discovering and researching this
|
||||
Thanks to Felix Gröbert (Google) for discovering and researching this
|
||||
issue.
|
||||
(CVE-2014-3510)
|
||||
[Emilia K<EFBFBD>sper]
|
||||
[Emilia Käsper]
|
||||
|
||||
*) By sending carefully crafted DTLS packets an attacker could cause openssl
|
||||
to leak memory. This can be exploited through a Denial of Service attack.
|
||||
@@ -748,7 +925,7 @@
|
||||
properly negotiated with the client. This can be exploited through a
|
||||
Denial of Service attack.
|
||||
|
||||
Thanks to Joonas Kuorilehto and Riku Hietam<EFBFBD>ki (Codenomicon) for
|
||||
Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for
|
||||
discovering and researching this issue.
|
||||
(CVE-2014-5139)
|
||||
[Steve Henson]
|
||||
@@ -760,7 +937,7 @@
|
||||
|
||||
Thanks to Ivan Fratric (Google) for discovering this issue.
|
||||
(CVE-2014-3508)
|
||||
[Emilia K<EFBFBD>sper, and Steve Henson]
|
||||
[Emilia Käsper, and Steve Henson]
|
||||
|
||||
*) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.)
|
||||
for corner cases. (Certain input points at infinity could lead to
|
||||
@@ -790,22 +967,22 @@
|
||||
client or server. This is potentially exploitable to run arbitrary
|
||||
code on a vulnerable client or server.
|
||||
|
||||
Thanks to J<EFBFBD>ri Aedla for reporting this issue. (CVE-2014-0195)
|
||||
[J<EFBFBD>ri Aedla, Steve Henson]
|
||||
Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195)
|
||||
[Jüri Aedla, Steve Henson]
|
||||
|
||||
*) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites
|
||||
are subject to a denial of service attack.
|
||||
|
||||
Thanks to Felix Gr<EFBFBD>bert and Ivan Fratric at Google for discovering
|
||||
Thanks to Felix Gröbert and Ivan Fratric at Google for discovering
|
||||
this issue. (CVE-2014-3470)
|
||||
[Felix Gr<EFBFBD>bert, Ivan Fratric, Steve Henson]
|
||||
[Felix Gröbert, Ivan Fratric, Steve Henson]
|
||||
|
||||
*) Harmonize version and its documentation. -f flag is used to display
|
||||
compilation flags.
|
||||
[mancha <mancha1@zoho.com>]
|
||||
|
||||
*) Fix eckey_priv_encode so it immediately returns an error upon a failure
|
||||
in i2d_ECPrivateKey.
|
||||
in i2d_ECPrivateKey. Thanks to Ted Unangst for feedback on this issue.
|
||||
[mancha <mancha1@zoho.com>]
|
||||
|
||||
*) Fix some double frees. These are not thought to be exploitable.
|
||||
@@ -877,9 +1054,9 @@
|
||||
Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
|
||||
Security Group at Royal Holloway, University of London
|
||||
(www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
|
||||
Emilia K<EFBFBD>sper for the initial patch.
|
||||
Emilia Käsper for the initial patch.
|
||||
(CVE-2013-0169)
|
||||
[Emilia K<EFBFBD>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
|
||||
[Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
|
||||
|
||||
*) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode
|
||||
ciphersuites which can be exploited in a denial of service attack.
|
||||
@@ -1054,7 +1231,7 @@
|
||||
EC_GROUP_new_by_curve_name() will automatically use these (while
|
||||
EC_GROUP_new_curve_GFp() currently prefers the more flexible
|
||||
implementations).
|
||||
[Emilia K<EFBFBD>sper, Adam Langley, Bodo Moeller (Google)]
|
||||
[Emilia Käsper, Adam Langley, Bodo Moeller (Google)]
|
||||
|
||||
*) Use type ossl_ssize_t instad of ssize_t which isn't available on
|
||||
all platforms. Move ssize_t definition from e_os.h to the public
|
||||
@@ -1330,7 +1507,7 @@
|
||||
[Adam Langley (Google)]
|
||||
|
||||
*) Fix spurious failures in ecdsatest.c.
|
||||
[Emilia K<EFBFBD>sper (Google)]
|
||||
[Emilia Käsper (Google)]
|
||||
|
||||
*) Fix the BIO_f_buffer() implementation (which was mixing different
|
||||
interpretations of the '..._len' fields).
|
||||
@@ -1344,7 +1521,7 @@
|
||||
lock to call BN_BLINDING_invert_ex, and avoids one use of
|
||||
BN_BLINDING_update for each BN_BLINDING structure (previously,
|
||||
the last update always remained unused).
|
||||
[Emilia K<EFBFBD>sper (Google)]
|
||||
[Emilia Käsper (Google)]
|
||||
|
||||
*) In ssl3_clear, preserve s3->init_extra along with s3->rbuf.
|
||||
[Bob Buckholz (Google)]
|
||||
@@ -2153,7 +2330,7 @@
|
||||
|
||||
*) Add RFC 3161 compliant time stamp request creation, response generation
|
||||
and response verification functionality.
|
||||
[Zolt<EFBFBD>n Gl<EFBFBD>zik <zglozik@opentsa.org>, The OpenTSA Project]
|
||||
[Zoltán Glózik <zglozik@opentsa.org>, The OpenTSA Project]
|
||||
|
||||
*) Add initial support for TLS extensions, specifically for the server_name
|
||||
extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now
|
||||
@@ -3321,7 +3498,7 @@
|
||||
|
||||
*) BN_CTX_get() should return zero-valued bignums, providing the same
|
||||
initialised value as BN_new().
|
||||
[Geoff Thorpe, suggested by Ulf M<EFBFBD>ller]
|
||||
[Geoff Thorpe, suggested by Ulf Möller]
|
||||
|
||||
*) Support for inhibitAnyPolicy certificate extension.
|
||||
[Steve Henson]
|
||||
@@ -3340,7 +3517,7 @@
|
||||
some point, these tighter rules will become openssl's default to improve
|
||||
maintainability, though the assert()s and other overheads will remain only
|
||||
in debugging configurations. See bn.h for more details.
|
||||
[Geoff Thorpe, Nils Larsch, Ulf M<EFBFBD>ller]
|
||||
[Geoff Thorpe, Nils Larsch, Ulf Möller]
|
||||
|
||||
*) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure
|
||||
that can only be obtained through BN_CTX_new() (which implicitly
|
||||
@@ -3407,7 +3584,7 @@
|
||||
[Douglas Stebila (Sun Microsystems Laboratories)]
|
||||
|
||||
*) Add the possibility to load symbols globally with DSO.
|
||||
[G<EFBFBD>tz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
|
||||
[Götz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
|
||||
|
||||
*) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better
|
||||
control of the error stack.
|
||||
@@ -4122,7 +4299,7 @@
|
||||
[Steve Henson]
|
||||
|
||||
*) Undo Cygwin change.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Added support for proxy certificates according to RFC 3820.
|
||||
Because they may be a security thread to unaware applications,
|
||||
@@ -4155,11 +4332,11 @@
|
||||
[Stephen Henson, reported by UK NISCC]
|
||||
|
||||
*) Use Windows randomness collection on Cygwin.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix hang in EGD/PRNGD query when communication socket is closed
|
||||
prematurely by EGD/PRNGD.
|
||||
[Darren Tucker <dtucker@zip.com.au> via Lutz J<EFBFBD>nicke, resolves #1014]
|
||||
[Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014]
|
||||
|
||||
*) Prompt for pass phrases when appropriate for PKCS12 input format.
|
||||
[Steve Henson]
|
||||
@@ -4621,7 +4798,7 @@
|
||||
pointers passed to them whenever necessary. Otherwise it is possible
|
||||
the caller may have overwritten (or deallocated) the original string
|
||||
data when a later ENGINE operation tries to use the stored values.
|
||||
[G<EFBFBD>tz Babin-Ebell <babinebell@trustcenter.de>]
|
||||
[Götz Babin-Ebell <babinebell@trustcenter.de>]
|
||||
|
||||
*) Improve diagnostics in file reading and command-line digests.
|
||||
[Ben Laurie aided and abetted by Solar Designer <solar@openwall.com>]
|
||||
@@ -6726,7 +6903,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) BN_sqr() bug fix.
|
||||
[Ulf M<EFBFBD>ller, reported by Jim Ellis <jim.ellis@cavium.com>]
|
||||
[Ulf Möller, reported by Jim Ellis <jim.ellis@cavium.com>]
|
||||
|
||||
*) Rabin-Miller test analyses assume uniformly distributed witnesses,
|
||||
so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
|
||||
@@ -6886,7 +7063,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Fix OAEP check.
|
||||
[Ulf M<EFBFBD>ller, Bodo M<EFBFBD>ller]
|
||||
[Ulf Möller, Bodo Möller]
|
||||
|
||||
*) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
|
||||
RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
|
||||
@@ -7148,10 +7325,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Use better test patterns in bntest.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) rand_win.c fix for Borland C.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) BN_rshift bugfix for n == 0.
|
||||
[Bodo Moeller]
|
||||
@@ -7296,14 +7473,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) New BIO_shutdown_wr macro, which invokes the BIO_C_SHUTDOWN_WR
|
||||
BIO_ctrl (for BIO pairs).
|
||||
[Bodo M<EFBFBD>ller]
|
||||
[Bodo Möller]
|
||||
|
||||
*) Add DSO method for VMS.
|
||||
[Richard Levitte]
|
||||
|
||||
*) Bug fix: Montgomery multiplication could produce results with the
|
||||
wrong sign.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add RPM specification openssl.spec and modify it to build three
|
||||
packages. The default package contains applications, application
|
||||
@@ -7321,7 +7498,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Don't set the two most significant bits to one when generating a
|
||||
random number < q in the DSA library.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) New SSL API mode 'SSL_MODE_AUTO_RETRY'. This disables the default
|
||||
behaviour that SSL_read may result in SSL_ERROR_WANT_READ (even if
|
||||
@@ -7587,7 +7764,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Randomness polling function for Win9x, as described in:
|
||||
Peter Gutmann, Software Generation of Practically Strong
|
||||
Random Numbers.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix so PRNG is seeded in req if using an already existing
|
||||
DSA key.
|
||||
@@ -7807,7 +7984,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Eliminate non-ANSI declarations in crypto.h and stack.h.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix for SSL server purpose checking. Server checking was
|
||||
rejecting certificates which had extended key usage present
|
||||
@@ -7839,7 +8016,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Bugfix for linux-elf makefile.one.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) RSA_get_default_method() will now cause a default
|
||||
RSA_METHOD to be chosen if one doesn't exist already.
|
||||
@@ -7928,7 +8105,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) des_quad_cksum() byte order bug fix.
|
||||
[Ulf M<EFBFBD>ller, using the problem description in krb4-0.9.7, where
|
||||
[Ulf Möller, using the problem description in krb4-0.9.7, where
|
||||
the solution is attributed to Derrick J Brashear <shadow@DEMENTIA.ORG>]
|
||||
|
||||
*) Fix so V_ASN1_APP_CHOOSE works again: however its use is strongly
|
||||
@@ -8029,7 +8206,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Rolf Haberrecker <rolf@suse.de>]
|
||||
|
||||
*) Assembler module support for Mingw32.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Shared library support for HPUX (in shlib/).
|
||||
[Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous]
|
||||
@@ -8048,7 +8225,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n]
|
||||
case was implemented. This caused BN_div_recp() to fail occasionally.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add an optional second argument to the set_label() in the perl
|
||||
assembly language builder. If this argument exists and is set
|
||||
@@ -8078,14 +8255,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Fix potential buffer overrun problem in BIO_printf().
|
||||
[Ulf M<EFBFBD>ller, using public domain code by Patrick Powell; problem
|
||||
[Ulf Möller, using public domain code by Patrick Powell; problem
|
||||
pointed out by David Sacerdote <das33@cornell.edu>]
|
||||
|
||||
*) Support EGD <http://www.lothar.com/tech/crypto/>. New functions
|
||||
RAND_egd() and RAND_status(). In the command line application,
|
||||
the EGD socket can be specified like a seed file using RANDFILE
|
||||
or -rand.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Allow the string CERTIFICATE to be tolerated in PKCS#7 structures.
|
||||
Some CAs (e.g. Verisign) distribute certificates in this form.
|
||||
@@ -8118,7 +8295,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
#define OPENSSL_ALGORITHM_DEFINES
|
||||
#include <openssl/opensslconf.h>
|
||||
defines all pertinent NO_<algo> symbols, such as NO_IDEA, NO_RSA, etc.
|
||||
[Richard Levitte, Ulf and Bodo M<EFBFBD>ller]
|
||||
[Richard Levitte, Ulf and Bodo Möller]
|
||||
|
||||
*) Bugfix: Tolerate fragmentation and interleaving in the SSL 3/TLS
|
||||
record layer.
|
||||
@@ -8169,17 +8346,17 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Bug fix for BN_div_recp() for numerators with an even number of
|
||||
bits.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) More tests in bntest.c, and changed test_bn output.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) ./config recognizes MacOS X now.
|
||||
[Andy Polyakov]
|
||||
|
||||
*) Bug fix for BN_div() when the first words of num and divsor are
|
||||
equal (it gave wrong results if (rem=(n1-q*d0)&BN_MASK2) < d0).
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add support for various broken PKCS#8 formats, and command line
|
||||
options to produce them.
|
||||
@@ -8187,11 +8364,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) New functions BN_CTX_start(), BN_CTX_get() and BT_CTX_end() to
|
||||
get temporary BIGNUMs from a BN_CTX.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont()
|
||||
for p == 0.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Change the SSLeay_add_all_*() functions to OpenSSL_add_all_*() and
|
||||
include a #define from the old name to the new. The original intent
|
||||
@@ -8215,7 +8392,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Source code cleanups: use const where appropriate, eliminate casts,
|
||||
use void * instead of char * in lhash.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Bugfix: ssl3_send_server_key_exchange was not restartable
|
||||
(the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of
|
||||
@@ -8260,13 +8437,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) New function BN_pseudo_rand().
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Clean up BN_mod_mul_montgomery(): replace the broken (and unreadable)
|
||||
bignum version of BN_from_montgomery() with the working code from
|
||||
SSLeay 0.9.0 (the word based version is faster anyway), and clean up
|
||||
the comments.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Avoid a race condition in s2_clnt.c (function get_server_hello) that
|
||||
made it impossible to use the same SSL_SESSION data structure in
|
||||
@@ -8276,25 +8453,25 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) The return value of RAND_load_file() no longer counts bytes obtained
|
||||
by stat(). RAND_load_file(..., -1) is new and uses the complete file
|
||||
to seed the PRNG (previously an explicit byte count was required).
|
||||
[Ulf M<EFBFBD>ller, Bodo M<EFBFBD>ller]
|
||||
[Ulf Möller, Bodo Möller]
|
||||
|
||||
*) Clean up CRYPTO_EX_DATA functions, some of these didn't have prototypes
|
||||
used (char *) instead of (void *) and had casts all over the place.
|
||||
[Steve Henson]
|
||||
|
||||
*) Make BN_generate_prime() return NULL on error if ret!=NULL.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Retain source code compatibility for BN_prime_checks macro:
|
||||
BN_is_prime(..., BN_prime_checks, ...) now uses
|
||||
BN_prime_checks_for_size to determine the appropriate number of
|
||||
Rabin-Miller iterations.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Diffie-Hellman uses "safe" primes: DH_check() return code renamed to
|
||||
DH_CHECK_P_NOT_SAFE_PRIME.
|
||||
(Check if this is true? OpenPGP calls them "strong".)
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Merge the functionality of "dh" and "gendh" programs into a new program
|
||||
"dhparam". The old programs are retained for now but will handle DH keys
|
||||
@@ -8350,7 +8527,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Add missing #ifndefs that caused missing symbols when building libssl
|
||||
as a shared library without RSA. Use #ifndef NO_SSL2 instead of
|
||||
NO_RSA in ssl/s2*.c.
|
||||
[Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf M<EFBFBD>ller]
|
||||
[Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf Möller]
|
||||
|
||||
*) Precautions against using the PRNG uninitialized: RAND_bytes() now
|
||||
has a return value which indicates the quality of the random data
|
||||
@@ -8359,7 +8536,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
guaranteed to be unique but not unpredictable. RAND_add is like
|
||||
RAND_seed, but takes an extra argument for an entropy estimate
|
||||
(RAND_seed always assumes full entropy).
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Do more iterations of Rabin-Miller probable prime test (specifically,
|
||||
3 for 1024-bit primes, 6 for 512-bit primes, 12 for 256-bit primes
|
||||
@@ -8389,7 +8566,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Honor the no-xxx Configure options when creating .DEF files.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add PKCS#10 attributes to field table: challengePassword,
|
||||
unstructuredName and unstructuredAddress. These are taken from
|
||||
@@ -9223,7 +9400,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) More DES library cleanups: remove references to srand/rand and
|
||||
delete an unused file.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add support for the the free Netwide assembler (NASM) under Win32,
|
||||
since not many people have MASM (ml) and it can be hard to obtain.
|
||||
@@ -9312,7 +9489,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
worked.
|
||||
|
||||
*) Fix problems with no-hmac etc.
|
||||
[Ulf M<EFBFBD>ller, pointed out by Brian Wellington <bwelling@tislabs.com>]
|
||||
[Ulf Möller, pointed out by Brian Wellington <bwelling@tislabs.com>]
|
||||
|
||||
*) New functions RSA_get_default_method(), RSA_set_method() and
|
||||
RSA_get_method(). These allows replacement of RSA_METHODs without having
|
||||
@@ -9429,7 +9606,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Ben Laurie]
|
||||
|
||||
*) DES library cleanups.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add support for PKCS#5 v2.0 PBE algorithms. This will permit PKCS#8 to be
|
||||
used with any cipher unlike PKCS#5 v1.5 which can at most handle 64 bit
|
||||
@@ -9472,7 +9649,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Christian Forster <fo@hawo.stw.uni-erlangen.de>]
|
||||
|
||||
*) config now generates no-xxx options for missing ciphers.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Support the EBCDIC character set (work in progress).
|
||||
File ebcdic.c not yet included because it has a different license.
|
||||
@@ -9585,7 +9762,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Move openssl.cnf out of lib/.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix various things to let OpenSSL even pass ``egcc -pipe -O2 -Wall
|
||||
-Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes
|
||||
@@ -9642,10 +9819,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Ben Laurie]
|
||||
|
||||
*) Support Borland C++ builder.
|
||||
[Janez Jere <jj@void.si>, modified by Ulf M<EFBFBD>ller]
|
||||
[Janez Jere <jj@void.si>, modified by Ulf Möller]
|
||||
|
||||
*) Support Mingw32.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) SHA-1 cleanups and performance enhancements.
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
@@ -9654,7 +9831,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
|
||||
*) Accept any -xxx and +xxx compiler options in Configure.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Update HPUX configuration.
|
||||
[Anonymous]
|
||||
@@ -9687,7 +9864,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Bodo Moeller]
|
||||
|
||||
*) OAEP decoding bug fix.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Support INSTALL_PREFIX for package builders, as proposed by
|
||||
David Harris.
|
||||
@@ -9710,21 +9887,21 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Niels Poppe <niels@netbox.org>]
|
||||
|
||||
*) New Configure option no-<cipher> (rsa, idea, rc5, ...).
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for
|
||||
extension adding in x509 utility.
|
||||
[Steve Henson]
|
||||
|
||||
*) Remove NOPROTO sections and error code comments.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Partial rewrite of the DEF file generator to now parse the ANSI
|
||||
prototypes.
|
||||
[Steve Henson]
|
||||
|
||||
*) New Configure options --prefix=DIR and --openssldir=DIR.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Complete rewrite of the error code script(s). It is all now handled
|
||||
by one script at the top level which handles error code gathering,
|
||||
@@ -9753,7 +9930,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Move the autogenerated header file parts to crypto/opensslconf.h.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of
|
||||
8 of keying material. Merlin has also confirmed interop with this fix
|
||||
@@ -9771,13 +9948,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
|
||||
*) Change functions to ANSI C.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix typos in error codes.
|
||||
[Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf M<EFBFBD>ller]
|
||||
[Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]
|
||||
|
||||
*) Remove defunct assembler files from Configure.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) SPARC v8 assembler BIGNUM implementation.
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
@@ -9814,7 +9991,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) New Configure option "rsaref".
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Don't auto-generate pem.h.
|
||||
[Bodo Moeller]
|
||||
@@ -9862,7 +10039,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) New functions DSA_do_sign and DSA_do_verify to provide access to
|
||||
the raw DSA values prior to ASN.1 encoding.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Tweaks to Configure
|
||||
[Niels Poppe <niels@netbox.org>]
|
||||
@@ -9872,11 +10049,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) New variables $(RANLIB) and $(PERL) in the Makefiles.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) New config option to avoid instructions that are illegal on the 80386.
|
||||
The default code is faster, but requires at least a 486.
|
||||
[Ulf M<EFBFBD>ller]
|
||||
[Ulf Möller]
|
||||
|
||||
*) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and
|
||||
SSL2_SERVER_VERSION (not used at all) macros, which are now the
|
||||
@@ -10415,7 +10592,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
Hagino <itojun@kame.net>]
|
||||
|
||||
*) File was opened incorrectly in randfile.c.
|
||||
[Ulf M<EFBFBD>ller <ulf@fitug.de>]
|
||||
[Ulf Möller <ulf@fitug.de>]
|
||||
|
||||
*) Beginning of support for GeneralizedTime. d2i, i2d, check and print
|
||||
functions. Also ASN1_TIME suite which is a CHOICE of UTCTime or
|
||||
@@ -10425,7 +10602,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Steve Henson]
|
||||
|
||||
*) Correct Linux 1 recognition in config.
|
||||
[Ulf M<EFBFBD>ller <ulf@fitug.de>]
|
||||
[Ulf Möller <ulf@fitug.de>]
|
||||
|
||||
*) Remove pointless MD5 hash when using DSA keys in ca.
|
||||
[Anonymous <nobody@replay.com>]
|
||||
@@ -10572,7 +10749,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
|
||||
*) Fix the RSA header declarations that hid a bug I fixed in 0.9.0b but
|
||||
was already fixed by Eric for 0.9.1 it seems.
|
||||
[Ben Laurie - pointed out by Ulf M<EFBFBD>ller <ulf@fitug.de>]
|
||||
[Ben Laurie - pointed out by Ulf Möller <ulf@fitug.de>]
|
||||
|
||||
*) Autodetect FreeBSD3.
|
||||
[Ben Laurie]
|
||||
|
38
CONTRIBUTING
Normal file
38
CONTRIBUTING
Normal file
@@ -0,0 +1,38 @@
|
||||
HOW TO CONTRIBUTE TO OpenSSL
|
||||
----------------------------
|
||||
|
||||
Development is coordinated on the openssl-dev mailing list (see
|
||||
http://www.openssl.org for information on subscribing). If you
|
||||
would like to submit a patch, send it to rt@openssl.org with
|
||||
the string "[PATCH]" in the subject. Please be sure to include a
|
||||
textual explanation of what your patch does.
|
||||
|
||||
You can also make GitHub pull requests. If you do this, please also send
|
||||
mail to rt@openssl.org with a brief description and a link to the PR so
|
||||
that we can more easily keep track of it.
|
||||
|
||||
If you are unsure as to whether a feature will be useful for the general
|
||||
OpenSSL community please discuss it on the openssl-dev mailing list first.
|
||||
Someone may be already working on the same thing or there may be a good
|
||||
reason as to why that feature isn't implemented.
|
||||
|
||||
Patches should be as up to date as possible, preferably relative to the
|
||||
current Git or the last snapshot. They should follow our coding style
|
||||
(see https://www.openssl.org/policies/codingstyle.html) and compile without
|
||||
warnings using the --strict-warnings flag. OpenSSL compiles on many varied
|
||||
platforms: try to ensure you only use portable features.
|
||||
|
||||
Our preferred format for patch files is "git format-patch" output. For example
|
||||
to provide a patch file containing the last commit in your local git repository
|
||||
use the following command:
|
||||
|
||||
# git format-patch --stdout HEAD^ >mydiffs.patch
|
||||
|
||||
Another method of creating an acceptable patch file without using git is as
|
||||
follows:
|
||||
|
||||
# cd openssl-work
|
||||
# [your changes]
|
||||
# ./Configure dist; make clean
|
||||
# cd ..
|
||||
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
50
Configure
50
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;
|
||||
|
||||
@@ -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,7 +272,7 @@ 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.
|
||||
@@ -398,7 +415,8 @@ my %table=(
|
||||
"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 -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 -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-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",
|
||||
"debug-linux-x86_64-clang", "clang: -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -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",
|
||||
@@ -419,7 +437,7 @@ my %table=(
|
||||
#### 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 -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 -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)",
|
||||
@@ -454,7 +472,7 @@ my %table=(
|
||||
"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 -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-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:-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
|
||||
@@ -462,7 +480,7 @@ my %table=(
|
||||
# triggered by RIPEMD160 code.
|
||||
"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", "gcc:-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)",
|
||||
"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)",
|
||||
|
||||
@@ -1195,6 +1213,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];
|
||||
@@ -1628,13 +1647,23 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
|
||||
$shlib_minor=$2;
|
||||
}
|
||||
|
||||
my $ecc = $cc;
|
||||
$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
|
||||
|
||||
if ($strict_warnings)
|
||||
{
|
||||
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/)
|
||||
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
|
||||
}
|
||||
if ($ecc eq "clang")
|
||||
{
|
||||
foreach $wopt (split /\s+/, $clang_devteam_warn)
|
||||
{
|
||||
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1686,6 +1715,7 @@ while (<IN>)
|
||||
s/^AR=\s*ar/AR= $ar/;
|
||||
s/^RANLIB=.*/RANLIB= $ranlib/;
|
||||
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
|
||||
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
|
||||
}
|
||||
s/^CFLAG=.*$/CFLAG= $cflags/;
|
||||
s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
|
||||
|
72
Makefile.org
72
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
|
||||
@@ -203,7 +203,9 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
|
||||
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
|
||||
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
|
||||
|
||||
BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
|
||||
# LC_ALL=C ensures that error [and other] messages are delivered in
|
||||
# same language for uniform treatment.
|
||||
BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
|
||||
CC='$(CC)' CFLAG='$(CFLAG)' \
|
||||
AS='$(CC)' ASFLAG='$(CFLAG) -c' \
|
||||
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
|
||||
@@ -269,21 +271,25 @@ reflect:
|
||||
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
|
||||
|
||||
sub_all: build_all
|
||||
|
||||
build_all: build_libs build_apps build_tests build_tools
|
||||
|
||||
build_libs: build_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)
|
||||
build_ssl:
|
||||
build_ssl: build_crypto
|
||||
@dir=ssl; target=all; $(BUILD_ONE_CMD)
|
||||
build_engines:
|
||||
build_engines: build_crypto
|
||||
@dir=engines; target=all; $(BUILD_ONE_CMD)
|
||||
build_apps:
|
||||
build_apps: build_libs
|
||||
@dir=apps; target=all; $(BUILD_ONE_CMD)
|
||||
build_tests:
|
||||
build_tests: build_libs
|
||||
@dir=test; target=all; $(BUILD_ONE_CMD)
|
||||
build_tools:
|
||||
build_tools: build_libs
|
||||
@dir=tools; target=all; $(BUILD_ONE_CMD)
|
||||
|
||||
all_testapps: build_libs build_testapps
|
||||
@@ -457,6 +463,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,50 +490,37 @@ 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
|
||||
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
|
||||
# tar does not support the --files-from option.
|
||||
tar:
|
||||
TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
|
||||
--owner openssl:0 --group openssl:0 \
|
||||
--transform 's|^|openssl-$(VERSION)/|' \
|
||||
-cvf -
|
||||
|
||||
../$(TARFILE).list:
|
||||
find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
|
||||
\! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
|
||||
\! -name '*test' \! -name '.#*' \! -name '*~' \
|
||||
| sort > ../$(TARFILE).list
|
||||
|
||||
tar: ../$(TARFILE).list
|
||||
find . -type d -print | xargs chmod 755
|
||||
find . -type f -print | xargs chmod a+r
|
||||
find . -type f -perm -0100 -print | xargs chmod a+x
|
||||
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
|
||||
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
|
||||
tardy --user_number=0 --user_name=openssl \
|
||||
--group_number=0 --group_name=openssl \
|
||||
--prefix=openssl-$(VERSION) - |\
|
||||
gzip --best >../$(TARFILE).gz; \
|
||||
rm -f ../$(TARFILE).list; \
|
||||
$(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
|
||||
rm -f ../$(TARFILE).list
|
||||
ls -l ../$(TARFILE).gz
|
||||
|
||||
tar-snap:
|
||||
@$(TAR) $(TARFLAGS) -cvf - \
|
||||
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
|
||||
tardy --user_number=0 --user_name=openssl \
|
||||
--group_number=0 --group_name=openssl \
|
||||
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
|
||||
tar-snap: ../$(TARFILE).list
|
||||
$(TAR_COMMAND) > ../$(TARFILE)
|
||||
rm -f ../$(TARFILE).list
|
||||
ls -l ../$(TARFILE)
|
||||
|
||||
dist:
|
||||
|
26
NEWS
26
NEWS
@@ -5,6 +5,32 @@
|
||||
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.2d and OpenSSL 1.0.2e [3 Dec 2015]
|
||||
|
||||
o BN_mod_exp may produce incorrect results on x86_64 (CVE-2015-3193)
|
||||
o Certificate verify crash with missing PSS parameter (CVE-2015-3194)
|
||||
o X509_ATTRIBUTE memory leak (CVE-2015-3195)
|
||||
o Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs
|
||||
o In DSA_generate_parameters_ex, if the provided seed is too short,
|
||||
return an error
|
||||
|
||||
Major changes between OpenSSL 1.0.2c and OpenSSL 1.0.2d [9 Jul 2015]
|
||||
|
||||
o Alternate chains certificate forgery (CVE-2015-1793)
|
||||
o Race condition handling PSK identify hint (CVE-2015-3196)
|
||||
|
||||
Major changes between OpenSSL 1.0.2b and OpenSSL 1.0.2c [12 Jun 2015]
|
||||
|
||||
o Fix HMAC ABI incompatibility
|
||||
|
||||
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)
|
||||
|
176
README
176
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 1.0.2a 19 Mar 2015
|
||||
OpenSSL 1.0.2e 3 Dec 2015
|
||||
|
||||
Copyright (c) 1998-2011 The OpenSSL Project
|
||||
Copyright (c) 1998-2015 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
|
||||
The OpenSSL Project is a collaborative effort to develop a robust,
|
||||
commercial-grade, fully featured, and Open Source toolkit implementing the
|
||||
Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
|
||||
protocols as well as a full-strength general purpose cryptography library.
|
||||
The project is managed by a worldwide community of volunteers that use the
|
||||
Internet to communicate, plan, and develop the OpenSSL toolkit and its
|
||||
related documentation.
|
||||
Secure Sockets Layer (SSLv3) and Transport Layer Security (TLS) protocols as
|
||||
well as a full-strength general purpose cryptograpic library. The project is
|
||||
managed by a worldwide community of volunteers that use the Internet to
|
||||
communicate, plan, and develop the OpenSSL toolkit and its related
|
||||
documentation.
|
||||
|
||||
OpenSSL is based on the excellent SSLeay library developed from Eric A. Young
|
||||
OpenSSL is descended from the SSLeay library developed by Eric A. Young
|
||||
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
|
||||
OpenSSL license plus the SSLeay license) situation, which basically means
|
||||
that you are free to get and use it for commercial and non-commercial
|
||||
purposes as long as you fulfill the conditions of both licenses.
|
||||
OpenSSL license plus the SSLeay license), which means that you are free to
|
||||
get and use it for commercial and non-commercial purposes as long as you
|
||||
fulfill the conditions of both licenses.
|
||||
|
||||
OVERVIEW
|
||||
--------
|
||||
@@ -28,90 +28,39 @@
|
||||
The OpenSSL toolkit includes:
|
||||
|
||||
libssl.a:
|
||||
Implementation of SSLv2, SSLv3, TLSv1 and the required code to support
|
||||
both SSLv2, SSLv3 and TLSv1 in the one server and client.
|
||||
Provides the client and server-side implementations for SSLv3 and TLS.
|
||||
|
||||
libcrypto.a:
|
||||
General encryption and X.509 v1/v3 stuff needed by SSL/TLS but not
|
||||
actually logically part of it. It includes routines for the following:
|
||||
|
||||
Ciphers
|
||||
libdes - EAY's libdes DES encryption package which was floating
|
||||
around the net for a few years, and was then relicensed by
|
||||
him as part of SSLeay. It includes 15 'modes/variations'
|
||||
of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb;
|
||||
pcbc and a more general form of cfb and ofb) including desx
|
||||
in cbc mode, a fast crypt(3), and routines to read
|
||||
passwords from the keyboard.
|
||||
RC4 encryption,
|
||||
RC2 encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||
Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||
IDEA encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||
|
||||
Digests
|
||||
MD5 and MD2 message digest algorithms, fast implementations,
|
||||
SHA (SHA-0) and SHA-1 message digest algorithms,
|
||||
MDC2 message digest. A DES based hash that is popular on smart cards.
|
||||
|
||||
Public Key
|
||||
RSA encryption/decryption/generation.
|
||||
There is no limit on the number of bits.
|
||||
DSA encryption/decryption/generation.
|
||||
There is no limit on the number of bits.
|
||||
Diffie-Hellman key-exchange/key generation.
|
||||
There is no limit on the number of bits.
|
||||
|
||||
X.509v3 certificates
|
||||
X509 encoding/decoding into/from binary ASN1 and a PEM
|
||||
based ASCII-binary encoding which supports encryption with a
|
||||
private key. Program to generate RSA and DSA certificate
|
||||
requests and to generate RSA and DSA certificates.
|
||||
|
||||
Systems
|
||||
The normal digital envelope routines and base64 encoding. Higher
|
||||
level access to ciphers and digests by name. New ciphers can be
|
||||
loaded at run time. The BIO io system which is a simple non-blocking
|
||||
IO abstraction. Current methods supported are file descriptors,
|
||||
sockets, socket accept, socket connect, memory buffer, buffering, SSL
|
||||
client/server, file pointer, encryption, digest, non-blocking testing
|
||||
and null.
|
||||
|
||||
Data structures
|
||||
A dynamically growing hashing system
|
||||
A simple stack.
|
||||
A Configuration loader that uses a format similar to MS .ini files.
|
||||
Provides general cryptographic and X.509 support needed by SSL/TLS but
|
||||
not logically part of it.
|
||||
|
||||
openssl:
|
||||
A command line tool that can be used for:
|
||||
Creation of RSA, DH and DSA key parameters
|
||||
Creation of key parameters
|
||||
Creation of X.509 certificates, CSRs and CRLs
|
||||
Calculation of Message Digests
|
||||
Encryption and Decryption with Ciphers
|
||||
SSL/TLS Client and Server Tests
|
||||
Calculation of message digests
|
||||
Encryption and decryption
|
||||
SSL/TLS client and server tests
|
||||
Handling of S/MIME signed or encrypted mail
|
||||
And more...
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
To install this package under a Unix derivative, read the INSTALL file. For
|
||||
a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read
|
||||
INSTALL.VMS.
|
||||
|
||||
Read the documentation in the doc/ directory. It is quite rough, but it
|
||||
lists the functions; you will probably have to look at the code to work out
|
||||
how to use them. Look at the example programs.
|
||||
|
||||
PROBLEMS
|
||||
--------
|
||||
|
||||
For some platforms, there are some known problems that may affect the user
|
||||
or application author. We try to collect those in doc/PROBLEMS, with current
|
||||
thoughts on how they should be solved in a future of OpenSSL.
|
||||
See the appropriate file:
|
||||
INSTALL Linux, Unix, etc.
|
||||
INSTALL.DJGPP DOS platform with DJGPP
|
||||
INSTALL.NW Netware
|
||||
INSTALL.OS2 OS/2
|
||||
INSTALL.VMS VMS
|
||||
INSTALL.W32 Windows (32bit)
|
||||
INSTALL.W64 Windows (64bit)
|
||||
INSTALL.WCE Windows CE
|
||||
|
||||
SUPPORT
|
||||
-------
|
||||
|
||||
See the OpenSSL website www.openssl.org for details of how to obtain
|
||||
See the OpenSSL website www.openssl.org for details on how to obtain
|
||||
commercial technical support.
|
||||
|
||||
If you have any problems with OpenSSL then please take the following steps
|
||||
@@ -137,56 +86,33 @@
|
||||
|
||||
Email the report to:
|
||||
|
||||
openssl-bugs@openssl.org
|
||||
rt@openssl.org
|
||||
|
||||
Note that the request tracker should NOT be used for general assistance
|
||||
or support queries. Just because something doesn't work the way you expect
|
||||
does not mean it is necessarily a bug in OpenSSL.
|
||||
In order to avoid spam, this is a moderated mailing list, and it might
|
||||
take a day for the ticket to show up. (We also scan posts to make sure
|
||||
that security disclosures aren't publically posted by mistake.) Mail to
|
||||
this address is recorded in the public RT (request tracker) database (see
|
||||
https://www.openssl.org/support/rt.html for details) and also forwarded
|
||||
the public openssl-dev mailing list. Confidential mail may be sent to
|
||||
openssl-security@openssl.org (PGP key available from the key servers).
|
||||
|
||||
Note that mail to openssl-bugs@openssl.org is recorded in the public
|
||||
request tracker database (see https://www.openssl.org/support/rt.html
|
||||
for details) and also forwarded to a public mailing list. Confidential
|
||||
mail may be sent to openssl-security@openssl.org (PGP key available from
|
||||
the key servers).
|
||||
Please do NOT use this for general assistance or support queries.
|
||||
Just because something doesn't work the way you expect does not mean it
|
||||
is necessarily a bug in OpenSSL.
|
||||
|
||||
You can also make GitHub pull requests. If you do this, please also send
|
||||
mail to rt@openssl.org with a link to the PR so that we can more easily
|
||||
keep track of it.
|
||||
|
||||
HOW TO CONTRIBUTE TO OpenSSL
|
||||
----------------------------
|
||||
|
||||
Development is coordinated on the openssl-dev mailing list (see
|
||||
http://www.openssl.org for information on subscribing). If you
|
||||
would like to submit a patch, send it to openssl-bugs@openssl.org with
|
||||
the string "[PATCH]" in the subject. Please be sure to include a
|
||||
textual explanation of what your patch does.
|
||||
See CONTRIBUTING
|
||||
|
||||
If you are unsure as to whether a feature will be useful for the general
|
||||
OpenSSL community please discuss it on the openssl-dev mailing list first.
|
||||
Someone may be already working on the same thing or there may be a good
|
||||
reason as to why that feature isn't implemented.
|
||||
|
||||
Patches should be as up to date as possible, preferably relative to the
|
||||
current Git or the last snapshot. They should follow the coding style of
|
||||
OpenSSL and compile without warnings. Some of the core team developer targets
|
||||
can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
|
||||
compiles on many varied platforms: try to ensure you only use portable
|
||||
features.
|
||||
|
||||
Note: For legal reasons, contributions from the US can be accepted only
|
||||
if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
|
||||
(formerly BXA) with a copy to the ENC Encryption Request Coordinator;
|
||||
please take some time to look at
|
||||
http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
|
||||
and
|
||||
http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e))
|
||||
for the details. If "your encryption source code is too large to serve as
|
||||
an email attachment", they are glad to receive it by fax instead; hope you
|
||||
have a cheap long-distance plan.
|
||||
|
||||
Our preferred format for changes is "diff -u" output. You might
|
||||
generate it like this:
|
||||
|
||||
# cd openssl-work
|
||||
# [your changes]
|
||||
# ./Configure dist; make clean
|
||||
# cd ..
|
||||
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
||||
LEGALITIES
|
||||
----------
|
||||
|
||||
A number of nations, in particular the U.S., restrict the use or export
|
||||
of cryptography. If you are potentially subject to such restrictions
|
||||
you should seek competent professional legal advice before attempting to
|
||||
develop or distribute cryptographic code.
|
||||
|
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
|
||||
|
@@ -1,8 +0,0 @@
|
||||
openssl
|
||||
Makefile.save
|
||||
der_chop
|
||||
der_chop.bak
|
||||
CA.pl
|
||||
*.flc
|
||||
semantic.cache
|
||||
*.dll
|
@@ -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)
|
||||
|
@@ -124,10 +124,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
|
||||
char buffer[200];
|
||||
|
||||
#ifdef OPENSSL_SYS_WINDOWS
|
||||
BIO_printf(bio_e, "Loading 'screen' into random state -");
|
||||
BIO_flush(bio_e);
|
||||
RAND_screen();
|
||||
BIO_printf(bio_e, " done\n");
|
||||
#endif
|
||||
|
||||
if (file == NULL)
|
||||
|
15
apps/apps.c
15
apps/apps.c
@@ -119,9 +119,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB)
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@@ -574,7 +571,7 @@ 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) {
|
||||
if (!prompt) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
UI_free(ui);
|
||||
return 0;
|
||||
@@ -588,7 +585,7 @@ 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) {
|
||||
if (!buff) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
UI_free(ui);
|
||||
OPENSSL_free(prompt);
|
||||
@@ -1352,7 +1349,11 @@ int set_name_ex(unsigned long *flags, const char *arg)
|
||||
{"ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
return set_multi_opts(flags, arg, ex_tbl);
|
||||
if (set_multi_opts(flags, arg, ex_tbl) == 0)
|
||||
return 0;
|
||||
if ((*flags & XN_FLAG_SEP_MASK) == 0)
|
||||
*flags |= XN_FLAG_SEP_CPLUS_SPC;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int set_ext_copy(int *copy_type, const char *arg)
|
||||
@@ -2371,6 +2372,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;
|
||||
|
||||
|
@@ -313,9 +313,9 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
typ = ASN1_TYPE_get(at);
|
||||
if ((typ == V_ASN1_OBJECT)
|
||||
|| (typ == V_ASN1_BOOLEAN)
|
||||
|| (typ == V_ASN1_NULL)) {
|
||||
BIO_printf(bio_err, "Can't parse %s type\n",
|
||||
typ == V_ASN1_NULL ? "NULL" : "OBJECT");
|
||||
BIO_printf(bio_err, "Can't parse %s type\n", ASN1_tag2str(typ));
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
24
apps/ca.c
24
apps/ca.c
@@ -99,25 +99,19 @@
|
||||
#undef PROG
|
||||
#define PROG ca_main
|
||||
|
||||
#define BASE_SECTION "ca"
|
||||
#define CONFIG_FILE "openssl.cnf"
|
||||
#define BASE_SECTION "ca"
|
||||
#define CONFIG_FILE "openssl.cnf"
|
||||
|
||||
#define ENV_DEFAULT_CA "default_ca"
|
||||
|
||||
#define STRING_MASK "string_mask"
|
||||
#define STRING_MASK "string_mask"
|
||||
#define UTF8_IN "utf8"
|
||||
|
||||
#define ENV_DIR "dir"
|
||||
#define ENV_CERTS "certs"
|
||||
#define ENV_CRL_DIR "crl_dir"
|
||||
#define ENV_CA_DB "CA_DB"
|
||||
#define ENV_NEW_CERTS_DIR "new_certs_dir"
|
||||
#define ENV_CERTIFICATE "certificate"
|
||||
#define ENV_SERIAL "serial"
|
||||
#define ENV_CRLNUMBER "crlnumber"
|
||||
#define ENV_CRL "crl"
|
||||
#define ENV_PRIVATE_KEY "private_key"
|
||||
#define ENV_RANDFILE "RANDFILE"
|
||||
#define ENV_DEFAULT_DAYS "default_days"
|
||||
#define ENV_DEFAULT_STARTDATE "default_startdate"
|
||||
#define ENV_DEFAULT_ENDDATE "default_enddate"
|
||||
@@ -563,7 +557,7 @@ int MAIN(int argc, char **argv)
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
len = strlen(s) + sizeof(CONFIG_FILE);
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if(!tofree) {
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -571,7 +565,7 @@ int MAIN(int argc, char **argv)
|
||||
#else
|
||||
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if(!tofree) {
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -2538,6 +2532,8 @@ static int do_updatedb(CA_DB *db)
|
||||
char **rrow, *a_tm_s;
|
||||
|
||||
a_tm = ASN1_UTCTIME_new();
|
||||
if (a_tm == NULL)
|
||||
return -1;
|
||||
|
||||
/* get actual time and make a string */
|
||||
a_tm = X509_gmtime_adj(a_tm, 0);
|
||||
@@ -2821,7 +2817,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
ASN1_GENERALIZEDTIME *comp_time = NULL;
|
||||
tmp = BUF_strdup(str);
|
||||
|
||||
if(!tmp) {
|
||||
if (!tmp) {
|
||||
BIO_printf(bio_err, "memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -2843,7 +2839,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
|
||||
if (prevtm) {
|
||||
*prevtm = ASN1_UTCTIME_new();
|
||||
if(!*prevtm) {
|
||||
if (!*prevtm) {
|
||||
BIO_printf(bio_err, "memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -2887,7 +2883,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
goto err;
|
||||
}
|
||||
comp_time = ASN1_GENERALIZEDTIME_new();
|
||||
if(!comp_time) {
|
||||
if (!comp_time) {
|
||||
BIO_printf(bio_err, "memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
|
@@ -463,7 +463,7 @@ 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) {
|
||||
if (!nparam) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto argerr;
|
||||
}
|
||||
@@ -645,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,
|
||||
|
@@ -416,14 +416,13 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (check) {
|
||||
if (group == NULL)
|
||||
BIO_printf(bio_err, "no elliptic curve parameters\n");
|
||||
BIO_printf(bio_err, "checking elliptic curve parameters: ");
|
||||
if (!EC_GROUP_check(group, NULL)) {
|
||||
BIO_printf(bio_err, "failed\n");
|
||||
ERR_print_errors(bio_err);
|
||||
} else
|
||||
BIO_printf(bio_err, "ok\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err, "ok\n");
|
||||
|
||||
}
|
||||
|
||||
|
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;
|
||||
}
|
||||
|
@@ -99,8 +99,6 @@ static void identity(char *ptr)
|
||||
|
||||
static int append_buf(char **buf, const char *s, int *size, int step)
|
||||
{
|
||||
int l = strlen(s);
|
||||
|
||||
if (*buf == NULL) {
|
||||
*size = step;
|
||||
*buf = OPENSSL_malloc(*size);
|
||||
@@ -109,9 +107,6 @@ static int append_buf(char **buf, const char *s, int *size, int step)
|
||||
**buf = '\0';
|
||||
}
|
||||
|
||||
if (**buf != '\0')
|
||||
l += 2; /* ", " */
|
||||
|
||||
if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
|
||||
*size += step;
|
||||
*buf = OPENSSL_realloc(*buf, *size);
|
||||
|
@@ -209,6 +209,7 @@ int MAIN(int argc, char **argv)
|
||||
OPENSSL_free(tport);
|
||||
if (tpath)
|
||||
OPENSSL_free(tpath);
|
||||
thost = tport = tpath = NULL;
|
||||
if (args[1]) {
|
||||
args++;
|
||||
if (!OCSP_parse_url(*args, &host, &port, &path, &use_ssl)) {
|
||||
@@ -535,6 +536,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,
|
||||
@@ -1258,8 +1261,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (BIO_get_fd(cbio, &fd) <= 0) {
|
||||
BIO_puts(err, "Can't get connection fd\n");
|
||||
if (BIO_get_fd(cbio, &fd) < 0) {
|
||||
BIO_puts(bio_err, "Can't get connection fd\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
@@ -134,13 +134,6 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
apps_startup();
|
||||
|
||||
# ifdef OPENSSL_FIPS
|
||||
if (FIPS_mode())
|
||||
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
else
|
||||
# endif
|
||||
cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
|
||||
enc = EVP_des_ede3_cbc();
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
@@ -148,6 +141,13 @@ int MAIN(int argc, char **argv)
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
# ifdef OPENSSL_FIPS
|
||||
if (FIPS_mode())
|
||||
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
else
|
||||
# endif
|
||||
cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
|
||||
args = argv + 1;
|
||||
|
||||
while (*args) {
|
||||
|
10
apps/s_cb.c
10
apps/s_cb.c
@@ -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,7 +457,7 @@ int ssl_print_curves(BIO *out, SSL *s, int noshared)
|
||||
if (ncurves <= 0)
|
||||
return 1;
|
||||
curves = OPENSSL_malloc(ncurves * sizeof(int));
|
||||
if(!curves) {
|
||||
if (!curves) {
|
||||
BIO_puts(out, "Malloc error getting supported curves\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -980,6 +981,11 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||
extname = "next protocol";
|
||||
break;
|
||||
#endif
|
||||
#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
|
||||
case TLSEXT_TYPE_application_layer_protocol_negotiation:
|
||||
extname = "application layer protocol negotiation";
|
||||
break;
|
||||
#endif
|
||||
|
||||
case TLSEXT_TYPE_padding:
|
||||
extname = "TLS padding";
|
||||
@@ -1012,7 +1018,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,
|
||||
@@ -422,6 +424,14 @@ static void sc_usage(void)
|
||||
" -no_ticket - disable use of RFC4507bis session tickets\n");
|
||||
BIO_printf(bio_err,
|
||||
" -serverinfo types - send empty ClientHello extensions (comma-separated numbers)\n");
|
||||
BIO_printf(bio_err,
|
||||
" -curves arg - Elliptic curves to advertise (colon-separated list)\n");
|
||||
BIO_printf(bio_err,
|
||||
" -sigalgs arg - Signature algorithms to support (colon-separated list)\n");
|
||||
BIO_printf(bio_err,
|
||||
" -client_sigalgs arg - Signature algorithms to support for client\n");
|
||||
BIO_printf(bio_err,
|
||||
" certificate authentication (colon-separated list)\n");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
BIO_printf(bio_err,
|
||||
@@ -560,7 +570,7 @@ static char *MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
|
||||
PW_CB_DATA cb_tmp;
|
||||
int l;
|
||||
|
||||
if(!pass) {
|
||||
if (!pass) {
|
||||
BIO_printf(bio_err, "Malloc failure\n");
|
||||
return NULL;
|
||||
}
|
||||
@@ -1336,13 +1346,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);
|
||||
@@ -2064,6 +2073,9 @@ int MAIN(int argc, char **argv)
|
||||
sk_X509_pop_free(chain, X509_free);
|
||||
if (pass)
|
||||
OPENSSL_free(pass);
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
OPENSSL_free(srp_arg.srppassin);
|
||||
#endif
|
||||
if (vpm)
|
||||
X509_VERIFY_PARAM_free(vpm);
|
||||
ssl_excert_free(exc);
|
||||
|
130
apps/s_server.c
130
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
|
||||
|
||||
@@ -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,
|
||||
@@ -632,6 +652,12 @@ static void sv_usage(void)
|
||||
" -no_ticket - disable use of RFC4507bis session tickets\n");
|
||||
BIO_printf(bio_err,
|
||||
" -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
|
||||
BIO_printf(bio_err,
|
||||
" -sigalgs arg - Signature algorithms to support (colon-separated list)\n");
|
||||
BIO_printf(bio_err,
|
||||
" -client_sigalgs arg - Signature algorithms to support for client \n");
|
||||
BIO_printf(bio_err,
|
||||
" certificate authentication (colon-separated list)\n");
|
||||
# ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
BIO_printf(bio_err,
|
||||
" -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n");
|
||||
@@ -754,7 +780,7 @@ static int ebcdic_write(BIO *b, const char *in, int inl)
|
||||
num = inl;
|
||||
wbuf =
|
||||
(EBCDIC_OUTBUFF *) OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + num);
|
||||
if(!wbuf)
|
||||
if (!wbuf)
|
||||
return 0;
|
||||
OPENSSL_free(b->ptr);
|
||||
|
||||
@@ -1865,7 +1891,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);
|
||||
|
||||
@@ -2453,8 +2483,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;
|
||||
}
|
||||
@@ -2855,6 +2887,21 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context)
|
||||
goto err;
|
||||
} else {
|
||||
BIO_printf(bio_s_out, "read R BLOCK\n");
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
if (BIO_should_io_special(io)
|
||||
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
|
||||
BIO_printf(bio_s_out, "LOOKUP renego during read\n");
|
||||
srp_callback_parm.user =
|
||||
SRP_VBASE_get_by_user(srp_callback_parm.vb,
|
||||
srp_callback_parm.login);
|
||||
if (srp_callback_parm.user)
|
||||
BIO_printf(bio_s_out, "LOOKUP done %s\n",
|
||||
srp_callback_parm.user->info);
|
||||
else
|
||||
BIO_printf(bio_s_out, "LOOKUP not successful\n");
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if defined(OPENSSL_SYS_NETWARE)
|
||||
delay(1000);
|
||||
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
|
||||
@@ -3185,6 +3232,21 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context)
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
if (BIO_should_io_special(io)
|
||||
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
|
||||
BIO_printf(bio_s_out, "LOOKUP renego during accept\n");
|
||||
srp_callback_parm.user =
|
||||
SRP_VBASE_get_by_user(srp_callback_parm.vb,
|
||||
srp_callback_parm.login);
|
||||
if (srp_callback_parm.user)
|
||||
BIO_printf(bio_s_out, "LOOKUP done %s\n",
|
||||
srp_callback_parm.user->info);
|
||||
else
|
||||
BIO_printf(bio_s_out, "LOOKUP not successful\n");
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
BIO_printf(bio_err, "CONNECTION ESTABLISHED\n");
|
||||
print_ssl_summary(bio_err, con);
|
||||
@@ -3198,6 +3260,21 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context)
|
||||
goto err;
|
||||
} else {
|
||||
BIO_printf(bio_s_out, "read R BLOCK\n");
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
if (BIO_should_io_special(io)
|
||||
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
|
||||
BIO_printf(bio_s_out, "LOOKUP renego during read\n");
|
||||
srp_callback_parm.user =
|
||||
SRP_VBASE_get_by_user(srp_callback_parm.vb,
|
||||
srp_callback_parm.login);
|
||||
if (srp_callback_parm.user)
|
||||
BIO_printf(bio_s_out, "LOOKUP done %s\n",
|
||||
srp_callback_parm.user->info);
|
||||
else
|
||||
BIO_printf(bio_s_out, "LOOKUP not successful\n");
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if defined(OPENSSL_SYS_NETWARE)
|
||||
delay(1000);
|
||||
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
|
||||
@@ -3281,7 +3358,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.
|
||||
@@ -3323,7 +3401,7 @@ static int add_session(SSL *ssl, SSL_SESSION *session)
|
||||
unsigned char *p;
|
||||
|
||||
sess = OPENSSL_malloc(sizeof(simple_ssl_session));
|
||||
if(!sess) {
|
||||
if (!sess) {
|
||||
BIO_printf(bio_err, "Out of memory adding session to external cache\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -3334,12 +3412,12 @@ 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) {
|
||||
if (!sess->id || !sess->der) {
|
||||
BIO_printf(bio_err, "Out of memory adding session to external cache\n");
|
||||
|
||||
if(sess->id)
|
||||
if (sess->id)
|
||||
OPENSSL_free(sess->id);
|
||||
if(sess->der)
|
||||
if (sess->der)
|
||||
OPENSSL_free(sess->der);
|
||||
OPENSSL_free(sess);
|
||||
return 0;
|
||||
|
@@ -302,7 +302,7 @@ static int parseArgs(int argc, char **argv)
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
maxTime = atoi(*(++argv));
|
||||
if(maxTime <= 0) {
|
||||
if (maxTime <= 0) {
|
||||
BIO_printf(bio_err, "time must be > 0\n");
|
||||
badop = 1;
|
||||
}
|
||||
|
@@ -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,
|
||||
|
11
apps/speed.c
11
apps/speed.c
@@ -2775,7 +2775,7 @@ 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) {
|
||||
if (!inp || !out) {
|
||||
BIO_printf(bio_err,"Out of memory\n");
|
||||
goto end;
|
||||
}
|
||||
@@ -2791,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;
|
||||
@@ -2826,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);
|
||||
}
|
||||
}
|
||||
@@ -2865,9 +2866,9 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher)
|
||||
}
|
||||
|
||||
end:
|
||||
if(inp)
|
||||
if (inp)
|
||||
OPENSSL_free(inp);
|
||||
if(out)
|
||||
if (out)
|
||||
OPENSSL_free(out);
|
||||
}
|
||||
#endif
|
||||
|
@@ -435,7 +435,7 @@ int MAIN(int argc, char **argv)
|
||||
# ifdef OPENSSL_SYS_VMS
|
||||
len = strlen(s) + sizeof(CONFIG_FILE);
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if(!tofree) {
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -443,7 +443,7 @@ int MAIN(int argc, char **argv)
|
||||
# else
|
||||
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
|
||||
tofree = OPENSSL_malloc(len);
|
||||
if(!tofree) {
|
||||
if (!tofree) {
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
|
@@ -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
|
||||
|
60
appveyor.yml
Normal file
60
appveyor.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- VSVER: 9
|
||||
- VSVER: 10
|
||||
- VSVER: 11
|
||||
- VSVER: 12
|
||||
- VSVER: 14
|
||||
|
||||
configuration:
|
||||
- plain
|
||||
- shared
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- platform: x64
|
||||
VSVER: 9
|
||||
- platform: x64
|
||||
VSVER: 10
|
||||
- platform: x64
|
||||
VSVER: 11
|
||||
|
||||
before_build:
|
||||
- ps: >-
|
||||
If ($env:Platform -Match "x86") {
|
||||
$env:VCVARS_PLATFORM="x86"
|
||||
$env:TARGET="VC-WIN32"
|
||||
$env:DO="do_ms"
|
||||
} Else {
|
||||
$env:VCVARS_PLATFORM="amd64"
|
||||
$env:TARGET="VC-WIN64A"
|
||||
$env:DO="do_win64a"
|
||||
}
|
||||
- ps: >-
|
||||
If ($env:Configuration -Like "*shared*") {
|
||||
$env:MAK="ntdll.mak"
|
||||
} Else {
|
||||
$env:MAK="nt.mak"
|
||||
}
|
||||
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
|
||||
- call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
|
||||
- perl Configure %TARGET% no-asm
|
||||
- call ms\%DO%
|
||||
|
||||
build_script:
|
||||
- nmake /f ms\%MAK%
|
||||
|
||||
test_script:
|
||||
- nmake /f ms\%MAK% test
|
||||
|
||||
notifications:
|
||||
- provider: Email
|
||||
to:
|
||||
- openssl-commits@openssl.org
|
||||
on_build_success: false
|
||||
on_build_failure: true
|
||||
on_build_status_changed: true
|
@@ -1,8 +0,0 @@
|
||||
lib
|
||||
buildinf.h
|
||||
opensslconf.h
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
*cpuid.s
|
||||
uplink-cof.s
|
@@ -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
|
||||
|
@@ -1,8 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
aes-*.s
|
||||
aesni-*.s
|
||||
bsaes-*.s
|
||||
vpaes-*.s
|
@@ -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)
|
||||
|
@@ -45,7 +45,7 @@
|
||||
# the undertaken effort was that it appeared that in tight IA-32
|
||||
# register window little-endian flavor could achieve slightly higher
|
||||
# Instruction Level Parallelism, and it indeed resulted in up to 15%
|
||||
# better performance on most recent <EFBFBD>-archs...
|
||||
# better performance on most recent µ-archs...
|
||||
#
|
||||
# Third version adds AES_cbc_encrypt implementation, which resulted in
|
||||
# up to 40% performance imrovement of CBC benchmark results. 40% was
|
||||
@@ -224,7 +224,7 @@ sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
|
||||
$speed_limit=512; # chunks smaller than $speed_limit are
|
||||
# processed with compact routine in CBC mode
|
||||
$small_footprint=1; # $small_footprint=1 code is ~5% slower [on
|
||||
# recent <EFBFBD>-archs], but ~5 times smaller!
|
||||
# recent µ-archs], but ~5 times smaller!
|
||||
# I favor compact code to minimize cache
|
||||
# contention and in hope to "collect" 5% back
|
||||
# in real-life applications...
|
||||
@@ -565,7 +565,7 @@ sub enctransform()
|
||||
# Performance is not actually extraordinary in comparison to pure
|
||||
# x86 code. In particular encrypt performance is virtually the same.
|
||||
# Decrypt performance on the other hand is 15-20% better on newer
|
||||
# <EFBFBD>-archs [but we're thankful for *any* improvement here], and ~50%
|
||||
# µ-archs [but we're thankful for *any* improvement here], and ~50%
|
||||
# better on PIII:-) And additionally on the pros side this code
|
||||
# eliminates redundant references to stack and thus relieves/
|
||||
# minimizes the pressure on the memory bus.
|
||||
|
@@ -63,7 +63,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
|
||||
$avx = ($1>=10) + ($1>=11);
|
||||
}
|
||||
|
||||
if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
|
||||
if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
|
||||
$avx = ($2>=3.0) + ($2>3.0);
|
||||
}
|
||||
|
||||
|
@@ -94,7 +94,7 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
|
||||
$avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
|
||||
`ml64 2>&1` =~ /Version ([0-9]+)\./ &&
|
||||
$1>=10);
|
||||
$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
|
||||
$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
|
||||
|
||||
$shaext=1; ### set to zero if compiling for 1.0.1
|
||||
|
||||
|
@@ -59,7 +59,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
|
||||
$avx = ($1>=10) + ($1>=12);
|
||||
}
|
||||
|
||||
if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
|
||||
if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
|
||||
$avx = ($2>=3.0) + ($2>3.0);
|
||||
}
|
||||
|
||||
@@ -139,11 +139,8 @@ $code.=<<___ if ($avx>1);
|
||||
je ${func}_avx2
|
||||
___
|
||||
$code.=<<___;
|
||||
and \$`1<<30`,%eax # mask "Intel CPU" bit
|
||||
and \$`1<<28|1<<9`,%r10d # mask AVX+SSSE3 bits
|
||||
or %eax,%r10d
|
||||
cmp \$`1<<28|1<<9|1<<30`,%r10d
|
||||
je ${func}_avx
|
||||
and \$`1<<28`,%r10d # check for AVX
|
||||
jnz ${func}_avx
|
||||
ud2
|
||||
___
|
||||
}
|
||||
@@ -1499,13 +1496,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 +1640,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; }
|
||||
|
||||
@@ -85,7 +88,7 @@ $inout3="xmm5"; $in1="xmm5";
|
||||
$inout4="xmm6"; $in0="xmm6";
|
||||
$inout5="xmm7"; $ivec="xmm7";
|
||||
|
||||
# AESNI extenstion
|
||||
# AESNI extension
|
||||
sub aeskeygenassist
|
||||
{ my($dst,$src,$imm)=@_;
|
||||
if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/)
|
||||
@@ -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
|
||||
|
@@ -337,24 +337,27 @@ Lenc_entry:
|
||||
addi $inp, $inp, 15 # 15 is not a typo
|
||||
?lvsr $outperm, 0, $out
|
||||
?lvsl $keyperm, 0, $key # prepare for unaligned access
|
||||
vnor $outmask, v7, v7 # 0xff..ff
|
||||
lvx $inptail, 0, $inp # redundant in aligned case
|
||||
?vperm $outmask, v7, $outmask, $outperm
|
||||
lvx $outhead, 0, $out
|
||||
?vperm v0, v0, $inptail, $inpperm
|
||||
|
||||
bl _vpaes_encrypt_core
|
||||
|
||||
vperm v0, v0, v0, $outperm # rotate right/left
|
||||
vsel v1, $outhead, v0, $outmask
|
||||
vmr $outhead, v0
|
||||
stvx v1, 0, $out
|
||||
addi $out, $out, 15 # 15 is not a typo
|
||||
########
|
||||
andi. r8, $out, 15
|
||||
li r9, 16
|
||||
beq Lenc_out_aligned
|
||||
|
||||
lvx v1, 0, $out # redundant in aligned case
|
||||
vsel v1, $outhead, v1, $outmask
|
||||
stvx v1, 0, $out
|
||||
vperm v0, v0, v0, $outperm # rotate right/left
|
||||
mtctr r9
|
||||
Lenc_out_unaligned:
|
||||
stvebx v0, 0, $out
|
||||
addi $out, $out, 1
|
||||
bdnz Lenc_out_unaligned
|
||||
b Lenc_done
|
||||
|
||||
.align 4
|
||||
Lenc_out_aligned:
|
||||
stvx v0, 0, $out
|
||||
Lenc_done:
|
||||
|
||||
li r10,`15+6*$SIZE_T`
|
||||
li r11,`31+6*$SIZE_T`
|
||||
@@ -566,24 +569,27 @@ Ldec_entry:
|
||||
addi $inp, $inp, 15 # 15 is not a typo
|
||||
?lvsr $outperm, 0, $out
|
||||
?lvsl $keyperm, 0, $key
|
||||
vnor $outmask, v7, v7 # 0xff..ff
|
||||
lvx $inptail, 0, $inp # redundant in aligned case
|
||||
?vperm $outmask, v7, $outmask, $outperm
|
||||
lvx $outhead, 0, $out
|
||||
?vperm v0, v0, $inptail, $inpperm
|
||||
|
||||
bl _vpaes_decrypt_core
|
||||
|
||||
vperm v0, v0, v0, $outperm # rotate right/left
|
||||
vsel v1, $outhead, v0, $outmask
|
||||
vmr $outhead, v0
|
||||
stvx v1, 0, $out
|
||||
addi $out, $out, 15 # 15 is not a typo
|
||||
########
|
||||
andi. r8, $out, 15
|
||||
li r9, 16
|
||||
beq Ldec_out_aligned
|
||||
|
||||
lvx v1, 0, $out # redundant in aligned case
|
||||
vsel v1, $outhead, v1, $outmask
|
||||
stvx v1, 0, $out
|
||||
vperm v0, v0, v0, $outperm # rotate right/left
|
||||
mtctr r9
|
||||
Ldec_out_unaligned:
|
||||
stvebx v0, 0, $out
|
||||
addi $out, $out, 1
|
||||
bdnz Ldec_out_unaligned
|
||||
b Ldec_done
|
||||
|
||||
.align 4
|
||||
Ldec_out_aligned:
|
||||
stvx v0, 0, $out
|
||||
Ldec_done:
|
||||
|
||||
li r10,`15+6*$SIZE_T`
|
||||
li r11,`31+6*$SIZE_T`
|
||||
@@ -658,11 +664,11 @@ Ldec_entry:
|
||||
$PUSH r0, `$FRAME+$SIZE_T*2+$LRSAVE`($sp)
|
||||
|
||||
and r30, r5, r9 # copy length&-16
|
||||
andi. r9, $out, 15 # is $out aligned?
|
||||
mr r5, r6 # copy pointer to key
|
||||
mr r31, r7 # copy pointer to iv
|
||||
blt Lcbc_abort
|
||||
cmpwi r8, 0 # test direction
|
||||
li r6, -1
|
||||
mcrf cr1, cr0 # put aside $out alignment flag
|
||||
mr r7, r12 # copy vrsave
|
||||
mtspr 256, r6 # preserve all AltiVec registers
|
||||
|
||||
@@ -672,6 +678,7 @@ Ldec_entry:
|
||||
lvx v25, r9, r31
|
||||
?vperm v24, v24, v25, $inpperm
|
||||
|
||||
cmpwi r8, 0 # test direction
|
||||
neg r8, $inp # prepare for unaligned access
|
||||
vxor v7, v7, v7
|
||||
?lvsl $keyperm, 0, $key
|
||||
@@ -681,13 +688,37 @@ Ldec_entry:
|
||||
lvx $inptail, 0, $inp
|
||||
?vperm $outmask, v7, $outmask, $outperm
|
||||
addi $inp, $inp, 15 # 15 is not a typo
|
||||
lvx $outhead, 0, $out
|
||||
|
||||
beq Lcbc_decrypt
|
||||
|
||||
bl _vpaes_encrypt_preheat
|
||||
li r0, 16
|
||||
|
||||
beq cr1, Lcbc_enc_loop # $out is aligned
|
||||
|
||||
vmr v0, $inptail
|
||||
lvx $inptail, 0, $inp
|
||||
addi $inp, $inp, 16
|
||||
?vperm v0, v0, $inptail, $inpperm
|
||||
vxor v0, v0, v24 # ^= iv
|
||||
|
||||
bl _vpaes_encrypt_core
|
||||
|
||||
andi. r8, $out, 15
|
||||
vmr v24, v0 # put aside iv
|
||||
sub r9, $out, r8
|
||||
vperm $outhead, v0, v0, $outperm # rotate right/left
|
||||
|
||||
Lcbc_enc_head:
|
||||
stvebx $outhead, r8, r9
|
||||
cmpwi r8, 15
|
||||
addi r8, r8, 1
|
||||
bne Lcbc_enc_head
|
||||
|
||||
sub. r30, r30, r0 # len -= 16
|
||||
addi $out, $out, 16
|
||||
beq Lcbc_unaligned_done
|
||||
|
||||
Lcbc_enc_loop:
|
||||
vmr v0, $inptail
|
||||
lvx $inptail, 0, $inp
|
||||
@@ -713,6 +744,32 @@ Lcbc_decrypt:
|
||||
bl _vpaes_decrypt_preheat
|
||||
li r0, 16
|
||||
|
||||
beq cr1, Lcbc_dec_loop # $out is aligned
|
||||
|
||||
vmr v0, $inptail
|
||||
lvx $inptail, 0, $inp
|
||||
addi $inp, $inp, 16
|
||||
?vperm v0, v0, $inptail, $inpperm
|
||||
vmr v25, v0 # put aside input
|
||||
|
||||
bl _vpaes_decrypt_core
|
||||
|
||||
andi. r8, $out, 15
|
||||
vxor v0, v0, v24 # ^= iv
|
||||
vmr v24, v25
|
||||
sub r9, $out, r8
|
||||
vperm $outhead, v0, v0, $outperm # rotate right/left
|
||||
|
||||
Lcbc_dec_head:
|
||||
stvebx $outhead, r8, r9
|
||||
cmpwi r8, 15
|
||||
addi r8, r8, 1
|
||||
bne Lcbc_dec_head
|
||||
|
||||
sub. r30, r30, r0 # len -= 16
|
||||
addi $out, $out, 16
|
||||
beq Lcbc_unaligned_done
|
||||
|
||||
Lcbc_dec_loop:
|
||||
vmr v0, $inptail
|
||||
lvx $inptail, 0, $inp
|
||||
@@ -733,23 +790,29 @@ Lcbc_dec_loop:
|
||||
bne Lcbc_dec_loop
|
||||
|
||||
Lcbc_done:
|
||||
addi $out, $out, -1
|
||||
lvx v1, 0, $out # redundant in aligned case
|
||||
vsel v1, $outhead, v1, $outmask
|
||||
stvx v1, 0, $out
|
||||
beq cr1, Lcbc_write_iv # $out is aligned
|
||||
|
||||
Lcbc_unaligned_done:
|
||||
andi. r8, $out, 15
|
||||
sub $out, $out, r8
|
||||
li r9, 0
|
||||
Lcbc_tail:
|
||||
stvebx $outhead, r9, $out
|
||||
addi r9, r9, 1
|
||||
cmpw r9, r8
|
||||
bne Lcbc_tail
|
||||
|
||||
Lcbc_write_iv:
|
||||
neg r8, r31 # write [potentially unaligned] iv
|
||||
li r10, 4
|
||||
?lvsl $outperm, 0, r8
|
||||
li r6, 15
|
||||
vnor $outmask, v7, v7 # 0xff..ff
|
||||
?vperm $outmask, v7, $outmask, $outperm
|
||||
lvx $outhead, 0, r31
|
||||
li r11, 8
|
||||
li r12, 12
|
||||
vperm v24, v24, v24, $outperm # rotate right/left
|
||||
vsel v0, $outhead, v24, $outmask
|
||||
lvx v1, r6, r31
|
||||
stvx v0, 0, r31
|
||||
vsel v1, v24, v1, $outmask
|
||||
stvx v1, r6, r31
|
||||
stvewx v24, 0, r31 # ivp is at least 32-bit aligned
|
||||
stvewx v24, r10, r31
|
||||
stvewx v24, r11, r31
|
||||
stvewx v24, r12, r31
|
||||
|
||||
mtspr 256, r7 # restore vrsave
|
||||
li r10,`15+6*$SIZE_T`
|
||||
@@ -872,18 +935,21 @@ _vpaes_schedule_core:
|
||||
|
||||
# encrypting, output zeroth round key after transform
|
||||
li r8, 0x30 # mov \$0x30,%r8d
|
||||
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
|
||||
li r9, 4
|
||||
li r10, 8
|
||||
li r11, 12
|
||||
|
||||
?lvsr $outperm, 0, $out # prepare for unaligned access
|
||||
vnor $outmask, v9, v9 # 0xff..ff
|
||||
lvx $outhead, 0, $out
|
||||
?vperm $outmask, v9, $outmask, $outperm
|
||||
|
||||
#stvx v0, 0, $out # vmovdqu %xmm0, (%rdx)
|
||||
vperm v1, v0, v0, $outperm # rotate right/left
|
||||
vsel v2, $outhead, v1, $outmask
|
||||
vmr $outhead, v1
|
||||
stvx v2, 0, $out
|
||||
vperm $outhead, v0, v0, $outperm # rotate right/left
|
||||
stvewx $outhead, 0, $out # some are superfluous
|
||||
stvewx $outhead, r9, $out
|
||||
stvewx $outhead, r10, $out
|
||||
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
|
||||
stvewx $outhead, r11, $out
|
||||
b Lschedule_go
|
||||
|
||||
Lschedule_am_decrypting:
|
||||
@@ -893,20 +959,24 @@ Lschedule_am_decrypting:
|
||||
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
|
||||
# decrypting, output zeroth round key after shiftrows
|
||||
lvx v1, r8, r10 # vmovdqa (%r8,%r10), %xmm1
|
||||
li r9, 4
|
||||
li r10, 8
|
||||
li r11, 12
|
||||
vperm v4, v3, v3, v1 # vpshufb %xmm1, %xmm3, %xmm3
|
||||
|
||||
neg r0, $out # prepare for unaligned access
|
||||
?lvsl $outperm, 0, r0
|
||||
addi $out, $out, 15 # 15 is not typo
|
||||
vnor $outmask, v9, v9 # 0xff..ff
|
||||
lvx $outhead, 0, $out
|
||||
?vperm $outmask, $outmask, v9, $outperm
|
||||
|
||||
#stvx v4, 0, $out # vmovdqu %xmm3, (%rdx)
|
||||
vperm v4, v4, v4, $outperm # rotate right/left
|
||||
vsel v2, $outhead, v4, $outmask
|
||||
vmr $outhead, v4
|
||||
stvx v2, 0, $out
|
||||
vperm $outhead, v4, v4, $outperm # rotate right/left
|
||||
stvewx $outhead, 0, $out # some are superfluous
|
||||
stvewx $outhead, r9, $out
|
||||
stvewx $outhead, r10, $out
|
||||
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
|
||||
stvewx $outhead, r11, $out
|
||||
addi $out, $out, 15 # 15 is not typo
|
||||
xori r8, r8, 0x30 # xor \$0x30, %r8
|
||||
|
||||
Lschedule_go:
|
||||
@@ -1038,14 +1108,15 @@ Lschedule_mangle_last:
|
||||
|
||||
#stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key
|
||||
vperm v0, v0, v0, $outperm # rotate right/left
|
||||
li r10, 4
|
||||
vsel v2, $outhead, v0, $outmask
|
||||
vmr $outhead, v0
|
||||
li r11, 8
|
||||
stvx v2, 0, $out
|
||||
|
||||
addi $out, $out, 15 # 15 is not typo
|
||||
lvx v1, 0, $out # redundant in aligned case
|
||||
vsel v1, $outhead, v1, $outmask
|
||||
stvx v1, 0, $out
|
||||
li r12, 12
|
||||
stvewx v0, 0, $out # some (or all) are redundant
|
||||
stvewx v0, r10, $out
|
||||
stvewx v0, r11, $out
|
||||
stvewx v0, r12, $out
|
||||
b Lschedule_mangle_done
|
||||
|
||||
.align 4
|
||||
@@ -1057,15 +1128,18 @@ Lschedule_mangle_last_dec:
|
||||
bl _vpaes_schedule_transform # output transform
|
||||
|
||||
#stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key
|
||||
addi r9, $out, -15 # -15 is not typo
|
||||
vperm v0, v0, v0, $outperm # rotate right/left
|
||||
li r10, 4
|
||||
vsel v2, $outhead, v0, $outmask
|
||||
vmr $outhead, v0
|
||||
li r11, 8
|
||||
stvx v2, 0, $out
|
||||
li r12, 12
|
||||
stvewx v0, 0, r9 # some (or all) are redundant
|
||||
stvewx v0, r10, r9
|
||||
stvewx v0, r11, r9
|
||||
stvewx v0, r12, r9
|
||||
|
||||
addi $out, $out, -15 # -15 is not typo
|
||||
lvx v1, 0, $out # redundant in aligned case
|
||||
vsel v1, $outhead, v1, $outmask
|
||||
stvx v1, 0, $out
|
||||
|
||||
Lschedule_mangle_done:
|
||||
mtlr r7
|
||||
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
@@ -280,7 +300,7 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
|
||||
int tmp_tag, tmp_class;
|
||||
|
||||
if (elem == NULL)
|
||||
return 0;
|
||||
return -1;
|
||||
|
||||
for (i = 0, p = elem; i < len; p++, i++) {
|
||||
/* Look for the ':' in name value pairs */
|
||||
@@ -353,7 +373,7 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
|
||||
break;
|
||||
|
||||
case ASN1_GEN_FLAG_FORMAT:
|
||||
if(!vstart) {
|
||||
if (!vstart) {
|
||||
ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
|
||||
return -1;
|
||||
}
|
||||
@@ -435,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;
|
||||
@@ -454,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))
|
||||
|
@@ -62,6 +62,10 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
#ifndef ASN1_PARSE_MAXDEPTH
|
||||
#define ASN1_PARSE_MAXDEPTH 128
|
||||
#endif
|
||||
|
||||
static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
|
||||
int indent);
|
||||
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
|
||||
@@ -128,6 +132,12 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
|
||||
#else
|
||||
dump_indent = 6; /* Because we know BIO_dump_indent() */
|
||||
#endif
|
||||
|
||||
if (depth > ASN1_PARSE_MAXDEPTH) {
|
||||
BIO_puts(bp, "BAD RECURSION DEPTH\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
p = *pp;
|
||||
tot = p + length;
|
||||
op = p - 1;
|
||||
|
@@ -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,7 +162,7 @@ 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)
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
ndef_aux->derbuf = p;
|
||||
@@ -232,7 +232,7 @@ 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)
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
ndef_aux->derbuf = p;
|
||||
|
@@ -72,6 +72,7 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
EVP_PKEY *ret;
|
||||
const unsigned char *p = *pp;
|
||||
|
||||
if ((a == NULL) || (*a == NULL)) {
|
||||
if ((ret = EVP_PKEY_new()) == NULL) {
|
||||
@@ -94,21 +95,23 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
}
|
||||
|
||||
if (!ret->ameth->old_priv_decode ||
|
||||
!ret->ameth->old_priv_decode(ret, pp, length)) {
|
||||
!ret->ameth->old_priv_decode(ret, &p, length)) {
|
||||
if (ret->ameth->priv_decode) {
|
||||
PKCS8_PRIV_KEY_INFO *p8 = NULL;
|
||||
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length);
|
||||
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
|
||||
if (!p8)
|
||||
goto err;
|
||||
EVP_PKEY_free(ret);
|
||||
ret = EVP_PKCS82PKEY(p8);
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
|
||||
if (ret == NULL)
|
||||
goto err;
|
||||
} else {
|
||||
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
*pp = p;
|
||||
if (a != NULL)
|
||||
(*a) = ret;
|
||||
return (ret);
|
||||
@@ -136,6 +139,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
|
||||
* input is surrounded by an ASN1 SEQUENCE.
|
||||
*/
|
||||
inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length);
|
||||
p = *pp;
|
||||
/*
|
||||
* Since we only need to discern "traditional format" RSA and DSA keys we
|
||||
* can just count the elements.
|
||||
@@ -146,7 +150,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
|
||||
keytype = EVP_PKEY_EC;
|
||||
else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not
|
||||
* traditional format */
|
||||
PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length);
|
||||
PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
|
||||
EVP_PKEY *ret;
|
||||
|
||||
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
|
||||
@@ -157,6 +161,9 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
|
||||
}
|
||||
ret = EVP_PKCS82PKEY(p8);
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
*pp = p;
|
||||
if (a) {
|
||||
*a = ret;
|
||||
}
|
||||
|
@@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
int otag;
|
||||
int ret = 0;
|
||||
ASN1_VALUE **pchptr, *ptmpval;
|
||||
int combine = aclass & ASN1_TFLG_COMBINE;
|
||||
aclass &= ~ASN1_TFLG_COMBINE;
|
||||
if (!pval)
|
||||
return 0;
|
||||
if (aux && aux->asn1_cb)
|
||||
@@ -350,9 +352,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
}
|
||||
|
||||
asn1_set_choice_selector(pval, i, it);
|
||||
*in = p;
|
||||
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
|
||||
goto auxerr;
|
||||
*in = p;
|
||||
return 1;
|
||||
|
||||
case ASN1_ITYPE_NDEF_SEQUENCE:
|
||||
@@ -489,9 +491,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
/* Save encoding */
|
||||
if (!asn1_enc_save(pval, *in, p - *in, it))
|
||||
goto auxerr;
|
||||
*in = p;
|
||||
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
|
||||
goto auxerr;
|
||||
*in = p;
|
||||
return 1;
|
||||
|
||||
default:
|
||||
@@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
auxerr:
|
||||
ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR);
|
||||
err:
|
||||
ASN1_item_ex_free(pval, it);
|
||||
if (combine == 0)
|
||||
ASN1_item_ex_free(pval, it);
|
||||
if (errtt)
|
||||
ERR_add_error_data(4, "Field=", errtt->field_name,
|
||||
", Type=", it->sname);
|
||||
@@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
|
||||
} else {
|
||||
/* Nothing special */
|
||||
ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
|
||||
-1, 0, opt, ctx);
|
||||
-1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx);
|
||||
if (!ret) {
|
||||
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR);
|
||||
goto err;
|
||||
|
@@ -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);
|
||||
|
@@ -290,7 +290,7 @@ 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)
|
||||
if (!seqtt)
|
||||
return 0;
|
||||
tmpfld = asn1_get_field_ptr(fld, seqtt);
|
||||
if (!asn1_template_print_ctx(out, tmpfld,
|
||||
|
@@ -141,8 +141,9 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
||||
int utype, char *free_cont, const ASN1_ITEM *it)
|
||||
{
|
||||
BIGNUM *bn;
|
||||
if (!*pval)
|
||||
bn_new(pval, it);
|
||||
|
||||
if (*pval == NULL && !bn_new(pval, it))
|
||||
return 0;
|
||||
bn = (BIGNUM *)*pval;
|
||||
if (!BN_bin2bn(cont, len, bn)) {
|
||||
bn_free(pval, it);
|
||||
|
@@ -188,13 +188,16 @@ EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length)
|
||||
{
|
||||
X509_PUBKEY *xpk;
|
||||
EVP_PKEY *pktmp;
|
||||
xpk = d2i_X509_PUBKEY(NULL, pp, length);
|
||||
const unsigned char *q;
|
||||
q = *pp;
|
||||
xpk = d2i_X509_PUBKEY(NULL, &q, length);
|
||||
if (!xpk)
|
||||
return NULL;
|
||||
pktmp = X509_PUBKEY_get(xpk);
|
||||
X509_PUBKEY_free(xpk);
|
||||
if (!pktmp)
|
||||
return NULL;
|
||||
*pp = q;
|
||||
if (a) {
|
||||
EVP_PKEY_free(*a);
|
||||
*a = pktmp;
|
||||
|
@@ -177,22 +177,21 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
|
||||
/* Save start position */
|
||||
q = *pp;
|
||||
|
||||
if(!a || *a == NULL) {
|
||||
if (!a || *a == NULL) {
|
||||
freeret = 1;
|
||||
}
|
||||
ret = d2i_X509(a, pp, length);
|
||||
ret = d2i_X509(a, &q, length);
|
||||
/* If certificate unreadable then forget it */
|
||||
if (!ret)
|
||||
return NULL;
|
||||
/* update length */
|
||||
length -= *pp - q;
|
||||
if (!length)
|
||||
return ret;
|
||||
if (!d2i_X509_CERT_AUX(&ret->aux, pp, length))
|
||||
length -= q - *pp;
|
||||
if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length))
|
||||
goto err;
|
||||
*pp = q;
|
||||
return ret;
|
||||
err:
|
||||
if(freeret) {
|
||||
if (freeret) {
|
||||
X509_free(ret);
|
||||
if (a)
|
||||
*a = NULL;
|
||||
|
@@ -163,10 +163,13 @@ int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj)
|
||||
if (!(objtmp = OBJ_dup(obj)))
|
||||
return 0;
|
||||
if (!(aux = aux_get(x)))
|
||||
return 0;
|
||||
goto err;
|
||||
if (!aux->reject && !(aux->reject = sk_ASN1_OBJECT_new_null()))
|
||||
return 0;
|
||||
goto err;
|
||||
return sk_ASN1_OBJECT_push(aux->reject, objtmp);
|
||||
err:
|
||||
ASN1_OBJECT_free(objtmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void X509_trust_clear(X509 *x)
|
||||
|
@@ -1,5 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
bf-*.s
|
@@ -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)
|
||||
|
@@ -1,4 +0,0 @@
|
||||
bx86unix.cpp
|
||||
bx86-elf.s
|
||||
*.flc
|
||||
semantic.cache
|
@@ -1,4 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
@@ -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)
|
||||
|
@@ -104,7 +104,6 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
if ((rows * dump_width) < len)
|
||||
rows++;
|
||||
for (i = 0; i < rows; i++) {
|
||||
buf[0] = '\0'; /* start with empty string */
|
||||
BUF_strlcpy(buf, str, sizeof buf);
|
||||
BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
|
||||
BUF_strlcat(buf, tmp, sizeof buf);
|
||||
|
@@ -704,32 +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(!*buffer) {
|
||||
/* Panic! Can't really do anything sensible. Just return */
|
||||
return;
|
||||
}
|
||||
if (*currlen > 0) {
|
||||
assert(*sbuffer != NULL);
|
||||
memcpy(*buffer, *sbuffer, *currlen);
|
||||
}
|
||||
*sbuffer = NULL;
|
||||
} else {
|
||||
*maxlen += 1024;
|
||||
*buffer = OPENSSL_realloc(*buffer, *maxlen);
|
||||
if(!*buffer) {
|
||||
/* Panic! Can't really do anything sensible. Just return */
|
||||
return;
|
||||
}
|
||||
/* |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);
|
||||
}
|
||||
|
||||
|
@@ -291,7 +291,7 @@ void BIO_clear_flags(BIO *b, int flags);
|
||||
* BIO_CB_RETURN flag indicates if it is after the call
|
||||
*/
|
||||
# define BIO_CB_RETURN 0x80
|
||||
# define BIO_CB_return(a) ((a)|BIO_CB_RETURN))
|
||||
# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
|
||||
# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
|
||||
# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
|
||||
|
||||
|
@@ -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,7 +1013,7 @@ 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) {
|
||||
if (!authchunks) {
|
||||
BIO_vfree(bio);
|
||||
return (NULL);
|
||||
}
|
||||
@@ -1352,7 +1353,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl)
|
||||
(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_ERROR);
|
||||
BIOerr(BIO_F_DGRAM_SCTP_READ, ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
memset(authchunks, 0, sizeof(optlen));
|
||||
@@ -1423,8 +1424,8 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl)
|
||||
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_ERROR);
|
||||
if (!(tmp = OPENSSL_malloc(inl))) {
|
||||
BIOerr(BIO_F_DGRAM_SCTP_WRITE, ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
if (data->saved_message.data)
|
||||
|
@@ -115,9 +115,8 @@ static BIO_METHOD methods_filep = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
BIO *BIO_new_file(const char *filename, const char *mode)
|
||||
static FILE *file_fopen(const char *filename, const char *mode)
|
||||
{
|
||||
BIO *ret;
|
||||
FILE *file = NULL;
|
||||
|
||||
# if defined(_WIN32) && defined(CP_UTF8)
|
||||
@@ -164,6 +163,14 @@ BIO *BIO_new_file(const char *filename, const char *mode)
|
||||
# else
|
||||
file = fopen(filename, mode);
|
||||
# endif
|
||||
return (file);
|
||||
}
|
||||
|
||||
BIO *BIO_new_file(const char *filename, const char *mode)
|
||||
{
|
||||
BIO *ret;
|
||||
FILE *file = file_fopen(filename, mode);
|
||||
|
||||
if (file == NULL) {
|
||||
SYSerr(SYS_F_FOPEN, get_last_sys_error());
|
||||
ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
|
||||
@@ -386,7 +393,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
else
|
||||
strcat(p, "t");
|
||||
# endif
|
||||
fp = fopen(ptr, p);
|
||||
fp = file_fopen(ptr, p);
|
||||
if (fp == NULL) {
|
||||
SYSerr(SYS_F_FOPEN, get_last_sys_error());
|
||||
ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");
|
||||
|
@@ -1,10 +0,0 @@
|
||||
lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
co-*.s
|
||||
bn-*.s
|
||||
*-mont.s
|
||||
modexp512-x86_64.s
|
||||
*-gf2m.s
|
||||
x86_64-mont5.s
|
@@ -176,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)
|
||||
@@ -251,6 +253,7 @@ bn_exp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
bn_exp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
bn_exp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
bn_exp.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_exp.c bn_lcl.h
|
||||
bn_exp.o: rsaz_exp.h
|
||||
bn_exp2.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
bn_exp2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
|
@@ -1,6 +0,0 @@
|
||||
bn86unix.cpp
|
||||
co86unix.cpp
|
||||
bn86-elf.s
|
||||
co86-elf.s
|
||||
*.flc
|
||||
semantic.cache
|
@@ -27,7 +27,7 @@
|
||||
# referred below, which improves ECDH and ECDSA verify benchmarks
|
||||
# by 18-40%.
|
||||
#
|
||||
# C<EFBFBD>mara, D.; Gouv<EFBFBD>a, C. P. L.; L<EFBFBD>pez, J. & Dahab, R.: Fast Software
|
||||
# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software
|
||||
# Polynomial Multiplication on ARM Processors using the NEON Engine.
|
||||
#
|
||||
# http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf
|
||||
@@ -136,7 +136,7 @@ ___
|
||||
################
|
||||
# void bn_GF2m_mul_2x2(BN_ULONG *r,
|
||||
# BN_ULONG a1,BN_ULONG a0,
|
||||
# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0<EFBFBD>b1b0
|
||||
# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0·b1b0
|
||||
{
|
||||
$code.=<<___;
|
||||
.global bn_GF2m_mul_2x2
|
||||
@@ -159,7 +159,7 @@ $code.=<<___;
|
||||
mov $mask,#7<<2
|
||||
sub sp,sp,#32 @ allocate tab[8]
|
||||
|
||||
bl mul_1x1_ialu @ a1<EFBFBD>b1
|
||||
bl mul_1x1_ialu @ a1·b1
|
||||
str $lo,[$ret,#8]
|
||||
str $hi,[$ret,#12]
|
||||
|
||||
@@ -169,13 +169,13 @@ $code.=<<___;
|
||||
eor r2,r2,$a
|
||||
eor $b,$b,r3
|
||||
eor $a,$a,r2
|
||||
bl mul_1x1_ialu @ a0<EFBFBD>b0
|
||||
bl mul_1x1_ialu @ a0·b0
|
||||
str $lo,[$ret]
|
||||
str $hi,[$ret,#4]
|
||||
|
||||
eor $a,$a,r2
|
||||
eor $b,$b,r3
|
||||
bl mul_1x1_ialu @ (a1+a0)<EFBFBD>(b1+b0)
|
||||
bl mul_1x1_ialu @ (a1+a0)·(b1+b0)
|
||||
___
|
||||
@r=map("r$_",(6..9));
|
||||
$code.=<<___;
|
||||
|
@@ -422,7 +422,7 @@ bn_mul_add_words:
|
||||
|
||||
// This loop spins in 3*(n+10) ticks on Itanium and in 2*(n+10) on
|
||||
// Itanium 2. Yes, unlike previous versions it scales:-) Previous
|
||||
// version was peforming *all* additions in IALU and was starving
|
||||
// version was performing *all* additions in IALU and was starving
|
||||
// for those even on Itanium 2. In this version one addition is
|
||||
// moved to FPU and is folded with multiplication. This is at cost
|
||||
// of propogating the result from previous call to this subroutine
|
||||
@@ -568,7 +568,7 @@ bn_sqr_comba8:
|
||||
// I've estimated this routine to run in ~120 ticks, but in reality
|
||||
// (i.e. according to ar.itc) it takes ~160 ticks. Are those extra
|
||||
// cycles consumed for instructions fetch? Or did I misinterpret some
|
||||
// clause in Itanium <EFBFBD>-architecture manual? Comments are welcomed and
|
||||
// clause in Itanium µ-architecture manual? Comments are welcomed and
|
||||
// highly appreciated.
|
||||
//
|
||||
// On Itanium 2 it takes ~190 ticks. This is because of stalls on
|
||||
|
@@ -94,6 +94,8 @@ if ($flavour =~ /32/) {
|
||||
$POP= "ld";
|
||||
} else { die "nonsense $flavour"; }
|
||||
|
||||
$LITTLE_ENDIAN = ($flavour=~/le$/) ? 4 : 0;
|
||||
|
||||
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
|
||||
( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
|
||||
( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
|
||||
@@ -294,12 +296,12 @@ $code.=<<___ if ($SIZE_T==8);
|
||||
|
||||
extrdi $t0,$a0,32,32 ; lwz $t0,4($ap)
|
||||
extrdi $t1,$a0,32,0 ; lwz $t1,0($ap)
|
||||
lwz $t2,12($ap) ; load a[1] as 32-bit word pair
|
||||
lwz $t3,8($ap)
|
||||
lwz $t4,4($np) ; load n[0] as 32-bit word pair
|
||||
lwz $t5,0($np)
|
||||
lwz $t6,12($np) ; load n[1] as 32-bit word pair
|
||||
lwz $t7,8($np)
|
||||
lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[1] as 32-bit word pair
|
||||
lwz $t3,`8^$LITTLE_ENDIAN`($ap)
|
||||
lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[0] as 32-bit word pair
|
||||
lwz $t5,`0^$LITTLE_ENDIAN`($np)
|
||||
lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[1] as 32-bit word pair
|
||||
lwz $t7,`8^$LITTLE_ENDIAN`($np)
|
||||
___
|
||||
$code.=<<___ if ($SIZE_T==4);
|
||||
lwz $a0,0($ap) ; pull ap[0,1] value
|
||||
@@ -463,14 +465,14 @@ $code.=<<___;
|
||||
L1st:
|
||||
___
|
||||
$code.=<<___ if ($SIZE_T==8);
|
||||
lwz $t0,4($ap) ; load a[j] as 32-bit word pair
|
||||
lwz $t1,0($ap)
|
||||
lwz $t2,12($ap) ; load a[j+1] as 32-bit word pair
|
||||
lwz $t3,8($ap)
|
||||
lwz $t4,4($np) ; load n[j] as 32-bit word pair
|
||||
lwz $t5,0($np)
|
||||
lwz $t6,12($np) ; load n[j+1] as 32-bit word pair
|
||||
lwz $t7,8($np)
|
||||
lwz $t0,`4^$LITTLE_ENDIAN`($ap) ; load a[j] as 32-bit word pair
|
||||
lwz $t1,`0^$LITTLE_ENDIAN`($ap)
|
||||
lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[j+1] as 32-bit word pair
|
||||
lwz $t3,`8^$LITTLE_ENDIAN`($ap)
|
||||
lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[j] as 32-bit word pair
|
||||
lwz $t5,`0^$LITTLE_ENDIAN`($np)
|
||||
lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[j+1] as 32-bit word pair
|
||||
lwz $t7,`8^$LITTLE_ENDIAN`($np)
|
||||
___
|
||||
$code.=<<___ if ($SIZE_T==4);
|
||||
lwz $t0,0($ap) ; load a[j..j+3] as 32-bit word pairs
|
||||
@@ -505,14 +507,14 @@ $code.=<<___;
|
||||
___
|
||||
} else {
|
||||
$code.=<<___;
|
||||
lwz $t1,`$FRAME+0`($sp)
|
||||
lwz $t0,`$FRAME+4`($sp)
|
||||
lwz $t3,`$FRAME+8`($sp)
|
||||
lwz $t2,`$FRAME+12`($sp)
|
||||
lwz $t5,`$FRAME+16`($sp)
|
||||
lwz $t4,`$FRAME+20`($sp)
|
||||
lwz $t7,`$FRAME+24`($sp)
|
||||
lwz $t6,`$FRAME+28`($sp)
|
||||
lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
@@ -651,8 +653,8 @@ $code.=<<___;
|
||||
|
||||
fmadd $T1a,$N1,$na,$T1a
|
||||
fmadd $T1b,$N1,$nb,$T1b
|
||||
lwz $t3,`$FRAME+32`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36`($sp) ; permuted $t0
|
||||
lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
|
||||
addc $t4,$t4,$carry
|
||||
adde $t5,$t5,$c1
|
||||
srwi $carry,$t4,16
|
||||
@@ -673,8 +675,8 @@ $code.=<<___;
|
||||
|
||||
fmadd $T1a,$N0,$nc,$T1a
|
||||
fmadd $T1b,$N0,$nd,$T1b
|
||||
lwz $t7,`$FRAME+40`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44`($sp) ; permuted $t2
|
||||
lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
|
||||
addc $t2,$t2,$carry
|
||||
adde $t3,$t3,$c1
|
||||
srwi $carry,$t2,16
|
||||
@@ -686,8 +688,8 @@ $code.=<<___;
|
||||
insrwi $carry,$t3,16,0
|
||||
fmadd $T3a,$N2,$nc,$T3a
|
||||
fmadd $T3b,$N2,$nd,$T3b
|
||||
lwz $t1,`$FRAME+48`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52`($sp) ; permuted $t4
|
||||
lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
|
||||
addc $t6,$t6,$carry
|
||||
adde $t7,$t7,$c1
|
||||
srwi $carry,$t6,16
|
||||
@@ -699,8 +701,8 @@ $code.=<<___;
|
||||
|
||||
fctid $T0a,$T0a
|
||||
fctid $T0b,$T0b
|
||||
lwz $t5,`$FRAME+56`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60`($sp) ; permuted $t6
|
||||
lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
|
||||
addc $t0,$t0,$carry
|
||||
adde $t1,$t1,$c1
|
||||
srwi $carry,$t0,16
|
||||
@@ -787,14 +789,14 @@ $code.=<<___;
|
||||
___
|
||||
} else {
|
||||
$code.=<<___;
|
||||
lwz $t1,`$FRAME+0`($sp)
|
||||
lwz $t0,`$FRAME+4`($sp)
|
||||
lwz $t3,`$FRAME+8`($sp)
|
||||
lwz $t2,`$FRAME+12`($sp)
|
||||
lwz $t5,`$FRAME+16`($sp)
|
||||
lwz $t4,`$FRAME+20`($sp)
|
||||
lwz $t7,`$FRAME+24`($sp)
|
||||
lwz $t6,`$FRAME+28`($sp)
|
||||
lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
|
||||
stfd $dota,`$FRAME+64`($sp)
|
||||
stfd $dotb,`$FRAME+72`($sp)
|
||||
|
||||
@@ -823,14 +825,14 @@ $code.=<<___;
|
||||
stw $t0,12($tp) ; tp[j-1]
|
||||
stw $t4,8($tp)
|
||||
|
||||
lwz $t3,`$FRAME+32`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36`($sp) ; permuted $t0
|
||||
lwz $t7,`$FRAME+40`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44`($sp) ; permuted $t2
|
||||
lwz $t1,`$FRAME+48`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52`($sp) ; permuted $t4
|
||||
lwz $t5,`$FRAME+56`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60`($sp) ; permuted $t6
|
||||
lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
|
||||
lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
|
||||
lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
|
||||
lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
|
||||
|
||||
addc $t2,$t2,$carry
|
||||
adde $t3,$t3,$c1
|
||||
@@ -857,10 +859,10 @@ $code.=<<___;
|
||||
stw $t2,20($tp) ; tp[j]
|
||||
stwu $t0,16($tp)
|
||||
|
||||
lwz $t7,`$FRAME+64`($sp)
|
||||
lwz $t6,`$FRAME+68`($sp)
|
||||
lwz $t5,`$FRAME+72`($sp)
|
||||
lwz $t4,`$FRAME+76`($sp)
|
||||
lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp)
|
||||
|
||||
addc $t6,$t6,$carry
|
||||
adde $t7,$t7,$c1
|
||||
@@ -1165,23 +1167,23 @@ ___
|
||||
$code.=<<___;
|
||||
fmadd $T1a,$N1,$na,$T1a
|
||||
fmadd $T1b,$N1,$nb,$T1b
|
||||
lwz $t1,`$FRAME+0`($sp)
|
||||
lwz $t0,`$FRAME+4`($sp)
|
||||
lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
|
||||
fmadd $T2a,$N2,$na,$T2a
|
||||
fmadd $T2b,$N2,$nb,$T2b
|
||||
lwz $t3,`$FRAME+8`($sp)
|
||||
lwz $t2,`$FRAME+12`($sp)
|
||||
lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
|
||||
fmadd $T3a,$N3,$na,$T3a
|
||||
fmadd $T3b,$N3,$nb,$T3b
|
||||
lwz $t5,`$FRAME+16`($sp)
|
||||
lwz $t4,`$FRAME+20`($sp)
|
||||
lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
|
||||
addc $t0,$t0,$carry
|
||||
adde $t1,$t1,$c1
|
||||
srwi $carry,$t0,16
|
||||
fmadd $T0a,$N0,$na,$T0a
|
||||
fmadd $T0b,$N0,$nb,$T0b
|
||||
lwz $t7,`$FRAME+24`($sp)
|
||||
lwz $t6,`$FRAME+28`($sp)
|
||||
lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
|
||||
srwi $c1,$t1,16
|
||||
insrwi $carry,$t1,16,0
|
||||
|
||||
@@ -1218,8 +1220,8 @@ $code.=<<___;
|
||||
fctid $T1a,$T1a
|
||||
addc $t0,$t0,$t2
|
||||
adde $t4,$t4,$t3
|
||||
lwz $t3,`$FRAME+32`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36`($sp) ; permuted $t0
|
||||
lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
|
||||
fctid $T1b,$T1b
|
||||
addze $carry,$carry
|
||||
addze $c1,$c1
|
||||
@@ -1229,19 +1231,19 @@ $code.=<<___;
|
||||
addc $t2,$t2,$carry
|
||||
adde $t3,$t3,$c1
|
||||
srwi $carry,$t2,16
|
||||
lwz $t7,`$FRAME+40`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44`($sp) ; permuted $t2
|
||||
lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
|
||||
fctid $T2b,$T2b
|
||||
srwi $c1,$t3,16
|
||||
insrwi $carry,$t3,16,0
|
||||
lwz $t1,`$FRAME+48`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52`($sp) ; permuted $t4
|
||||
lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
|
||||
fctid $T3a,$T3a
|
||||
addc $t6,$t6,$carry
|
||||
adde $t7,$t7,$c1
|
||||
srwi $carry,$t6,16
|
||||
lwz $t5,`$FRAME+56`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60`($sp) ; permuted $t6
|
||||
lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
|
||||
fctid $T3b,$T3b
|
||||
|
||||
insrwi $t2,$t6,16,0 ; 64..95 bits
|
||||
@@ -1354,14 +1356,14 @@ $code.=<<___;
|
||||
___
|
||||
} else {
|
||||
$code.=<<___;
|
||||
lwz $t1,`$FRAME+0`($sp)
|
||||
lwz $t0,`$FRAME+4`($sp)
|
||||
lwz $t3,`$FRAME+8`($sp)
|
||||
lwz $t2,`$FRAME+12`($sp)
|
||||
lwz $t5,`$FRAME+16`($sp)
|
||||
lwz $t4,`$FRAME+20`($sp)
|
||||
lwz $t7,`$FRAME+24`($sp)
|
||||
lwz $t6,`$FRAME+28`($sp)
|
||||
lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
|
||||
stfd $dota,`$FRAME+64`($sp)
|
||||
stfd $dotb,`$FRAME+72`($sp)
|
||||
|
||||
@@ -1397,14 +1399,14 @@ $code.=<<___;
|
||||
stw $t0,4($tp) ; tp[j-1]
|
||||
stw $t4,0($tp)
|
||||
|
||||
lwz $t3,`$FRAME+32`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36`($sp) ; permuted $t0
|
||||
lwz $t7,`$FRAME+40`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44`($sp) ; permuted $t2
|
||||
lwz $t1,`$FRAME+48`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52`($sp) ; permuted $t4
|
||||
lwz $t5,`$FRAME+56`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60`($sp) ; permuted $t6
|
||||
lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
|
||||
lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
|
||||
lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
|
||||
lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
|
||||
lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
|
||||
lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
|
||||
lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
|
||||
lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
|
||||
|
||||
addc $t2,$t2,$carry
|
||||
adde $t3,$t3,$c1
|
||||
@@ -1433,12 +1435,12 @@ $code.=<<___;
|
||||
|
||||
addc $t2,$t2,$t6
|
||||
adde $t0,$t0,$t7
|
||||
lwz $t7,`$FRAME+64`($sp)
|
||||
lwz $t6,`$FRAME+68`($sp)
|
||||
lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp)
|
||||
addze $carry,$carry
|
||||
addze $c1,$c1
|
||||
lwz $t5,`$FRAME+72`($sp)
|
||||
lwz $t4,`$FRAME+76`($sp)
|
||||
lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp)
|
||||
lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp)
|
||||
|
||||
addc $t6,$t6,$carry
|
||||
adde $t7,$t7,$c1
|
||||
|
@@ -113,7 +113,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
|
||||
$addx = ($1>=12);
|
||||
}
|
||||
|
||||
if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
|
||||
if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
|
||||
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
|
||||
$addx = ($ver>=3.03);
|
||||
}
|
||||
|
@@ -172,19 +172,19 @@ ___
|
||||
if ($SIZE_T==8) {
|
||||
my @r=map("%r$_",(6..9));
|
||||
$code.=<<___;
|
||||
bras $ra,_mul_1x1 # a1<EFBFBD>b1
|
||||
bras $ra,_mul_1x1 # a1·b1
|
||||
stmg $lo,$hi,16($rp)
|
||||
|
||||
lg $a,`$stdframe+128+4*$SIZE_T`($sp)
|
||||
lg $b,`$stdframe+128+6*$SIZE_T`($sp)
|
||||
bras $ra,_mul_1x1 # a0<EFBFBD>b0
|
||||
bras $ra,_mul_1x1 # a0·b0
|
||||
stmg $lo,$hi,0($rp)
|
||||
|
||||
lg $a,`$stdframe+128+3*$SIZE_T`($sp)
|
||||
lg $b,`$stdframe+128+5*$SIZE_T`($sp)
|
||||
xg $a,`$stdframe+128+4*$SIZE_T`($sp)
|
||||
xg $b,`$stdframe+128+6*$SIZE_T`($sp)
|
||||
bras $ra,_mul_1x1 # (a0+a1)<EFBFBD>(b0+b1)
|
||||
bras $ra,_mul_1x1 # (a0+a1)·(b0+b1)
|
||||
lmg @r[0],@r[3],0($rp)
|
||||
|
||||
xgr $lo,$hi
|
||||
|
@@ -18,71 +18,106 @@
|
||||
.align 4
|
||||
bn_mul_add_words:
|
||||
lghi zero,0 // zero = 0
|
||||
la %r1,0(%r2) // put rp aside
|
||||
lghi %r2,0 // i=0;
|
||||
la %r1,0(%r2) // put rp aside [to give way to]
|
||||
lghi %r2,0 // return value
|
||||
ltgfr %r4,%r4
|
||||
bler %r14 // if (len<=0) return 0;
|
||||
|
||||
stmg %r6,%r10,48(%r15)
|
||||
lghi %r10,3
|
||||
lghi %r8,0 // carry = 0
|
||||
nr %r10,%r4 // len%4
|
||||
stmg %r6,%r13,48(%r15)
|
||||
lghi %r2,3
|
||||
lghi %r12,0 // carry = 0
|
||||
slgr %r1,%r3 // rp-=ap
|
||||
nr %r2,%r4 // len%4
|
||||
sra %r4,2 // cnt=len/4
|
||||
jz .Loop1_madd // carry is incidentally cleared if branch taken
|
||||
algr zero,zero // clear carry
|
||||
|
||||
.Loop4_madd:
|
||||
lg %r7,0(%r2,%r3) // ap[i]
|
||||
lg %r7,0(%r3) // ap[0]
|
||||
lg %r9,8(%r3) // ap[1]
|
||||
mlgr %r6,%r5 // *=w
|
||||
alcgr %r7,%r8 // +=carry
|
||||
alcgr %r6,zero
|
||||
alg %r7,0(%r2,%r1) // +=rp[i]
|
||||
stg %r7,0(%r2,%r1) // rp[i]=
|
||||
brct %r4,.Loop4_madd
|
||||
j .Loop4_madd_tail
|
||||
|
||||
lg %r9,8(%r2,%r3)
|
||||
.Loop4_madd:
|
||||
mlgr %r8,%r5
|
||||
lg %r11,16(%r3) // ap[i+2]
|
||||
alcgr %r7,%r12 // +=carry
|
||||
alcgr %r6,zero
|
||||
alg %r7,0(%r3,%r1) // +=rp[i]
|
||||
stg %r7,0(%r3,%r1) // rp[i]=
|
||||
|
||||
mlgr %r10,%r5
|
||||
lg %r13,24(%r3)
|
||||
alcgr %r9,%r6
|
||||
alcgr %r8,zero
|
||||
alg %r9,8(%r2,%r1)
|
||||
stg %r9,8(%r2,%r1)
|
||||
alg %r9,8(%r3,%r1)
|
||||
stg %r9,8(%r3,%r1)
|
||||
|
||||
mlgr %r12,%r5
|
||||
lg %r7,32(%r3)
|
||||
alcgr %r11,%r8
|
||||
alcgr %r10,zero
|
||||
alg %r11,16(%r3,%r1)
|
||||
stg %r11,16(%r3,%r1)
|
||||
|
||||
lg %r7,16(%r2,%r3)
|
||||
mlgr %r6,%r5
|
||||
alcgr %r7,%r8
|
||||
alcgr %r6,zero
|
||||
alg %r7,16(%r2,%r1)
|
||||
stg %r7,16(%r2,%r1)
|
||||
lg %r9,40(%r3)
|
||||
alcgr %r13,%r10
|
||||
alcgr %r12,zero
|
||||
alg %r13,24(%r3,%r1)
|
||||
stg %r13,24(%r3,%r1)
|
||||
|
||||
lg %r9,24(%r2,%r3)
|
||||
mlgr %r8,%r5
|
||||
alcgr %r9,%r6
|
||||
alcgr %r8,zero
|
||||
alg %r9,24(%r2,%r1)
|
||||
stg %r9,24(%r2,%r1)
|
||||
|
||||
la %r2,32(%r2) // i+=4
|
||||
la %r3,32(%r3) // i+=4
|
||||
brct %r4,.Loop4_madd
|
||||
|
||||
la %r10,1(%r10) // see if len%4 is zero ...
|
||||
brct %r10,.Loop1_madd // without touching condition code:-)
|
||||
.Loop4_madd_tail:
|
||||
mlgr %r8,%r5
|
||||
lg %r11,16(%r3)
|
||||
alcgr %r7,%r12 // +=carry
|
||||
alcgr %r6,zero
|
||||
alg %r7,0(%r3,%r1) // +=rp[i]
|
||||
stg %r7,0(%r3,%r1) // rp[i]=
|
||||
|
||||
mlgr %r10,%r5
|
||||
lg %r13,24(%r3)
|
||||
alcgr %r9,%r6
|
||||
alcgr %r8,zero
|
||||
alg %r9,8(%r3,%r1)
|
||||
stg %r9,8(%r3,%r1)
|
||||
|
||||
mlgr %r12,%r5
|
||||
alcgr %r11,%r8
|
||||
alcgr %r10,zero
|
||||
alg %r11,16(%r3,%r1)
|
||||
stg %r11,16(%r3,%r1)
|
||||
|
||||
alcgr %r13,%r10
|
||||
alcgr %r12,zero
|
||||
alg %r13,24(%r3,%r1)
|
||||
stg %r13,24(%r3,%r1)
|
||||
|
||||
la %r3,32(%r3) // i+=4
|
||||
|
||||
la %r2,1(%r2) // see if len%4 is zero ...
|
||||
brct %r2,.Loop1_madd // without touching condition code:-)
|
||||
|
||||
.Lend_madd:
|
||||
alcgr %r8,zero // collect carry bit
|
||||
lgr %r2,%r8
|
||||
lmg %r6,%r10,48(%r15)
|
||||
lgr %r2,zero // return value
|
||||
alcgr %r2,%r12 // collect even carry bit
|
||||
lmg %r6,%r13,48(%r15)
|
||||
br %r14
|
||||
|
||||
.Loop1_madd:
|
||||
lg %r7,0(%r2,%r3) // ap[i]
|
||||
lg %r7,0(%r3) // ap[i]
|
||||
mlgr %r6,%r5 // *=w
|
||||
alcgr %r7,%r8 // +=carry
|
||||
alcgr %r7,%r12 // +=carry
|
||||
alcgr %r6,zero
|
||||
alg %r7,0(%r2,%r1) // +=rp[i]
|
||||
stg %r7,0(%r2,%r1) // rp[i]=
|
||||
alg %r7,0(%r3,%r1) // +=rp[i]
|
||||
stg %r7,0(%r3,%r1) // rp[i]=
|
||||
|
||||
lgr %r8,%r6
|
||||
la %r2,8(%r2) // i++
|
||||
brct %r10,.Loop1_madd
|
||||
lgr %r12,%r6
|
||||
la %r3,8(%r3) // i++
|
||||
brct %r2,.Loop1_madd
|
||||
|
||||
j .Lend_madd
|
||||
.size bn_mul_add_words,.-bn_mul_add_words
|
||||
|
@@ -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
|
||||
|
@@ -14,7 +14,7 @@
|
||||
# the time being... Except that it has three code paths: pure integer
|
||||
# code suitable for any x86 CPU, MMX code suitable for PIII and later
|
||||
# and PCLMULQDQ suitable for Westmere and later. Improvement varies
|
||||
# from one benchmark and <EFBFBD>-arch to another. Below are interval values
|
||||
# from one benchmark and µ-arch to another. Below are interval values
|
||||
# for 163- and 571-bit ECDH benchmarks relative to compiler-generated
|
||||
# code:
|
||||
#
|
||||
@@ -226,22 +226,22 @@ if ($sse2) {
|
||||
&push ("edi");
|
||||
&mov ($a,&wparam(1));
|
||||
&mov ($b,&wparam(3));
|
||||
&call ("_mul_1x1_mmx"); # a1<EFBFBD>b1
|
||||
&call ("_mul_1x1_mmx"); # a1·b1
|
||||
&movq ("mm7",$R);
|
||||
|
||||
&mov ($a,&wparam(2));
|
||||
&mov ($b,&wparam(4));
|
||||
&call ("_mul_1x1_mmx"); # a0<EFBFBD>b0
|
||||
&call ("_mul_1x1_mmx"); # a0·b0
|
||||
&movq ("mm6",$R);
|
||||
|
||||
&mov ($a,&wparam(1));
|
||||
&mov ($b,&wparam(3));
|
||||
&xor ($a,&wparam(2));
|
||||
&xor ($b,&wparam(4));
|
||||
&call ("_mul_1x1_mmx"); # (a0+a1)<EFBFBD>(b0+b1)
|
||||
&call ("_mul_1x1_mmx"); # (a0+a1)·(b0+b1)
|
||||
&pxor ($R,"mm7");
|
||||
&mov ($a,&wparam(0));
|
||||
&pxor ($R,"mm6"); # (a0+a1)<EFBFBD>(b0+b1)-a1<EFBFBD>b1-a0<EFBFBD>b0
|
||||
&pxor ($R,"mm6"); # (a0+a1)·(b0+b1)-a1·b1-a0·b0
|
||||
|
||||
&movq ($A,$R);
|
||||
&psllq ($R,32);
|
||||
@@ -266,13 +266,13 @@ if ($sse2) {
|
||||
|
||||
&mov ($a,&wparam(1));
|
||||
&mov ($b,&wparam(3));
|
||||
&call ("_mul_1x1_ialu"); # a1<EFBFBD>b1
|
||||
&call ("_mul_1x1_ialu"); # a1·b1
|
||||
&mov (&DWP(8,"esp"),$lo);
|
||||
&mov (&DWP(12,"esp"),$hi);
|
||||
|
||||
&mov ($a,&wparam(2));
|
||||
&mov ($b,&wparam(4));
|
||||
&call ("_mul_1x1_ialu"); # a0<EFBFBD>b0
|
||||
&call ("_mul_1x1_ialu"); # a0·b0
|
||||
&mov (&DWP(0,"esp"),$lo);
|
||||
&mov (&DWP(4,"esp"),$hi);
|
||||
|
||||
@@ -280,7 +280,7 @@ if ($sse2) {
|
||||
&mov ($b,&wparam(3));
|
||||
&xor ($a,&wparam(2));
|
||||
&xor ($b,&wparam(4));
|
||||
&call ("_mul_1x1_ialu"); # (a0+a1)<EFBFBD>(b0+b1)
|
||||
&call ("_mul_1x1_ialu"); # (a0+a1)·(b0+b1)
|
||||
|
||||
&mov ("ebp",&wparam(0));
|
||||
@r=("ebx","ecx","edi","esi");
|
||||
|
@@ -65,7 +65,7 @@
|
||||
# undef mul_add
|
||||
|
||||
/*-
|
||||
* "m"(a), "+m"(r) is the way to favor DirectPath <EFBFBD>-code;
|
||||
* "m"(a), "+m"(r) is the way to favor DirectPath µ-code;
|
||||
* "g"(0) let the compiler to decide where does it
|
||||
* want to keep the value of zero;
|
||||
*/
|
||||
|
@@ -13,7 +13,7 @@
|
||||
# in bn_gf2m.c. It's kind of low-hanging mechanical port from C for
|
||||
# the time being... Except that it has two code paths: code suitable
|
||||
# for any x86_64 CPU and PCLMULQDQ one suitable for Westmere and
|
||||
# later. Improvement varies from one benchmark and <EFBFBD>-arch to another.
|
||||
# later. Improvement varies from one benchmark and µ-arch to another.
|
||||
# Vanilla code path is at most 20% faster than compiler-generated code
|
||||
# [not very impressive], while PCLMULQDQ - whole 85%-160% better on
|
||||
# 163- and 571-bit ECDH benchmarks on Intel CPUs. Keep in mind that
|
||||
@@ -184,13 +184,13 @@ ___
|
||||
$code.=<<___;
|
||||
movdqa %xmm0,%xmm4
|
||||
movdqa %xmm1,%xmm5
|
||||
pclmulqdq \$0,%xmm1,%xmm0 # a1<EFBFBD>b1
|
||||
pclmulqdq \$0,%xmm1,%xmm0 # a1·b1
|
||||
pxor %xmm2,%xmm4
|
||||
pxor %xmm3,%xmm5
|
||||
pclmulqdq \$0,%xmm3,%xmm2 # a0<EFBFBD>b0
|
||||
pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)<EFBFBD>(b0+b1)
|
||||
pclmulqdq \$0,%xmm3,%xmm2 # a0·b0
|
||||
pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)·(b0+b1)
|
||||
xorps %xmm0,%xmm4
|
||||
xorps %xmm2,%xmm4 # (a0+a1)<EFBFBD>(b0+b1)-a0<EFBFBD>b0-a1<EFBFBD>b1
|
||||
xorps %xmm2,%xmm4 # (a0+a1)·(b0+b1)-a0·b0-a1·b1
|
||||
movdqa %xmm4,%xmm5
|
||||
pslldq \$8,%xmm4
|
||||
psrldq \$8,%xmm5
|
||||
@@ -225,13 +225,13 @@ $code.=<<___;
|
||||
mov \$0xf,$mask
|
||||
mov $a1,$a
|
||||
mov $b1,$b
|
||||
call _mul_1x1 # a1<EFBFBD>b1
|
||||
call _mul_1x1 # a1·b1
|
||||
mov $lo,16(%rsp)
|
||||
mov $hi,24(%rsp)
|
||||
|
||||
mov 48(%rsp),$a
|
||||
mov 64(%rsp),$b
|
||||
call _mul_1x1 # a0<EFBFBD>b0
|
||||
call _mul_1x1 # a0·b0
|
||||
mov $lo,0(%rsp)
|
||||
mov $hi,8(%rsp)
|
||||
|
||||
@@ -239,7 +239,7 @@ $code.=<<___;
|
||||
mov 56(%rsp),$b
|
||||
xor 48(%rsp),$a
|
||||
xor 64(%rsp),$b
|
||||
call _mul_1x1 # (a0+a1)<EFBFBD>(b0+b1)
|
||||
call _mul_1x1 # (a0+a1)·(b0+b1)
|
||||
___
|
||||
@r=("%rbx","%rcx","%rdi","%rsi");
|
||||
$code.=<<___;
|
||||
|
@@ -68,6 +68,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
|
||||
$addx = ($1>=12);
|
||||
}
|
||||
|
||||
if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
|
||||
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
|
||||
$addx = ($ver>=3.03);
|
||||
}
|
||||
|
||||
# int bn_mul_mont(
|
||||
$rp="%rdi"; # BN_ULONG *rp,
|
||||
$ap="%rsi"; # const BN_ULONG *ap,
|
||||
|
@@ -53,6 +53,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
|
||||
$addx = ($1>=12);
|
||||
}
|
||||
|
||||
if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
|
||||
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
|
||||
$addx = ($ver>=3.03);
|
||||
}
|
||||
|
||||
# int bn_mul_mont_gather5(
|
||||
$rp="%rdi"; # BN_ULONG *rp,
|
||||
$ap="%rsi"; # const BN_ULONG *ap,
|
||||
@@ -1779,6 +1784,15 @@ sqr8x_reduction:
|
||||
.align 32
|
||||
.L8x_tail_done:
|
||||
add (%rdx),%r8 # can this overflow?
|
||||
adc \$0,%r9
|
||||
adc \$0,%r10
|
||||
adc \$0,%r11
|
||||
adc \$0,%r12
|
||||
adc \$0,%r13
|
||||
adc \$0,%r14
|
||||
adc \$0,%r15 # can't overflow, because we
|
||||
# started with "overhung" part
|
||||
# of multiplication
|
||||
xor %rax,%rax
|
||||
|
||||
neg $carry
|
||||
@@ -3125,6 +3139,15 @@ sqrx8x_reduction:
|
||||
.align 32
|
||||
.Lsqrx8x_tail_done:
|
||||
add 24+8(%rsp),%r8 # can this overflow?
|
||||
adc \$0,%r9
|
||||
adc \$0,%r10
|
||||
adc \$0,%r11
|
||||
adc \$0,%r12
|
||||
adc \$0,%r13
|
||||
adc \$0,%r14
|
||||
adc \$0,%r15 # can't overflow, because we
|
||||
# started with "overhung" part
|
||||
# of multiplication
|
||||
mov $carry,%rax # xor %rax,%rax
|
||||
|
||||
sub 16+8(%rsp),$carry # mov 16(%rsp),%cf
|
||||
@@ -3168,13 +3191,11 @@ my ($rptr,$nptr)=("%rdx","%rbp");
|
||||
my @ri=map("%r$_",(10..13));
|
||||
my @ni=map("%r$_",(14..15));
|
||||
$code.=<<___;
|
||||
xor %rbx,%rbx
|
||||
xor %ebx,%ebx
|
||||
sub %r15,%rsi # compare top-most words
|
||||
adc %rbx,%rbx
|
||||
mov %rcx,%r10 # -$num
|
||||
.byte 0x67
|
||||
or %rbx,%rax
|
||||
.byte 0x67
|
||||
mov %rcx,%r9 # -$num
|
||||
xor \$1,%rax
|
||||
sar \$3+2,%rcx # cf=0
|
||||
@@ -3226,11 +3247,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"},
|
||||
|
@@ -126,13 +126,7 @@
|
||||
# include <alloca.h>
|
||||
#endif
|
||||
|
||||
#undef RSAZ_ENABLED
|
||||
#if defined(OPENSSL_BN_ASM_MONT) && \
|
||||
(defined(__x86_64) || defined(__x86_64__) || \
|
||||
defined(_M_AMD64) || defined(_M_X64))
|
||||
# include "rsaz_exp.h"
|
||||
# define RSAZ_ENABLED
|
||||
#endif
|
||||
#include "rsaz_exp.h"
|
||||
|
||||
#undef SPARC_T4_MONT
|
||||
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
|
||||
@@ -668,12 +662,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
bn_check_top(p);
|
||||
bn_check_top(m);
|
||||
|
||||
top = m->top;
|
||||
|
||||
if (!(m->d[0] & 1)) {
|
||||
if (!BN_is_odd(m)) {
|
||||
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
|
||||
return (0);
|
||||
}
|
||||
|
||||
top = m->top;
|
||||
|
||||
bits = BN_num_bits(p);
|
||||
if (bits == 0) {
|
||||
ret = BN_one(rr);
|
||||
|
@@ -583,6 +583,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
|
||||
* BN_div_no_branch will be called eventually.
|
||||
*/
|
||||
pB = &local_B;
|
||||
local_B.flags = 0;
|
||||
BN_with_flags(pB, B, BN_FLG_CONSTTIME);
|
||||
if (!BN_nnmod(B, pB, A, ctx))
|
||||
goto err;
|
||||
@@ -610,6 +611,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
|
||||
* BN_div_no_branch will be called eventually.
|
||||
*/
|
||||
pA = &local_A;
|
||||
local_A.flags = 0;
|
||||
BN_with_flags(pA, A, BN_FLG_CONSTTIME);
|
||||
|
||||
/* (D, M) := (A/B, A%B) ... */
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
@@ -576,7 +575,7 @@ int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
|
||||
bn_check_top(a);
|
||||
BN_CTX_start(ctx);
|
||||
if ((s = BN_CTX_get(ctx)) == NULL)
|
||||
return 0;
|
||||
goto err;
|
||||
if (!bn_wexpand(s, 2 * a->top))
|
||||
goto err;
|
||||
|
||||
@@ -694,23 +693,27 @@ 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);
|
||||
if (!bn_wexpand(u, top))
|
||||
goto err;
|
||||
udp = u->d;
|
||||
for (i = u->top; i < top; i++)
|
||||
udp[i] = 0;
|
||||
u->top = top;
|
||||
bn_wexpand(b, top);
|
||||
if (!bn_wexpand(b, top))
|
||||
goto err;
|
||||
bdp = b->d;
|
||||
bdp[0] = 1;
|
||||
for (i = 1; i < top; i++)
|
||||
bdp[i] = 0;
|
||||
b->top = top;
|
||||
bn_wexpand(c, top);
|
||||
if (!bn_wexpand(c, top))
|
||||
goto err;
|
||||
cdp = c->d;
|
||||
for (i = 0; i < top; i++)
|
||||
cdp[i] = 0;
|
||||
@@ -740,8 +743,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) ({ \
|
||||
|
@@ -361,9 +361,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont)
|
||||
if (mont == NULL)
|
||||
return;
|
||||
|
||||
BN_free(&(mont->RR));
|
||||
BN_free(&(mont->N));
|
||||
BN_free(&(mont->Ni));
|
||||
BN_clear_free(&(mont->RR));
|
||||
BN_clear_free(&(mont->N));
|
||||
BN_clear_free(&(mont->Ni));
|
||||
if (mont->flags & BN_FLG_MALLOCED)
|
||||
OPENSSL_free(mont);
|
||||
}
|
||||
@@ -373,6 +373,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
|
||||
int ret = 0;
|
||||
BIGNUM *Ri, *R;
|
||||
|
||||
if (BN_is_zero(mod))
|
||||
return 0;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
if ((Ri = BN_CTX_get(ctx)) == NULL)
|
||||
goto err;
|
||||
|
@@ -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;
|
||||
|
@@ -152,8 +152,10 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
|
||||
|
||||
if (BN_ucmp(m, &(recp->N)) < 0) {
|
||||
BN_zero(d);
|
||||
if (!BN_copy(r, m))
|
||||
if (!BN_copy(r, m)) {
|
||||
BN_CTX_end(ctx);
|
||||
return 0;
|
||||
}
|
||||
BN_CTX_end(ctx);
|
||||
return (1);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -213,14 +213,14 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
|
||||
* exceeded.
|
||||
*/
|
||||
if (!BN_rand(Xp, nbits, 1, 0))
|
||||
return 0;
|
||||
goto err;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
t = BN_CTX_get(ctx);
|
||||
|
||||
for (i = 0; i < 1000; i++) {
|
||||
if (!BN_rand(Xq, nbits, 1, 0))
|
||||
return 0;
|
||||
goto err;
|
||||
/* Check that |Xp - Xq| > 2^(nbits - 100) */
|
||||
BN_sub(t, Xp, Xq);
|
||||
if (BN_num_bits(t) > (nbits - 100))
|
||||
@@ -234,6 +234,9 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
BN_CTX_end(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -441,6 +441,14 @@ int test_div(BIO *bp, BN_CTX *ctx)
|
||||
BN_init(&d);
|
||||
BN_init(&e);
|
||||
|
||||
BN_one(&a);
|
||||
BN_zero(&b);
|
||||
|
||||
if (BN_div(&d, &c, &a, &b, ctx)) {
|
||||
fprintf(stderr, "Division by zero succeeded!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < num0 + num1; i++) {
|
||||
if (i < num1) {
|
||||
BN_bntest_rand(&a, 400, 0, 0);
|
||||
@@ -516,9 +524,9 @@ int test_div_word(BIO *bp)
|
||||
do {
|
||||
BN_bntest_rand(&a, 512, -1, 0);
|
||||
BN_bntest_rand(&b, BN_BITS2, -1, 0);
|
||||
s = b.d[0];
|
||||
} while (!s);
|
||||
} while (BN_is_zero(&b));
|
||||
|
||||
s = b.d[0];
|
||||
BN_copy(&b, &a);
|
||||
r = BN_div_word(&b, s);
|
||||
|
||||
@@ -781,6 +789,18 @@ int test_mont(BIO *bp, BN_CTX *ctx)
|
||||
if (mont == NULL)
|
||||
return 0;
|
||||
|
||||
BN_zero(&n);
|
||||
if (BN_MONT_CTX_set(mont, &n, ctx)) {
|
||||
fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_set_word(&n, 16);
|
||||
if (BN_MONT_CTX_set(mont, &n, ctx)) {
|
||||
fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_bntest_rand(&a, 100, 0, 0);
|
||||
BN_bntest_rand(&b, 100, 0, 0);
|
||||
for (i = 0; i < num2; i++) {
|
||||
@@ -887,6 +907,14 @@ int test_mod_mul(BIO *bp, BN_CTX *ctx)
|
||||
d = BN_new();
|
||||
e = BN_new();
|
||||
|
||||
BN_one(a);
|
||||
BN_one(b);
|
||||
BN_zero(c);
|
||||
if (BN_mod_mul(e, a, b, c, ctx)) {
|
||||
fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
BN_bntest_rand(c, 1024, 0, 0);
|
||||
for (i = 0; i < num0; i++) {
|
||||
@@ -952,6 +980,14 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
|
||||
d = BN_new();
|
||||
e = BN_new();
|
||||
|
||||
BN_one(a);
|
||||
BN_one(b);
|
||||
BN_zero(c);
|
||||
if (BN_mod_exp(d, a, b, c, ctx)) {
|
||||
fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
|
||||
for (i = 0; i < num2; i++) {
|
||||
BN_bntest_rand(a, 20 + i * 5, 0, 0);
|
||||
@@ -980,6 +1016,24 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Regression test for carry propagation bug in sqr8x_reduction */
|
||||
BN_hex2bn(&a, "050505050505");
|
||||
BN_hex2bn(&b, "02");
|
||||
BN_hex2bn(&c,
|
||||
"4141414141414141414141274141414141414141414141414141414141414141"
|
||||
"4141414141414141414141414141414141414141414141414141414141414141"
|
||||
"4141414141414141414141800000000000000000000000000000000000000000"
|
||||
"0000000000000000000000000000000000000000000000000000000000000000"
|
||||
"0000000000000000000000000000000000000000000000000000000000000000"
|
||||
"0000000000000000000000000000000000000000000000000000000001");
|
||||
BN_mod_exp(d, a, b, c, ctx);
|
||||
BN_mul(e, a, a, ctx);
|
||||
if (BN_cmp(d, e)) {
|
||||
fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_free(a);
|
||||
BN_free(b);
|
||||
BN_free(c);
|
||||
@@ -999,6 +1053,22 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
|
||||
d = BN_new();
|
||||
e = BN_new();
|
||||
|
||||
BN_one(a);
|
||||
BN_one(b);
|
||||
BN_zero(c);
|
||||
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
|
||||
fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
|
||||
"succeeded\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_set_word(c, 16);
|
||||
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
|
||||
fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
|
||||
"succeeded\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
|
||||
for (i = 0; i < num2; i++) {
|
||||
BN_bntest_rand(a, 20 + i * 5, 0, 0);
|
||||
@@ -1042,7 +1112,6 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
|
||||
int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
|
||||
{
|
||||
BIGNUM *a, *p, *m, *d, *e;
|
||||
|
||||
BN_MONT_CTX *mont;
|
||||
|
||||
a = BN_new();
|
||||
@@ -1050,7 +1119,6 @@ int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
|
||||
m = BN_new();
|
||||
d = BN_new();
|
||||
e = BN_new();
|
||||
|
||||
mont = BN_MONT_CTX_new();
|
||||
|
||||
BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */
|
||||
@@ -1099,6 +1167,7 @@ int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
|
||||
fprintf(stderr, "Modular exponentiation test failed!\n");
|
||||
return 0;
|
||||
}
|
||||
BN_MONT_CTX_free(mont);
|
||||
BN_free(a);
|
||||
BN_free(p);
|
||||
BN_free(m);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user