Compare commits
164 Commits
OpenSSL_0_
...
OpenSSL-en
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7b24a1a33b | ||
![]() |
393a9b68cf | ||
![]() |
4ae5099856 | ||
![]() |
5c36f01000 | ||
![]() |
6ef9d8328b | ||
![]() |
5a9c441c6e | ||
![]() |
d69d8b5ffa | ||
![]() |
9aef355cf0 | ||
![]() |
11f3f9f4a1 | ||
![]() |
ef9088c9ec | ||
![]() |
422830e17b | ||
![]() |
ac0d075faa | ||
![]() |
53195ba215 | ||
![]() |
6b4580887e | ||
![]() |
4c37da8051 | ||
![]() |
381798377e | ||
![]() |
ffade5fb96 | ||
![]() |
0294674b44 | ||
![]() |
771c8a7ce5 | ||
![]() |
a307eeba84 | ||
![]() |
1fbc936cca | ||
![]() |
ac63f88790 | ||
![]() |
ecfb406f1e | ||
![]() |
df9badad4c | ||
![]() |
c4af8daf34 | ||
![]() |
b4ac8b1e0a | ||
![]() |
adccc4cc7e | ||
![]() |
bbc89d2e1f | ||
![]() |
1e6c9fc26f | ||
![]() |
3d4bb90138 | ||
![]() |
c540bd2851 | ||
![]() |
6ad0776236 | ||
![]() |
ca7fcc65ef | ||
![]() |
cd9bed6d1d | ||
![]() |
c80abb148d | ||
![]() |
757ab9b506 | ||
![]() |
868af8e4be | ||
![]() |
e100946038 | ||
![]() |
5209202f3b | ||
![]() |
73701c27b3 | ||
![]() |
4ef897d1fc | ||
![]() |
19a5e404cb | ||
![]() |
e3f527177b | ||
![]() |
f09a419c6a | ||
![]() |
f4bdbfea66 | ||
![]() |
f00ba75c69 | ||
![]() |
47dc5a1321 | ||
![]() |
3476515195 | ||
![]() |
e1db7a5e30 | ||
![]() |
4839df4061 | ||
![]() |
9cfb6bbd29 | ||
![]() |
27f00db152 | ||
![]() |
a9c33b529e | ||
![]() |
5deb47f12a | ||
![]() |
775c289db5 | ||
![]() |
099f5bfeba | ||
![]() |
103a604932 | ||
![]() |
12f49bd79d | ||
![]() |
4b250a3d25 | ||
![]() |
c200ff0446 | ||
![]() |
a7ce1f0514 | ||
![]() |
4cae3ac371 | ||
![]() |
63ccddf717 | ||
![]() |
ce6990739e | ||
![]() |
42cc160301 | ||
![]() |
0e61cfff53 | ||
![]() |
f77600524f | ||
![]() |
ebcdd0c43e | ||
![]() |
8de7587e02 | ||
![]() |
90ac586317 | ||
![]() |
15c0fb18a2 | ||
![]() |
f30839ecaa | ||
![]() |
eb31944f81 | ||
![]() |
0dcf7fd543 | ||
![]() |
02539402af | ||
![]() |
2be9694116 | ||
![]() |
b46ba9b1bc | ||
![]() |
8e1ec9fb37 | ||
![]() |
dc005a7367 | ||
![]() |
da867a51a0 | ||
![]() |
25814b9690 | ||
![]() |
0fc7c5010d | ||
![]() |
166e1f304b | ||
![]() |
ef413a7ee8 | ||
![]() |
dcd4d341e1 | ||
![]() |
61b337bd22 | ||
![]() |
06b71aec85 | ||
![]() |
527cc9841c | ||
![]() |
6901ba7dc8 | ||
![]() |
ab13064406 | ||
![]() |
192295a094 | ||
![]() |
7dfded5c26 | ||
![]() |
28b3b4c6e6 | ||
![]() |
acab12fbe3 | ||
![]() |
1ba5b1b530 | ||
![]() |
d786112124 | ||
![]() |
bdecf23415 | ||
![]() |
03ef63ba69 | ||
![]() |
cb9c5dc571 | ||
![]() |
a6f8bbcad9 | ||
![]() |
9f10f9beeb | ||
![]() |
a46229b43f | ||
![]() |
c7a48d3d00 | ||
![]() |
9188480827 | ||
![]() |
2b912846b9 | ||
![]() |
854067e8e4 | ||
![]() |
eb2f937b93 | ||
![]() |
64c4f5732d | ||
![]() |
f3052a9eee | ||
![]() |
e1e9ead6fb | ||
![]() |
5ac85984ec | ||
![]() |
e11b297730 | ||
![]() |
48555cf0fc | ||
![]() |
ae02fc5348 | ||
![]() |
93e147dd32 | ||
![]() |
3257904c56 | ||
![]() |
2a7619d762 | ||
![]() |
70d03c4f59 | ||
![]() |
5971d37400 | ||
![]() |
d813a428a7 | ||
![]() |
3b2972d8d9 | ||
![]() |
2165d91196 | ||
![]() |
fc99c92835 | ||
![]() |
1dde74f229 | ||
![]() |
665b5ab5a7 | ||
![]() |
13232559fc | ||
![]() |
1b2f8b6e2a | ||
![]() |
ccd98b43ed | ||
![]() |
d32e8acf08 | ||
![]() |
d8c4d0e819 | ||
![]() |
b215f70a0e | ||
![]() |
7ed20a2158 | ||
![]() |
6c62150674 | ||
![]() |
aa23a57918 | ||
![]() |
8e2c277353 | ||
![]() |
f18ef82a9f | ||
![]() |
cc015c48db | ||
![]() |
9a4051050c | ||
![]() |
4c4ea428cc | ||
![]() |
28e94dc70d | ||
![]() |
f812743544 | ||
![]() |
87f3435f78 | ||
![]() |
86787f93d6 | ||
![]() |
05d909c549 | ||
![]() |
d44c7dcf00 | ||
![]() |
5decfb7002 | ||
![]() |
50008364a6 | ||
![]() |
6a1129837a | ||
![]() |
20ca3d49e7 | ||
![]() |
f156d5495d | ||
![]() |
96d7e0ece7 | ||
![]() |
974e22704d | ||
![]() |
835475a2d6 | ||
![]() |
a26f2b5e62 | ||
![]() |
67e08eb185 | ||
![]() |
0b4cb28f39 | ||
![]() |
9c5ed502ee | ||
![]() |
6111f7408b | ||
![]() |
b6577e040e | ||
![]() |
bb51f21728 | ||
![]() |
0e0e569cbf | ||
![]() |
71c8e9f1c3 | ||
![]() |
e759b095d4 | ||
![]() |
afa0598f06 |
362
CHANGES
362
CHANGES
@@ -2,362 +2,6 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 0.9.6c and 0.9.6d [XX xxx XXXX]
|
||||
|
||||
*) Check various X509_...() return values in apps/req.c.
|
||||
[Nils Larsch <nla@trustcenter.de>]
|
||||
|
||||
*) Fix BASE64 decode (EVP_DecodeUpdate) for data with CR/LF ended lines:
|
||||
an end-of-file condition would erronously be flagged, when the CRLF
|
||||
was just at the end of a processed block. The bug was discovered when
|
||||
processing data through a buffering memory BIO handing the data to a
|
||||
BASE64-decoding BIO. Bug fund and patch submitted by Pavel Tsekov
|
||||
<ptsekov@syntrex.com> and Nedelcho Stanev.
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Implement a countermeasure against a vulnerability recently found
|
||||
in CBC ciphersuites in SSL 3.0/TLS 1.0: Send an empty fragment
|
||||
before application data chunks to avoid the use of known IVs
|
||||
with data potentially chosen by the attacker.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Fix length checks in ssl3_get_client_hello().
|
||||
[Bodo Moeller]
|
||||
|
||||
*) TLS/SSL library bugfix: use s->s3->in_read_app_data differently
|
||||
to prevent ssl3_read_internal() from incorrectly assuming that
|
||||
ssl3_read_bytes() found application data while handshake
|
||||
processing was enabled when in fact s->s3->in_read_app_data was
|
||||
merely automatically cleared during the initial handshake.
|
||||
[Bodo Moeller; problem pointed out by Arne Ansper <arne@ats.cyber.ee>]
|
||||
|
||||
*) Fix object definitions for Private and Enterprise: they were not
|
||||
recognized in their shortname (=lowercase) representation. Extend
|
||||
obj_dat.pl to issue an error when using undefined keywords instead
|
||||
of silently ignoring the problem (Svenning Sorensen
|
||||
<sss@sss.dnsalias.net>).
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Fix DH_generate_parameters() so that it works for 'non-standard'
|
||||
generators, i.e. generators other than 2 and 5. (Previously, the
|
||||
code did not properly initialise the 'add' and 'rem' values to
|
||||
BN_generate_prime().)
|
||||
|
||||
In the new general case, we do not insist that 'generator' is
|
||||
actually a primitive root: This requirement is rather pointless;
|
||||
a generator of the order-q subgroup is just as good, if not
|
||||
better.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Map new X509 verification errors to alerts. Discovered and submitted by
|
||||
Tom Wu <tom@arcot.com>.
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Fix ssl3_pending() (ssl/s3_lib.c) to prevent SSL_pending() from
|
||||
returning non-zero before the data has been completely received
|
||||
when using non-blocking I/O.
|
||||
[Bodo Moeller; problem pointed out by John Hughes]
|
||||
|
||||
*) Some of the ciphers missed the strength entry (SSL_LOW etc).
|
||||
[Ben Laurie, Lutz Jaenicke]
|
||||
|
||||
*) Fix bug in SSL_clear(): bad sessions were not removed (found by
|
||||
Yoram Zahavi <YoramZ@gilian.com>).
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Add information about CygWin 1.3 and on, and preserve proper
|
||||
configuration for the versions before that.
|
||||
[Corinna Vinschen <vinschen@redhat.com> and Richard Levitte]
|
||||
|
||||
*) Make removal from session cache (SSL_CTX_remove_session()) more robust:
|
||||
check whether we deal with a copy of a session and do not delete from
|
||||
the cache in this case. Problem reported by "Izhar Shoshani Levi"
|
||||
<izhar@checkpoint.com>.
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Do not store session data into the internal session cache, if it
|
||||
is never intended to be looked up (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
|
||||
flag is set). Proposed by Aslam <aslam@funk.com>.
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Have ASN1_BIT_STRING_set_bit() really clear a bit when the requested
|
||||
value is 0.
|
||||
[Richard Levitte]
|
||||
|
||||
*) [In 0.9.6c-engine release:]
|
||||
Fix a crashbug and a logic bug in hwcrhk_load_pubkey()
|
||||
[Toomas Kiisk <vix@cyber.ee> via Richard Levitte]
|
||||
|
||||
*) Add the configuration target linux-s390x.
|
||||
[Neale Ferguson <Neale.Ferguson@SoftwareAG-USA.com> via Richard Levitte]
|
||||
|
||||
*) The earlier bugfix for the SSL3_ST_SW_HELLO_REQ_C case of
|
||||
ssl3_accept (ssl/s3_srvr.c) incorrectly used a local flag
|
||||
variable as an indication that a ClientHello message has been
|
||||
received. As the flag value will be lost between multiple
|
||||
invocations of ssl3_accept when using non-blocking I/O, the
|
||||
function may not be aware that a handshake has actually taken
|
||||
place, thus preventing a new session from being added to the
|
||||
session cache.
|
||||
|
||||
To avoid this problem, we now set s->new_session to 2 instead of
|
||||
using a local variable.
|
||||
[Lutz Jaenicke, Bodo Moeller]
|
||||
|
||||
*) Bugfix: Return -1 from ssl3_get_server_done (ssl3/s3_clnt.c)
|
||||
if the SSL_R_LENGTH_MISMATCH error is detected.
|
||||
[Geoff Thorpe, Bodo Moeller]
|
||||
|
||||
*) New 'shared_ldflag' column in Configure platform table.
|
||||
[Richard Levitte]
|
||||
|
||||
*) Fix EVP_CIPHER_mode macro.
|
||||
["Dan S. Camper" <dan@bti.net>]
|
||||
|
||||
*) Fix ssl3_read_bytes (ssl/s3_pkt.c): To ignore messages of unknown
|
||||
type, we must throw them away by setting rr->length to 0.
|
||||
[D P Chang <dpc@qualys.com>]
|
||||
|
||||
Changes between 0.9.6b and 0.9.6c [21 dec 2001]
|
||||
|
||||
*) Fix BN_rand_range bug pointed out by Dominikus Scherkl
|
||||
<Dominikus.Scherkl@biodata.com>. (The previous implementation
|
||||
worked incorrectly for those cases where range = 10..._2 and
|
||||
3*range is two bits longer than range.)
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Only add signing time to PKCS7 structures if it is not already
|
||||
present.
|
||||
[Steve Henson]
|
||||
|
||||
*) Fix crypto/objects/objects.h: "ld-ce" should be "id-ce",
|
||||
OBJ_ld_ce should be OBJ_id_ce.
|
||||
Also some ip-pda OIDs in crypto/objects/objects.txt were
|
||||
incorrect (cf. RFC 3039).
|
||||
[Matt Cooper, Frederic Giudicelli, Bodo Moeller]
|
||||
|
||||
*) Release CRYPTO_LOCK_DYNLOCK when CRYPTO_destroy_dynlockid()
|
||||
returns early because it has nothing to do.
|
||||
[Andy Schneider <andy.schneider@bjss.co.uk>]
|
||||
|
||||
*) [In 0.9.6c-engine release:]
|
||||
Fix mutex callback return values in crypto/engine/hw_ncipher.c.
|
||||
[Andy Schneider <andy.schneider@bjss.co.uk>]
|
||||
|
||||
*) [In 0.9.6c-engine release:]
|
||||
Add support for Cryptographic Appliance's keyserver technology.
|
||||
(Use engine 'keyclient')
|
||||
[Cryptographic Appliances and Geoff Thorpe]
|
||||
|
||||
*) Add a configuration entry for OS/390 Unix. The C compiler 'c89'
|
||||
is called via tools/c89.sh because arguments have to be
|
||||
rearranged (all '-L' options must appear before the first object
|
||||
modules).
|
||||
[Richard Shapiro <rshapiro@abinitio.com>]
|
||||
|
||||
*) [In 0.9.6c-engine release:]
|
||||
Add support for Broadcom crypto accelerator cards, backported
|
||||
from 0.9.7.
|
||||
[Broadcom, Nalin Dahyabhai <nalin@redhat.com>, Mark Cox]
|
||||
|
||||
*) [In 0.9.6c-engine release:]
|
||||
Add support for SureWare crypto accelerator cards from
|
||||
Baltimore Technologies. (Use engine 'sureware')
|
||||
[Baltimore Technologies and Mark Cox]
|
||||
|
||||
*) [In 0.9.6c-engine release:]
|
||||
Add support for crypto accelerator cards from Accelerated
|
||||
Encryption Processing, www.aep.ie. (Use engine 'aep')
|
||||
[AEP Inc. and Mark Cox]
|
||||
|
||||
*) Add a configuration entry for gcc on UnixWare.
|
||||
[Gary Benson <gbenson@redhat.com>]
|
||||
|
||||
*) Change ssl/s2_clnt.c and ssl/s2_srvr.c so that received handshake
|
||||
messages are stored in a single piece (fixed-length part and
|
||||
variable-length part combined) and fix various bugs found on the way.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Disable caching in BIO_gethostbyname(), directly use gethostbyname()
|
||||
instead. BIO_gethostbyname() does not know what timeouts are
|
||||
appropriate, so entries would stay in cache even when they have
|
||||
become invalid.
|
||||
[Bodo Moeller; problem pointed out by Rich Salz <rsalz@zolera.com>
|
||||
|
||||
*) Change ssl23_get_client_hello (ssl/s23_srvr.c) behaviour when
|
||||
faced with a pathologically small ClientHello fragment that does
|
||||
not contain client_version: Instead of aborting with an error,
|
||||
simply choose the highest available protocol version (i.e.,
|
||||
TLS 1.0 unless it is disabled). In practice, ClientHello
|
||||
messages are never sent like this, but this change gives us
|
||||
strictly correct behaviour at least for TLS.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Fix SSL handshake functions and SSL_clear() such that SSL_clear()
|
||||
never resets s->method to s->ctx->method when called from within
|
||||
one of the SSL handshake functions.
|
||||
[Bodo Moeller; problem pointed out by Niko Baric]
|
||||
|
||||
*) In ssl3_get_client_hello (ssl/s3_srvr.c), generate a fatal alert
|
||||
(sent using the client's version number) if client_version is
|
||||
smaller than the protocol version in use. Also change
|
||||
ssl23_get_client_hello (ssl/s23_srvr.c) to select TLS 1.0 if
|
||||
the client demanded SSL 3.0 but only TLS 1.0 is enabled; then
|
||||
the client will at least see that alert.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Fix ssl3_get_message (ssl/s3_both.c) to handle message fragmentation
|
||||
correctly.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Avoid infinite loop in ssl3_get_message (ssl/s3_both.c) if a
|
||||
client receives HelloRequest while in a handshake.
|
||||
[Bodo Moeller; bug noticed by Andy Schneider <andy.schneider@bjss.co.uk>]
|
||||
|
||||
*) Bugfix in ssl3_accept (ssl/s3_srvr.c): Case SSL3_ST_SW_HELLO_REQ_C
|
||||
should end in 'break', not 'goto end' which circuments various
|
||||
cleanups done in state SSL_ST_OK. But session related stuff
|
||||
must be disabled for SSL_ST_OK in the case that we just sent a
|
||||
HelloRequest.
|
||||
|
||||
Also avoid some overhead by not calling ssl_init_wbio_buffer()
|
||||
before just sending a HelloRequest.
|
||||
[Bodo Moeller, Eric Rescorla <ekr@rtfm.com>]
|
||||
|
||||
*) Fix ssl/s3_enc.c, ssl/t1_enc.c and ssl/s3_pkt.c so that we don't
|
||||
reveal whether illegal block cipher padding was found or a MAC
|
||||
verification error occured. (Neither SSLerr() codes nor alerts
|
||||
are directly visible to potential attackers, but the information
|
||||
may leak via logfiles.)
|
||||
|
||||
Similar changes are not required for the SSL 2.0 implementation
|
||||
because the number of padding bytes is sent in clear for SSL 2.0,
|
||||
and the extra bytes are just ignored. However ssl/s2_pkt.c
|
||||
failed to verify that the purported number of padding bytes is in
|
||||
the legal range.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Add OpenUNIX-8 support including shared libraries
|
||||
(Boyd Lynn Gerber <gerberb@zenez.com>).
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Improve RSA_padding_check_PKCS1_OAEP() check again to avoid
|
||||
'wristwatch attack' using huge encoding parameters (cf.
|
||||
James H. Manger's CRYPTO 2001 paper). Note that the
|
||||
RSA_PKCS1_OAEP_PADDING case of RSA_private_decrypt() does not use
|
||||
encoding parameters and hence was not vulnerable.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) BN_sqr() bug fix.
|
||||
[Ulf M<>ller, reported by Jim Ellis <jim.ellis@cavium.com>]
|
||||
|
||||
*) Rabin-Miller test analyses assume uniformly distributed witnesses,
|
||||
so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
|
||||
followed by modular reduction.
|
||||
[Bodo Moeller; pointed out by Adam Young <AYoung1@NCSUS.JNJ.COM>]
|
||||
|
||||
*) Add BN_pseudo_rand_range() with obvious functionality: BN_rand_range()
|
||||
equivalent based on BN_pseudo_rand() instead of BN_rand().
|
||||
[Bodo Moeller]
|
||||
|
||||
*) s3_srvr.c: allow sending of large client certificate lists (> 16 kB).
|
||||
This function was broken, as the check for a new client hello message
|
||||
to handle SGC did not allow these large messages.
|
||||
(Tracked down by "Douglas E. Engert" <deengert@anl.gov>.)
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Add alert descriptions for TLSv1 to SSL_alert_desc_string[_long]().
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Fix buggy behaviour of BIO_get_num_renegotiates() and BIO_ctrl()
|
||||
for BIO_C_GET_WRITE_BUF_SIZE ("Stephen Hinton" <shinton@netopia.com>).
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Rework the configuration and shared library support for Tru64 Unix.
|
||||
The configuration part makes use of modern compiler features and
|
||||
still retains old compiler behavior for those that run older versions
|
||||
of the OS. The shared library support part includes a variant that
|
||||
uses the RPATH feature, and is available through the special
|
||||
configuration target "alpha-cc-rpath", which will never be selected
|
||||
automatically.
|
||||
[Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> via Richard Levitte]
|
||||
|
||||
*) In ssl3_get_key_exchange (ssl/s3_clnt.c), call ssl3_get_message()
|
||||
with the same message size as in ssl3_get_certificate_request().
|
||||
Otherwise, if no ServerKeyExchange message occurs, CertificateRequest
|
||||
messages might inadvertently be reject as too long.
|
||||
[Petr Lampa <lampa@fee.vutbr.cz>]
|
||||
|
||||
*) Enhanced support for IA-64 Unix platforms (well, Linux and HP-UX).
|
||||
[Andy Polyakov]
|
||||
|
||||
*) Modified SSL library such that the verify_callback that has been set
|
||||
specificly for an SSL object with SSL_set_verify() is actually being
|
||||
used. Before the change, a verify_callback set with this function was
|
||||
ignored and the verify_callback() set in the SSL_CTX at the time of
|
||||
the call was used. New function X509_STORE_CTX_set_verify_cb() introduced
|
||||
to allow the necessary settings.
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) Initialize static variable in crypto/dsa/dsa_lib.c and crypto/dh/dh_lib.c
|
||||
explicitly to NULL, as at least on Solaris 8 this seems not always to be
|
||||
done automatically (in contradiction to the requirements of the C
|
||||
standard). This made problems when used from OpenSSH.
|
||||
[Lutz Jaenicke]
|
||||
|
||||
*) In OpenSSL 0.9.6a and 0.9.6b, crypto/dh/dh_key.c ignored
|
||||
dh->length and always used
|
||||
|
||||
BN_rand_range(priv_key, dh->p).
|
||||
|
||||
BN_rand_range() is not necessary for Diffie-Hellman, and this
|
||||
specific range makes Diffie-Hellman unnecessarily inefficient if
|
||||
dh->length (recommended exponent length) is much smaller than the
|
||||
length of dh->p. We could use BN_rand_range() if the order of
|
||||
the subgroup was stored in the DH structure, but we only have
|
||||
dh->length.
|
||||
|
||||
So switch back to
|
||||
|
||||
BN_rand(priv_key, l, ...)
|
||||
|
||||
where 'l' is dh->length if this is defined, or BN_num_bits(dh->p)-1
|
||||
otherwise.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) In
|
||||
|
||||
RSA_eay_public_encrypt
|
||||
RSA_eay_private_decrypt
|
||||
RSA_eay_private_encrypt (signing)
|
||||
RSA_eay_public_decrypt (signature verification)
|
||||
|
||||
(default implementations for RSA_public_encrypt,
|
||||
RSA_private_decrypt, RSA_private_encrypt, RSA_public_decrypt),
|
||||
always reject numbers >= n.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) In crypto/rand/md_rand.c, use a new short-time lock CRYPTO_LOCK_RAND2
|
||||
to synchronize access to 'locking_thread'. This is necessary on
|
||||
systems where access to 'locking_thread' (an 'unsigned long'
|
||||
variable) is not atomic.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) In crypto/rand/md_rand.c, set 'locking_thread' to current thread's ID
|
||||
*before* setting the 'crypto_lock_rand' flag. The previous code had
|
||||
a race condition if 0 is a valid thread ID.
|
||||
[Travis Vitek <vitek@roguewave.com>]
|
||||
|
||||
*) Add support for shared libraries under Irix.
|
||||
[Albert Chin-A-Young <china@thewrittenword.com>]
|
||||
|
||||
*) Add configuration option to build on Linux on both big-endian and
|
||||
little-endian MIPS.
|
||||
[Ralf Baechle <ralf@uni-koblenz.de>]
|
||||
|
||||
*) Add the possibility to create shared libraries on HP-UX.
|
||||
[Richard Levitte]
|
||||
|
||||
Changes between 0.9.6a and 0.9.6b [9 Jul 2001]
|
||||
|
||||
*) Change ssleay_rand_bytes (crypto/rand/md_rand.c)
|
||||
@@ -412,7 +56,7 @@
|
||||
[Ulf M<>ller, Bodo M<>ller]
|
||||
|
||||
*) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
|
||||
RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
|
||||
RSA encryption was accidentily removed in s3_srvr.c in OpenSSL 0.9.5
|
||||
when fixing the server behaviour for backwards-compatible 'client
|
||||
hello' messages. (Note that the attack is impractical against
|
||||
SSL 3.0 and TLS 1.0 anyway because length and version checking
|
||||
@@ -462,7 +106,7 @@
|
||||
combination of a flag and a thread ID variable.
|
||||
Otherwise while one thread is in ssleay_rand_bytes (which sets the
|
||||
flag), *other* threads can enter ssleay_add_bytes without obeying
|
||||
the CRYPTO_LOCK_RAND lock (and may even illegally release the lock
|
||||
the CRYPTO_LOCK_RAND lock (and may even illegaly release the lock
|
||||
that they do not hold after the first thread unsets add_do_not_lock).
|
||||
[Bodo Moeller]
|
||||
|
||||
@@ -1104,7 +748,7 @@
|
||||
default is static libraries only, and the OpenSSL programs
|
||||
are always statically linked for now, but there are
|
||||
preparations for dynamic linking in place.
|
||||
This has been tested on Linux and Tru64.
|
||||
This has been tested on Linux and True64.
|
||||
[Richard Levitte]
|
||||
|
||||
*) Randomness polling function for Win9x, as described in:
|
||||
|
341
Configure
341
Configure
@@ -10,7 +10,7 @@ use strict;
|
||||
|
||||
# see INSTALL for instructions.
|
||||
|
||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--test-sanity] os/compiler[:flags]\n";
|
||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] os/compiler[:flags]\n";
|
||||
|
||||
# Options:
|
||||
#
|
||||
@@ -23,14 +23,20 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
|
||||
# default). This needn't be set in advance, you can
|
||||
# just as well use "make INSTALL_PREFIX=/whatever install".
|
||||
#
|
||||
# --test-sanity Make a number of sanity checks on the data in this file.
|
||||
# This is a debugging tool for OpenSSL developers.
|
||||
#
|
||||
# no-hw-xxx do not compile support for specific crypto hardware.
|
||||
# Generic OpenSSL-style methods relating to this support
|
||||
# are always compiled but return NULL if the hardware
|
||||
# support isn't compiled.
|
||||
# no-hw do not compile support for any crypto hardware.
|
||||
# rsaref use RSAref
|
||||
# [no-]threads [don't] try to create a library that is suitable for
|
||||
# multithreaded applications (default is "threads" if we
|
||||
# know how to do it)
|
||||
# [no-]shared [don't] try to create shared libraries when supported.
|
||||
# IT IS NOT RECOMMENDED TO USE "shared"! Since this is a
|
||||
# development branch, the positions of the ENGINE symbols
|
||||
# in the transfer vector are constantly moving, so binary
|
||||
# backward compatibility can't be guaranteed in any way.
|
||||
# no-asm do not use assembler
|
||||
# no-dso do not compile in any native shared-library methods. This
|
||||
# will ensure that all methods just return NULL.
|
||||
@@ -100,7 +106,7 @@ my $alpha_asm="::::::::";
|
||||
# -DB_ENDIAN slows things down on a sparc for md5, but helps sha1.
|
||||
# So the md5_locl.h file has an undef B_ENDIAN if sun is defined
|
||||
|
||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $lflags : $bn_ops : $bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib
|
||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $lflags : $bn_ops : $bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag
|
||||
|
||||
my %table=(
|
||||
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
|
||||
@@ -119,10 +125,10 @@ my %table=(
|
||||
"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
|
||||
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown):::::",
|
||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn",
|
||||
"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn",
|
||||
"dist", "cc:-O::(unknown):::::",
|
||||
|
||||
# Basic configs that should work on any (32 and less bit) box
|
||||
@@ -135,35 +141,35 @@ my %table=(
|
||||
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
|
||||
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
|
||||
# error message.
|
||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:gnu-shared:-fPIC:.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)",
|
||||
"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)",
|
||||
|
||||
#### 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::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"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:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
|
||||
# but keep the assembler modules.
|
||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
####
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### 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:.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 -DULTRASPARC::-D_REENTRANT:-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 -DULTRASPARC::-D_REENTRANT:-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:.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 -DULTRASPARC::-D_REENTRANT:-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 -DULTRASPARC::-D_REENTRANT:-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:.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 -DULTRASPARC::-D_REENTRANT:-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:.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 -DULTRASPARC::-D_REENTRANT:-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)",
|
||||
|
||||
#### 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::",
|
||||
@@ -172,7 +178,7 @@ my %table=(
|
||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o::::",
|
||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
||||
# -Wa,-Av8plus should do the trick no matter what.
|
||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
# !!!Folowing can't be even tested yet!!!
|
||||
# We have to wait till 64-bit glibc for SPARC is operational!!!
|
||||
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
||||
@@ -183,17 +189,17 @@ my %table=(
|
||||
|
||||
#### IRIX 5.x configs
|
||||
# -mips2 flag is added by ./config when appropriate.
|
||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:::",
|
||||
#### IRIX 6.x configs
|
||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
||||
# './Configure irix-[g]cc' manually.
|
||||
# -mips4 flag is added by ./config when appropriate.
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}",
|
||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}",
|
||||
# N64 ABI builds.
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}",
|
||||
|
||||
#### Unified HP-UX ANSI C configs.
|
||||
# Special notes:
|
||||
@@ -225,44 +231,41 @@ 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:::-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:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
"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",
|
||||
|
||||
# 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 +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-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 +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-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 +Olibcalls -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-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
|
||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl",
|
||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -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",
|
||||
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
|
||||
|
||||
# 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):-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):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
# 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):-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):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
|
||||
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-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):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
# If hpux-gcc fails, try this one:
|
||||
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.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-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
|
||||
# HPUX 10.X config. Supports threads.
|
||||
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT:-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:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
# 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:-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:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
|
||||
"hpux10-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-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:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
# If hpux10-gcc fails, try this one:
|
||||
"hpux10-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-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:-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
|
||||
# HPUX 11.X from www.globus.org.
|
||||
# Only works on PA-RISC 2.0 cpus, and not optimized. Why?
|
||||
@@ -273,43 +276,13 @@ my %table=(
|
||||
#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
|
||||
"MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
|
||||
#### PARISC Linux setups
|
||||
"linux-parisc","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
|
||||
|
||||
# Dec Alpha, OSF/1 - the alpha164-cc is historical, for the conversion
|
||||
# from the older DEC C Compiler to the newer compiler. It's now the
|
||||
# same as the preferred entry, alpha-cc. If you are still using the
|
||||
# older compiler (you're at 3.x or earlier, or perhaps very early 4.x)
|
||||
# you should use `alphaold-cc'.
|
||||
#
|
||||
# "What's in a name? That which we call a rose
|
||||
# By any other word would smell as sweet."
|
||||
#
|
||||
# - William Shakespeare, "Romeo & Juliet", Act II, scene II.
|
||||
#
|
||||
# For OSF/1 3.2b and earlier, and Digital UNIX 3.2c - 3.2g, with the
|
||||
# vendor compiler, use alphaold-cc.
|
||||
# For Digital UNIX 4.0 - 4.0e, with the vendor compiler, use alpha-cc.
|
||||
# For Tru64 UNIX 4.f - current, with the vendor compiler, use alpha-cc.
|
||||
#
|
||||
# There's also an alternate target available (which `config' will never
|
||||
# select) called alpha-cc-rpath. This target builds an RPATH into the
|
||||
# shared libraries, which is very convenient on Tru64 since binaries
|
||||
# linked against that shared library will automatically inherit that RPATH,
|
||||
# and hence know where to look for the openssl libraries, even if they're in
|
||||
# an odd place.
|
||||
#
|
||||
# Dec Alpha, OSF/1 - the alpha164-cc is the flags for a 21164A with
|
||||
# the new compiler
|
||||
# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version
|
||||
#
|
||||
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
|
||||
"alphaold-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
|
||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared:::.so",
|
||||
"alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared:::.so",
|
||||
"alpha-cc-rpath", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared-rpath:::.so",
|
||||
#
|
||||
# This probably belongs in a different section.
|
||||
#
|
||||
"FreeBSD-alpha","gcc:-DTERMIOS -O -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:tru64-shared::.so",
|
||||
"alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
|
||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
|
||||
"FreeBSD-alpha","gcc:-DTERMIOS -O -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### Alpha Linux with GNU C and Compaq C setups
|
||||
# Special notes:
|
||||
@@ -324,8 +297,8 @@ my %table=(
|
||||
#
|
||||
# <appro@fy.chalmers.se>
|
||||
#
|
||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
|
||||
@@ -334,24 +307,22 @@ my %table=(
|
||||
|
||||
# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the
|
||||
# bn86-elf.o file file since it is hand tweaked assembler.
|
||||
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT:-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT:-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT:-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT:-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT:-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
||||
"linux-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
|
||||
"linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-mips", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
|
||||
"linux-m68k", "gcc:-DB_ENDIAN -DTERMIO -O2 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
|
||||
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
|
||||
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::SIXTY_FOUR_BIT_LONG:::::::::::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 RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.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)",
|
||||
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::SIXTY_FOUR_BIT_LONG::",
|
||||
"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)",
|
||||
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"FreeBSD", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
||||
"bsdi-gcc", "gcc:-O3 -ffast-math -DL_ENDIAN -DPERL5 -m486::(unknown)::RSA_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_bsdi_asm}",
|
||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"nextstep", "cc:-O -Wall:<libc.h>:(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
"nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
# NCR MP-RAS UNIX ver 02.03.01
|
||||
@@ -360,11 +331,8 @@ my %table=(
|
||||
# QNX 4
|
||||
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown)::${x86_gcc_des} ${x86_gcc_opts}:",
|
||||
|
||||
# QNX 6
|
||||
"qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown):-lsocket:${x86_gcc_des} ${x86_gcc_opts}:",
|
||||
|
||||
# Linux on ARM
|
||||
"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# UnixWare 2.0x fails destest with -O
|
||||
"unixware-2.0","cc:-DFILIO_H::-Kthread:-lsocket -lnsl -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
@@ -379,15 +347,6 @@ my %table=(
|
||||
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"unixware-7-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"unixware-7-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT:-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# OpenUNIX 8
|
||||
"OpenUNIX-8","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"OpenUNIX-8-gcc","gcc:-O -DFILIO_H -fomit-frame-pointer::-pthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"OpenUNIX-8-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"OpenUNIX-8-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"OpenUNIX-8-shared","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic",
|
||||
"OpenUNIX-8-gcc-shared","gcc:-O3 -DFILIO_H -fomit-frame-pointer::-pthread:-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr5-shared:-fPIC",
|
||||
|
||||
# IBM's AIX.
|
||||
"aix-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR:::",
|
||||
@@ -396,7 +355,7 @@ my %table=(
|
||||
"aix43-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:",
|
||||
|
||||
#
|
||||
# Cray T90 and similar (SDSC)
|
||||
# Cray T90 (SDSC)
|
||||
# It's Big-endian, but the algorithms work properly when B_ENDIAN is NOT
|
||||
# defined. The T90 ints and longs are 8 bytes long, and apparently the
|
||||
# B_ENDIAN code assumes 4 byte ints. Fortunately, the non-B_ENDIAN and
|
||||
@@ -406,10 +365,7 @@ my %table=(
|
||||
#'Taking the address of a bit field is not allowed. '
|
||||
#'An expression with bit field exists as the operand of "sizeof" '
|
||||
# (written by Wayne Schroeder <schroede@SDSC.EDU>)
|
||||
#
|
||||
# j90 is considered the base machine type for unicos machines,
|
||||
# so this configuration is now called "cray-j90" ...
|
||||
"cray-j90", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT:::",
|
||||
"cray-t90-cc", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT:::",
|
||||
|
||||
#
|
||||
# Cray T3E (Research Center Juelich, beckman@acl.lanl.gov)
|
||||
@@ -431,11 +387,9 @@ my %table=(
|
||||
|
||||
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the
|
||||
# SCO cc.
|
||||
"sco5-cc", "cc:-belf::(unknown):-lsocket -lresolv:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
|
||||
"sco5-cc", "cc:::(unknown):-lsocket:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
|
||||
"sco5-cc-pentium", "cc:-Kpentium::(unknown):-lsocket:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
|
||||
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown):-lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
|
||||
"sco5-cc-shared","cc:-belf:::-lsocket -lresolv -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr3-shared:-Kpic",
|
||||
"sco5-gcc-shared","gcc:-O3 -DFILIO_H -fomit-frame-pointer:::-lsocket -lresolv -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC",
|
||||
|
||||
# Sinix/ReliantUNIX RM400
|
||||
# NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */
|
||||
@@ -446,12 +400,6 @@ my %table=(
|
||||
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
|
||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown):-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
||||
|
||||
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
|
||||
# You need to compile using the c89.sh wrapper in the tools directory, because the
|
||||
# IBM compiler does not like the -L switch after any object modules.
|
||||
#
|
||||
"OS390-Unix","c89.sh:-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE::(unknown)::THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
||||
|
||||
# Windows NT, Microsoft Visual C++ 4.0
|
||||
|
||||
"VC-NT","cl:::::BN_LLONG RC4_INDEX ${x86_gcc_opts}::::::::::win32",
|
||||
@@ -470,9 +418,8 @@ my %table=(
|
||||
# and its library files in util/pl/*)
|
||||
"Mingw32", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
|
||||
# Cygwin
|
||||
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32:cygwin-shared:::.dll",
|
||||
# CygWin32
|
||||
"CygWin32", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
|
||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown)::::::",
|
||||
@@ -481,49 +428,22 @@ my %table=(
|
||||
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown)::::::",
|
||||
|
||||
# Some OpenBSD from Bob Beck <beck@obtuse.com>
|
||||
"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-mips","gcc:-O2 -DL_ENDIAN::(unknown):BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-mips","gcc:-O2 -DL_ENDIAN::(unknown):BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
|
||||
##### MacOS X (a.k.a. Rhapsody) setup
|
||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
"darwin-ppc-cc","cc:-O3 -D_DARWIN -DB_ENDIAN::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
|
||||
##### Sony NEWS-OS 4.x
|
||||
"newsos4-gcc","gcc:-O -DB_ENDIAN -DNEWS4::(unknown):-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
|
||||
|
||||
##### VxWorks for various targets
|
||||
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DVXWORKS -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::-r:::::",
|
||||
|
||||
);
|
||||
|
||||
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
|
||||
BC-16 Mingw32);
|
||||
|
||||
my $idx = 0;
|
||||
my $idx_cc = $idx++;
|
||||
my $idx_cflags = $idx++;
|
||||
my $idx_unistd = $idx++;
|
||||
my $idx_thread_cflag = $idx++;
|
||||
my $idx_lflags = $idx++;
|
||||
my $idx_bn_ops = $idx++;
|
||||
my $idx_bn_obj = $idx++;
|
||||
my $idx_des_obj = $idx++;
|
||||
my $idx_bf_obj = $idx++;
|
||||
my $idx_md5_obj = $idx++;
|
||||
my $idx_sha1_obj = $idx++;
|
||||
my $idx_cast_obj = $idx++;
|
||||
my $idx_rc4_obj = $idx++;
|
||||
my $idx_rmd160_obj = $idx++;
|
||||
my $idx_rc5_obj = $idx++;
|
||||
my $idx_dso_scheme = $idx++;
|
||||
my $idx_shared_target = $idx++;
|
||||
my $idx_shared_cflag = $idx++;
|
||||
my $idx_shared_ldflag = $idx++;
|
||||
my $idx_shared_extension = $idx++;
|
||||
my $idx_ranlib = $idx++;
|
||||
|
||||
my $prefix="";
|
||||
my $openssldir="";
|
||||
my $exe_ext="";
|
||||
@@ -596,16 +516,24 @@ PROCESS_ARGS:
|
||||
foreach (@argvcopy)
|
||||
{
|
||||
s /^-no-/no-/; # some people just can't read the instructions
|
||||
if (/^--test-sanity$/)
|
||||
{
|
||||
exit(&test_sanity());
|
||||
}
|
||||
elsif (/^no-asm$/)
|
||||
if (/^no-asm$/)
|
||||
{
|
||||
$no_asm=1;
|
||||
$flags .= "-DNO_ASM ";
|
||||
$openssl_other_defines .= "#define NO_ASM\n";
|
||||
}
|
||||
elsif (/^no-hw-(.+)$/)
|
||||
{
|
||||
my $hw=$1;
|
||||
$hw =~ tr/[a-z]/[A-Z]/;
|
||||
$flags .= "-DNO_HW_$hw ";
|
||||
$openssl_other_defines .= "#define NO_HW_$hw\n";
|
||||
}
|
||||
elsif (/^no-hw$/)
|
||||
{
|
||||
$flags .= "-DNO_HW ";
|
||||
$openssl_other_defines .= "#define NO_HW\n";
|
||||
}
|
||||
elsif (/^no-dso$/)
|
||||
{ $no_dso=1; }
|
||||
elsif (/^no-threads$/)
|
||||
@@ -729,17 +657,13 @@ if ($target eq "LIST") {
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($target =~ m/^CygWin32(-.*)$/) {
|
||||
$target = "Cygwin".$1;
|
||||
}
|
||||
|
||||
print "Configuring for $target\n";
|
||||
|
||||
&usage if (!defined($table{$target}));
|
||||
|
||||
my $IsWindows=scalar grep /^$target$/,@WinTargets;
|
||||
|
||||
$exe_ext=".exe" if ($target eq "Cygwin");
|
||||
$exe_ext=".exe" if ($target eq "CygWin32");
|
||||
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
|
||||
$prefix=$openssldir if $prefix eq "";
|
||||
|
||||
@@ -752,29 +676,9 @@ $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /^\//;
|
||||
|
||||
print "IsWindows=$IsWindows\n";
|
||||
|
||||
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
my $cc = $fields[$idx_cc];
|
||||
my $cflags = $fields[$idx_cflags];
|
||||
my $unistd = $fields[$idx_unistd];
|
||||
my $thread_cflag = $fields[$idx_thread_cflag];
|
||||
my $lflags = $fields[$idx_lflags];
|
||||
my $bn_ops = $fields[$idx_bn_ops];
|
||||
my $bn_obj = $fields[$idx_bn_obj];
|
||||
my $des_obj = $fields[$idx_des_obj];
|
||||
my $bf_obj = $fields[$idx_bf_obj];
|
||||
my $md5_obj = $fields[$idx_md5_obj];
|
||||
my $sha1_obj = $fields[$idx_sha1_obj];
|
||||
my $cast_obj = $fields[$idx_cast_obj];
|
||||
my $rc4_obj = $fields[$idx_rc4_obj];
|
||||
my $rmd160_obj = $fields[$idx_rmd160_obj];
|
||||
my $rc5_obj = $fields[$idx_rc5_obj];
|
||||
my $dso_scheme = $fields[$idx_dso_scheme];
|
||||
my $shared_target = $fields[$idx_shared_target];
|
||||
my $shared_cflag = $fields[$idx_shared_cflag];
|
||||
my $shared_ldflag = $fields[$idx_shared_ldflag];
|
||||
my $shared_extension = $fields[$idx_shared_extension];
|
||||
my $ranlib = $fields[$idx_ranlib];
|
||||
|
||||
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $lflags,my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
|
||||
$md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,my $shared_extension,my $ranlib)=
|
||||
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
$cflags="$flags$cflags" if ($flags ne "");
|
||||
|
||||
# The DSO code currently always implements all functions so that no
|
||||
@@ -978,17 +882,7 @@ while (<IN>)
|
||||
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);
|
||||
if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/)
|
||||
{
|
||||
my $sotmp = $1;
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/
|
||||
}
|
||||
elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
|
||||
{
|
||||
my $sotmp = $1;
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
|
||||
}
|
||||
s/^SHARED_LDFLAGS=.*/SHARED_LDFLAGS=$shared_ldflag/;
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.so.\$(SHLIB_MAJOR) .so/ if ($shared_extension ne "" && $shared_extension !~ /^\.s[ol]$/);
|
||||
print OUT $_."\n";
|
||||
}
|
||||
close(IN);
|
||||
@@ -1276,7 +1170,7 @@ sub print_table_entry
|
||||
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 $shared_extension,my $ranlib)=
|
||||
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
|
||||
print <<EOF
|
||||
@@ -1300,44 +1194,7 @@ sub print_table_entry
|
||||
\$dso_scheme = $dso_scheme
|
||||
\$shared_target= $shared_target
|
||||
\$shared_cflag = $shared_cflag
|
||||
\$shared_ldflag = $shared_ldflag
|
||||
\$shared_extension = $shared_extension
|
||||
\$ranlib = $ranlib
|
||||
EOF
|
||||
}
|
||||
|
||||
sub test_sanity
|
||||
{
|
||||
my $errorcnt = 0;
|
||||
|
||||
print STDERR "=" x 70, "\n";
|
||||
print STDERR "=== SANITY TESTING!\n";
|
||||
print STDERR "=== No configuration will be done, all other arguments will be ignored!\n";
|
||||
print STDERR "=" x 70, "\n";
|
||||
|
||||
foreach $target (sort keys %table)
|
||||
{
|
||||
@fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
|
||||
if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/)
|
||||
{
|
||||
$errorcnt++;
|
||||
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
|
||||
print STDERR " in the previous field\n";
|
||||
}
|
||||
elsif ($fields[$idx_dso_scheme+1] =~ /^(dl|dlfcn|win32|vms)$/)
|
||||
{
|
||||
$errorcnt++;
|
||||
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
|
||||
print STDERR " in the following field\n";
|
||||
}
|
||||
elsif ($fields[$idx_dso_scheme] !~ /^(dl|dlfcn|win32|vms|)$/)
|
||||
{
|
||||
$errorcnt++;
|
||||
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n";
|
||||
print STDERR " valid values are 'dl', 'dlfcn', 'win32' and 'vms'\n";
|
||||
}
|
||||
}
|
||||
print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
|
||||
return $errorcnt;
|
||||
}
|
||||
|
131
FAQ
131
FAQ
@@ -8,7 +8,6 @@ OpenSSL - Frequently Asked Questions
|
||||
* How can I contact the OpenSSL developers?
|
||||
* Where can I get a compiled version of OpenSSL?
|
||||
* Why aren't tools like 'autoconf' and 'libtool' used?
|
||||
* What is an 'engine' version?
|
||||
|
||||
[LEGAL] Legal questions
|
||||
|
||||
@@ -28,14 +27,13 @@ OpenSSL - Frequently Asked Questions
|
||||
* How can I remove the passphrase on a private key?
|
||||
* Why can't I use OpenSSL certificates with SSL client authentication?
|
||||
* Why does my browser give a warning about a mismatched hostname?
|
||||
* How do I install a CA certificate into a browser?
|
||||
|
||||
[BUILD] Questions about building and testing OpenSSL
|
||||
|
||||
* Why does the linker complain about undefined symbols?
|
||||
* Why does the OpenSSL test fail with "bc: command not found"?
|
||||
* Why does the OpenSSL test fail with "bc: 1 no implemented"?
|
||||
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
|
||||
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
|
||||
* Why does the OpenSSL compilation fail with "ar: command not found"?
|
||||
* Why does the OpenSSL compilation fail on Win32 with VC++?
|
||||
|
||||
@@ -59,7 +57,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.6c was released on December 21st, 2001.
|
||||
OpenSSL 0.9.6b was released on July 9th, 2001.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
@@ -123,12 +121,6 @@ A number of Linux and *BSD distributions include OpenSSL.
|
||||
autoconf will probably be used in future OpenSSL versions. If it was
|
||||
less Unix-centric, it might have been used much earlier.
|
||||
|
||||
* What is an 'engine' version?
|
||||
|
||||
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.
|
||||
|
||||
[LEGAL] =======================================================================
|
||||
|
||||
@@ -154,7 +146,7 @@ holders claim that you infringe on their rights if you use OpenSSL with
|
||||
their software on operating systems that don't normally include OpenSSL.
|
||||
|
||||
If you develop open source software that uses OpenSSL, you may find it
|
||||
useful to choose an other license than the GPL, or state explicitly that
|
||||
useful to choose an other license than the GPL, or state explicitely that
|
||||
"This program is released under the GPL with the additional exemption that
|
||||
compiling, linking, and/or using OpenSSL is allowed." If you are using
|
||||
GPL software developed by others, you may want to ask the copyright holder
|
||||
@@ -194,7 +186,7 @@ environment variable HOME is set, then the seeding file is $HOME/.rnd.
|
||||
If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
|
||||
use file .rnd in the current directory while OpenSSL 0.9.6a uses no
|
||||
default seeding file at all. OpenSSL 0.9.6b and later will behave
|
||||
similarly to 0.9.6a, but will use a default of "C:\" for HOME on
|
||||
similarly to 0.9.6a, but will use a default of "C:" for HOME on
|
||||
Windows systems if the environment variable has not been set.
|
||||
|
||||
If the default seeding file does not exist or is too short, the "PRNG
|
||||
@@ -305,7 +297,7 @@ there is little point presenting a certificate which the server will
|
||||
reject.
|
||||
|
||||
The solution is to add the relevant CA certificate to your servers "trusted
|
||||
CA list". How you do this depends on the server software in uses. You can
|
||||
CA list". How you do this depends on the server sofware in uses. You can
|
||||
print out the servers list of acceptable CAs using the OpenSSL s_client tool:
|
||||
|
||||
openssl s_client -connect www.some.host:443 -prexit
|
||||
@@ -324,26 +316,6 @@ Browsers expect the server's hostname to match the value in the commonName
|
||||
(CN) field of the certificate. If it does not then you get a warning.
|
||||
|
||||
|
||||
* How do I install a CA certificate into a browser?
|
||||
|
||||
The usual way is to send the DER encoded certificate to the browser as
|
||||
MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
|
||||
link. On MSIE certain extensions such as .der or .cacert may also work, or you
|
||||
can import the certificate using the certificate import wizard.
|
||||
|
||||
You can convert a certificate to DER form using the command:
|
||||
|
||||
openssl x509 -in ca.pem -outform DER -out ca.der
|
||||
|
||||
Occasionally someone suggests using a command such as:
|
||||
|
||||
openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
|
||||
|
||||
DO NOT DO THIS! This command will give away your CAs private key and
|
||||
reduces its security to zero: allowing anyone to forge certificates in
|
||||
whatever name they choose.
|
||||
|
||||
|
||||
[BUILD] =======================================================================
|
||||
|
||||
* Why does the linker complain about undefined symbols?
|
||||
@@ -387,9 +359,9 @@ and compile/install it. GNU bc (see http://www.gnu.org/software/software.html
|
||||
for download instructions) can be safely used, for example.
|
||||
|
||||
|
||||
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
|
||||
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
|
||||
|
||||
On some Alpha installations running Tru64 Unix and Compaq C, the compilation
|
||||
On some Alpha installations running True64 Unix and Compaq C, the compilation
|
||||
of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual
|
||||
memory to continue compilation.' As far as the tests have shown, this may be
|
||||
a compiler bug. What happens is that it eats up a lot of resident memory
|
||||
@@ -467,43 +439,10 @@ OpenSSL. This is described in the threads(3) manpage.
|
||||
|
||||
* I've compiled a program under Windows and it crashes: why?
|
||||
|
||||
This is usually because you've missed the comment in INSTALL.W32.
|
||||
Your application must link against the same version of the Win32
|
||||
C-Runtime against which your openssl libraries were linked. The
|
||||
default version for OpenSSL is /MD - "Multithreaded DLL".
|
||||
|
||||
If you are using Microsoft Visual C++'s IDE (Visual Studio), in
|
||||
many cases, your new project most likely defaulted to "Debug
|
||||
Singlethreaded" - /ML. This is NOT interchangeable with /MD and your
|
||||
program will crash, typically on the first BIO related read or write
|
||||
operation.
|
||||
|
||||
For each of the six possible link stage configurations within Win32,
|
||||
your application must link against the same by which OpenSSL was
|
||||
built. If you are using MS Visual C++ (Studio) this can be changed
|
||||
by:
|
||||
|
||||
1. Select Settings... from the Project Menu.
|
||||
2. Select the C/C++ Tab.
|
||||
3. Select "Code Generation from the "Category" drop down list box
|
||||
4. Select the Appropriate library (see table below) from the "Use
|
||||
run-time library" drop down list box. Perform this step for both
|
||||
your debug and release versions of your application (look at the
|
||||
top left of the settings panel to change between the two)
|
||||
|
||||
Single Threaded /ML - MS VC++ often defaults to
|
||||
this for the release
|
||||
version of a new project.
|
||||
Debug Single Threaded /MLd - MS VC++ often defaults to
|
||||
this for the debug version
|
||||
of a new project.
|
||||
Multithreaded /MT
|
||||
Debug Multithreaded /MTd
|
||||
Multithreaded DLL /MD - OpenSSL defaults to this.
|
||||
Debug Multithreaded DLL /MDd
|
||||
|
||||
Note that debug and release libraries are NOT interchangeable. If you
|
||||
built OpenSSL with /MD your application must use /MD and cannot use /MDd.
|
||||
This is usually because you've missed the comment in INSTALL.W32. You
|
||||
must link with the multithreaded DLL version of the VC++ runtime library
|
||||
otherwise the conflict will cause a program to crash: typically on the
|
||||
first BIO related read or write operation.
|
||||
|
||||
|
||||
* How do I read or write a DER encoded buffer using the ASN1 functions?
|
||||
@@ -584,16 +523,44 @@ OpenSSL_add_all_algorithms(). See the manual page for more information.
|
||||
|
||||
* Why can't the OpenSSH configure script detect OpenSSL?
|
||||
|
||||
Several reasons for problems with the automatic detection exist.
|
||||
OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
|
||||
Sometimes the distribution has installed an older version in the system
|
||||
locations that is detected instead of a new one installed. The OpenSSL
|
||||
library might have been compiled for another CPU or another mode (32/64 bits).
|
||||
Permissions might be wrong.
|
||||
There is a problem with OpenSSH 1.2.2p1, in that the configure script
|
||||
can't find the installed OpenSSL libraries. The problem is actually
|
||||
a small glitch that is easily solved with the following patch to be
|
||||
applied to the OpenSSH distribution:
|
||||
|
||||
----- snip:start -----
|
||||
--- openssh-1.2.2p1/configure.in.orig Thu Mar 23 18:56:58 2000
|
||||
+++ openssh-1.2.2p1/configure.in Thu Mar 23 18:55:05 2000
|
||||
@@ -152,10 +152,10 @@
|
||||
AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
|
||||
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
||||
if test ! -z "$ssldir" ; then
|
||||
- LIBS="$saved_LIBS -L$ssldir"
|
||||
+ LIBS="$saved_LIBS -L$ssldir/lib"
|
||||
CFLAGS="$CFLAGS -I$ssldir/include"
|
||||
if test "x$need_dash_r" = "x1" ; then
|
||||
- LIBS="$LIBS -R$ssldir"
|
||||
+ LIBS="$LIBS -R$ssldir/lib"
|
||||
fi
|
||||
fi
|
||||
LIBS="$LIBS -lcrypto"
|
||||
--- openssh-1.2.2p1/configure.orig Thu Mar 23 18:55:02 2000
|
||||
+++ openssh-1.2.2p1/configure Thu Mar 23 18:57:08 2000
|
||||
@@ -1890,10 +1890,10 @@
|
||||
echo "configure:1891: checking for OpenSSL/SSLeay directory" >&5
|
||||
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
||||
if test ! -z "$ssldir" ; then
|
||||
- LIBS="$saved_LIBS -L$ssldir"
|
||||
+ LIBS="$saved_LIBS -L$ssldir/lib"
|
||||
CFLAGS="$CFLAGS -I$ssldir/include"
|
||||
if test "x$need_dash_r" = "x1" ; then
|
||||
- LIBS="$LIBS -R$ssldir"
|
||||
+ LIBS="$LIBS -R$ssldir/lib"
|
||||
fi
|
||||
fi
|
||||
LIBS="$LIBS -lcrypto"
|
||||
----- snip:end -----
|
||||
|
||||
The general answer is to check the config.log file generated when running
|
||||
the OpenSSH configure script. It should contain the detailed information
|
||||
on why the OpenSSL library was not detected or considered incompatible.
|
||||
|
||||
* Can I use OpenSSL's SSL library with non-blocking I/O?
|
||||
|
||||
@@ -612,7 +579,7 @@ SSL_write() will try to continue any pending handshake.
|
||||
* Why doesn't my server application receive a client certificate?
|
||||
|
||||
Due to the TLS protocol definition, a client will only send a certificate,
|
||||
if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
|
||||
if explicitely asked by the server. Use the SSL_VERIFY_PEER flag of the
|
||||
SSL_CTX_set_verify() function to enable the use of client certificates.
|
||||
|
||||
|
||||
|
10
INSTALL
10
INSTALL
@@ -57,7 +57,10 @@
|
||||
|
||||
shared In addition to the usual static libraries, create shared
|
||||
libraries on platforms where it's supported. See "Note on
|
||||
shared libraries" below.
|
||||
shared libraries" below. THIS IS NOT RECOMMENDED! Since
|
||||
this is a development branch, the positions of the ENGINE
|
||||
symbols in the transfer vector are constantly moving, so
|
||||
binary backward compatibility can't be guaranteed in any way.
|
||||
|
||||
no-asm Do not use assembler code.
|
||||
|
||||
@@ -269,11 +272,6 @@
|
||||
Note on shared libraries
|
||||
------------------------
|
||||
|
||||
Shared library is currently an experimental feature. The only reason to
|
||||
have them would be to conserve memory on systems where several program
|
||||
are using OpenSSL. Binary backward compatibility can't be guaranteed
|
||||
before OpenSSL version 1.0.
|
||||
|
||||
For some systems, the OpenSSL Configure script knows what is needed to
|
||||
build shared libraries for libcrypto and libssl. On these systems,
|
||||
the shared libraries are currently not created by default, but giving
|
||||
|
@@ -1,7 +1,7 @@
|
||||
OpenSSL - Port To The Macintosh OS 9 or Earlier
|
||||
===============================================
|
||||
OpenSSL - Port To The Macintosh
|
||||
===============================
|
||||
|
||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for Mac OS (pre
|
||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for MacOS (pre
|
||||
X) is now provided. "Initial" means that unlike other platforms where you
|
||||
get an SDK and a "swiss army" openssl application, on Macintosh you only
|
||||
get one sample application which fetches a page over HTTPS(*) and dumps it
|
||||
@@ -42,7 +42,7 @@ Installation procedure:
|
||||
BSD sockets and some other POSIX APIs. The GUSI distribution is
|
||||
expected to be found in the same directory as openssl source tree,
|
||||
i.e. in the parent directory to the one where this very file,
|
||||
namely INSTALL.MacOS. For more information about GUSI, see
|
||||
namely INSTALL.MacOS. For more informations about GUSI, see
|
||||
http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
|
||||
|
||||
Finally some essential comments from our generous contributor:-)
|
||||
|
50
INSTALL.W32
50
INSTALL.W32
@@ -2,19 +2,16 @@
|
||||
INSTALLATION ON THE WIN32 PLATFORM
|
||||
----------------------------------
|
||||
|
||||
Heres a few comments about building OpenSSL in Windows environments. Most
|
||||
of this is tested on Win32 but it may also work in Win 3.1 with some
|
||||
Heres a few comments about building OpenSSL in Windows environments. Most of
|
||||
this is tested on Win32 but it may also work in Win 3.1 with some
|
||||
modification.
|
||||
|
||||
You need Perl for Win32. Unless you will build on Cygwin, you will need
|
||||
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
|
||||
For Cygwin users, there's more info in the Cygwin section.
|
||||
|
||||
You need Perl for Win32 (available from http://www.activestate.com/ActivePerl)
|
||||
and one of the following C compilers:
|
||||
|
||||
* Visual C++
|
||||
* Borland C
|
||||
* GNU C (Mingw32 or Cygwin)
|
||||
* GNU C (Mingw32 or Cygwin32)
|
||||
|
||||
If you want to compile in the assembly language routines with Visual C++ then
|
||||
you will need an assembler. This is worth doing because it will result in
|
||||
@@ -81,7 +78,7 @@
|
||||
|
||||
There are various changes you can make to the Win32 compile environment. By
|
||||
default the library is not compiled with debugging symbols. If you add 'debug'
|
||||
to the mk1mf.pl lines in the do_* batch file then debugging symbols will be
|
||||
to the mk1mk.pl lines in the do_* batch file then debugging symbols will be
|
||||
compiled in.
|
||||
|
||||
The default Win32 environment is to leave out any Windows NT specific
|
||||
@@ -137,30 +134,28 @@
|
||||
> cd out
|
||||
> ..\ms\test
|
||||
|
||||
GNU C (Cygwin)
|
||||
--------------
|
||||
GNU C (CygWin32)
|
||||
---------------
|
||||
|
||||
Cygwin provides a bash shell and GNU tools environment running on
|
||||
CygWin32 provides a bash shell and GNU tools environment running on
|
||||
NT 4.0, Windows 9x and Windows 2000. Consequently, a make of OpenSSL
|
||||
with Cygwin is closer to a GNU bash environment such as Linux rather
|
||||
with CygWin is closer to a GNU bash environment such as Linux rather
|
||||
than other W32 makes that are based on a single makefile approach.
|
||||
Cygwin implements Posix/Unix calls through cygwin1.dll, and is
|
||||
CygWin32 implements Posix/Unix calls through cygwin1.dll, and is
|
||||
contrasted to Mingw32 which links dynamically to msvcrt.dll or
|
||||
crtdll.dll.
|
||||
|
||||
To build OpenSSL using Cygwin:
|
||||
To build OpenSSL using CygWin32:
|
||||
|
||||
* Install Cygwin (see http://sourceware.cygnus.com/cygwin)
|
||||
* Install CygWin32 (see http://sourceware.cygnus.com/cygwin)
|
||||
|
||||
* Install Perl and ensure it is in the path (recent Cygwin perl
|
||||
(version 5.6.1-2 of the latter has been reported to work) or
|
||||
ActivePerl)
|
||||
* Install Perl and ensure it is in the path
|
||||
|
||||
* Run the Cygwin bash shell
|
||||
* Run the CygWin bash shell
|
||||
|
||||
* $ tar zxvf openssl-x.x.x.tar.gz
|
||||
$ cd openssl-x.x.x
|
||||
$ ./config
|
||||
$ ./Configure no-threads CygWin32
|
||||
[...]
|
||||
$ make
|
||||
[...]
|
||||
@@ -169,28 +164,27 @@
|
||||
|
||||
This will create a default install in /usr/local/ssl.
|
||||
|
||||
Cygwin Notes:
|
||||
CygWin32 Notes:
|
||||
|
||||
"make test" and normal file operations may fail in directories
|
||||
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
|
||||
mounted as text (i.e. mount -t c:\somewhere /home) due to CygWin
|
||||
stripping of carriage returns. To avoid this ensure that a binary
|
||||
mount is used, e.g. mount -b c:\somewhere /home.
|
||||
|
||||
As of version 1.1.1 Cygwin is relatively unstable in its handling
|
||||
As of version 1.1.1 CygWin32 is relatively unstable in its handling
|
||||
of cr/lf issues. These make procedures succeeded with versions 1.1 and
|
||||
the snapshot 20000524 (Slow!).
|
||||
|
||||
"bc" is not provided in the Cygwin distribution. This causes a
|
||||
"bc" is not provided in the CygWin32 distribution. This causes a
|
||||
non-fatal error in "make test" but is otherwise harmless. If
|
||||
desired, GNU bc can be built with Cygwin without change.
|
||||
desired, GNU bc can be built with CygWin32 without change.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
If you used the Cygwin procedure above, you have already installed and
|
||||
can skip this section. For all other procedures, there's currently no real
|
||||
installation procedure for Win32. There are, however, some suggestions:
|
||||
There's currently no real installation procedure for Win32. There are,
|
||||
however, some suggestions:
|
||||
|
||||
- do nothing. The include files are found in the inc32/ subdirectory,
|
||||
all binaries are found in out32dll/ or out32/ depending if you built
|
||||
|
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2001 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
|
||||
|
261
Makefile.org
261
Makefile.org
@@ -162,7 +162,7 @@ SHLIBDIRS= crypto ssl
|
||||
SDIRS= \
|
||||
md2 md4 md5 sha mdc2 hmac ripemd \
|
||||
des rc2 rc4 rc5 idea bf cast \
|
||||
bn rsa dsa dh dso \
|
||||
bn rsa dsa dh dso engine \
|
||||
buffer bio stack lhash rand err objects \
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
|
||||
|
||||
@@ -183,7 +183,6 @@ SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
|
||||
SHARED_SSL=libssl$(SHLIB_EXT)
|
||||
SHARED_LIBS=
|
||||
SHARED_LIBS_LINK_EXTS=
|
||||
SHARED_LDFLAGS=
|
||||
|
||||
GENERAL= Makefile
|
||||
BASENAME= openssl
|
||||
@@ -236,22 +235,19 @@ clean-shared:
|
||||
done; \
|
||||
fi; \
|
||||
( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
|
||||
if [ "$(PLATFORM)" = "Cygwin" ]; then \
|
||||
( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
|
||||
fi; \
|
||||
done
|
||||
|
||||
link-shared:
|
||||
@if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
||||
tmp="$(SHARED_LIBS_LINK_EXTS)"; \
|
||||
for i in $(SHLIBDIRS); do \
|
||||
prev=lib$$i$(SHLIB_EXT); \
|
||||
@for i in $(SHLIBDIRS); do \
|
||||
prev=lib$$i$(SHLIB_EXT); \
|
||||
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
||||
tmp="$(SHARED_LIBS_LINK_EXTS)"; \
|
||||
for j in $${tmp:-x}; do \
|
||||
( set -x; ln -f -s $$prev lib$$i$$j ); \
|
||||
prev=lib$$i$$j; \
|
||||
done; \
|
||||
done; \
|
||||
fi
|
||||
fi; \
|
||||
done
|
||||
|
||||
build-shared: clean-shared do_$(SHLIB_TARGET) link-shared
|
||||
|
||||
@@ -259,220 +255,29 @@ do_bsd-gcc-shared: do_gnu-shared
|
||||
do_linux-shared: do_gnu-shared
|
||||
do_gnu-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-Bsymbolic \
|
||||
( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-S,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,--whole-archive lib$$i.a \
|
||||
-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
|
||||
collect2=`gcc -print-prog-name=collect2 2>&1` && \
|
||||
[ -n "$$collect2" ] && \
|
||||
my_ld=`$$collect2 --help 2>&1 | grep Usage: | sed 's/^Usage: *\([^ ][^ ]*\).*/\1/'` && \
|
||||
[ -n "$$my_ld" ] && \
|
||||
$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
|
||||
|
||||
# For Darwin AKA Mac OS/X (dyld)
|
||||
do_darwin-shared:
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_tru64-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x ; ${CC} --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; \
|
||||
libs="$$libs -l`basename $$i${SHLIB_EXT} .dylib`"; \
|
||||
echo "" ; \
|
||||
done
|
||||
|
||||
do_cygwin-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} -shared -o cyg$$i.dll \
|
||||
-Wl,-Bsymbolic \
|
||||
-Wl,--whole-archive lib$$i.a \
|
||||
-Wl,--out-implib,lib$$i.dll.a \
|
||||
-Wl,--no-whole-archive $$libs ) || exit 1; \
|
||||
( set -x; ${CC} -shared -no_archive -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_alpha-osf1-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${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; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
|
||||
# option passed to the linker.
|
||||
do_tru64-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${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; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
# The difference between tru64-shared and tru64-shared-rpath is the
|
||||
# -rpath ${INSTALLTOP}/lib passed to the linker.
|
||||
do_tru64-shared-rpath:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${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; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_solaris-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# OpenServer 5 native compilers used
|
||||
do_svr3-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
find . -name "*.o" -print > allobjs ; \
|
||||
OBJS= ; export OBJS ; \
|
||||
for obj in `ar t lib$$i.a` ; do \
|
||||
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# UnixWare 7 and OpenUNIX 8 native compilers used
|
||||
do_svr5-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
find . -name "*.o" -print > allobjs ; \
|
||||
OBJS= ; export OBJS ; \
|
||||
for obj in `ar t lib$$i.a` ; do \
|
||||
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; ${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; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_irix-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_hpux-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
|
||||
+vnocompatwarnings \
|
||||
-b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Fl lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -L. -l$$i"; \
|
||||
done
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_hpux64-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
|
||||
-b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
+forceload lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -L. -l$$i"; \
|
||||
done
|
||||
|
||||
# The following method is said to work on all platforms. Tests will
|
||||
# determine if that's how it's gong to be used.
|
||||
# This assumes that for all but GNU systems, GNU utilities are *not* used.
|
||||
# ALLSYMSFLAGS would be:
|
||||
# GNU systems: --whole-archive
|
||||
# Tru64 Unix: -all
|
||||
# Solaris: -z allextract
|
||||
# Irix: -all
|
||||
# HP/UX-32bit: -Fl
|
||||
# HP/UX-64bit: +forceload
|
||||
# AIX: -bnogc
|
||||
# SHAREDFLAGS would be:
|
||||
# GNU systems: -shared -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# Tru64 Unix: -shared \
|
||||
# -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}"
|
||||
# Solaris: -G -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# Irix: -shared -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# HP/UX-32bit: +vnocompatwarnings -b -z +s \
|
||||
# +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# HP/UX-64bit: -b -z +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# AIX: -G -bE:lib$$i.exp -bM:SRE
|
||||
# SHAREDCMD would be:
|
||||
# GNU systems: $(CC)
|
||||
# Tru64 Unix: $(CC)
|
||||
# Solaris: $(CC)
|
||||
# Irix: $(CC)
|
||||
# HP/UX-32bit: /usr/ccs/bin/ld
|
||||
# HP/UX-64bit: /usr/ccs/bin/ld
|
||||
# AIX: $(CC)
|
||||
ALLSYMSFLAG=-bnogc
|
||||
SHAREDFLAGS=${SHARED_LDFLAGS} -G -bE:lib$$i.exp -bM:SRE
|
||||
SHAREDCMD=$(CC)
|
||||
do_aix-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; \
|
||||
ld -r -o $$i.o $(ALLSYMSFLAG) lib$$i.a && \
|
||||
( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
|
||||
$(SHAREDCMD) $(SHAREDFLAG) -o lib$$i.so lib$$i.o \
|
||||
$$libs ${EX_LIBS} ) ) \
|
||||
|| exit 1; \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
@@ -545,7 +350,7 @@ test: tests
|
||||
|
||||
tests: rehash
|
||||
@(cd test && echo "testing..." && \
|
||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' EXE_EXT='${EXE_EXT}' tests );
|
||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' EXE_EXT='${EXE_EXT}' tests );
|
||||
@apps/openssl version -a
|
||||
|
||||
report:
|
||||
@@ -579,25 +384,25 @@ tags:
|
||||
done;
|
||||
|
||||
errors:
|
||||
$(PERL) util/mkerr.pl -recurse -write
|
||||
perl util/mkerr.pl -recurse -write
|
||||
|
||||
stacks:
|
||||
$(PERL) util/mkstack.pl -write
|
||||
perl util/mkstack.pl -write
|
||||
|
||||
util/libeay.num::
|
||||
$(PERL) util/mkdef.pl crypto update
|
||||
perl util/mkdef.pl crypto update
|
||||
|
||||
util/ssleay.num::
|
||||
$(PERL) util/mkdef.pl ssl update
|
||||
perl util/mkdef.pl ssl update
|
||||
|
||||
crypto/objects/obj_dat.h: crypto/objects/obj_mac.h crypto/objects/obj_dat.pl
|
||||
$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
|
||||
perl crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
|
||||
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt
|
||||
$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
|
||||
perl crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
|
||||
|
||||
TABLE: Configure
|
||||
(echo 'Output of `Configure TABLE'"':"; \
|
||||
$(PERL) Configure TABLE) > TABLE
|
||||
perl Configure TABLE) > TABLE
|
||||
|
||||
update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
|
||||
|
||||
@@ -652,18 +457,10 @@ install: all install_docs
|
||||
tmp="$(SHARED_LIBS)"; \
|
||||
for i in $${tmp:-x}; \
|
||||
do \
|
||||
if [ -f "$$i" -o -f "$$i.a" ]; then \
|
||||
if [ -f "$$i" ]; then \
|
||||
( echo installing $$i; \
|
||||
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
else \
|
||||
c=`echo $$i | sed 's/^lib/cyg/'`; \
|
||||
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||
fi ); \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi \
|
||||
done; \
|
||||
( here="`pwd`"; \
|
||||
|
18
NEWS
18
NEWS
@@ -5,24 +5,6 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
|
||||
|
||||
o Various SSL/TLS library bugfixes.
|
||||
o Fix DH parameter generation for 'non-standard' generators.
|
||||
|
||||
Changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
|
||||
|
||||
o Various SSL/TLS library bugfixes.
|
||||
o BIGNUM library fixes.
|
||||
o RSA OAEP and random number generation fixes.
|
||||
o Object identifiers corrected and added.
|
||||
o Add assembler BN routines for IA64.
|
||||
o Add support for OS/390 Unix, UnixWare with gcc, OpenUNIX 8,
|
||||
MIPS Linux; shared library support for Irix, HP-UX.
|
||||
o Add crypto accelerator support for AEP, Baltimore SureWare,
|
||||
Broadcom and Cryptographic Appliance's keyserver
|
||||
[in 0.9.6c-engine release].
|
||||
|
||||
Changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
|
||||
|
||||
o Security fix: PRNG improvements.
|
||||
|
16
README
16
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 0.9.6d-beta1 17 Apr 2002
|
||||
OpenSSL 0.9.6b [engine] 9 Jul 2001
|
||||
|
||||
Copyright (c) 1998-2002 The OpenSSL Project
|
||||
Copyright (c) 1998-2001 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
X.509v3 certificates
|
||||
X509 encoding/decoding into/from binary ASN1 and a PEM
|
||||
based ASCII-binary encoding which supports encryption with a
|
||||
based ascii-binary encoding which supports encryption with a
|
||||
private key. Program to generate RSA and DSA certificate
|
||||
requests and to generate RSA and DSA certificates.
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
locations around the world. _YOU_ are responsible for ensuring that your use
|
||||
of any algorithms is legal by checking if there are any patents in your
|
||||
country. The file contains some of the patents that we know about or are
|
||||
rumored to exist. This is not a definitive list.
|
||||
rumoured to exist. This is not a definitive list.
|
||||
|
||||
RSA Security holds software patents on the RC5 algorithm. If you
|
||||
intend to use this cipher, you must contact RSA Security for
|
||||
@@ -107,8 +107,8 @@
|
||||
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
|
||||
Japan, 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/.
|
||||
|
||||
INSTALLATION
|
||||
@@ -119,8 +119,8 @@
|
||||
INSTALL.VMS.
|
||||
|
||||
Read the documentation in the doc/ directory. It is quite rough, but it
|
||||
lists the functions; you will probably have to look at the code to work out
|
||||
how to use them. Look at the example programs.
|
||||
lists the functions, you will probably have to look at the code to work out
|
||||
how to used them. Look at the example programs.
|
||||
|
||||
SUPPORT
|
||||
-------
|
||||
|
@@ -5,7 +5,7 @@
|
||||
With OpenSSL 0.9.6, a new component has been added to support external
|
||||
crypto devices, for example accelerator cards. The component is called
|
||||
ENGINE, and has still a pretty experimental status and almost no
|
||||
documentation. It's designed to be fairly easily extensible by the
|
||||
documentation. It's designed to be faily easily extensible by the
|
||||
calling programs.
|
||||
|
||||
There's currently built-in support for the following crypto devices:
|
||||
@@ -48,7 +48,7 @@
|
||||
No external crypto device is chosen unless you say so. You have actively
|
||||
tell the openssl utility commands to use it through a new command line
|
||||
switch called "-engine". And if you want to use the ENGINE library to
|
||||
do something similar, you must also explicitly choose an external crypto
|
||||
do something similar, you must also explicitely choose an external crypto
|
||||
device, or the built-in crypto routines will be used, just as in the
|
||||
default OpenSSL distribution.
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
PROBLEMS
|
||||
========
|
||||
|
||||
It seems like the ENGINE part doesn't work too well with CryptoSwift on
|
||||
It seems like the ENGINE part doesn't work too well with Cryptoswift on
|
||||
Win32. A quick test done right before the release showed that trying
|
||||
"openssl speed -engine cswift" generated errors. If the DSO gets enabled,
|
||||
an attempt is made to write at memory address 0x00000002.
|
||||
|
35
STATUS
35
STATUS
@@ -1,13 +1,9 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2002/04/17 12:28:37 $
|
||||
______________ $Date: 2001/04/05 17:48:02 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 0.9.7: Under development...
|
||||
o OpenSSL 0.9.6d: Feature freeze, beta1 April 17th, 2002
|
||||
o OpenSSL 0.9.6c: Released on December 21st, 2001
|
||||
o OpenSSL 0.9.6b: Released on July 9th, 2001
|
||||
o OpenSSL 0.9.6a: Released on April 5th, 2001
|
||||
o OpenSSL 0.9.6: Released on September 24th, 2000
|
||||
o OpenSSL 0.9.5a: Released on April 1st, 2000
|
||||
@@ -22,8 +18,6 @@
|
||||
|
||||
AVAILABLE PATCHES
|
||||
|
||||
o
|
||||
|
||||
IN PROGRESS
|
||||
|
||||
o Steve is currently working on (in no particular order):
|
||||
@@ -37,25 +31,32 @@
|
||||
o Geoff and Richard are currently working on:
|
||||
ENGINE (the new code that gives hardware support among others).
|
||||
o Richard is currently working on:
|
||||
UI (User Interface)
|
||||
UTIL (a new set of library functions to support some higher level
|
||||
functionality that is currently missing).
|
||||
Shared library support for VMS.
|
||||
OCSP
|
||||
Kerberos 5 authentication
|
||||
Constification
|
||||
OCSP
|
||||
|
||||
NEEDS PATCH
|
||||
|
||||
o apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file
|
||||
|
||||
o OpenSSL_0_9_6-stable:
|
||||
#include <openssl/e_os.h> in exported header files is illegal since
|
||||
e_os.h is suitable only for library-internal use.
|
||||
|
||||
o Whenever strncpy is used, make sure the resulting string is NULL-terminated
|
||||
or an error is reported
|
||||
|
||||
o "OpenSSL STATUS" is never up-to-date.
|
||||
|
||||
OPEN ISSUES
|
||||
|
||||
o crypto/ex_data.c is not really thread-safe and so must be used
|
||||
with care (e.g., extra locking where necessary, or don't call
|
||||
CRYPTO_get_ex_new_index once multiple threads exist).
|
||||
The current API is not suitable for everything that it pretends
|
||||
to offer.
|
||||
|
||||
o The Makefile hierarchy and build mechanism is still not a round thing:
|
||||
|
||||
1. The config vs. Configure scripts
|
||||
@@ -98,14 +99,4 @@
|
||||
|
||||
WISHES
|
||||
|
||||
o SRP in TLS.
|
||||
[wished by:
|
||||
Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
|
||||
Tom Holroyd <tomh@po.crl.go.jp>]
|
||||
|
||||
See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
|
||||
as well as http://www-cs-students.stanford.edu/~tjw/srp/.
|
||||
|
||||
Tom Holroyd tells us there is a SRP patch for OpenSSH at
|
||||
http://members.tripod.com/professor_tom/archives/, that could
|
||||
be useful.
|
||||
o
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -170,6 +170,8 @@ int str2fmt(char *s)
|
||||
|| (strcmp(s,"PKCS12") == 0) || (strcmp(s,"pkcs12") == 0)
|
||||
|| (strcmp(s,"P12") == 0) || (strcmp(s,"p12") == 0))
|
||||
return(FORMAT_PKCS12);
|
||||
else if ((*s == 'E') || (*s == 'e'))
|
||||
return(FORMAT_ENGINE);
|
||||
else
|
||||
return(FORMAT_UNDEF);
|
||||
}
|
||||
|
@@ -162,6 +162,8 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format);
|
||||
#define FORMAT_NETSCAPE 4
|
||||
#define FORMAT_PKCS12 5
|
||||
#define FORMAT_SMIME 6
|
||||
/* Since this is currently inofficial, let's give it a high number */
|
||||
#define FORMAT_ENGINE 127
|
||||
|
||||
#define NETSCAPE_CERT_HDR "certificate"
|
||||
|
||||
|
29
apps/ca.c
29
apps/ca.c
@@ -74,6 +74,7 @@
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#ifndef W_OK
|
||||
# ifdef VMS
|
||||
@@ -82,7 +83,7 @@
|
||||
# else
|
||||
# include <unixlib.h>
|
||||
# endif
|
||||
# elif !defined(VXWORKS)
|
||||
# else
|
||||
# include <sys/file.h>
|
||||
# endif
|
||||
#endif
|
||||
@@ -167,6 +168,7 @@ static char *ca_usage[]={
|
||||
" -revoke file - Revoke a certificate (given in file)\n",
|
||||
" -extensions .. - Extension section (override value in config file)\n",
|
||||
" -crlexts .. - CRL extension section (override value in config file)\n",
|
||||
" -engine e - use engine e, possibly a hardware device.\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -216,6 +218,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
char *key=NULL,*passargin=NULL;
|
||||
int total=0;
|
||||
int total_done=0;
|
||||
@@ -268,6 +271,7 @@ int MAIN(int argc, char **argv)
|
||||
#define BSIZE 256
|
||||
MS_STATIC char buf[3][BSIZE];
|
||||
char *randfile=NULL;
|
||||
char *engine = NULL;
|
||||
|
||||
#ifdef EFENCE
|
||||
EF_PROTECT_FREE=1;
|
||||
@@ -419,6 +423,11 @@ EF_ALIGNMENT=0;
|
||||
if (--argc < 1) goto bad;
|
||||
crl_ext= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
bad:
|
||||
@@ -439,6 +448,24 @@ bad:
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto err;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
if (configfile == NULL) configfile = getenv("OPENSSL_CONF");
|
||||
if (configfile == NULL) configfile = getenv("SSLEAY_CONF");
|
||||
|
31
apps/dgst.c
31
apps/dgst.c
@@ -66,6 +66,7 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef BUFSIZE
|
||||
#define BUFSIZE 1024*8
|
||||
@@ -80,6 +81,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
unsigned char *buf=NULL;
|
||||
int i,err=0;
|
||||
const EVP_MD *md=NULL,*m;
|
||||
@@ -87,8 +89,8 @@ int MAIN(int argc, char **argv)
|
||||
BIO *bmd=NULL;
|
||||
BIO *out = NULL;
|
||||
const char *name;
|
||||
#define PROG_NAME_SIZE 39
|
||||
char pname[PROG_NAME_SIZE+1];
|
||||
#define PROG_NAME_SIZE 16
|
||||
char pname[PROG_NAME_SIZE];
|
||||
int separator=0;
|
||||
int debug=0;
|
||||
const char *outfile = NULL, *keyfile = NULL;
|
||||
@@ -97,6 +99,7 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY *sigkey = NULL;
|
||||
unsigned char *sigbuf = NULL;
|
||||
int siglen = 0;
|
||||
char *engine=NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -154,6 +157,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) break;
|
||||
sigfile=*(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) break;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-hex") == 0)
|
||||
out_bin = 0;
|
||||
else if (strcmp(*argv,"-binary") == 0)
|
||||
@@ -190,6 +198,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,"-prverify file verify a signature using private key in file\n");
|
||||
BIO_printf(bio_err,"-signature file signature to verify\n");
|
||||
BIO_printf(bio_err,"-binary output in binary form\n");
|
||||
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
||||
|
||||
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
|
||||
LN_md5,LN_md5);
|
||||
@@ -209,6 +218,24 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
bmd=BIO_new(BIO_f_md());
|
||||
if (debug)
|
||||
|
29
apps/dh.c
29
apps/dh.c
@@ -69,6 +69,7 @@
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dh_main
|
||||
@@ -87,11 +88,12 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
DH *dh=NULL;
|
||||
int i,badops=0,text=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||
char *infile,*outfile,*prog;
|
||||
char *infile,*outfile,*prog,*engine;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -99,6 +101,7 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
engine=NULL;
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
informat=FORMAT_PEM;
|
||||
@@ -129,6 +132,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-check") == 0)
|
||||
check=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
@@ -160,11 +168,30 @@ bad:
|
||||
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
||||
BIO_printf(bio_err," -C Output C code\n");
|
||||
BIO_printf(bio_err," -noout no output\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
|
@@ -121,6 +121,7 @@
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#ifndef NO_DSA
|
||||
#include <openssl/dsa.h>
|
||||
@@ -148,6 +149,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
DH *dh=NULL;
|
||||
int i,badops=0,text=0;
|
||||
#ifndef NO_DSA
|
||||
@@ -156,7 +158,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||
char *infile,*outfile,*prog;
|
||||
char *inrand=NULL;
|
||||
char *inrand=NULL,*engine=NULL;
|
||||
int num = 0, g = 0;
|
||||
|
||||
apps_startup();
|
||||
@@ -195,6 +197,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-check") == 0)
|
||||
check=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
@@ -240,6 +247,7 @@ bad:
|
||||
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
|
||||
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
|
||||
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
@@ -249,6 +257,24 @@ bad:
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if (g && !num)
|
||||
num = DEFBITS;
|
||||
|
||||
|
29
apps/dsa.c
29
apps/dsa.c
@@ -68,6 +68,7 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dsa_main
|
||||
@@ -87,6 +88,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int ret=1;
|
||||
DSA *dsa=NULL;
|
||||
int i,badops=0;
|
||||
@@ -94,7 +96,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,text=0,noout=0;
|
||||
int pubin = 0, pubout = 0;
|
||||
char *infile,*outfile,*prog;
|
||||
char *infile,*outfile,*prog,*engine;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
int modulus=0;
|
||||
@@ -105,6 +107,7 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
engine=NULL;
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
informat=FORMAT_PEM;
|
||||
@@ -145,6 +148,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
@@ -176,6 +184,7 @@ bad:
|
||||
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
#ifndef NO_IDEA
|
||||
@@ -189,6 +198,24 @@ bad:
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
|
@@ -69,6 +69,7 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dsaparam_main
|
||||
@@ -90,11 +91,12 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
DSA *dsa=NULL;
|
||||
int i,badops=0,text=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,noout=0,C=0,ret=1;
|
||||
char *infile,*outfile,*prog,*inrand=NULL;
|
||||
char *infile,*outfile,*prog,*inrand=NULL,*engine=NULL;
|
||||
int numbits= -1,num,genkey=0;
|
||||
int need_rand=0;
|
||||
|
||||
|
31
apps/enc.c
31
apps/enc.c
@@ -70,6 +70,7 @@
|
||||
#include <openssl/md5.h>
|
||||
#endif
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
int set_hex(char *in,unsigned char *out,int size);
|
||||
#undef SIZE
|
||||
@@ -84,6 +85,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
static const char magic[]="Salted__";
|
||||
char mbuf[8]; /* should be 1 smaller than magic */
|
||||
char *strbuf=NULL;
|
||||
@@ -99,8 +101,9 @@ int MAIN(int argc, char **argv)
|
||||
const EVP_CIPHER *cipher=NULL,*c;
|
||||
char *inf=NULL,*outf=NULL;
|
||||
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
|
||||
#define PROG_NAME_SIZE 39
|
||||
char pname[PROG_NAME_SIZE+1];
|
||||
#define PROG_NAME_SIZE 16
|
||||
char pname[PROG_NAME_SIZE];
|
||||
char *engine = NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -141,6 +144,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
passarg= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-d") == 0)
|
||||
enc=0;
|
||||
else if (strcmp(*argv,"-p") == 0)
|
||||
@@ -241,6 +249,7 @@ bad:
|
||||
BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv");
|
||||
BIO_printf(bio_err,"%-14s print the iv/key (then exit if -P)\n","-[pP]");
|
||||
BIO_printf(bio_err,"%-14s buffer size\n","-bufsize <n>");
|
||||
BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
|
||||
|
||||
BIO_printf(bio_err,"Cipher Types\n");
|
||||
BIO_printf(bio_err,"des : 56 bit key DES encryption\n");
|
||||
@@ -314,6 +323,24 @@ bad:
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if (bufsize != NULL)
|
||||
{
|
||||
unsigned long n;
|
||||
|
33
apps/gendh.c
33
apps/gendh.c
@@ -70,6 +70,7 @@
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define DEFBITS 512
|
||||
#undef PROG
|
||||
@@ -81,11 +82,13 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
DH *dh=NULL;
|
||||
int ret=1,num=DEFBITS;
|
||||
int g=2;
|
||||
char *outfile=NULL;
|
||||
char *inrand=NULL;
|
||||
char *engine=NULL;
|
||||
BIO *out=NULL;
|
||||
|
||||
apps_startup();
|
||||
@@ -110,6 +113,11 @@ int MAIN(int argc, char **argv)
|
||||
g=3; */
|
||||
else if (strcmp(*argv,"-5") == 0)
|
||||
g=5;
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-rand") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -125,15 +133,34 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"usage: gendh [args] [numbits]\n");
|
||||
BIO_printf(bio_err," -out file - output the key to 'file\n");
|
||||
BIO_printf(bio_err," -2 use 2 as the generator value\n");
|
||||
/* BIO_printf(bio_err," -3 use 3 as the generator value\n"); */
|
||||
BIO_printf(bio_err," -5 use 5 as the generator value\n");
|
||||
BIO_printf(bio_err," -2 - use 2 as the generator value\n");
|
||||
/* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */
|
||||
BIO_printf(bio_err," -5 - use 5 as the generator value\n");
|
||||
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
out=BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
{
|
||||
|
@@ -68,6 +68,7 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define DEFBITS 512
|
||||
#undef PROG
|
||||
@@ -77,6 +78,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
DSA *dsa=NULL;
|
||||
int ret=1;
|
||||
char *outfile=NULL;
|
||||
@@ -84,6 +86,7 @@ int MAIN(int argc, char **argv)
|
||||
char *passargout = NULL, *passout = NULL;
|
||||
BIO *out=NULL,*in=NULL;
|
||||
EVP_CIPHER *enc=NULL;
|
||||
char *engine=NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -106,6 +109,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-rand") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -145,6 +153,7 @@ bad:
|
||||
#ifndef NO_IDEA
|
||||
BIO_printf(bio_err," -idea - encrypt the generated key with IDEA in cbc mode\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
@@ -153,6 +162,24 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
|
@@ -69,6 +69,7 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define DEFBITS 512
|
||||
#undef PROG
|
||||
@@ -80,6 +81,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int ret=1;
|
||||
RSA *rsa=NULL;
|
||||
int i,num=DEFBITS;
|
||||
@@ -88,6 +90,7 @@ int MAIN(int argc, char **argv)
|
||||
unsigned long f4=RSA_F4;
|
||||
char *outfile=NULL;
|
||||
char *passargout = NULL, *passout = NULL;
|
||||
char *engine=NULL;
|
||||
char *inrand=NULL;
|
||||
BIO *out=NULL;
|
||||
|
||||
@@ -116,6 +119,11 @@ int MAIN(int argc, char **argv)
|
||||
f4=3;
|
||||
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
|
||||
f4=RSA_F4;
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-rand") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -154,6 +162,7 @@ bad:
|
||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
|
||||
BIO_printf(bio_err," -3 use 3 for the E value\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err," load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
@@ -167,6 +176,24 @@ bad:
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto err;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if (outfile == NULL)
|
||||
{
|
||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||
@@ -186,7 +213,8 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
||||
&& !RAND_status())
|
||||
{
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
}
|
||||
|
@@ -1133,7 +1133,6 @@ $!
|
||||
$! Save directory information
|
||||
$!
|
||||
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
|
||||
$ __HERE = F$EDIT(__HERE,"UPCASE")
|
||||
$ __TOP = __HERE - "APPS]"
|
||||
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
|
||||
$!
|
||||
|
@@ -88,8 +88,8 @@ BIO *bio_err=NULL;
|
||||
int main(int Argc, char *Argv[])
|
||||
{
|
||||
ARGS arg;
|
||||
#define PROG_NAME_SIZE 39
|
||||
char pname[PROG_NAME_SIZE+1];
|
||||
#define PROG_NAME_SIZE 16
|
||||
char pname[PROG_NAME_SIZE];
|
||||
FUNCTION f,*fp;
|
||||
MS_STATIC char *prompt,buf[1024],config_name[256];
|
||||
int n,i,ret=0;
|
||||
|
@@ -66,6 +66,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define PROG pkcs12_main
|
||||
|
||||
@@ -92,6 +93,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
char *infile=NULL, *outfile=NULL, *keyname = NULL;
|
||||
char *certfile=NULL;
|
||||
BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL;
|
||||
@@ -118,6 +120,7 @@ int MAIN(int argc, char **argv)
|
||||
char *passin = NULL, *passout = NULL;
|
||||
char *inrand = NULL;
|
||||
char *CApath = NULL, *CAfile = NULL;
|
||||
char *engine=NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -236,6 +239,11 @@ int MAIN(int argc, char **argv)
|
||||
args++;
|
||||
CAfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp(*args,"-engine")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
engine = *args;
|
||||
} else badarg = 1;
|
||||
} else badarg = 1;
|
||||
|
||||
} else badarg = 1;
|
||||
@@ -279,12 +287,27 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "-password p set import/export password source\n");
|
||||
BIO_printf (bio_err, "-passin p input file pass phrase source\n");
|
||||
BIO_printf (bio_err, "-passout p output file pass phrase source\n");
|
||||
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err, " the random number generator\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL) {
|
||||
if((e = ENGINE_by_id(engine)) == NULL) {
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n", engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if(passarg) {
|
||||
if(export_cert) passargout = passarg;
|
||||
else passargin = passarg;
|
||||
|
27
apps/pkcs7.c
27
apps/pkcs7.c
@@ -67,6 +67,7 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pkcs7.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG pkcs7_main
|
||||
@@ -82,6 +83,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
PKCS7 *p7=NULL;
|
||||
int i,badops=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
@@ -89,6 +91,7 @@ int MAIN(int argc, char **argv)
|
||||
char *infile,*outfile,*prog;
|
||||
int print_certs=0,text=0,noout=0;
|
||||
int ret=0;
|
||||
char *engine=NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -132,6 +135,11 @@ int MAIN(int argc, char **argv)
|
||||
text=1;
|
||||
else if (strcmp(*argv,"-print_certs") == 0)
|
||||
print_certs=1;
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||
@@ -154,11 +162,30 @@ bad:
|
||||
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
|
||||
BIO_printf(bio_err," -text print full details of certificates\n");
|
||||
BIO_printf(bio_err," -noout don't output encoded data\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
EXIT(1);
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
|
30
apps/pkcs8.c
30
apps/pkcs8.c
@@ -62,6 +62,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#include "apps.h"
|
||||
#define PROG pkcs8_main
|
||||
@@ -70,6 +71,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
char **args, *infile = NULL, *outfile = NULL;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
@@ -85,9 +87,13 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY *pkey;
|
||||
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
||||
int badarg = 0;
|
||||
char *engine=NULL;
|
||||
|
||||
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
|
||||
informat=FORMAT_PEM;
|
||||
outformat=FORMAT_PEM;
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
OpenSSL_add_all_algorithms();
|
||||
args = argv + 1;
|
||||
@@ -138,6 +144,11 @@ int MAIN(int argc, char **argv)
|
||||
if (!args[1]) goto bad;
|
||||
passargout= *(++args);
|
||||
}
|
||||
else if (strcmp(*args,"-engine") == 0)
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
engine= *(++args);
|
||||
}
|
||||
else if (!strcmp (*args, "-in")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -170,9 +181,28 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
|
||||
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
||||
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
return (1);
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
return (1);
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
return (1);
|
||||
|
35
apps/rand.c
35
apps/rand.c
@@ -9,6 +9,7 @@
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG rand_main
|
||||
@@ -23,6 +24,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int i, r, ret = 1;
|
||||
int badopt;
|
||||
char *outfile = NULL;
|
||||
@@ -30,6 +32,7 @@ int MAIN(int argc, char **argv)
|
||||
int base64 = 0;
|
||||
BIO *out = NULL;
|
||||
int num = -1;
|
||||
char *engine=NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -48,6 +51,13 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
badopt = 1;
|
||||
}
|
||||
if (strcmp(argv[i], "-engine") == 0)
|
||||
{
|
||||
if ((argv[i+1] != NULL) && (engine == NULL))
|
||||
engine = argv[++i];
|
||||
else
|
||||
badopt = 1;
|
||||
}
|
||||
else if (strcmp(argv[i], "-rand") == 0)
|
||||
{
|
||||
if ((argv[i+1] != NULL) && (inrand == NULL))
|
||||
@@ -84,12 +94,31 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
BIO_printf(bio_err, "Usage: rand [options] num\n");
|
||||
BIO_printf(bio_err, "where options are\n");
|
||||
BIO_printf(bio_err, "-out file - write to file\n");
|
||||
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err, "-base64 - encode output\n");
|
||||
BIO_printf(bio_err, "-out file - write to file\n");
|
||||
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err, "-base64 - encode output\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto err;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
|
82
apps/req.c
82
apps/req.c
@@ -73,6 +73,7 @@
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define SECTION "req"
|
||||
|
||||
@@ -140,6 +141,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
#ifndef NO_DSA
|
||||
DSA *dsa_params=NULL;
|
||||
#endif
|
||||
@@ -152,6 +154,7 @@ int MAIN(int argc, char **argv)
|
||||
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
|
||||
int nodes=0,kludge=0,newhdr=0;
|
||||
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
|
||||
char *engine=NULL;
|
||||
char *extensions = NULL;
|
||||
char *req_exts = NULL;
|
||||
EVP_CIPHER *cipher=NULL;
|
||||
@@ -195,6 +198,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outformat=str2fmt(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-key") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -283,7 +291,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end;
|
||||
dtmp=X509_get_pubkey(xtmp);
|
||||
if (dtmp->type == EVP_PKEY_DSA)
|
||||
dsa_params=DSAparams_dup(dtmp->pkey.dsa);
|
||||
EVP_PKEY_free(dtmp);
|
||||
@@ -375,6 +383,7 @@ bad:
|
||||
BIO_printf(bio_err," -verify verify signature on REQ\n");
|
||||
BIO_printf(bio_err," -modulus RSA modulus\n");
|
||||
BIO_printf(bio_err," -nodes don't encrypt the output key\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," -key file use the private key contained in file\n");
|
||||
BIO_printf(bio_err," -keyform arg key file format\n");
|
||||
BIO_printf(bio_err," -keyout arg file to send the key to\n");
|
||||
@@ -383,7 +392,8 @@ bad:
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
BIO_printf(bio_err," -newkey rsa:bits generate a new RSA key of 'bits' in size\n");
|
||||
BIO_printf(bio_err," -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n");
|
||||
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2, md4)\n");
|
||||
|
||||
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2)\n");
|
||||
BIO_printf(bio_err," -config file request template file.\n");
|
||||
BIO_printf(bio_err," -new new request.\n");
|
||||
BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n");
|
||||
@@ -521,24 +531,55 @@ bad:
|
||||
if ((in == NULL) || (out == NULL))
|
||||
goto end;
|
||||
|
||||
if (keyfile != NULL)
|
||||
if (engine != NULL)
|
||||
{
|
||||
if (BIO_read_filename(in,keyfile) <= 0)
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
perror(keyfile);
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (keyform == FORMAT_ASN1)
|
||||
pkey=d2i_PrivateKey_bio(in,NULL);
|
||||
else if (keyform == FORMAT_PEM)
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,passin);
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if (keyfile != NULL)
|
||||
{
|
||||
if (keyform == FORMAT_ENGINE)
|
||||
{
|
||||
if (!e)
|
||||
{
|
||||
BIO_printf(bio_err,"no engine specified\n");
|
||||
goto end;
|
||||
}
|
||||
pkey = ENGINE_load_private_key(e, keyfile, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"bad input format specified for X509 request\n");
|
||||
goto end;
|
||||
if (BIO_read_filename(in,keyfile) <= 0)
|
||||
{
|
||||
perror(keyfile);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (keyform == FORMAT_ASN1)
|
||||
pkey=d2i_PrivateKey_bio(in,NULL);
|
||||
else if (keyform == FORMAT_PEM)
|
||||
{
|
||||
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,
|
||||
passin);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"bad input format specified for X509 request\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (pkey == NULL)
|
||||
@@ -718,14 +759,17 @@ loop:
|
||||
|
||||
/* Set version to V3 */
|
||||
if(!X509_set_version(x509ss, 2)) goto end;
|
||||
if (!ASN1_INTEGER_set(X509_get_serialNumber(x509ss),0L)) goto end;
|
||||
ASN1_INTEGER_set(X509_get_serialNumber(x509ss),0L);
|
||||
|
||||
if (!X509_set_issuer_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
|
||||
if (!X509_gmtime_adj(X509_get_notBefore(x509ss),0)) goto end;
|
||||
if (!X509_gmtime_adj(X509_get_notAfter(x509ss), (long)60*60*24*days)) goto end;
|
||||
if (!X509_set_subject_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
|
||||
X509_set_issuer_name(x509ss,
|
||||
X509_REQ_get_subject_name(req));
|
||||
X509_gmtime_adj(X509_get_notBefore(x509ss),0);
|
||||
X509_gmtime_adj(X509_get_notAfter(x509ss),
|
||||
(long)60*60*24*days);
|
||||
X509_set_subject_name(x509ss,
|
||||
X509_REQ_get_subject_name(req));
|
||||
tmppkey = X509_REQ_get_pubkey(req);
|
||||
if (!tmppkey || !X509_set_pubkey(x509ss,tmppkey)) goto end;
|
||||
X509_set_pubkey(x509ss,tmppkey);
|
||||
EVP_PKEY_free(tmppkey);
|
||||
|
||||
/* Set up V3 context struct */
|
||||
@@ -956,7 +1000,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
|
||||
else i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs);
|
||||
if(!i) goto err;
|
||||
|
||||
if (!X509_REQ_set_pubkey(req,pkey)) goto err;
|
||||
X509_REQ_set_pubkey(req,pkey);
|
||||
|
||||
ret=1;
|
||||
err:
|
||||
|
27
apps/rsa.c
27
apps/rsa.c
@@ -68,6 +68,7 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG rsa_main
|
||||
@@ -90,6 +91,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int ret=1;
|
||||
RSA *rsa=NULL;
|
||||
int i,badops=0, sgckey=0;
|
||||
@@ -100,6 +102,7 @@ int MAIN(int argc, char **argv)
|
||||
char *infile,*outfile,*prog;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
char *engine=NULL;
|
||||
int modulus=0;
|
||||
|
||||
apps_startup();
|
||||
@@ -148,6 +151,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-sgckey") == 0)
|
||||
sgckey=1;
|
||||
else if (strcmp(*argv,"-pubin") == 0)
|
||||
@@ -195,11 +203,30 @@ bad:
|
||||
BIO_printf(bio_err," -check verify key consistency\n");
|
||||
BIO_printf(bio_err," -pubin expect a public key in input file\n");
|
||||
BIO_printf(bio_err," -pubout output a public key\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
|
@@ -62,6 +62,7 @@
|
||||
#include <string.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define RSA_SIGN 1
|
||||
#define RSA_VERIFY 2
|
||||
@@ -82,6 +83,7 @@ int MAIN(int argc, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
char *infile = NULL, *outfile = NULL;
|
||||
char *keyfile = NULL;
|
||||
@@ -95,6 +97,7 @@ int MAIN(int argc, char **argv)
|
||||
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
|
||||
int rsa_inlen, rsa_outlen = 0;
|
||||
int keysize;
|
||||
char *engine=NULL;
|
||||
|
||||
int ret = 1;
|
||||
|
||||
@@ -117,6 +120,9 @@ int MAIN(int argc, char **argv)
|
||||
} else if(!strcmp(*argv, "-inkey")) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
keyfile = *(++argv);
|
||||
} else if(!strcmp(*argv, "-engine")) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
engine = *(++argv);
|
||||
} else if(!strcmp(*argv, "-pubin")) {
|
||||
key_type = KEY_PUBKEY;
|
||||
} else if(!strcmp(*argv, "-certin")) {
|
||||
@@ -151,6 +157,24 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
/* FIXME: seed PRNG only if needed */
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
|
||||
@@ -280,6 +304,7 @@ static void usage()
|
||||
BIO_printf(bio_err, "-inkey file input key\n");
|
||||
BIO_printf(bio_err, "-pubin input is an RSA public\n");
|
||||
BIO_printf(bio_err, "-certin input is a certificate carrying an RSA public key\n");
|
||||
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err, "-ssl use SSL v2 padding\n");
|
||||
BIO_printf(bio_err, "-raw use no padding\n");
|
||||
BIO_printf(bio_err, "-pkcs use PKCS#1 v1.5 padding (default)\n");
|
||||
|
@@ -80,6 +80,7 @@ typedef unsigned int u_int;
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/engine.h>
|
||||
#include "s_apps.h"
|
||||
|
||||
#ifdef WINDOWS
|
||||
@@ -154,7 +155,7 @@ static void sc_usage(void)
|
||||
BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n");
|
||||
BIO_printf(bio_err," command to see what is available\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
|
||||
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
||||
}
|
||||
|
||||
int MAIN(int, char **);
|
||||
@@ -182,6 +183,8 @@ int MAIN(int argc, char **argv)
|
||||
SSL_METHOD *meth=NULL;
|
||||
BIO *sbio;
|
||||
char *inrand=NULL;
|
||||
char *engine_id=NULL;
|
||||
ENGINE *e=NULL;
|
||||
#ifdef WINDOWS
|
||||
struct timeval tv;
|
||||
#endif
|
||||
@@ -324,6 +327,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
inrand= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine_id = *(++argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||
@@ -364,6 +372,30 @@ bad:
|
||||
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
SSL_load_error_strings();
|
||||
|
||||
if (engine_id != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine_id)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (c_debug)
|
||||
{
|
||||
ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
|
||||
0, bio_err, 0);
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine_id);
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
ctx=SSL_CTX_new(meth);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
@@ -896,7 +928,5 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
||||
BIO_printf(bio,"---\n");
|
||||
if (peer != NULL)
|
||||
X509_free(peer);
|
||||
/* flush, or debugging output gets mixed with http response */
|
||||
BIO_flush(bio);
|
||||
}
|
||||
|
||||
|
@@ -84,6 +84,7 @@ typedef unsigned int u_int;
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/engine.h>
|
||||
#include "s_apps.h"
|
||||
|
||||
#ifdef WINDOWS
|
||||
@@ -177,6 +178,7 @@ static int s_debug=0;
|
||||
static int s_quiet=0;
|
||||
|
||||
static int hack=0;
|
||||
static char *engine_id=NULL;
|
||||
|
||||
#ifdef MONOLITH
|
||||
static void s_server_init(void)
|
||||
@@ -199,6 +201,7 @@ static void s_server_init(void)
|
||||
s_debug=0;
|
||||
s_quiet=0;
|
||||
hack=0;
|
||||
engine_id=NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -244,6 +247,7 @@ static void sv_usage(void)
|
||||
BIO_printf(bio_err," -www - Respond to a 'GET /' with a status page\n");
|
||||
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
||||
}
|
||||
|
||||
static int local_argc=0;
|
||||
@@ -414,6 +418,8 @@ int MAIN(int argc, char *argv[])
|
||||
int state=0;
|
||||
SSL_METHOD *meth=NULL;
|
||||
char *inrand=NULL;
|
||||
char *engine_id=NULL;
|
||||
ENGINE *e=NULL;
|
||||
#ifndef NO_DH
|
||||
DH *dh=NULL;
|
||||
#endif
|
||||
@@ -573,6 +579,11 @@ int MAIN(int argc, char *argv[])
|
||||
if (--argc < 1) goto bad;
|
||||
inrand= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine_id= *(++argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||
@@ -624,6 +635,29 @@ bad:
|
||||
SSL_load_error_strings();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
|
||||
if (engine_id != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine_id)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (s_debug)
|
||||
{
|
||||
ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
|
||||
0, bio_err, 0);
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine_id);
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
ctx=SSL_CTX_new(meth);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
|
@@ -82,7 +82,7 @@
|
||||
#include "wintext.h"
|
||||
#endif
|
||||
|
||||
#if !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC)) || defined (_DARWIN)
|
||||
#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
|
||||
#define TIMES
|
||||
#endif
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
#undef TIMES
|
||||
#endif
|
||||
|
||||
#if !defined(TIMES) && !defined(VXWORKS)
|
||||
#ifndef TIMES
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
@@ -139,8 +139,6 @@
|
||||
#undef BUFSIZZ
|
||||
#define BUFSIZZ 1024*10
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
@@ -370,22 +368,6 @@ static double tm_Time_F(int s)
|
||||
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
||||
return((ret == 0.0)?1e-6:ret);
|
||||
}
|
||||
#elif defined(VXWORKS)
|
||||
{
|
||||
static unsigned long tick_start, tick_end;
|
||||
|
||||
if( s == START )
|
||||
{
|
||||
tick_start = tickGet();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tick_end = tickGet();
|
||||
ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
|
||||
return((ret == 0.0)?1e-6:ret);
|
||||
}
|
||||
}
|
||||
#else /* !times() */
|
||||
static struct timeb tstart,tend;
|
||||
long i;
|
||||
|
33
apps/smime.c
33
apps/smime.c
@@ -64,6 +64,7 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG smime_main
|
||||
@@ -81,6 +82,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int operation = 0;
|
||||
int ret = 0;
|
||||
char **args;
|
||||
@@ -103,8 +105,9 @@ int MAIN(int argc, char **argv)
|
||||
char *inrand = NULL;
|
||||
int need_rand = 0;
|
||||
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
|
||||
args = argv + 1;
|
||||
char *engine=NULL;
|
||||
|
||||
args = argv + 1;
|
||||
ret = 1;
|
||||
|
||||
while (!badarg && *args && *args[0] == '-') {
|
||||
@@ -153,6 +156,11 @@ int MAIN(int argc, char **argv)
|
||||
inrand = *args;
|
||||
} else badarg = 1;
|
||||
need_rand = 1;
|
||||
} else if (!strcmp(*args,"-engine")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
engine = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp(*args,"-passin")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -290,6 +298,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "-text include or delete text MIME headers\n");
|
||||
BIO_printf (bio_err, "-CApath dir trusted certificates directory\n");
|
||||
BIO_printf (bio_err, "-CAfile file trusted certificates file\n");
|
||||
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf (bio_err, "-passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||
@@ -298,6 +307,24 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
@@ -454,9 +481,9 @@ int MAIN(int argc, char **argv)
|
||||
} else if(operation == SMIME_VERIFY) {
|
||||
STACK_OF(X509) *signers;
|
||||
if(PKCS7_verify(p7, other, store, indata, out, flags)) {
|
||||
BIO_printf(bio_err, "Verification successful\n");
|
||||
BIO_printf(bio_err, "Verification Successful\n");
|
||||
} else {
|
||||
BIO_printf(bio_err, "Verification failure\n");
|
||||
BIO_printf(bio_err, "Verification Failure\n");
|
||||
goto end;
|
||||
}
|
||||
signers = PKCS7_get0_signers(p7, other, flags);
|
||||
|
72
apps/speed.c
72
apps/speed.c
@@ -81,13 +81,14 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(_DARWIN)
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
# define USE_TOD
|
||||
#elif !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC))
|
||||
#elif !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
|
||||
# define TIMES
|
||||
#endif
|
||||
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__) && !defined(_DARWIN) && !defined(VXWORKS)
|
||||
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__)
|
||||
# define TIMEB
|
||||
#endif
|
||||
|
||||
@@ -115,7 +116,7 @@
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(VXWORKS)
|
||||
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD)
|
||||
#error "It seems neither struct tms nor struct timeb is supported in this platform!"
|
||||
#endif
|
||||
|
||||
@@ -224,7 +225,7 @@ static double Time_F(int s, int usertime)
|
||||
|
||||
#ifdef USE_TOD
|
||||
if(usertime)
|
||||
{
|
||||
{
|
||||
static struct rusage tstart,tend;
|
||||
|
||||
if (s == START)
|
||||
@@ -284,23 +285,7 @@ static double Time_F(int s, int usertime)
|
||||
# if defined(TIMES) && defined(TIMEB)
|
||||
else
|
||||
# endif
|
||||
# ifdef VXWORKS
|
||||
{
|
||||
static unsigned long tick_start, tick_end;
|
||||
|
||||
if( s == START )
|
||||
{
|
||||
tick_start = tickGet();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tick_end = tickGet();
|
||||
ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
|
||||
return((ret < 0.001)?0.001:ret);
|
||||
}
|
||||
}
|
||||
# elif defined(TIMEB)
|
||||
# ifdef TIMEB
|
||||
{
|
||||
static struct timeb tstart,tend;
|
||||
long i;
|
||||
@@ -319,7 +304,6 @@ static double Time_F(int s, int usertime)
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -327,6 +311,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e;
|
||||
unsigned char *buf=NULL,*buf2=NULL;
|
||||
int mret=1;
|
||||
#define ALGOR_NUM 15
|
||||
@@ -335,9 +320,7 @@ int MAIN(int argc, char **argv)
|
||||
#define DSA_NUM 3
|
||||
long count,rsa_count;
|
||||
int i,j,k;
|
||||
#ifndef NO_RSA
|
||||
unsigned rsa_num;
|
||||
#endif
|
||||
#ifndef NO_MD2
|
||||
unsigned char md2[MD2_DIGEST_LENGTH];
|
||||
#endif
|
||||
@@ -489,6 +472,37 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
if ((argc > 0) && (strcmp(*argv,"-elapsed") == 0))
|
||||
usertime = 0;
|
||||
else
|
||||
if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
|
||||
{
|
||||
argc--;
|
||||
argv++;
|
||||
if(argc == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"no engine given\n");
|
||||
goto end;
|
||||
}
|
||||
if((e = ENGINE_by_id(*argv)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
*argv);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", *argv);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
/* It will be increased again further down. We just
|
||||
don't want speed to confuse an engine with an
|
||||
algorithm, especially when none is given (which
|
||||
means all of them should be run) */
|
||||
j--;
|
||||
}
|
||||
else
|
||||
#ifndef NO_MD2
|
||||
if (strcmp(*argv,"md2") == 0) doit[D_MD2]=1;
|
||||
else
|
||||
@@ -536,7 +550,7 @@ int MAIN(int argc, char **argv)
|
||||
#ifdef RSAref
|
||||
if (strcmp(*argv,"rsaref") == 0)
|
||||
{
|
||||
RSA_set_default_method(RSA_PKCS1_RSAref());
|
||||
RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
|
||||
j--;
|
||||
}
|
||||
else
|
||||
@@ -544,7 +558,7 @@ int MAIN(int argc, char **argv)
|
||||
#ifndef RSA_NULL
|
||||
if (strcmp(*argv,"openssl") == 0)
|
||||
{
|
||||
RSA_set_default_method(RSA_PKCS1_SSLeay());
|
||||
RSA_set_default_openssl_method(RSA_PKCS1_SSLeay());
|
||||
j--;
|
||||
}
|
||||
else
|
||||
@@ -689,11 +703,12 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,"\n");
|
||||
#endif
|
||||
|
||||
#ifdef TIMES
|
||||
BIO_printf(bio_err,"\n");
|
||||
BIO_printf(bio_err,"Available options:\n");
|
||||
#ifdef TIMES
|
||||
BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n");
|
||||
#endif
|
||||
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
||||
goto end;
|
||||
}
|
||||
argc--;
|
||||
@@ -1400,6 +1415,7 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
mret=0;
|
||||
end:
|
||||
ERR_print_errors(bio_err);
|
||||
if (buf != NULL) OPENSSL_free(buf);
|
||||
if (buf2 != NULL) OPENSSL_free(buf2);
|
||||
#ifndef NO_RSA
|
||||
|
27
apps/spkac.c
27
apps/spkac.c
@@ -69,6 +69,7 @@
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG spkac_main
|
||||
@@ -81,6 +82,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int i,badops=0, ret = 1;
|
||||
BIO *in = NULL,*out = NULL, *key = NULL;
|
||||
int verify=0,noout=0,pubkey=0;
|
||||
@@ -91,6 +93,7 @@ int MAIN(int argc, char **argv)
|
||||
LHASH *conf = NULL;
|
||||
NETSCAPE_SPKI *spki = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
char *engine=NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -136,6 +139,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
spksect= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-pubkey") == 0)
|
||||
@@ -161,6 +169,7 @@ bad:
|
||||
BIO_printf(bio_err," -noout don't print SPKAC\n");
|
||||
BIO_printf(bio_err," -pubkey output public key\n");
|
||||
BIO_printf(bio_err," -verify verify SPKAC signature\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -170,6 +179,24 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if(keyfile) {
|
||||
if(strcmp(keyfile, "-")) key = BIO_new_file(keyfile, "r");
|
||||
else key = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
|
@@ -65,6 +65,7 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG verify_main
|
||||
@@ -78,6 +79,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int i,ret=1;
|
||||
int purpose = -1;
|
||||
char *CApath=NULL,*CAfile=NULL;
|
||||
@@ -85,6 +87,7 @@ int MAIN(int argc, char **argv)
|
||||
STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
|
||||
X509_STORE *cert_ctx=NULL;
|
||||
X509_LOOKUP *lookup=NULL;
|
||||
char *engine=NULL;
|
||||
|
||||
cert_ctx=X509_STORE_new();
|
||||
if (cert_ctx == NULL) goto end;
|
||||
@@ -137,6 +140,11 @@ int MAIN(int argc, char **argv)
|
||||
if (argc-- < 1) goto end;
|
||||
trustfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto end;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-help") == 0)
|
||||
goto end;
|
||||
else if (strcmp(*argv,"-issuer_checks") == 0)
|
||||
@@ -154,6 +162,24 @@ int MAIN(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
||||
if (lookup == NULL) abort();
|
||||
if (CAfile) {
|
||||
@@ -201,7 +227,7 @@ int MAIN(int argc, char **argv)
|
||||
ret=0;
|
||||
end:
|
||||
if (ret == 1) {
|
||||
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] cert1 cert2 ...\n");
|
||||
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-engine e] cert1 cert2 ...\n");
|
||||
BIO_printf(bio_err,"recognized usages:\n");
|
||||
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
||||
X509_PURPOSE *ptmp;
|
||||
|
27
apps/x509.c
27
apps/x509.c
@@ -73,6 +73,7 @@
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG x509_main
|
||||
@@ -129,6 +130,7 @@ static char *x509_usage[]={
|
||||
" -extensions - section from config file with X509V3 extensions to add\n",
|
||||
" -clrext - delete extensions before signing and input certificate\n",
|
||||
" -nameopt arg - various certificate name options\n",
|
||||
" -engine e - use engine e, possibly a hardware device.\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -145,6 +147,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int ret=1;
|
||||
X509_REQ *req=NULL;
|
||||
X509 *x=NULL,*xca=NULL;
|
||||
@@ -175,6 +178,7 @@ int MAIN(int argc, char **argv)
|
||||
int need_rand = 0;
|
||||
int checkend=0,checkoffset=0;
|
||||
unsigned long nmflag = 0;
|
||||
char *engine=NULL;
|
||||
|
||||
reqfile=0;
|
||||
|
||||
@@ -337,6 +341,11 @@ int MAIN(int argc, char **argv)
|
||||
alias= *(++argv);
|
||||
trustout = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-C") == 0)
|
||||
C= ++num;
|
||||
else if (strcmp(*argv,"-email") == 0)
|
||||
@@ -420,6 +429,24 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
|
||||
if (need_rand)
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
|
||||
|
129
config
129
config
@@ -68,11 +68,6 @@ if [ "x$XREL" != "x" ]; then
|
||||
4.2)
|
||||
echo "whatever-whatever-unixware1"; exit 0
|
||||
;;
|
||||
OpenUNIX)
|
||||
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
|
||||
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
|
||||
fi
|
||||
;;
|
||||
5)
|
||||
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
|
||||
echo "${MACHINE}-sco-unixware7"; exit 0
|
||||
@@ -200,33 +195,15 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "${MACHINE}-whatever-openbsd"; exit 0
|
||||
;;
|
||||
|
||||
OpenUNIX:*)
|
||||
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
|
||||
;;
|
||||
|
||||
OSF1:*:*:*alpha*)
|
||||
OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
|
||||
case "$OSFMAJOR" in
|
||||
4|5)
|
||||
echo "${MACHINE}-dec-tru64"; exit 0
|
||||
;;
|
||||
1|2|3)
|
||||
echo "${MACHINE}-dec-osf"; exit 0
|
||||
;;
|
||||
*)
|
||||
echo "${MACHINE}-dec-osf"; exit 0
|
||||
;;
|
||||
esac
|
||||
echo "${MACHINE}-dec-osf"; exit 0
|
||||
;;
|
||||
|
||||
QNX:*)
|
||||
case "$RELEASE" in
|
||||
case "$VERSION" in
|
||||
4*)
|
||||
echo "${MACHINE}-whatever-qnx4"
|
||||
;;
|
||||
6*)
|
||||
echo "${MACHINE}-whatever-qnx6"
|
||||
;;
|
||||
*)
|
||||
echo "${MACHINE}-whatever-qnx"
|
||||
;;
|
||||
@@ -242,10 +219,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "ppc-apple-rhapsody"; exit 0
|
||||
;;
|
||||
|
||||
Darwin:*)
|
||||
echo "ppc-apple-darwin"; exit 0
|
||||
;;
|
||||
|
||||
SunOS:5.*)
|
||||
echo "${MACHINE}-whatever-solaris2"; exit 0
|
||||
;;
|
||||
@@ -298,25 +271,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "mips-sony-newsos4"; exit 0;
|
||||
;;
|
||||
|
||||
CYGWIN*)
|
||||
case "$RELEASE" in
|
||||
[bB]*|1.0|1.[12].*)
|
||||
echo "${MACHINE}-whatever-cygwin_pre1.3"
|
||||
;;
|
||||
*)
|
||||
echo "${MACHINE}-whatever-cygwin"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*"CRAY T3E")
|
||||
echo "t3e-cray-unicosmk"; exit 0;
|
||||
;;
|
||||
|
||||
*CRAY*)
|
||||
echo "j90-cray-unicos"; exit 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
@@ -481,27 +435,11 @@ case "$GUESSOS" in
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
mips-*-linux?)
|
||||
cat >dummy.c <<EOF
|
||||
#include <stdio.h> /* for printf() prototype */
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#ifdef __MIPSEB__
|
||||
printf ("linux-%s\n", argv[1]);
|
||||
#endif
|
||||
#ifdef __MIPSEL__
|
||||
printf ("linux-%sel\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
|
||||
rm dummy dummy.c
|
||||
;;
|
||||
mips-*-linux?) OUT="linux-mips" ;;
|
||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||
m68k-*-linux*) OUT="linux-m68k" ;;
|
||||
ia64-*-linux?) OUT="linux-ia64" ;;
|
||||
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
||||
ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
|
||||
sparc64-*-linux2)
|
||||
#Before we can uncomment following lines we have to wait at least
|
||||
#till 64-bit glibc for SPARC is operational:-(
|
||||
@@ -518,29 +456,8 @@ EOF
|
||||
sun4d) OUT="linux-sparcv8" ;;
|
||||
*) OUT="linux-sparcv7" ;;
|
||||
esac ;;
|
||||
parisc-*-linux2)
|
||||
CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
|
||||
CPUSCHEDULE=`awk '/^cpu.[ ]: PA/{print substr($3,3)}' /proc/cpuinfo`
|
||||
|
||||
# ??TODO ?? Model transformations
|
||||
# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
|
||||
# assuming no further arch. identification will ever be used by GCC.
|
||||
# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
|
||||
# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
|
||||
# for these chips in the future.
|
||||
# PA7300LC -> 7100LC (1.1)
|
||||
# PA8200 -> 8000 (2.0)
|
||||
# PA8500 -> 8000 (2.0)
|
||||
# PA8600 -> 8000 (2.0)
|
||||
|
||||
CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
|
||||
# Finish Model transformations
|
||||
|
||||
options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
||||
OUT="linux-parisc" ;;
|
||||
arm*-*-linux2) OUT="linux-elf-arm" ;;
|
||||
s390-*-linux2) OUT="linux-s390" ;;
|
||||
s390x-*-linux?) OUT="linux-s390x" ;;
|
||||
*-*-linux2) OUT="linux-elf" ;;
|
||||
*-*-linux1) OUT="linux-aout" ;;
|
||||
sun4u*-*-solaris2)
|
||||
@@ -568,15 +485,7 @@ EOF
|
||||
pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
|
||||
*-*-openbsd) OUT="OpenBSD" ;;
|
||||
*86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
|
||||
*-*-osf) OUT="alphaold-cc" ;;
|
||||
*-*-tru64) OUT="alpha-cc" ;;
|
||||
*-*-OpenUNIX*)
|
||||
if [ "$CC" = "gcc" ]; then
|
||||
OUT="OpenUNIX-8-gcc"
|
||||
else
|
||||
OUT="OpenUNIX-8"
|
||||
fi
|
||||
;;
|
||||
*-*-osf) OUT="alpha-cc" ;;
|
||||
*-*-unixware7) OUT="unixware-7" ;;
|
||||
*-*-UnixWare7) OUT="unixware-7" ;;
|
||||
*-*-Unixware7) OUT="unixware-7" ;;
|
||||
@@ -596,18 +505,30 @@ EOF
|
||||
# *-aix) OUT="aix-$CC" ;;
|
||||
# *-dgux) OUT="dgux" ;;
|
||||
mips-sony-newsos4) OUT="newsos4-gcc" ;;
|
||||
*-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
|
||||
*-*-cygwin) OUT="Cygwin" ;;
|
||||
t3e-cray-unicosmk) OUT="cray-t3e" ;;
|
||||
j90-cray-unicos) OUT="cray-j90" ;;
|
||||
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
||||
esac
|
||||
|
||||
# NB: This atalla support has been superceded by the ENGINE support
|
||||
# That contains its own header and definitions anyway. Support can
|
||||
# be enabled or disabled on any supported platform without external
|
||||
# headers, eg. by adding the "hw-atalla" switch to ./config or
|
||||
# perl Configure
|
||||
#
|
||||
# See whether we can compile Atalla support
|
||||
if [ -f /usr/include/atasi.h ]
|
||||
then
|
||||
options="$options -DATALLA"
|
||||
fi
|
||||
#if [ -f /usr/include/atasi.h ]
|
||||
#then
|
||||
# options="$options -DATALLA"
|
||||
#fi
|
||||
|
||||
#get some basic shared lib support (behnke@trustcenter.de)
|
||||
case "$OUT" in
|
||||
solaris-*-gcc)
|
||||
if [ "$SHARED" = "true" ]
|
||||
then
|
||||
options="$options -DPIC -fPIC"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# gcc < 2.8 does not support -mcpu=ultrasparc
|
||||
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
|
||||
@@ -628,7 +549,7 @@ case "$GUESSOS" in
|
||||
i386-*) options="$options 386" ;;
|
||||
esac
|
||||
|
||||
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
|
||||
for i in bf cast des dh dsa hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
|
||||
do
|
||||
if [ ! -d crypto/$i ]
|
||||
then
|
||||
|
@@ -6,7 +6,7 @@ DIR= crypto
|
||||
TOP= ..
|
||||
CC= cc
|
||||
INCLUDE= -I. -I../include
|
||||
INCLUDES= -I.. -I../.. -I../../include
|
||||
INCLUDES= -I.. -I../../include
|
||||
CFLAG= -g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
@@ -27,7 +27,7 @@ LIBS=
|
||||
|
||||
SDIRS= md2 md5 sha mdc2 hmac ripemd \
|
||||
des rc2 rc4 rc5 idea bf cast \
|
||||
bn rsa dsa dh dso \
|
||||
bn rsa dsa dh dso engine \
|
||||
buffer bio stack lhash rand err objects \
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
|
||||
|
||||
|
@@ -936,40 +936,40 @@ t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
t_bitst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
t_bitst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
t_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
t_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
t_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_bitst.o: ../cryptlib.h
|
||||
t_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
t_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
t_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
t_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
t_crl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_crl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
t_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
t_crl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
t_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
t_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
t_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
t_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_crl.o: ../cryptlib.h
|
||||
t_crl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
t_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
t_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
t_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
t_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
@@ -985,20 +985,20 @@ t_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
t_req.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
t_req.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
t_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
t_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_req.o: ../cryptlib.h
|
||||
t_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
t_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
t_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
t_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
t_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
@@ -1024,20 +1024,20 @@ t_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
t_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
t_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
t_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
t_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_x509.o: ../cryptlib.h
|
||||
t_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
t_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
t_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
t_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
t_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
t_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
@@ -1310,20 +1310,21 @@ x_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
x_x509.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
|
||||
x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
x_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
x_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
x_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
x_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
x_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
x_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
|
||||
x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
x_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
x_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
x_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
x_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
x_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
x_x509.o: ../cryptlib.h
|
||||
x_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
|
@@ -224,7 +224,6 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
|
||||
w=n/8;
|
||||
v=1<<(7-(n&0x07));
|
||||
iv= ~v;
|
||||
if (!value) v=0;
|
||||
|
||||
a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */
|
||||
|
||||
|
@@ -203,7 +203,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
if (s == NULL)
|
||||
return(NULL);
|
||||
|
||||
#if defined(THREADS) && !defined(WIN32) && ! defined(_DARWIN)
|
||||
#if defined(THREADS) && !defined(WIN32)
|
||||
gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
|
||||
ts=&data;
|
||||
#else
|
||||
|
@@ -105,9 +105,9 @@ int ASN1_STRING_set_default_mask_asc(char *p)
|
||||
mask = strtoul(p + 5, &end, 0);
|
||||
if(*end) return 0;
|
||||
} else if(!strcmp(p, "nombstr"))
|
||||
mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING));
|
||||
mask = ~(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING);
|
||||
else if(!strcmp(p, "pkix"))
|
||||
mask = ~((unsigned long)B_ASN1_T61STRING);
|
||||
mask = ~B_ASN1_T61STRING;
|
||||
else if(!strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING;
|
||||
else if(!strcmp(p, "default"))
|
||||
mask = 0xFFFFFFFFL;
|
||||
|
@@ -113,7 +113,7 @@ ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length)
|
||||
ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
|
||||
{
|
||||
struct tm *ts;
|
||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
|
||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
|
||||
struct tm data;
|
||||
|
||||
gmtime_r(&t,&data);
|
||||
|
@@ -203,7 +203,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
|
||||
if (s == NULL)
|
||||
return(NULL);
|
||||
|
||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
|
||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
|
||||
gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
|
||||
ts=&data;
|
||||
#else
|
||||
@@ -286,7 +286,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
|
||||
|
||||
t -= offset*60; /* FIXME: may overflow in extreme cases */
|
||||
|
||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
|
||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
|
||||
{ struct tm data; gmtime_r(&t, &data); tm = &data; }
|
||||
#else
|
||||
tm = gmtime(&t);
|
||||
|
@@ -834,6 +834,8 @@ void ASN1_HEADER_free(ASN1_HEADER *a);
|
||||
|
||||
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
|
||||
|
||||
void ERR_load_ASN1_strings(void);
|
||||
|
||||
/* Not used that much at this point, except for the first two */
|
||||
ASN1_METHOD *X509_asn1_meth(void);
|
||||
ASN1_METHOD *RSAPrivateKey_asn1_meth(void);
|
||||
@@ -875,7 +877,6 @@ void ASN1_STRING_TABLE_cleanup(void);
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_ASN1_strings(void);
|
||||
|
||||
/* Error codes for the ASN1 functions. */
|
||||
|
||||
@@ -1147,3 +1148,4 @@ void ERR_load_ASN1_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -569,7 +569,7 @@ pow10(int exp)
|
||||
}
|
||||
|
||||
static long
|
||||
roundv(LDOUBLE value)
|
||||
round(LDOUBLE value)
|
||||
{
|
||||
long intpart;
|
||||
intpart = (long) value;
|
||||
@@ -621,7 +621,7 @@ fmtfp(
|
||||
|
||||
/* we "cheat" by converting the fractional part to integer by
|
||||
multiplying by a factor of 10 */
|
||||
fracpart = roundv((pow10(max)) * (ufvalue - intpart));
|
||||
fracpart = round((pow10(max)) * (ufvalue - intpart));
|
||||
|
||||
if (fracpart >= pow10(max)) {
|
||||
intpart++;
|
||||
|
@@ -72,9 +72,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef SO_MAXCONN
|
||||
#define MAX_LISTEN SO_MAXCONN
|
||||
#elif defined(SOMAXCONN)
|
||||
#define MAX_LISTEN SOMAXCONN
|
||||
#elif defined(SO_MAXCONN)
|
||||
#define MAX_LISTEN SO_MAXCONN
|
||||
#else
|
||||
#define MAX_LISTEN 32
|
||||
#endif
|
||||
@@ -95,10 +95,8 @@ static struct ghbn_cache_st
|
||||
} ghbn_cache[GHBN_NUM];
|
||||
|
||||
static int get_ip(const char *str,unsigned char *ip);
|
||||
#if 0
|
||||
static void ghbn_free(struct hostent *a);
|
||||
static struct hostent *ghbn_dup(struct hostent *a);
|
||||
#endif
|
||||
int BIO_get_host_ip(const char *str, unsigned char *ip)
|
||||
{
|
||||
int i;
|
||||
@@ -268,7 +266,6 @@ long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)
|
||||
return(1);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static struct hostent *ghbn_dup(struct hostent *a)
|
||||
{
|
||||
struct hostent *ret;
|
||||
@@ -345,27 +342,21 @@ static void ghbn_free(struct hostent *a)
|
||||
if (a->h_name != NULL) OPENSSL_free(a->h_name);
|
||||
OPENSSL_free(a);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct hostent *BIO_gethostbyname(const char *name)
|
||||
{
|
||||
#if 1
|
||||
/* Caching gethostbyname() results forever is wrong,
|
||||
* so we have to let the true gethostbyname() worry about this */
|
||||
return gethostbyname(name);
|
||||
#else
|
||||
struct hostent *ret;
|
||||
int i,lowi=0,j;
|
||||
unsigned long low= (unsigned long)-1;
|
||||
|
||||
/* return(gethostbyname(name)); */
|
||||
|
||||
# if 0
|
||||
/* It doesn't make sense to use locking here: The function interface
|
||||
* is not thread-safe, because threads can never be sure when
|
||||
* some other thread destroys the data they were given a pointer to.
|
||||
*/
|
||||
#if 0 /* It doesn't make sense to use locking here: The function interface
|
||||
* is not thread-safe, because threads can never be sure when
|
||||
* some other thread destroys the data they were given a pointer to.
|
||||
*/
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);
|
||||
# endif
|
||||
#endif
|
||||
j=strlen(name);
|
||||
if (j < 128)
|
||||
{
|
||||
@@ -393,21 +384,20 @@ struct hostent *BIO_gethostbyname(const char *name)
|
||||
* parameter is 'char *', instead of 'const char *'
|
||||
*/
|
||||
ret=gethostbyname(
|
||||
# ifndef CONST_STRICT
|
||||
#ifndef CONST_STRICT
|
||||
(char *)
|
||||
# endif
|
||||
#endif
|
||||
name);
|
||||
|
||||
if (ret == NULL)
|
||||
goto end;
|
||||
if (j > 128) /* too big to cache */
|
||||
{
|
||||
# if 0
|
||||
/* If we were trying to make this function thread-safe (which
|
||||
* is bound to fail), we'd have to give up in this case
|
||||
* (or allocate more memory). */
|
||||
#if 0 /* If we were trying to make this function thread-safe (which
|
||||
* is bound to fail), we'd have to give up in this case
|
||||
* (or allocate more memory). */
|
||||
ret = NULL;
|
||||
# endif
|
||||
#endif
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -431,14 +421,12 @@ struct hostent *BIO_gethostbyname(const char *name)
|
||||
ghbn_cache[i].order=BIO_ghbn_miss+BIO_ghbn_hits;
|
||||
}
|
||||
end:
|
||||
# if 0
|
||||
#if 0
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME);
|
||||
# endif
|
||||
return(ret);
|
||||
#endif
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
int BIO_sock_init(void)
|
||||
{
|
||||
#ifdef WINDOWS
|
||||
|
@@ -200,7 +200,7 @@ static int linebuffer_write(BIO *b, const char *in, int inl)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
BIO_write(b->next_bio, "<*<", 3);
|
||||
#endif
|
||||
i=BIO_write(b->next_bio,
|
||||
@@ -210,13 +210,13 @@ BIO_write(b->next_bio, "<*<", 3);
|
||||
ctx->obuf_len = orig_olen;
|
||||
BIO_copy_next_retry(b);
|
||||
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
BIO_write(b->next_bio, ">*>", 3);
|
||||
#endif
|
||||
if (i < 0) return((num > 0)?num:i);
|
||||
if (i == 0) return(num);
|
||||
}
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
BIO_write(b->next_bio, ">*>", 3);
|
||||
#endif
|
||||
if (i < ctx->obuf_len)
|
||||
@@ -229,20 +229,20 @@ BIO_write(b->next_bio, ">*>", 3);
|
||||
buffer if a NL was found and there is anything to write. */
|
||||
if ((foundnl || p - in > ctx->obuf_size) && p - in > 0)
|
||||
{
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
BIO_write(b->next_bio, "<*<", 3);
|
||||
#endif
|
||||
i=BIO_write(b->next_bio,in,p - in);
|
||||
if (i <= 0)
|
||||
{
|
||||
BIO_copy_next_retry(b);
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
BIO_write(b->next_bio, ">*>", 3);
|
||||
#endif
|
||||
if (i < 0) return((num > 0)?num:i);
|
||||
if (i == 0) return(num);
|
||||
}
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
BIO_write(b->next_bio, ">*>", 3);
|
||||
#endif
|
||||
num+=i;
|
||||
|
@@ -356,8 +356,8 @@ typedef struct bio_f_buffer_ctx_struct
|
||||
#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
|
||||
#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
|
||||
#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
|
||||
#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
|
||||
#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3)
|
||||
#define BIO_get_conn_ip(b,ip) BIO_ptr_ctrl(b,BIO_C_SET_CONNECT,2)
|
||||
#define BIO_get_conn_int_port(b,port) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,port)
|
||||
|
||||
|
||||
#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
|
||||
@@ -431,7 +431,7 @@ int BIO_read_filename(BIO *b,const char *name);
|
||||
#define BIO_set_ssl_renegotiate_bytes(b,num) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
|
||||
#define BIO_get_num_renegotiates(b) \
|
||||
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_NUM_RENEGOTIATES,0,NULL);
|
||||
#define BIO_set_ssl_renegotiate_timeout(b,seconds) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
|
||||
|
||||
@@ -588,6 +588,8 @@ int BIO_sock_init(void );
|
||||
void BIO_sock_cleanup(void);
|
||||
int BIO_set_tcp_ndelay(int sock,int turn_on);
|
||||
|
||||
void ERR_load_BIO_strings(void );
|
||||
|
||||
BIO *BIO_new_socket(int sock, int close_flag);
|
||||
BIO *BIO_new_fd(int fd, int close_flag);
|
||||
BIO *BIO_new_connect(char *host_port);
|
||||
@@ -613,7 +615,6 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_BIO_strings(void);
|
||||
|
||||
/* Error codes for the BIO functions. */
|
||||
|
||||
@@ -683,3 +684,4 @@ void ERR_load_BIO_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -23,12 +23,7 @@
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
#include "openssl/e_os.h"
|
||||
|
||||
/* VxWorks defines SSiZE_MAX with an empty value causing compile errors */
|
||||
#if defined(VXWORKS)
|
||||
# undef SSIZE_MAX
|
||||
# define SSIZE_MAX INT_MAX
|
||||
#elif !defined(SSIZE_MAX)
|
||||
#ifndef SSIZE_MAX
|
||||
# define SSIZE_MAX INT_MAX
|
||||
#endif
|
||||
|
||||
@@ -479,8 +474,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
|
||||
break;
|
||||
|
||||
case BIO_C_GET_WRITE_BUF_SIZE:
|
||||
ret = (long) b->size;
|
||||
break;
|
||||
num = (long) b->size;
|
||||
|
||||
case BIO_C_MAKE_BIO_PAIR:
|
||||
{
|
||||
|
@@ -75,7 +75,7 @@
|
||||
# include <starlet.h>
|
||||
#elif defined(__ultrix)
|
||||
# include <sys/syslog.h>
|
||||
#elif !defined(MSDOS) && !defined(VXWORKS) /* Unix */
|
||||
#elif !defined(MSDOS) /* Unix */
|
||||
# include <syslog.h>
|
||||
#endif
|
||||
|
||||
|
@@ -124,8 +124,6 @@ asm/sparcv8plus-gcc27.o: asm/sparcv8plus.S
|
||||
$(CC) $(ASFLAGS) -E asm/sparcv8plus.S | \
|
||||
/usr/ccs/bin/as -xarch=v8plus - -o asm/sparcv8plus-gcc27.o
|
||||
|
||||
asm/ia64.o: asm/ia64.S
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
|
||||
|
1498
crypto/bn/asm/ia64.S
1498
crypto/bn/asm/ia64.S
File diff suppressed because it is too large
Load Diff
@@ -90,9 +90,7 @@ extern "C" {
|
||||
* be on. Again this in only really a problem on machines
|
||||
* using "long long's", are 32bit, and are not using my assembler code. */
|
||||
#if defined(MSDOS) || defined(WINDOWS) || defined(WIN32) || defined(linux)
|
||||
# ifndef BN_DIV2W
|
||||
# define BN_DIV2W
|
||||
# endif
|
||||
#define BN_DIV2W
|
||||
#endif
|
||||
|
||||
/* assuming long is 64bit - this is the DEC Alpha
|
||||
@@ -331,7 +329,6 @@ void BN_CTX_end(BN_CTX *ctx);
|
||||
int BN_rand(BIGNUM *rnd, int bits, int top,int bottom);
|
||||
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
|
||||
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
|
||||
int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
|
||||
int BN_num_bits(const BIGNUM *a);
|
||||
int BN_num_bits_word(BN_ULONG);
|
||||
BIGNUM *BN_new(void);
|
||||
@@ -406,6 +403,7 @@ int BN_is_prime(const BIGNUM *p,int nchecks,
|
||||
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);
|
||||
void ERR_load_BN_strings(void );
|
||||
|
||||
BN_MONT_CTX *BN_MONT_CTX_new(void );
|
||||
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
|
||||
@@ -476,7 +474,6 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom);
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_BN_strings(void);
|
||||
|
||||
/* Error codes for the BN functions. */
|
||||
|
||||
@@ -520,3 +517,4 @@ void ERR_load_BN_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -128,7 +128,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
|
||||
|
||||
#if !defined(NO_ASM) && !defined(NO_INLINE_ASM) && !defined(PEDANTIC) && !defined(BN_DIV3W)
|
||||
# if defined(__GNUC__) && __GNUC__>=2
|
||||
# if defined(__i386) || defined (__i386__)
|
||||
# if defined(__i386)
|
||||
/*
|
||||
* There were two reasons for implementing this template:
|
||||
* - GNU C generates a call to a function (__udivdi3 to be exact)
|
||||
|
@@ -113,13 +113,6 @@
|
||||
#include <stdio.h>
|
||||
#include "cryptlib.h"
|
||||
#include "bn_lcl.h"
|
||||
#ifdef ATALLA
|
||||
# include <alloca.h>
|
||||
# include <atasi.h>
|
||||
# include <assert.h>
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
|
||||
#define TABLE_SIZE 32
|
||||
|
||||
@@ -183,174 +176,6 @@ err:
|
||||
}
|
||||
|
||||
|
||||
#ifdef ATALLA
|
||||
|
||||
/*
|
||||
* This routine will dynamically check for the existance of an Atalla AXL-200
|
||||
* SSL accelerator module. If one is found, the variable
|
||||
* asi_accelerator_present is set to 1 and the function pointers
|
||||
* ptr_ASI_xxxxxx above will be initialized to corresponding ASI API calls.
|
||||
*/
|
||||
typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
|
||||
unsigned int *ret_buf);
|
||||
typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
|
||||
typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
|
||||
unsigned char *output,
|
||||
unsigned char *input,
|
||||
unsigned int modulus_len);
|
||||
|
||||
static tfnASI_GetHardwareConfig *ptr_ASI_GetHardwareConfig;
|
||||
static tfnASI_RSAPrivateKeyOpFn *ptr_ASI_RSAPrivateKeyOpFn;
|
||||
static tfnASI_GetPerformanceStatistics *ptr_ASI_GetPerformanceStatistics;
|
||||
static int asi_accelerator_present;
|
||||
static int tried_atalla;
|
||||
|
||||
void atalla_initialize_accelerator_handle(void)
|
||||
{
|
||||
void *dl_handle;
|
||||
int status;
|
||||
unsigned int config_buf[1024];
|
||||
static int tested;
|
||||
|
||||
if(tested)
|
||||
return;
|
||||
|
||||
tested=1;
|
||||
|
||||
bzero((void *)config_buf, 1024);
|
||||
|
||||
/*
|
||||
* Check to see if the library is present on the system
|
||||
*/
|
||||
dl_handle = dlopen("atasi.so", RTLD_NOW);
|
||||
if (dl_handle == (void *) NULL)
|
||||
{
|
||||
/* printf("atasi.so library is not present on the system\n");
|
||||
printf("No HW acceleration available\n");*/
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The library is present. Now we'll check to insure that the
|
||||
* LDM is up and running. First we'll get the address of the
|
||||
* function in the atasi library that we need to see if the
|
||||
* LDM is operating.
|
||||
*/
|
||||
|
||||
ptr_ASI_GetHardwareConfig =
|
||||
(tfnASI_GetHardwareConfig *)dlsym(dl_handle,"ASI_GetHardwareConfig");
|
||||
|
||||
if (ptr_ASI_GetHardwareConfig)
|
||||
{
|
||||
/*
|
||||
* We found the call, now we'll get our config
|
||||
* status. If we get a non 0 result, the LDM is not
|
||||
* running and we cannot use the Atalla ASI *
|
||||
* library.
|
||||
*/
|
||||
status = (*ptr_ASI_GetHardwareConfig)(0L, config_buf);
|
||||
if (status != 0)
|
||||
{
|
||||
printf("atasi.so library is present but not initialized\n");
|
||||
printf("No HW acceleration available\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* printf("We found the library, but not the function. Very Strange!\n");*/
|
||||
return ;
|
||||
}
|
||||
|
||||
/*
|
||||
* It looks like we have acceleration capabilities. Load up the
|
||||
* pointers to our ASI API calls.
|
||||
*/
|
||||
ptr_ASI_RSAPrivateKeyOpFn=
|
||||
(tfnASI_RSAPrivateKeyOpFn *)dlsym(dl_handle, "ASI_RSAPrivateKeyOpFn");
|
||||
if (ptr_ASI_RSAPrivateKeyOpFn == NULL)
|
||||
{
|
||||
/* printf("We found the library, but no RSA function. Very Strange!\n");*/
|
||||
return;
|
||||
}
|
||||
|
||||
ptr_ASI_GetPerformanceStatistics =
|
||||
(tfnASI_GetPerformanceStatistics *)dlsym(dl_handle, "ASI_GetPerformanceStatistics");
|
||||
if (ptr_ASI_GetPerformanceStatistics == NULL)
|
||||
{
|
||||
/* printf("We found the library, but no stat function. Very Strange!\n");*/
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Indicate that acceleration is available
|
||||
*/
|
||||
asi_accelerator_present = 1;
|
||||
|
||||
/* printf("This system has acceleration!\n");*/
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* make sure this only gets called once when bn_mod_exp calls bn_mod_exp_mont */
|
||||
int BN_mod_exp_atalla(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m)
|
||||
{
|
||||
unsigned char *abin;
|
||||
unsigned char *pbin;
|
||||
unsigned char *mbin;
|
||||
unsigned char *rbin;
|
||||
int an,pn,mn,ret;
|
||||
RSAPrivateKey keydata;
|
||||
|
||||
atalla_initialize_accelerator_handle();
|
||||
if(!asi_accelerator_present)
|
||||
return 0;
|
||||
|
||||
|
||||
/* We should be able to run without size testing */
|
||||
# define ASIZE 128
|
||||
an=BN_num_bytes(a);
|
||||
pn=BN_num_bytes(p);
|
||||
mn=BN_num_bytes(m);
|
||||
|
||||
if(an <= ASIZE && pn <= ASIZE && mn <= ASIZE)
|
||||
{
|
||||
int size=mn;
|
||||
|
||||
assert(an <= mn);
|
||||
abin=alloca(size);
|
||||
memset(abin,'\0',mn);
|
||||
BN_bn2bin(a,abin+size-an);
|
||||
|
||||
pbin=alloca(pn);
|
||||
BN_bn2bin(p,pbin);
|
||||
|
||||
mbin=alloca(size);
|
||||
memset(mbin,'\0',mn);
|
||||
BN_bn2bin(m,mbin+size-mn);
|
||||
|
||||
rbin=alloca(size);
|
||||
|
||||
memset(&keydata,'\0',sizeof keydata);
|
||||
keydata.privateExponent.data=pbin;
|
||||
keydata.privateExponent.len=pn;
|
||||
keydata.modulus.data=mbin;
|
||||
keydata.modulus.len=size;
|
||||
|
||||
ret=(*ptr_ASI_RSAPrivateKeyOpFn)(&keydata,rbin,abin,keydata.modulus.len);
|
||||
/*fprintf(stderr,"!%s\n",BN_bn2hex(a));*/
|
||||
if(!ret)
|
||||
{
|
||||
BN_bin2bn(rbin,keydata.modulus.len,r);
|
||||
/*fprintf(stderr,"?%s\n",BN_bn2hex(r));*/
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* def ATALLA */
|
||||
|
||||
|
||||
int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
|
||||
BN_CTX *ctx)
|
||||
{
|
||||
@@ -360,13 +185,6 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
|
||||
bn_check_top(p);
|
||||
bn_check_top(m);
|
||||
|
||||
#ifdef ATALLA
|
||||
if(BN_mod_exp_atalla(r,a,p,m))
|
||||
return 1;
|
||||
/* If it fails, try the other methods (but don't try atalla again) */
|
||||
tried_atalla=1;
|
||||
#endif
|
||||
|
||||
#ifdef MONT_MUL_MOD
|
||||
/* I have finally been able to take out this pre-condition of
|
||||
* the top bit being set. It was caused by an error in BN_div
|
||||
@@ -392,10 +210,6 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
|
||||
{ ret=BN_mod_exp_simple(r,a,p,m,ctx); }
|
||||
#endif
|
||||
|
||||
#ifdef ATALLA
|
||||
tried_atalla=0;
|
||||
#endif
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -525,12 +339,6 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
|
||||
bn_check_top(p);
|
||||
bn_check_top(m);
|
||||
|
||||
#ifdef ATALLA
|
||||
if(!tried_atalla && BN_mod_exp_atalla(rr,a,p,m))
|
||||
return 1;
|
||||
/* If it fails, try the other methods */
|
||||
#endif
|
||||
|
||||
if (!(m->d[0] & 1))
|
||||
{
|
||||
BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS);
|
||||
@@ -693,19 +501,6 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
|
||||
t = BN_CTX_get(ctx);
|
||||
if (d == NULL || r == NULL || t == NULL) goto err;
|
||||
|
||||
#ifdef ATALLA
|
||||
if (!tried_atalla)
|
||||
{
|
||||
BN_set_word(t, a);
|
||||
if (BN_mod_exp_atalla(rr, t, p, m))
|
||||
{
|
||||
BN_CTX_end(ctx);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/* If it fails, try the other methods */
|
||||
#endif
|
||||
|
||||
if (in_mont != NULL)
|
||||
mont=in_mont;
|
||||
else
|
||||
|
@@ -225,15 +225,12 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
|
||||
BN_MONT_CTX *mont = NULL;
|
||||
const BIGNUM *A = NULL;
|
||||
|
||||
if (BN_cmp(a, BN_value_one()) <= 0)
|
||||
return 0;
|
||||
|
||||
if (checks == BN_prime_checks)
|
||||
checks = BN_prime_checks_for_size(BN_num_bits(a));
|
||||
|
||||
/* first look for small factors */
|
||||
if (!BN_is_odd(a))
|
||||
return 0;
|
||||
return(0);
|
||||
if (do_trial_division)
|
||||
{
|
||||
for (i = 1; i < NUMPRIMES; i++)
|
||||
@@ -292,8 +289,11 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
|
||||
|
||||
for (i = 0; i < checks; i++)
|
||||
{
|
||||
if (!BN_pseudo_rand_range(check, A1))
|
||||
if (!BN_pseudo_rand(check, BN_num_bits(A1), 0, 0))
|
||||
goto err;
|
||||
if (BN_cmp(check, A1) >= 0)
|
||||
if (!BN_sub(check, check, A1))
|
||||
goto err;
|
||||
if (!BN_add_word(check, 1))
|
||||
goto err;
|
||||
/* now 1 <= check < A */
|
||||
|
@@ -55,59 +55,6 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 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
|
||||
* openssl-core@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 <time.h>
|
||||
@@ -225,9 +172,8 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
|
||||
#endif
|
||||
|
||||
/* random number r: 0 <= r < range */
|
||||
static int bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
|
||||
int BN_rand_range(BIGNUM *r, BIGNUM *range)
|
||||
{
|
||||
int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand;
|
||||
int n;
|
||||
|
||||
if (range->neg || BN_is_zero(range))
|
||||
@@ -238,19 +184,26 @@ static int bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
|
||||
|
||||
n = BN_num_bits(range); /* n > 0 */
|
||||
|
||||
/* BN_is_bit_set(range, n - 1) always holds */
|
||||
|
||||
if (n == 1)
|
||||
{
|
||||
if (!BN_zero(r)) return 0;
|
||||
}
|
||||
else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3))
|
||||
else if (BN_is_bit_set(range, n - 2))
|
||||
{
|
||||
/* range = 100..._2,
|
||||
do
|
||||
{
|
||||
/* range = 11..._2, so each iteration succeeds with probability >= .75 */
|
||||
if (!BN_rand(r, n, -1, 0)) return 0;
|
||||
}
|
||||
while (BN_cmp(r, range) >= 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* range = 10..._2,
|
||||
* so 3*range (= 11..._2) is exactly one bit longer than range */
|
||||
do
|
||||
{
|
||||
if (!bn_rand(r, n + 1, -1, 0)) return 0;
|
||||
if (!BN_rand(r, n + 1, -1, 0)) return 0;
|
||||
/* If r < 3*range, use r := r MOD range
|
||||
* (which is either r, r - range, or r - 2*range).
|
||||
* Otherwise, iterate once more.
|
||||
@@ -265,26 +218,6 @@ static int bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
|
||||
}
|
||||
while (BN_cmp(r, range) >= 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
/* range = 11..._2 or range = 101..._2 */
|
||||
if (!bn_rand(r, n, -1, 0)) return 0;
|
||||
}
|
||||
while (BN_cmp(r, range) >= 0);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int BN_rand_range(BIGNUM *r, BIGNUM *range)
|
||||
{
|
||||
return bn_rand_range(0, r, range);
|
||||
}
|
||||
|
||||
int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range)
|
||||
{
|
||||
return bn_rand_range(1, r, range);
|
||||
}
|
||||
|
@@ -245,7 +245,7 @@ printf(" bn_sqr_recursive %d * %d\n",n2,n2);
|
||||
if (!zero)
|
||||
bn_sqr_recursive(&(t[n2]),t,n,p);
|
||||
else
|
||||
memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
|
||||
memset(&(t[n2]),0,n*sizeof(BN_ULONG));
|
||||
bn_sqr_recursive(r,a,n,p);
|
||||
bn_sqr_recursive(&(r[n2]),&(a[n]),n,p);
|
||||
|
||||
|
@@ -75,11 +75,12 @@ void BUF_MEM_free(BUF_MEM *a);
|
||||
int BUF_MEM_grow(BUF_MEM *str, int len);
|
||||
char * BUF_strdup(const char *str);
|
||||
|
||||
void ERR_load_BUF_strings(void );
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_BUF_strings(void);
|
||||
|
||||
/* Error codes for the BUF functions. */
|
||||
|
||||
@@ -94,3 +95,4 @@ void ERR_load_BUF_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -22,10 +22,10 @@ TEST=
|
||||
APPS=
|
||||
|
||||
LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC= comp_lib.c comp_err.c \
|
||||
LIBSRC= comp_lib.c \
|
||||
c_rle.c c_zlib.c
|
||||
|
||||
LIBOBJ= comp_lib.o comp_err.o \
|
||||
LIBOBJ= comp_lib.o \
|
||||
c_rle.o c_zlib.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
@@ -94,11 +94,6 @@ c_zlib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
|
||||
c_zlib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
c_zlib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
c_zlib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
comp_err.o: ../../include/openssl/bio.h ../../include/openssl/comp.h
|
||||
comp_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
|
||||
comp_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
|
||||
comp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
comp_err.o: ../../include/openssl/symhacks.h
|
||||
comp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
comp_lib.o: ../../include/openssl/bn.h ../../include/openssl/comp.h
|
||||
comp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
|
||||
|
@@ -47,7 +47,6 @@ COMP_METHOD *COMP_zlib(void );
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_COMP_strings(void);
|
||||
|
||||
/* Error codes for the COMP functions. */
|
||||
|
||||
@@ -59,3 +58,4 @@ void ERR_load_COMP_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
DIR= conf
|
||||
TOP= ../..
|
||||
CC= cc
|
||||
INCLUDES= -I.. -I../.. -I../../include
|
||||
INCLUDES= -I.. -I../../include
|
||||
CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
@@ -80,25 +80,30 @@ clean:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
conf_api.o: ../../e_os.h ../../include/openssl/bio.h
|
||||
conf_api.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h
|
||||
conf_api.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
conf_api.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
|
||||
conf_api.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
|
||||
conf_api.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
conf_api.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
conf_def.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
conf_def.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h
|
||||
conf_def.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
|
||||
conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
|
||||
conf_def.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
conf_def.o: ../../include/openssl/symhacks.h conf_def.h
|
||||
conf_def.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
conf_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
conf_def.o: conf_def.h
|
||||
conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
|
||||
conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
|
||||
conf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
|
||||
conf_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
conf_err.o: ../../include/openssl/symhacks.h
|
||||
conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
conf_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
conf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
conf_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
conf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
conf_lib.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
|
||||
conf_lib.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
|
||||
conf_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
conf_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
conf_lib.o: ../../include/openssl/opensslconf.h
|
||||
conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
conf_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
|
@@ -56,13 +56,14 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CONF_H
|
||||
#ifndef HEADER_CONF_H
|
||||
#define HEADER_CONF_H
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/stack.h>
|
||||
#include <openssl/safestack.h>
|
||||
#include <openssl/e_os.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -85,14 +86,14 @@ typedef struct conf_method_st CONF_METHOD;
|
||||
struct conf_method_st
|
||||
{
|
||||
const char *name;
|
||||
CONF *(*create)(CONF_METHOD *meth);
|
||||
int (*init)(CONF *conf);
|
||||
int (*destroy)(CONF *conf);
|
||||
int (*destroy_data)(CONF *conf);
|
||||
int (*load)(CONF *conf, BIO *bp, long *eline);
|
||||
int (*dump)(CONF *conf, BIO *bp);
|
||||
int (*is_number)(CONF *conf, char c);
|
||||
int (*to_int)(CONF *conf, char c);
|
||||
CONF *(MS_FAR *create)(CONF_METHOD *meth);
|
||||
int (MS_FAR *init)(CONF *conf);
|
||||
int (MS_FAR *destroy)(CONF *conf);
|
||||
int (MS_FAR *destroy_data)(CONF *conf);
|
||||
int (MS_FAR *load)(CONF *conf, BIO *bp, long *eline);
|
||||
int (MS_FAR *dump)(CONF *conf, BIO *bp);
|
||||
int (MS_FAR *is_number)(CONF *conf, char c);
|
||||
int (MS_FAR *to_int)(CONF *conf, char c);
|
||||
};
|
||||
|
||||
int CONF_set_default_method(CONF_METHOD *meth);
|
||||
@@ -107,6 +108,7 @@ long CONF_get_number(LHASH *conf,char *group,char *name);
|
||||
void CONF_free(LHASH *conf);
|
||||
int CONF_dump_fp(LHASH *conf, FILE *out);
|
||||
int CONF_dump_bio(LHASH *conf, BIO *out);
|
||||
void ERR_load_CONF_strings(void );
|
||||
|
||||
/* New conf code. The semantics are different from the functions above.
|
||||
If that wasn't the case, the above functions would have been replaced */
|
||||
@@ -143,7 +145,6 @@ int NCONF_dump_bio(CONF *conf, BIO *out);
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_CONF_strings(void);
|
||||
|
||||
/* Error codes for the CONF functions. */
|
||||
|
||||
@@ -175,3 +176,4 @@ void ERR_load_CONF_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -67,7 +67,6 @@
|
||||
#include <string.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/conf_api.h>
|
||||
#include "e_os.h"
|
||||
|
||||
static void value_free_hash(CONF_VALUE *a, LHASH *conf);
|
||||
static void value_free_stack(CONF_VALUE *a,LHASH *conf);
|
||||
|
@@ -71,7 +71,6 @@
|
||||
#define CONF_COMMENT 128
|
||||
#define CONF_FCOMMENT 2048
|
||||
#define CONF_EOF 8
|
||||
#define CONF_HIGHBIT 4096
|
||||
#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
|
||||
#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
|
||||
#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \
|
||||
@@ -79,102 +78,68 @@
|
||||
|
||||
#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
|
||||
#ifndef CHARSET_EBCDIC
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \
|
||||
(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
|
||||
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
|
||||
(KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_DQUOTE)
|
||||
|
||||
#else /*CHARSET_EBCDIC*/
|
||||
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \
|
||||
(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
|
||||
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
|
||||
(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_DQUOTE)
|
||||
#endif /*CHARSET_EBCDIC*/
|
||||
|
||||
static unsigned short CONF_type_default[256]={
|
||||
0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0010,0x0200,0x0040,0x0080,0x0000,0x0200,0x0200,0x0040,
|
||||
0x0000,0x0000,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,
|
||||
0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
|
||||
0x0001,0x0001,0x0000,0x0200,0x0000,0x0000,0x0000,0x0200,
|
||||
0x0200,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
|
||||
0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
|
||||
0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
|
||||
0x0002,0x0002,0x0002,0x0000,0x0020,0x0000,0x0200,0x0100,
|
||||
0x0040,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
|
||||
0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
|
||||
0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
|
||||
0x0004,0x0004,0x0004,0x0000,0x0200,0x0000,0x0200,0x0000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
static unsigned short CONF_type_default[128]={
|
||||
0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
|
||||
0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000,
|
||||
0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
|
||||
0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
|
||||
0x010,0x200,0x040,0x080,0x000,0x200,0x200,0x040,
|
||||
0x000,0x000,0x200,0x200,0x200,0x200,0x200,0x200,
|
||||
0x001,0x001,0x001,0x001,0x001,0x001,0x001,0x001,
|
||||
0x001,0x001,0x000,0x200,0x000,0x000,0x000,0x200,
|
||||
0x200,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
|
||||
0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
|
||||
0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
|
||||
0x002,0x002,0x002,0x000,0x020,0x000,0x200,0x100,
|
||||
0x040,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
|
||||
0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
|
||||
0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
|
||||
0x004,0x004,0x004,0x000,0x200,0x000,0x200,0x000,
|
||||
};
|
||||
|
||||
static unsigned short CONF_type_win32[256]={
|
||||
0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0010,0x0200,0x0400,0x0000,0x0000,0x0200,0x0200,0x0000,
|
||||
0x0000,0x0000,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,
|
||||
0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
|
||||
0x0001,0x0001,0x0000,0x0A00,0x0000,0x0000,0x0000,0x0200,
|
||||
0x0200,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
|
||||
0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
|
||||
0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
|
||||
0x0002,0x0002,0x0002,0x0000,0x0000,0x0000,0x0200,0x0100,
|
||||
0x0000,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
|
||||
0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
|
||||
0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
|
||||
0x0004,0x0004,0x0004,0x0000,0x0200,0x0000,0x0200,0x0000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
|
||||
static unsigned short CONF_type_win32[128]={
|
||||
0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
|
||||
0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000,
|
||||
0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
|
||||
0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
|
||||
0x010,0x200,0x400,0x000,0x000,0x200,0x200,0x000,
|
||||
0x000,0x000,0x200,0x200,0x200,0x200,0x200,0x200,
|
||||
0x001,0x001,0x001,0x001,0x001,0x001,0x001,0x001,
|
||||
0x001,0x001,0x000,0xA00,0x000,0x000,0x000,0x200,
|
||||
0x200,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
|
||||
0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
|
||||
0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
|
||||
0x002,0x002,0x002,0x000,0x000,0x000,0x200,0x100,
|
||||
0x000,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
|
||||
0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
|
||||
0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
|
||||
0x004,0x004,0x004,0x000,0x200,0x000,0x200,0x000,
|
||||
};
|
||||
|
||||
|
@@ -12,9 +12,8 @@ $DQUOTE=0x400;
|
||||
$COMMENT=0x80;
|
||||
$FCOMMENT=0x800;
|
||||
$EOF=0x08;
|
||||
$HIGHBIT=0x1000;
|
||||
|
||||
foreach (0 .. 255)
|
||||
foreach (0 .. 127)
|
||||
{
|
||||
$v=0;
|
||||
$c=sprintf("%c",$_);
|
||||
@@ -28,12 +27,11 @@ foreach (0 .. 255)
|
||||
$v|=$QUOTE if ($c =~ /['`"]/); # for emacs: "`'}/)
|
||||
$v|=$COMMENT if ($c =~ /\#/);
|
||||
$v|=$EOF if ($c =~ /\0/);
|
||||
$v|=$HIGHBIT if ($c =~/[\x80-\xff]/);
|
||||
|
||||
push(@V_def,$v);
|
||||
}
|
||||
|
||||
foreach (0 .. 255)
|
||||
foreach (0 .. 127)
|
||||
{
|
||||
$v=0;
|
||||
$c=sprintf("%c",$_);
|
||||
@@ -46,7 +44,6 @@ foreach (0 .. 255)
|
||||
$v|=$DQUOTE if ($c =~ /["]/); # for emacs: "}/)
|
||||
$v|=$FCOMMENT if ($c =~ /;/);
|
||||
$v|=$EOF if ($c =~ /\0/);
|
||||
$v|=$HIGHBIT if ($c =~/[\x80-\xff]/);
|
||||
|
||||
push(@V_w32,$v);
|
||||
}
|
||||
@@ -125,7 +122,6 @@ print <<"EOF";
|
||||
#define CONF_COMMENT $COMMENT
|
||||
#define CONF_FCOMMENT $FCOMMENT
|
||||
#define CONF_EOF $EOF
|
||||
#define CONF_HIGHBIT $HIGHBIT
|
||||
#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
|
||||
#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
|
||||
#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \\
|
||||
@@ -133,53 +129,51 @@ print <<"EOF";
|
||||
|
||||
#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
|
||||
#ifndef CHARSET_EBCDIC
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
||||
(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
|
||||
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
|
||||
(KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_DQUOTE)
|
||||
|
||||
#else /*CHARSET_EBCDIC*/
|
||||
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
||||
(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
|
||||
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
|
||||
(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_DQUOTE)
|
||||
#endif /*CHARSET_EBCDIC*/
|
||||
|
||||
EOF
|
||||
|
||||
print "static unsigned short CONF_type_default[256]={";
|
||||
print "static unsigned short CONF_type_default[128]={";
|
||||
|
||||
for ($i=0; $i<256; $i++)
|
||||
for ($i=0; $i<128; $i++)
|
||||
{
|
||||
print "\n\t" if ($i % 8) == 0;
|
||||
printf "0x%04X,",$V_def[$i];
|
||||
printf "0x%03X,",$V_def[$i];
|
||||
}
|
||||
|
||||
print "\n\t};\n\n";
|
||||
|
||||
print "static unsigned short CONF_type_win32[256]={";
|
||||
print "static unsigned short CONF_type_win32[128]={";
|
||||
|
||||
for ($i=0; $i<256; $i++)
|
||||
for ($i=0; $i<128; $i++)
|
||||
{
|
||||
print "\n\t" if ($i % 8) == 0;
|
||||
printf "0x%04X,",$V_w32[$i];
|
||||
printf "0x%03X,",$V_w32[$i];
|
||||
}
|
||||
|
||||
print "\n\t};\n\n";
|
||||
|
@@ -90,7 +90,6 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
|
||||
"ssl_sess_cert",
|
||||
"ssl",
|
||||
"rand",
|
||||
"rand2",
|
||||
"debug_malloc",
|
||||
"BIO",
|
||||
"gethostbyname",
|
||||
@@ -101,6 +100,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
|
||||
"debug_malloc2",
|
||||
"dso",
|
||||
"dynlock",
|
||||
"engine",
|
||||
#if CRYPTO_NUM_LOCKS != 29
|
||||
# error "Inconsistency between crypto.h and cryptlib.c"
|
||||
#endif
|
||||
@@ -228,10 +228,7 @@ void CRYPTO_destroy_dynlockid(int i)
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
|
||||
|
||||
if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
|
||||
{
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
|
||||
return;
|
||||
}
|
||||
pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
|
||||
if (pointer != NULL)
|
||||
{
|
||||
@@ -399,16 +396,15 @@ void CRYPTO_lock(int mode, int type, const char *file, int line)
|
||||
#endif
|
||||
if (type < 0)
|
||||
{
|
||||
int i = -type - 1;
|
||||
struct CRYPTO_dynlock_value *pointer
|
||||
= CRYPTO_get_dynlock_value(i);
|
||||
= CRYPTO_get_dynlock_value(type);
|
||||
|
||||
if (pointer && dynlock_lock_callback)
|
||||
{
|
||||
dynlock_lock_callback(mode, pointer, file, line);
|
||||
}
|
||||
|
||||
CRYPTO_destroy_dynlockid(i);
|
||||
CRYPTO_destroy_dynlockid(type);
|
||||
}
|
||||
else
|
||||
if (locking_callback != NULL)
|
||||
|
@@ -88,7 +88,7 @@ $! Define The Different Encryption Types.
|
||||
$!
|
||||
$ ENCRYPT_TYPES = "Basic,MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ -
|
||||
"DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ -
|
||||
"BN,RSA,DSA,DH,DSO,"+ -
|
||||
"BN,RSA,DSA,DH,DSO,ENGINE,"+ -
|
||||
"BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,"+ -
|
||||
"EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
|
||||
"CONF,TXT_DB,PKCS7,PKCS12,COMP"
|
||||
@@ -206,6 +206,8 @@ $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl"
|
||||
$ LIB_DH = "dh_gen,dh_key,dh_lib,dh_check,dh_err"
|
||||
$ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
|
||||
"dso_openssl,dso_win32,dso_vms"
|
||||
$ LIB_ENGINE = "engine_err,engine_lib,engine_list,engine_openssl,"+ -
|
||||
"hw_atalla,hw_cswift,hw_ncipher"
|
||||
$ LIB_BUFFER = "buffer,buf_err"
|
||||
$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
|
||||
"bss_mem,bss_null,bss_fd,"+ -
|
||||
@@ -1194,7 +1196,9 @@ $ CC = "CC"
|
||||
$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
|
||||
THEN CC = "CC/DECC"
|
||||
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
|
||||
"/NOLIST/PREFIX=ALL/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS
|
||||
"/NOLIST/PREFIX=ALL" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
|
||||
CCEXTRAFLAGS
|
||||
$!
|
||||
$! Define The Linker Options File Name.
|
||||
$!
|
||||
@@ -1226,7 +1230,8 @@ $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
|
||||
$ EXIT
|
||||
$ ENDIF
|
||||
$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
|
||||
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST/INCLUDE=SYS$DISK:[]" + -
|
||||
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
|
||||
CCEXTRAFLAGS
|
||||
$ CCDEFS = """VAXC""," + CCDEFS
|
||||
$!
|
||||
@@ -1258,7 +1263,8 @@ $!
|
||||
$! Use GNU C...
|
||||
$!
|
||||
$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
|
||||
"/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
|
||||
CCEXTRAFLAGS
|
||||
$!
|
||||
$! Define The Linker Options File Name.
|
||||
$!
|
||||
@@ -1456,7 +1462,6 @@ $!
|
||||
$! Save directory information
|
||||
$!
|
||||
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
|
||||
$ __HERE = F$EDIT(__HERE,"UPCASE")
|
||||
$ __TOP = __HERE - "CRYPTO]"
|
||||
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
|
||||
$!
|
||||
|
@@ -112,17 +112,17 @@ extern "C" {
|
||||
#define CRYPTO_LOCK_SSL_SESS_CERT 15
|
||||
#define CRYPTO_LOCK_SSL 16
|
||||
#define CRYPTO_LOCK_RAND 17
|
||||
#define CRYPTO_LOCK_RAND2 18
|
||||
#define CRYPTO_LOCK_MALLOC 19
|
||||
#define CRYPTO_LOCK_BIO 20
|
||||
#define CRYPTO_LOCK_GETHOSTBYNAME 21
|
||||
#define CRYPTO_LOCK_GETSERVBYNAME 22
|
||||
#define CRYPTO_LOCK_READDIR 23
|
||||
#define CRYPTO_LOCK_RSA_BLINDING 24
|
||||
#define CRYPTO_LOCK_DH 25
|
||||
#define CRYPTO_LOCK_MALLOC2 26
|
||||
#define CRYPTO_LOCK_DSO 27
|
||||
#define CRYPTO_LOCK_DYNLOCK 28
|
||||
#define CRYPTO_LOCK_MALLOC 18
|
||||
#define CRYPTO_LOCK_BIO 19
|
||||
#define CRYPTO_LOCK_GETHOSTBYNAME 20
|
||||
#define CRYPTO_LOCK_GETSERVBYNAME 21
|
||||
#define CRYPTO_LOCK_READDIR 22
|
||||
#define CRYPTO_LOCK_RSA_BLINDING 23
|
||||
#define CRYPTO_LOCK_DH 24
|
||||
#define CRYPTO_LOCK_MALLOC2 25
|
||||
#define CRYPTO_LOCK_DSO 26
|
||||
#define CRYPTO_LOCK_DYNLOCK 27
|
||||
#define CRYPTO_LOCK_ENGINE 28
|
||||
#define CRYPTO_NUM_LOCKS 29
|
||||
|
||||
#define CRYPTO_LOCK 1
|
||||
@@ -351,9 +351,6 @@ int CRYPTO_push_info_(const char *info, const char *file, int line);
|
||||
int CRYPTO_pop_info(void);
|
||||
int CRYPTO_remove_all_info(void);
|
||||
|
||||
|
||||
/* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro;
|
||||
* used as default in CRYPTO_MDEBUG compilations): */
|
||||
/* The last argument has the following significance:
|
||||
*
|
||||
* 0: called before the actual memory allocation has taken place
|
||||
@@ -362,18 +359,18 @@ int CRYPTO_remove_all_info(void);
|
||||
void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p);
|
||||
void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p);
|
||||
void CRYPTO_dbg_free(void *addr,int before_p);
|
||||
|
||||
/* Tell the debugging code about options. By default, the following values
|
||||
* apply:
|
||||
*
|
||||
* 0: Clear all options.
|
||||
* V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option.
|
||||
* V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option.
|
||||
* V_CRYPTO_MDEBUG_ALL (3): 1 + 2
|
||||
* 0: Clear all options.
|
||||
* 1: Set the "Show Time" option.
|
||||
* 2: Set the "Show Thread Number" option.
|
||||
* 3: 1 + 2
|
||||
*/
|
||||
void CRYPTO_dbg_set_options(long bits);
|
||||
long CRYPTO_dbg_get_options(void);
|
||||
|
||||
|
||||
#ifndef NO_FP_API
|
||||
void CRYPTO_mem_leaks_fp(FILE *);
|
||||
#endif
|
||||
@@ -381,11 +378,12 @@ void CRYPTO_mem_leaks(struct bio_st *bio);
|
||||
/* unsigned long order, char *file, int line, int num_bytes, char *addr */
|
||||
void CRYPTO_mem_leaks_cb(void (*cb)(unsigned long, const char *, int, int, void *));
|
||||
|
||||
void ERR_load_CRYPTO_strings(void);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_CRYPTO_strings(void);
|
||||
|
||||
/* Error codes for the CRYPTO functions. */
|
||||
|
||||
@@ -402,3 +400,4 @@ void ERR_load_CRYPTO_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -61,7 +61,7 @@ static unsigned const char cov_2char[64]={
|
||||
void fcrypt_body(DES_LONG *out,des_key_schedule ks,
|
||||
DES_LONG Eswap0, DES_LONG Eswap1);
|
||||
|
||||
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(_DARWIN)
|
||||
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT)
|
||||
char *crypt(const char *buf, const char *salt)
|
||||
{
|
||||
return(des_crypt(buf, salt));
|
||||
|
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(VXWORKS)
|
||||
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifdef OPENSSL_UNISTD
|
||||
# include OPENSSL_UNISTD
|
||||
@@ -133,12 +133,6 @@
|
||||
#define SGTTY
|
||||
#endif
|
||||
|
||||
#if defined(VXWORKS)
|
||||
#undef TERMIOS
|
||||
#undef TERMIO
|
||||
#undef SGTTY
|
||||
#endif
|
||||
|
||||
#ifdef TERMIOS
|
||||
#include <termios.h>
|
||||
#define TTY_STRUCT struct termios
|
||||
@@ -246,7 +240,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
|
||||
long status;
|
||||
unsigned short channel = 0;
|
||||
#else
|
||||
#if !defined(MSDOS) && !defined(VXWORKS)
|
||||
#ifndef MSDOS
|
||||
TTY_STRUCT tty_orig,tty_new;
|
||||
#endif
|
||||
#endif
|
||||
@@ -274,7 +268,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
|
||||
#ifdef MSDOS
|
||||
if ((tty=fopen("con","r")) == NULL)
|
||||
tty=stdin;
|
||||
#elif defined(MAC_OS_pre_X) || defined(VXWORKS)
|
||||
#elif defined(MAC_OS_pre_X)
|
||||
tty=stdin;
|
||||
#else
|
||||
#ifndef MPE
|
||||
@@ -372,7 +366,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
|
||||
|
||||
error:
|
||||
fprintf(stderr,"\n");
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
perror("fgets(tty)");
|
||||
#endif
|
||||
/* What can we do if there is an error? */
|
||||
|
@@ -101,19 +101,39 @@ dh_gen.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
dh_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
dh_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
dh_gen.o: ../cryptlib.h
|
||||
dh_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
dh_key.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
|
||||
dh_key.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
dh_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
dh_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
dh_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
dh_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
dh_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
dh_key.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
dh_key.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
dh_key.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
dh_key.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
dh_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
dh_key.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
dh_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
dh_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
dh_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
dh_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
|
||||
dh_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
|
||||
dh_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
dh_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
dh_lib.o: ../cryptlib.h
|
||||
dh_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
dh_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
dh_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
dh_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
dh_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
dh_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
dh_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
dh_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
dh_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
dh_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
dh_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
|
||||
|
@@ -115,7 +115,11 @@ struct dh_st
|
||||
|
||||
int references;
|
||||
CRYPTO_EX_DATA ex_data;
|
||||
#if 0
|
||||
DH_METHOD *meth;
|
||||
#else
|
||||
struct engine_st *engine;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define DH_GENERATOR_2 2
|
||||
@@ -150,10 +154,15 @@ struct dh_st
|
||||
|
||||
DH_METHOD *DH_OpenSSL(void);
|
||||
|
||||
void DH_set_default_method(DH_METHOD *meth);
|
||||
DH_METHOD *DH_get_default_method(void);
|
||||
void DH_set_default_openssl_method(DH_METHOD *meth);
|
||||
DH_METHOD *DH_get_default_openssl_method(void);
|
||||
#if 0
|
||||
DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth);
|
||||
DH *DH_new_method(DH_METHOD *meth);
|
||||
#else
|
||||
int DH_set_method(DH *dh, struct engine_st *engine);
|
||||
DH *DH_new_method(struct engine_st *engine);
|
||||
#endif
|
||||
|
||||
DH * DH_new(void);
|
||||
void DH_free(DH *dh);
|
||||
@@ -177,12 +186,12 @@ int DHparams_print(BIO *bp, DH *x);
|
||||
#else
|
||||
int DHparams_print(char *bp, DH *x);
|
||||
#endif
|
||||
void ERR_load_DH_strings(void );
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_DH_strings(void);
|
||||
|
||||
/* Error codes for the DH functions. */
|
||||
|
||||
@@ -195,10 +204,10 @@ void ERR_load_DH_strings(void);
|
||||
#define DH_F_DH_NEW 105
|
||||
|
||||
/* Reason codes. */
|
||||
#define DH_R_BAD_GENERATOR 101
|
||||
#define DH_R_NO_PRIVATE_VALUE 100
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/dh/dh_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999 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
|
||||
@@ -77,7 +77,6 @@ static ERR_STRING_DATA DH_str_functs[]=
|
||||
|
||||
static ERR_STRING_DATA DH_str_reasons[]=
|
||||
{
|
||||
{DH_R_BAD_GENERATOR ,"bad generator"},
|
||||
{DH_R_NO_PRIVATE_VALUE ,"no private value"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
@@ -82,10 +82,7 @@
|
||||
* Since DH should be using a safe prime (both p and q are prime),
|
||||
* this generator function can take a very very long time to run.
|
||||
*/
|
||||
/* Actually there is no reason to insist that 'generator' be a generator.
|
||||
* It's just as OK (and in some sense better) to use a generator of the
|
||||
* order-q subgroup.
|
||||
*/
|
||||
|
||||
DH *DH_generate_parameters(int prime_len, int generator,
|
||||
void (*callback)(int,int,void *), void *cb_arg)
|
||||
{
|
||||
@@ -103,43 +100,30 @@ DH *DH_generate_parameters(int prime_len, int generator,
|
||||
t2 = BN_CTX_get(ctx);
|
||||
if (t1 == NULL || t2 == NULL) goto err;
|
||||
|
||||
if (generator <= 1)
|
||||
{
|
||||
DHerr(DH_F_DH_GENERATE_PARAMETERS, DH_R_BAD_GENERATOR);
|
||||
goto err;
|
||||
}
|
||||
if (generator == DH_GENERATOR_2)
|
||||
{
|
||||
if (!BN_set_word(t1,24)) goto err;
|
||||
if (!BN_set_word(t2,11)) goto err;
|
||||
BN_set_word(t1,24);
|
||||
BN_set_word(t2,11);
|
||||
g=2;
|
||||
}
|
||||
#if 0 /* does not work for safe primes */
|
||||
#ifdef undef /* does not work for safe primes */
|
||||
else if (generator == DH_GENERATOR_3)
|
||||
{
|
||||
if (!BN_set_word(t1,12)) goto err;
|
||||
if (!BN_set_word(t2,5)) goto err;
|
||||
BN_set_word(t1,12);
|
||||
BN_set_word(t2,5);
|
||||
g=3;
|
||||
}
|
||||
#endif
|
||||
else if (generator == DH_GENERATOR_5)
|
||||
{
|
||||
if (!BN_set_word(t1,10)) goto err;
|
||||
if (!BN_set_word(t2,3)) goto err;
|
||||
BN_set_word(t1,10);
|
||||
BN_set_word(t2,3);
|
||||
/* BN_set_word(t3,7); just have to miss
|
||||
* out on these ones :-( */
|
||||
g=5;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* in the general case, don't worry if 'generator' is a
|
||||
* generator or not: since we are using safe primes,
|
||||
* it will generate either an order-q or an order-2q group,
|
||||
* which both is OK */
|
||||
if (!BN_set_word(t1,2)) goto err;
|
||||
if (!BN_set_word(t2,1)) goto err;
|
||||
g=generator;
|
||||
}
|
||||
|
||||
p=BN_generate_prime(NULL,prime_len,1,t1,t2,callback,cb_arg);
|
||||
if (p == NULL) goto err;
|
||||
|
@@ -61,6 +61,7 @@
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
static int generate_key(DH *dh);
|
||||
static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
|
||||
@@ -72,12 +73,12 @@ static int dh_finish(DH *dh);
|
||||
|
||||
int DH_generate_key(DH *dh)
|
||||
{
|
||||
return dh->meth->generate_key(dh);
|
||||
return ENGINE_get_DH(dh->engine)->generate_key(dh);
|
||||
}
|
||||
|
||||
int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
|
||||
{
|
||||
return dh->meth->compute_key(key, pub_key, dh);
|
||||
return ENGINE_get_DH(dh->engine)->compute_key(key, pub_key, dh);
|
||||
}
|
||||
|
||||
static DH_METHOD dh_ossl = {
|
||||
@@ -99,8 +100,6 @@ DH_METHOD *DH_OpenSSL(void)
|
||||
static int generate_key(DH *dh)
|
||||
{
|
||||
int ok=0;
|
||||
int generate_new_key=0;
|
||||
unsigned l;
|
||||
BN_CTX ctx;
|
||||
BN_MONT_CTX *mont;
|
||||
BIGNUM *pub_key=NULL,*priv_key=NULL;
|
||||
@@ -111,7 +110,9 @@ static int generate_key(DH *dh)
|
||||
{
|
||||
priv_key=BN_new();
|
||||
if (priv_key == NULL) goto err;
|
||||
generate_new_key=1;
|
||||
do
|
||||
if (!BN_rand_range(priv_key, dh->p)) goto err;
|
||||
while (BN_is_zero(priv_key));
|
||||
}
|
||||
else
|
||||
priv_key=dh->priv_key;
|
||||
@@ -132,12 +133,9 @@ static int generate_key(DH *dh)
|
||||
}
|
||||
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;
|
||||
if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, pub_key, dh->g,
|
||||
priv_key,dh->p,&ctx,mont))
|
||||
goto err;
|
||||
|
||||
dh->pub_key=pub_key;
|
||||
dh->priv_key=priv_key;
|
||||
@@ -176,7 +174,8 @@ static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
|
||||
}
|
||||
|
||||
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))
|
||||
if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, tmp, pub_key,
|
||||
dh->priv_key,dh->p,&ctx,mont))
|
||||
{
|
||||
DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);
|
||||
goto err;
|
||||
|
@@ -60,24 +60,40 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
|
||||
|
||||
static DH_METHOD *default_DH_method = NULL;
|
||||
static DH_METHOD *default_DH_method;
|
||||
static int dh_meth_num = 0;
|
||||
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;
|
||||
|
||||
void DH_set_default_method(DH_METHOD *meth)
|
||||
void DH_set_default_openssl_method(DH_METHOD *meth)
|
||||
{
|
||||
default_DH_method = meth;
|
||||
ENGINE *e;
|
||||
/* We'll need to notify the "openssl" ENGINE of this
|
||||
* change too. We won't bother locking things down at
|
||||
* our end as there was never any locking in these
|
||||
* functions! */
|
||||
if(default_DH_method != meth)
|
||||
{
|
||||
default_DH_method = meth;
|
||||
e = ENGINE_by_id("openssl");
|
||||
if(e)
|
||||
{
|
||||
ENGINE_set_DH(e, meth);
|
||||
ENGINE_free(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DH_METHOD *DH_get_default_method(void)
|
||||
DH_METHOD *DH_get_default_openssl_method(void)
|
||||
{
|
||||
if(!default_DH_method) default_DH_method = DH_OpenSSL();
|
||||
return default_DH_method;
|
||||
}
|
||||
|
||||
#if 0
|
||||
DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
|
||||
{
|
||||
DH_METHOD *mtmp;
|
||||
@@ -87,14 +103,37 @@ DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
|
||||
if (meth->init) meth->init(dh);
|
||||
return mtmp;
|
||||
}
|
||||
#else
|
||||
int DH_set_method(DH *dh, ENGINE *engine)
|
||||
{
|
||||
ENGINE *mtmp;
|
||||
DH_METHOD *meth;
|
||||
mtmp = dh->engine;
|
||||
meth = ENGINE_get_DH(mtmp);
|
||||
if (!ENGINE_init(engine))
|
||||
return 0;
|
||||
if (meth->finish) meth->finish(dh);
|
||||
dh->engine= engine;
|
||||
meth = ENGINE_get_DH(engine);
|
||||
if (meth->init) meth->init(dh);
|
||||
/* SHOULD ERROR CHECK THIS!!! */
|
||||
ENGINE_finish(mtmp);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
DH *DH_new(void)
|
||||
{
|
||||
return DH_new_method(NULL);
|
||||
}
|
||||
|
||||
#if 0
|
||||
DH *DH_new_method(DH_METHOD *meth)
|
||||
#else
|
||||
DH *DH_new_method(ENGINE *engine)
|
||||
#endif
|
||||
{
|
||||
DH_METHOD *meth;
|
||||
DH *ret;
|
||||
ret=(DH *)OPENSSL_malloc(sizeof(DH));
|
||||
|
||||
@@ -103,8 +142,17 @@ DH *DH_new_method(DH_METHOD *meth)
|
||||
DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);
|
||||
return(NULL);
|
||||
}
|
||||
if(meth) ret->meth = meth;
|
||||
else ret->meth = DH_get_default_method();
|
||||
if(engine)
|
||||
ret->engine = engine;
|
||||
else
|
||||
{
|
||||
if((ret->engine=ENGINE_get_default_DH()) == NULL)
|
||||
{
|
||||
OPENSSL_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
meth = ENGINE_get_DH(ret->engine);
|
||||
ret->pad=0;
|
||||
ret->version=0;
|
||||
ret->p=NULL;
|
||||
@@ -119,9 +167,9 @@ DH *DH_new_method(DH_METHOD *meth)
|
||||
ret->counter = NULL;
|
||||
ret->method_mont_p=NULL;
|
||||
ret->references = 1;
|
||||
ret->flags=ret->meth->flags;
|
||||
ret->flags=meth->flags;
|
||||
CRYPTO_new_ex_data(dh_meth,ret,&ret->ex_data);
|
||||
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
|
||||
if ((meth->init != NULL) && !meth->init(ret))
|
||||
{
|
||||
CRYPTO_free_ex_data(dh_meth,ret,&ret->ex_data);
|
||||
OPENSSL_free(ret);
|
||||
@@ -132,6 +180,7 @@ DH *DH_new_method(DH_METHOD *meth)
|
||||
|
||||
void DH_free(DH *r)
|
||||
{
|
||||
DH_METHOD *meth;
|
||||
int i;
|
||||
if(r == NULL) return;
|
||||
i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
|
||||
@@ -147,7 +196,9 @@ void DH_free(DH *r)
|
||||
}
|
||||
#endif
|
||||
|
||||
if(r->meth->finish) r->meth->finish(r);
|
||||
meth = ENGINE_get_DH(r->engine);
|
||||
if(meth->finish) meth->finish(r);
|
||||
ENGINE_finish(r->engine);
|
||||
|
||||
CRYPTO_free_ex_data(dh_meth, r, &r->ex_data);
|
||||
|
||||
|
@@ -66,7 +66,6 @@
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
#ifdef NO_DH
|
||||
int main(int argc, char *argv[])
|
||||
@@ -113,16 +112,6 @@ int main(int argc, char *argv[])
|
||||
a=DH_generate_parameters(64,DH_GENERATOR_5,cb,out);
|
||||
if (a == NULL) goto err;
|
||||
|
||||
if (!DH_check(a, &i)) goto err;
|
||||
if (i & DH_CHECK_P_NOT_PRIME)
|
||||
BIO_puts(out, "p value is not prime\n");
|
||||
if (i & DH_CHECK_P_NOT_SAFE_PRIME)
|
||||
BIO_puts(out, "p value is not a safe prime\n");
|
||||
if (i & DH_UNABLE_TO_CHECK_GENERATOR)
|
||||
BIO_puts(out, "unable to check the generator value\n");
|
||||
if (i & DH_NOT_SUITABLE_GENERATOR)
|
||||
BIO_puts(out, "the g value is not a generator\n");
|
||||
|
||||
BIO_puts(out,"\np =");
|
||||
BN_print(out,a->p);
|
||||
BIO_puts(out,"\ng =");
|
||||
@@ -181,8 +170,6 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
ret=0;
|
||||
err:
|
||||
ERR_print_errors_fp(stderr);
|
||||
|
||||
if (abuf != NULL) OPENSSL_free(abuf);
|
||||
if (bbuf != NULL) OPENSSL_free(bbuf);
|
||||
if(b != NULL) DH_free(b);
|
||||
|
@@ -116,39 +116,75 @@ dsa_key.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
|
||||
dsa_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
dsa_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
|
||||
dsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
dsa_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
|
||||
dsa_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
dsa_lib.o: ../cryptlib.h
|
||||
dsa_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
dsa_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
dsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
dsa_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
dsa_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
dsa_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
dsa_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
dsa_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
dsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
dsa_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
dsa_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
|
||||
dsa_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
dsa_ossl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
|
||||
dsa_ossl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
dsa_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
dsa_ossl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
dsa_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
dsa_ossl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
dsa_ossl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
dsa_ossl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
dsa_ossl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
dsa_ossl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
dsa_ossl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
dsa_ossl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
dsa_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
dsa_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
dsa_ossl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
dsa_ossl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
dsa_ossl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
dsa_ossl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
dsa_ossl.o: ../../include/openssl/symhacks.h ../cryptlib.h
|
||||
dsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
dsa_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
|
||||
dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
dsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
dsa_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
dsa_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
dsa_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
dsa_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
dsa_sign.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
dsa_sign.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
dsa_sign.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
dsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
dsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
dsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
dsa_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
dsa_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
dsa_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
dsa_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
dsa_sign.o: ../../include/openssl/symhacks.h ../cryptlib.h
|
||||
dsa_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
dsa_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
dsa_vrf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
dsa_vrf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
dsa_vrf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
dsa_vrf.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
|
||||
dsa_vrf.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
dsa_vrf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
dsa_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
|
||||
dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
dsa_vrf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
dsa_vrf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
dsa_vrf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
dsa_vrf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
dsa_vrf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
|
||||
dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
|
||||
dsa_vrf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
dsa_vrf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
dsa_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
dsa_vrf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
dsa_vrf.o: ../cryptlib.h
|
||||
|
@@ -133,7 +133,11 @@ struct dsa_st
|
||||
char *method_mont_p;
|
||||
int references;
|
||||
CRYPTO_EX_DATA ex_data;
|
||||
#if 0
|
||||
DSA_METHOD *meth;
|
||||
#else
|
||||
struct engine_st *engine;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \
|
||||
@@ -159,12 +163,20 @@ int DSA_do_verify(const unsigned char *dgst,int dgst_len,
|
||||
|
||||
DSA_METHOD *DSA_OpenSSL(void);
|
||||
|
||||
void DSA_set_default_method(DSA_METHOD *);
|
||||
DSA_METHOD *DSA_get_default_method(void);
|
||||
void DSA_set_default_openssl_method(DSA_METHOD *);
|
||||
DSA_METHOD *DSA_get_default_openssl_method(void);
|
||||
#if 0
|
||||
DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *);
|
||||
#else
|
||||
int DSA_set_method(DSA *dsa, struct engine_st *engine);
|
||||
#endif
|
||||
|
||||
DSA * DSA_new(void);
|
||||
#if 0
|
||||
DSA * DSA_new_method(DSA_METHOD *meth);
|
||||
#else
|
||||
DSA * DSA_new_method(struct engine_st *engine);
|
||||
#endif
|
||||
int DSA_size(DSA *);
|
||||
/* next 4 return -1 on error */
|
||||
int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp);
|
||||
@@ -178,6 +190,8 @@ int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
|
||||
int DSA_set_ex_data(DSA *d, int idx, void *arg);
|
||||
void *DSA_get_ex_data(DSA *d, int idx);
|
||||
|
||||
void ERR_load_DSA_strings(void );
|
||||
|
||||
DSA * d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length);
|
||||
DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
|
||||
DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length);
|
||||
@@ -214,7 +228,6 @@ DH *DSA_dup_DH(DSA *r);
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_DSA_strings(void);
|
||||
|
||||
/* Error codes for the DSA functions. */
|
||||
|
||||
@@ -241,3 +254,4 @@ void ERR_load_DSA_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -63,19 +63,34 @@
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
|
||||
|
||||
static DSA_METHOD *default_DSA_method = NULL;
|
||||
static DSA_METHOD *default_DSA_method;
|
||||
static int dsa_meth_num = 0;
|
||||
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;
|
||||
|
||||
void DSA_set_default_method(DSA_METHOD *meth)
|
||||
void DSA_set_default_openssl_method(DSA_METHOD *meth)
|
||||
{
|
||||
default_DSA_method = meth;
|
||||
ENGINE *e;
|
||||
/* We'll need to notify the "openssl" ENGINE of this
|
||||
* change too. We won't bother locking things down at
|
||||
* our end as there was never any locking in these
|
||||
* functions! */
|
||||
if(default_DSA_method != meth)
|
||||
{
|
||||
default_DSA_method = meth;
|
||||
e = ENGINE_by_id("openssl");
|
||||
if(e)
|
||||
{
|
||||
ENGINE_set_DSA(e, meth);
|
||||
ENGINE_free(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DSA_METHOD *DSA_get_default_method(void)
|
||||
DSA_METHOD *DSA_get_default_openssl_method(void)
|
||||
{
|
||||
if(!default_DSA_method) default_DSA_method = DSA_OpenSSL();
|
||||
return default_DSA_method;
|
||||
@@ -86,6 +101,7 @@ DSA *DSA_new(void)
|
||||
return DSA_new_method(NULL);
|
||||
}
|
||||
|
||||
#if 0
|
||||
DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
|
||||
{
|
||||
DSA_METHOD *mtmp;
|
||||
@@ -95,10 +111,33 @@ DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
|
||||
if (meth->init) meth->init(dsa);
|
||||
return mtmp;
|
||||
}
|
||||
|
||||
|
||||
DSA *DSA_new_method(DSA_METHOD *meth)
|
||||
#else
|
||||
int DSA_set_method(DSA *dsa, ENGINE *engine)
|
||||
{
|
||||
ENGINE *mtmp;
|
||||
DSA_METHOD *meth;
|
||||
mtmp = dsa->engine;
|
||||
meth = ENGINE_get_DSA(mtmp);
|
||||
if (!ENGINE_init(engine))
|
||||
return 0;
|
||||
if (meth->finish) meth->finish(dsa);
|
||||
dsa->engine = engine;
|
||||
meth = ENGINE_get_DSA(engine);
|
||||
if (meth->init) meth->init(dsa);
|
||||
/* SHOULD ERROR CHECK THIS!!! */
|
||||
ENGINE_finish(mtmp);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
DSA *DSA_new_method(DSA_METHOD *meth)
|
||||
#else
|
||||
DSA *DSA_new_method(ENGINE *engine)
|
||||
#endif
|
||||
{
|
||||
DSA_METHOD *meth;
|
||||
DSA *ret;
|
||||
|
||||
ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
|
||||
@@ -107,8 +146,17 @@ DSA *DSA_new_method(DSA_METHOD *meth)
|
||||
DSAerr(DSA_F_DSA_NEW,ERR_R_MALLOC_FAILURE);
|
||||
return(NULL);
|
||||
}
|
||||
if(meth) ret->meth = meth;
|
||||
else ret->meth = DSA_get_default_method();
|
||||
if(engine)
|
||||
ret->engine = engine;
|
||||
else
|
||||
{
|
||||
if((ret->engine=ENGINE_get_default_DSA()) == NULL)
|
||||
{
|
||||
OPENSSL_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
meth = ENGINE_get_DSA(ret->engine);
|
||||
ret->pad=0;
|
||||
ret->version=0;
|
||||
ret->write_params=1;
|
||||
@@ -124,9 +172,9 @@ DSA *DSA_new_method(DSA_METHOD *meth)
|
||||
ret->method_mont_p=NULL;
|
||||
|
||||
ret->references=1;
|
||||
ret->flags=ret->meth->flags;
|
||||
ret->flags=meth->flags;
|
||||
CRYPTO_new_ex_data(dsa_meth,ret,&ret->ex_data);
|
||||
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
|
||||
if ((meth->init != NULL) && !meth->init(ret))
|
||||
{
|
||||
CRYPTO_free_ex_data(dsa_meth,ret,&ret->ex_data);
|
||||
OPENSSL_free(ret);
|
||||
@@ -138,6 +186,7 @@ DSA *DSA_new_method(DSA_METHOD *meth)
|
||||
|
||||
void DSA_free(DSA *r)
|
||||
{
|
||||
DSA_METHOD *meth;
|
||||
int i;
|
||||
|
||||
if (r == NULL) return;
|
||||
@@ -155,7 +204,9 @@ void DSA_free(DSA *r)
|
||||
}
|
||||
#endif
|
||||
|
||||
if(r->meth->finish) r->meth->finish(r);
|
||||
meth = ENGINE_get_DSA(r->engine);
|
||||
if(meth->finish) meth->finish(r);
|
||||
ENGINE_finish(r->engine);
|
||||
|
||||
CRYPTO_free_ex_data(dsa_meth, r, &r->ex_data);
|
||||
|
||||
|
@@ -64,6 +64,7 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
|
||||
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
|
||||
@@ -201,7 +202,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||
}
|
||||
|
||||
/* Compute r = (g^k mod p) mod q */
|
||||
if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
|
||||
if (!ENGINE_get_DSA(dsa->engine)->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;
|
||||
|
||||
@@ -290,7 +291,7 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
||||
if (!BN_mod(&u1,&u1,dsa->q,ctx)) goto err;
|
||||
#else
|
||||
{
|
||||
if (!dsa->meth->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2,
|
||||
if (!ENGINE_get_DSA(dsa->engine)->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2,
|
||||
dsa->p,ctx,mont)) goto err;
|
||||
/* BN_copy(&u1,&t1); */
|
||||
/* let u1 = u1 mod q */
|
||||
|
@@ -64,10 +64,11 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
|
||||
{
|
||||
return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
|
||||
return ENGINE_get_DSA(dsa->engine)->dsa_do_sign(dgst, dlen, dsa);
|
||||
}
|
||||
|
||||
int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
|
||||
@@ -87,6 +88,6 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
|
||||
|
||||
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||
{
|
||||
return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
|
||||
return ENGINE_get_DSA(dsa->engine)->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
|
||||
}
|
||||
|
||||
|
@@ -65,11 +65,12 @@
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1_mac.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
||||
DSA *dsa)
|
||||
{
|
||||
return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
|
||||
return ENGINE_get_DSA(dsa->engine)->dsa_do_verify(dgst, dgst_len, sig, dsa);
|
||||
}
|
||||
|
||||
/* data has already been hashed (probably with SHA or SHA-1). */
|
||||
|
@@ -194,11 +194,12 @@ DSO_METHOD *DSO_METHOD_win32(void);
|
||||
/* If VMS is defined, use shared images. If not, return NULL. */
|
||||
DSO_METHOD *DSO_METHOD_vms(void);
|
||||
|
||||
void ERR_load_DSO_strings(void);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_DSO_strings(void);
|
||||
|
||||
/* Error codes for the DSO functions. */
|
||||
|
||||
@@ -246,3 +247,4 @@ void ERR_load_DSO_strings(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -259,12 +259,8 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym)
|
||||
{
|
||||
DSO_VMS_INTERNAL *ptr;
|
||||
int status;
|
||||
#if 0
|
||||
int flags = (1<<4); /* LIB$M_FIS_MIXEDCASE, but this symbol isn't
|
||||
defined in VMS older than 7.0 or so */
|
||||
#else
|
||||
int flags = 0;
|
||||
#endif
|
||||
struct dsc$descriptor_s symname_dsc;
|
||||
*sym = NULL;
|
||||
|
||||
|
2
crypto/engine/.cvsignore
Normal file
2
crypto/engine/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
lib
|
||||
Makefile.save
|
220
crypto/engine/Makefile.ssl
Normal file
220
crypto/engine/Makefile.ssl
Normal file
@@ -0,0 +1,220 @@
|
||||
#
|
||||
# OpenSSL/crypto/engine/Makefile
|
||||
#
|
||||
|
||||
DIR= engine
|
||||
TOP= ../..
|
||||
CC= cc
|
||||
INCLUDES= -I.. -I../../include
|
||||
CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP)
|
||||
MAKEFILE= Makefile.ssl
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
|
||||
GENERAL=Makefile
|
||||
TEST= enginetest.c
|
||||
APPS=
|
||||
|
||||
LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC= engine_err.c engine_lib.c engine_list.c engine_openssl.c \
|
||||
hw_atalla.c hw_cswift.c hw_ncipher.c
|
||||
LIBOBJ= engine_err.o engine_lib.o engine_list.o engine_openssl.o \
|
||||
hw_atalla.o hw_cswift.o hw_ncipher.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
EXHEADER= engine.h
|
||||
HEADER= $(EXHEADER)
|
||||
|
||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
|
||||
top:
|
||||
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
|
||||
install:
|
||||
@for i in $(EXHEADER) ; \
|
||||
do \
|
||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||
done;
|
||||
|
||||
tags:
|
||||
ctags $(SRC)
|
||||
|
||||
tests:
|
||||
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
depend:
|
||||
$(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
|
||||
|
||||
dclean:
|
||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
engine_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
engine_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
engine_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
|
||||
engine_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
engine_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
|
||||
engine_err.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
engine_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
engine_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
engine_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
engine_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
engine_err.o: ../../include/openssl/objects.h
|
||||
engine_err.o: ../../include/openssl/opensslconf.h
|
||||
engine_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
engine_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
engine_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
engine_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
engine_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
engine_err.o: ../../include/openssl/symhacks.h
|
||||
engine_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
engine_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
engine_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
engine_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
engine_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
engine_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
engine_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
engine_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
engine_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
engine_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
engine_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
engine_lib.o: ../../include/openssl/objects.h
|
||||
engine_lib.o: ../../include/openssl/opensslconf.h
|
||||
engine_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
engine_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
engine_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
engine_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
engine_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
engine_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
|
||||
engine_list.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
engine_list.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
engine_list.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
engine_list.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
engine_list.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
engine_list.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
engine_list.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
engine_list.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
engine_list.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
engine_list.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
|
||||
engine_list.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
|
||||
engine_list.o: ../../include/openssl/objects.h
|
||||
engine_list.o: ../../include/openssl/opensslconf.h
|
||||
engine_list.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
engine_list.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
engine_list.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
engine_list.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
engine_list.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
engine_list.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
|
||||
engine_openssl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
engine_openssl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
engine_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
engine_openssl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
engine_openssl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
engine_openssl.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
|
||||
engine_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
|
||||
engine_openssl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
engine_openssl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
engine_openssl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
engine_openssl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
engine_openssl.o: ../../include/openssl/obj_mac.h
|
||||
engine_openssl.o: ../../include/openssl/objects.h
|
||||
engine_openssl.o: ../../include/openssl/opensslconf.h
|
||||
engine_openssl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
engine_openssl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
engine_openssl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
engine_openssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
engine_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
engine_openssl.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
|
||||
hw_atalla.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
hw_atalla.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
hw_atalla.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
hw_atalla.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
hw_atalla.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
hw_atalla.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
|
||||
hw_atalla.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
|
||||
hw_atalla.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
hw_atalla.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
hw_atalla.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
hw_atalla.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
hw_atalla.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
hw_atalla.o: ../../include/openssl/opensslconf.h
|
||||
hw_atalla.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
hw_atalla.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
hw_atalla.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
hw_atalla.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
hw_atalla.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
hw_atalla.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
|
||||
hw_atalla.o: vendor_defns/atalla.h
|
||||
hw_cswift.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
hw_cswift.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
hw_cswift.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
hw_cswift.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
hw_cswift.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
hw_cswift.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
|
||||
hw_cswift.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
|
||||
hw_cswift.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
hw_cswift.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
hw_cswift.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
hw_cswift.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
hw_cswift.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
hw_cswift.o: ../../include/openssl/opensslconf.h
|
||||
hw_cswift.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
|
||||
hw_cswift.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
hw_cswift.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
hw_cswift.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
hw_cswift.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
hw_cswift.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
|
||||
hw_cswift.o: vendor_defns/cswift.h
|
||||
hw_ncipher.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
hw_ncipher.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
hw_ncipher.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
hw_ncipher.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
hw_ncipher.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
hw_ncipher.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
|
||||
hw_ncipher.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
|
||||
hw_ncipher.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
hw_ncipher.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
|
||||
hw_ncipher.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
|
||||
hw_ncipher.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
hw_ncipher.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
hw_ncipher.o: ../../include/openssl/opensslconf.h
|
||||
hw_ncipher.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
|
||||
hw_ncipher.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
|
||||
hw_ncipher.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
|
||||
hw_ncipher.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
hw_ncipher.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
hw_ncipher.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
hw_ncipher.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
hw_ncipher.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
hw_ncipher.o: ../cryptlib.h engine_int.h vendor_defns/hwcryptohook.h
|
278
crypto/engine/README
Normal file
278
crypto/engine/README
Normal file
@@ -0,0 +1,278 @@
|
||||
NOTES, THOUGHTS, and EVERYTHING
|
||||
-------------------------------
|
||||
|
||||
(1) Concurrency and locking ... I made a change to the ENGINE_free code
|
||||
because I spotted a potential hold-up in proceedings (doing too
|
||||
much inside a lock including calling a callback), there may be
|
||||
other bits like this. What do the speed/optimisation freaks think
|
||||
of this aspect of the code and design? There's lots of locking for
|
||||
manipulation functions and I need that to keep things nice and
|
||||
solid, but this manipulation is mostly (de)initialisation, I would
|
||||
think that most run-time locking is purely in the ENGINE_init and
|
||||
ENGINE_finish calls that might be made when getting handles for
|
||||
RSA (and friends') structures. These would be mostly reference
|
||||
count operations as the functional references should always be 1
|
||||
or greater at run-time to prevent init/deinit thrashing.
|
||||
|
||||
(2) nCipher support, via the HWCryptoHook API, is now in the code.
|
||||
Apparently this hasn't been tested too much yet, but it looks
|
||||
good. :-) Atalla support has been added too, but shares a lot in
|
||||
common with Ben's original hooks in bn_exp.c (although it has been
|
||||
ENGINE-ified, and error handling wrapped around it) and it's also
|
||||
had some low-volume testing, so it should be usable.
|
||||
|
||||
(3) Of more concern, we need to work out (a) how to put together usable
|
||||
RAND_METHODs for units that just have one "get n or less random
|
||||
bytes" function, (b) we also need to determine how to hook the code
|
||||
in crypto/rand/ to use the ENGINE defaults in a way similar to what
|
||||
has been done in crypto/rsa/, crypto/dsa/, etc.
|
||||
|
||||
(4) ENGINE should really grow to encompass more than 3 public key
|
||||
algorithms and randomness gathering. The structure/data level of
|
||||
the engine code is hidden from code outside the crypto/engine/
|
||||
directory so change shouldn't be too viral. More important though
|
||||
is how things should evolve ... this needs thought and discussion.
|
||||
|
||||
|
||||
-----------------------------------==*==-----------------------------------
|
||||
|
||||
More notes 2000-08-01
|
||||
---------------------
|
||||
|
||||
Geoff Thorpe, who designed the engine part, wrote a pretty good description
|
||||
of the thoughts he had when he built it, good enough to include verbatim here
|
||||
(with his permission) -- Richard Levitte
|
||||
|
||||
|
||||
Date: Tue, 1 Aug 2000 16:54:08 +0100 (BST)
|
||||
From: Geoff Thorpe
|
||||
Subject: Re: The thoughts to merge BRANCH_engine into the main trunk are
|
||||
emerging
|
||||
|
||||
Hi there,
|
||||
|
||||
I'm going to try and do some justice to this, but I'm a little short on
|
||||
time and the there is an endless amount that could be discussed on this
|
||||
subject. sigh ... please bear with me :-)
|
||||
|
||||
> The changes in BRANCH_engine dig deep into the core of OpenSSL, for example
|
||||
> into the RSA and RAND routines, adding a level of indirection which is needed
|
||||
> to keep the abstraction, as far as I understand. It would be a good thing if
|
||||
> those who do play with those things took a look at the changes that have been
|
||||
> done in the branch and say out loud how much (or hopefully little) we've made
|
||||
> fools of ourselves.
|
||||
|
||||
The point here is that the code that has emerged in the BRANCH_engine
|
||||
branch was based on some initial requirements of mine that I went in and
|
||||
addressed, and Richard has picked up the ball and run with it too. It
|
||||
would be really useful to get some review of the approach we've taken, but
|
||||
first I think I need to describe as best I can the reasons behind what has
|
||||
been done so far, in particular what issues we have tried to address when
|
||||
doing this, and what issues we have intentionally (or necessarily) tried
|
||||
to avoid.
|
||||
|
||||
methods, engines, and evps
|
||||
--------------------------
|
||||
|
||||
There has been some dicussion, particularly with Steve, about where this
|
||||
ENGINE stuff might fit into the conceptual picture as/when we start to
|
||||
abstract algorithms a little bit to make the library more extensible. In
|
||||
particular, it would desirable to have algorithms (symmetric, hash, pkc,
|
||||
etc) abstracted in some way that allows them to be just objects sitting in
|
||||
a list (or database) ... it'll just happen that the "DSA" object doesn't
|
||||
support encryption whereas the "RSA" object does. This requires a lot of
|
||||
consideration to begin to know how to tackle it; in particular how
|
||||
encapsulated should these things be? If the objects also understand their
|
||||
own ASN1 encodings and what-not, then it would for example be possible to
|
||||
add support for elliptic-curve DSA in as a new algorithm and automatically
|
||||
have ECC-DSA certificates supported in SSL applications. Possible, but not
|
||||
easy. :-)
|
||||
|
||||
Whatever, it seems that the way to go (if I've grok'd Steve's comments on
|
||||
this in the past) is to amalgamate these things in EVP as is already done
|
||||
(I think) for ciphers or hashes (Steve, please correct/elaborate). I
|
||||
certainly think something should be done in this direction because right
|
||||
now we have different source directories, types, functions, and methods
|
||||
for each algorithm - even when conceptually they are very much different
|
||||
feathers of the same bird. (This is certainly all true for the public-key
|
||||
stuff, and may be partially true for the other parts.)
|
||||
|
||||
ENGINE was *not* conceived as a way of solving this, far from it. Nor was
|
||||
it conceived as a way of replacing the various "***_METHOD"s. It was
|
||||
conceived as an abstraction of a sort of "virtual crypto device". If we
|
||||
lived in a world where "EVP_ALGO"s (or something like them) encapsulated
|
||||
particular algorithms like RSA,DSA,MD5,RC4,etc, and "***_METHOD"s
|
||||
encapsulated interfaces to algorithms (eg. some algo's might support a
|
||||
PKC_METHOD, a HASH_METHOD, or a CIPHER_METHOD, who knows?), then I would
|
||||
think that ENGINE would encapsulate an implementation of arbitrarily many
|
||||
of those algorithms - perhaps as alternatives to existing algorithms
|
||||
and/or perhaps as new previously unimplemented algorithms. An ENGINE could
|
||||
be used to contain an alternative software implementation, a wrapper for a
|
||||
hardware acceleration and/or key-management unit, a comms-wrapper for
|
||||
distributing cryptographic operations to remote machines, or any other
|
||||
"devices" your imagination can dream up.
|
||||
|
||||
However, what has been done in the ENGINE branch so far is nothing more
|
||||
than starting to get our toes wet. I had a couple of self-imposed
|
||||
requirements when putting the initial abstraction together, and I may have
|
||||
already posed these in one form or another on the list, but briefly;
|
||||
|
||||
(i) only bother with public key algorithms for now, and maybe RAND too
|
||||
(motivated by the need to get hardware support going and the fact
|
||||
this was a comparitively easy subset to address to begin with).
|
||||
|
||||
(ii) don't change (if at all possible) the existing crypto code, ie. the
|
||||
implementations, the way the ***_METHODs work, etc.
|
||||
|
||||
(iii) ensure that if no function from the ENGINE code is ever called then
|
||||
things work the way they always did, and there is no memory
|
||||
allocation (otherwise the failure to cleanup would be a problem -
|
||||
this is part of the reason no STACKs were used, the other part of
|
||||
the reason being I found them inappropriate).
|
||||
|
||||
(iv) ensure that all the built-in crypto was encapsulated by one of
|
||||
these "ENGINE"s and that this engine was automatically selected as
|
||||
the default.
|
||||
|
||||
(v) provide the minimum hooking possible in the existing crypto code
|
||||
so that global functions (eg. RSA_public_encrypt) do not need any
|
||||
extra parameter, yet will use whatever the current default ENGINE
|
||||
for that RSA key is, and that the default can be set "per-key"
|
||||
and globally (new keys will assume the global default, and keys
|
||||
without their own default will be operated on using the global
|
||||
default). NB: Try and make (v) conflict as little as possible with
|
||||
(ii). :-)
|
||||
|
||||
(vi) wrap the ENGINE code up in duct tape so you can't even see the
|
||||
corners. Ie. expose no structures at all, just black-box pointers.
|
||||
|
||||
(v) maintain internally a list of ENGINEs on which a calling
|
||||
application can iterate, interrogate, etc. Allow a calling
|
||||
application to hook in new ENGINEs, remove ENGINEs from the list,
|
||||
and enforce uniqueness within the global list of each ENGINE's
|
||||
"unique id".
|
||||
|
||||
(vi) keep reference counts for everything - eg. this includes storing a
|
||||
reference inside each RSA structure to the ENGINE that it uses.
|
||||
This is freed when the RSA structure is destroyed, or has its
|
||||
ENGINE explicitly changed. The net effect needs to be that at any
|
||||
time, it is deterministic to know whether an ENGINE is in use or
|
||||
can be safely removed (or unloaded in the case of the other type
|
||||
of reference) without invalidating function pointers that may or
|
||||
may not be used indavertently in the future. This was actually
|
||||
one of the biggest problems to overcome in the existing OpenSSL
|
||||
code - implementations had always been assumed to be ever-present,
|
||||
so there was no trivial way to get round this.
|
||||
|
||||
(vii) distinguish between structural references and functional
|
||||
references.
|
||||
|
||||
A *little* detail
|
||||
-----------------
|
||||
|
||||
While my mind is on it; I'll illustrate the bit in item (vii). This idea
|
||||
turned out to be very handy - the ENGINEs themselves need to be operated
|
||||
on and manipulated simply as objects without necessarily trying to
|
||||
"enable" them for use. Eg. most host machines will not have the necessary
|
||||
hardware or software to support all the engines one might compile into
|
||||
OpenSSL, yet it needs to be possible to iterate across the ENGINEs,
|
||||
querying their names, properties, etc - all happening in a thread-safe
|
||||
manner that uses reference counts (if you imagine two threads iterating
|
||||
through a list and one thread removing the ENGINE the other is currently
|
||||
looking at - you can see the gotcha waiting to happen). For all of this,
|
||||
*structural references* are used and operate much like the other reference
|
||||
counts in OpenSSL.
|
||||
|
||||
The other kind of reference count is for *functional* references - these
|
||||
indicate a reference on which the caller can actually assume the
|
||||
particular ENGINE to be initialised and usable to perform the operations
|
||||
it implements. Any increment or decrement of the functional reference
|
||||
count automatically invokes a corresponding change in the structural
|
||||
reference count, as it is fairly obvious that a functional reference is a
|
||||
restricted case of a structural reference. So struct_ref >= funct_ref at
|
||||
all times. NB: functional references are usually obtained by a call to
|
||||
ENGINE_init(), but can also be created implicitly by calls that require a
|
||||
new functional reference to be created, eg. ENGINE_set_default(). Either
|
||||
way the only time the underlying ENGINE's "init" function is really called
|
||||
is when the (functional) reference count increases to 1, similarly the
|
||||
underlying "finish" handler is only called as the count goes down to 0.
|
||||
The effect of this, for example, is that if you set the default ENGINE for
|
||||
RSA operations to be "cswift", then its functional reference count will
|
||||
already be at least 1 so the CryptoSwift shared-library and the card will
|
||||
stay loaded and initialised until such time as all RSA keys using the
|
||||
cswift ENGINE are changed or destroyed and the default ENGINE for RSA
|
||||
operations has been changed. This prevents repeated thrashing of init and
|
||||
finish handling if the count keeps getting down as far as zero.
|
||||
|
||||
Otherwise, the way the ENGINE code has been put together I think pretty
|
||||
much reflects the above points. The reason for the ENGINE structure having
|
||||
individual RSA_METHOD, DSA_METHOD, etc pointers is simply that it was the
|
||||
easiest way to go about things for now, to hook it all into the raw
|
||||
RSA,DSA,etc code, and I was trying to the keep the structure invisible
|
||||
anyway so that the way this is internally managed could be easily changed
|
||||
later on when we start to work out what's to be done about these other
|
||||
abstractions.
|
||||
|
||||
Down the line, if some EVP-based technique emerges for adequately
|
||||
encapsulating algorithms and all their various bits and pieces, then I can
|
||||
imagine that "ENGINE" would turn into a reference-counting database of
|
||||
these EVP things, of which the default "openssl" ENGINE would be the
|
||||
library's own object database of pre-built software implemented algorithms
|
||||
(and such). It would also be cool to see the idea of "METHOD"s detached
|
||||
from the algorithms themselves ... so RSA, DSA, ElGamal, etc can all
|
||||
expose essentially the same METHOD (aka interface), which would include
|
||||
any querying/flagging stuff to identify what the algorithm can/can't do,
|
||||
its name, and other stuff like max/min block sizes, key sizes, etc. This
|
||||
would result in ENGINE similarly detaching its internal database of
|
||||
algorithm implementations from the function definitions that return
|
||||
interfaces to them. I think ...
|
||||
|
||||
As for DSOs etc. Well the DSO code is pretty handy (but could be made much
|
||||
more so) for loading vendor's driver-libraries and talking to them in some
|
||||
generic way, but right now there's still big problems associated with
|
||||
actually putting OpenSSL code (ie. new ENGINEs, or anything else for that
|
||||
matter) in dynamically loadable libraries. These problems won't go away in
|
||||
a hurry so I don't think we should expect to have any kind of
|
||||
shared-library extensions any time soon - but solving the problems is a
|
||||
good thing to aim for, and would as a side-effect probably help make
|
||||
OpenSSL more usable as a shared-library itself (looking at the things
|
||||
needed to do this will show you why).
|
||||
|
||||
One of the problems is that if you look at any of the ENGINE
|
||||
implementations, eg. hw_cswift.c or hw_ncipher.c, you'll see how it needs
|
||||
a variety of functionality and definitions from various areas of OpenSSL,
|
||||
including crypto/bn/, crypto/err/, crypto/ itself (locking for example),
|
||||
crypto/dso/, crypto/engine/, crypto/rsa, etc etc etc. So if similar code
|
||||
were to be suctioned off into shared libraries, the shared libraries would
|
||||
either have to duplicate all the definitions and code and avoid loader
|
||||
conflicts, or OpenSSL would have to somehow expose all that functionality
|
||||
to the shared-library. If this isn't a big enough problem, the issue of
|
||||
binary compatibility will be - anyone writing Apache modules can tell you
|
||||
that (Ralf? Ben? :-). However, I don't think OpenSSL would need to be
|
||||
quite so forgiving as Apache should be, so OpenSSL could simply tell its
|
||||
version to the DSO and leave the DSO with the problem of deciding whether
|
||||
to proceed or bail out for fear of binary incompatibilities.
|
||||
|
||||
Certainly one thing that would go a long way to addressing this is to
|
||||
embark on a bit of an opaqueness mission. I've set the ENGINE code up with
|
||||
this in mind - it's so draconian that even to declare your own ENGINE, you
|
||||
have to get the engine code to create the underlying ENGINE structure, and
|
||||
then feed in the new ENGINE's function/method pointers through various
|
||||
"set" functions. The more of the code that takes on such a black-box
|
||||
approach, the more of the code that will be (a) easy to expose to shared
|
||||
libraries that need it, and (b) easy to expose to applications wanting to
|
||||
use OpenSSL itself as a shared-library. From my own explorations in
|
||||
OpenSSL, the biggest leviathan I've seen that is a problem in this respect
|
||||
is the BIGNUM code. Trying to "expose" the bignum code through any kind of
|
||||
organised "METHODs", let alone do all the necessary bignum operations
|
||||
solely through functions rather than direct access to the structures and
|
||||
macros, will be a massive pain in the "r"s.
|
||||
|
||||
Anyway, I'm done for now - hope it was readable. Thoughts?
|
||||
|
||||
Cheers,
|
||||
Geoff
|
||||
|
||||
|
||||
-----------------------------------==*==-----------------------------------
|
||||
|
398
crypto/engine/engine.h
Normal file
398
crypto/engine/engine.h
Normal file
@@ -0,0 +1,398 @@
|
||||
/* openssl/engine.h */
|
||||
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
|
||||
* project 2000.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 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).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ENGINE_H
|
||||
#define HEADER_ENGINE_H
|
||||
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* These flags are used to control combinations of algorithm (methods)
|
||||
* by bitwise "OR"ing. */
|
||||
#define ENGINE_METHOD_RSA (unsigned int)0x0001
|
||||
#define ENGINE_METHOD_DSA (unsigned int)0x0002
|
||||
#define ENGINE_METHOD_DH (unsigned int)0x0004
|
||||
#define ENGINE_METHOD_RAND (unsigned int)0x0008
|
||||
#define ENGINE_METHOD_BN_MOD_EXP (unsigned int)0x0010
|
||||
#define ENGINE_METHOD_BN_MOD_EXP_CRT (unsigned int)0x0020
|
||||
/* Obvious all-or-nothing cases. */
|
||||
#define ENGINE_METHOD_ALL (unsigned int)0xFFFF
|
||||
#define ENGINE_METHOD_NONE (unsigned int)0x0000
|
||||
|
||||
/* These flags are used to tell the ctrl function what should be done.
|
||||
* All command numbers are shared between all engines, even if some don't
|
||||
* make sense to some engines. In such a case, they do nothing but return
|
||||
* the error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. */
|
||||
#define ENGINE_CTRL_SET_LOGSTREAM 1
|
||||
#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
|
||||
/* Flags specific to the nCipher "chil" engine */
|
||||
#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
|
||||
/* Depending on the value of the (long)i argument, this sets or
|
||||
* unsets the SimpleForkCheck flag in the CHIL API to enable or
|
||||
* disable checking and workarounds for applications that fork().
|
||||
*/
|
||||
#define ENGINE_CTRL_CHIL_NO_LOCKING 101
|
||||
/* This prevents the initialisation function from providing mutex
|
||||
* callbacks to the nCipher library. */
|
||||
|
||||
/* As we're missing a BIGNUM_METHOD, we need a couple of locally
|
||||
* defined function types that engines can implement. */
|
||||
|
||||
#ifndef HEADER_ENGINE_INT_H
|
||||
/* mod_exp operation, calculates; r = a ^ p mod m
|
||||
* NB: ctx can be NULL, but if supplied, the implementation may use
|
||||
* it if it wishes. */
|
||||
typedef int (*BN_MOD_EXP)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
|
||||
/* private key operation for RSA, provided seperately in case other
|
||||
* RSA implementations wish to use it. */
|
||||
typedef int (*BN_MOD_EXP_CRT)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
|
||||
const BIGNUM *iqmp, BN_CTX *ctx);
|
||||
|
||||
/* Generic function pointer */
|
||||
typedef void (*ENGINE_GEN_FUNC_PTR)();
|
||||
/* Generic function pointer taking no arguments */
|
||||
typedef void (*ENGINE_GEN_INT_FUNC_PTR)(void);
|
||||
/* Specific control function pointer */
|
||||
typedef int (*ENGINE_CTRL_FUNC_PTR)(int cmd, long i, void *p, void (*f)());
|
||||
|
||||
/* The list of "engine" types is a static array of (const ENGINE*)
|
||||
* pointers (not dynamic because static is fine for now and we otherwise
|
||||
* have to hook an appropriate load/unload function in to initialise and
|
||||
* cleanup). */
|
||||
typedef struct engine_st ENGINE;
|
||||
#endif
|
||||
|
||||
/* STRUCTURE functions ... all of these functions deal with pointers to
|
||||
* ENGINE structures where the pointers have a "structural reference".
|
||||
* This means that their reference is to allow access to the structure
|
||||
* but it does not imply that the structure is functional. To simply
|
||||
* increment or decrement the structural reference count, use ENGINE_new
|
||||
* and ENGINE_free. NB: This is not required when iterating using
|
||||
* ENGINE_get_next as it will automatically decrement the structural
|
||||
* reference count of the "current" ENGINE and increment the structural
|
||||
* reference count of the ENGINE it returns (unless it is NULL). */
|
||||
|
||||
/* Get the first/last "ENGINE" type available. */
|
||||
ENGINE *ENGINE_get_first(void);
|
||||
ENGINE *ENGINE_get_last(void);
|
||||
/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
|
||||
ENGINE *ENGINE_get_next(ENGINE *e);
|
||||
ENGINE *ENGINE_get_prev(ENGINE *e);
|
||||
/* Add another "ENGINE" type into the array. */
|
||||
int ENGINE_add(ENGINE *e);
|
||||
/* Remove an existing "ENGINE" type from the array. */
|
||||
int ENGINE_remove(ENGINE *e);
|
||||
/* Retrieve an engine from the list by its unique "id" value. */
|
||||
ENGINE *ENGINE_by_id(const char *id);
|
||||
|
||||
/* These functions are useful for manufacturing new ENGINE
|
||||
* structures. They don't address reference counting at all -
|
||||
* one uses them to populate an ENGINE structure with personalised
|
||||
* implementations of things prior to using it directly or adding
|
||||
* it to the builtin ENGINE list in OpenSSL. These are also here
|
||||
* so that the ENGINE structure doesn't have to be exposed and
|
||||
* break binary compatibility!
|
||||
*
|
||||
* NB: I'm changing ENGINE_new to force the ENGINE structure to
|
||||
* be allocated from within OpenSSL. See the comment for
|
||||
* ENGINE_get_struct_size().
|
||||
*/
|
||||
#if 0
|
||||
ENGINE *ENGINE_new(ENGINE *e);
|
||||
#else
|
||||
ENGINE *ENGINE_new(void);
|
||||
#endif
|
||||
int ENGINE_free(ENGINE *e);
|
||||
int ENGINE_set_id(ENGINE *e, const char *id);
|
||||
int ENGINE_set_name(ENGINE *e, const char *name);
|
||||
int ENGINE_set_RSA(ENGINE *e, RSA_METHOD *rsa_meth);
|
||||
int ENGINE_set_DSA(ENGINE *e, DSA_METHOD *dsa_meth);
|
||||
int ENGINE_set_DH(ENGINE *e, DH_METHOD *dh_meth);
|
||||
int ENGINE_set_RAND(ENGINE *e, RAND_METHOD *rand_meth);
|
||||
int ENGINE_set_BN_mod_exp(ENGINE *e, BN_MOD_EXP bn_mod_exp);
|
||||
int ENGINE_set_BN_mod_exp_crt(ENGINE *e, BN_MOD_EXP_CRT bn_mod_exp_crt);
|
||||
int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
|
||||
int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
|
||||
int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
|
||||
|
||||
/* These return values from within the ENGINE structure. These can
|
||||
* be useful with functional references as well as structural
|
||||
* references - it depends which you obtained. Using the result
|
||||
* for functional purposes if you only obtained a structural
|
||||
* reference may be problematic! */
|
||||
const char *ENGINE_get_id(ENGINE *e);
|
||||
const char *ENGINE_get_name(ENGINE *e);
|
||||
RSA_METHOD *ENGINE_get_RSA(ENGINE *e);
|
||||
DSA_METHOD *ENGINE_get_DSA(ENGINE *e);
|
||||
DH_METHOD *ENGINE_get_DH(ENGINE *e);
|
||||
RAND_METHOD *ENGINE_get_RAND(ENGINE *e);
|
||||
BN_MOD_EXP ENGINE_get_BN_mod_exp(ENGINE *e);
|
||||
BN_MOD_EXP_CRT ENGINE_get_BN_mod_exp_crt(ENGINE *e);
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(ENGINE *e);
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(ENGINE *e);
|
||||
ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(ENGINE *e);
|
||||
|
||||
/* ENGINE_new is normally passed a NULL in the first parameter because
|
||||
* the calling code doesn't have access to the definition of the ENGINE
|
||||
* structure (for good reason). However, if the caller wishes to use
|
||||
* its own memory allocation or use a static array, the following call
|
||||
* should be used to check the amount of memory the ENGINE structure
|
||||
* will occupy. This will make the code more future-proof.
|
||||
*
|
||||
* NB: I'm "#if 0"-ing this out because it's better to force the use of
|
||||
* internally allocated memory. See similar change in ENGINE_new().
|
||||
*/
|
||||
#if 0
|
||||
int ENGINE_get_struct_size(void);
|
||||
#endif
|
||||
|
||||
/* FUNCTIONAL functions. These functions deal with ENGINE structures
|
||||
* that have (or will) be initialised for use. Broadly speaking, the
|
||||
* structural functions are useful for iterating the list of available
|
||||
* engine types, creating new engine types, and other "list" operations.
|
||||
* These functions actually deal with ENGINEs that are to be used. As
|
||||
* such these functions can fail (if applicable) when particular
|
||||
* engines are unavailable - eg. if a hardware accelerator is not
|
||||
* attached or not functioning correctly. Each ENGINE has 2 reference
|
||||
* counts; structural and functional. Every time a functional reference
|
||||
* is obtained or released, a corresponding structural reference is
|
||||
* automatically obtained or released too. */
|
||||
|
||||
/* Initialise a engine type for use (or up its reference count if it's
|
||||
* already in use). This will fail if the engine is not currently
|
||||
* operational and cannot initialise. */
|
||||
int ENGINE_init(ENGINE *e);
|
||||
/* Free a functional reference to a engine type. This does not require
|
||||
* a corresponding call to ENGINE_free as it also releases a structural
|
||||
* reference. */
|
||||
int ENGINE_finish(ENGINE *e);
|
||||
/* Send control parametrised commands to the engine. The possibilities
|
||||
* to send down an integer, a pointer to data or a function pointer are
|
||||
* provided. Any of the parameters may or may not be NULL, depending
|
||||
* on the command number */
|
||||
/* WARNING: This is currently experimental and may change radically! */
|
||||
int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
|
||||
|
||||
/* The following functions handle keys that are stored in some secondary
|
||||
* location, handled by the engine. The storage may be on a card or
|
||||
* whatever. */
|
||||
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
|
||||
const char *passphrase);
|
||||
EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
|
||||
const char *passphrase);
|
||||
|
||||
/* This returns a pointer for the current ENGINE structure that
|
||||
* is (by default) performing any RSA operations. The value returned
|
||||
* is an incremented reference, so it should be free'd (ENGINE_finish)
|
||||
* before it is discarded. */
|
||||
ENGINE *ENGINE_get_default_RSA(void);
|
||||
/* Same for the other "methods" */
|
||||
ENGINE *ENGINE_get_default_DSA(void);
|
||||
ENGINE *ENGINE_get_default_DH(void);
|
||||
ENGINE *ENGINE_get_default_RAND(void);
|
||||
ENGINE *ENGINE_get_default_BN_mod_exp(void);
|
||||
ENGINE *ENGINE_get_default_BN_mod_exp_crt(void);
|
||||
|
||||
/* This sets a new default ENGINE structure for performing RSA
|
||||
* operations. If the result is non-zero (success) then the ENGINE
|
||||
* structure will have had its reference count up'd so the caller
|
||||
* should still free their own reference 'e'. */
|
||||
int ENGINE_set_default_RSA(ENGINE *e);
|
||||
/* Same for the other "methods" */
|
||||
int ENGINE_set_default_DSA(ENGINE *e);
|
||||
int ENGINE_set_default_DH(ENGINE *e);
|
||||
int ENGINE_set_default_RAND(ENGINE *e);
|
||||
int ENGINE_set_default_BN_mod_exp(ENGINE *e);
|
||||
int ENGINE_set_default_BN_mod_exp_crt(ENGINE *e);
|
||||
|
||||
/* The combination "set" - the flags are bitwise "OR"d from the
|
||||
* ENGINE_METHOD_*** defines above. */
|
||||
int ENGINE_set_default(ENGINE *e, unsigned int flags);
|
||||
|
||||
/* Obligatory error function. */
|
||||
void ERR_load_ENGINE_strings(void);
|
||||
|
||||
/*
|
||||
* Error codes for all engine functions. NB: We use "generic"
|
||||
* function names instead of per-implementation ones because this
|
||||
* levels the playing field for externally implemented bootstrapped
|
||||
* support code. As the filename and line number is included, it's
|
||||
* more important to indicate the type of function, so that
|
||||
* bootstrapped code (that can't easily add its own errors in) can
|
||||
* use the same error codes too.
|
||||
*/
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
|
||||
/* Error codes for the ENGINE functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define ENGINE_F_ATALLA_FINISH 135
|
||||
#define ENGINE_F_ATALLA_INIT 136
|
||||
#define ENGINE_F_ATALLA_MOD_EXP 137
|
||||
#define ENGINE_F_ATALLA_RSA_MOD_EXP 138
|
||||
#define ENGINE_F_CSWIFT_DSA_SIGN 133
|
||||
#define ENGINE_F_CSWIFT_DSA_VERIFY 134
|
||||
#define ENGINE_F_CSWIFT_FINISH 100
|
||||
#define ENGINE_F_CSWIFT_INIT 101
|
||||
#define ENGINE_F_CSWIFT_MOD_EXP 102
|
||||
#define ENGINE_F_CSWIFT_MOD_EXP_CRT 103
|
||||
#define ENGINE_F_CSWIFT_RSA_MOD_EXP 104
|
||||
#define ENGINE_F_ENGINE_ADD 105
|
||||
#define ENGINE_F_ENGINE_BY_ID 106
|
||||
#define ENGINE_F_ENGINE_CTRL 142
|
||||
#define ENGINE_F_ENGINE_FINISH 107
|
||||
#define ENGINE_F_ENGINE_FREE 108
|
||||
#define ENGINE_F_ENGINE_GET_BN_MOD_EXP 109
|
||||
#define ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT 110
|
||||
#define ENGINE_F_ENGINE_GET_CTRL_FUNCTION 144
|
||||
#define ENGINE_F_ENGINE_GET_DH 111
|
||||
#define ENGINE_F_ENGINE_GET_DSA 112
|
||||
#define ENGINE_F_ENGINE_GET_FINISH_FUNCTION 145
|
||||
#define ENGINE_F_ENGINE_GET_ID 113
|
||||
#define ENGINE_F_ENGINE_GET_INIT_FUNCTION 146
|
||||
#define ENGINE_F_ENGINE_GET_NAME 114
|
||||
#define ENGINE_F_ENGINE_GET_NEXT 115
|
||||
#define ENGINE_F_ENGINE_GET_PREV 116
|
||||
#define ENGINE_F_ENGINE_GET_RAND 117
|
||||
#define ENGINE_F_ENGINE_GET_RSA 118
|
||||
#define ENGINE_F_ENGINE_INIT 119
|
||||
#define ENGINE_F_ENGINE_LIST_ADD 120
|
||||
#define ENGINE_F_ENGINE_LIST_REMOVE 121
|
||||
#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
|
||||
#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
|
||||
#define ENGINE_F_ENGINE_NEW 122
|
||||
#define ENGINE_F_ENGINE_REMOVE 123
|
||||
#define ENGINE_F_ENGINE_SET_BN_MOD_EXP 124
|
||||
#define ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT 125
|
||||
#define ENGINE_F_ENGINE_SET_CTRL_FUNCTION 147
|
||||
#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
|
||||
#define ENGINE_F_ENGINE_SET_DH 127
|
||||
#define ENGINE_F_ENGINE_SET_DSA 128
|
||||
#define ENGINE_F_ENGINE_SET_FINISH_FUNCTION 148
|
||||
#define ENGINE_F_ENGINE_SET_ID 129
|
||||
#define ENGINE_F_ENGINE_SET_INIT_FUNCTION 149
|
||||
#define ENGINE_F_ENGINE_SET_NAME 130
|
||||
#define ENGINE_F_ENGINE_SET_RAND 131
|
||||
#define ENGINE_F_ENGINE_SET_RSA 132
|
||||
#define ENGINE_F_ENGINE_UNLOAD_KEY 152
|
||||
#define ENGINE_F_HWCRHK_CTRL 143
|
||||
#define ENGINE_F_HWCRHK_FINISH 135
|
||||
#define ENGINE_F_HWCRHK_GET_PASS 155
|
||||
#define ENGINE_F_HWCRHK_INIT 136
|
||||
#define ENGINE_F_HWCRHK_LOAD_PRIVKEY 153
|
||||
#define ENGINE_F_HWCRHK_LOAD_PUBKEY 154
|
||||
#define ENGINE_F_HWCRHK_MOD_EXP 137
|
||||
#define ENGINE_F_HWCRHK_MOD_EXP_CRT 138
|
||||
#define ENGINE_F_HWCRHK_RAND_BYTES 139
|
||||
#define ENGINE_F_HWCRHK_RSA_MOD_EXP 140
|
||||
#define ENGINE_F_LOG_MESSAGE 141
|
||||
|
||||
/* Reason codes. */
|
||||
#define ENGINE_R_ALREADY_LOADED 100
|
||||
#define ENGINE_R_BIO_WAS_FREED 121
|
||||
#define ENGINE_R_BN_CTX_FULL 101
|
||||
#define ENGINE_R_BN_EXPAND_FAIL 102
|
||||
#define ENGINE_R_CHIL_ERROR 123
|
||||
#define ENGINE_R_CONFLICTING_ENGINE_ID 103
|
||||
#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
|
||||
#define ENGINE_R_DSO_FAILURE 104
|
||||
#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
|
||||
#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
|
||||
#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
|
||||
#define ENGINE_R_FINISH_FAILED 106
|
||||
#define ENGINE_R_GET_HANDLE_FAILED 107
|
||||
#define ENGINE_R_ID_OR_NAME_MISSING 108
|
||||
#define ENGINE_R_INIT_FAILED 109
|
||||
#define ENGINE_R_INTERNAL_LIST_ERROR 110
|
||||
#define ENGINE_R_MISSING_KEY_COMPONENTS 111
|
||||
#define ENGINE_R_NOT_INITIALISED 117
|
||||
#define ENGINE_R_NOT_LOADED 112
|
||||
#define ENGINE_R_NO_CALLBACK 127
|
||||
#define ENGINE_R_NO_CONTROL_FUNCTION 120
|
||||
#define ENGINE_R_NO_KEY 124
|
||||
#define ENGINE_R_NO_LOAD_FUNCTION 125
|
||||
#define ENGINE_R_NO_REFERENCE 130
|
||||
#define ENGINE_R_NO_SUCH_ENGINE 116
|
||||
#define ENGINE_R_NO_UNLOAD_FUNCTION 126
|
||||
#define ENGINE_R_PROVIDE_PARAMETERS 113
|
||||
#define ENGINE_R_REQUEST_FAILED 114
|
||||
#define ENGINE_R_REQUEST_FALLBACK 118
|
||||
#define ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL 122
|
||||
#define ENGINE_R_UNIT_FAILURE 115
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
183
crypto/engine/engine_err.c
Normal file
183
crypto/engine/engine_err.c
Normal file
@@ -0,0 +1,183 @@
|
||||
/* crypto/engine/engine_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 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
|
||||
* openssl-core@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).
|
||||
*
|
||||
*/
|
||||
|
||||
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
|
||||
* made to it will be overwritten when the script next updates this file,
|
||||
* only reason strings will be preserved.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef NO_ERR
|
||||
static ERR_STRING_DATA ENGINE_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,ENGINE_F_ATALLA_FINISH,0), "ATALLA_FINISH"},
|
||||
{ERR_PACK(0,ENGINE_F_ATALLA_INIT,0), "ATALLA_INIT"},
|
||||
{ERR_PACK(0,ENGINE_F_ATALLA_MOD_EXP,0), "ATALLA_MOD_EXP"},
|
||||
{ERR_PACK(0,ENGINE_F_ATALLA_RSA_MOD_EXP,0), "ATALLA_RSA_MOD_EXP"},
|
||||
{ERR_PACK(0,ENGINE_F_CSWIFT_DSA_SIGN,0), "CSWIFT_DSA_SIGN"},
|
||||
{ERR_PACK(0,ENGINE_F_CSWIFT_DSA_VERIFY,0), "CSWIFT_DSA_VERIFY"},
|
||||
{ERR_PACK(0,ENGINE_F_CSWIFT_FINISH,0), "CSWIFT_FINISH"},
|
||||
{ERR_PACK(0,ENGINE_F_CSWIFT_INIT,0), "CSWIFT_INIT"},
|
||||
{ERR_PACK(0,ENGINE_F_CSWIFT_MOD_EXP,0), "CSWIFT_MOD_EXP"},
|
||||
{ERR_PACK(0,ENGINE_F_CSWIFT_MOD_EXP_CRT,0), "CSWIFT_MOD_EXP_CRT"},
|
||||
{ERR_PACK(0,ENGINE_F_CSWIFT_RSA_MOD_EXP,0), "CSWIFT_RSA_MOD_EXP"},
|
||||
{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_CTRL,0), "ENGINE_ctrl"},
|
||||
{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_BN_MOD_EXP,0), "ENGINE_get_BN_mod_exp"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT,0), "ENGINE_get_BN_mod_exp_crt"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_CTRL_FUNCTION,0), "ENGINE_get_ctrl_function"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_DH,0), "ENGINE_get_DH"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_DSA,0), "ENGINE_get_DSA"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_FINISH_FUNCTION,0), "ENGINE_get_finish_function"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_ID,0), "ENGINE_get_id"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_INIT_FUNCTION,0), "ENGINE_get_init_function"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_NAME,0), "ENGINE_get_name"},
|
||||
{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_GET_RAND,0), "ENGINE_get_RAND"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_GET_RSA,0), "ENGINE_get_RSA"},
|
||||
{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_NEW,0), "ENGINE_new"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_REMOVE,0), "ENGINE_remove"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_BN_MOD_EXP,0), "ENGINE_set_BN_mod_exp"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT,0), "ENGINE_set_BN_mod_exp_crt"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_CTRL_FUNCTION,0), "ENGINE_set_ctrl_function"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DEFAULT_TYPE,0), "ENGINE_SET_DEFAULT_TYPE"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DH,0), "ENGINE_set_DH"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DSA,0), "ENGINE_set_DSA"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_FINISH_FUNCTION,0), "ENGINE_set_finish_function"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_ID,0), "ENGINE_set_id"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_INIT_FUNCTION,0), "ENGINE_set_init_function"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_NAME,0), "ENGINE_set_name"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_RAND,0), "ENGINE_set_RAND"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_SET_RSA,0), "ENGINE_set_RSA"},
|
||||
{ERR_PACK(0,ENGINE_F_ENGINE_UNLOAD_KEY,0), "ENGINE_UNLOAD_KEY"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_CTRL,0), "HWCRHK_CTRL"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_FINISH,0), "HWCRHK_FINISH"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_GET_PASS,0), "HWCRHK_GET_PASS"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_INIT,0), "HWCRHK_INIT"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_LOAD_PRIVKEY,0), "HWCRHK_LOAD_PRIVKEY"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_LOAD_PUBKEY,0), "HWCRHK_LOAD_PUBKEY"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP,0), "HWCRHK_MOD_EXP"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP_CRT,0), "HWCRHK_MOD_EXP_CRT"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_RAND_BYTES,0), "HWCRHK_RAND_BYTES"},
|
||||
{ERR_PACK(0,ENGINE_F_HWCRHK_RSA_MOD_EXP,0), "HWCRHK_RSA_MOD_EXP"},
|
||||
{ERR_PACK(0,ENGINE_F_LOG_MESSAGE,0), "LOG_MESSAGE"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA ENGINE_str_reasons[]=
|
||||
{
|
||||
{ENGINE_R_ALREADY_LOADED ,"already loaded"},
|
||||
{ENGINE_R_BIO_WAS_FREED ,"bio was freed"},
|
||||
{ENGINE_R_BN_CTX_FULL ,"BN_CTX full"},
|
||||
{ENGINE_R_BN_EXPAND_FAIL ,"bn_expand fail"},
|
||||
{ENGINE_R_CHIL_ERROR ,"chil error"},
|
||||
{ENGINE_R_CONFLICTING_ENGINE_ID ,"conflicting engine id"},
|
||||
{ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"},
|
||||
{ENGINE_R_DSO_FAILURE ,"DSO failure"},
|
||||
{ENGINE_R_ENGINE_IS_NOT_IN_LIST ,"engine is not in the list"},
|
||||
{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_MISSING_KEY_COMPONENTS ,"missing key components"},
|
||||
{ENGINE_R_NOT_INITIALISED ,"not initialised"},
|
||||
{ENGINE_R_NOT_LOADED ,"not loaded"},
|
||||
{ENGINE_R_NO_CALLBACK ,"no callback"},
|
||||
{ENGINE_R_NO_CONTROL_FUNCTION ,"no control function"},
|
||||
{ENGINE_R_NO_KEY ,"no key"},
|
||||
{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_REQUEST_FAILED ,"request failed"},
|
||||
{ENGINE_R_REQUEST_FALLBACK ,"request fallback"},
|
||||
{ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"},
|
||||
{ENGINE_R_UNIT_FAILURE ,"unit failure"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
void ERR_load_ENGINE_strings(void)
|
||||
{
|
||||
static int init=1;
|
||||
|
||||
if (init)
|
||||
{
|
||||
init=0;
|
||||
#ifndef NO_ERR
|
||||
ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_functs);
|
||||
ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_reasons);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
160
crypto/engine/engine_int.h
Normal file
160
crypto/engine/engine_int.h
Normal file
@@ -0,0 +1,160 @@
|
||||
/* crypto/engine/engine_int.h */
|
||||
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
|
||||
* project 2000.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 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).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ENGINE_INT_H
|
||||
#define HEADER_ENGINE_INT_H
|
||||
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Bitwise OR-able values for the "flags" variable in ENGINE. */
|
||||
#define ENGINE_FLAGS_MALLOCED 0x0001
|
||||
|
||||
#ifndef HEADER_ENGINE_H
|
||||
/* Regrettably, we need to reproduce the "BN" function types here
|
||||
* because there is no such "BIGNUM_METHOD" as there is with RSA,
|
||||
* DSA, etc. We do this so that we don't have a case where engine.h
|
||||
* and engine_int.h conflict with each other. */
|
||||
typedef int (*BN_MOD_EXP)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
|
||||
/* private key operation for RSA, provided seperately in case other
|
||||
* RSA implementations wish to use it. */
|
||||
typedef int (*BN_MOD_EXP_CRT)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
|
||||
const BIGNUM *iqmp, BN_CTX *ctx);
|
||||
|
||||
/* Generic function pointer */
|
||||
typedef int (*ENGINE_GEN_FUNC_PTR)();
|
||||
/* Generic function pointer taking no arguments */
|
||||
typedef int (*ENGINE_GEN_INT_FUNC_PTR)(void);
|
||||
/* Specific control function pointer */
|
||||
typedef int (*ENGINE_CTRL_FUNC_PTR)(int cmd, long i, void *p, void (*f)());
|
||||
|
||||
#endif
|
||||
|
||||
/* This is a structure for storing implementations of various crypto
|
||||
* algorithms and functions. */
|
||||
typedef struct engine_st
|
||||
{
|
||||
const char *id;
|
||||
const char *name;
|
||||
RSA_METHOD *rsa_meth;
|
||||
DSA_METHOD *dsa_meth;
|
||||
DH_METHOD *dh_meth;
|
||||
RAND_METHOD *rand_meth;
|
||||
BN_MOD_EXP bn_mod_exp;
|
||||
BN_MOD_EXP_CRT bn_mod_exp_crt;
|
||||
int (*init)(void);
|
||||
int (*finish)(void);
|
||||
int (*ctrl)(int cmd, long i, void *p, void (*f)());
|
||||
EVP_PKEY *(*load_privkey)(const char *key_id, const char *passphrase);
|
||||
EVP_PKEY *(*load_pubkey)(const char *key_id, const char *passphrase);
|
||||
int flags;
|
||||
/* reference count on the structure itself */
|
||||
int struct_ref;
|
||||
/* reference count on usability of the engine type. NB: This
|
||||
* controls the loading and initialisation of any functionlity
|
||||
* required by this engine, whereas the previous count is
|
||||
* simply to cope with (de)allocation of this structure. Hence,
|
||||
* running_ref <= struct_ref at all times. */
|
||||
int funct_ref;
|
||||
/* Used to maintain the linked-list of engines. */
|
||||
struct engine_st *prev;
|
||||
struct engine_st *next;
|
||||
} ENGINE;
|
||||
|
||||
/* BUILT-IN ENGINES. (these functions are only ever called once and
|
||||
* do not return references - they are purely for bootstrapping). */
|
||||
|
||||
/* Returns a structure of software only methods (the default). */
|
||||
ENGINE *ENGINE_openssl();
|
||||
|
||||
#ifndef NO_HW
|
||||
|
||||
#ifndef NO_HW_CSWIFT
|
||||
/* Returns a structure of cswift methods ... NB: This can exist and be
|
||||
* "used" even on non-cswift systems because the "init" will fail if the
|
||||
* card/library are not found. */
|
||||
ENGINE *ENGINE_cswift();
|
||||
#endif /* !NO_HW_CSWIFT */
|
||||
|
||||
#ifndef NO_HW_NCIPHER
|
||||
ENGINE *ENGINE_ncipher();
|
||||
#endif /* !NO_HW_NCIPHER */
|
||||
|
||||
#ifndef NO_HW_ATALLA
|
||||
/* Returns a structure of atalla methods. */
|
||||
ENGINE *ENGINE_atalla();
|
||||
#endif /* !NO_HW_ATALLA */
|
||||
|
||||
#endif /* !NO_HW */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_ENGINE_INT_H */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user