Compare commits
419 Commits
OpenSSL_0_
...
OpenSSL_FI
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bf059c2efc | ||
![]() |
417d5af7c7 | ||
![]() |
33d3b6043a | ||
![]() |
c7e1e48908 | ||
![]() |
7f3a22803c | ||
![]() |
386ec8fc15 | ||
![]() |
8aecae520c | ||
![]() |
571d90db24 | ||
![]() |
4a54d594e1 | ||
![]() |
bd6ae6579e | ||
![]() |
85ca1d2c86 | ||
![]() |
3c1ee6c147 | ||
![]() |
a13e6553ad | ||
![]() |
b1971b067a | ||
![]() |
a5319427a2 | ||
![]() |
e0a4dc3b66 | ||
![]() |
0b51beff26 | ||
![]() |
6a9f9aed30 | ||
![]() |
3ae83be021 | ||
![]() |
d2ab6fa4ae | ||
![]() |
0a2466a08d | ||
![]() |
172bb3734a | ||
![]() |
b7508d8396 | ||
![]() |
fd27364317 | ||
![]() |
d37ca24da9 | ||
![]() |
1ce2fb42de | ||
![]() |
4ca47e6db9 | ||
![]() |
fbe6969a0d | ||
![]() |
7dfd94a088 | ||
![]() |
f6bbb5b67d | ||
![]() |
c9f4204ae8 | ||
![]() |
29c18b0112 | ||
![]() |
e2e28a6bb6 | ||
![]() |
5a175fe228 | ||
![]() |
15a6cf7d14 | ||
![]() |
ed457c6e1c | ||
![]() |
c1e67d9856 | ||
![]() |
0c91b0eaff | ||
![]() |
e886317f9b | ||
![]() |
015d162d41 | ||
![]() |
211ce24020 | ||
![]() |
8750e911f1 | ||
![]() |
d9ba7079b8 | ||
![]() |
21a0819274 | ||
![]() |
2d96867e30 | ||
![]() |
4c80a153cb | ||
![]() |
3dd5699238 | ||
![]() |
bffe708e47 | ||
![]() |
7606bb65ea | ||
![]() |
2f4d5c6542 | ||
![]() |
deab8d9392 | ||
![]() |
c12ba74f1d | ||
![]() |
9c6413521d | ||
![]() |
c892524146 | ||
![]() |
473a1324fc | ||
![]() |
49a305e7ef | ||
![]() |
a40916cbba | ||
![]() |
62ecdf077f | ||
![]() |
5905787c6d | ||
![]() |
9f03d028e7 | ||
![]() |
10f8acdf4c | ||
![]() |
cd029eb6f0 | ||
![]() |
f6fefec921 | ||
![]() |
ec5a7681fe | ||
![]() |
a21ce67a63 | ||
![]() |
e2f0d879b1 | ||
![]() |
017f35edba | ||
![]() |
a0434788ce | ||
![]() |
b269af6829 | ||
![]() |
9273be0795 | ||
![]() |
6c8a3344b6 | ||
![]() |
e80f233749 | ||
![]() |
6835cdf3b4 | ||
![]() |
c0c943e82b | ||
![]() |
bb67f28a1e | ||
![]() |
08f7417a98 | ||
![]() |
84c881d0b5 | ||
![]() |
f25209267f | ||
![]() |
07cc19fcac | ||
![]() |
34aca2b6b6 | ||
![]() |
67dbe90856 | ||
![]() |
4a29c4e39f | ||
![]() |
0902926150 | ||
![]() |
15d95d5f92 | ||
![]() |
0116eae43e | ||
![]() |
d01f1d89e3 | ||
![]() |
722a5c5ade | ||
![]() |
2788e3983e | ||
![]() |
5ba3ebb593 | ||
![]() |
2b19ce86dc | ||
![]() |
140e5c3f3b | ||
![]() |
77bc62c3a7 | ||
![]() |
42f335ca0e | ||
![]() |
43b30bf2c8 | ||
![]() |
06e12403e0 | ||
![]() |
03b3a0d022 | ||
![]() |
f840728f43 | ||
![]() |
30fc34625c | ||
![]() |
18f3210a35 | ||
![]() |
82da9623bf | ||
![]() |
7c0341dbc4 | ||
![]() |
7450139b8b | ||
![]() |
e85e5ca5ec | ||
![]() |
67cdaca99d | ||
![]() |
b00f715c96 | ||
![]() |
098927c384 | ||
![]() |
0eb8e0058c | ||
![]() |
56c55b0655 | ||
![]() |
e17d60d5fb | ||
![]() |
e32b08abc3 | ||
![]() |
2776beb91a | ||
![]() |
dca20343e0 | ||
![]() |
e99f6700e1 | ||
![]() |
3da3c85a3f | ||
![]() |
d58d546e2d | ||
![]() |
780b97aba6 | ||
![]() |
e0ec2d772c | ||
![]() |
5fbf6769fc | ||
![]() |
7bf79446c8 | ||
![]() |
bdee60fc1a | ||
![]() |
0b62d2f4c9 | ||
![]() |
4375ca95a4 | ||
![]() |
acce7b5963 | ||
![]() |
c5098ee16f | ||
![]() |
6d0e43d555 | ||
![]() |
9f32d49de9 | ||
![]() |
db84c9075b | ||
![]() |
e96fad9d2d | ||
![]() |
0c7b06714e | ||
![]() |
d893001918 | ||
![]() |
b8bd781b7e | ||
![]() |
bb792a485a | ||
![]() |
452421d059 | ||
![]() |
ea8399724e | ||
![]() |
26655341fc | ||
![]() |
5858d32a59 | ||
![]() |
0dfe532ea9 | ||
![]() |
5c567ffd4c | ||
![]() |
3bc1781994 | ||
![]() |
485bcc9cab | ||
![]() |
bb1bbb3274 | ||
![]() |
4bd7bc97e8 | ||
![]() |
4d4339922c | ||
![]() |
c3d03b70af | ||
![]() |
e4c2c550b9 | ||
![]() |
570357b7a8 | ||
![]() |
7044d328a2 | ||
![]() |
35d7cc8166 | ||
![]() |
80790d89ec | ||
![]() |
7bad200b49 | ||
![]() |
6b6f64da2d | ||
![]() |
31def5ae59 | ||
![]() |
713407a5c7 | ||
![]() |
db73333585 | ||
![]() |
84c9b6edb1 | ||
![]() |
e609c04994 | ||
![]() |
53cfa36d37 | ||
![]() |
b10bd63df3 | ||
![]() |
44a287747f | ||
![]() |
20a413620c | ||
![]() |
e99b588f1b | ||
![]() |
48a3f2818e | ||
![]() |
fc0e014ca3 | ||
![]() |
8baaeba881 | ||
![]() |
150ebacd8a | ||
![]() |
bedcd5c0bb | ||
![]() |
fd86c390eb | ||
![]() |
63453c025f | ||
![]() |
ecb1445ce2 | ||
![]() |
64c32bf9eb | ||
![]() |
775e82c58d | ||
![]() |
db5cbd8954 | ||
![]() |
c6012b252d | ||
![]() |
e1ff593dcb | ||
![]() |
c4d9c13a31 | ||
![]() |
00c1c6cb28 | ||
![]() |
973fbfe3a3 | ||
![]() |
9fc1d3f4c4 | ||
![]() |
765863f0bf | ||
![]() |
cbd72088ec | ||
![]() |
8aabdf3505 | ||
![]() |
fcec494072 | ||
![]() |
88f62fb98a | ||
![]() |
69488fa929 | ||
![]() |
b0367dde56 | ||
![]() |
ad93095f16 | ||
![]() |
82b47955fc | ||
![]() |
95477d36f6 | ||
![]() |
eb798944b3 | ||
![]() |
b1ca6f2f3d | ||
![]() |
102e6481ae | ||
![]() |
97949ccfc8 | ||
![]() |
44e9bc81eb | ||
![]() |
4b27a9feb3 | ||
![]() |
0649b6f0f2 | ||
![]() |
389ff2e01f | ||
![]() |
8cf1846857 | ||
![]() |
2dab26339d | ||
![]() |
239e31f896 | ||
![]() |
4bf3222d96 | ||
![]() |
3380c4561e | ||
![]() |
3f2f0c8892 | ||
![]() |
0ee883650d | ||
![]() |
70cf309517 | ||
![]() |
8b5bf52ac2 | ||
![]() |
73a9485081 | ||
![]() |
d37a65bc81 | ||
![]() |
9dc4f157bc | ||
![]() |
34c7ff6dc9 | ||
![]() |
647907918d | ||
![]() |
cee73df3bd | ||
![]() |
07481951f9 | ||
![]() |
f15c448a72 | ||
![]() |
fcb41c0ee8 | ||
![]() |
8513320593 | ||
![]() |
9b62318311 | ||
![]() |
c1efb6705f | ||
![]() |
5f1841cdca | ||
![]() |
4b45051902 | ||
![]() |
f07320eae0 | ||
![]() |
9e5790ce21 | ||
![]() |
a0724cb261 | ||
![]() |
cdbba1067f | ||
![]() |
d837ca70f7 | ||
![]() |
fb64e17555 | ||
![]() |
e8f245d243 | ||
![]() |
fce8c6cc53 | ||
![]() |
0ff469d38d | ||
![]() |
73f3c281ff | ||
![]() |
05338b58ce | ||
![]() |
081057c3ff | ||
![]() |
94c1672ef0 | ||
![]() |
405d9761a5 | ||
![]() |
4c3a2d64e4 | ||
![]() |
6a62b2e54b | ||
![]() |
98a2fd32a0 | ||
![]() |
7bdeeb64ac | ||
![]() |
43b45a42fd | ||
![]() |
9af1bfb3d5 | ||
![]() |
aed14edd12 | ||
![]() |
14a948e6ad | ||
![]() |
af2fcf3a65 | ||
![]() |
4a676ac4f8 | ||
![]() |
37e27219f2 | ||
![]() |
d2284ab5d1 | ||
![]() |
78e91e7574 | ||
![]() |
c1668fe59d | ||
![]() |
e1cc0671ac | ||
![]() |
c1a8a5de13 | ||
![]() |
e3d0e0a792 | ||
![]() |
7c7667b86b | ||
![]() |
38be5db93b | ||
![]() |
6a50d0a422 | ||
![]() |
7ab2d30349 | ||
![]() |
d753c3f582 | ||
![]() |
1897c89302 | ||
![]() |
9aa260ab57 | ||
![]() |
c7e7d382d5 | ||
![]() |
3cc54008eb | ||
![]() |
ff8bcccdd4 | ||
![]() |
81170986ed | ||
![]() |
a93b01be57 | ||
![]() |
04b304d346 | ||
![]() |
6c61726b2a | ||
![]() |
cd202fe2f9 | ||
![]() |
69af4faec1 | ||
![]() |
4b21c202ff | ||
![]() |
df9e0bf507 | ||
![]() |
879b19801a | ||
![]() |
6ec8e63af6 | ||
![]() |
465b9f6b26 | ||
![]() |
0c9c87a76e | ||
![]() |
a7a90b2f00 | ||
![]() |
4d6e7733fa | ||
![]() |
2deadf1672 | ||
![]() |
9ea862e0b3 | ||
![]() |
11c9b7cfeb | ||
![]() |
b08868c48a | ||
![]() |
9ca46ff609 | ||
![]() |
800e400de5 | ||
![]() |
05886a6f77 | ||
![]() |
667aef4c6a | ||
![]() |
49e179cc52 | ||
![]() |
aa4ce7315f | ||
![]() |
c741b83762 | ||
![]() |
64387788a9 | ||
![]() |
480506bd49 | ||
![]() |
0d5ea7613e | ||
![]() |
beb056b303 | ||
![]() |
4e321ffaff | ||
![]() |
6ededa42db | ||
![]() |
36d16f8ee0 | ||
![]() |
ab781a0cb6 | ||
![]() |
19c2987eb6 | ||
![]() |
b09af97686 | ||
![]() |
a7b1c7732f | ||
![]() |
abc64463af | ||
![]() |
2e7245f5a3 | ||
![]() |
f76b062e16 | ||
![]() |
cc1717eaa4 | ||
![]() |
c5156d952e | ||
![]() |
0b2d0d7d13 | ||
![]() |
b732a8cf5f | ||
![]() |
a7dc451ebe | ||
![]() |
1e764f463e | ||
![]() |
87357fc0b8 | ||
![]() |
a2c96d888d | ||
![]() |
a7a0af0ca4 | ||
![]() |
9a6c6b99bf | ||
![]() |
033c79dff1 | ||
![]() |
b362536275 | ||
![]() |
aa16a28631 | ||
![]() |
2757c67da2 | ||
![]() |
148111ff0a | ||
![]() |
3d5fd31280 | ||
![]() |
c7199e62f1 | ||
![]() |
0b3fc6e63b | ||
![]() |
c2db9cfb52 | ||
![]() |
6bc8e6b898 | ||
![]() |
6eb4958989 | ||
![]() |
9edf4e8157 | ||
![]() |
b07a7b5daa | ||
![]() |
965a1cb92e | ||
![]() |
e9ad6665a5 | ||
![]() |
b5855b2f32 | ||
![]() |
a0bee97e55 | ||
![]() |
e7076c5a80 | ||
![]() |
ff22e913a3 | ||
![]() |
132f25950b | ||
![]() |
4ed56cba63 | ||
![]() |
145878ca29 | ||
![]() |
a36c30136e | ||
![]() |
04d0d0accf | ||
![]() |
92ad8e5c37 | ||
![]() |
00df894701 | ||
![]() |
630e4a6e59 | ||
![]() |
bf2336f478 | ||
![]() |
4f6c2bacb1 | ||
![]() |
384dba6edb | ||
![]() |
2c45bf2bc9 | ||
![]() |
836ec0c764 | ||
![]() |
5e72fb063a | ||
![]() |
d9536ccffa | ||
![]() |
37ce8cffcc | ||
![]() |
2dc08d5f5d | ||
![]() |
00b8abee61 | ||
![]() |
7efebab9fd | ||
![]() |
a74286d636 | ||
![]() |
254cfe878e | ||
![]() |
ed824195a1 | ||
![]() |
22c3600e4c | ||
![]() |
49f386578e | ||
![]() |
7c671508bd | ||
![]() |
76693ca0a3 | ||
![]() |
d3fdc27aa8 | ||
![]() |
4182f0ffc7 | ||
![]() |
40e950aed6 | ||
![]() |
0ef4ec4fd4 | ||
![]() |
f868b61376 | ||
![]() |
987bebaf8c | ||
![]() |
65f0efe198 | ||
![]() |
e77d8f2ecd | ||
![]() |
f68854b4c3 | ||
![]() |
c61a8ad5b0 | ||
![]() |
89234b1eed | ||
![]() |
2ec5ebb979 | ||
![]() |
863a155451 | ||
![]() |
1ddce0bebf | ||
![]() |
4347c0a76d | ||
![]() |
f1429a972f | ||
![]() |
45bc841b22 | ||
![]() |
7a111bc864 | ||
![]() |
1cfd258ed6 | ||
![]() |
04d7d51ea2 | ||
![]() |
48d0ba4a1e | ||
![]() |
0e23faec0a | ||
![]() |
7590f37fd7 | ||
![]() |
2906dc8601 | ||
![]() |
c8d5c71af5 | ||
![]() |
ff990440ee | ||
![]() |
0e304b7f41 | ||
![]() |
f97b4a776e | ||
![]() |
b99daf76a7 | ||
![]() |
8fc6cb77c5 | ||
![]() |
fbe6ba81e9 | ||
![]() |
b219bb8f62 | ||
![]() |
2b85e23d2e | ||
![]() |
026bb0b96a | ||
![]() |
6424498226 | ||
![]() |
0b418c7d51 | ||
![]() |
13051e9316 | ||
![]() |
0174c56851 | ||
![]() |
3ed449e94a | ||
![]() |
4f1c33b430 | ||
![]() |
1334462ab3 | ||
![]() |
a34f2d42b4 | ||
![]() |
5dc4923359 | ||
![]() |
e62991a07c | ||
![]() |
52272327f3 | ||
![]() |
5820d87a5f | ||
![]() |
1bf955920a | ||
![]() |
89b1fd98ac | ||
![]() |
51d28013db | ||
![]() |
ee2bf876c2 | ||
![]() |
8861ba355d | ||
![]() |
e44f62c2b1 | ||
![]() |
9e88c82703 | ||
![]() |
9d2f51c086 | ||
![]() |
ad0db060b1 | ||
![]() |
3547478fc8 | ||
![]() |
29dc350813 | ||
![]() |
342b7e0458 | ||
![]() |
bc3cae7e7d | ||
![]() |
96534114a3 | ||
![]() |
4ecd7d2b7e | ||
![]() |
9d728b8d10 | ||
![]() |
37942fab51 | ||
![]() |
d060fc9ff2 | ||
![]() |
36521f0150 |
107
CHANGES
107
CHANGES
@@ -2,8 +2,87 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 0.9.7i and 0.9.7j [XX xxx XXXX]
|
||||
|
||||
*) Add new Windows build target VC-32-GMAKE for VC++. This uses GNU make
|
||||
from a Windows bash shell such as MSYS. It is autodetected from the
|
||||
"config" script when run from a VC++ environment. Modify standard VC++
|
||||
build to use fipscanister.o from the GNU make build.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.7h and 0.9.7i [14 Oct 2005]
|
||||
|
||||
*) Wrapped the definition of EVP_MAX_MD_SIZE in a #ifdef OPENSSL_FIPS.
|
||||
The value now differs depending on if you build for FIPS or not.
|
||||
BEWARE! A program linked with a shared FIPSed libcrypto can't be
|
||||
safely run with a non-FIPSed libcrypto, as it may crash because of
|
||||
the difference induced by this change.
|
||||
[Andy Polyakov]
|
||||
|
||||
Changes between 0.9.7g and 0.9.7h [11 Oct 2005]
|
||||
|
||||
*) Remove the functionality of SSL_OP_MSIE_SSLV2_RSA_PADDING
|
||||
(part of SSL_OP_ALL). This option used to disable the
|
||||
countermeasure against man-in-the-middle protocol-version
|
||||
rollback in the SSL 2.0 server implementation, which is a bad
|
||||
idea. (CVE-2005-2969)
|
||||
|
||||
[Bodo Moeller; problem pointed out by Yutaka Oiwa (Research Center
|
||||
for Information Security, National Institute of Advanced Industrial
|
||||
Science and Technology [AIST], Japan)]
|
||||
|
||||
*) Minimal support for X9.31 signatures and PSS padding modes. This is
|
||||
mainly for FIPS compliance and not fully integrated at this stage.
|
||||
[Steve Henson]
|
||||
|
||||
*) For DSA signing, unless DSA_FLAG_NO_EXP_CONSTTIME is set, perform
|
||||
the exponentiation using a fixed-length exponent. (Otherwise,
|
||||
the information leaked through timing could expose the secret key
|
||||
after many signatures; cf. Bleichenbacher's attack on DSA with
|
||||
biased k.)
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Make a new fixed-window mod_exp implementation the default for
|
||||
RSA, DSA, and DH private-key operations so that the sequence of
|
||||
squares and multiplies and the memory access pattern are
|
||||
independent of the particular secret key. This will mitigate
|
||||
cache-timing and potential related attacks.
|
||||
|
||||
BN_mod_exp_mont_consttime() is the new exponentiation implementation,
|
||||
and this is automatically used by BN_mod_exp_mont() if the new flag
|
||||
BN_FLG_EXP_CONSTTIME is set for the exponent. RSA, DSA, and DH
|
||||
will use this BN flag for private exponents unless the flag
|
||||
RSA_FLAG_NO_EXP_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME, or
|
||||
DH_FLAG_NO_EXP_CONSTTIME, respectively, is set.
|
||||
|
||||
[Matthew D Wood (Intel Corp), with some changes by Bodo Moeller]
|
||||
|
||||
*) Change the client implementation for SSLv23_method() and
|
||||
SSLv23_client_method() so that is uses the SSL 3.0/TLS 1.0
|
||||
Client Hello message format if the SSL_OP_NO_SSLv2 option is set.
|
||||
(Previously, the SSL 2.0 backwards compatible Client Hello
|
||||
message format would be used even with SSL_OP_NO_SSLv2.)
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Add support for smime-type MIME parameter in S/MIME messages which some
|
||||
clients need.
|
||||
[Steve Henson]
|
||||
|
||||
*) New function BN_MONT_CTX_set_locked() to set montgomery parameters in
|
||||
a threadsafe manner. Modify rsa code to use new function and add calls
|
||||
to dsa and dh code (which had race conditions before).
|
||||
[Steve Henson]
|
||||
|
||||
*) Include the fixed error library code in the C error file definitions
|
||||
instead of fixing them up at runtime. This keeps the error code
|
||||
structures constant.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.7f and 0.9.7g [11 Apr 2005]
|
||||
|
||||
[NB: OpenSSL 0.9.7h and later 0.9.7 patch levels were released after
|
||||
OpenSSL 0.9.8.]
|
||||
|
||||
*) Fixes for newer kerberos headers. NB: the casts are needed because
|
||||
the 'length' field is signed on one version and unsigned on another
|
||||
with no (?) obvious way to tell the difference, without these VC++
|
||||
@@ -111,11 +190,11 @@
|
||||
Changes between 0.9.7c and 0.9.7d [17 Mar 2004]
|
||||
|
||||
*) Fix null-pointer assignment in do_change_cipher_spec() revealed
|
||||
by using the Codenomicon TLS Test Tool (CAN-2004-0079)
|
||||
by using the Codenomicon TLS Test Tool (CVE-2004-0079)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
*) Fix flaw in SSL/TLS handshaking when using Kerberos ciphersuites
|
||||
(CAN-2004-0112)
|
||||
(CVE-2004-0112)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
*) Make it possible to have multiple active certificates with the same
|
||||
@@ -158,9 +237,9 @@
|
||||
*) Fix various bugs revealed by running the NISCC test suite:
|
||||
|
||||
Stop out of bounds reads in the ASN1 code when presented with
|
||||
invalid tags (CAN-2003-0543 and CAN-2003-0544).
|
||||
invalid tags (CVE-2003-0543 and CVE-2003-0544).
|
||||
|
||||
Free up ASN1_TYPE correctly if ANY type is invalid (CAN-2003-0545).
|
||||
Free up ASN1_TYPE correctly if ANY type is invalid (CVE-2003-0545).
|
||||
|
||||
If verify callback ignores invalid public key errors don't try to check
|
||||
certificate signature with the NULL public key.
|
||||
@@ -245,7 +324,7 @@
|
||||
via timing by performing a MAC computation even if incorrrect
|
||||
block cipher padding has been found. This is a countermeasure
|
||||
against active attacks where the attacker has to distinguish
|
||||
between bad padding and a MAC verification error. (CAN-2003-0078)
|
||||
between bad padding and a MAC verification error. (CVE-2003-0078)
|
||||
|
||||
[Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
|
||||
Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
|
||||
@@ -462,7 +541,7 @@
|
||||
|
||||
Remote buffer overflow in SSL3 protocol - an attacker could
|
||||
supply an oversized master key in Kerberos-enabled versions.
|
||||
(CAN-2002-0657)
|
||||
(CVE-2002-0657)
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
*) Change the SSL kerb5 codes to match RFC 2712.
|
||||
@@ -2146,7 +2225,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
Changes between 0.9.6l and 0.9.6m [17 Mar 2004]
|
||||
|
||||
*) Fix null-pointer assignment in do_change_cipher_spec() revealed
|
||||
by using the Codenomicon TLS Test Tool (CAN-2004-0079)
|
||||
by using the Codenomicon TLS Test Tool (CVE-2004-0079)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
Changes between 0.9.6k and 0.9.6l [04 Nov 2003]
|
||||
@@ -2154,7 +2233,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Fix additional bug revealed by the NISCC test suite:
|
||||
|
||||
Stop bug triggering large recursion when presented with
|
||||
certain ASN.1 tags (CAN-2003-0851)
|
||||
certain ASN.1 tags (CVE-2003-0851)
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.6j and 0.9.6k [30 Sep 2003]
|
||||
@@ -2162,7 +2241,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Fix various bugs revealed by running the NISCC test suite:
|
||||
|
||||
Stop out of bounds reads in the ASN1 code when presented with
|
||||
invalid tags (CAN-2003-0543 and CAN-2003-0544).
|
||||
invalid tags (CVE-2003-0543 and CVE-2003-0544).
|
||||
|
||||
If verify callback ignores invalid public key errors don't try to check
|
||||
certificate signature with the NULL public key.
|
||||
@@ -2214,7 +2293,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
via timing by performing a MAC computation even if incorrrect
|
||||
block cipher padding has been found. This is a countermeasure
|
||||
against active attacks where the attacker has to distinguish
|
||||
between bad padding and a MAC verification error. (CAN-2003-0078)
|
||||
between bad padding and a MAC verification error. (CVE-2003-0078)
|
||||
|
||||
[Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
|
||||
Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
|
||||
@@ -2347,7 +2426,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Add various sanity checks to asn1_get_length() to reject
|
||||
the ASN1 length bytes if they exceed sizeof(long), will appear
|
||||
negative or the content length exceeds the length of the
|
||||
supplied buffer. (CAN-2002-0659)
|
||||
supplied buffer. (CVE-2002-0659)
|
||||
[Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
|
||||
|
||||
*) Assertions for various potential buffer overflows, not known to
|
||||
@@ -2355,15 +2434,15 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
*) Various temporary buffers to hold ASCII versions of integers were
|
||||
too small for 64 bit platforms. (CAN-2002-0655)
|
||||
too small for 64 bit platforms. (CVE-2002-0655)
|
||||
[Matthew Byng-Maddick <mbm@aldigital.co.uk> and Ben Laurie (CHATS)>
|
||||
|
||||
*) Remote buffer overflow in SSL3 protocol - an attacker could
|
||||
supply an oversized session ID to a client. (CAN-2002-0656)
|
||||
supply an oversized session ID to a client. (CVE-2002-0656)
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
*) Remote buffer overflow in SSL2 protocol - an attacker could
|
||||
supply an oversized client master key. (CAN-2002-0656)
|
||||
supply an oversized client master key. (CVE-2002-0656)
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
Changes between 0.9.6c and 0.9.6d [9 May 2002]
|
||||
|
114
Configure
114
Configure
@@ -177,11 +177,11 @@ my %table=(
|
||||
# actually recommend to consider using gcc shared build even with vendor
|
||||
# compiler:-)
|
||||
# <appro@fy.chalmers.se>
|
||||
"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o::::::asm/rc4-amd64.o:::dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o::::::asm/rc4-x86_64.o:::dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### Solaris x86 with Sun C setups
|
||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL::::::::::dlfcn:solaris-shared:-KPIC:-xarch=amd64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL::::::::::dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### 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::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
@@ -200,17 +200,17 @@ my %table=(
|
||||
|
||||
#### SPARC Solaris with Sun C setups
|
||||
# DO NOT use /xO[34] on sparc with SC3.0. It is broken, and will not pass the tests
|
||||
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
|
||||
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
|
||||
# SC5.0 note: Compiler common patch 107357-01 or later is required!
|
||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
|
||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
|
||||
####
|
||||
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### SPARC Linux setups
|
||||
"linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
|
||||
@@ -271,56 +271,56 @@ my %table=(
|
||||
#
|
||||
#!#"hpux-parisc-cc","cc:-Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
# Since there is mention of this in shlib/hpux10-cc.sh
|
||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-Wl,+cdp,../%3a,+cdp,./%3a,+s,+b,\$(INSTALLTOP)/lib -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::-Wl,+cdp,../%3a,+cdp,./%3a,+s,+b,\$(INSTALLTOP)/lib -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# 64bit PARISC for GCC without optimization, which seems to make problems.
|
||||
# Submitted by <ross.alexander@uk.neceur.com>
|
||||
"hpux64-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# IA-64 targets
|
||||
"hpux-ia64-cc","cc:-Ae +DD32 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:hpux-shared:+Z::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-ia64-cc","cc:-Ae +DD32 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:hpux-shared:+Z:-b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted with
|
||||
# with debugging of the following config.
|
||||
"hpux64-ia64-cc","cc:-Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:hpux64-shared:+Z::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-ia64-cc","cc:-Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:hpux-shared:+Z:+DD64 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# More attempts at unified 10.X and 11.X targets for HP C compiler.
|
||||
#
|
||||
# Chris Ruemmler <ruemmler@cup.hp.com>
|
||||
# Kevin Steves <ks@hp.se>
|
||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+cdp,../%3a,+cdp,./%3a,+s,+b,\$(INSTALLTOP)/lib -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+cdp,../%3a,+cdp,./%3a,+s,+b,\$(INSTALLTOP)/lib -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# Isn't the line below meaningless? HP-UX cc optimizes for host by default.
|
||||
# hpux-parisc1_0-cc with +DAportable flag would make more sense. <appro>
|
||||
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+cdp,../%3a,+cdp,./%3a,+s,+b,\$(INSTALLTOP)/lib -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# HPUX 9.X config.
|
||||
# Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or
|
||||
# egcs. gcc 2.8.1 is also broken.
|
||||
|
||||
"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown)::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown)::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux-cc fails (e.g. during "make test"), try the next one; otherwise,
|
||||
# please report your OS and compiler version to the openssl-bugs@openssl.org
|
||||
# mailing list.
|
||||
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown)::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux-gcc fails, try this one:
|
||||
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# HPUX 9.X on Motorola 68k platforms with gcc
|
||||
"hpux-m68k-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):::BN_LLONG DES_PTR DES_UNROLL:::::::::::::",
|
||||
|
||||
# HPUX 10.X config. Supports threads.
|
||||
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux10-cc fails, try this one (if still fails, try deleting BN_LLONG):
|
||||
"hpux10-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
"hpux10-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux10-gcc fails, try this one:
|
||||
"hpux10-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s,+b,\$(INSTALLTOP)/lib -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# HPUX 11.X from www.globus.org.
|
||||
# Only works on PA-RISC 2.0 cpus, and not optimized. Why?
|
||||
@@ -409,10 +409,9 @@ my %table=(
|
||||
"linux-m68k", "gcc:-DB_ENDIAN -DTERMIO -O2 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::",
|
||||
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:asm/ia64.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64-ecc", "ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:asm/ia64.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o::::::asm/rc4-amd64.o:::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-em64t", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o:::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64-ecc", "ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o::::asm/sha1-ia64.o::asm/rc4-ia64.o:::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o::::::asm/rc4-x86_64.o:::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
@@ -530,17 +529,17 @@ my %table=(
|
||||
"BC-16","bcc:::(unknown):WIN16::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",
|
||||
|
||||
# MinGW
|
||||
"mingw", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll",
|
||||
"mingw", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_out_asm}:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
|
||||
|
||||
# UWIN
|
||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
|
||||
# Cygwin
|
||||
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:cygwin-shared:-D_WINDLL::.dll",
|
||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:cygwin-shared:-D_WINDLL::.dll.a",
|
||||
|
||||
# DJGPP
|
||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall -DDEVRANDOM=\"/dev/urandom\\x24\":::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
|
||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
|
||||
|
||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||
"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
|
||||
@@ -563,7 +562,7 @@ my %table=(
|
||||
|
||||
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
|
||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
"darwin-ppc-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/osx_ppc32.o::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-ppc-cc","cc:-O3 -fomit-frame-pointer -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/osx_ppc32.o:::::::::dlfcn:darwin-shared:-fPIC -fno-common::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
|
||||
##### A/UX
|
||||
@@ -866,6 +865,14 @@ PROCESS_ARGS:
|
||||
{
|
||||
$withargs{"krb5-".$1}=$2;
|
||||
}
|
||||
elsif (/^--with-zlib-lib=(.*)$/)
|
||||
{
|
||||
$withargs{"zlib-lib"}=$1;
|
||||
}
|
||||
elsif (/^--with-zlib-include=(.*)$/)
|
||||
{
|
||||
$withargs{"zlib-include"}="-I$1";
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR $usage;
|
||||
@@ -879,7 +886,7 @@ PROCESS_ARGS:
|
||||
}
|
||||
else
|
||||
{
|
||||
die "target already defined - $target\n" if ($target ne "");
|
||||
die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
|
||||
$target=$_;
|
||||
}
|
||||
unless ($_ eq $target) {
|
||||
@@ -969,6 +976,7 @@ $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/]
|
||||
print "IsWindows=$IsWindows\n";
|
||||
|
||||
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
for (@fields) { s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; }
|
||||
my $cc = $fields[$idx_cc];
|
||||
my $cflags = $fields[$idx_cflags];
|
||||
my $unistd = $fields[$idx_unistd];
|
||||
@@ -1027,7 +1035,7 @@ else
|
||||
if $withargs{"krb5-dir"} eq "";
|
||||
$withargs{"krb5-lib"} = "-L".$withargs{"krb5-dir"}.
|
||||
"/lib -lgssapi -lkrb5 -lcom_err"
|
||||
if $withargs{"krb5-lib"} eq "";
|
||||
if $withargs{"krb5-lib"} eq "" && !$IsWindows;
|
||||
$cflags="-DKRB5_HEIMDAL $cflags";
|
||||
}
|
||||
if ($withargs{"krb5-flavor"} =~ /^[Mm][Ii][Tt]/)
|
||||
@@ -1036,7 +1044,7 @@ else
|
||||
if $withargs{"krb5-dir"} eq "";
|
||||
$withargs{"krb5-lib"} = "-L".$withargs{"krb5-dir"}.
|
||||
"/lib -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto"
|
||||
if $withargs{"krb5-lib"} eq "";
|
||||
if $withargs{"krb5-lib"} eq "" && !$IsWindows;
|
||||
$cflags="-DKRB5_MIT $cflags";
|
||||
$withargs{"krb5-flavor"} =~ s/^[Mm][Ii][Tt][._-]*//;
|
||||
if ($withargs{"krb5-flavor"} =~ /^1[._-]*[01]/)
|
||||
@@ -1055,7 +1063,7 @@ else
|
||||
}
|
||||
}
|
||||
$withargs{"krb5-lib"} .= " -lresolv"
|
||||
if ("$lresolv" ne "");
|
||||
if ("$lresolv" ne "" && !$IsWindows);
|
||||
$withargs{"krb5-include"} = "-I".$withargs{"krb5-dir"}."/include"
|
||||
if $withargs{"krb5-include"} eq "" &&
|
||||
$withargs{"krb5-dir"} ne "";
|
||||
@@ -1151,7 +1159,8 @@ if (!$no_shared)
|
||||
{
|
||||
if ($shared_cflag ne "")
|
||||
{
|
||||
$cflags = "$shared_cflag $cflags";
|
||||
$cflags = "$shared_cflag -DOPENSSL_PIC $cflags";
|
||||
$shared_ldflag = "$shared_ldflag $shared_cflag" if($fips);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1174,16 +1183,22 @@ if ($ranlib eq "")
|
||||
$bn_obj = $bn_asm unless $bn_obj ne "";
|
||||
|
||||
my $fips_des_obj;
|
||||
my $fips_aes_obj;
|
||||
my $fips_sha1_obj;
|
||||
if ($fips)
|
||||
{
|
||||
if ($des_obj =~ /\-elf\.o$/ && $no_shared) # FIPS DES module is not PIC
|
||||
if ($des_obj =~ /\-elf\.o$/)
|
||||
{
|
||||
$fips_des_obj='asm/fips-dx86-elf.o';
|
||||
$openssl_other_defines.="#define OPENSSL_FIPS_DES_ASM\n";
|
||||
$fips_aes_obj='asm/fips-ax86-elf.o';
|
||||
$openssl_other_defines.="#define OPENSSL_FIPS_AES_ASM\n";
|
||||
}
|
||||
else { $fips_des_obj=$fips_des_enc; }
|
||||
$fips_sha1_obj='asm/sx86-elf.o' if ($sha1_obj =~ /\-elf\.o$/);
|
||||
else {
|
||||
$fips_des_obj=$fips_des_enc;
|
||||
$fips_aes_obj='fips_aes_core.o';
|
||||
}
|
||||
$fips_sha1_obj='asm/fips-sx86-elf.o' if ($sha1_obj =~ /\-elf\.o$/);
|
||||
$des_obj=$sha1_obj="";
|
||||
$openssl_other_defines.="#define OPENSSL_FIPS\n";
|
||||
}
|
||||
@@ -1287,6 +1302,7 @@ while (<IN>)
|
||||
s/^BN_ASM=.*$/BN_ASM= $bn_obj/;
|
||||
s/^DES_ENC=.*$/DES_ENC= $des_obj/;
|
||||
s/^FIPS_DES_ENC=.*$/FIPS_DES_ENC= $fips_des_obj/;
|
||||
s/^FIPS_AES_ENC=.*$/FIPS_AES_ENC= $fips_aes_obj/;
|
||||
s/^BF_ENC=.*$/BF_ENC= $bf_obj/;
|
||||
s/^CAST_ENC=.*$/CAST_ENC= $cast_obj/;
|
||||
s/^RC4_ENC=.*$/RC4_ENC= $rc4_obj/;
|
||||
@@ -1301,6 +1317,8 @@ while (<IN>)
|
||||
s/^PERL=.*/PERL= $perl/;
|
||||
s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/;
|
||||
s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
|
||||
s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/;
|
||||
s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/;
|
||||
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
|
||||
s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
|
||||
s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
|
||||
@@ -1654,12 +1672,13 @@ sub print_table_entry
|
||||
{
|
||||
my $target = shift;
|
||||
|
||||
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
for (@fields) { s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; }
|
||||
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags,
|
||||
my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
|
||||
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
|
||||
my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,
|
||||
my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags)=
|
||||
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags)=@fields;
|
||||
|
||||
print <<EOF
|
||||
|
||||
@@ -1702,6 +1721,7 @@ sub test_sanity
|
||||
foreach $target (sort keys %table)
|
||||
{
|
||||
@fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
for (@fields) { s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; }
|
||||
|
||||
if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/)
|
||||
{
|
||||
|
6
FAQ
6
FAQ
@@ -70,7 +70,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* Which is the current version of OpenSSL?
|
||||
|
||||
The current version is available from <URL: http://www.openssl.org>.
|
||||
OpenSSL 0.9.7g was released on April 11, 2005.
|
||||
OpenSSL 0.9.7i was released on October 14, 2005.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
@@ -141,8 +141,8 @@ less Unix-centric, it might have been used much earlier.
|
||||
|
||||
With version 0.9.6 OpenSSL was extended to interface to external crypto
|
||||
hardware. This was realized in a special release '0.9.6-engine'. With
|
||||
version 0.9.7 (not yet released) the changes were merged into the main
|
||||
development line, so that the special release is no longer necessary.
|
||||
version 0.9.7 the changes were merged into the main development line,
|
||||
so that the special release is no longer necessary.
|
||||
|
||||
* How do I check the authenticity of the OpenSSL distribution?
|
||||
|
||||
|
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2005 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
|
||||
|
130
Makefile.org
130
Makefile.org
@@ -102,6 +102,7 @@ PROCESSOR=
|
||||
# Set DES_ENC to des_enc.o if you want to use the C version
|
||||
#There are 4 x86 assember options.
|
||||
FIPS_DES_ENC= des_enc.o fcrypt_b.o
|
||||
FIPS_AES_ENC= fips_aes_core.o
|
||||
DES_ENC= asm/dx86-out.o asm/yx86-out.o
|
||||
#DES_ENC= des_enc.o fcrypt_b.o # C
|
||||
#DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
|
||||
@@ -171,11 +172,15 @@ RMD160_ASM_OBJ= asm/rm86-out.o
|
||||
KRB5_INCLUDES=
|
||||
LIBKRB5=
|
||||
|
||||
# Zlib stuff
|
||||
ZLIB_INCLUDE=
|
||||
LIBZLIB=
|
||||
|
||||
# When we're prepared to use shared libraries in the programs we link here
|
||||
# we might set SHLIB_MARK to '$(SHARED_LIBS)'.
|
||||
SHLIB_MARK=
|
||||
|
||||
DIRS= crypto fips ssl $(SHLIB_MARK) sigs apps test tools
|
||||
DIRS= crypto fips-1.0 ssl $(SHLIB_MARK) apps test tools
|
||||
SHLIBDIRS= crypto ssl
|
||||
|
||||
# dirs in crypto to build
|
||||
@@ -186,7 +191,7 @@ SDIRS= objects \
|
||||
buffer bio stack lhash rand err \
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
|
||||
|
||||
FDIRS= sha1 rand des aes dsa rsa dh
|
||||
FDIRS= sha rand des aes dsa rsa dh hmac
|
||||
|
||||
# tests to perform. "alltests" is a special word indicating that all tests
|
||||
# should be performed.
|
||||
@@ -205,7 +210,6 @@ ONEDIRS=out tmp
|
||||
EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
|
||||
WDIRS= windows
|
||||
LIBS= libcrypto.a libssl.a
|
||||
SIGS= libcrypto.a.sha1
|
||||
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
|
||||
SHARED_SSL=libssl$(SHLIB_EXT)
|
||||
SHARED_LIBS=
|
||||
@@ -225,19 +229,12 @@ HEADER= e_os.h
|
||||
|
||||
all: Makefile sub_all openssl.pc
|
||||
|
||||
sigs: $(SIGS)
|
||||
libcrypto.a.sha1: libcrypto.a
|
||||
@if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
$(RANLIB) libcrypto.a; \
|
||||
fips/sha1/fips_standalone_sha1 libcrypto.a > libcrypto.a.sha1; \
|
||||
fi
|
||||
|
||||
sub_all:
|
||||
@for i in $(DIRS); \
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(cd $$i && echo "making all in $$i..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' FIPS_AES_ENC='${FIPS_AES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
||||
else \
|
||||
$(MAKE) $$i; \
|
||||
fi; \
|
||||
@@ -248,7 +245,7 @@ sub_target:
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(cd $$i && echo "making $(TARGET) in $$i..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TARGET='$(TARGET)' sub_target ) || exit 1; \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' FIPS_AES_ENC='${FIPS_AES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TARGET='$(TARGET)' sub_target ) || exit 1; \
|
||||
else \
|
||||
$(MAKE) $$i; \
|
||||
fi; \
|
||||
@@ -304,12 +301,12 @@ do_gnu-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-Bsymbolic \
|
||||
-Wl,--whole-archive lib$$i.a \
|
||||
-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
-Wl,--no-whole-archive $$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done
|
||||
|
||||
@@ -321,7 +318,8 @@ do_darwin-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
--verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
|
||||
lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
|
||||
-install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
|
||||
@@ -338,14 +336,15 @@ do_cygwin-shared:
|
||||
[ "$(PLATFORM)" = "mingw" ] && shlib=$${i}eay32.dll; \
|
||||
[ -f apps/$$shlib ] && rm apps/$$shlib; \
|
||||
[ -f test/$$shlib ] && rm test/$$shlib; \
|
||||
base=; [ $$i = "crypto" ] && base=-Wl,--image-base,0xFE00000; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
base=; [ $$i = "crypto" ] && base=-Wl,--image-base,0x63000000; \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared $$base -o $$shlib \
|
||||
-Wl,-Bsymbolic \
|
||||
-Wl,--whole-archive lib$$i.a \
|
||||
-Wl,--out-implib,lib$$i.dll.a \
|
||||
-Wl,--no-whole-archive $$libs ${EX_LIBS} ) || exit 1; \
|
||||
cp -p $$shlib apps/; cp -p $$shlib test/; \
|
||||
touch -c lib$$i.dll.a; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done
|
||||
|
||||
@@ -358,10 +357,10 @@ do_alpha-osf1-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done; \
|
||||
fi
|
||||
@@ -377,10 +376,10 @@ do_tru64-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -msym -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done; \
|
||||
fi
|
||||
@@ -396,11 +395,11 @@ do_tru64-shared-rpath:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -msym -o lib$$i.so \
|
||||
-rpath ${INSTALLTOP}/lib \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done; \
|
||||
fi
|
||||
@@ -418,12 +417,12 @@ do_solaris-shared:
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
MINUSZ='-z '; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} -G -dy -z text \
|
||||
set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-Bsymbolic \
|
||||
$${MINUSZ}allextract lib$$i.a $${MINUSZ}defaultextract \
|
||||
$$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
$$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done; \
|
||||
fi
|
||||
@@ -443,7 +442,7 @@ do_svr3-shared:
|
||||
for obj in `ar t lib$$i.a` ; do \
|
||||
OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
|
||||
@@ -469,7 +468,7 @@ do_svr5-shared:
|
||||
OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
|
||||
${CC} ${SHARED_LDFLAGS} \
|
||||
$${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
$${SHARE_FLAG} -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
|
||||
@@ -488,24 +487,15 @@ do_irix-shared:
|
||||
fi; \
|
||||
( WHOLELIB="-all lib$$i.a -none"; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && WHOLELIB="-Wl,-all,lib$$i.a,-none"; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${WHOLELIB} $$libs ${EX_LIBS} -lc) || exit 1; \
|
||||
$${WHOLELIB} $$libs ${EX_LIBS}) || exit 1; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
# HP-UX includes the full pathname of libs we depend on, so we would get
|
||||
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
||||
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
|
||||
# anyway.
|
||||
# The object modules are loaded from lib$i.a using the undocumented -Fl
|
||||
# option.
|
||||
#
|
||||
# WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
|
||||
# by temporarily specifying "+s"!
|
||||
#
|
||||
do_hpux-shared:
|
||||
for i in ${SHLIBDIRS}; do \
|
||||
@@ -518,38 +508,11 @@ do_hpux-shared:
|
||||
shlib=lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
|
||||
fi; \
|
||||
[ -f $$shlib ] && rm -f $$shlib; \
|
||||
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
|
||||
+vnocompatwarnings \
|
||||
-b -z +s \
|
||||
-o $$shlib +h $$shlib \
|
||||
-Fl lib$$i.a -ldld -lc ) || exit 1; \
|
||||
chmod a=rx $$shlib; \
|
||||
done
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
# HP-UX includes the full pathname of libs we depend on, so we would get
|
||||
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
||||
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
|
||||
# anyway.
|
||||
#
|
||||
# HP-UX in 64bit mode has "+s" enabled by default; it will search for
|
||||
# shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
|
||||
#
|
||||
do_hpux64-shared:
|
||||
for i in ${SHLIBDIRS}; do \
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
if expr $(PLATFORM) : '.*ia64' > /dev/null; then \
|
||||
shlib=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
|
||||
else \
|
||||
shlib=lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
|
||||
fi; \
|
||||
[ -f $$shlib ] && rm -f $$shlib; \
|
||||
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
|
||||
-b -z \
|
||||
-o $$shlib +h $$shlib \
|
||||
+forceload lib$$i.a -ldl -lc ) || exit 1; \
|
||||
ALLSYMSFLAGS='-Wl,-Fl'; \
|
||||
expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-Wl,-B,symbolic,+vnocompatwarnings,-z,+h,$$shlib \
|
||||
-o $$shlib $$ALLSYMSFLAGS,lib$$i.a -ldld ) || exit 1; \
|
||||
chmod a=rx $$shlib; \
|
||||
done
|
||||
|
||||
@@ -595,7 +558,7 @@ do_aix-shared:
|
||||
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
||||
ld -r -o lib$$i.o $(ALLSYMSFLAG) lib$$i.a && \
|
||||
( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
|
||||
$(SHAREDCMD) $(SHAREDFLAGS) \
|
||||
$${FIPSLD:-${CC}} $(SHAREDFLAGS) \
|
||||
-o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib$$i.o \
|
||||
$$libs ${EX_LIBS} ) ) \
|
||||
|| exit 1; \
|
||||
@@ -611,7 +574,7 @@ do_reliantunix-shared:
|
||||
( set -x; \
|
||||
( Opwd=`pwd` ; mkdir $$tmpdir || exit 1; \
|
||||
cd $$tmpdir || exit 1 ; ar x $$Opwd/lib$$i.a ; \
|
||||
${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
|
||||
$${FIPSLD:-${CC}} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
|
||||
) || exit 1; \
|
||||
cp $$tmpdir/lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} . ; \
|
||||
) || exit 1; \
|
||||
@@ -757,11 +720,15 @@ crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt c
|
||||
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: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h apps/openssl-vms.cnf TABLE
|
||||
update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.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
|
||||
@@ -866,15 +833,6 @@ install_sw:
|
||||
sed -e '1,/^$$/d' doc/openssl-shared.txt; \
|
||||
fi; \
|
||||
fi
|
||||
@for i in $(SIGS) ;\
|
||||
do \
|
||||
if [ -f "$$i" ]; then \
|
||||
( echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi; \
|
||||
done;
|
||||
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
|
||||
|
||||
@@ -900,8 +858,8 @@ install_docs:
|
||||
--release=$(VERSION) `basename $$i`") \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
|
||||
$(PERL) util/extract-names.pl < $$i | \
|
||||
grep -v $$filecase "^$$fn\$$" | \
|
||||
grep -v "[ ]" | \
|
||||
(grep -v $$filecase "^$$fn\$$"; true) | \
|
||||
(grep -v "[ ]"; true) | \
|
||||
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||
while read n; do \
|
||||
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||
@@ -917,8 +875,8 @@ install_docs:
|
||||
--release=$(VERSION) `basename $$i`") \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
|
||||
$(PERL) util/extract-names.pl < $$i | \
|
||||
grep -v $$filecase "^$$fn\$$" | \
|
||||
grep -v "[ ]" | \
|
||||
(grep -v $$filecase "^$$fn\$$"; true) | \
|
||||
(grep -v "[ ]"; true) | \
|
||||
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||
while read n; do \
|
||||
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||
|
14
NEWS
14
NEWS
@@ -5,6 +5,20 @@
|
||||
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 0.9.7i and OpenSSL 0.9.7j:
|
||||
|
||||
o Update Windows build system for FIPS.
|
||||
|
||||
Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i:
|
||||
|
||||
o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build.
|
||||
|
||||
Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h:
|
||||
|
||||
o Fix SSL 2.0 Rollback, CAN-2005-2969
|
||||
o Allow use of fixed-length exponent on DSA signing
|
||||
o Default fixed-window RSA, DSA, DH private-key operations
|
||||
|
||||
Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g:
|
||||
|
||||
o More compilation issues fixed.
|
||||
|
56
PROBLEMS
56
PROBLEMS
@@ -48,20 +48,28 @@ will interfere with each other and lead to test failure.
|
||||
The solution is simple for now: don't run parallell make when testing.
|
||||
|
||||
|
||||
* Bugs in gcc 3.0 triggered
|
||||
* Bugs in gcc triggered
|
||||
|
||||
According to a problem report, there are bugs in gcc 3.0 that are
|
||||
triggered by some of the code in OpenSSL, more specifically in
|
||||
PEM_get_EVP_CIPHER_INFO(). The triggering code is the following:
|
||||
- According to a problem report, there are bugs in gcc 3.0 that are
|
||||
triggered by some of the code in OpenSSL, more specifically in
|
||||
PEM_get_EVP_CIPHER_INFO(). The triggering code is the following:
|
||||
|
||||
header+=11;
|
||||
if (*header != '4') return(0); header++;
|
||||
if (*header != ',') return(0); header++;
|
||||
|
||||
What happens is that gcc might optimize a little too agressively, and
|
||||
you end up with an extra incrementation when *header != '4'.
|
||||
What happens is that gcc might optimize a little too agressively, and
|
||||
you end up with an extra incrementation when *header != '4'.
|
||||
|
||||
We recommend that you upgrade gcc to as high a 3.x version as you can.
|
||||
We recommend that you upgrade gcc to as high a 3.x version as you can.
|
||||
|
||||
- According to multiple problem reports, some of our message digest
|
||||
implementations trigger bug[s] in code optimizer in gcc 3.3 for sparc64
|
||||
and gcc 2.96 for ppc. Former fails to complete RIPEMD160 test, while
|
||||
latter - SHA one.
|
||||
|
||||
The recomendation is to upgrade your compiler. This naturally applies to
|
||||
other similar cases.
|
||||
|
||||
* solaris64-sparcv9-cc SHA-1 performance with WorkShop 6 compiler.
|
||||
|
||||
@@ -120,3 +128,37 @@ Any information helping to solve this issue would be deeply
|
||||
appreciated.
|
||||
|
||||
NOTE: building non-shared doesn't come with this problem.
|
||||
|
||||
* ULTRIX build fails with shell errors, such as "bad substitution"
|
||||
and "test: argument expected"
|
||||
|
||||
The problem is caused by ULTRIX /bin/sh supporting only original
|
||||
Bourne shell syntax/semantics, and the trouble is that the vast
|
||||
majority is so accustomed to more modern syntax, that very few
|
||||
people [if any] would recognize the ancient syntax even as valid.
|
||||
This inevitably results in non-trivial scripts breaking on ULTRIX,
|
||||
and OpenSSL isn't an exclusion. Fortunately there is workaround,
|
||||
hire /bin/ksh to do the job /bin/sh fails to do.
|
||||
|
||||
1. Trick make(1) to use /bin/ksh by setting up following environ-
|
||||
ment variables *prior* you execute ./Configure and make:
|
||||
|
||||
PROG_ENV=POSIX
|
||||
MAKESHELL=/bin/ksh
|
||||
export PROG_ENV MAKESHELL
|
||||
|
||||
or if your shell is csh-compatible:
|
||||
|
||||
setenv PROG_ENV POSIX
|
||||
setenv MAKESHELL /bin/ksh
|
||||
|
||||
2. Trick /bin/sh to use alternative expression evaluator. Create
|
||||
following 'test' script for example in /tmp:
|
||||
|
||||
#!/bin/ksh
|
||||
${0##*/} "$@"
|
||||
|
||||
Then 'chmod a+x /tmp/test; ln /tmp/test /tmp/[' and *prepend*
|
||||
your $PATH with chosen location, e.g. PATH=/tmp:$PATH. Alter-
|
||||
natively just replace system /bin/test and /bin/[ with the
|
||||
above script.
|
||||
|
27
README
27
README
@@ -1,5 +1,5 @@
|
||||
|
||||
OpenSSL 0.9.7g 11 April 2005
|
||||
OpenSSL 0.9.7j-dev XX xxx XXXX
|
||||
|
||||
Copyright (c) 1998-2005 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
@@ -14,13 +14,13 @@
|
||||
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.
|
||||
related documentation.
|
||||
|
||||
OpenSSL is based on the excellent SSLeay library developed from Eric A. Young
|
||||
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
|
||||
OpenSSL license plus the SSLeay license) situation, which basically means
|
||||
that you are free to get and use it for commercial and non-commercial
|
||||
purposes as long as you fulfill the conditions of both licenses.
|
||||
purposes as long as you fulfill the conditions of both licenses.
|
||||
|
||||
OVERVIEW
|
||||
--------
|
||||
@@ -53,11 +53,11 @@
|
||||
MDC2 message digest. A DES based hash that is popular on smart cards.
|
||||
|
||||
Public Key
|
||||
RSA encryption/decryption/generation.
|
||||
RSA encryption/decryption/generation.
|
||||
There is no limit on the number of bits.
|
||||
DSA encryption/decryption/generation.
|
||||
DSA encryption/decryption/generation.
|
||||
There is no limit on the number of bits.
|
||||
Diffie-Hellman key-exchange/key generation.
|
||||
Diffie-Hellman key-exchange/key generation.
|
||||
There is no limit on the number of bits.
|
||||
|
||||
X.509v3 certificates
|
||||
@@ -80,16 +80,16 @@
|
||||
A simple stack.
|
||||
A Configuration loader that uses a format similar to MS .ini files.
|
||||
|
||||
openssl:
|
||||
openssl:
|
||||
A command line tool that can be used for:
|
||||
Creation of RSA, DH and DSA key parameters
|
||||
Creation of X.509 certificates, CSRs and CRLs
|
||||
Creation of X.509 certificates, CSRs and CRLs
|
||||
Calculation of Message Digests
|
||||
Encryption and Decryption with Ciphers
|
||||
SSL/TLS Client and Server Tests
|
||||
Handling of S/MIME signed or encrypted mail
|
||||
|
||||
|
||||
|
||||
PATENTS
|
||||
-------
|
||||
|
||||
@@ -104,13 +104,15 @@
|
||||
licensing conditions. Their web page is http://www.rsasecurity.com/.
|
||||
|
||||
RC4 is a trademark of RSA Security, so use of this label should perhaps
|
||||
only be used with RSA Security's permission.
|
||||
only be used with RSA Security's permission.
|
||||
|
||||
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
|
||||
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They
|
||||
should be contacted if that algorithm is to be used; their web page is
|
||||
http://www.ascom.ch/.
|
||||
|
||||
The MDC2 algorithm is patented by IBM.
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
@@ -129,7 +131,7 @@
|
||||
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.
|
||||
|
||||
SUPPORT
|
||||
SUPPORT
|
||||
-------
|
||||
|
||||
If you have any problems with OpenSSL then please take the following steps
|
||||
@@ -138,7 +140,7 @@
|
||||
- Download the current snapshot from ftp://ftp.openssl.org/snapshot/
|
||||
to see if the problem has already been addressed
|
||||
- Remove ASM versions of libraries
|
||||
- Remove compiler optimisation flags
|
||||
- Remove compiler optimisation flags
|
||||
|
||||
If you wish to report a bug then please include the following information in
|
||||
any bug report:
|
||||
@@ -191,3 +193,4 @@
|
||||
# ./Configure dist; make clean
|
||||
# cd ..
|
||||
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
||||
|
||||
|
8
STATUS
8
STATUS
@@ -1,10 +1,14 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2005/04/11 15:10:06 $
|
||||
______________ $Date: 2005/10/14 22:15:44 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 0.9.8: Under development...
|
||||
o OpenSSL 0.9.9: Under development...
|
||||
o OpenSSL 0.9.8a: Released on October 11th, 2005
|
||||
o OpenSSL 0.9.8: Released on July 5th, 2005
|
||||
o OpenSSL 0.9.7i: Released on October 14th, 2005
|
||||
o OpenSSL 0.9.7h: Released on October 11th, 2005
|
||||
o OpenSSL 0.9.7g: Released on April 11th, 2005
|
||||
o OpenSSL 0.9.7f: Released on March 22nd, 2005
|
||||
o OpenSSL 0.9.7e: Released on October 25th, 2004
|
||||
|
165
TABLE
165
TABLE
@@ -96,7 +96,7 @@ $dso_scheme = dlfcn
|
||||
$shared_target= cygwin-shared
|
||||
$shared_cflag = -D_WINDLL
|
||||
$shared_ldflag =
|
||||
$shared_extension = .dll
|
||||
$shared_extension = .dll.a
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
@@ -127,7 +127,7 @@ $arflags =
|
||||
|
||||
*** DJGPP
|
||||
$cc = gcc
|
||||
$cflags = -I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall -DDEVRANDOM="/dev/urandom\x24"
|
||||
$cflags = -I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id = MSDOS
|
||||
@@ -1427,7 +1427,7 @@ $arflags =
|
||||
|
||||
*** darwin-ppc-cc
|
||||
$cc = cc
|
||||
$cflags = -O3 -fomit-frame-pointer -fno-common -DB_ENDIAN
|
||||
$cflags = -O3 -fomit-frame-pointer -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id = MACOSX
|
||||
@@ -1442,9 +1442,9 @@ $cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= darwin-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_cflag = -fPIC -fno-common
|
||||
$shared_ldflag =
|
||||
$shared_extension = .$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
|
||||
$ranlib =
|
||||
@@ -1895,7 +1895,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -1945,7 +1945,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2231,7 +2231,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2245,7 +2245,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2256,7 +2256,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -O3
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2270,7 +2270,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2281,7 +2281,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2295,7 +2295,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2306,7 +2306,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -O3
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2320,7 +2320,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2331,8 +2331,8 @@ $cflags = -Ae +DD32 +O3 +Olit=all -z -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj = asm/ia64-cpp.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -2345,7 +2345,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2381,7 +2381,7 @@ $cflags = +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD3
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+cdp,../:,+cdp,./:,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2395,7 +2395,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2406,7 +2406,7 @@ $cflags = -Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id =
|
||||
$lflags = -ldld
|
||||
$lflags = -Wl,+cdp,../:,+cdp,./:,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2420,7 +2420,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2431,7 +2431,7 @@ $cflags = -O3 -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+cdp,../:,+cdp,./:,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2445,7 +2445,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2456,7 +2456,7 @@ $cflags = +DA1.1 +DS1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -D
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+cdp,../:,+cdp,./:,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2470,7 +2470,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2481,7 +2481,7 @@ $cflags = +DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -D
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+cdp,../:,+cdp,./:,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj = asm/pa-risc2.o
|
||||
$des_obj =
|
||||
@@ -2495,7 +2495,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2506,7 +2506,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2520,7 +2520,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2531,7 +2531,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -O3
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2545,7 +2545,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2556,7 +2556,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2570,7 +2570,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2581,7 +2581,7 @@ $cflags = -DB_ENDIAN -DBN_DIV2W -O3
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -Wl,+s -ldld
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldld
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2595,7 +2595,7 @@ $rc5_obj =
|
||||
$dso_scheme = dl
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2606,8 +2606,8 @@ $cflags = -Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj = asm/ia64-cpp.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -2618,9 +2618,9 @@ $rc4_obj = asm/rc4-ia64.o
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= hpux64-shared
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = +DD64 -b
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2631,7 +2631,7 @@ $cflags = -Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2643,9 +2643,9 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= hpux64-shared
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = +DD64 -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2656,7 +2656,7 @@ $cflags = -DB_ENDIAN -DMD32_XARRAY
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
@@ -2668,9 +2668,9 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= hpux64-shared
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = -fpic
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2681,7 +2681,7 @@ $cflags = +DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XAR
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj = asm/pa-risc2W.o
|
||||
$des_obj =
|
||||
@@ -2693,9 +2693,9 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= hpux64-shared
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = +Z
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = +DD64 -b
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2706,7 +2706,7 @@ $cflags = -O3 -DB_ENDIAN -DMD32_XARRAY
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$lflags = -Wl,+s,+b,$(INSTALLTOP)/lib -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj = asm/pa-risc2W.o
|
||||
$des_obj =
|
||||
@@ -2718,9 +2718,9 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= hpux64-shared
|
||||
$shared_cflag = -fpic
|
||||
$shared_ldflag =
|
||||
$shared_target= hpux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3075,31 +3075,6 @@ $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
*** linux-em64t
|
||||
$cc = gcc
|
||||
$cflags = -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_obj = asm/x86_64-gcc.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= linux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag = -m64
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
*** linux-ia64
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
@@ -3107,7 +3082,7 @@ $unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR
|
||||
$bn_obj = asm/ia64.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -3132,7 +3107,7 @@ $unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR
|
||||
$bn_obj = asm/ia64.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -3507,14 +3482,14 @@ $unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_obj = asm/x86_64-gcc.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj = asm/rc4-amd64.o
|
||||
$rc4_obj = asm/rc4-x86_64.o
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
@@ -3552,12 +3527,12 @@ $arflags =
|
||||
|
||||
*** mingw
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall
|
||||
$cflags = -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall -D_WIN32_WINNT=0x333
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id = MINGW32
|
||||
$lflags = -lwsock32 -lgdi32
|
||||
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
|
||||
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT EXPORT_VAR_AS_FN
|
||||
$bn_obj = asm/bn86-out.o asm/co86-out.o
|
||||
$des_obj = asm/dx86-out.o asm/yx86-out.o
|
||||
$bf_obj = asm/bx86-out.o
|
||||
@@ -3571,7 +3546,7 @@ $dso_scheme = win32
|
||||
$shared_target= cygwin-shared
|
||||
$shared_cflag = -D_WINDLL
|
||||
$shared_ldflag = -mno-cygwin
|
||||
$shared_extension = .dll
|
||||
$shared_extension = .dll.a
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
@@ -3870,7 +3845,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3895,7 +3870,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3945,7 +3920,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3995,7 +3970,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -4070,7 +4045,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -4120,7 +4095,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag = -xarch=v9
|
||||
$shared_ldflag = -xarch=v9 -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib = /usr/ccs/bin/ar rs
|
||||
$arflags =
|
||||
@@ -4182,7 +4157,7 @@ $unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -lsocket -lnsl -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -4195,7 +4170,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag = -xarch=amd64
|
||||
$shared_ldflag = -xarch=amd64 -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -4207,14 +4182,14 @@ $unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -lsocket -lnsl -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_obj = asm/x86_64-gcc.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj = asm/rc4-amd64.o
|
||||
$rc4_obj = asm/rc4-x86_64.o
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
|
@@ -66,19 +66,19 @@ foreach (@ARGV) {
|
||||
exit 0;
|
||||
} elsif (/^-newcert$/) {
|
||||
# create a certificate
|
||||
system ("$REQ -new -x509 -keyout newreq.pem -out newreq.pem $DAYS");
|
||||
system ("$REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS");
|
||||
$RET=$?;
|
||||
print "Certificate (and private key) is in newreq.pem\n"
|
||||
print "Certificate is in newcert.pem, private key is in newkey.pem\n"
|
||||
} elsif (/^-newreq$/) {
|
||||
# create a certificate request
|
||||
system ("$REQ -new -keyout newreq.pem -out newreq.pem $DAYS");
|
||||
system ("$REQ -new -keyout newkey.pem -out newreq.pem $DAYS");
|
||||
$RET=$?;
|
||||
print "Request (and private key) is in newreq.pem\n";
|
||||
print "Request is in newreq.pem, private key is in newkey.pem\n";
|
||||
} elsif (/^-newreq-nodes$/) {
|
||||
# create a certificate request
|
||||
system ("$REQ -new -nodes -keyout newreq.pem -out newreq.pem $DAYS");
|
||||
system ("$REQ -new -nodes -keyout newkey.pem -out newreq.pem $DAYS");
|
||||
$RET=$?;
|
||||
print "Request (and private key) is in newreq.pem\n";
|
||||
print "Request is in newreq.pem, private key is in newkey.pem\n";
|
||||
} elsif (/^-newca$/) {
|
||||
# if explicitly asked for or it doesn't exist then setup the
|
||||
# directory structure that Eric likes to manage things
|
||||
@@ -118,10 +118,11 @@ foreach (@ARGV) {
|
||||
} elsif (/^-pkcs12$/) {
|
||||
my $cname = $ARGV[1];
|
||||
$cname = "My Certificate" unless defined $cname;
|
||||
system ("$PKCS12 -in newcert.pem -inkey newreq.pem " .
|
||||
system ("$PKCS12 -in newcert.pem -inkey newkey.pem " .
|
||||
"-certfile ${CATOP}/$CACERT -out newcert.p12 " .
|
||||
"-export -name \"$cname\"");
|
||||
$RET=$?;
|
||||
print "PKCS #12 file is in newcert.p12\n";
|
||||
exit $RET;
|
||||
} elsif (/^-xsign$/) {
|
||||
system ("$CA -policy policy_anything -infiles newreq.pem");
|
||||
|
@@ -51,15 +51,15 @@ case $i in
|
||||
;;
|
||||
-newcert)
|
||||
# create a certificate
|
||||
$REQ -new -x509 -keyout newreq.pem -out newreq.pem $DAYS
|
||||
$REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS
|
||||
RET=$?
|
||||
echo "Certificate (and private key) is in newreq.pem"
|
||||
echo "Certificate is in newcert.pem, private key is in newkey.pem"
|
||||
;;
|
||||
-newreq)
|
||||
# create a certificate request
|
||||
$REQ -new -keyout newreq.pem -out newreq.pem $DAYS
|
||||
$REQ -new -keyout newkey.pem -out newreq.pem $DAYS
|
||||
RET=$?
|
||||
echo "Request (and private key) is in newreq.pem"
|
||||
echo "Request is in newreq.pem, private key is in newkey.pem"
|
||||
;;
|
||||
-newca)
|
||||
# if explicitly asked for or it doesn't exist then setup the directory
|
||||
|
@@ -101,8 +101,9 @@ install:
|
||||
(echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
|
||||
done;
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
|
||||
) done;
|
||||
@for i in $(SCRIPTS); \
|
||||
do \
|
||||
(echo installing $$i; \
|
||||
@@ -143,17 +144,19 @@ $(DLIBCRYPTO):
|
||||
|
||||
$(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||
$(RM) $(EXE)
|
||||
if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \
|
||||
@if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
FIPSLD_CC=$(CC); CC=$(TOP)/fips-1.0/fipsld; export CC FIPSLD_CC; \
|
||||
fi; \
|
||||
SHARED_LIBS="$(SHARED_LIBS)"; \
|
||||
if [ "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \
|
||||
SHARED_LIBS=""; \
|
||||
fi; \
|
||||
if [ -z "$$SHARED_LIBS" ]; then \
|
||||
set -x; $${CC:-$(CC)} -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(DLIBSSL) $(LIBKRB5) $(DLIBCRYPTO) $(EX_LIBS) ; \
|
||||
elif [ -z "$(SHARED_LIBS)" ]; then \
|
||||
set -x; $${CC:-$(CC)} -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \
|
||||
else \
|
||||
set -x; LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \
|
||||
$(CC) -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \
|
||||
fi
|
||||
if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(EXE); \
|
||||
fi
|
||||
-(cd ..; \
|
||||
OPENSSL="`pwd`/util/opensslwrap.sh"; export OPENSSL; \
|
||||
$(PERL) tools/c_rehash certs)
|
||||
|
24
apps/apps.c
24
apps/apps.c
@@ -361,10 +361,17 @@ int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
|
||||
/* The start of something good :-) */
|
||||
if (num >= arg->count)
|
||||
{
|
||||
arg->count+=20;
|
||||
arg->data=(char **)OPENSSL_realloc(arg->data,
|
||||
sizeof(char *)*arg->count);
|
||||
if (argc == 0) return(0);
|
||||
char **tmp_p;
|
||||
int tlen = arg->count + 20;
|
||||
tmp_p = (char **)OPENSSL_realloc(arg->data,
|
||||
sizeof(char *)*tlen);
|
||||
if (tmp_p == NULL)
|
||||
return 0;
|
||||
arg->data = tmp_p;
|
||||
arg->count = tlen;
|
||||
/* initialize newly allocated data */
|
||||
for (i = num; i < arg->count; i++)
|
||||
arg->data[i] = NULL;
|
||||
}
|
||||
arg->data[num++]=p;
|
||||
|
||||
@@ -1591,8 +1598,9 @@ int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix)
|
||||
{
|
||||
if (errno != ENOENT
|
||||
#ifdef ENOTDIR
|
||||
&& errno != ENOTDIR)
|
||||
&& errno != ENOTDIR
|
||||
#endif
|
||||
)
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
@@ -1893,8 +1901,9 @@ int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
|
||||
{
|
||||
if (errno != ENOENT
|
||||
#ifdef ENOTDIR
|
||||
&& errno != ENOTDIR)
|
||||
&& errno != ENOTDIR
|
||||
#endif
|
||||
)
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
@@ -1929,8 +1938,9 @@ int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
|
||||
{
|
||||
if (errno != ENOENT
|
||||
#ifdef ENOTDIR
|
||||
&& errno != ENOTDIR)
|
||||
&& errno != ENOTDIR
|
||||
#endif
|
||||
)
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
|
@@ -182,7 +182,7 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] <infile\n",prog);
|
||||
BIO_printf(bio_err,"where options are\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER TXT PEM\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file (output format is always DER\n");
|
||||
BIO_printf(bio_err," -noout arg don't produce any output\n");
|
||||
|
@@ -943,7 +943,6 @@ bad:
|
||||
if (verbose) BIO_printf(bio_err,
|
||||
"Done. %d entries marked as expired\n",i);
|
||||
}
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
|
@@ -387,11 +387,15 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-pre") == 0)
|
||||
{
|
||||
argc--; argv++;
|
||||
if (argc == 0)
|
||||
goto skip_arg_loop;
|
||||
sk_push(pre_cmds,*argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-post") == 0)
|
||||
{
|
||||
argc--; argv++;
|
||||
if (argc == 0)
|
||||
goto skip_arg_loop;
|
||||
sk_push(post_cmds,*argv);
|
||||
}
|
||||
else if ((strncmp(*argv,"-h",2) == 0) ||
|
||||
|
@@ -88,6 +88,9 @@ int MAIN(int argc, char **argv)
|
||||
RSA *rsa=NULL;
|
||||
int i,num=DEFBITS;
|
||||
long l;
|
||||
#ifdef OPENSSL_FIPS
|
||||
int use_x931 = 0;
|
||||
#endif
|
||||
const EVP_CIPHER *enc=NULL;
|
||||
unsigned long f4=RSA_F4;
|
||||
char *outfile=NULL;
|
||||
@@ -126,6 +129,10 @@ int MAIN(int argc, char **argv)
|
||||
f4=3;
|
||||
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
|
||||
f4=RSA_F4;
|
||||
#ifdef OPENSSL_FIPS
|
||||
else if (strcmp(*argv,"-x931") == 0)
|
||||
use_x931 = 1;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
@@ -233,11 +240,27 @@ bad:
|
||||
|
||||
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
|
||||
num);
|
||||
rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err);
|
||||
#ifdef OPENSSL_FIPS
|
||||
if (use_x931)
|
||||
{
|
||||
BIGNUM *pubexp;
|
||||
pubexp = BN_new();
|
||||
BN_set_word(pubexp, f4);
|
||||
rsa = RSA_X931_generate_key(num, pubexp, genrsa_cb, bio_err);
|
||||
BN_free(pubexp);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err);
|
||||
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
|
||||
if (rsa == NULL) goto err;
|
||||
if (rsa == NULL)
|
||||
{
|
||||
BIO_printf(bio_err, "Key Generation error\n");
|
||||
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* We need to do the following for when the base number size is <
|
||||
* long, esp windows 3.1 :-(. */
|
||||
|
@@ -650,7 +650,7 @@ $ CCDEFS = "MONOLITH"
|
||||
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
|
||||
$ CCEXTRAFLAGS = ""
|
||||
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
||||
$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX"
|
||||
$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
|
||||
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
|
||||
CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
|
||||
$!
|
||||
|
@@ -237,21 +237,12 @@ int main(int Argc, char *Argv[])
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(getenv("OPENSSL_FIPS")) {
|
||||
#if defined(_WIN32)
|
||||
char filename[MAX_PATH] = "";
|
||||
GetModuleFileNameA( NULL, filename, MAX_PATH) ;
|
||||
p = filename;
|
||||
#else
|
||||
p = Argv[0];
|
||||
#endif
|
||||
if (!FIPS_mode_set(1,p)) {
|
||||
if (!FIPS_mode_set(1)) {
|
||||
ERR_load_crypto_strings();
|
||||
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
|
||||
EXIT(1);
|
||||
}
|
||||
in_FIPS_mode = 1;
|
||||
if (getenv("OPENSSL_FIPS_MD5"))
|
||||
FIPS_allow_md5(1);
|
||||
}
|
||||
#endif
|
||||
if (bio_err == NULL)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
* project 2000.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 2000-2005 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
|
||||
@@ -147,6 +147,7 @@ int MAIN(int argc, char **argv)
|
||||
else if(!strcmp(*argv, "-oaep")) pad = RSA_PKCS1_OAEP_PADDING;
|
||||
else if(!strcmp(*argv, "-ssl")) pad = RSA_SSLV23_PADDING;
|
||||
else if(!strcmp(*argv, "-pkcs")) pad = RSA_PKCS1_PADDING;
|
||||
else if(!strcmp(*argv, "-x931")) pad = RSA_X931_PADDING;
|
||||
else if(!strcmp(*argv, "-sign")) {
|
||||
rsa_mode = RSA_SIGN;
|
||||
need_priv = 1;
|
||||
|
@@ -1706,7 +1706,7 @@ show_res:
|
||||
k,rsa_bits[k],rsa_results[k][0],
|
||||
rsa_results[k][1]);
|
||||
else
|
||||
fprintf(stdout,"rsa %4u bits %8.4fs %8.4fs %8.1f %8.1f\n",
|
||||
fprintf(stdout,"rsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
|
||||
rsa_bits[k],rsa_results[k][0],rsa_results[k][1],
|
||||
1.0/rsa_results[k][0],1.0/rsa_results[k][1]);
|
||||
}
|
||||
@@ -1725,7 +1725,7 @@ show_res:
|
||||
fprintf(stdout,"+F3:%u:%u:%f:%f\n",
|
||||
k,dsa_bits[k],dsa_results[k][0],dsa_results[k][1]);
|
||||
else
|
||||
fprintf(stdout,"dsa %4u bits %8.4fs %8.4fs %8.1f %8.1f\n",
|
||||
fprintf(stdout,"dsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
|
||||
dsa_bits[k],dsa_results[k][0],dsa_results[k][1],
|
||||
1.0/dsa_results[k][0],1.0/dsa_results[k][1]);
|
||||
}
|
||||
|
39
certs/argena.pem
Normal file
39
certs/argena.pem
Normal file
@@ -0,0 +1,39 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIG0zCCBbugAwIBAgIBADANBgkqhkiG9w0BAQUFADCBzDELMAkGA1UEBhMCQVQx
|
||||
EDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTE6MDgGA1UEChMxQVJH
|
||||
RSBEQVRFTiAtIEF1c3RyaWFuIFNvY2lldHkgZm9yIERhdGEgUHJvdGVjdGlvbjEl
|
||||
MCMGA1UECxMcQS1DRVJUIENlcnRpZmljYXRpb24gU2VydmljZTEYMBYGA1UEAxMP
|
||||
QS1DRVJUIEFEVkFOQ0VEMR0wGwYJKoZIhvcNAQkBFg5pbmZvQGEtY2VydC5hdDAe
|
||||
Fw0wNDEwMjMxNDE0MTRaFw0xMTEwMjMxNDE0MTRaMIHMMQswCQYDVQQGEwJBVDEQ
|
||||
MA4GA1UECBMHQXVzdHJpYTEPMA0GA1UEBxMGVmllbm5hMTowOAYDVQQKEzFBUkdF
|
||||
IERBVEVOIC0gQXVzdHJpYW4gU29jaWV0eSBmb3IgRGF0YSBQcm90ZWN0aW9uMSUw
|
||||
IwYDVQQLExxBLUNFUlQgQ2VydGlmaWNhdGlvbiBTZXJ2aWNlMRgwFgYDVQQDEw9B
|
||||
LUNFUlQgQURWQU5DRUQxHTAbBgkqhkiG9w0BCQEWDmluZm9AYS1jZXJ0LmF0MIIB
|
||||
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3euXIy+mnf6BYKbK+QH5k679
|
||||
tUFqeT8jlZxMew8eNiHuw9KoxWBzL6KksK+5uK7Gatw+sbAYntEGE80P+Jg1hADM
|
||||
e+Fr5V0bc6QS3gkVtfUCW/RIvfMM39oxvmqJmOgPnJU7H6+nmLtsq61tv9kVJi/2
|
||||
4Y5wXW3odet72sF57EoG6s78w0BUVLNcMngS9bZZzmdG3/d6JbkGgoNF/8DcgCBJ
|
||||
W/t0JrcIzyppXIOVtUzzOrrU86zuUgT3Rtkl5kjG7DEHpFb9H0fTOY1v8+gRoaO6
|
||||
2gA0PCiysgVZjwgVeYe3KAg11nznyleDv198uK3Dc1oXIGYjJx2FpKWUvAuAEwID
|
||||
AQABo4ICvDCCArgwHQYDVR0OBBYEFDd/Pj6ZcWDKJNSRE3nQdCm0qCTYMIH5BgNV
|
||||
HSMEgfEwge6AFDd/Pj6ZcWDKJNSRE3nQdCm0qCTYoYHSpIHPMIHMMQswCQYDVQQG
|
||||
EwJBVDEQMA4GA1UECBMHQXVzdHJpYTEPMA0GA1UEBxMGVmllbm5hMTowOAYDVQQK
|
||||
EzFBUkdFIERBVEVOIC0gQXVzdHJpYW4gU29jaWV0eSBmb3IgRGF0YSBQcm90ZWN0
|
||||
aW9uMSUwIwYDVQQLExxBLUNFUlQgQ2VydGlmaWNhdGlvbiBTZXJ2aWNlMRgwFgYD
|
||||
VQQDEw9BLUNFUlQgQURWQU5DRUQxHTAbBgkqhkiG9w0BCQEWDmluZm9AYS1jZXJ0
|
||||
LmF0ggEAMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgHmMEcGA1UdJQRAMD4G
|
||||
CCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcD
|
||||
CAYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAP8wUQYDVR0gBEowSDBGBggq
|
||||
KAAYAQEBAzA6MDgGCCsGAQUFBwIBFixodHRwOi8vd3d3LmEtY2VydC5hdC9jZXJ0
|
||||
aWZpY2F0ZS1wb2xpY3kuaHRtbDA7BglghkgBhvhCAQgELhYsaHR0cDovL3d3dy5h
|
||||
LWNlcnQuYXQvY2VydGlmaWNhdGUtcG9saWN5Lmh0bWwwGQYDVR0RBBIwEIEOaW5m
|
||||
b0BhLWNlcnQuYXQwLwYDVR0SBCgwJoEOaW5mb0BhLWNlcnQuYXSGFGh0dHA6Ly93
|
||||
d3cuYS1jZXJ0LmF0MEUGA1UdHwQ+MDwwOqA4oDaGNGh0dHBzOi8vc2VjdXJlLmEt
|
||||
Y2VydC5hdC9jZ2ktYmluL2EtY2VydC1hZHZhbmNlZC5jZ2kwDQYJKoZIhvcNAQEF
|
||||
BQADggEBACX1IvgfdG2rvfv35O48vSEvcVaEdlN8USFBHWz3JRAozgzvaBtwHkjK
|
||||
Zwt5l/BWOtjbvHfRjDt7ijlBEcxOOrNC1ffyMHwHrXpvff6YpQ5wnxmIYEQcURiG
|
||||
HMqruEX0WkuDNgSKwefsgXs27eeBauHgNGVcTYH1rmHu/ZyLpLxOyJQ2PCzA1DzW
|
||||
3rWkIX92ogJ7lTRdWrbxwUL1XGinxnnaQ74+/y0pI9JNEv7ic2tpkweRMpkedaLW
|
||||
msC1+orfKTebsg69aMaCx7o6jNONRmR/7TVaPf8/k6g52cHZ9YWjQvup22b5rWxG
|
||||
J5r5LZ4vCPmF4+T4lutjUYAa/lGuQTg=
|
||||
-----END CERTIFICATE-----
|
23
certs/argeng.pem
Normal file
23
certs/argeng.pem
Normal file
@@ -0,0 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDwzCCAyygAwIBAgIBADANBgkqhkiG9w0BAQQFADCBmDELMAkGA1UEBhMCQVQx
|
||||
EDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTFCMEAGA1UEChM5QXJn
|
||||
ZSBEYXRlbiBPZXN0ZXJyZWljaGlzY2hlIEdlc2VsbHNjaGFmdCBmdWVyIERhdGVu
|
||||
c2NodXR6MSIwIAYJKoZIhvcNAQkBFhNhLWNlcnRAYXJnZWRhdGVuLmF0MB4XDTAx
|
||||
MDIxMjExMzAzMFoXDTA5MDIxMjExMzAzMFowgZgxCzAJBgNVBAYTAkFUMRAwDgYD
|
||||
VQQIEwdBdXN0cmlhMQ8wDQYDVQQHEwZWaWVubmExQjBABgNVBAoTOUFyZ2UgRGF0
|
||||
ZW4gT2VzdGVycmVpY2hpc2NoZSBHZXNlbGxzY2hhZnQgZnVlciBEYXRlbnNjaHV0
|
||||
ejEiMCAGCSqGSIb3DQEJARYTYS1jZXJ0QGFyZ2VkYXRlbi5hdDCBnzANBgkqhkiG
|
||||
9w0BAQEFAAOBjQAwgYkCgYEAwgsHqoNtmmrJ86+e1I4hOVBaL4kokqKN2IPOIL+1
|
||||
XwY8vfOOUfPEdhWpaC0ldt7VYrksgDiUccgH0FROANWK2GkfKMDzjjXHysR04uEb
|
||||
Om7Kqjqn0nproOGkFG+QvBZgs+Ws+HXNFJA6V76fU4+JXq4452LSK4Lr5YcBquu3
|
||||
NJECAwEAAaOCARkwggEVMB0GA1UdDgQWBBQ0j59zH/G31zRjgK1y2P//tSAWZjCB
|
||||
xQYDVR0jBIG9MIG6gBQ0j59zH/G31zRjgK1y2P//tSAWZqGBnqSBmzCBmDELMAkG
|
||||
A1UEBhMCQVQxEDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTFCMEAG
|
||||
A1UEChM5QXJnZSBEYXRlbiBPZXN0ZXJyZWljaGlzY2hlIEdlc2VsbHNjaGFmdCBm
|
||||
dWVyIERhdGVuc2NodXR6MSIwIAYJKoZIhvcNAQkBFhNhLWNlcnRAYXJnZWRhdGVu
|
||||
LmF0ggEAMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQE
|
||||
AwICBDANBgkqhkiG9w0BAQQFAAOBgQBFuJYncqMYB6gXQS3eDOI90BEHfFTKy/dV
|
||||
AV+K7QdAYikWmqgBheRdPKddJdccPy/Zl/p3ZT7GhDyC5f3wZjcuu8AJ27BNwbCA
|
||||
x54dgxgCNcyPm79nY8MRtEdEpoRGdSsFKJemz6hpXM++MWFciyrRWIIA44XB0Gv3
|
||||
US0spjsDPQ==
|
||||
-----END CERTIFICATE-----
|
20
config
20
config
@@ -54,6 +54,22 @@ SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
|
||||
VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Check for VC++ presence first.
|
||||
#
|
||||
#if [ "x$MSVCDIR" != "x" -o "x$VCINSTALLDIR" != "x" ]; then
|
||||
# perl Configure VC-WIN32 $*
|
||||
# cmd /c ms\\do_masm.bat
|
||||
# perl util/mk1mf.pl VC-WIN32-GMAKE >mak.tmp
|
||||
# rm Makefile
|
||||
# mv mak.tmp Makefile
|
||||
# echo "Configured for VC++ using GNU make"
|
||||
# exit 0
|
||||
#fi
|
||||
#
|
||||
|
||||
# Now test for ISC and SCO, since it is has a braindamaged uname.
|
||||
#
|
||||
# We need to work around FreeBSD 1.1.5.1
|
||||
@@ -339,6 +355,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
|
||||
MINGW*)
|
||||
echo "${MACHINE}-whatever-mingw"; echo 0;
|
||||
# Save fipslib path so VC++ build can find it
|
||||
(cd /usr/local/ssl/lib ; pwd -W ) > util/fipslib_path.txt
|
||||
# Extract _chkstk.o so VC++ can use it, to avoid __alloca link error
|
||||
(cd ms ; ar x `gcc -print-libgcc-file-name` _chkstk.o)
|
||||
;;
|
||||
CYGWIN*)
|
||||
case "$RELEASE" in
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/Makefile
|
||||
# OpenSSL/crypto/Makefile
|
||||
#
|
||||
|
||||
DIR= crypto
|
||||
|
@@ -59,6 +59,7 @@
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
#if !defined(OPENSSL_FIPS_AES_ASM)
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc) {
|
||||
@@ -129,3 +130,4 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/asn1/Makefile
|
||||
# OpenSSL/crypto/asn1/Makefile
|
||||
#
|
||||
|
||||
DIR= asn1
|
||||
|
@@ -962,6 +962,7 @@ void ERR_load_ASN1_strings(void);
|
||||
#define ASN1_F_ASN1_DUP 111
|
||||
#define ASN1_F_ASN1_ENUMERATED_SET 112
|
||||
#define ASN1_F_ASN1_ENUMERATED_TO_BN 113
|
||||
#define ASN1_F_ASN1_FIND_END 182
|
||||
#define ASN1_F_ASN1_GENERALIZEDTIME_SET 178
|
||||
#define ASN1_F_ASN1_GET_OBJECT 114
|
||||
#define ASN1_F_ASN1_HEADER_NEW 115
|
||||
@@ -1075,6 +1076,7 @@ void ERR_load_ASN1_strings(void);
|
||||
#define ASN1_R_MISSING_SECOND_NUMBER 138
|
||||
#define ASN1_R_MSTRING_NOT_UNIVERSAL 139
|
||||
#define ASN1_R_MSTRING_WRONG_TAG 140
|
||||
#define ASN1_R_NESTED_ASN1_STRING 174
|
||||
#define ASN1_R_NON_HEX_CHARACTERS 141
|
||||
#define ASN1_R_NOT_ENOUGH_DATA 142
|
||||
#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/asn1/asn1_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,169 +64,175 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ASN1,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ASN1,0,reason)
|
||||
|
||||
static ERR_STRING_DATA ASN1_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,ASN1_F_A2D_ASN1_OBJECT,0), "a2d_ASN1_OBJECT"},
|
||||
{ERR_PACK(0,ASN1_F_A2I_ASN1_ENUMERATED,0), "a2i_ASN1_ENUMERATED"},
|
||||
{ERR_PACK(0,ASN1_F_A2I_ASN1_INTEGER,0), "a2i_ASN1_INTEGER"},
|
||||
{ERR_PACK(0,ASN1_F_A2I_ASN1_STRING,0), "a2i_ASN1_STRING"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_BIT_STRING_SET_BIT,0), "ASN1_BIT_STRING_set_bit"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_CHECK_TLEN,0), "ASN1_CHECK_TLEN"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_COLLATE_PRIMITIVE,0), "ASN1_COLLATE_PRIMITIVE"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_COLLECT,0), "ASN1_COLLECT"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_D2I_BIO,0), "ASN1_d2i_bio"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_D2I_EX_PRIMITIVE,0), "ASN1_D2I_EX_PRIMITIVE"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_D2I_FP,0), "ASN1_d2i_fp"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_DIGEST,0), "ASN1_digest"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_DO_ADB,0), "ASN1_DO_ADB"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_DUP,0), "ASN1_dup"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_ENUMERATED_SET,0), "ASN1_ENUMERATED_set"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_ENUMERATED_TO_BN,0), "ASN1_ENUMERATED_to_BN"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_GENERALIZEDTIME_SET,0), "ASN1_GENERALIZEDTIME_set"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_GET_OBJECT,0), "ASN1_get_object"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_HEADER_NEW,0), "ASN1_HEADER_new"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_I2D_BIO,0), "ASN1_i2d_bio"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_I2D_FP,0), "ASN1_i2d_fp"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_INTEGER_SET,0), "ASN1_INTEGER_set"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_INTEGER_TO_BN,0), "ASN1_INTEGER_to_BN"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_ITEM_EX_D2I,0), "ASN1_ITEM_EX_D2I"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_ITEM_NEW,0), "ASN1_item_new"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_MBSTRING_COPY,0), "ASN1_mbstring_copy"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_OBJECT_NEW,0), "ASN1_OBJECT_new"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_PACK_STRING,0), "ASN1_pack_string"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_PBE_SET,0), "ASN1_PBE_SET"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_SEQ_PACK,0), "ASN1_seq_pack"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_SEQ_UNPACK,0), "ASN1_seq_unpack"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_SIGN,0), "ASN1_sign"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_STRING_SET,0), "ASN1_STRING_set"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_STRING_TABLE_ADD,0), "ASN1_STRING_TABLE_add"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_STRING_TYPE_NEW,0), "ASN1_STRING_type_new"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_TEMPLATE_D2I,0), "ASN1_TEMPLATE_D2I"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_TEMPLATE_EX_D2I,0), "ASN1_TEMPLATE_EX_D2I"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_TEMPLATE_NEW,0), "ASN1_TEMPLATE_NEW"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_TIME_SET,0), "ASN1_TIME_set"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING,0), "ASN1_TYPE_get_int_octetstring"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_OCTETSTRING,0), "ASN1_TYPE_get_octetstring"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_UNPACK_STRING,0), "ASN1_unpack_string"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_UTCTIME_SET,0), "ASN1_UTCTIME_set"},
|
||||
{ERR_PACK(0,ASN1_F_ASN1_VERIFY,0), "ASN1_verify"},
|
||||
{ERR_PACK(0,ASN1_F_BN_TO_ASN1_ENUMERATED,0), "BN_to_ASN1_ENUMERATED"},
|
||||
{ERR_PACK(0,ASN1_F_BN_TO_ASN1_INTEGER,0), "BN_to_ASN1_INTEGER"},
|
||||
{ERR_PACK(0,ASN1_F_COLLECT_DATA,0), "COLLECT_DATA"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_BIT_STRING,0), "D2I_ASN1_BIT_STRING"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_BOOLEAN,0), "d2i_ASN1_BOOLEAN"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_BYTES,0), "d2i_ASN1_bytes"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_GENERALIZEDTIME,0), "D2I_ASN1_GENERALIZEDTIME"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_HEADER,0), "d2i_ASN1_HEADER"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_INTEGER,0), "D2I_ASN1_INTEGER"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_OBJECT,0), "d2i_ASN1_OBJECT"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_SET,0), "d2i_ASN1_SET"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_TYPE_BYTES,0), "d2i_ASN1_type_bytes"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_UINTEGER,0), "d2i_ASN1_UINTEGER"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_ASN1_UTCTIME,0), "D2I_ASN1_UTCTIME"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA,0), "d2i_Netscape_RSA"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA_2,0), "D2I_NETSCAPE_RSA_2"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_PRIVATEKEY,0), "d2i_PrivateKey"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_PUBLICKEY,0), "d2i_PublicKey"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_X509,0), "D2I_X509"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_X509_CINF,0), "D2I_X509_CINF"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_X509_NAME,0), "D2I_X509_NAME"},
|
||||
{ERR_PACK(0,ASN1_F_D2I_X509_PKEY,0), "d2i_X509_PKEY"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_ASN1_SET,0), "i2d_ASN1_SET"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_ASN1_TIME,0), "I2D_ASN1_TIME"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_DSA_PUBKEY,0), "i2d_DSA_PUBKEY"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_NETSCAPE_RSA,0), "i2d_Netscape_RSA"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_PRIVATEKEY,0), "i2d_PrivateKey"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_PUBLICKEY,0), "i2d_PublicKey"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_RSA_PUBKEY,0), "i2d_RSA_PUBKEY"},
|
||||
{ERR_PACK(0,ASN1_F_LONG_C2I,0), "LONG_C2I"},
|
||||
{ERR_PACK(0,ASN1_F_OID_MODULE_INIT,0), "OID_MODULE_INIT"},
|
||||
{ERR_PACK(0,ASN1_F_PKCS5_PBE2_SET,0), "PKCS5_pbe2_set"},
|
||||
{ERR_PACK(0,ASN1_F_X509_CINF_NEW,0), "X509_CINF_NEW"},
|
||||
{ERR_PACK(0,ASN1_F_X509_CRL_ADD0_REVOKED,0), "X509_CRL_add0_revoked"},
|
||||
{ERR_PACK(0,ASN1_F_X509_INFO_NEW,0), "X509_INFO_new"},
|
||||
{ERR_PACK(0,ASN1_F_X509_NAME_NEW,0), "X509_NAME_NEW"},
|
||||
{ERR_PACK(0,ASN1_F_X509_NEW,0), "X509_NEW"},
|
||||
{ERR_PACK(0,ASN1_F_X509_PKEY_NEW,0), "X509_PKEY_new"},
|
||||
{ERR_FUNC(ASN1_F_A2D_ASN1_OBJECT), "a2d_ASN1_OBJECT"},
|
||||
{ERR_FUNC(ASN1_F_A2I_ASN1_ENUMERATED), "a2i_ASN1_ENUMERATED"},
|
||||
{ERR_FUNC(ASN1_F_A2I_ASN1_INTEGER), "a2i_ASN1_INTEGER"},
|
||||
{ERR_FUNC(ASN1_F_A2I_ASN1_STRING), "a2i_ASN1_STRING"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_BIT_STRING_SET_BIT), "ASN1_BIT_STRING_set_bit"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_CHECK_TLEN), "ASN1_CHECK_TLEN"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_COLLATE_PRIMITIVE), "ASN1_COLLATE_PRIMITIVE"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_COLLECT), "ASN1_COLLECT"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_D2I_BIO), "ASN1_d2i_bio"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_D2I_EX_PRIMITIVE), "ASN1_D2I_EX_PRIMITIVE"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_D2I_FP), "ASN1_d2i_fp"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_DIGEST), "ASN1_digest"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_DO_ADB), "ASN1_DO_ADB"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_DUP), "ASN1_dup"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ENUMERATED_SET), "ASN1_ENUMERATED_set"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ENUMERATED_TO_BN), "ASN1_ENUMERATED_to_BN"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_FIND_END), "ASN1_FIND_END"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_GENERALIZEDTIME_SET), "ASN1_GENERALIZEDTIME_set"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_GET_OBJECT), "ASN1_get_object"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_HEADER_NEW), "ASN1_HEADER_new"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_I2D_BIO), "ASN1_i2d_bio"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_I2D_FP), "ASN1_i2d_fp"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_INTEGER_SET), "ASN1_INTEGER_set"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_INTEGER_TO_BN), "ASN1_INTEGER_to_BN"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_EX_D2I), "ASN1_ITEM_EX_D2I"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_NEW), "ASN1_item_new"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_MBSTRING_COPY), "ASN1_mbstring_copy"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_OBJECT_NEW), "ASN1_OBJECT_new"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_PACK_STRING), "ASN1_pack_string"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_PBE_SET), "ASN1_PBE_SET"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_SEQ_PACK), "ASN1_seq_pack"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_SEQ_UNPACK), "ASN1_seq_unpack"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_SIGN), "ASN1_sign"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_STRING_SET), "ASN1_STRING_set"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_STRING_TABLE_ADD), "ASN1_STRING_TABLE_add"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_STRING_TYPE_NEW), "ASN1_STRING_type_new"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_D2I), "ASN1_TEMPLATE_D2I"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_EX_D2I), "ASN1_TEMPLATE_EX_D2I"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NEW), "ASN1_TEMPLATE_NEW"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_TIME_SET), "ASN1_TIME_set"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING), "ASN1_TYPE_get_int_octetstring"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_OCTETSTRING), "ASN1_TYPE_get_octetstring"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_UNPACK_STRING), "ASN1_unpack_string"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_UTCTIME_SET), "ASN1_UTCTIME_set"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_VERIFY), "ASN1_verify"},
|
||||
{ERR_FUNC(ASN1_F_BN_TO_ASN1_ENUMERATED), "BN_to_ASN1_ENUMERATED"},
|
||||
{ERR_FUNC(ASN1_F_BN_TO_ASN1_INTEGER), "BN_to_ASN1_INTEGER"},
|
||||
{ERR_FUNC(ASN1_F_COLLECT_DATA), "COLLECT_DATA"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_BIT_STRING), "D2I_ASN1_BIT_STRING"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_BOOLEAN), "d2i_ASN1_BOOLEAN"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_BYTES), "d2i_ASN1_bytes"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_GENERALIZEDTIME), "D2I_ASN1_GENERALIZEDTIME"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_HEADER), "d2i_ASN1_HEADER"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_INTEGER), "D2I_ASN1_INTEGER"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_OBJECT), "d2i_ASN1_OBJECT"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_SET), "d2i_ASN1_SET"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_TYPE_BYTES), "d2i_ASN1_type_bytes"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_UINTEGER), "d2i_ASN1_UINTEGER"},
|
||||
{ERR_FUNC(ASN1_F_D2I_ASN1_UTCTIME), "D2I_ASN1_UTCTIME"},
|
||||
{ERR_FUNC(ASN1_F_D2I_NETSCAPE_RSA), "d2i_Netscape_RSA"},
|
||||
{ERR_FUNC(ASN1_F_D2I_NETSCAPE_RSA_2), "D2I_NETSCAPE_RSA_2"},
|
||||
{ERR_FUNC(ASN1_F_D2I_PRIVATEKEY), "d2i_PrivateKey"},
|
||||
{ERR_FUNC(ASN1_F_D2I_PUBLICKEY), "d2i_PublicKey"},
|
||||
{ERR_FUNC(ASN1_F_D2I_X509), "D2I_X509"},
|
||||
{ERR_FUNC(ASN1_F_D2I_X509_CINF), "D2I_X509_CINF"},
|
||||
{ERR_FUNC(ASN1_F_D2I_X509_NAME), "D2I_X509_NAME"},
|
||||
{ERR_FUNC(ASN1_F_D2I_X509_PKEY), "d2i_X509_PKEY"},
|
||||
{ERR_FUNC(ASN1_F_I2D_ASN1_SET), "i2d_ASN1_SET"},
|
||||
{ERR_FUNC(ASN1_F_I2D_ASN1_TIME), "I2D_ASN1_TIME"},
|
||||
{ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY), "i2d_DSA_PUBKEY"},
|
||||
{ERR_FUNC(ASN1_F_I2D_NETSCAPE_RSA), "i2d_Netscape_RSA"},
|
||||
{ERR_FUNC(ASN1_F_I2D_PRIVATEKEY), "i2d_PrivateKey"},
|
||||
{ERR_FUNC(ASN1_F_I2D_PUBLICKEY), "i2d_PublicKey"},
|
||||
{ERR_FUNC(ASN1_F_I2D_RSA_PUBKEY), "i2d_RSA_PUBKEY"},
|
||||
{ERR_FUNC(ASN1_F_LONG_C2I), "LONG_C2I"},
|
||||
{ERR_FUNC(ASN1_F_OID_MODULE_INIT), "OID_MODULE_INIT"},
|
||||
{ERR_FUNC(ASN1_F_PKCS5_PBE2_SET), "PKCS5_pbe2_set"},
|
||||
{ERR_FUNC(ASN1_F_X509_CINF_NEW), "X509_CINF_NEW"},
|
||||
{ERR_FUNC(ASN1_F_X509_CRL_ADD0_REVOKED), "X509_CRL_add0_revoked"},
|
||||
{ERR_FUNC(ASN1_F_X509_INFO_NEW), "X509_INFO_new"},
|
||||
{ERR_FUNC(ASN1_F_X509_NAME_NEW), "X509_NAME_NEW"},
|
||||
{ERR_FUNC(ASN1_F_X509_NEW), "X509_NEW"},
|
||||
{ERR_FUNC(ASN1_F_X509_PKEY_NEW), "X509_PKEY_new"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA ASN1_str_reasons[]=
|
||||
{
|
||||
{ASN1_R_ADDING_OBJECT ,"adding object"},
|
||||
{ASN1_R_AUX_ERROR ,"aux error"},
|
||||
{ASN1_R_BAD_CLASS ,"bad class"},
|
||||
{ASN1_R_BAD_OBJECT_HEADER ,"bad object header"},
|
||||
{ASN1_R_BAD_PASSWORD_READ ,"bad password read"},
|
||||
{ASN1_R_BAD_TAG ,"bad tag"},
|
||||
{ASN1_R_BN_LIB ,"bn lib"},
|
||||
{ASN1_R_BOOLEAN_IS_WRONG_LENGTH ,"boolean is wrong length"},
|
||||
{ASN1_R_BUFFER_TOO_SMALL ,"buffer too small"},
|
||||
{ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER ,"cipher has no object identifier"},
|
||||
{ASN1_R_DATA_IS_WRONG ,"data is wrong"},
|
||||
{ASN1_R_DECODE_ERROR ,"decode error"},
|
||||
{ASN1_R_DECODING_ERROR ,"decoding error"},
|
||||
{ASN1_R_ENCODE_ERROR ,"encode error"},
|
||||
{ASN1_R_ERROR_GETTING_TIME ,"error getting time"},
|
||||
{ASN1_R_ERROR_LOADING_SECTION ,"error loading section"},
|
||||
{ASN1_R_ERROR_PARSING_SET_ELEMENT ,"error parsing set element"},
|
||||
{ASN1_R_ERROR_SETTING_CIPHER_PARAMS ,"error setting cipher params"},
|
||||
{ASN1_R_EXPECTING_AN_INTEGER ,"expecting an integer"},
|
||||
{ASN1_R_EXPECTING_AN_OBJECT ,"expecting an object"},
|
||||
{ASN1_R_EXPECTING_A_BOOLEAN ,"expecting a boolean"},
|
||||
{ASN1_R_EXPECTING_A_TIME ,"expecting a time"},
|
||||
{ASN1_R_EXPLICIT_LENGTH_MISMATCH ,"explicit length mismatch"},
|
||||
{ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED ,"explicit tag not constructed"},
|
||||
{ASN1_R_FIELD_MISSING ,"field missing"},
|
||||
{ASN1_R_FIRST_NUM_TOO_LARGE ,"first num too large"},
|
||||
{ASN1_R_HEADER_TOO_LONG ,"header too long"},
|
||||
{ASN1_R_ILLEGAL_CHARACTERS ,"illegal characters"},
|
||||
{ASN1_R_ILLEGAL_NULL ,"illegal null"},
|
||||
{ASN1_R_ILLEGAL_OPTIONAL_ANY ,"illegal optional any"},
|
||||
{ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE ,"illegal options on item template"},
|
||||
{ASN1_R_ILLEGAL_TAGGED_ANY ,"illegal tagged any"},
|
||||
{ASN1_R_INTEGER_TOO_LARGE_FOR_LONG ,"integer too large for long"},
|
||||
{ASN1_R_INVALID_BMPSTRING_LENGTH ,"invalid bmpstring length"},
|
||||
{ASN1_R_INVALID_DIGIT ,"invalid digit"},
|
||||
{ASN1_R_INVALID_SEPARATOR ,"invalid separator"},
|
||||
{ASN1_R_INVALID_TIME_FORMAT ,"invalid time format"},
|
||||
{ASN1_R_INVALID_UNIVERSALSTRING_LENGTH ,"invalid universalstring length"},
|
||||
{ASN1_R_INVALID_UTF8STRING ,"invalid utf8string"},
|
||||
{ASN1_R_IV_TOO_LARGE ,"iv too large"},
|
||||
{ASN1_R_LENGTH_ERROR ,"length error"},
|
||||
{ASN1_R_MISSING_EOC ,"missing eoc"},
|
||||
{ASN1_R_MISSING_SECOND_NUMBER ,"missing second number"},
|
||||
{ASN1_R_MSTRING_NOT_UNIVERSAL ,"mstring not universal"},
|
||||
{ASN1_R_MSTRING_WRONG_TAG ,"mstring wrong tag"},
|
||||
{ASN1_R_NON_HEX_CHARACTERS ,"non hex characters"},
|
||||
{ASN1_R_NOT_ENOUGH_DATA ,"not enough data"},
|
||||
{ASN1_R_NO_MATCHING_CHOICE_TYPE ,"no matching choice type"},
|
||||
{ASN1_R_NULL_IS_WRONG_LENGTH ,"null is wrong length"},
|
||||
{ASN1_R_ODD_NUMBER_OF_CHARS ,"odd number of chars"},
|
||||
{ASN1_R_PRIVATE_KEY_HEADER_MISSING ,"private key header missing"},
|
||||
{ASN1_R_SECOND_NUMBER_TOO_LARGE ,"second number too large"},
|
||||
{ASN1_R_SEQUENCE_LENGTH_MISMATCH ,"sequence length mismatch"},
|
||||
{ASN1_R_SEQUENCE_NOT_CONSTRUCTED ,"sequence not constructed"},
|
||||
{ASN1_R_SHORT_LINE ,"short line"},
|
||||
{ASN1_R_STRING_TOO_LONG ,"string too long"},
|
||||
{ASN1_R_STRING_TOO_SHORT ,"string too short"},
|
||||
{ASN1_R_TAG_VALUE_TOO_HIGH ,"tag value too high"},
|
||||
{ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD,"the asn1 object identifier is not known for this md"},
|
||||
{ASN1_R_TOO_LONG ,"too long"},
|
||||
{ASN1_R_TYPE_NOT_CONSTRUCTED ,"type not constructed"},
|
||||
{ASN1_R_UNABLE_TO_DECODE_RSA_KEY ,"unable to decode rsa key"},
|
||||
{ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY ,"unable to decode rsa private key"},
|
||||
{ASN1_R_UNEXPECTED_EOC ,"unexpected eoc"},
|
||||
{ASN1_R_UNKNOWN_FORMAT ,"unknown format"},
|
||||
{ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM ,"unknown message digest algorithm"},
|
||||
{ASN1_R_UNKNOWN_OBJECT_TYPE ,"unknown object type"},
|
||||
{ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE ,"unknown public key type"},
|
||||
{ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE ,"unsupported any defined by type"},
|
||||
{ASN1_R_UNSUPPORTED_CIPHER ,"unsupported cipher"},
|
||||
{ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM ,"unsupported encryption algorithm"},
|
||||
{ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE ,"unsupported public key type"},
|
||||
{ASN1_R_WRONG_TAG ,"wrong tag"},
|
||||
{ASN1_R_WRONG_TYPE ,"wrong type"},
|
||||
{ERR_REASON(ASN1_R_ADDING_OBJECT) ,"adding object"},
|
||||
{ERR_REASON(ASN1_R_AUX_ERROR) ,"aux error"},
|
||||
{ERR_REASON(ASN1_R_BAD_CLASS) ,"bad class"},
|
||||
{ERR_REASON(ASN1_R_BAD_OBJECT_HEADER) ,"bad object header"},
|
||||
{ERR_REASON(ASN1_R_BAD_PASSWORD_READ) ,"bad password read"},
|
||||
{ERR_REASON(ASN1_R_BAD_TAG) ,"bad tag"},
|
||||
{ERR_REASON(ASN1_R_BN_LIB) ,"bn lib"},
|
||||
{ERR_REASON(ASN1_R_BOOLEAN_IS_WRONG_LENGTH),"boolean is wrong length"},
|
||||
{ERR_REASON(ASN1_R_BUFFER_TOO_SMALL) ,"buffer too small"},
|
||||
{ERR_REASON(ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),"cipher has no object identifier"},
|
||||
{ERR_REASON(ASN1_R_DATA_IS_WRONG) ,"data is wrong"},
|
||||
{ERR_REASON(ASN1_R_DECODE_ERROR) ,"decode error"},
|
||||
{ERR_REASON(ASN1_R_DECODING_ERROR) ,"decoding error"},
|
||||
{ERR_REASON(ASN1_R_ENCODE_ERROR) ,"encode error"},
|
||||
{ERR_REASON(ASN1_R_ERROR_GETTING_TIME) ,"error getting time"},
|
||||
{ERR_REASON(ASN1_R_ERROR_LOADING_SECTION),"error loading section"},
|
||||
{ERR_REASON(ASN1_R_ERROR_PARSING_SET_ELEMENT),"error parsing set element"},
|
||||
{ERR_REASON(ASN1_R_ERROR_SETTING_CIPHER_PARAMS),"error setting cipher params"},
|
||||
{ERR_REASON(ASN1_R_EXPECTING_AN_INTEGER) ,"expecting an integer"},
|
||||
{ERR_REASON(ASN1_R_EXPECTING_AN_OBJECT) ,"expecting an object"},
|
||||
{ERR_REASON(ASN1_R_EXPECTING_A_BOOLEAN) ,"expecting a boolean"},
|
||||
{ERR_REASON(ASN1_R_EXPECTING_A_TIME) ,"expecting a time"},
|
||||
{ERR_REASON(ASN1_R_EXPLICIT_LENGTH_MISMATCH),"explicit length mismatch"},
|
||||
{ERR_REASON(ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED),"explicit tag not constructed"},
|
||||
{ERR_REASON(ASN1_R_FIELD_MISSING) ,"field missing"},
|
||||
{ERR_REASON(ASN1_R_FIRST_NUM_TOO_LARGE) ,"first num too large"},
|
||||
{ERR_REASON(ASN1_R_HEADER_TOO_LONG) ,"header too long"},
|
||||
{ERR_REASON(ASN1_R_ILLEGAL_CHARACTERS) ,"illegal characters"},
|
||||
{ERR_REASON(ASN1_R_ILLEGAL_NULL) ,"illegal null"},
|
||||
{ERR_REASON(ASN1_R_ILLEGAL_OPTIONAL_ANY) ,"illegal optional any"},
|
||||
{ERR_REASON(ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE),"illegal options on item template"},
|
||||
{ERR_REASON(ASN1_R_ILLEGAL_TAGGED_ANY) ,"illegal tagged any"},
|
||||
{ERR_REASON(ASN1_R_INTEGER_TOO_LARGE_FOR_LONG),"integer too large for long"},
|
||||
{ERR_REASON(ASN1_R_INVALID_BMPSTRING_LENGTH),"invalid bmpstring length"},
|
||||
{ERR_REASON(ASN1_R_INVALID_DIGIT) ,"invalid digit"},
|
||||
{ERR_REASON(ASN1_R_INVALID_SEPARATOR) ,"invalid separator"},
|
||||
{ERR_REASON(ASN1_R_INVALID_TIME_FORMAT) ,"invalid time format"},
|
||||
{ERR_REASON(ASN1_R_INVALID_UNIVERSALSTRING_LENGTH),"invalid universalstring length"},
|
||||
{ERR_REASON(ASN1_R_INVALID_UTF8STRING) ,"invalid utf8string"},
|
||||
{ERR_REASON(ASN1_R_IV_TOO_LARGE) ,"iv too large"},
|
||||
{ERR_REASON(ASN1_R_LENGTH_ERROR) ,"length error"},
|
||||
{ERR_REASON(ASN1_R_MISSING_EOC) ,"missing eoc"},
|
||||
{ERR_REASON(ASN1_R_MISSING_SECOND_NUMBER),"missing second number"},
|
||||
{ERR_REASON(ASN1_R_MSTRING_NOT_UNIVERSAL),"mstring not universal"},
|
||||
{ERR_REASON(ASN1_R_MSTRING_WRONG_TAG) ,"mstring wrong tag"},
|
||||
{ERR_REASON(ASN1_R_NESTED_ASN1_STRING) ,"nested asn1 string"},
|
||||
{ERR_REASON(ASN1_R_NON_HEX_CHARACTERS) ,"non hex characters"},
|
||||
{ERR_REASON(ASN1_R_NOT_ENOUGH_DATA) ,"not enough data"},
|
||||
{ERR_REASON(ASN1_R_NO_MATCHING_CHOICE_TYPE),"no matching choice type"},
|
||||
{ERR_REASON(ASN1_R_NULL_IS_WRONG_LENGTH) ,"null is wrong length"},
|
||||
{ERR_REASON(ASN1_R_ODD_NUMBER_OF_CHARS) ,"odd number of chars"},
|
||||
{ERR_REASON(ASN1_R_PRIVATE_KEY_HEADER_MISSING),"private key header missing"},
|
||||
{ERR_REASON(ASN1_R_SECOND_NUMBER_TOO_LARGE),"second number too large"},
|
||||
{ERR_REASON(ASN1_R_SEQUENCE_LENGTH_MISMATCH),"sequence length mismatch"},
|
||||
{ERR_REASON(ASN1_R_SEQUENCE_NOT_CONSTRUCTED),"sequence not constructed"},
|
||||
{ERR_REASON(ASN1_R_SHORT_LINE) ,"short line"},
|
||||
{ERR_REASON(ASN1_R_STRING_TOO_LONG) ,"string too long"},
|
||||
{ERR_REASON(ASN1_R_STRING_TOO_SHORT) ,"string too short"},
|
||||
{ERR_REASON(ASN1_R_TAG_VALUE_TOO_HIGH) ,"tag value too high"},
|
||||
{ERR_REASON(ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD),"the asn1 object identifier is not known for this md"},
|
||||
{ERR_REASON(ASN1_R_TOO_LONG) ,"too long"},
|
||||
{ERR_REASON(ASN1_R_TYPE_NOT_CONSTRUCTED) ,"type not constructed"},
|
||||
{ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_KEY),"unable to decode rsa key"},
|
||||
{ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY),"unable to decode rsa private key"},
|
||||
{ERR_REASON(ASN1_R_UNEXPECTED_EOC) ,"unexpected eoc"},
|
||||
{ERR_REASON(ASN1_R_UNKNOWN_FORMAT) ,"unknown format"},
|
||||
{ERR_REASON(ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM),"unknown message digest algorithm"},
|
||||
{ERR_REASON(ASN1_R_UNKNOWN_OBJECT_TYPE) ,"unknown object type"},
|
||||
{ERR_REASON(ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE),"unknown public key type"},
|
||||
{ERR_REASON(ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE),"unsupported any defined by type"},
|
||||
{ERR_REASON(ASN1_R_UNSUPPORTED_CIPHER) ,"unsupported cipher"},
|
||||
{ERR_REASON(ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM),"unsupported encryption algorithm"},
|
||||
{ERR_REASON(ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE),"unsupported public key type"},
|
||||
{ERR_REASON(ASN1_R_WRONG_TAG) ,"wrong tag"},
|
||||
{ERR_REASON(ASN1_R_WRONG_TYPE) ,"wrong type"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -240,8 +246,8 @@ void ERR_load_ASN1_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_ASN1,ASN1_str_functs);
|
||||
ERR_load_strings(ERR_LIB_ASN1,ASN1_str_reasons);
|
||||
ERR_load_strings(0,ASN1_str_functs);
|
||||
ERR_load_strings(0,ASN1_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -66,6 +66,7 @@
|
||||
#include <openssl/err.h>
|
||||
|
||||
static int asn1_check_eoc(unsigned char **in, long len);
|
||||
static int asn1_find_end(unsigned char **in, long len, char inf);
|
||||
static int asn1_collect(BUF_MEM *buf, unsigned char **in, long len, char inf, int tag, int aclass);
|
||||
static int collect_data(BUF_MEM *buf, unsigned char **p, long plen);
|
||||
static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, char *inf, char *cst,
|
||||
@@ -644,7 +645,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, unsigned char **in, long inl
|
||||
cont = *in;
|
||||
/* If indefinite length constructed find the real end */
|
||||
if(inf) {
|
||||
if(!asn1_collect(NULL, &p, plen, inf, -1, -1)) goto err;
|
||||
if(!asn1_find_end(&p, plen, inf)) goto err;
|
||||
len = p - cont;
|
||||
} else {
|
||||
len = p - cont + plen;
|
||||
@@ -807,12 +808,66 @@ int asn1_ex_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* This function finds the end of an ASN1 structure when passed its maximum
|
||||
* length, whether it is indefinite length and a pointer to the content.
|
||||
* This is more efficient than calling asn1_collect because it does not
|
||||
* recurse on each indefinite length header.
|
||||
*/
|
||||
|
||||
static int asn1_find_end(unsigned char **in, long len, char inf)
|
||||
{
|
||||
int expected_eoc;
|
||||
long plen;
|
||||
unsigned char *p = *in, *q;
|
||||
/* If not indefinite length constructed just add length */
|
||||
if (inf == 0)
|
||||
{
|
||||
*in += len;
|
||||
return 1;
|
||||
}
|
||||
expected_eoc = 1;
|
||||
/* Indefinite length constructed form. Find the end when enough EOCs
|
||||
* are found. If more indefinite length constructed headers
|
||||
* are encountered increment the expected eoc count otherwise justi
|
||||
* skip to the end of the data.
|
||||
*/
|
||||
while (len > 0)
|
||||
{
|
||||
if(asn1_check_eoc(&p, len))
|
||||
{
|
||||
expected_eoc--;
|
||||
if (expected_eoc == 0)
|
||||
break;
|
||||
len -= 2;
|
||||
continue;
|
||||
}
|
||||
q = p;
|
||||
/* Just read in a header: only care about the length */
|
||||
if(!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len,
|
||||
-1, 0, 0, NULL))
|
||||
{
|
||||
ASN1err(ASN1_F_ASN1_FIND_END, ERR_R_NESTED_ASN1_ERROR);
|
||||
return 0;
|
||||
}
|
||||
if (inf)
|
||||
expected_eoc++;
|
||||
else
|
||||
p += plen;
|
||||
len -= p - q;
|
||||
}
|
||||
if (expected_eoc)
|
||||
{
|
||||
ASN1err(ASN1_F_ASN1_FIND_END, ASN1_R_MISSING_EOC);
|
||||
return 0;
|
||||
}
|
||||
*in = p;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This function collects the asn1 data from a constructred string
|
||||
* type into a buffer. The values of 'in' and 'len' should refer
|
||||
* to the contents of the constructed type and 'inf' should be set
|
||||
* if it is indefinite length. If 'buf' is NULL then we just want
|
||||
* to find the end of the current structure: useful for indefinite
|
||||
* length constructed stuff.
|
||||
* if it is indefinite length.
|
||||
*/
|
||||
|
||||
static int asn1_collect(BUF_MEM *buf, unsigned char **in, long len, char inf, int tag, int aclass)
|
||||
@@ -822,11 +877,6 @@ static int asn1_collect(BUF_MEM *buf, unsigned char **in, long len, char inf, in
|
||||
char cst, ininf;
|
||||
p = *in;
|
||||
inf &= 1;
|
||||
/* If no buffer and not indefinite length constructed just pass over the encoded data */
|
||||
if(!buf && !inf) {
|
||||
*in += len;
|
||||
return 1;
|
||||
}
|
||||
while(len > 0) {
|
||||
q = p;
|
||||
/* Check for EOC */
|
||||
@@ -845,9 +895,15 @@ static int asn1_collect(BUF_MEM *buf, unsigned char **in, long len, char inf, in
|
||||
}
|
||||
/* If indefinite length constructed update max length */
|
||||
if(cst) {
|
||||
if(!asn1_collect(buf, &p, plen, ininf, tag, aclass)) return 0;
|
||||
#ifdef OPENSSL_ALLOW_NESTED_ASN1_STRINGS
|
||||
if (!asn1_collect(buf, &p, plen, ininf, tag, aclass))
|
||||
return 0;
|
||||
#else
|
||||
ASN1err(ASN1_F_ASN1_COLLECT, ASN1_R_NESTED_ASN1_STRING);
|
||||
return 0;
|
||||
#endif
|
||||
} else {
|
||||
if(!collect_data(buf, &p, plen)) return 0;
|
||||
if(plen && !collect_data(buf, &p, plen)) return 0;
|
||||
}
|
||||
len -= p - q;
|
||||
}
|
||||
|
@@ -445,9 +445,12 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, const ASN1_
|
||||
case V_ASN1_BOOLEAN:
|
||||
tbool = (ASN1_BOOLEAN *)pval;
|
||||
if(*tbool == -1) return -1;
|
||||
/* Default handling if value == size field then omit */
|
||||
if(*tbool && (it->size > 0)) return -1;
|
||||
if(!*tbool && !it->size) return -1;
|
||||
if (it->utype != V_ASN1_ANY)
|
||||
{
|
||||
/* Default handling if value == size field then omit */
|
||||
if(*tbool && (it->size > 0)) return -1;
|
||||
if(!*tbool && !it->size) return -1;
|
||||
}
|
||||
c = (unsigned char)*tbool;
|
||||
cont = &c;
|
||||
len = 1;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/blowfish/Makefile
|
||||
# OpenSSL/crypto/blowfish/Makefile
|
||||
#
|
||||
|
||||
DIR= bf
|
||||
@@ -110,7 +110,7 @@ bf_enc.o: ../../include/openssl/opensslconf.h bf_enc.c bf_locl.h
|
||||
bf_ofb64.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h
|
||||
bf_ofb64.o: ../../include/openssl/opensslconf.h bf_locl.h bf_ofb64.c
|
||||
bf_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/crypto.h
|
||||
bf_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
|
||||
bf_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
bf_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
bf_skey.o: bf_locl.h bf_pi.h bf_skey.c
|
||||
bf_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/fips.h
|
||||
bf_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
bf_skey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
bf_skey.o: ../../include/openssl/symhacks.h bf_locl.h bf_pi.h bf_skey.c
|
||||
|
@@ -60,6 +60,7 @@
|
||||
#include <string.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/blowfish.h>
|
||||
#include <openssl/fips.h>
|
||||
#include "bf_locl.h"
|
||||
#include "bf_pi.h"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/bio/Makefile
|
||||
# OpenSSL/crypto/bio/Makefile
|
||||
#
|
||||
|
||||
DIR= bio
|
||||
|
@@ -576,7 +576,7 @@ abs_val(LDOUBLE value)
|
||||
}
|
||||
|
||||
static LDOUBLE
|
||||
pow10(int in_exp)
|
||||
pow_10(int in_exp)
|
||||
{
|
||||
LDOUBLE result = 1;
|
||||
while (in_exp) {
|
||||
@@ -639,11 +639,11 @@ fmtfp(
|
||||
|
||||
/* we "cheat" by converting the fractional part to integer by
|
||||
multiplying by a factor of 10 */
|
||||
fracpart = roundv((pow10(max)) * (ufvalue - intpart));
|
||||
fracpart = roundv((pow_10(max)) * (ufvalue - intpart));
|
||||
|
||||
if (fracpart >= (long)pow10(max)) {
|
||||
if (fracpart >= (long)pow_10(max)) {
|
||||
intpart++;
|
||||
fracpart -= (long)pow10(max);
|
||||
fracpart -= (long)pow_10(max);
|
||||
}
|
||||
|
||||
/* convert integer part */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/bio/bio_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,73 +64,77 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_BIO,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_BIO,0,reason)
|
||||
|
||||
static ERR_STRING_DATA BIO_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,BIO_F_ACPT_STATE,0), "ACPT_STATE"},
|
||||
{ERR_PACK(0,BIO_F_BIO_ACCEPT,0), "BIO_accept"},
|
||||
{ERR_PACK(0,BIO_F_BIO_BER_GET_HEADER,0), "BIO_BER_GET_HEADER"},
|
||||
{ERR_PACK(0,BIO_F_BIO_CTRL,0), "BIO_ctrl"},
|
||||
{ERR_PACK(0,BIO_F_BIO_GETHOSTBYNAME,0), "BIO_gethostbyname"},
|
||||
{ERR_PACK(0,BIO_F_BIO_GETS,0), "BIO_gets"},
|
||||
{ERR_PACK(0,BIO_F_BIO_GET_ACCEPT_SOCKET,0), "BIO_get_accept_socket"},
|
||||
{ERR_PACK(0,BIO_F_BIO_GET_HOST_IP,0), "BIO_get_host_ip"},
|
||||
{ERR_PACK(0,BIO_F_BIO_GET_PORT,0), "BIO_get_port"},
|
||||
{ERR_PACK(0,BIO_F_BIO_MAKE_PAIR,0), "BIO_MAKE_PAIR"},
|
||||
{ERR_PACK(0,BIO_F_BIO_NEW,0), "BIO_new"},
|
||||
{ERR_PACK(0,BIO_F_BIO_NEW_FILE,0), "BIO_new_file"},
|
||||
{ERR_PACK(0,BIO_F_BIO_NEW_MEM_BUF,0), "BIO_new_mem_buf"},
|
||||
{ERR_PACK(0,BIO_F_BIO_NREAD,0), "BIO_nread"},
|
||||
{ERR_PACK(0,BIO_F_BIO_NREAD0,0), "BIO_nread0"},
|
||||
{ERR_PACK(0,BIO_F_BIO_NWRITE,0), "BIO_nwrite"},
|
||||
{ERR_PACK(0,BIO_F_BIO_NWRITE0,0), "BIO_nwrite0"},
|
||||
{ERR_PACK(0,BIO_F_BIO_PUTS,0), "BIO_puts"},
|
||||
{ERR_PACK(0,BIO_F_BIO_READ,0), "BIO_read"},
|
||||
{ERR_PACK(0,BIO_F_BIO_SOCK_INIT,0), "BIO_sock_init"},
|
||||
{ERR_PACK(0,BIO_F_BIO_WRITE,0), "BIO_write"},
|
||||
{ERR_PACK(0,BIO_F_BUFFER_CTRL,0), "BUFFER_CTRL"},
|
||||
{ERR_PACK(0,BIO_F_CONN_CTRL,0), "CONN_CTRL"},
|
||||
{ERR_PACK(0,BIO_F_CONN_STATE,0), "CONN_STATE"},
|
||||
{ERR_PACK(0,BIO_F_FILE_CTRL,0), "FILE_CTRL"},
|
||||
{ERR_PACK(0,BIO_F_FILE_READ,0), "FILE_READ"},
|
||||
{ERR_PACK(0,BIO_F_LINEBUFFER_CTRL,0), "LINEBUFFER_CTRL"},
|
||||
{ERR_PACK(0,BIO_F_MEM_READ,0), "MEM_READ"},
|
||||
{ERR_PACK(0,BIO_F_MEM_WRITE,0), "MEM_WRITE"},
|
||||
{ERR_PACK(0,BIO_F_SSL_NEW,0), "SSL_new"},
|
||||
{ERR_PACK(0,BIO_F_WSASTARTUP,0), "WSASTARTUP"},
|
||||
{ERR_FUNC(BIO_F_ACPT_STATE), "ACPT_STATE"},
|
||||
{ERR_FUNC(BIO_F_BIO_ACCEPT), "BIO_accept"},
|
||||
{ERR_FUNC(BIO_F_BIO_BER_GET_HEADER), "BIO_BER_GET_HEADER"},
|
||||
{ERR_FUNC(BIO_F_BIO_CTRL), "BIO_ctrl"},
|
||||
{ERR_FUNC(BIO_F_BIO_GETHOSTBYNAME), "BIO_gethostbyname"},
|
||||
{ERR_FUNC(BIO_F_BIO_GETS), "BIO_gets"},
|
||||
{ERR_FUNC(BIO_F_BIO_GET_ACCEPT_SOCKET), "BIO_get_accept_socket"},
|
||||
{ERR_FUNC(BIO_F_BIO_GET_HOST_IP), "BIO_get_host_ip"},
|
||||
{ERR_FUNC(BIO_F_BIO_GET_PORT), "BIO_get_port"},
|
||||
{ERR_FUNC(BIO_F_BIO_MAKE_PAIR), "BIO_MAKE_PAIR"},
|
||||
{ERR_FUNC(BIO_F_BIO_NEW), "BIO_new"},
|
||||
{ERR_FUNC(BIO_F_BIO_NEW_FILE), "BIO_new_file"},
|
||||
{ERR_FUNC(BIO_F_BIO_NEW_MEM_BUF), "BIO_new_mem_buf"},
|
||||
{ERR_FUNC(BIO_F_BIO_NREAD), "BIO_nread"},
|
||||
{ERR_FUNC(BIO_F_BIO_NREAD0), "BIO_nread0"},
|
||||
{ERR_FUNC(BIO_F_BIO_NWRITE), "BIO_nwrite"},
|
||||
{ERR_FUNC(BIO_F_BIO_NWRITE0), "BIO_nwrite0"},
|
||||
{ERR_FUNC(BIO_F_BIO_PUTS), "BIO_puts"},
|
||||
{ERR_FUNC(BIO_F_BIO_READ), "BIO_read"},
|
||||
{ERR_FUNC(BIO_F_BIO_SOCK_INIT), "BIO_sock_init"},
|
||||
{ERR_FUNC(BIO_F_BIO_WRITE), "BIO_write"},
|
||||
{ERR_FUNC(BIO_F_BUFFER_CTRL), "BUFFER_CTRL"},
|
||||
{ERR_FUNC(BIO_F_CONN_CTRL), "CONN_CTRL"},
|
||||
{ERR_FUNC(BIO_F_CONN_STATE), "CONN_STATE"},
|
||||
{ERR_FUNC(BIO_F_FILE_CTRL), "FILE_CTRL"},
|
||||
{ERR_FUNC(BIO_F_FILE_READ), "FILE_READ"},
|
||||
{ERR_FUNC(BIO_F_LINEBUFFER_CTRL), "LINEBUFFER_CTRL"},
|
||||
{ERR_FUNC(BIO_F_MEM_READ), "MEM_READ"},
|
||||
{ERR_FUNC(BIO_F_MEM_WRITE), "MEM_WRITE"},
|
||||
{ERR_FUNC(BIO_F_SSL_NEW), "SSL_new"},
|
||||
{ERR_FUNC(BIO_F_WSASTARTUP), "WSASTARTUP"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA BIO_str_reasons[]=
|
||||
{
|
||||
{BIO_R_ACCEPT_ERROR ,"accept error"},
|
||||
{BIO_R_BAD_FOPEN_MODE ,"bad fopen mode"},
|
||||
{BIO_R_BAD_HOSTNAME_LOOKUP ,"bad hostname lookup"},
|
||||
{BIO_R_BROKEN_PIPE ,"broken pipe"},
|
||||
{BIO_R_CONNECT_ERROR ,"connect error"},
|
||||
{BIO_R_EOF_ON_MEMORY_BIO ,"EOF on memory BIO"},
|
||||
{BIO_R_ERROR_SETTING_NBIO ,"error setting nbio"},
|
||||
{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET,"error setting nbio on accepted socket"},
|
||||
{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET,"error setting nbio on accept socket"},
|
||||
{BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET ,"gethostbyname addr is not af inet"},
|
||||
{BIO_R_INVALID_ARGUMENT ,"invalid argument"},
|
||||
{BIO_R_INVALID_IP_ADDRESS ,"invalid ip address"},
|
||||
{BIO_R_IN_USE ,"in use"},
|
||||
{BIO_R_KEEPALIVE ,"keepalive"},
|
||||
{BIO_R_NBIO_CONNECT_ERROR ,"nbio connect error"},
|
||||
{BIO_R_NO_ACCEPT_PORT_SPECIFIED ,"no accept port specified"},
|
||||
{BIO_R_NO_HOSTNAME_SPECIFIED ,"no hostname specified"},
|
||||
{BIO_R_NO_PORT_DEFINED ,"no port defined"},
|
||||
{BIO_R_NO_PORT_SPECIFIED ,"no port specified"},
|
||||
{BIO_R_NO_SUCH_FILE ,"no such file"},
|
||||
{BIO_R_NULL_PARAMETER ,"null parameter"},
|
||||
{BIO_R_TAG_MISMATCH ,"tag mismatch"},
|
||||
{BIO_R_UNABLE_TO_BIND_SOCKET ,"unable to bind socket"},
|
||||
{BIO_R_UNABLE_TO_CREATE_SOCKET ,"unable to create socket"},
|
||||
{BIO_R_UNABLE_TO_LISTEN_SOCKET ,"unable to listen socket"},
|
||||
{BIO_R_UNINITIALIZED ,"uninitialized"},
|
||||
{BIO_R_UNSUPPORTED_METHOD ,"unsupported method"},
|
||||
{BIO_R_WRITE_TO_READ_ONLY_BIO ,"write to read only BIO"},
|
||||
{BIO_R_WSASTARTUP ,"WSAStartup"},
|
||||
{ERR_REASON(BIO_R_ACCEPT_ERROR) ,"accept error"},
|
||||
{ERR_REASON(BIO_R_BAD_FOPEN_MODE) ,"bad fopen mode"},
|
||||
{ERR_REASON(BIO_R_BAD_HOSTNAME_LOOKUP) ,"bad hostname lookup"},
|
||||
{ERR_REASON(BIO_R_BROKEN_PIPE) ,"broken pipe"},
|
||||
{ERR_REASON(BIO_R_CONNECT_ERROR) ,"connect error"},
|
||||
{ERR_REASON(BIO_R_EOF_ON_MEMORY_BIO) ,"EOF on memory BIO"},
|
||||
{ERR_REASON(BIO_R_ERROR_SETTING_NBIO) ,"error setting nbio"},
|
||||
{ERR_REASON(BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET),"error setting nbio on accepted socket"},
|
||||
{ERR_REASON(BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET),"error setting nbio on accept socket"},
|
||||
{ERR_REASON(BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET),"gethostbyname addr is not af inet"},
|
||||
{ERR_REASON(BIO_R_INVALID_ARGUMENT) ,"invalid argument"},
|
||||
{ERR_REASON(BIO_R_INVALID_IP_ADDRESS) ,"invalid ip address"},
|
||||
{ERR_REASON(BIO_R_IN_USE) ,"in use"},
|
||||
{ERR_REASON(BIO_R_KEEPALIVE) ,"keepalive"},
|
||||
{ERR_REASON(BIO_R_NBIO_CONNECT_ERROR) ,"nbio connect error"},
|
||||
{ERR_REASON(BIO_R_NO_ACCEPT_PORT_SPECIFIED),"no accept port specified"},
|
||||
{ERR_REASON(BIO_R_NO_HOSTNAME_SPECIFIED) ,"no hostname specified"},
|
||||
{ERR_REASON(BIO_R_NO_PORT_DEFINED) ,"no port defined"},
|
||||
{ERR_REASON(BIO_R_NO_PORT_SPECIFIED) ,"no port specified"},
|
||||
{ERR_REASON(BIO_R_NO_SUCH_FILE) ,"no such file"},
|
||||
{ERR_REASON(BIO_R_NULL_PARAMETER) ,"null parameter"},
|
||||
{ERR_REASON(BIO_R_TAG_MISMATCH) ,"tag mismatch"},
|
||||
{ERR_REASON(BIO_R_UNABLE_TO_BIND_SOCKET) ,"unable to bind socket"},
|
||||
{ERR_REASON(BIO_R_UNABLE_TO_CREATE_SOCKET),"unable to create socket"},
|
||||
{ERR_REASON(BIO_R_UNABLE_TO_LISTEN_SOCKET),"unable to listen socket"},
|
||||
{ERR_REASON(BIO_R_UNINITIALIZED) ,"uninitialized"},
|
||||
{ERR_REASON(BIO_R_UNSUPPORTED_METHOD) ,"unsupported method"},
|
||||
{ERR_REASON(BIO_R_WRITE_TO_READ_ONLY_BIO),"write to read only BIO"},
|
||||
{ERR_REASON(BIO_R_WSASTARTUP) ,"WSAStartup"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -144,8 +148,8 @@ void ERR_load_BIO_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_BIO,BIO_str_functs);
|
||||
ERR_load_strings(ERR_LIB_BIO,BIO_str_reasons);
|
||||
ERR_load_strings(0,BIO_str_functs);
|
||||
ERR_load_strings(0,BIO_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -469,7 +469,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
break;
|
||||
case BIO_C_DO_STATE_MACHINE:
|
||||
/* use this one to start the connection */
|
||||
if (!data->state != BIO_CONN_S_OK)
|
||||
if (data->state != BIO_CONN_S_OK)
|
||||
ret=(long)conn_state(b,data);
|
||||
else
|
||||
ret=1;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/bn/Makefile
|
||||
# OpenSSL/crypto/bn/Makefile
|
||||
#
|
||||
|
||||
DIR= bn
|
||||
@@ -31,12 +31,12 @@ LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC= bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c bn_mod.c \
|
||||
bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \
|
||||
bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_asm.c \
|
||||
bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c
|
||||
bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_x931p.c
|
||||
|
||||
LIBOBJ= bn_add.o bn_div.o bn_exp.o bn_lib.o bn_ctx.o bn_mul.o bn_mod.o \
|
||||
bn_print.o bn_rand.o bn_shift.o bn_word.o bn_blind.o \
|
||||
bn_kron.o bn_sqrt.o bn_gcd.o bn_prime.o bn_err.o bn_sqr.o $(BN_ASM) \
|
||||
bn_recp.o bn_mont.o bn_mpi.o bn_exp2.o
|
||||
bn_recp.o bn_mont.o bn_mpi.o bn_exp2.o bn_x931p.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
@@ -329,3 +329,5 @@ bn_word.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
bn_word.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
bn_word.o: ../cryptlib.h bn_lcl.h bn_word.c
|
||||
bn_x931p.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h
|
||||
bn_x931p.o: ../../include/openssl/opensslconf.h bn_x931p.c
|
||||
|
@@ -116,7 +116,7 @@ if ($opf =~ /32\.s/) {
|
||||
$UDIV= "divwu"; # unsigned divide
|
||||
$UCMPI= "cmplwi"; # unsigned compare with immediate
|
||||
$UCMP= "cmplw"; # unsigned compare
|
||||
$COUNTZ="cntlzw"; # count leading zeros
|
||||
$CNTLZ= "cntlzw"; # count leading zeros
|
||||
$SHL= "slw"; # shift left
|
||||
$SHR= "srw"; # unsigned shift right
|
||||
$SHRI= "srwi"; # unsigned shift right by immediate
|
||||
@@ -124,6 +124,7 @@ if ($opf =~ /32\.s/) {
|
||||
$CLRU= "clrlwi"; # clear upper bits
|
||||
$INSR= "insrwi"; # insert right
|
||||
$ROTL= "rotlwi"; # rotate left by immediate
|
||||
$TR= "tw"; # conditional trap
|
||||
} elsif ($opf =~ /64\.s/) {
|
||||
$BITS= 64;
|
||||
$BNSZ= $BITS/8;
|
||||
@@ -139,7 +140,7 @@ if ($opf =~ /32\.s/) {
|
||||
$UDIV= "divdu"; # unsigned divide
|
||||
$UCMPI= "cmpldi"; # unsigned compare with immediate
|
||||
$UCMP= "cmpld"; # unsigned compare
|
||||
$COUNTZ="cntlzd"; # count leading zeros
|
||||
$CNTLZ= "cntlzd"; # count leading zeros
|
||||
$SHL= "sld"; # shift left
|
||||
$SHR= "srd"; # unsigned shift right
|
||||
$SHRI= "srdi"; # unsigned shift right by immediate
|
||||
@@ -147,6 +148,7 @@ if ($opf =~ /32\.s/) {
|
||||
$CLRU= "clrldi"; # clear upper bits
|
||||
$INSR= "insrdi"; # insert right
|
||||
$ROTL= "rotldi"; # rotate left by immediate
|
||||
$TR= "td"; # conditional trap
|
||||
} else { die "nonsense $opf"; }
|
||||
|
||||
( defined shift || open STDOUT,">$opf" ) || die "can't open $opf: $!";
|
||||
@@ -1710,17 +1712,12 @@ Lppcasm_add_adios:
|
||||
bclr BO_ALWAYS,CR0_LT
|
||||
Lppcasm_div1:
|
||||
xor r0,r0,r0 #r0=0
|
||||
$COUNTZ r7,r5 #r7 = num leading 0s in d.
|
||||
subfic r8,r7,$BITS #r8 = BN_num_bits_word(d)
|
||||
cmpi 0,0,r8,$BITS #
|
||||
bc BO_IF,CR0_EQ,Lppcasm_div2 #proceed if (r8==$BITS)
|
||||
li r9,1 # r9=1
|
||||
$SHL r10,r9,r8 # r9<<=r8
|
||||
$UCMP 0,r3,r10 #
|
||||
bc BO_IF,CR0_GT,Lppcasm_div2 #or if (h > (1<<r8))
|
||||
$UDIV r3,r3,r0 #if not assert(0) divide by 0!
|
||||
#that's how we signal overflow
|
||||
bclr BO_ALWAYS,CR0_LT #return. NEVER REACHED.
|
||||
li r8,$BITS
|
||||
$CNTLZ. r7,r5 #r7 = num leading 0s in d.
|
||||
bc BO_IF,CR0_EQ,Lppcasm_div2 #proceed if no leading zeros
|
||||
subf r8,r7,r8 #r8 = BN_num_bits_word(d)
|
||||
$SHR. r9,r3,r8 #are there any bits above r8'th?
|
||||
$TR 16,r9,r0 #if there're, signal to dump core...
|
||||
Lppcasm_div2:
|
||||
$UCMP 0,r3,r5 #h>=d?
|
||||
bc BO_IF,CR0_LT,Lppcasm_div3 #goto Lppcasm_div3 if not
|
||||
|
@@ -162,10 +162,14 @@
|
||||
* BN_ULONG w;
|
||||
*/
|
||||
bn_mul_add_words:
|
||||
sra %o2,%g0,%o2 ! signx %o2
|
||||
brgz,a %o2,.L_bn_mul_add_words_proceed
|
||||
lduw [%o1],%g2
|
||||
retl
|
||||
clr %o0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
.L_bn_mul_add_words_proceed:
|
||||
srl %o3,%g0,%o3 ! clruw %o3
|
||||
@@ -260,10 +264,14 @@ bn_mul_add_words:
|
||||
* BN_ULONG w;
|
||||
*/
|
||||
bn_mul_words:
|
||||
sra %o2,%g0,%o2 ! signx %o2
|
||||
brgz,a %o2,.L_bn_mul_words_proceeed
|
||||
lduw [%o1],%g2
|
||||
retl
|
||||
clr %o0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
.L_bn_mul_words_proceeed:
|
||||
srl %o3,%g0,%o3 ! clruw %o3
|
||||
@@ -344,10 +352,14 @@ bn_mul_words:
|
||||
* int n;
|
||||
*/
|
||||
bn_sqr_words:
|
||||
sra %o2,%g0,%o2 ! signx %o2
|
||||
brgz,a %o2,.L_bn_sqr_words_proceeed
|
||||
lduw [%o1],%g2
|
||||
retl
|
||||
clr %o0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
.L_bn_sqr_words_proceeed:
|
||||
andcc %o2,-4,%g0
|
||||
@@ -445,6 +457,7 @@ bn_div_words:
|
||||
* int n;
|
||||
*/
|
||||
bn_add_words:
|
||||
sra %o3,%g0,%o3 ! signx %o3
|
||||
brgz,a %o3,.L_bn_add_words_proceed
|
||||
lduw [%o1],%o4
|
||||
retl
|
||||
@@ -454,7 +467,6 @@ bn_add_words:
|
||||
andcc %o3,-4,%g0
|
||||
bz,pn %icc,.L_bn_add_words_tail
|
||||
addcc %g0,0,%g0 ! clear carry flag
|
||||
nop
|
||||
|
||||
.L_bn_add_words_loop: ! wow! 32 aligned!
|
||||
dec 4,%o3
|
||||
@@ -523,6 +535,7 @@ bn_add_words:
|
||||
* int n;
|
||||
*/
|
||||
bn_sub_words:
|
||||
sra %o3,%g0,%o3 ! signx %o3
|
||||
brgz,a %o3,.L_bn_sub_words_proceed
|
||||
lduw [%o1],%o4
|
||||
retl
|
||||
@@ -532,7 +545,6 @@ bn_sub_words:
|
||||
andcc %o3,-4,%g0
|
||||
bz,pn %icc,.L_bn_sub_words_tail
|
||||
addcc %g0,0,%g0 ! clear carry flag
|
||||
nop
|
||||
|
||||
.L_bn_sub_words_loop: ! wow! 32 aligned!
|
||||
dec 4,%o3
|
||||
|
@@ -225,10 +225,23 @@ extern "C" {
|
||||
|
||||
#define BN_FLG_MALLOCED 0x01
|
||||
#define BN_FLG_STATIC_DATA 0x02
|
||||
#define BN_FLG_EXP_CONSTTIME 0x04 /* avoid leaking exponent information through timings
|
||||
* (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
|
||||
#define BN_FLG_FREE 0x8000 /* used for debuging */
|
||||
#define BN_set_flags(b,n) ((b)->flags|=(n))
|
||||
#define BN_get_flags(b,n) ((b)->flags&(n))
|
||||
|
||||
/* get a clone of a BIGNUM with changed flags, for *temporary* use only
|
||||
* (the two BIGNUMs cannot not be used in parallel!) */
|
||||
#define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \
|
||||
(dest)->top=(b)->top, \
|
||||
(dest)->dmax=(b)->dmax, \
|
||||
(dest)->neg=(b)->neg, \
|
||||
(dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \
|
||||
| ((b)->flags & ~BN_FLG_MALLOCED) \
|
||||
| BN_FLG_STATIC_DATA \
|
||||
| (n)))
|
||||
|
||||
typedef struct bignum_st
|
||||
{
|
||||
BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
|
||||
@@ -378,6 +391,8 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m,BN_CTX *ctx);
|
||||
int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont);
|
||||
int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
|
||||
@@ -423,6 +438,19 @@ int BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
|
||||
void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
|
||||
int do_trial_division);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int BN_X931_derive_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
void (*cb)(int, int, void *), void *cb_arg,
|
||||
const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
|
||||
const BIGNUM *e, BN_CTX *ctx);
|
||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
|
||||
int BN_X931_generate_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
BIGNUM *Xp1, BIGNUM *Xp2,
|
||||
const BIGNUM *Xp,
|
||||
const BIGNUM *e, BN_CTX *ctx,
|
||||
void (*cb)(int, int, void *), void *cb_arg);
|
||||
#endif
|
||||
|
||||
BN_MONT_CTX *BN_MONT_CTX_new(void );
|
||||
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
|
||||
int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,
|
||||
@@ -434,6 +462,8 @@ int BN_from_montgomery(BIGNUM *r,const BIGNUM *a,
|
||||
void BN_MONT_CTX_free(BN_MONT_CTX *mont);
|
||||
int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx);
|
||||
BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from);
|
||||
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
|
||||
const BIGNUM *mod, BN_CTX *ctx);
|
||||
|
||||
BN_BLINDING *BN_BLINDING_new(BIGNUM *A,BIGNUM *Ai,BIGNUM *mod);
|
||||
void BN_BLINDING_free(BN_BLINDING *b);
|
||||
@@ -510,11 +540,15 @@ void ERR_load_BN_strings(void);
|
||||
#define BN_F_BN_CTX_GET 116
|
||||
#define BN_F_BN_CTX_NEW 106
|
||||
#define BN_F_BN_DIV 107
|
||||
#define BN_F_BN_EXP 123
|
||||
#define BN_F_BN_EXPAND2 108
|
||||
#define BN_F_BN_EXPAND_INTERNAL 120
|
||||
#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
|
||||
#define BN_F_BN_MOD_EXP_MONT_WORD 117
|
||||
#define BN_F_BN_MOD_EXP_RECP 125
|
||||
#define BN_F_BN_MOD_EXP_SIMPLE 126
|
||||
#define BN_F_BN_MOD_INVERSE 110
|
||||
#define BN_F_BN_MOD_LSHIFT_QUICK 119
|
||||
#define BN_F_BN_MOD_MUL_RECIPROCAL 111
|
||||
|
@@ -237,7 +237,7 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
|
||||
if (d == 0) return(BN_MASK2);
|
||||
|
||||
i=BN_num_bits_word(d);
|
||||
assert((i == BN_BITS2) || (h > (BN_ULONG)1<<i));
|
||||
assert((i == BN_BITS2) || (h <= (BN_ULONG)1<<i));
|
||||
|
||||
i=BN_BITS2-i;
|
||||
if (h >= d) h-=d;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/bn/bn_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,52 +64,60 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_BN,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_BN,0,reason)
|
||||
|
||||
static ERR_STRING_DATA BN_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,BN_F_BN_BLINDING_CONVERT,0), "BN_BLINDING_convert"},
|
||||
{ERR_PACK(0,BN_F_BN_BLINDING_INVERT,0), "BN_BLINDING_invert"},
|
||||
{ERR_PACK(0,BN_F_BN_BLINDING_NEW,0), "BN_BLINDING_new"},
|
||||
{ERR_PACK(0,BN_F_BN_BLINDING_UPDATE,0), "BN_BLINDING_update"},
|
||||
{ERR_PACK(0,BN_F_BN_BN2DEC,0), "BN_bn2dec"},
|
||||
{ERR_PACK(0,BN_F_BN_BN2HEX,0), "BN_bn2hex"},
|
||||
{ERR_PACK(0,BN_F_BN_CTX_GET,0), "BN_CTX_get"},
|
||||
{ERR_PACK(0,BN_F_BN_CTX_NEW,0), "BN_CTX_new"},
|
||||
{ERR_PACK(0,BN_F_BN_DIV,0), "BN_div"},
|
||||
{ERR_PACK(0,BN_F_BN_EXPAND2,0), "bn_expand2"},
|
||||
{ERR_PACK(0,BN_F_BN_EXPAND_INTERNAL,0), "BN_EXPAND_INTERNAL"},
|
||||
{ERR_PACK(0,BN_F_BN_MOD_EXP2_MONT,0), "BN_mod_exp2_mont"},
|
||||
{ERR_PACK(0,BN_F_BN_MOD_EXP_MONT,0), "BN_mod_exp_mont"},
|
||||
{ERR_PACK(0,BN_F_BN_MOD_EXP_MONT_WORD,0), "BN_mod_exp_mont_word"},
|
||||
{ERR_PACK(0,BN_F_BN_MOD_INVERSE,0), "BN_mod_inverse"},
|
||||
{ERR_PACK(0,BN_F_BN_MOD_LSHIFT_QUICK,0), "BN_mod_lshift_quick"},
|
||||
{ERR_PACK(0,BN_F_BN_MOD_MUL_RECIPROCAL,0), "BN_mod_mul_reciprocal"},
|
||||
{ERR_PACK(0,BN_F_BN_MOD_SQRT,0), "BN_mod_sqrt"},
|
||||
{ERR_PACK(0,BN_F_BN_MPI2BN,0), "BN_mpi2bn"},
|
||||
{ERR_PACK(0,BN_F_BN_NEW,0), "BN_new"},
|
||||
{ERR_PACK(0,BN_F_BN_RAND,0), "BN_rand"},
|
||||
{ERR_PACK(0,BN_F_BN_RAND_RANGE,0), "BN_rand_range"},
|
||||
{ERR_PACK(0,BN_F_BN_USUB,0), "BN_usub"},
|
||||
{ERR_FUNC(BN_F_BN_BLINDING_CONVERT), "BN_BLINDING_convert"},
|
||||
{ERR_FUNC(BN_F_BN_BLINDING_INVERT), "BN_BLINDING_invert"},
|
||||
{ERR_FUNC(BN_F_BN_BLINDING_NEW), "BN_BLINDING_new"},
|
||||
{ERR_FUNC(BN_F_BN_BLINDING_UPDATE), "BN_BLINDING_update"},
|
||||
{ERR_FUNC(BN_F_BN_BN2DEC), "BN_bn2dec"},
|
||||
{ERR_FUNC(BN_F_BN_BN2HEX), "BN_bn2hex"},
|
||||
{ERR_FUNC(BN_F_BN_CTX_GET), "BN_CTX_get"},
|
||||
{ERR_FUNC(BN_F_BN_CTX_NEW), "BN_CTX_new"},
|
||||
{ERR_FUNC(BN_F_BN_DIV), "BN_div"},
|
||||
{ERR_FUNC(BN_F_BN_EXP), "BN_exp"},
|
||||
{ERR_FUNC(BN_F_BN_EXPAND2), "bn_expand2"},
|
||||
{ERR_FUNC(BN_F_BN_EXPAND_INTERNAL), "BN_EXPAND_INTERNAL"},
|
||||
{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"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT_WORD), "BN_mod_exp_mont_word"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_EXP_RECP), "BN_mod_exp_recp"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_EXP_SIMPLE), "BN_mod_exp_simple"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_INVERSE), "BN_mod_inverse"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_LSHIFT_QUICK), "BN_mod_lshift_quick"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_MUL_RECIPROCAL), "BN_mod_mul_reciprocal"},
|
||||
{ERR_FUNC(BN_F_BN_MOD_SQRT), "BN_mod_sqrt"},
|
||||
{ERR_FUNC(BN_F_BN_MPI2BN), "BN_mpi2bn"},
|
||||
{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_USUB), "BN_usub"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA BN_str_reasons[]=
|
||||
{
|
||||
{BN_R_ARG2_LT_ARG3 ,"arg2 lt arg3"},
|
||||
{BN_R_BAD_RECIPROCAL ,"bad reciprocal"},
|
||||
{BN_R_BIGNUM_TOO_LONG ,"bignum too long"},
|
||||
{BN_R_CALLED_WITH_EVEN_MODULUS ,"called with even modulus"},
|
||||
{BN_R_DIV_BY_ZERO ,"div by zero"},
|
||||
{BN_R_ENCODING_ERROR ,"encoding error"},
|
||||
{BN_R_EXPAND_ON_STATIC_BIGNUM_DATA ,"expand on static bignum data"},
|
||||
{BN_R_INPUT_NOT_REDUCED ,"input not reduced"},
|
||||
{BN_R_INVALID_LENGTH ,"invalid length"},
|
||||
{BN_R_INVALID_RANGE ,"invalid range"},
|
||||
{BN_R_NOT_A_SQUARE ,"not a square"},
|
||||
{BN_R_NOT_INITIALIZED ,"not initialized"},
|
||||
{BN_R_NO_INVERSE ,"no inverse"},
|
||||
{BN_R_P_IS_NOT_PRIME ,"p is not prime"},
|
||||
{BN_R_TOO_MANY_ITERATIONS ,"too many iterations"},
|
||||
{BN_R_TOO_MANY_TEMPORARY_VARIABLES ,"too many temporary variables"},
|
||||
{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_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"},
|
||||
{ERR_REASON(BN_R_EXPAND_ON_STATIC_BIGNUM_DATA),"expand on static bignum data"},
|
||||
{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_NOT_A_SQUARE) ,"not a square"},
|
||||
{ERR_REASON(BN_R_NOT_INITIALIZED) ,"not initialized"},
|
||||
{ERR_REASON(BN_R_NO_INVERSE) ,"no inverse"},
|
||||
{ERR_REASON(BN_R_P_IS_NOT_PRIME) ,"p is not prime"},
|
||||
{ERR_REASON(BN_R_TOO_MANY_ITERATIONS) ,"too many iterations"},
|
||||
{ERR_REASON(BN_R_TOO_MANY_TEMPORARY_VARIABLES),"too many temporary variables"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -123,8 +131,8 @@ void ERR_load_BN_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_BN,BN_str_functs);
|
||||
ERR_load_strings(ERR_LIB_BN,BN_str_reasons);
|
||||
ERR_load_strings(0,BN_str_functs);
|
||||
ERR_load_strings(0,BN_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2005 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
|
||||
@@ -113,6 +113,7 @@
|
||||
#include "cryptlib.h"
|
||||
#include "bn_lcl.h"
|
||||
|
||||
/* maximum precomputation table size for *variable* sliding windows */
|
||||
#define TABLE_SIZE 32
|
||||
|
||||
/* this one works - simple but works */
|
||||
@@ -121,6 +122,13 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
||||
int i,bits,ret=0;
|
||||
BIGNUM *v,*rr;
|
||||
|
||||
if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
|
||||
{
|
||||
/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
|
||||
BNerr(BN_F_BN_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
if ((r == a) || (r == p))
|
||||
rr = BN_CTX_get(ctx);
|
||||
@@ -204,7 +212,7 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
|
||||
if (BN_is_odd(m))
|
||||
{
|
||||
# ifdef MONT_EXP_WORD
|
||||
if (a->top == 1 && !a->neg)
|
||||
if (a->top == 1 && !a->neg && (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) == 0))
|
||||
{
|
||||
BN_ULONG A = a->d[0];
|
||||
ret=BN_mod_exp_mont_word(r,A,p,m,ctx,NULL);
|
||||
@@ -234,6 +242,13 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
BIGNUM val[TABLE_SIZE];
|
||||
BN_RECP_CTX recp;
|
||||
|
||||
if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
|
||||
{
|
||||
/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
|
||||
BNerr(BN_F_BN_MOD_EXP_RECP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
bits=BN_num_bits(p);
|
||||
|
||||
if (bits == 0)
|
||||
@@ -361,6 +376,11 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
BIGNUM val[TABLE_SIZE];
|
||||
BN_MONT_CTX *mont=NULL;
|
||||
|
||||
if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
|
||||
{
|
||||
return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
|
||||
}
|
||||
|
||||
bn_check_top(a);
|
||||
bn_check_top(p);
|
||||
bn_check_top(m);
|
||||
@@ -493,6 +513,212 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout
|
||||
* so that accessing any of these table values shows the same access pattern as far
|
||||
* as cache lines are concerned. The following functions are used to transfer a BIGNUM
|
||||
* from/to that table. */
|
||||
|
||||
static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width)
|
||||
{
|
||||
size_t i, j;
|
||||
|
||||
if (bn_wexpand(b, top) == NULL)
|
||||
return 0;
|
||||
while (b->top < top)
|
||||
{
|
||||
b->d[b->top++] = 0;
|
||||
}
|
||||
|
||||
for (i = 0, j=idx; i < top * sizeof b->d[0]; i++, j+=width)
|
||||
{
|
||||
buf[j] = ((unsigned char*)b->d)[i];
|
||||
}
|
||||
|
||||
bn_fix_top(b);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width)
|
||||
{
|
||||
size_t i, j;
|
||||
|
||||
if (bn_wexpand(b, top) == NULL)
|
||||
return 0;
|
||||
|
||||
for (i=0, j=idx; i < top * sizeof b->d[0]; i++, j+=width)
|
||||
{
|
||||
((unsigned char*)b->d)[i] = buf[j];
|
||||
}
|
||||
|
||||
b->top = top;
|
||||
bn_fix_top(b);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Given a pointer value, compute the next address that is a cache line multiple. */
|
||||
#define MOD_EXP_CTIME_ALIGN(x_) \
|
||||
((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ULONG)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
|
||||
|
||||
/* This variant of BN_mod_exp_mont() uses fixed windows and the special
|
||||
* precomputation memory layout to limit data-dependency to a minimum
|
||||
* to protect secret exponents (cf. the hyper-threading timing attacks
|
||||
* pointed out by Colin Percival,
|
||||
* http://www.daemonology.net/hyperthreading-considered-harmful/)
|
||||
*/
|
||||
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
|
||||
{
|
||||
int i,bits,ret=0,idx,window,wvalue;
|
||||
int top;
|
||||
BIGNUM *r;
|
||||
const BIGNUM *aa;
|
||||
BN_MONT_CTX *mont=NULL;
|
||||
|
||||
int numPowers;
|
||||
unsigned char *powerbufFree=NULL;
|
||||
int powerbufLen = 0;
|
||||
unsigned char *powerbuf=NULL;
|
||||
BIGNUM *computeTemp=NULL, *am=NULL;
|
||||
|
||||
bn_check_top(a);
|
||||
bn_check_top(p);
|
||||
bn_check_top(m);
|
||||
|
||||
top = m->top;
|
||||
|
||||
if (!(m->d[0] & 1))
|
||||
{
|
||||
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME,BN_R_CALLED_WITH_EVEN_MODULUS);
|
||||
return(0);
|
||||
}
|
||||
bits=BN_num_bits(p);
|
||||
if (bits == 0)
|
||||
{
|
||||
ret = BN_one(rr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Initialize BIGNUM context and allocate intermediate result */
|
||||
BN_CTX_start(ctx);
|
||||
r = BN_CTX_get(ctx);
|
||||
if (r == NULL) goto err;
|
||||
|
||||
/* Allocate a montgomery context if it was not supplied by the caller.
|
||||
* If this is not done, things will break in the montgomery part.
|
||||
*/
|
||||
if (in_mont != NULL)
|
||||
mont=in_mont;
|
||||
else
|
||||
{
|
||||
if ((mont=BN_MONT_CTX_new()) == NULL) goto err;
|
||||
if (!BN_MONT_CTX_set(mont,m,ctx)) goto err;
|
||||
}
|
||||
|
||||
/* Get the window size to use with size of p. */
|
||||
window = BN_window_bits_for_ctime_exponent_size(bits);
|
||||
|
||||
/* Allocate a buffer large enough to hold all of the pre-computed
|
||||
* powers of a.
|
||||
*/
|
||||
numPowers = 1 << window;
|
||||
powerbufLen = sizeof(m->d[0])*top*numPowers;
|
||||
if ((powerbufFree=(unsigned char*)OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL)
|
||||
goto err;
|
||||
|
||||
powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
|
||||
memset(powerbuf, 0, powerbufLen);
|
||||
|
||||
/* Initialize the intermediate result. Do this early to save double conversion,
|
||||
* once each for a^0 and intermediate result.
|
||||
*/
|
||||
if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err;
|
||||
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(r, top, powerbuf, 0, numPowers)) goto err;
|
||||
|
||||
/* Initialize computeTemp as a^1 with montgomery precalcs */
|
||||
computeTemp = BN_CTX_get(ctx);
|
||||
am = BN_CTX_get(ctx);
|
||||
if (computeTemp==NULL || am==NULL) goto err;
|
||||
|
||||
if (a->neg || BN_ucmp(a,m) >= 0)
|
||||
{
|
||||
if (!BN_mod(am,a,m,ctx))
|
||||
goto err;
|
||||
aa= am;
|
||||
}
|
||||
else
|
||||
aa=a;
|
||||
if (!BN_to_montgomery(am,aa,mont,ctx)) goto err;
|
||||
if (!BN_copy(computeTemp, am)) goto err;
|
||||
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(am, top, powerbuf, 1, numPowers)) goto err;
|
||||
|
||||
/* If the window size is greater than 1, then calculate
|
||||
* val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1)
|
||||
* (even powers could instead be computed as (a^(i/2))^2
|
||||
* to use the slight performance advantage of sqr over mul).
|
||||
*/
|
||||
if (window > 1)
|
||||
{
|
||||
for (i=2; i<numPowers; i++)
|
||||
{
|
||||
/* Calculate a^i = a^(i-1) * a */
|
||||
if (!BN_mod_mul_montgomery(computeTemp,am,computeTemp,mont,ctx))
|
||||
goto err;
|
||||
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(computeTemp, top, powerbuf, i, numPowers)) goto err;
|
||||
}
|
||||
}
|
||||
|
||||
/* Adjust the number of bits up to a multiple of the window size.
|
||||
* If the exponent length is not a multiple of the window size, then
|
||||
* this pads the most significant bits with zeros to normalize the
|
||||
* scanning loop to there's no special cases.
|
||||
*
|
||||
* * NOTE: Making the window size a power of two less than the native
|
||||
* * word size ensures that the padded bits won't go past the last
|
||||
* * word in the internal BIGNUM structure. Going past the end will
|
||||
* * still produce the correct result, but causes a different branch
|
||||
* * to be taken in the BN_is_bit_set function.
|
||||
*/
|
||||
bits = ((bits+window-1)/window)*window;
|
||||
idx=bits-1; /* The top bit of the window */
|
||||
|
||||
/* Scan the exponent one window at a time starting from the most
|
||||
* significant bits.
|
||||
*/
|
||||
while (idx >= 0)
|
||||
{
|
||||
wvalue=0; /* The 'value' of the window */
|
||||
|
||||
/* Scan the window, squaring the result as we go */
|
||||
for (i=0; i<window; i++,idx--)
|
||||
{
|
||||
if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) goto err;
|
||||
wvalue = (wvalue<<1)+BN_is_bit_set(p,idx);
|
||||
}
|
||||
|
||||
/* Fetch the appropriate pre-computed value from the pre-buf */
|
||||
if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(computeTemp, top, powerbuf, wvalue, numPowers)) goto err;
|
||||
|
||||
/* Multiply the result into the intermediate result */
|
||||
if (!BN_mod_mul_montgomery(r,r,computeTemp,mont,ctx)) goto err;
|
||||
}
|
||||
|
||||
/* Convert the final result from montgomery to standard format */
|
||||
if (!BN_from_montgomery(rr,r,mont,ctx)) goto err;
|
||||
ret=1;
|
||||
err:
|
||||
if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont);
|
||||
if (powerbuf!=NULL)
|
||||
{
|
||||
OPENSSL_cleanse(powerbuf,powerbufLen);
|
||||
OPENSSL_free(powerbufFree);
|
||||
}
|
||||
if (am!=NULL) BN_clear(am);
|
||||
if (computeTemp!=NULL) BN_clear(computeTemp);
|
||||
BN_CTX_end(ctx);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
|
||||
{
|
||||
@@ -517,6 +743,13 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
|
||||
#define BN_TO_MONTGOMERY_WORD(r, w, mont) \
|
||||
(BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
|
||||
|
||||
if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
|
||||
{
|
||||
/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
|
||||
BNerr(BN_F_BN_MOD_EXP_MONT_WORD,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
bn_check_top(p);
|
||||
bn_check_top(m);
|
||||
|
||||
@@ -644,6 +877,13 @@ int BN_mod_exp_simple(BIGNUM *r,
|
||||
BIGNUM *d;
|
||||
BIGNUM val[TABLE_SIZE];
|
||||
|
||||
if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
|
||||
{
|
||||
/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
|
||||
BNerr(BN_F_BN_MOD_EXP_SIMPLE,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
bits=BN_num_bits(p);
|
||||
|
||||
if (bits == 0)
|
||||
|
@@ -177,6 +177,45 @@ struct bignum_ctx
|
||||
|
||||
|
||||
|
||||
/* BN_mod_exp_mont_conttime is based on the assumption that the
|
||||
* L1 data cache line width of the target processor is at least
|
||||
* the following value.
|
||||
*/
|
||||
#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH ( 64 )
|
||||
#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)
|
||||
|
||||
/* Window sizes optimized for fixed window size modular exponentiation
|
||||
* algorithm (BN_mod_exp_mont_consttime).
|
||||
*
|
||||
* To achieve the security goals of BN_mode_exp_mont_consttime, the
|
||||
* maximum size of the window must not exceed
|
||||
* log_2(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH).
|
||||
*
|
||||
* Window size thresholds are defined for cache line sizes of 32 and 64,
|
||||
* cache line sizes where log_2(32)=5 and log_2(64)=6 respectively. A
|
||||
* window size of 7 should only be used on processors that have a 128
|
||||
* byte or greater cache line size.
|
||||
*/
|
||||
#if MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 64
|
||||
|
||||
# define BN_window_bits_for_ctime_exponent_size(b) \
|
||||
((b) > 937 ? 6 : \
|
||||
(b) > 306 ? 5 : \
|
||||
(b) > 89 ? 4 : \
|
||||
(b) > 22 ? 3 : 1)
|
||||
# define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (6)
|
||||
|
||||
#elif MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 32
|
||||
|
||||
# define BN_window_bits_for_ctime_exponent_size(b) \
|
||||
((b) > 306 ? 5 : \
|
||||
(b) > 89 ? 4 : \
|
||||
(b) > 22 ? 3 : 1)
|
||||
# define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (5)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Pentium pro 16,16,16,32,64 */
|
||||
/* Alpha 16,16,16,16.64 */
|
||||
#define BN_MULL_SIZE_NORMAL (16) /* 32 */
|
||||
|
@@ -347,3 +347,23 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
|
||||
return(to);
|
||||
}
|
||||
|
||||
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
|
||||
const BIGNUM *mod, BN_CTX *ctx)
|
||||
{
|
||||
if (*pmont)
|
||||
return *pmont;
|
||||
CRYPTO_w_lock(lock);
|
||||
if (!*pmont)
|
||||
{
|
||||
*pmont = BN_MONT_CTX_new();
|
||||
if (*pmont && !BN_MONT_CTX_set(*pmont, mod, ctx))
|
||||
{
|
||||
BN_MONT_CTX_free(*pmont);
|
||||
*pmont = NULL;
|
||||
}
|
||||
}
|
||||
CRYPTO_w_unlock(lock);
|
||||
return *pmont;
|
||||
}
|
||||
|
||||
|
||||
|
282
crypto/bn/bn_x931p.c
Normal file
282
crypto/bn/bn_x931p.c
Normal file
@@ -0,0 +1,282 @@
|
||||
/* bn_x931p.c */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
* project 2005.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2005 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
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
|
||||
/* X9.31 routines for prime derivation */
|
||||
|
||||
|
||||
/* X9.31 prime derivation. This is used to generate the primes pi
|
||||
* (p1, p2, q1, q2) from a parameter Xpi by checking successive odd
|
||||
* integers.
|
||||
*/
|
||||
|
||||
static int bn_x931_derive_pi(BIGNUM *pi, const BIGNUM *Xpi, BN_CTX *ctx,
|
||||
void (*cb)(int, int, void *), void *cb_arg)
|
||||
{
|
||||
int i = 0;
|
||||
if (!BN_copy(pi, Xpi))
|
||||
return 0;
|
||||
if (!BN_is_odd(pi) && !BN_add_word(pi, 1))
|
||||
return 0;
|
||||
for(;;)
|
||||
{
|
||||
i++;
|
||||
if (cb)
|
||||
cb(0, i, cb_arg);
|
||||
/* NB 27 MR is specificed in X9.31 */
|
||||
if (BN_is_prime_fasttest(pi, 27, cb, ctx, cb_arg, 1))
|
||||
break;
|
||||
if (!BN_add_word(pi, 2))
|
||||
return 0;
|
||||
}
|
||||
if (cb)
|
||||
cb(2, i, cb_arg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This is the main X9.31 prime derivation function. From parameters
|
||||
* Xp1, Xp2 and Xp derive the prime p. If the parameters p1 or p2 are
|
||||
* not NULL they will be returned too: this is needed for testing.
|
||||
*/
|
||||
|
||||
int BN_X931_derive_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
void (*cb)(int, int, void *), void *cb_arg,
|
||||
const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
|
||||
const BIGNUM *e, BN_CTX *ctx)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
BIGNUM *t, *p1p2, *pm1;
|
||||
|
||||
/* Only even e supported */
|
||||
if (!BN_is_odd(e))
|
||||
return 0;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
if (!p1)
|
||||
p1 = BN_CTX_get(ctx);
|
||||
|
||||
if (!p2)
|
||||
p2 = BN_CTX_get(ctx);
|
||||
|
||||
t = BN_CTX_get(ctx);
|
||||
|
||||
p1p2 = BN_CTX_get(ctx);
|
||||
|
||||
pm1 = BN_CTX_get(ctx);
|
||||
|
||||
if (!bn_x931_derive_pi(p1, Xp1, ctx, cb, cb_arg))
|
||||
goto err;
|
||||
|
||||
if (!bn_x931_derive_pi(p2, Xp2, ctx, cb, cb_arg))
|
||||
goto err;
|
||||
|
||||
if (!BN_mul(p1p2, p1, p2, ctx))
|
||||
goto err;
|
||||
|
||||
/* First set p to value of Rp */
|
||||
|
||||
if (!BN_mod_inverse(p, p2, p1, ctx))
|
||||
goto err;
|
||||
|
||||
if (!BN_mul(p, p, p2, ctx))
|
||||
goto err;
|
||||
|
||||
if (!BN_mod_inverse(t, p1, p2, ctx))
|
||||
goto err;
|
||||
|
||||
if (!BN_mul(t, t, p1, ctx))
|
||||
goto err;
|
||||
|
||||
if (!BN_sub(p, p, t))
|
||||
goto err;
|
||||
|
||||
if (p->neg && !BN_add(p, p, p1p2))
|
||||
goto err;
|
||||
|
||||
/* p now equals Rp */
|
||||
|
||||
if (!BN_mod_sub(p, p, Xp, p1p2, ctx))
|
||||
goto err;
|
||||
|
||||
if (!BN_add(p, p, Xp))
|
||||
goto err;
|
||||
|
||||
/* p now equals Yp0 */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int i = 1;
|
||||
if (cb)
|
||||
cb(0, i++, cb_arg);
|
||||
if (!BN_copy(pm1, p))
|
||||
goto err;
|
||||
if (!BN_sub_word(pm1, 1))
|
||||
goto err;
|
||||
if (!BN_gcd(t, pm1, e, ctx))
|
||||
goto err;
|
||||
if (BN_is_one(t)
|
||||
/* X9.31 specifies 8 MR and 1 Lucas test or any prime test
|
||||
* offering similar or better guarantees 50 MR is considerably
|
||||
* better.
|
||||
*/
|
||||
&& BN_is_prime_fasttest(p, 50, cb, ctx, cb_arg, 1))
|
||||
break;
|
||||
if (!BN_add(p, p, p1p2))
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (cb)
|
||||
cb(3, 0, cb_arg);
|
||||
|
||||
ret = 1;
|
||||
|
||||
err:
|
||||
|
||||
BN_CTX_end(ctx);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Generate pair of paramters Xp, Xq for X9.31 prime generation.
|
||||
* Note: nbits paramter is sum of number of bits in both.
|
||||
*/
|
||||
|
||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
|
||||
{
|
||||
BIGNUM *t;
|
||||
int i;
|
||||
/* Number of bits for each prime is of the form
|
||||
* 512+128s for s = 0, 1, ...
|
||||
*/
|
||||
if ((nbits < 1024) || (nbits & 0xff))
|
||||
return 0;
|
||||
nbits >>= 1;
|
||||
/* The random value Xp must be between sqrt(2) * 2^(nbits-1) and
|
||||
* 2^nbits - 1. By setting the top two bits we ensure that the lower
|
||||
* bound is exceeded.
|
||||
*/
|
||||
if (!BN_rand(Xp, nbits, 1, 0))
|
||||
return 0;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
t = BN_CTX_get(ctx);
|
||||
|
||||
for (i = 0; i < 1000; i++)
|
||||
{
|
||||
if (!BN_rand(Xq, nbits, 1, 0))
|
||||
return 0;
|
||||
/* Check that |Xp - Xq| > 2^(nbits - 100) */
|
||||
BN_sub(t, Xp, Xq);
|
||||
if (BN_num_bits(t) > (nbits - 100))
|
||||
break;
|
||||
}
|
||||
|
||||
BN_CTX_end(ctx);
|
||||
|
||||
if (i < 1000)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/* Generate primes using X9.31 algorithm. Of the values p, p1, p2, Xp1
|
||||
* and Xp2 only 'p' needs to be non-NULL. If any of the others are not NULL
|
||||
* the relevant parameter will be stored in it.
|
||||
*
|
||||
* Due to the fact that |Xp - Xq| > 2^(nbits - 100) must be satisfied Xp and Xq
|
||||
* are generated using the previous function and supplied as input.
|
||||
*/
|
||||
|
||||
int BN_X931_generate_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
BIGNUM *Xp1, BIGNUM *Xp2,
|
||||
const BIGNUM *Xp,
|
||||
const BIGNUM *e, BN_CTX *ctx,
|
||||
void (*cb)(int, int, void *), void *cb_arg)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
if (!Xp1)
|
||||
Xp1 = BN_CTX_get(ctx);
|
||||
if (!Xp2)
|
||||
Xp2 = BN_CTX_get(ctx);
|
||||
|
||||
if (!BN_rand(Xp1, 101, 0, 0))
|
||||
goto error;
|
||||
if (!BN_rand(Xp2, 101, 0, 0))
|
||||
goto error;
|
||||
if (!BN_X931_derive_prime(p, p1, p2, cb, cb_arg,
|
||||
Xp, Xp1, Xp2, e, ctx))
|
||||
goto error;
|
||||
|
||||
ret = 1;
|
||||
|
||||
error:
|
||||
BN_CTX_end(ctx);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -86,6 +86,7 @@ int test_mont(BIO *bp,BN_CTX *ctx);
|
||||
int test_mod(BIO *bp,BN_CTX *ctx);
|
||||
int test_mod_mul(BIO *bp,BN_CTX *ctx);
|
||||
int test_mod_exp(BIO *bp,BN_CTX *ctx);
|
||||
int test_mod_exp_mont_consttime(BIO *bp,BN_CTX *ctx);
|
||||
int test_exp(BIO *bp,BN_CTX *ctx);
|
||||
int test_kron(BIO *bp,BN_CTX *ctx);
|
||||
int test_sqrt(BIO *bp,BN_CTX *ctx);
|
||||
@@ -213,6 +214,10 @@ int main(int argc, char *argv[])
|
||||
if (!test_mod_exp(out,ctx)) goto err;
|
||||
BIO_flush(out);
|
||||
|
||||
message(out,"BN_mod_exp_mont_consttime");
|
||||
if (!test_mod_exp_mont_consttime(out,ctx)) goto err;
|
||||
BIO_flush(out);
|
||||
|
||||
message(out,"BN_exp");
|
||||
if (!test_exp(out,ctx)) goto err;
|
||||
BIO_flush(out);
|
||||
@@ -813,6 +818,57 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
|
||||
return(1);
|
||||
}
|
||||
|
||||
int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
|
||||
{
|
||||
BIGNUM *a,*b,*c,*d,*e;
|
||||
int i;
|
||||
|
||||
a=BN_new();
|
||||
b=BN_new();
|
||||
c=BN_new();
|
||||
d=BN_new();
|
||||
e=BN_new();
|
||||
|
||||
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); /**/
|
||||
BN_bntest_rand(b,2+i,0,0); /**/
|
||||
|
||||
if (!BN_mod_exp_mont_consttime(d,a,b,c,ctx,NULL))
|
||||
return(00);
|
||||
|
||||
if (bp != NULL)
|
||||
{
|
||||
if (!results)
|
||||
{
|
||||
BN_print(bp,a);
|
||||
BIO_puts(bp," ^ ");
|
||||
BN_print(bp,b);
|
||||
BIO_puts(bp," % ");
|
||||
BN_print(bp,c);
|
||||
BIO_puts(bp," - ");
|
||||
}
|
||||
BN_print(bp,d);
|
||||
BIO_puts(bp,"\n");
|
||||
}
|
||||
BN_exp(e,a,b,ctx);
|
||||
BN_sub(e,e,d);
|
||||
BN_div(a,b,e,c,ctx);
|
||||
if(!BN_is_zero(b))
|
||||
{
|
||||
fprintf(stderr,"Modulo exponentiation test failed!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
BN_free(a);
|
||||
BN_free(b);
|
||||
BN_free(c);
|
||||
BN_free(d);
|
||||
BN_free(e);
|
||||
return(1);
|
||||
}
|
||||
|
||||
int test_exp(BIO *bp, BN_CTX *ctx)
|
||||
{
|
||||
BIGNUM *a,*b,*d,*e,*one;
|
||||
|
@@ -321,7 +321,7 @@ void do_mul_exp(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *c, BN_CTX *ctx)
|
||||
#else /* TEST_SQRT */
|
||||
"2*sqrt [prime == %d (mod 64)] %4d %4d mod %4d"
|
||||
#endif
|
||||
" -> %8.3fms %5.1f (%ld)\n",
|
||||
" -> %8.6fms %5.1f (%ld)\n",
|
||||
#ifdef TEST_SQRT
|
||||
P_MOD_64,
|
||||
#endif
|
||||
|
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
||||
BIO *out=NULL;
|
||||
int i,ret;
|
||||
unsigned char c;
|
||||
BIGNUM *r_mont,*r_recp,*r_simple,*a,*b,*m;
|
||||
BIGNUM *r_mont,*r_mont_const,*r_recp,*r_simple,*a,*b,*m;
|
||||
|
||||
RAND_seed(rnd_seed, sizeof rnd_seed); /* or BN_rand may fail, and we don't
|
||||
* even check its return value
|
||||
@@ -88,6 +88,7 @@ int main(int argc, char *argv[])
|
||||
ctx=BN_CTX_new();
|
||||
if (ctx == NULL) EXIT(1);
|
||||
r_mont=BN_new();
|
||||
r_mont_const=BN_new();
|
||||
r_recp=BN_new();
|
||||
r_simple=BN_new();
|
||||
a=BN_new();
|
||||
@@ -143,8 +144,17 @@ int main(int argc, char *argv[])
|
||||
EXIT(1);
|
||||
}
|
||||
|
||||
ret=BN_mod_exp_mont_consttime(r_mont_const,a,b,m,ctx,NULL);
|
||||
if (ret <= 0)
|
||||
{
|
||||
printf("BN_mod_exp_mont_consttime() problems\n");
|
||||
ERR_print_errors(out);
|
||||
EXIT(1);
|
||||
}
|
||||
|
||||
if (BN_cmp(r_simple, r_mont) == 0
|
||||
&& BN_cmp(r_simple,r_recp) == 0)
|
||||
&& BN_cmp(r_simple,r_recp) == 0
|
||||
&& BN_cmp(r_simple,r_mont_const) == 0)
|
||||
{
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
@@ -153,6 +163,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (BN_cmp(r_simple,r_mont) != 0)
|
||||
printf("\nsimple and mont results differ\n");
|
||||
if (BN_cmp(r_simple,r_mont) != 0)
|
||||
printf("\nsimple and mont const time results differ\n");
|
||||
if (BN_cmp(r_simple,r_recp) != 0)
|
||||
printf("\nsimple and recp results differ\n");
|
||||
|
||||
@@ -162,11 +174,13 @@ int main(int argc, char *argv[])
|
||||
printf("\nsimple ="); BN_print(out,r_simple);
|
||||
printf("\nrecp ="); BN_print(out,r_recp);
|
||||
printf("\nmont ="); BN_print(out,r_mont);
|
||||
printf("\nmont_ct ="); BN_print(out,r_mont_const);
|
||||
printf("\n");
|
||||
EXIT(1);
|
||||
}
|
||||
}
|
||||
BN_free(r_mont);
|
||||
BN_free(r_mont_const);
|
||||
BN_free(r_recp);
|
||||
BN_free(r_simple);
|
||||
BN_free(a);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/buffer/Makefile
|
||||
# OpenSSL/crypto/buffer/Makefile
|
||||
#
|
||||
|
||||
DIR= buffer
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/buffer/buf_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,11 +64,15 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_BUF,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_BUF,0,reason)
|
||||
|
||||
static ERR_STRING_DATA BUF_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,BUF_F_BUF_MEM_GROW,0), "BUF_MEM_grow"},
|
||||
{ERR_PACK(0,BUF_F_BUF_MEM_NEW,0), "BUF_MEM_new"},
|
||||
{ERR_PACK(0,BUF_F_BUF_STRDUP,0), "BUF_strdup"},
|
||||
{ERR_FUNC(BUF_F_BUF_MEM_GROW), "BUF_MEM_grow"},
|
||||
{ERR_FUNC(BUF_F_BUF_MEM_NEW), "BUF_MEM_new"},
|
||||
{ERR_FUNC(BUF_F_BUF_STRDUP), "BUF_strdup"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -87,8 +91,8 @@ void ERR_load_BUF_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_BUF,BUF_str_functs);
|
||||
ERR_load_strings(ERR_LIB_BUF,BUF_str_reasons);
|
||||
ERR_load_strings(0,BUF_str_functs);
|
||||
ERR_load_strings(0,BUF_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/cast/Makefile
|
||||
# OpenSSL/crypto/cast/Makefile
|
||||
#
|
||||
|
||||
DIR= cast
|
||||
@@ -115,6 +115,7 @@ c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
|
||||
c_ofb64.o: c_ofb64.c cast_lcl.h
|
||||
c_skey.o: ../../e_os.h ../../include/openssl/cast.h
|
||||
c_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
c_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
c_skey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
c_skey.o: ../../include/openssl/symhacks.h c_skey.c cast_lcl.h cast_s.h
|
||||
c_skey.o: ../../include/openssl/fips.h ../../include/openssl/opensslconf.h
|
||||
c_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
c_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
c_skey.o: c_skey.c cast_lcl.h cast_s.h
|
||||
|
@@ -57,6 +57,7 @@
|
||||
*/
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/fips.h>
|
||||
#include <openssl/cast.h>
|
||||
|
||||
#include "cast_lcl.h"
|
||||
|
@@ -64,11 +64,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
||||
# undef OPENSSL_EXTERN
|
||||
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
||||
#endif
|
||||
|
||||
#undef c2l
|
||||
#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
|
||||
l|=((unsigned long)(*((c)++)))<< 8L, \
|
||||
@@ -222,11 +217,11 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table0[256];
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table1[256];
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table2[256];
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table3[256];
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table4[256];
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table5[256];
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table6[256];
|
||||
OPENSSL_EXTERN const CAST_LONG CAST_S_table7[256];
|
||||
extern const CAST_LONG CAST_S_table0[256];
|
||||
extern const CAST_LONG CAST_S_table1[256];
|
||||
extern const CAST_LONG CAST_S_table2[256];
|
||||
extern const CAST_LONG CAST_S_table3[256];
|
||||
extern const CAST_LONG CAST_S_table4[256];
|
||||
extern const CAST_LONG CAST_S_table5[256];
|
||||
extern const CAST_LONG CAST_S_table6[256];
|
||||
extern const CAST_LONG CAST_S_table7[256];
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/comp/Makefile
|
||||
# OpenSSL/crypto/comp/Makefile
|
||||
#
|
||||
|
||||
DIR= comp
|
||||
|
@@ -51,30 +51,17 @@ static COMP_METHOD zlib_method={
|
||||
*/
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
|
||||
# include <windows.h>
|
||||
|
||||
# define Z_CALLCONV _stdcall
|
||||
# define ZLIB_SHARED
|
||||
#else
|
||||
# define Z_CALLCONV
|
||||
#endif /* !(OPENSSL_SYS_WINDOWS || OPENSSL_SYS_WIN32) */
|
||||
|
||||
#ifdef ZLIB_SHARED
|
||||
#include <openssl/dso.h>
|
||||
|
||||
/* Prototypes for built in stubs */
|
||||
static int stub_compress(Bytef *dest,uLongf *destLen,
|
||||
const Bytef *source, uLong sourceLen);
|
||||
static int stub_inflateEnd(z_streamp strm);
|
||||
static int stub_inflate(z_streamp strm, int flush);
|
||||
static int stub_inflateInit_(z_streamp strm, const char * version,
|
||||
int stream_size);
|
||||
|
||||
/* Function pointers */
|
||||
typedef int (Z_CALLCONV *compress_ft)(Bytef *dest,uLongf *destLen,
|
||||
typedef int (*compress_ft)(Bytef *dest,uLongf *destLen,
|
||||
const Bytef *source, uLong sourceLen);
|
||||
typedef int (Z_CALLCONV *inflateEnd_ft)(z_streamp strm);
|
||||
typedef int (Z_CALLCONV *inflate_ft)(z_streamp strm, int flush);
|
||||
typedef int (Z_CALLCONV *inflateInit__ft)(z_streamp strm,
|
||||
typedef int (*inflateEnd_ft)(z_streamp strm);
|
||||
typedef int (*inflate_ft)(z_streamp strm, int flush);
|
||||
typedef int (*inflateInit__ft)(z_streamp strm,
|
||||
const char * version, int stream_size);
|
||||
static compress_ft p_compress=NULL;
|
||||
static inflateEnd_ft p_inflateEnd=NULL;
|
||||
@@ -84,10 +71,10 @@ static inflateInit__ft p_inflateInit_=NULL;
|
||||
static int zlib_loaded = 0; /* only attempt to init func pts once */
|
||||
static DSO *zlib_dso = NULL;
|
||||
|
||||
#define compress stub_compress
|
||||
#define inflateEnd stub_inflateEnd
|
||||
#define inflate stub_inflate
|
||||
#define inflateInit_ stub_inflateInit_
|
||||
#define compress p_compress
|
||||
#define inflateEnd p_inflateEnd
|
||||
#define inflate p_inflate
|
||||
#define inflateInit_ p_inflateInit_
|
||||
#endif /* ZLIB_SHARED */
|
||||
|
||||
static int zlib_compress_block(COMP_CTX *ctx, unsigned char *out,
|
||||
@@ -191,16 +178,6 @@ COMP_METHOD *COMP_zlib(void)
|
||||
{
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
|
||||
zlib_dso = DSO_load(NULL, "ZLIB1", NULL, 0);
|
||||
if (!zlib_dso)
|
||||
{
|
||||
zlib_dso = DSO_load(NULL, "ZLIB", NULL, 0);
|
||||
if (zlib_dso)
|
||||
{
|
||||
/* Clear the errors from the first failed
|
||||
DSO_load() */
|
||||
ERR_clear_error();
|
||||
}
|
||||
}
|
||||
#else
|
||||
zlib_dso = DSO_load(NULL, "z", NULL, 0);
|
||||
#endif
|
||||
@@ -218,54 +195,21 @@ COMP_METHOD *COMP_zlib(void)
|
||||
p_inflateInit_
|
||||
= (inflateInit__ft) DSO_bind_func(zlib_dso,
|
||||
"inflateInit_");
|
||||
zlib_loaded++;
|
||||
|
||||
if (p_compress && p_inflateEnd && p_inflate
|
||||
&& p_inflateInit_)
|
||||
zlib_loaded++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef ZLIB_SHARED
|
||||
if (zlib_loaded)
|
||||
#endif
|
||||
#if defined(ZLIB) || defined(ZLIB_SHARED)
|
||||
meth = &zlib_method;
|
||||
meth = &zlib_method;
|
||||
#endif
|
||||
|
||||
return(meth);
|
||||
}
|
||||
|
||||
#ifdef ZLIB_SHARED
|
||||
/* Stubs for each function to be dynamicly loaded */
|
||||
static int
|
||||
stub_compress(Bytef *dest,uLongf *destLen,const Bytef *source, uLong sourceLen)
|
||||
{
|
||||
if (p_compress)
|
||||
return(p_compress(dest,destLen,source,sourceLen));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
static int
|
||||
stub_inflateEnd(z_streamp strm)
|
||||
{
|
||||
if ( p_inflateEnd )
|
||||
return(p_inflateEnd(strm));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
static int
|
||||
stub_inflate(z_streamp strm, int flush)
|
||||
{
|
||||
if ( p_inflate )
|
||||
return(p_inflate(strm,flush));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
static int
|
||||
stub_inflateInit_(z_streamp strm, const char * version, int stream_size)
|
||||
{
|
||||
if ( p_inflateInit_ )
|
||||
return(p_inflateInit_(strm,version,stream_size));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
#endif /* ZLIB_SHARED */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/conf/Makefile
|
||||
# OpenSSL/crypto/conf/Makefile
|
||||
#
|
||||
|
||||
DIR= conf
|
||||
|
@@ -613,13 +613,13 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
|
||||
e++;
|
||||
}
|
||||
/* So at this point we have
|
||||
* ns which is the start of the name string which is
|
||||
* np which is the start of the name string which is
|
||||
* '\0' terminated.
|
||||
* cs which is the start of the section string which is
|
||||
* cp which is the start of the section string which is
|
||||
* '\0' terminated.
|
||||
* e is the 'next point after'.
|
||||
* r and s are the chars replaced by the '\0'
|
||||
* rp and sp is where 'r' and 's' came from.
|
||||
* r and rr are the chars replaced by the '\0'
|
||||
* rp and rrp is where 'r' and 'rr' came from.
|
||||
*/
|
||||
p=_CONF_get_string(conf,cp,np);
|
||||
if (rrp != NULL) *rrp=rr;
|
||||
@@ -638,6 +638,11 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
|
||||
points at. /RL */
|
||||
len -= e-from;
|
||||
from=e;
|
||||
|
||||
/* In case there were no braces or parenthesis around
|
||||
the variable reference, we have to put back the
|
||||
character that was replaced with a '\0'. /RL */
|
||||
*rp = r;
|
||||
}
|
||||
else
|
||||
buf->data[to++]= *(from++);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/conf/conf_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,47 +64,51 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_CONF,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_CONF,0,reason)
|
||||
|
||||
static ERR_STRING_DATA CONF_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,CONF_F_CONF_DUMP_FP,0), "CONF_dump_fp"},
|
||||
{ERR_PACK(0,CONF_F_CONF_LOAD,0), "CONF_load"},
|
||||
{ERR_PACK(0,CONF_F_CONF_LOAD_BIO,0), "CONF_load_bio"},
|
||||
{ERR_PACK(0,CONF_F_CONF_LOAD_FP,0), "CONF_load_fp"},
|
||||
{ERR_PACK(0,CONF_F_CONF_MODULES_LOAD,0), "CONF_modules_load"},
|
||||
{ERR_PACK(0,CONF_F_MODULE_INIT,0), "MODULE_INIT"},
|
||||
{ERR_PACK(0,CONF_F_MODULE_LOAD_DSO,0), "MODULE_LOAD_DSO"},
|
||||
{ERR_PACK(0,CONF_F_MODULE_RUN,0), "MODULE_RUN"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_DUMP_BIO,0), "NCONF_dump_bio"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_DUMP_FP,0), "NCONF_dump_fp"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_GET_NUMBER,0), "NCONF_get_number"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_GET_NUMBER_E,0), "NCONF_get_number_e"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_GET_SECTION,0), "NCONF_get_section"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_GET_STRING,0), "NCONF_get_string"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_LOAD,0), "NCONF_load"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_LOAD_BIO,0), "NCONF_load_bio"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_LOAD_FP,0), "NCONF_load_fp"},
|
||||
{ERR_PACK(0,CONF_F_NCONF_NEW,0), "NCONF_new"},
|
||||
{ERR_PACK(0,CONF_F_STR_COPY,0), "STR_COPY"},
|
||||
{ERR_FUNC(CONF_F_CONF_DUMP_FP), "CONF_dump_fp"},
|
||||
{ERR_FUNC(CONF_F_CONF_LOAD), "CONF_load"},
|
||||
{ERR_FUNC(CONF_F_CONF_LOAD_BIO), "CONF_load_bio"},
|
||||
{ERR_FUNC(CONF_F_CONF_LOAD_FP), "CONF_load_fp"},
|
||||
{ERR_FUNC(CONF_F_CONF_MODULES_LOAD), "CONF_modules_load"},
|
||||
{ERR_FUNC(CONF_F_MODULE_INIT), "MODULE_INIT"},
|
||||
{ERR_FUNC(CONF_F_MODULE_LOAD_DSO), "MODULE_LOAD_DSO"},
|
||||
{ERR_FUNC(CONF_F_MODULE_RUN), "MODULE_RUN"},
|
||||
{ERR_FUNC(CONF_F_NCONF_DUMP_BIO), "NCONF_dump_bio"},
|
||||
{ERR_FUNC(CONF_F_NCONF_DUMP_FP), "NCONF_dump_fp"},
|
||||
{ERR_FUNC(CONF_F_NCONF_GET_NUMBER), "NCONF_get_number"},
|
||||
{ERR_FUNC(CONF_F_NCONF_GET_NUMBER_E), "NCONF_get_number_e"},
|
||||
{ERR_FUNC(CONF_F_NCONF_GET_SECTION), "NCONF_get_section"},
|
||||
{ERR_FUNC(CONF_F_NCONF_GET_STRING), "NCONF_get_string"},
|
||||
{ERR_FUNC(CONF_F_NCONF_LOAD), "NCONF_load"},
|
||||
{ERR_FUNC(CONF_F_NCONF_LOAD_BIO), "NCONF_load_bio"},
|
||||
{ERR_FUNC(CONF_F_NCONF_LOAD_FP), "NCONF_load_fp"},
|
||||
{ERR_FUNC(CONF_F_NCONF_NEW), "NCONF_new"},
|
||||
{ERR_FUNC(CONF_F_STR_COPY), "STR_COPY"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA CONF_str_reasons[]=
|
||||
{
|
||||
{CONF_R_ERROR_LOADING_DSO ,"error loading dso"},
|
||||
{CONF_R_MISSING_CLOSE_SQUARE_BRACKET ,"missing close square bracket"},
|
||||
{CONF_R_MISSING_EQUAL_SIGN ,"missing equal sign"},
|
||||
{CONF_R_MISSING_FINISH_FUNCTION ,"missing finish function"},
|
||||
{CONF_R_MISSING_INIT_FUNCTION ,"missing init function"},
|
||||
{CONF_R_MODULE_INITIALIZATION_ERROR ,"module initialization error"},
|
||||
{CONF_R_NO_CLOSE_BRACE ,"no close brace"},
|
||||
{CONF_R_NO_CONF ,"no conf"},
|
||||
{CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE ,"no conf or environment variable"},
|
||||
{CONF_R_NO_SECTION ,"no section"},
|
||||
{CONF_R_NO_SUCH_FILE ,"no such file"},
|
||||
{CONF_R_NO_VALUE ,"no value"},
|
||||
{CONF_R_UNABLE_TO_CREATE_NEW_SECTION ,"unable to create new section"},
|
||||
{CONF_R_UNKNOWN_MODULE_NAME ,"unknown module name"},
|
||||
{CONF_R_VARIABLE_HAS_NO_VALUE ,"variable has no value"},
|
||||
{ERR_REASON(CONF_R_ERROR_LOADING_DSO) ,"error loading dso"},
|
||||
{ERR_REASON(CONF_R_MISSING_CLOSE_SQUARE_BRACKET),"missing close square bracket"},
|
||||
{ERR_REASON(CONF_R_MISSING_EQUAL_SIGN) ,"missing equal sign"},
|
||||
{ERR_REASON(CONF_R_MISSING_FINISH_FUNCTION),"missing finish function"},
|
||||
{ERR_REASON(CONF_R_MISSING_INIT_FUNCTION),"missing init function"},
|
||||
{ERR_REASON(CONF_R_MODULE_INITIALIZATION_ERROR),"module initialization error"},
|
||||
{ERR_REASON(CONF_R_NO_CLOSE_BRACE) ,"no close brace"},
|
||||
{ERR_REASON(CONF_R_NO_CONF) ,"no conf"},
|
||||
{ERR_REASON(CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE),"no conf or environment variable"},
|
||||
{ERR_REASON(CONF_R_NO_SECTION) ,"no section"},
|
||||
{ERR_REASON(CONF_R_NO_SUCH_FILE) ,"no such file"},
|
||||
{ERR_REASON(CONF_R_NO_VALUE) ,"no value"},
|
||||
{ERR_REASON(CONF_R_UNABLE_TO_CREATE_NEW_SECTION),"unable to create new section"},
|
||||
{ERR_REASON(CONF_R_UNKNOWN_MODULE_NAME) ,"unknown module name"},
|
||||
{ERR_REASON(CONF_R_VARIABLE_HAS_NO_VALUE),"variable has no value"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -118,8 +122,8 @@ void ERR_load_CONF_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_CONF,CONF_str_functs);
|
||||
ERR_load_strings(ERR_LIB_CONF,CONF_str_reasons);
|
||||
ERR_load_strings(0,CONF_str_functs);
|
||||
ERR_load_strings(0,CONF_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/cpt_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,23 +64,27 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_CRYPTO,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_CRYPTO,0,reason)
|
||||
|
||||
static ERR_STRING_DATA CRYPTO_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,0), "CRYPTO_get_ex_new_index"},
|
||||
{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,0), "CRYPTO_get_new_dynlockid"},
|
||||
{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_NEW_LOCKID,0), "CRYPTO_get_new_lockid"},
|
||||
{ERR_PACK(0,CRYPTO_F_CRYPTO_SET_EX_DATA,0), "CRYPTO_set_ex_data"},
|
||||
{ERR_PACK(0,CRYPTO_F_DEF_ADD_INDEX,0), "DEF_ADD_INDEX"},
|
||||
{ERR_PACK(0,CRYPTO_F_DEF_GET_CLASS,0), "DEF_GET_CLASS"},
|
||||
{ERR_PACK(0,CRYPTO_F_INT_DUP_EX_DATA,0), "INT_DUP_EX_DATA"},
|
||||
{ERR_PACK(0,CRYPTO_F_INT_FREE_EX_DATA,0), "INT_FREE_EX_DATA"},
|
||||
{ERR_PACK(0,CRYPTO_F_INT_NEW_EX_DATA,0), "INT_NEW_EX_DATA"},
|
||||
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX), "CRYPTO_get_ex_new_index"},
|
||||
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID), "CRYPTO_get_new_dynlockid"},
|
||||
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_NEW_LOCKID), "CRYPTO_get_new_lockid"},
|
||||
{ERR_FUNC(CRYPTO_F_CRYPTO_SET_EX_DATA), "CRYPTO_set_ex_data"},
|
||||
{ERR_FUNC(CRYPTO_F_DEF_ADD_INDEX), "DEF_ADD_INDEX"},
|
||||
{ERR_FUNC(CRYPTO_F_DEF_GET_CLASS), "DEF_GET_CLASS"},
|
||||
{ERR_FUNC(CRYPTO_F_INT_DUP_EX_DATA), "INT_DUP_EX_DATA"},
|
||||
{ERR_FUNC(CRYPTO_F_INT_FREE_EX_DATA), "INT_FREE_EX_DATA"},
|
||||
{ERR_FUNC(CRYPTO_F_INT_NEW_EX_DATA), "INT_NEW_EX_DATA"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA CRYPTO_str_reasons[]=
|
||||
{
|
||||
{CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK ,"no dynlock create callback"},
|
||||
{ERR_REASON(CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK),"no dynlock create callback"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -94,8 +98,8 @@ void ERR_load_CRYPTO_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_CRYPTO,CRYPTO_str_functs);
|
||||
ERR_load_strings(ERR_LIB_CRYPTO,CRYPTO_str_reasons);
|
||||
ERR_load_strings(0,CRYPTO_str_functs);
|
||||
ERR_load_strings(0,CRYPTO_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -480,6 +480,8 @@ const char *CRYPTO_get_lock_name(int type)
|
||||
return(sk_value(app_locks,type-CRYPTO_NUM_LOCKS));
|
||||
}
|
||||
|
||||
int OPENSSL_NONPIC_relocated=0;
|
||||
|
||||
#if defined(_WIN32) && defined(_WINDLL)
|
||||
|
||||
/* All we really need to do is remove the 'error' state when a thread
|
||||
@@ -491,6 +493,21 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
|
||||
switch(fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
#if defined(_WIN32_WINNT)
|
||||
{
|
||||
IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hinstDLL;
|
||||
IMAGE_NT_HEADERS *nt_headers;
|
||||
|
||||
if (dos_header->e_magic==IMAGE_DOS_SIGNATURE)
|
||||
{
|
||||
nt_headers = (IMAGE_NT_HEADERS *)((char *)dos_header
|
||||
+ dos_header->e_lfanew);
|
||||
if (nt_headers->Signature==IMAGE_NT_SIGNATURE &&
|
||||
hinstDLL!=(HINSTANCE)(nt_headers->OptionalHeader.ImageBase))
|
||||
OPENSSL_NONPIC_relocated=1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
break;
|
||||
@@ -504,18 +521,160 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <tchar.h>
|
||||
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
|
||||
static int IsService(void)
|
||||
{ HWINSTA h;
|
||||
DWORD len;
|
||||
WCHAR *name;
|
||||
|
||||
(void)GetDesktopWindow(); /* return value is ignored */
|
||||
|
||||
h = GetProcessWindowStation();
|
||||
if (h==NULL) return -1;
|
||||
|
||||
if (GetUserObjectInformationW (h,UOI_NAME,NULL,0,&len) ||
|
||||
GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||
return -1;
|
||||
|
||||
if (len>512) return -1; /* paranoia */
|
||||
len++,len&=~1; /* paranoia */
|
||||
#ifdef _MSC_VER
|
||||
name=(WCHAR *)_alloca(len+sizeof(WCHAR));
|
||||
#else
|
||||
name=(WCHAR *)alloca(len+sizeof(WCHAR));
|
||||
#endif
|
||||
if (!GetUserObjectInformationW (h,UOI_NAME,name,len,&len))
|
||||
return -1;
|
||||
|
||||
len++,len&=~1; /* paranoia */
|
||||
name[len/sizeof(WCHAR)]=L'\0'; /* paranoia */
|
||||
#if 1
|
||||
/* This doesn't cover "interactive" services [working with real
|
||||
* WinSta0's] nor programs started non-interactively by Task
|
||||
* Scheduler [those are working with SAWinSta]. */
|
||||
if (wcsstr(name,L"Service-0x")) return 1;
|
||||
#else
|
||||
/* This covers all non-interactive programs such as services. */
|
||||
if (!wcsstr(name,L"WinSta0")) return 1;
|
||||
#endif
|
||||
else return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void OPENSSL_showfatal (const char *fmta,...)
|
||||
{ va_list ap;
|
||||
TCHAR buf[256];
|
||||
const TCHAR *fmt;
|
||||
HANDLE h;
|
||||
|
||||
if ((h=GetStdHandle(STD_ERROR_HANDLE)) != NULL &&
|
||||
GetFileType(h)!=FILE_TYPE_UNKNOWN)
|
||||
{ /* must be console application */
|
||||
va_start (ap,fmta);
|
||||
vfprintf (stderr,fmta,ap);
|
||||
va_end (ap);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sizeof(TCHAR)==sizeof(char))
|
||||
fmt=(const TCHAR *)fmta;
|
||||
else do
|
||||
{ int keepgoing;
|
||||
size_t len_0=strlen(fmta)+1,i;
|
||||
WCHAR *fmtw;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
fmtw = (WCHAR *)_alloca (len_0*sizeof(WCHAR));
|
||||
#else
|
||||
fmtw = (WCHAR *)alloca (len_0*sizeof(WCHAR));
|
||||
#endif
|
||||
if (fmtw == NULL) { fmt=(const TCHAR *)L"no stack?"; break; }
|
||||
|
||||
#ifndef OPENSSL_NO_MULTIBYTE
|
||||
if (!MultiByteToWideChar(CP_ACP,0,fmta,len_0,fmtw,len_0))
|
||||
#endif
|
||||
for (i=0;i<len_0;i++) fmtw[i]=(WCHAR)fmta[i];
|
||||
|
||||
for (i=0;i<len_0;i++)
|
||||
{ if (fmtw[i]==L'%') do
|
||||
{ keepgoing=0;
|
||||
switch (fmtw[i+1])
|
||||
{ case L'0': case L'1': case L'2': case L'3': case L'4':
|
||||
case L'5': case L'6': case L'7': case L'8': case L'9':
|
||||
case L'.': case L'*':
|
||||
case L'-': i++; keepgoing=1; break;
|
||||
case L's': fmtw[i+1]=L'S'; break;
|
||||
case L'S': fmtw[i+1]=L's'; break;
|
||||
case L'c': fmtw[i+1]=L'C'; break;
|
||||
case L'C': fmtw[i+1]=L'c'; break;
|
||||
}
|
||||
} while (keepgoing);
|
||||
}
|
||||
fmt = (const TCHAR *)fmtw;
|
||||
} while (0);
|
||||
|
||||
va_start (ap,fmta);
|
||||
_vsntprintf (buf,sizeof(buf)/sizeof(TCHAR)-1,fmt,ap);
|
||||
buf [sizeof(buf)/sizeof(TCHAR)-1] = _T('\0');
|
||||
va_end (ap);
|
||||
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
|
||||
/* this -------------v--- guards NT-specific calls */
|
||||
if (GetVersion() < 0x80000000 && IsService())
|
||||
{ HANDLE h = RegisterEventSource(0,_T("OPENSSL"));
|
||||
const TCHAR *pmsg=buf;
|
||||
ReportEvent(h,EVENTLOG_ERROR_TYPE,0,0,0,1,0,&pmsg,0);
|
||||
DeregisterEventSource(h);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ MSGBOXPARAMS m;
|
||||
|
||||
m.cbSize = sizeof(m);
|
||||
m.hwndOwner = NULL;
|
||||
m.lpszCaption = _T("OpenSSL: FATAL");
|
||||
m.dwStyle = MB_OK;
|
||||
m.hInstance = NULL;
|
||||
m.lpszIcon = IDI_ERROR;
|
||||
m.dwContextHelpId = 0;
|
||||
m.lpfnMsgBoxCallback = NULL;
|
||||
m.dwLanguageId = MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US);
|
||||
m.lpszText = buf;
|
||||
|
||||
MessageBoxIndirect (&m);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void OPENSSL_showfatal (const char *fmta,...)
|
||||
{ va_list ap;
|
||||
|
||||
va_start (ap,fmta);
|
||||
vfprintf (stderr,fmta,ap);
|
||||
va_end (ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
void OpenSSLDie(const char *file,int line,const char *assertion)
|
||||
{
|
||||
fprintf(stderr,
|
||||
OPENSSL_showfatal(
|
||||
"%s(%d): OpenSSL internal error, assertion failed: %s\n",
|
||||
file,line,assertion);
|
||||
abort();
|
||||
}
|
||||
|
||||
void *OPENSSL_stderr(void) { return stderr; }
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
|
||||
void fips_w_lock(void) { CRYPTO_w_lock(CRYPTO_LOCK_FIPS); }
|
||||
void fips_w_unlock(void) { CRYPTO_w_unlock(CRYPTO_LOCK_FIPS); }
|
||||
void fips_r_lock(void) { CRYPTO_r_lock(CRYPTO_LOCK_FIPS); }
|
||||
void fips_r_unlock(void) { CRYPTO_r_unlock(CRYPTO_LOCK_FIPS); }
|
||||
|
||||
static int fips_started = 0;
|
||||
static int fips_mode = 0;
|
||||
static void *fips_rand_check = 0;
|
||||
static unsigned long fips_thread = 0;
|
||||
|
||||
void fips_set_started(void)
|
||||
@@ -576,57 +735,10 @@ int fips_clear_owning_thread(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void fips_set_mode(int onoff)
|
||||
unsigned char *fips_signature_witness(void)
|
||||
{
|
||||
int owning_thread = fips_is_owning_thread();
|
||||
|
||||
if (fips_is_started())
|
||||
{
|
||||
if (!owning_thread) CRYPTO_w_lock(CRYPTO_LOCK_FIPS);
|
||||
fips_mode = onoff;
|
||||
if (!owning_thread) CRYPTO_w_unlock(CRYPTO_LOCK_FIPS);
|
||||
}
|
||||
extern unsigned char FIPS_signature[];
|
||||
return FIPS_signature;
|
||||
}
|
||||
|
||||
void fips_set_rand_check(void *rand_check)
|
||||
{
|
||||
int owning_thread = fips_is_owning_thread();
|
||||
|
||||
if (fips_is_started())
|
||||
{
|
||||
if (!owning_thread) CRYPTO_w_lock(CRYPTO_LOCK_FIPS);
|
||||
fips_rand_check = rand_check;
|
||||
if (!owning_thread) CRYPTO_w_unlock(CRYPTO_LOCK_FIPS);
|
||||
}
|
||||
}
|
||||
|
||||
int FIPS_mode(void)
|
||||
{
|
||||
int ret = 0;
|
||||
int owning_thread = fips_is_owning_thread();
|
||||
|
||||
if (fips_is_started())
|
||||
{
|
||||
if (!owning_thread) CRYPTO_r_lock(CRYPTO_LOCK_FIPS);
|
||||
ret = fips_mode;
|
||||
if (!owning_thread) CRYPTO_r_unlock(CRYPTO_LOCK_FIPS);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *FIPS_rand_check(void)
|
||||
{
|
||||
void *ret = 0;
|
||||
int owning_thread = fips_is_owning_thread();
|
||||
|
||||
if (fips_is_started())
|
||||
{
|
||||
if (!owning_thread) CRYPTO_r_lock(CRYPTO_LOCK_FIPS);
|
||||
ret = fips_rand_check;
|
||||
if (!owning_thread) CRYPTO_r_unlock(CRYPTO_LOCK_FIPS);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* OPENSSL_FIPS */
|
||||
|
||||
|
@@ -93,6 +93,10 @@ extern "C" {
|
||||
#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1)
|
||||
#define HEX_SIZE(type) (sizeof(type)*2)
|
||||
|
||||
void OPENSSL_showfatal(const char *,...);
|
||||
void *OPENSSL_stderr(void);
|
||||
extern int OPENSSL_NONPIC_relocated;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -184,10 +184,10 @@ $ IF F$TRNLNM("OPENSSL_NO_ASM").OR.ARCH.EQS."AXP" THEN LIB_BN_ASM = "bn_asm"
|
||||
$ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
|
||||
"bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
|
||||
"bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
|
||||
"bn_recp,bn_mont,bn_mpi,bn_exp2"
|
||||
"bn_recp,bn_mont,bn_mpi,bn_exp2,bn_x931p"
|
||||
$ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
|
||||
"rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
|
||||
"rsa_asn1"
|
||||
"rsa_pss,rsa_x931,rsa_asn1"
|
||||
$ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_recp,ecp_nist,ec_cvt,ec_mult,"+ -
|
||||
"ec_err"
|
||||
$ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl"
|
||||
@@ -265,10 +265,15 @@ $ LIB_KRB5 = "krb5_asn"
|
||||
$!
|
||||
$! Setup exceptional compilations
|
||||
$!
|
||||
$ ! Add definitions for no threads on OpenVMS 7.1 and higher
|
||||
$ COMPILEWITH_CC3 = ",bss_rtcp,"
|
||||
$ ! Disable the DOLLARID warning
|
||||
$ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,"
|
||||
$ ! Disable disjoint optimization
|
||||
$ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
|
||||
"sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
|
||||
$ ! Disable the MIXLINKAGE warning
|
||||
$ COMPILEWITH_CC6 = ",enc_read,set_key,"
|
||||
$!
|
||||
$! Figure Out What Other Modules We Are To Build.
|
||||
$!
|
||||
@@ -497,7 +502,12 @@ $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
|
||||
$ THEN
|
||||
$ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ ELSE
|
||||
$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6
|
||||
$ THEN
|
||||
$ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ ELSE
|
||||
$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ ENDIF
|
||||
$ ENDIF
|
||||
$ ENDIF
|
||||
$ ENDIF
|
||||
@@ -960,7 +970,7 @@ $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
|
||||
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
|
||||
$ CCEXTRAFLAGS = ""
|
||||
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
||||
$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX"
|
||||
$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
|
||||
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
|
||||
CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
|
||||
$!
|
||||
@@ -1077,14 +1087,18 @@ $ THEN
|
||||
$ IF CCDISABLEWARNINGS .EQS. ""
|
||||
$ THEN
|
||||
$ CC4DISABLEWARNINGS = "DOLLARID"
|
||||
$ CC6DISABLEWARNINGS = "MIXLINKAGE"
|
||||
$ ELSE
|
||||
$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
|
||||
$ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE"
|
||||
$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
|
||||
$ ENDIF
|
||||
$ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
|
||||
$ CC6DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))"
|
||||
$ ELSE
|
||||
$ CCDISABLEWARNINGS = ""
|
||||
$ CC4DISABLEWARNINGS = ""
|
||||
$ CC6DISABLEWARNINGS = ""
|
||||
$ ENDIF
|
||||
$ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
|
||||
$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
|
||||
@@ -1095,6 +1109,7 @@ $ ELSE
|
||||
$ CC5 = CC + "/NOOPTIMIZE"
|
||||
$ ENDIF
|
||||
$ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
|
||||
$ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS
|
||||
$!
|
||||
$! Show user the result
|
||||
$!
|
||||
|
@@ -434,12 +434,9 @@ void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb);
|
||||
|
||||
/* die if we have to */
|
||||
void OpenSSLDie(const char *file,int line,const char *assertion);
|
||||
#define OPENSSL_assert(e) ((e) ? (void)0 : OpenSSLDie(__FILE__, __LINE__, #e))
|
||||
#define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int FIPS_mode(void);
|
||||
void *FIPS_rand_check(void);
|
||||
|
||||
#define FIPS_ERROR_IGNORED(alg) OpenSSLDie(__FILE__, __LINE__, \
|
||||
alg " previous FIPS forbidden algorithm error ignored");
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/des/Makefile
|
||||
# OpenSSL/crypto/des/Makefile
|
||||
#
|
||||
|
||||
DIR= des
|
||||
|
@@ -421,7 +421,7 @@
|
||||
PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
|
||||
}
|
||||
|
||||
OPENSSL_EXTERN const DES_LONG DES_SPtrans[8][64];
|
||||
extern const DES_LONG DES_SPtrans[8][64];
|
||||
|
||||
void fcrypt_body(DES_LONG *out,DES_key_schedule *ks,
|
||||
DES_LONG Eswap0, DES_LONG Eswap1);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/dh/Makefile
|
||||
# OpenSSL/crypto/dh/Makefile
|
||||
#
|
||||
|
||||
DIR= dh
|
||||
|
@@ -70,7 +70,14 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/ossl_typ.h>
|
||||
|
||||
#define DH_FLAG_CACHE_MONT_P 0x01
|
||||
#define DH_FLAG_CACHE_MONT_P 0x01
|
||||
#define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH
|
||||
* implementation now uses constant time
|
||||
* modular exponentiation for secret exponents
|
||||
* by default. This flag causes the
|
||||
* faster variable sliding window method to
|
||||
* be used for all exponents.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/dh/dh_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,21 +64,25 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_DH,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_DH,0,reason)
|
||||
|
||||
static ERR_STRING_DATA DH_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,DH_F_DHPARAMS_PRINT,0), "DHparams_print"},
|
||||
{ERR_PACK(0,DH_F_DHPARAMS_PRINT_FP,0), "DHparams_print_fp"},
|
||||
{ERR_PACK(0,DH_F_DH_COMPUTE_KEY,0), "DH_compute_key"},
|
||||
{ERR_PACK(0,DH_F_DH_GENERATE_KEY,0), "DH_generate_key"},
|
||||
{ERR_PACK(0,DH_F_DH_GENERATE_PARAMETERS,0), "DH_generate_parameters"},
|
||||
{ERR_PACK(0,DH_F_DH_NEW_METHOD,0), "DH_new_method"},
|
||||
{ERR_FUNC(DH_F_DHPARAMS_PRINT), "DHparams_print"},
|
||||
{ERR_FUNC(DH_F_DHPARAMS_PRINT_FP), "DHparams_print_fp"},
|
||||
{ERR_FUNC(DH_F_DH_COMPUTE_KEY), "DH_compute_key"},
|
||||
{ERR_FUNC(DH_F_DH_GENERATE_KEY), "DH_generate_key"},
|
||||
{ERR_FUNC(DH_F_DH_GENERATE_PARAMETERS), "DH_generate_parameters"},
|
||||
{ERR_FUNC(DH_F_DH_NEW_METHOD), "DH_new_method"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA DH_str_reasons[]=
|
||||
{
|
||||
{DH_R_BAD_GENERATOR ,"bad generator"},
|
||||
{DH_R_NO_PRIVATE_VALUE ,"no private value"},
|
||||
{ERR_REASON(DH_R_BAD_GENERATOR) ,"bad generator"},
|
||||
{ERR_REASON(DH_R_NO_PRIVATE_VALUE) ,"no private value"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -92,8 +96,8 @@ void ERR_load_DH_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_DH,DH_str_functs);
|
||||
ERR_load_strings(ERR_LIB_DH,DH_str_reasons);
|
||||
ERR_load_strings(0,DH_str_functs);
|
||||
ERR_load_strings(0,DH_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ static int generate_key(DH *dh)
|
||||
int generate_new_key=0;
|
||||
unsigned l;
|
||||
BN_CTX *ctx;
|
||||
BN_MONT_CTX *mont;
|
||||
BN_MONT_CTX *mont=NULL;
|
||||
BIGNUM *pub_key=NULL,*priv_key=NULL;
|
||||
|
||||
ctx = BN_CTX_new();
|
||||
@@ -128,21 +128,37 @@ static int generate_key(DH *dh)
|
||||
else
|
||||
pub_key=dh->pub_key;
|
||||
|
||||
if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P))
|
||||
|
||||
if (dh->flags & DH_FLAG_CACHE_MONT_P)
|
||||
{
|
||||
if ((dh->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL)
|
||||
if (!BN_MONT_CTX_set((BN_MONT_CTX *)dh->method_mont_p,
|
||||
dh->p,ctx)) goto err;
|
||||
mont = BN_MONT_CTX_set_locked(
|
||||
(BN_MONT_CTX **)&dh->method_mont_p,
|
||||
CRYPTO_LOCK_DH, dh->p, ctx);
|
||||
if (!mont)
|
||||
goto err;
|
||||
}
|
||||
mont=(BN_MONT_CTX *)dh->method_mont_p;
|
||||
|
||||
if (generate_new_key)
|
||||
{
|
||||
l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
|
||||
if (!BN_rand(priv_key, l, 0, 0)) goto err;
|
||||
}
|
||||
if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, priv_key,dh->p,ctx,mont))
|
||||
goto err;
|
||||
|
||||
{
|
||||
BIGNUM local_prk;
|
||||
BIGNUM *prk;
|
||||
|
||||
if ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) == 0)
|
||||
{
|
||||
BN_init(&local_prk);
|
||||
prk = &local_prk;
|
||||
BN_with_flags(prk, priv_key, BN_FLG_EXP_CONSTTIME);
|
||||
}
|
||||
else
|
||||
prk = priv_key;
|
||||
|
||||
if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, prk, dh->p, ctx, mont)) goto err;
|
||||
}
|
||||
|
||||
dh->pub_key=pub_key;
|
||||
dh->priv_key=priv_key;
|
||||
@@ -160,7 +176,7 @@ err:
|
||||
static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
|
||||
{
|
||||
BN_CTX *ctx;
|
||||
BN_MONT_CTX *mont;
|
||||
BN_MONT_CTX *mont=NULL;
|
||||
BIGNUM *tmp;
|
||||
int ret= -1;
|
||||
|
||||
@@ -174,14 +190,21 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
|
||||
DHerr(DH_F_DH_COMPUTE_KEY,DH_R_NO_PRIVATE_VALUE);
|
||||
goto err;
|
||||
}
|
||||
if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P))
|
||||
|
||||
if (dh->flags & DH_FLAG_CACHE_MONT_P)
|
||||
{
|
||||
if ((dh->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL)
|
||||
if (!BN_MONT_CTX_set((BN_MONT_CTX *)dh->method_mont_p,
|
||||
dh->p,ctx)) goto err;
|
||||
mont = BN_MONT_CTX_set_locked(
|
||||
(BN_MONT_CTX **)&dh->method_mont_p,
|
||||
CRYPTO_LOCK_DH, dh->p, ctx);
|
||||
if ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) == 0)
|
||||
{
|
||||
/* XXX */
|
||||
BN_set_flags(dh->priv_key, BN_FLG_EXP_CONSTTIME);
|
||||
}
|
||||
if (!mont)
|
||||
goto err;
|
||||
}
|
||||
|
||||
mont=(BN_MONT_CTX *)dh->method_mont_p;
|
||||
if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont))
|
||||
{
|
||||
DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);
|
||||
@@ -200,7 +223,10 @@ static int dh_bn_mod_exp(const DH *dh, BIGNUM *r,
|
||||
const BIGNUM *m, BN_CTX *ctx,
|
||||
BN_MONT_CTX *m_ctx)
|
||||
{
|
||||
if (a->top == 1)
|
||||
/* If a is only one word long and constant time is false, use the faster
|
||||
* exponenentiation function.
|
||||
*/
|
||||
if (a->top == 1 && ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) != 0))
|
||||
{
|
||||
BN_ULONG A = a->d[0];
|
||||
return BN_mod_exp_mont_word(r,A,p,m,ctx,m_ctx);
|
||||
|
@@ -136,6 +136,10 @@ int main(int argc, char *argv[])
|
||||
b->g=BN_dup(a->g);
|
||||
if ((b->p == NULL) || (b->g == NULL)) goto err;
|
||||
|
||||
/* Set a to run with normal modexp and b to use constant time */
|
||||
a->flags &= ~DH_FLAG_NO_EXP_CONSTTIME;
|
||||
b->flags |= DH_FLAG_NO_EXP_CONSTTIME;
|
||||
|
||||
if (!DH_generate_key(a)) goto err;
|
||||
BIO_puts(out,"pri 1=");
|
||||
BN_print(out,a->priv_key);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/dsa/Makefile
|
||||
# OpenSSL/crypto/dsa/Makefile
|
||||
#
|
||||
|
||||
DIR= dsa
|
||||
|
@@ -80,6 +80,13 @@
|
||||
#endif
|
||||
|
||||
#define DSA_FLAG_CACHE_MONT_P 0x01
|
||||
#define DSA_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DSA
|
||||
* implementation now uses constant time
|
||||
* modular exponentiation for secret exponents
|
||||
* by default. This flag causes the
|
||||
* faster variable sliding window method to
|
||||
* be used for all exponents.
|
||||
*/
|
||||
|
||||
#if defined(OPENSSL_FIPS)
|
||||
#define FIPS_DSA_SIZE_T int
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/dsa/dsa_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,29 +64,33 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_DSA,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_DSA,0,reason)
|
||||
|
||||
static ERR_STRING_DATA DSA_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,DSA_F_D2I_DSA_SIG,0), "d2i_DSA_SIG"},
|
||||
{ERR_PACK(0,DSA_F_DSAPARAMS_PRINT,0), "DSAparams_print"},
|
||||
{ERR_PACK(0,DSA_F_DSAPARAMS_PRINT_FP,0), "DSAparams_print_fp"},
|
||||
{ERR_PACK(0,DSA_F_DSA_DO_SIGN,0), "DSA_do_sign"},
|
||||
{ERR_PACK(0,DSA_F_DSA_DO_VERIFY,0), "DSA_do_verify"},
|
||||
{ERR_PACK(0,DSA_F_DSA_NEW_METHOD,0), "DSA_new_method"},
|
||||
{ERR_PACK(0,DSA_F_DSA_PRINT,0), "DSA_print"},
|
||||
{ERR_PACK(0,DSA_F_DSA_PRINT_FP,0), "DSA_print_fp"},
|
||||
{ERR_PACK(0,DSA_F_DSA_SIGN,0), "DSA_sign"},
|
||||
{ERR_PACK(0,DSA_F_DSA_SIGN_SETUP,0), "DSA_sign_setup"},
|
||||
{ERR_PACK(0,DSA_F_DSA_SIG_NEW,0), "DSA_SIG_new"},
|
||||
{ERR_PACK(0,DSA_F_DSA_VERIFY,0), "DSA_verify"},
|
||||
{ERR_PACK(0,DSA_F_I2D_DSA_SIG,0), "i2d_DSA_SIG"},
|
||||
{ERR_PACK(0,DSA_F_SIG_CB,0), "SIG_CB"},
|
||||
{ERR_FUNC(DSA_F_D2I_DSA_SIG), "d2i_DSA_SIG"},
|
||||
{ERR_FUNC(DSA_F_DSAPARAMS_PRINT), "DSAparams_print"},
|
||||
{ERR_FUNC(DSA_F_DSAPARAMS_PRINT_FP), "DSAparams_print_fp"},
|
||||
{ERR_FUNC(DSA_F_DSA_DO_SIGN), "DSA_do_sign"},
|
||||
{ERR_FUNC(DSA_F_DSA_DO_VERIFY), "DSA_do_verify"},
|
||||
{ERR_FUNC(DSA_F_DSA_NEW_METHOD), "DSA_new_method"},
|
||||
{ERR_FUNC(DSA_F_DSA_PRINT), "DSA_print"},
|
||||
{ERR_FUNC(DSA_F_DSA_PRINT_FP), "DSA_print_fp"},
|
||||
{ERR_FUNC(DSA_F_DSA_SIGN), "DSA_sign"},
|
||||
{ERR_FUNC(DSA_F_DSA_SIGN_SETUP), "DSA_sign_setup"},
|
||||
{ERR_FUNC(DSA_F_DSA_SIG_NEW), "DSA_SIG_new"},
|
||||
{ERR_FUNC(DSA_F_DSA_VERIFY), "DSA_verify"},
|
||||
{ERR_FUNC(DSA_F_I2D_DSA_SIG), "i2d_DSA_SIG"},
|
||||
{ERR_FUNC(DSA_F_SIG_CB), "SIG_CB"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA DSA_str_reasons[]=
|
||||
{
|
||||
{DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE ,"data too large for key size"},
|
||||
{DSA_R_MISSING_PARAMETERS ,"missing parameters"},
|
||||
{ERR_REASON(DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE),"data too large for key size"},
|
||||
{ERR_REASON(DSA_R_MISSING_PARAMETERS) ,"missing parameters"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -100,8 +104,8 @@ void ERR_load_DSA_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_DSA,DSA_str_functs);
|
||||
ERR_load_strings(ERR_LIB_DSA,DSA_str_reasons);
|
||||
ERR_load_strings(0,DSA_str_functs);
|
||||
ERR_load_strings(0,DSA_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -90,8 +90,22 @@ int DSA_generate_key(DSA *dsa)
|
||||
}
|
||||
else
|
||||
pub_key=dsa->pub_key;
|
||||
|
||||
{
|
||||
BIGNUM local_prk;
|
||||
BIGNUM *prk;
|
||||
|
||||
if (!BN_mod_exp(pub_key,dsa->g,priv_key,dsa->p,ctx)) goto err;
|
||||
if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0)
|
||||
{
|
||||
BN_init(&local_prk);
|
||||
prk = &local_prk;
|
||||
BN_with_flags(prk, priv_key, BN_FLG_EXP_CONSTTIME);
|
||||
}
|
||||
else
|
||||
prk = priv_key;
|
||||
|
||||
if (!BN_mod_exp(pub_key,dsa->g,prk,dsa->p,ctx)) goto err;
|
||||
}
|
||||
|
||||
dsa->priv_key=priv_key;
|
||||
dsa->pub_key=pub_key;
|
||||
|
@@ -172,7 +172,7 @@ err:
|
||||
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||
{
|
||||
BN_CTX *ctx;
|
||||
BIGNUM k,*kinv=NULL,*r=NULL;
|
||||
BIGNUM k,kq,*K,*kinv=NULL,*r=NULL;
|
||||
int ret=0;
|
||||
|
||||
if (!dsa->p || !dsa->q || !dsa->g)
|
||||
@@ -182,6 +182,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||
}
|
||||
|
||||
BN_init(&k);
|
||||
BN_init(&kq);
|
||||
|
||||
if (ctx_in == NULL)
|
||||
{
|
||||
@@ -191,22 +192,49 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||
ctx=ctx_in;
|
||||
|
||||
if ((r=BN_new()) == NULL) goto err;
|
||||
kinv=NULL;
|
||||
|
||||
/* Get random k */
|
||||
do
|
||||
if (!BN_rand_range(&k, dsa->q)) goto err;
|
||||
while (BN_is_zero(&k));
|
||||
|
||||
if ((dsa->method_mont_p == NULL) && (dsa->flags & DSA_FLAG_CACHE_MONT_P))
|
||||
if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0)
|
||||
{
|
||||
if ((dsa->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL)
|
||||
if (!BN_MONT_CTX_set((BN_MONT_CTX *)dsa->method_mont_p,
|
||||
dsa->p,ctx)) goto err;
|
||||
BN_set_flags(&k, BN_FLG_EXP_CONSTTIME);
|
||||
}
|
||||
|
||||
if (dsa->flags & DSA_FLAG_CACHE_MONT_P)
|
||||
{
|
||||
if (!BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_p,
|
||||
CRYPTO_LOCK_DSA,
|
||||
dsa->p, ctx))
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Compute r = (g^k mod p) mod q */
|
||||
if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
|
||||
|
||||
if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0)
|
||||
{
|
||||
if (!BN_copy(&kq, &k)) goto err;
|
||||
|
||||
/* We do not want timing information to leak the length of k,
|
||||
* so we compute g^k using an equivalent exponent of fixed length.
|
||||
*
|
||||
* (This is a kludge that we need because the BN_mod_exp_mont()
|
||||
* does not let us specify the desired timing behaviour.) */
|
||||
|
||||
if (!BN_add(&kq, &kq, dsa->q)) goto err;
|
||||
if (BN_num_bits(&kq) <= BN_num_bits(dsa->q))
|
||||
{
|
||||
if (!BN_add(&kq, &kq, dsa->q)) goto err;
|
||||
}
|
||||
|
||||
K = &kq;
|
||||
}
|
||||
else
|
||||
{
|
||||
K = &k;
|
||||
}
|
||||
if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,K,dsa->p,ctx,
|
||||
(BN_MONT_CTX *)dsa->method_mont_p)) goto err;
|
||||
if (!BN_mod(r,r,dsa->q,ctx)) goto err;
|
||||
|
||||
@@ -229,6 +257,7 @@ err:
|
||||
if (ctx_in == NULL) BN_CTX_free(ctx);
|
||||
if (kinv != NULL) BN_clear_free(kinv);
|
||||
BN_clear_free(&k);
|
||||
BN_clear_free(&kq);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -275,13 +304,15 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
||||
/* u2 = r * w mod q */
|
||||
if (!BN_mod_mul(&u2,sig->r,&u2,dsa->q,ctx)) goto err;
|
||||
|
||||
if ((dsa->method_mont_p == NULL) && (dsa->flags & DSA_FLAG_CACHE_MONT_P))
|
||||
|
||||
if (dsa->flags & DSA_FLAG_CACHE_MONT_P)
|
||||
{
|
||||
if ((dsa->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL)
|
||||
if (!BN_MONT_CTX_set((BN_MONT_CTX *)dsa->method_mont_p,
|
||||
dsa->p,ctx)) goto err;
|
||||
mont = BN_MONT_CTX_set_locked(
|
||||
(BN_MONT_CTX **)&dsa->method_mont_p,
|
||||
CRYPTO_LOCK_DSA, dsa->p, ctx);
|
||||
if (!mont)
|
||||
goto err;
|
||||
}
|
||||
mont=(BN_MONT_CTX *)dsa->method_mont_p;
|
||||
|
||||
#if 0
|
||||
{
|
||||
|
@@ -194,10 +194,19 @@ int main(int argc, char **argv)
|
||||
BIO_printf(bio_err,"g value is wrong\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
dsa->flags |= DSA_FLAG_NO_EXP_CONSTTIME;
|
||||
DSA_generate_key(dsa);
|
||||
DSA_sign(0, str1, 20, sig, &siglen, dsa);
|
||||
if (DSA_verify(0, str1, 20, sig, siglen, dsa) == 1)
|
||||
ret=1;
|
||||
|
||||
dsa->flags &= ~DSA_FLAG_NO_EXP_CONSTTIME;
|
||||
DSA_generate_key(dsa);
|
||||
DSA_sign(0, str1, 20, sig, &siglen, dsa);
|
||||
if (DSA_verify(0, str1, 20, sig, siglen, dsa) == 1)
|
||||
ret=1;
|
||||
|
||||
end:
|
||||
if (!ret)
|
||||
ERR_print_errors(bio_err);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/dso/Makefile
|
||||
# OpenSSL/crypto/dso/Makefile
|
||||
#
|
||||
|
||||
DIR= dso
|
||||
|
@@ -126,7 +126,8 @@ static int dl_load(DSO *dso)
|
||||
DSOerr(DSO_F_DL_LOAD,DSO_R_NO_FILENAME);
|
||||
goto err;
|
||||
}
|
||||
ptr = shl_load(filename, BIND_IMMEDIATE|DYNAMIC_PATH, 0L);
|
||||
ptr = shl_load(filename, BIND_IMMEDIATE |
|
||||
(dso->flags&DSO_FLAG_NO_NAME_TRANSLATION?0:DYNAMIC_PATH), 0L);
|
||||
if(ptr == NULL)
|
||||
{
|
||||
DSOerr(DSO_F_DL_LOAD,DSO_R_LOAD_FAILED);
|
||||
@@ -281,4 +282,36 @@ static char *dl_name_converter(DSO *dso, const char *filename)
|
||||
return(translated);
|
||||
}
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
static void dl_ref_point(){}
|
||||
|
||||
int DSO_pathbyaddr(void *addr,char *path,int sz)
|
||||
{
|
||||
struct shl_descriptor inf;
|
||||
int i,len;
|
||||
|
||||
if (addr == NULL)
|
||||
{
|
||||
union { void(*f)(); void *p; } t = { dl_ref_point };
|
||||
addr = t.p;
|
||||
}
|
||||
|
||||
for (i=-1;shl_get_r(i,&inf)==0;i++)
|
||||
{
|
||||
if (((size_t)addr >= inf.tstart && (size_t)addr < inf.tend) ||
|
||||
((size_t)addr >= inf.dstart && (size_t)addr < inf.dend))
|
||||
{
|
||||
len = (int)strlen(inf.filename);
|
||||
if (sz <= 0) return len+1;
|
||||
if (len >= sz) len=sz-1;
|
||||
memcpy(path,inf.filename,len);
|
||||
path[len++] = 0;
|
||||
return len;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* DSO_DL */
|
||||
|
@@ -56,6 +56,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __linux
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/dso.h>
|
||||
@@ -228,7 +232,7 @@ static void *dlfcn_bind_var(DSO *dso, const char *symname)
|
||||
static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
|
||||
{
|
||||
void *ptr;
|
||||
DSO_FUNC_TYPE sym;
|
||||
DSO_FUNC_TYPE sym, *tsym = &sym;
|
||||
|
||||
if((dso == NULL) || (symname == NULL))
|
||||
{
|
||||
@@ -246,7 +250,7 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
|
||||
DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_NULL_HANDLE);
|
||||
return(NULL);
|
||||
}
|
||||
sym = (DSO_FUNC_TYPE)dlsym(ptr, symname);
|
||||
*(void**)(tsym) = dlsym(ptr, symname);
|
||||
if(sym == NULL)
|
||||
{
|
||||
DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_SYM_FAILURE);
|
||||
@@ -290,4 +294,32 @@ static char *dlfcn_name_converter(DSO *dso, const char *filename)
|
||||
return(translated);
|
||||
}
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
static void dlfcn_ref_point(){}
|
||||
|
||||
int DSO_pathbyaddr(void *addr,char *path,int sz)
|
||||
{
|
||||
Dl_info dli;
|
||||
int len;
|
||||
|
||||
if (addr == NULL)
|
||||
{
|
||||
union { void(*f)(void); void *p; } t = { dlfcn_ref_point };
|
||||
addr = t.p;
|
||||
}
|
||||
|
||||
if (dladdr(addr,&dli))
|
||||
{
|
||||
len = (int)strlen(dli.dli_fname);
|
||||
if (sz <= 0) return len+1;
|
||||
if (len >= sz) len=sz-1;
|
||||
memcpy(path,dli.dli_fname,len);
|
||||
path[len++]=0;
|
||||
return len;
|
||||
}
|
||||
|
||||
ERR_add_error_data(4, "dlfcn_pathbyaddr(): ", dlerror());
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
#endif /* DSO_DLFCN */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/dso/dso_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,56 +64,60 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_DSO,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_DSO,0,reason)
|
||||
|
||||
static ERR_STRING_DATA DSO_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,DSO_F_DLFCN_BIND_FUNC,0), "DLFCN_BIND_FUNC"},
|
||||
{ERR_PACK(0,DSO_F_DLFCN_BIND_VAR,0), "DLFCN_BIND_VAR"},
|
||||
{ERR_PACK(0,DSO_F_DLFCN_LOAD,0), "DLFCN_LOAD"},
|
||||
{ERR_PACK(0,DSO_F_DLFCN_NAME_CONVERTER,0), "DLFCN_NAME_CONVERTER"},
|
||||
{ERR_PACK(0,DSO_F_DLFCN_UNLOAD,0), "DLFCN_UNLOAD"},
|
||||
{ERR_PACK(0,DSO_F_DL_BIND_FUNC,0), "DL_BIND_FUNC"},
|
||||
{ERR_PACK(0,DSO_F_DL_BIND_VAR,0), "DL_BIND_VAR"},
|
||||
{ERR_PACK(0,DSO_F_DL_LOAD,0), "DL_LOAD"},
|
||||
{ERR_PACK(0,DSO_F_DL_NAME_CONVERTER,0), "DL_NAME_CONVERTER"},
|
||||
{ERR_PACK(0,DSO_F_DL_UNLOAD,0), "DL_UNLOAD"},
|
||||
{ERR_PACK(0,DSO_F_DSO_BIND_FUNC,0), "DSO_bind_func"},
|
||||
{ERR_PACK(0,DSO_F_DSO_BIND_VAR,0), "DSO_bind_var"},
|
||||
{ERR_PACK(0,DSO_F_DSO_CONVERT_FILENAME,0), "DSO_convert_filename"},
|
||||
{ERR_PACK(0,DSO_F_DSO_CTRL,0), "DSO_ctrl"},
|
||||
{ERR_PACK(0,DSO_F_DSO_FREE,0), "DSO_free"},
|
||||
{ERR_PACK(0,DSO_F_DSO_GET_FILENAME,0), "DSO_get_filename"},
|
||||
{ERR_PACK(0,DSO_F_DSO_GET_LOADED_FILENAME,0), "DSO_get_loaded_filename"},
|
||||
{ERR_PACK(0,DSO_F_DSO_LOAD,0), "DSO_load"},
|
||||
{ERR_PACK(0,DSO_F_DSO_NEW_METHOD,0), "DSO_new_method"},
|
||||
{ERR_PACK(0,DSO_F_DSO_SET_FILENAME,0), "DSO_set_filename"},
|
||||
{ERR_PACK(0,DSO_F_DSO_SET_NAME_CONVERTER,0), "DSO_set_name_converter"},
|
||||
{ERR_PACK(0,DSO_F_DSO_UP_REF,0), "DSO_up_ref"},
|
||||
{ERR_PACK(0,DSO_F_VMS_BIND_VAR,0), "VMS_BIND_VAR"},
|
||||
{ERR_PACK(0,DSO_F_VMS_LOAD,0), "VMS_LOAD"},
|
||||
{ERR_PACK(0,DSO_F_VMS_UNLOAD,0), "VMS_UNLOAD"},
|
||||
{ERR_PACK(0,DSO_F_WIN32_BIND_FUNC,0), "WIN32_BIND_FUNC"},
|
||||
{ERR_PACK(0,DSO_F_WIN32_BIND_VAR,0), "WIN32_BIND_VAR"},
|
||||
{ERR_PACK(0,DSO_F_WIN32_LOAD,0), "WIN32_LOAD"},
|
||||
{ERR_PACK(0,DSO_F_WIN32_NAME_CONVERTER,0), "WIN32_NAME_CONVERTER"},
|
||||
{ERR_PACK(0,DSO_F_WIN32_UNLOAD,0), "WIN32_UNLOAD"},
|
||||
{ERR_FUNC(DSO_F_DLFCN_BIND_FUNC), "DLFCN_BIND_FUNC"},
|
||||
{ERR_FUNC(DSO_F_DLFCN_BIND_VAR), "DLFCN_BIND_VAR"},
|
||||
{ERR_FUNC(DSO_F_DLFCN_LOAD), "DLFCN_LOAD"},
|
||||
{ERR_FUNC(DSO_F_DLFCN_NAME_CONVERTER), "DLFCN_NAME_CONVERTER"},
|
||||
{ERR_FUNC(DSO_F_DLFCN_UNLOAD), "DLFCN_UNLOAD"},
|
||||
{ERR_FUNC(DSO_F_DL_BIND_FUNC), "DL_BIND_FUNC"},
|
||||
{ERR_FUNC(DSO_F_DL_BIND_VAR), "DL_BIND_VAR"},
|
||||
{ERR_FUNC(DSO_F_DL_LOAD), "DL_LOAD"},
|
||||
{ERR_FUNC(DSO_F_DL_NAME_CONVERTER), "DL_NAME_CONVERTER"},
|
||||
{ERR_FUNC(DSO_F_DL_UNLOAD), "DL_UNLOAD"},
|
||||
{ERR_FUNC(DSO_F_DSO_BIND_FUNC), "DSO_bind_func"},
|
||||
{ERR_FUNC(DSO_F_DSO_BIND_VAR), "DSO_bind_var"},
|
||||
{ERR_FUNC(DSO_F_DSO_CONVERT_FILENAME), "DSO_convert_filename"},
|
||||
{ERR_FUNC(DSO_F_DSO_CTRL), "DSO_ctrl"},
|
||||
{ERR_FUNC(DSO_F_DSO_FREE), "DSO_free"},
|
||||
{ERR_FUNC(DSO_F_DSO_GET_FILENAME), "DSO_get_filename"},
|
||||
{ERR_FUNC(DSO_F_DSO_GET_LOADED_FILENAME), "DSO_get_loaded_filename"},
|
||||
{ERR_FUNC(DSO_F_DSO_LOAD), "DSO_load"},
|
||||
{ERR_FUNC(DSO_F_DSO_NEW_METHOD), "DSO_new_method"},
|
||||
{ERR_FUNC(DSO_F_DSO_SET_FILENAME), "DSO_set_filename"},
|
||||
{ERR_FUNC(DSO_F_DSO_SET_NAME_CONVERTER), "DSO_set_name_converter"},
|
||||
{ERR_FUNC(DSO_F_DSO_UP_REF), "DSO_up_ref"},
|
||||
{ERR_FUNC(DSO_F_VMS_BIND_VAR), "VMS_BIND_VAR"},
|
||||
{ERR_FUNC(DSO_F_VMS_LOAD), "VMS_LOAD"},
|
||||
{ERR_FUNC(DSO_F_VMS_UNLOAD), "VMS_UNLOAD"},
|
||||
{ERR_FUNC(DSO_F_WIN32_BIND_FUNC), "WIN32_BIND_FUNC"},
|
||||
{ERR_FUNC(DSO_F_WIN32_BIND_VAR), "WIN32_BIND_VAR"},
|
||||
{ERR_FUNC(DSO_F_WIN32_LOAD), "WIN32_LOAD"},
|
||||
{ERR_FUNC(DSO_F_WIN32_NAME_CONVERTER), "WIN32_NAME_CONVERTER"},
|
||||
{ERR_FUNC(DSO_F_WIN32_UNLOAD), "WIN32_UNLOAD"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA DSO_str_reasons[]=
|
||||
{
|
||||
{DSO_R_CTRL_FAILED ,"control command failed"},
|
||||
{DSO_R_DSO_ALREADY_LOADED ,"dso already loaded"},
|
||||
{DSO_R_FILENAME_TOO_BIG ,"filename too big"},
|
||||
{DSO_R_FINISH_FAILED ,"cleanup method function failed"},
|
||||
{DSO_R_LOAD_FAILED ,"could not load the shared library"},
|
||||
{DSO_R_NAME_TRANSLATION_FAILED ,"name translation failed"},
|
||||
{DSO_R_NO_FILENAME ,"no filename"},
|
||||
{DSO_R_NULL_HANDLE ,"a null shared library handle was used"},
|
||||
{DSO_R_SET_FILENAME_FAILED ,"set filename failed"},
|
||||
{DSO_R_STACK_ERROR ,"the meth_data stack is corrupt"},
|
||||
{DSO_R_SYM_FAILURE ,"could not bind to the requested symbol name"},
|
||||
{DSO_R_UNLOAD_FAILED ,"could not unload the shared library"},
|
||||
{DSO_R_UNSUPPORTED ,"functionality not supported"},
|
||||
{ERR_REASON(DSO_R_CTRL_FAILED) ,"control command failed"},
|
||||
{ERR_REASON(DSO_R_DSO_ALREADY_LOADED) ,"dso already loaded"},
|
||||
{ERR_REASON(DSO_R_FILENAME_TOO_BIG) ,"filename too big"},
|
||||
{ERR_REASON(DSO_R_FINISH_FAILED) ,"cleanup method function failed"},
|
||||
{ERR_REASON(DSO_R_LOAD_FAILED) ,"could not load the shared library"},
|
||||
{ERR_REASON(DSO_R_NAME_TRANSLATION_FAILED),"name translation failed"},
|
||||
{ERR_REASON(DSO_R_NO_FILENAME) ,"no filename"},
|
||||
{ERR_REASON(DSO_R_NULL_HANDLE) ,"a null shared library handle was used"},
|
||||
{ERR_REASON(DSO_R_SET_FILENAME_FAILED) ,"set filename failed"},
|
||||
{ERR_REASON(DSO_R_STACK_ERROR) ,"the meth_data stack is corrupt"},
|
||||
{ERR_REASON(DSO_R_SYM_FAILURE) ,"could not bind to the requested symbol name"},
|
||||
{ERR_REASON(DSO_R_UNLOAD_FAILED) ,"could not unload the shared library"},
|
||||
{ERR_REASON(DSO_R_UNSUPPORTED) ,"functionality not supported"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -127,8 +131,8 @@ void ERR_load_DSO_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_DSO,DSO_str_functs);
|
||||
ERR_load_strings(ERR_LIB_DSO,DSO_str_reasons);
|
||||
ERR_load_strings(0,DSO_str_functs);
|
||||
ERR_load_strings(0,DSO_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -68,6 +68,25 @@ DSO_METHOD *DSO_METHOD_win32(void)
|
||||
}
|
||||
#else
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
# if _WIN32_WCE < 300
|
||||
static FARPROC GetProcAddressA(HMODULE hModule,LPCSTR lpProcName)
|
||||
{
|
||||
WCHAR lpProcNameW[64];
|
||||
int i;
|
||||
|
||||
for (i=0;lpProcName[i] && i<64;i++)
|
||||
lpProcNameW[i] = (WCHAR)lpProcName[i];
|
||||
if (i==64) return NULL;
|
||||
lpProcNameW[i] = 0;
|
||||
|
||||
return GetProcAddressW(hModule,lpProcNameW);
|
||||
}
|
||||
# endif
|
||||
# undef GetProcAddress
|
||||
# define GetProcAddress GetProcAddressA
|
||||
#endif
|
||||
|
||||
/* Part of the hack in "win32_load" ... */
|
||||
#define DSO_MAX_TRANSLATED_SIZE 256
|
||||
|
||||
@@ -122,7 +141,7 @@ static int win32_load(DSO *dso)
|
||||
DSOerr(DSO_F_WIN32_LOAD,DSO_R_NO_FILENAME);
|
||||
goto err;
|
||||
}
|
||||
h = LoadLibrary(filename);
|
||||
h = LoadLibraryA(filename);
|
||||
if(h == NULL)
|
||||
{
|
||||
DSOerr(DSO_F_WIN32_LOAD,DSO_R_LOAD_FAILED);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/ec/ec_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,70 +64,74 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_EC,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_EC,0,reason)
|
||||
|
||||
static ERR_STRING_DATA EC_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,EC_F_COMPUTE_WNAF,0), "COMPUTE_WNAF"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_DECODE,0), "ec_GFp_mont_field_decode"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_ENCODE,0), "ec_GFp_mont_field_encode"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_MUL,0), "ec_GFp_mont_field_mul"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_SQR,0), "ec_GFp_mont_field_sqr"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP,0), "ec_GFp_simple_group_set_curve_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR,0), "ec_GFp_simple_group_set_generator"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_MAKE_AFFINE,0), "ec_GFp_simple_make_affine"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_OCT2POINT,0), "ec_GFp_simple_oct2point"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT2OCT,0), "ec_GFp_simple_point2oct"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE,0), "ec_GFp_simple_points_make_affine"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP,0), "ec_GFp_simple_point_get_affine_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP,0), "ec_GFp_simple_point_set_affine_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP,0), "ec_GFp_simple_set_compressed_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_COPY,0), "EC_GROUP_copy"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_GET0_GENERATOR,0), "EC_GROUP_get0_generator"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_GET_COFACTOR,0), "EC_GROUP_get_cofactor"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_GET_CURVE_GFP,0), "EC_GROUP_get_curve_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_GET_ORDER,0), "EC_GROUP_get_order"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW,0), "EC_GROUP_new"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_PRECOMPUTE_MULT,0), "EC_GROUP_precompute_mult"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_CURVE_GFP,0), "EC_GROUP_set_curve_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_EXTRA_DATA,0), "EC_GROUP_set_extra_data"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_GENERATOR,0), "EC_GROUP_set_generator"},
|
||||
{ERR_PACK(0,EC_F_EC_POINTS_MAKE_AFFINE,0), "EC_POINTs_make_affine"},
|
||||
{ERR_PACK(0,EC_F_EC_POINTS_MUL,0), "EC_POINTs_mul"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_ADD,0), "EC_POINT_add"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_CMP,0), "EC_POINT_cmp"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_COPY,0), "EC_POINT_copy"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_DBL,0), "EC_POINT_dbl"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP,0), "EC_POINT_get_affine_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP,0), "EC_POINT_get_Jprojective_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_IS_AT_INFINITY,0), "EC_POINT_is_at_infinity"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_IS_ON_CURVE,0), "EC_POINT_is_on_curve"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_MAKE_AFFINE,0), "EC_POINT_make_affine"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_NEW,0), "EC_POINT_new"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_OCT2POINT,0), "EC_POINT_oct2point"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_POINT2OCT,0), "EC_POINT_point2oct"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP,0), "EC_POINT_set_affine_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP,0), "EC_POINT_set_compressed_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP,0), "EC_POINT_set_Jprojective_coordinates_GFp"},
|
||||
{ERR_PACK(0,EC_F_EC_POINT_SET_TO_INFINITY,0), "EC_POINT_set_to_infinity"},
|
||||
{ERR_PACK(0,EC_F_GFP_MONT_GROUP_SET_CURVE_GFP,0), "GFP_MONT_GROUP_SET_CURVE_GFP"},
|
||||
{ERR_FUNC(EC_F_COMPUTE_WNAF), "COMPUTE_WNAF"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_DECODE), "ec_GFp_mont_field_decode"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_ENCODE), "ec_GFp_mont_field_encode"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_MUL), "ec_GFp_mont_field_mul"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_SQR), "ec_GFp_mont_field_sqr"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP), "ec_GFp_simple_group_set_curve_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR), "ec_GFp_simple_group_set_generator"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_MAKE_AFFINE), "ec_GFp_simple_make_affine"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_OCT2POINT), "ec_GFp_simple_oct2point"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_POINT2OCT), "ec_GFp_simple_point2oct"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE), "ec_GFp_simple_points_make_affine"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP), "ec_GFp_simple_point_get_affine_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP), "ec_GFp_simple_point_set_affine_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP), "ec_GFp_simple_set_compressed_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_COPY), "EC_GROUP_copy"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_GET0_GENERATOR), "EC_GROUP_get0_generator"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_GET_COFACTOR), "EC_GROUP_get_cofactor"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_GET_CURVE_GFP), "EC_GROUP_get_curve_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_GET_ORDER), "EC_GROUP_get_order"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_NEW), "EC_GROUP_new"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_PRECOMPUTE_MULT), "EC_GROUP_precompute_mult"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_SET_CURVE_GFP), "EC_GROUP_set_curve_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_SET_EXTRA_DATA), "EC_GROUP_set_extra_data"},
|
||||
{ERR_FUNC(EC_F_EC_GROUP_SET_GENERATOR), "EC_GROUP_set_generator"},
|
||||
{ERR_FUNC(EC_F_EC_POINTS_MAKE_AFFINE), "EC_POINTs_make_affine"},
|
||||
{ERR_FUNC(EC_F_EC_POINTS_MUL), "EC_POINTs_mul"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_ADD), "EC_POINT_add"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_CMP), "EC_POINT_cmp"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_COPY), "EC_POINT_copy"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_DBL), "EC_POINT_dbl"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP), "EC_POINT_get_affine_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP), "EC_POINT_get_Jprojective_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_IS_AT_INFINITY), "EC_POINT_is_at_infinity"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_IS_ON_CURVE), "EC_POINT_is_on_curve"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_MAKE_AFFINE), "EC_POINT_make_affine"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_NEW), "EC_POINT_new"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_OCT2POINT), "EC_POINT_oct2point"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_POINT2OCT), "EC_POINT_point2oct"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP), "EC_POINT_set_affine_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP), "EC_POINT_set_compressed_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP), "EC_POINT_set_Jprojective_coordinates_GFp"},
|
||||
{ERR_FUNC(EC_F_EC_POINT_SET_TO_INFINITY), "EC_POINT_set_to_infinity"},
|
||||
{ERR_FUNC(EC_F_GFP_MONT_GROUP_SET_CURVE_GFP), "GFP_MONT_GROUP_SET_CURVE_GFP"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA EC_str_reasons[]=
|
||||
{
|
||||
{EC_R_BUFFER_TOO_SMALL ,"buffer too small"},
|
||||
{EC_R_INCOMPATIBLE_OBJECTS ,"incompatible objects"},
|
||||
{EC_R_INVALID_ARGUMENT ,"invalid argument"},
|
||||
{EC_R_INVALID_COMPRESSED_POINT ,"invalid compressed point"},
|
||||
{EC_R_INVALID_COMPRESSION_BIT ,"invalid compression bit"},
|
||||
{EC_R_INVALID_ENCODING ,"invalid encoding"},
|
||||
{EC_R_INVALID_FIELD ,"invalid field"},
|
||||
{EC_R_INVALID_FORM ,"invalid form"},
|
||||
{EC_R_NOT_INITIALIZED ,"not initialized"},
|
||||
{EC_R_POINT_AT_INFINITY ,"point at infinity"},
|
||||
{EC_R_POINT_IS_NOT_ON_CURVE ,"point is not on curve"},
|
||||
{EC_R_SLOT_FULL ,"slot full"},
|
||||
{EC_R_UNDEFINED_GENERATOR ,"undefined generator"},
|
||||
{EC_R_UNKNOWN_ORDER ,"unknown order"},
|
||||
{ERR_REASON(EC_R_BUFFER_TOO_SMALL) ,"buffer too small"},
|
||||
{ERR_REASON(EC_R_INCOMPATIBLE_OBJECTS) ,"incompatible objects"},
|
||||
{ERR_REASON(EC_R_INVALID_ARGUMENT) ,"invalid argument"},
|
||||
{ERR_REASON(EC_R_INVALID_COMPRESSED_POINT),"invalid compressed point"},
|
||||
{ERR_REASON(EC_R_INVALID_COMPRESSION_BIT),"invalid compression bit"},
|
||||
{ERR_REASON(EC_R_INVALID_ENCODING) ,"invalid encoding"},
|
||||
{ERR_REASON(EC_R_INVALID_FIELD) ,"invalid field"},
|
||||
{ERR_REASON(EC_R_INVALID_FORM) ,"invalid form"},
|
||||
{ERR_REASON(EC_R_NOT_INITIALIZED) ,"not initialized"},
|
||||
{ERR_REASON(EC_R_POINT_AT_INFINITY) ,"point at infinity"},
|
||||
{ERR_REASON(EC_R_POINT_IS_NOT_ON_CURVE) ,"point is not on curve"},
|
||||
{ERR_REASON(EC_R_SLOT_FULL) ,"slot full"},
|
||||
{ERR_REASON(EC_R_UNDEFINED_GENERATOR) ,"undefined generator"},
|
||||
{ERR_REASON(EC_R_UNKNOWN_ORDER) ,"unknown order"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -141,8 +145,8 @@ void ERR_load_EC_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_EC,EC_str_functs);
|
||||
ERR_load_strings(ERR_LIB_EC,EC_str_reasons);
|
||||
ERR_load_strings(0,EC_str_functs);
|
||||
ERR_load_strings(0,EC_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -158,7 +158,7 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
|
||||
*/
|
||||
if (!strcmp(ctrlvalue, "EMPTY"))
|
||||
ctrlvalue = NULL;
|
||||
else if (!strcmp(ctrlname, "init"))
|
||||
if (!strcmp(ctrlname, "init"))
|
||||
{
|
||||
if (!NCONF_get_number_e(cnf, value, "init", &do_init))
|
||||
goto err;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/engine/eng_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2005 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
|
||||
@@ -64,87 +64,91 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ENGINE,func,0)
|
||||
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ENGINE,0,reason)
|
||||
|
||||
static ERR_STRING_DATA ENGINE_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,ENGINE_F_DYNAMIC_CTRL,0), "DYNAMIC_CTRL"},
|
||||
{ERR_PACK(0,ENGINE_F_DYNAMIC_GET_DATA_CTX,0), "DYNAMIC_GET_DATA_CTX"},
|
||||
{ERR_PACK(0,ENGINE_F_DYNAMIC_LOAD,0), "DYNAMIC_LOAD"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_ADD,0), "ENGINE_add"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_BY_ID,0), "ENGINE_by_id"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_CMD_IS_EXECUTABLE,0), "ENGINE_cmd_is_executable"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_CTRL,0), "ENGINE_ctrl"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_CTRL_CMD,0), "ENGINE_ctrl_cmd"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_CTRL_CMD_STRING,0), "ENGINE_ctrl_cmd_string"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_FINISH,0), "ENGINE_finish"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_FREE,0), "ENGINE_free"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_CIPHER,0), "ENGINE_get_cipher"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_DEFAULT_TYPE,0), "ENGINE_GET_DEFAULT_TYPE"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_DIGEST,0), "ENGINE_get_digest"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_NEXT,0), "ENGINE_get_next"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_PREV,0), "ENGINE_get_prev"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_INIT,0), "ENGINE_init"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_LIST_ADD,0), "ENGINE_LIST_ADD"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_LIST_REMOVE,0), "ENGINE_LIST_REMOVE"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,0), "ENGINE_load_private_key"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,0), "ENGINE_load_public_key"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_MODULE_INIT,0), "ENGINE_MODULE_INIT"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_NEW,0), "ENGINE_new"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_REMOVE,0), "ENGINE_remove"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DEFAULT_STRING,0), "ENGINE_set_default_string"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DEFAULT_TYPE,0), "ENGINE_SET_DEFAULT_TYPE"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_ID,0), "ENGINE_set_id"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_NAME,0), "ENGINE_set_name"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_TABLE_REGISTER,0), "ENGINE_TABLE_REGISTER"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_UNLOAD_KEY,0), "ENGINE_UNLOAD_KEY"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_UP_REF,0), "ENGINE_up_ref"},
|
||||
{ERR_PACK(0,ENGINE_F_INT_CTRL_HELPER,0), "INT_CTRL_HELPER"},
|
||||
{ERR_PACK(0,ENGINE_F_INT_ENGINE_CONFIGURE,0), "INT_ENGINE_CONFIGURE"},
|
||||
{ERR_PACK(0,ENGINE_F_LOG_MESSAGE,0), "LOG_MESSAGE"},
|
||||
{ERR_PACK(0,ENGINE_F_SET_DATA_CTX,0), "SET_DATA_CTX"},
|
||||
{ERR_FUNC(ENGINE_F_DYNAMIC_CTRL), "DYNAMIC_CTRL"},
|
||||
{ERR_FUNC(ENGINE_F_DYNAMIC_GET_DATA_CTX), "DYNAMIC_GET_DATA_CTX"},
|
||||
{ERR_FUNC(ENGINE_F_DYNAMIC_LOAD), "DYNAMIC_LOAD"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_ADD), "ENGINE_add"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_BY_ID), "ENGINE_by_id"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_CMD_IS_EXECUTABLE), "ENGINE_cmd_is_executable"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_CTRL), "ENGINE_ctrl"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD), "ENGINE_ctrl_cmd"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD_STRING), "ENGINE_ctrl_cmd_string"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_FINISH), "ENGINE_finish"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_FREE), "ENGINE_free"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_GET_CIPHER), "ENGINE_get_cipher"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_GET_DEFAULT_TYPE), "ENGINE_GET_DEFAULT_TYPE"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_GET_DIGEST), "ENGINE_get_digest"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_GET_NEXT), "ENGINE_get_next"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_GET_PREV), "ENGINE_get_prev"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_INIT), "ENGINE_init"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_LIST_ADD), "ENGINE_LIST_ADD"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_LIST_REMOVE), "ENGINE_LIST_REMOVE"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY), "ENGINE_load_private_key"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY), "ENGINE_load_public_key"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_MODULE_INIT), "ENGINE_MODULE_INIT"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_NEW), "ENGINE_new"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_REMOVE), "ENGINE_remove"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_STRING), "ENGINE_set_default_string"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_TYPE), "ENGINE_SET_DEFAULT_TYPE"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_SET_ID), "ENGINE_set_id"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_SET_NAME), "ENGINE_set_name"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_TABLE_REGISTER), "ENGINE_TABLE_REGISTER"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_UNLOAD_KEY), "ENGINE_UNLOAD_KEY"},
|
||||
{ERR_FUNC(ENGINE_F_ENGINE_UP_REF), "ENGINE_up_ref"},
|
||||
{ERR_FUNC(ENGINE_F_INT_CTRL_HELPER), "INT_CTRL_HELPER"},
|
||||
{ERR_FUNC(ENGINE_F_INT_ENGINE_CONFIGURE), "INT_ENGINE_CONFIGURE"},
|
||||
{ERR_FUNC(ENGINE_F_LOG_MESSAGE), "LOG_MESSAGE"},
|
||||
{ERR_FUNC(ENGINE_F_SET_DATA_CTX), "SET_DATA_CTX"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA ENGINE_str_reasons[]=
|
||||
{
|
||||
{ENGINE_R_ALREADY_LOADED ,"already loaded"},
|
||||
{ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER ,"argument is not a number"},
|
||||
{ENGINE_R_CMD_NOT_EXECUTABLE ,"cmd not executable"},
|
||||
{ENGINE_R_COMMAND_TAKES_INPUT ,"command takes input"},
|
||||
{ENGINE_R_COMMAND_TAKES_NO_INPUT ,"command takes no input"},
|
||||
{ENGINE_R_CONFLICTING_ENGINE_ID ,"conflicting engine id"},
|
||||
{ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"},
|
||||
{ENGINE_R_DH_NOT_IMPLEMENTED ,"dh not implemented"},
|
||||
{ENGINE_R_DSA_NOT_IMPLEMENTED ,"dsa not implemented"},
|
||||
{ENGINE_R_DSO_FAILURE ,"DSO failure"},
|
||||
{ENGINE_R_DSO_NOT_FOUND ,"dso not found"},
|
||||
{ENGINE_R_ENGINES_SECTION_ERROR ,"engines section error"},
|
||||
{ENGINE_R_ENGINE_IS_NOT_IN_LIST ,"engine is not in the list"},
|
||||
{ENGINE_R_ENGINE_SECTION_ERROR ,"engine section error"},
|
||||
{ENGINE_R_FAILED_LOADING_PRIVATE_KEY ,"failed loading private key"},
|
||||
{ENGINE_R_FAILED_LOADING_PUBLIC_KEY ,"failed loading public key"},
|
||||
{ENGINE_R_FINISH_FAILED ,"finish failed"},
|
||||
{ENGINE_R_GET_HANDLE_FAILED ,"could not obtain hardware handle"},
|
||||
{ENGINE_R_ID_OR_NAME_MISSING ,"'id' or 'name' missing"},
|
||||
{ENGINE_R_INIT_FAILED ,"init failed"},
|
||||
{ENGINE_R_INTERNAL_LIST_ERROR ,"internal list error"},
|
||||
{ENGINE_R_INVALID_ARGUMENT ,"invalid argument"},
|
||||
{ENGINE_R_INVALID_CMD_NAME ,"invalid cmd name"},
|
||||
{ENGINE_R_INVALID_CMD_NUMBER ,"invalid cmd number"},
|
||||
{ENGINE_R_INVALID_INIT_VALUE ,"invalid init value"},
|
||||
{ENGINE_R_INVALID_STRING ,"invalid string"},
|
||||
{ENGINE_R_NOT_INITIALISED ,"not initialised"},
|
||||
{ENGINE_R_NOT_LOADED ,"not loaded"},
|
||||
{ENGINE_R_NO_CONTROL_FUNCTION ,"no control function"},
|
||||
{ENGINE_R_NO_INDEX ,"no index"},
|
||||
{ENGINE_R_NO_LOAD_FUNCTION ,"no load function"},
|
||||
{ENGINE_R_NO_REFERENCE ,"no reference"},
|
||||
{ENGINE_R_NO_SUCH_ENGINE ,"no such engine"},
|
||||
{ENGINE_R_NO_UNLOAD_FUNCTION ,"no unload function"},
|
||||
{ENGINE_R_PROVIDE_PARAMETERS ,"provide parameters"},
|
||||
{ENGINE_R_RSA_NOT_IMPLEMENTED ,"rsa not implemented"},
|
||||
{ENGINE_R_UNIMPLEMENTED_CIPHER ,"unimplemented cipher"},
|
||||
{ENGINE_R_UNIMPLEMENTED_DIGEST ,"unimplemented digest"},
|
||||
{ENGINE_R_VERSION_INCOMPATIBILITY ,"version incompatibility"},
|
||||
{ERR_REASON(ENGINE_R_ALREADY_LOADED) ,"already loaded"},
|
||||
{ERR_REASON(ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER),"argument is not a number"},
|
||||
{ERR_REASON(ENGINE_R_CMD_NOT_EXECUTABLE) ,"cmd not executable"},
|
||||
{ERR_REASON(ENGINE_R_COMMAND_TAKES_INPUT),"command takes input"},
|
||||
{ERR_REASON(ENGINE_R_COMMAND_TAKES_NO_INPUT),"command takes no input"},
|
||||
{ERR_REASON(ENGINE_R_CONFLICTING_ENGINE_ID),"conflicting engine id"},
|
||||
{ERR_REASON(ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"},
|
||||
{ERR_REASON(ENGINE_R_DH_NOT_IMPLEMENTED) ,"dh not implemented"},
|
||||
{ERR_REASON(ENGINE_R_DSA_NOT_IMPLEMENTED),"dsa not implemented"},
|
||||
{ERR_REASON(ENGINE_R_DSO_FAILURE) ,"DSO failure"},
|
||||
{ERR_REASON(ENGINE_R_DSO_NOT_FOUND) ,"dso not found"},
|
||||
{ERR_REASON(ENGINE_R_ENGINES_SECTION_ERROR),"engines section error"},
|
||||
{ERR_REASON(ENGINE_R_ENGINE_IS_NOT_IN_LIST),"engine is not in the list"},
|
||||
{ERR_REASON(ENGINE_R_ENGINE_SECTION_ERROR),"engine section error"},
|
||||
{ERR_REASON(ENGINE_R_FAILED_LOADING_PRIVATE_KEY),"failed loading private key"},
|
||||
{ERR_REASON(ENGINE_R_FAILED_LOADING_PUBLIC_KEY),"failed loading public key"},
|
||||
{ERR_REASON(ENGINE_R_FINISH_FAILED) ,"finish failed"},
|
||||
{ERR_REASON(ENGINE_R_GET_HANDLE_FAILED) ,"could not obtain hardware handle"},
|
||||
{ERR_REASON(ENGINE_R_ID_OR_NAME_MISSING) ,"'id' or 'name' missing"},
|
||||
{ERR_REASON(ENGINE_R_INIT_FAILED) ,"init failed"},
|
||||
{ERR_REASON(ENGINE_R_INTERNAL_LIST_ERROR),"internal list error"},
|
||||
{ERR_REASON(ENGINE_R_INVALID_ARGUMENT) ,"invalid argument"},
|
||||
{ERR_REASON(ENGINE_R_INVALID_CMD_NAME) ,"invalid cmd name"},
|
||||
{ERR_REASON(ENGINE_R_INVALID_CMD_NUMBER) ,"invalid cmd number"},
|
||||
{ERR_REASON(ENGINE_R_INVALID_INIT_VALUE) ,"invalid init value"},
|
||||
{ERR_REASON(ENGINE_R_INVALID_STRING) ,"invalid string"},
|
||||
{ERR_REASON(ENGINE_R_NOT_INITIALISED) ,"not initialised"},
|
||||
{ERR_REASON(ENGINE_R_NOT_LOADED) ,"not loaded"},
|
||||
{ERR_REASON(ENGINE_R_NO_CONTROL_FUNCTION),"no control function"},
|
||||
{ERR_REASON(ENGINE_R_NO_INDEX) ,"no index"},
|
||||
{ERR_REASON(ENGINE_R_NO_LOAD_FUNCTION) ,"no load function"},
|
||||
{ERR_REASON(ENGINE_R_NO_REFERENCE) ,"no reference"},
|
||||
{ERR_REASON(ENGINE_R_NO_SUCH_ENGINE) ,"no such engine"},
|
||||
{ERR_REASON(ENGINE_R_NO_UNLOAD_FUNCTION) ,"no unload function"},
|
||||
{ERR_REASON(ENGINE_R_PROVIDE_PARAMETERS) ,"provide parameters"},
|
||||
{ERR_REASON(ENGINE_R_RSA_NOT_IMPLEMENTED),"rsa not implemented"},
|
||||
{ERR_REASON(ENGINE_R_UNIMPLEMENTED_CIPHER),"unimplemented cipher"},
|
||||
{ERR_REASON(ENGINE_R_UNIMPLEMENTED_DIGEST),"unimplemented digest"},
|
||||
{ERR_REASON(ENGINE_R_VERSION_INCOMPATIBILITY),"version incompatibility"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
@@ -158,8 +162,8 @@ void ERR_load_ENGINE_strings(void)
|
||||
{
|
||||
init=0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_functs);
|
||||
ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_reasons);
|
||||
ERR_load_strings(0,ENGINE_str_functs);
|
||||
ERR_load_strings(0,ENGINE_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -474,6 +474,7 @@ static int aep_init(ENGINE *e)
|
||||
|
||||
if(aep_dso)
|
||||
DSO_free(aep_dso);
|
||||
aep_dso = NULL;
|
||||
|
||||
p_AEP_OpenConnection = NULL;
|
||||
p_AEP_ModExp = NULL;
|
||||
|
@@ -375,6 +375,7 @@ static int atalla_init(ENGINE *e)
|
||||
err:
|
||||
if(atalla_dso)
|
||||
DSO_free(atalla_dso);
|
||||
atalla_dso = NULL;
|
||||
p_Atalla_GetHardwareConfig = NULL;
|
||||
p_Atalla_RSAPrivateKeyOpFn = NULL;
|
||||
p_Atalla_GetPerformanceStatistics = NULL;
|
||||
|
@@ -90,6 +90,7 @@ static int cswift_destroy(ENGINE *e);
|
||||
static int cswift_init(ENGINE *e);
|
||||
static int cswift_finish(ENGINE *e);
|
||||
static int cswift_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
|
||||
static int cswift_bn_32copy(SW_LARGENUMBER * out, const BIGNUM * in);
|
||||
|
||||
/* BIGNUM stuff */
|
||||
static int cswift_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
@@ -403,7 +404,10 @@ static int cswift_init(ENGINE *e)
|
||||
return 1;
|
||||
err:
|
||||
if(cswift_dso)
|
||||
{
|
||||
DSO_free(cswift_dso);
|
||||
cswift_dso = NULL;
|
||||
}
|
||||
p_CSwift_AcquireAccContext = NULL;
|
||||
p_CSwift_AttachKeyParam = NULL;
|
||||
p_CSwift_SimpleRequest = NULL;
|
||||
@@ -553,6 +557,29 @@ err:
|
||||
return to_return;
|
||||
}
|
||||
|
||||
|
||||
int cswift_bn_32copy(SW_LARGENUMBER * out, const BIGNUM * in)
|
||||
{
|
||||
int mod;
|
||||
int numbytes = BN_num_bytes(in);
|
||||
|
||||
mod = 0;
|
||||
while( ((out->nbytes = (numbytes+mod)) % 32) )
|
||||
{
|
||||
mod++;
|
||||
}
|
||||
out->value = (unsigned char*)OPENSSL_malloc(out->nbytes);
|
||||
if(!out->value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
BN_bn2bin(in, &out->value[mod]);
|
||||
if(mod)
|
||||
memset(out->value, 0, mod);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Un petit mod_exp chinois */
|
||||
static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *q, const BIGNUM *dmp1,
|
||||
@@ -562,15 +589,16 @@ static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
SW_LARGENUMBER arg, res;
|
||||
SW_PARAM sw_param;
|
||||
SW_CONTEXT_HANDLE hac;
|
||||
BIGNUM *rsa_p = NULL;
|
||||
BIGNUM *rsa_q = NULL;
|
||||
BIGNUM *rsa_dmp1 = NULL;
|
||||
BIGNUM *rsa_dmq1 = NULL;
|
||||
BIGNUM *rsa_iqmp = NULL;
|
||||
BIGNUM *argument = NULL;
|
||||
BIGNUM *result = NULL;
|
||||
BIGNUM *argument = NULL;
|
||||
int to_return = 0; /* expect failure */
|
||||
int acquired = 0;
|
||||
|
||||
sw_param.up.crt.p.value = NULL;
|
||||
sw_param.up.crt.q.value = NULL;
|
||||
sw_param.up.crt.dmp1.value = NULL;
|
||||
sw_param.up.crt.dmq1.value = NULL;
|
||||
sw_param.up.crt.iqmp.value = NULL;
|
||||
|
||||
if(!get_context(&hac))
|
||||
{
|
||||
@@ -578,44 +606,55 @@ static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
goto err;
|
||||
}
|
||||
acquired = 1;
|
||||
|
||||
/* Prepare the params */
|
||||
BN_CTX_start(ctx);
|
||||
rsa_p = BN_CTX_get(ctx);
|
||||
rsa_q = BN_CTX_get(ctx);
|
||||
rsa_dmp1 = BN_CTX_get(ctx);
|
||||
rsa_dmq1 = BN_CTX_get(ctx);
|
||||
rsa_iqmp = BN_CTX_get(ctx);
|
||||
argument = BN_CTX_get(ctx);
|
||||
result = BN_CTX_get(ctx);
|
||||
if(!result)
|
||||
argument = BN_new();
|
||||
result = BN_new();
|
||||
if(!result || !argument)
|
||||
{
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_CTX_FULL);
|
||||
goto err;
|
||||
}
|
||||
if(!bn_wexpand(rsa_p, p->top) || !bn_wexpand(rsa_q, q->top) ||
|
||||
!bn_wexpand(rsa_dmp1, dmp1->top) ||
|
||||
!bn_wexpand(rsa_dmq1, dmq1->top) ||
|
||||
!bn_wexpand(rsa_iqmp, iqmp->top) ||
|
||||
!bn_wexpand(argument, a->top) ||
|
||||
|
||||
|
||||
sw_param.type = SW_ALG_CRT;
|
||||
/************************************************************************/
|
||||
/* 04/02/2003 */
|
||||
/* Modified by Frederic Giudicelli (deny-all.com) to overcome the */
|
||||
/* limitation of cswift with values not a multiple of 32 */
|
||||
/************************************************************************/
|
||||
if(!cswift_bn_32copy(&sw_param.up.crt.p, p))
|
||||
{
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
|
||||
goto err;
|
||||
}
|
||||
if(!cswift_bn_32copy(&sw_param.up.crt.q, q))
|
||||
{
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
|
||||
goto err;
|
||||
}
|
||||
if(!cswift_bn_32copy(&sw_param.up.crt.dmp1, dmp1))
|
||||
{
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
|
||||
goto err;
|
||||
}
|
||||
if(!cswift_bn_32copy(&sw_param.up.crt.dmq1, dmq1))
|
||||
{
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
|
||||
goto err;
|
||||
}
|
||||
if(!cswift_bn_32copy(&sw_param.up.crt.iqmp, iqmp))
|
||||
{
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
|
||||
goto err;
|
||||
}
|
||||
if( !bn_wexpand(argument, a->top) ||
|
||||
!bn_wexpand(result, p->top + q->top))
|
||||
{
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
|
||||
goto err;
|
||||
}
|
||||
sw_param.type = SW_ALG_CRT;
|
||||
sw_param.up.crt.p.nbytes = BN_bn2bin(p, (unsigned char *)rsa_p->d);
|
||||
sw_param.up.crt.p.value = (unsigned char *)rsa_p->d;
|
||||
sw_param.up.crt.q.nbytes = BN_bn2bin(q, (unsigned char *)rsa_q->d);
|
||||
sw_param.up.crt.q.value = (unsigned char *)rsa_q->d;
|
||||
sw_param.up.crt.dmp1.nbytes = BN_bn2bin(dmp1,
|
||||
(unsigned char *)rsa_dmp1->d);
|
||||
sw_param.up.crt.dmp1.value = (unsigned char *)rsa_dmp1->d;
|
||||
sw_param.up.crt.dmq1.nbytes = BN_bn2bin(dmq1,
|
||||
(unsigned char *)rsa_dmq1->d);
|
||||
sw_param.up.crt.dmq1.value = (unsigned char *)rsa_dmq1->d;
|
||||
sw_param.up.crt.iqmp.nbytes = BN_bn2bin(iqmp,
|
||||
(unsigned char *)rsa_iqmp->d);
|
||||
sw_param.up.crt.iqmp.value = (unsigned char *)rsa_iqmp->d;
|
||||
|
||||
/* Attach the key params */
|
||||
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
|
||||
switch(sw_status)
|
||||
@@ -654,9 +693,22 @@ static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
|
||||
to_return = 1;
|
||||
err:
|
||||
if(sw_param.up.crt.p.value)
|
||||
OPENSSL_free(sw_param.up.crt.p.value);
|
||||
if(sw_param.up.crt.q.value)
|
||||
OPENSSL_free(sw_param.up.crt.q.value);
|
||||
if(sw_param.up.crt.dmp1.value)
|
||||
OPENSSL_free(sw_param.up.crt.dmp1.value);
|
||||
if(sw_param.up.crt.dmq1.value)
|
||||
OPENSSL_free(sw_param.up.crt.dmq1.value);
|
||||
if(sw_param.up.crt.iqmp.value)
|
||||
OPENSSL_free(sw_param.up.crt.iqmp.value);
|
||||
if(result)
|
||||
BN_free(result);
|
||||
if(argument)
|
||||
BN_free(argument);
|
||||
if(acquired)
|
||||
release_context(hac);
|
||||
BN_CTX_end(ctx);
|
||||
return to_return;
|
||||
}
|
||||
|
||||
@@ -665,6 +717,27 @@ static int cswift_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa)
|
||||
{
|
||||
BN_CTX *ctx;
|
||||
int to_return = 0;
|
||||
const RSA_METHOD * def_rsa_method;
|
||||
|
||||
/* Try the limits of RSA (2048 bits) */
|
||||
if(BN_num_bytes(rsa->p) > 128 ||
|
||||
BN_num_bytes(rsa->q) > 128 ||
|
||||
BN_num_bytes(rsa->dmp1) > 128 ||
|
||||
BN_num_bytes(rsa->dmq1) > 128 ||
|
||||
BN_num_bytes(rsa->iqmp) > 128)
|
||||
{
|
||||
#ifdef RSA_NULL
|
||||
def_rsa_method=RSA_null_method();
|
||||
#else
|
||||
#if 0
|
||||
def_rsa_method=RSA_PKCS1_RSAref();
|
||||
#else
|
||||
def_rsa_method=RSA_PKCS1_SSLeay();
|
||||
#endif
|
||||
#endif
|
||||
if(def_rsa_method)
|
||||
return def_rsa_method->rsa_mod_exp(r0, I, rsa);
|
||||
}
|
||||
|
||||
if((ctx = BN_CTX_new()) == NULL)
|
||||
goto err;
|
||||
@@ -686,6 +759,26 @@ err:
|
||||
static int cswift_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
|
||||
{
|
||||
const RSA_METHOD * def_rsa_method;
|
||||
|
||||
/* Try the limits of RSA (2048 bits) */
|
||||
if(BN_num_bytes(r) > 256 ||
|
||||
BN_num_bytes(a) > 256 ||
|
||||
BN_num_bytes(m) > 256)
|
||||
{
|
||||
#ifdef RSA_NULL
|
||||
def_rsa_method=RSA_null_method();
|
||||
#else
|
||||
#if 0
|
||||
def_rsa_method=RSA_PKCS1_RSAref();
|
||||
#else
|
||||
def_rsa_method=RSA_PKCS1_SSLeay();
|
||||
#endif
|
||||
#endif
|
||||
if(def_rsa_method)
|
||||
return def_rsa_method->bn_mod_exp(r, a, p, m, ctx, m_ctx);
|
||||
}
|
||||
|
||||
return cswift_mod_exp(r, a, p, m, ctx);
|
||||
}
|
||||
|
||||
@@ -930,9 +1023,10 @@ static int cswift_rand_bytes(unsigned char *buf, int num)
|
||||
SW_CONTEXT_HANDLE hac;
|
||||
SW_STATUS swrc;
|
||||
SW_LARGENUMBER largenum;
|
||||
size_t nbytes = 0;
|
||||
int acquired = 0;
|
||||
int to_return = 0; /* assume failure */
|
||||
unsigned char buf32[1024];
|
||||
|
||||
|
||||
if (!get_context(&hac))
|
||||
{
|
||||
@@ -941,17 +1035,19 @@ static int cswift_rand_bytes(unsigned char *buf, int num)
|
||||
}
|
||||
acquired = 1;
|
||||
|
||||
while (nbytes < (size_t)num)
|
||||
/************************************************************************/
|
||||
/* 04/02/2003 */
|
||||
/* Modified by Frederic Giudicelli (deny-all.com) to overcome the */
|
||||
/* limitation of cswift with values not a multiple of 32 */
|
||||
/************************************************************************/
|
||||
|
||||
while(num >= sizeof(buf32))
|
||||
{
|
||||
largenum.value = buf;
|
||||
largenum.nbytes = sizeof(buf32);
|
||||
/* tell CryptoSwift how many bytes we want and where we want it.
|
||||
* Note: - CryptoSwift cannot do more than 4096 bytes at a time.
|
||||
* - CryptoSwift can only do multiple of 32-bits. */
|
||||
largenum.value = (SW_BYTE *) buf + nbytes;
|
||||
if (4096 > num - nbytes)
|
||||
largenum.nbytes = num - nbytes;
|
||||
else
|
||||
largenum.nbytes = 4096;
|
||||
|
||||
swrc = p_CSwift_SimpleRequest(hac, SW_CMD_RAND, NULL, 0, &largenum, 1);
|
||||
if (swrc != SW_OK)
|
||||
{
|
||||
@@ -961,14 +1057,30 @@ static int cswift_rand_bytes(unsigned char *buf, int num)
|
||||
ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf);
|
||||
goto err;
|
||||
}
|
||||
|
||||
nbytes += largenum.nbytes;
|
||||
buf += sizeof(buf32);
|
||||
num -= sizeof(buf32);
|
||||
}
|
||||
if(num)
|
||||
{
|
||||
largenum.nbytes = sizeof(buf32);
|
||||
largenum.value = buf32;
|
||||
swrc = p_CSwift_SimpleRequest(hac, SW_CMD_RAND, NULL, 0, &largenum, 1);
|
||||
if (swrc != SW_OK)
|
||||
{
|
||||
char tmpbuf[20];
|
||||
CSWIFTerr(CSWIFT_F_CSWIFT_CTRL, CSWIFT_R_REQUEST_FAILED);
|
||||
sprintf(tmpbuf, "%ld", swrc);
|
||||
ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf);
|
||||
goto err;
|
||||
}
|
||||
memcpy(buf, largenum.value, num);
|
||||
}
|
||||
to_return = 1; /* success */
|
||||
|
||||
to_return = 1; /* success */
|
||||
err:
|
||||
if (acquired)
|
||||
release_context(hac);
|
||||
|
||||
return to_return;
|
||||
}
|
||||
|
||||
|
@@ -454,6 +454,7 @@ static int ubsec_init(ENGINE *e)
|
||||
err:
|
||||
if(ubsec_dso)
|
||||
DSO_free(ubsec_dso);
|
||||
ubsec_dso = NULL;
|
||||
p_UBSEC_ubsec_bytes_to_bits = NULL;
|
||||
p_UBSEC_ubsec_bits_to_bytes = NULL;
|
||||
p_UBSEC_ubsec_open = NULL;
|
||||
|
@@ -94,7 +94,7 @@ int ENGINE_set_default_DSA(ENGINE *e)
|
||||
{
|
||||
if(e->dsa_meth)
|
||||
return engine_table_register(&dsa_table,
|
||||
engine_unregister_all_DSA, e, &dummy_nid, 1, 0);
|
||||
engine_unregister_all_DSA, e, &dummy_nid, 1, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/err/Makefile
|
||||
# OpenSSL/crypto/err/Makefile
|
||||
#
|
||||
|
||||
DIR= err
|
||||
|
@@ -621,7 +621,8 @@ static void err_load_strings(int lib, ERR_STRING_DATA *str)
|
||||
{
|
||||
while (str->error)
|
||||
{
|
||||
str->error|=ERR_PACK(lib,0,0);
|
||||
if (lib)
|
||||
str->error|=ERR_PACK(lib,0,0);
|
||||
ERRFN(err_set_item)(str);
|
||||
str++;
|
||||
}
|
||||
@@ -637,7 +638,8 @@ void ERR_unload_strings(int lib, ERR_STRING_DATA *str)
|
||||
{
|
||||
while (str->error)
|
||||
{
|
||||
str->error|=ERR_PACK(lib,0,0);
|
||||
if (lib)
|
||||
str->error|=ERR_PACK(lib,0,0);
|
||||
ERRFN(err_del_item)(str);
|
||||
str++;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/evp/Makefile
|
||||
# OpenSSL/crypto/evp/Makefile
|
||||
#
|
||||
|
||||
DIR= evp
|
||||
|
@@ -71,7 +71,7 @@ static int enc_new(BIO *h);
|
||||
static int enc_free(BIO *data);
|
||||
static long enc_callback_ctrl(BIO *h, int cmd, bio_info_cb *fps);
|
||||
#define ENC_BLOCK_SIZE (1024*4)
|
||||
#define BUF_OFFSET EVP_MAX_BLOCK_LENGTH
|
||||
#define BUF_OFFSET (EVP_MAX_BLOCK_LENGTH*2)
|
||||
|
||||
typedef struct enc_struct
|
||||
{
|
||||
|
@@ -99,5 +99,15 @@ void OpenSSL_add_all_digests(void)
|
||||
EVP_add_digest(EVP_ripemd160());
|
||||
EVP_add_digest_alias(SN_ripemd160,"ripemd");
|
||||
EVP_add_digest_alias(SN_ripemd160,"rmd160");
|
||||
#endif
|
||||
#ifdef OPENSSL_FIPS
|
||||
#ifndef OPENSSL_NO_SHA256
|
||||
EVP_add_digest(EVP_sha224());
|
||||
EVP_add_digest(EVP_sha256());
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SHA512
|
||||
EVP_add_digest(EVP_sha384());
|
||||
EVP_add_digest(EVP_sha512());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@@ -86,9 +86,9 @@ IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY,
|
||||
|
||||
#define IMPLEMENT_AES_CFBR(ksize,cbits,flags) IMPLEMENT_CFBR(aes,AES,EVP_AES_KEY,ks,ksize,cbits,16,flags)
|
||||
|
||||
IMPLEMENT_AES_CFBR(128,1,0)
|
||||
IMPLEMENT_AES_CFBR(192,1,0)
|
||||
IMPLEMENT_AES_CFBR(256,1,0)
|
||||
IMPLEMENT_AES_CFBR(128,1,EVP_CIPH_FLAG_FIPS)
|
||||
IMPLEMENT_AES_CFBR(192,1,EVP_CIPH_FLAG_FIPS)
|
||||
IMPLEMENT_AES_CFBR(256,1,EVP_CIPH_FLAG_FIPS)
|
||||
|
||||
IMPLEMENT_AES_CFBR(128,8,EVP_CIPH_FLAG_FIPS)
|
||||
IMPLEMENT_AES_CFBR(192,8,EVP_CIPH_FLAG_FIPS)
|
||||
|
@@ -313,7 +313,7 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
|
||||
/* There will never be more than two '=' */
|
||||
}
|
||||
|
||||
if ((v == B64_EOF) || (n >= 64))
|
||||
if ((v == B64_EOF && (n&3) == 0) || (n >= 64))
|
||||
{
|
||||
/* This is needed to work correctly on 64 byte input
|
||||
* lines. We process the line and then need to
|
||||
|
@@ -84,7 +84,11 @@
|
||||
#include <openssl/md5.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SHA
|
||||
#ifndef OPENSSL_FIPS
|
||||
#include <openssl/sha.h>
|
||||
#else
|
||||
#include <openssl/fips_sha.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_RIPEMD
|
||||
#include <openssl/ripemd.h>
|
||||
@@ -128,7 +132,11 @@
|
||||
#define EVP_CAST5_KEY_SIZE 16
|
||||
#define EVP_RC5_32_12_16_KEY_SIZE 16
|
||||
*/
|
||||
#define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define EVP_MAX_MD_SIZE 64 /* longest known SHA512 */
|
||||
#else
|
||||
#define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */
|
||||
#endif
|
||||
#define EVP_MAX_KEY_LENGTH 32
|
||||
#define EVP_MAX_IV_LENGTH 16
|
||||
#define EVP_MAX_BLOCK_LENGTH 32
|
||||
@@ -642,6 +650,16 @@ const EVP_MD *EVP_sha(void);
|
||||
const EVP_MD *EVP_sha1(void);
|
||||
const EVP_MD *EVP_dss(void);
|
||||
const EVP_MD *EVP_dss1(void);
|
||||
#ifdef OPENSSL_FIPS
|
||||
#ifndef OPENSSL_NO_SHA256
|
||||
const EVP_MD *EVP_sha224(void);
|
||||
const EVP_MD *EVP_sha256(void);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SHA512
|
||||
const EVP_MD *EVP_sha384(void);
|
||||
const EVP_MD *EVP_sha512(void);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_MDC2
|
||||
const EVP_MD *EVP_mdc2(void);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user