Compare commits

..

292 Commits

Author SHA1 Message Date
Richard Levitte
483c4e0682 Add security patch and create release.
Tags will be OpenSSL_0_9_6b and OpenSSL-engine-0_9_6b
2001-07-09 14:36:30 +00:00
Richard Levitte
de61328615 make update 2001-07-05 12:28:13 +00:00
Bodo Möller
731e14031c Andy's mips3.s fix (as in main branch). 2001-07-04 20:17:52 +00:00
Lutz Jänicke
93074b2509 When only the key is given to "enc", the IV is undefined
(found by Andy Brown <logic@warthog.com>).
2001-07-03 10:32:30 +00:00
Dr. Stephen Henson
1498ad74bb Another empty X509_NAME fix. 2001-06-26 12:38:33 +00:00
Dr. Stephen Henson
e319a89f84 Handle empty X509_NAME in printing routines. 2001-06-26 12:04:12 +00:00
Bodo Möller
9fa5786340 DSA verification should insist that r and s are in the allowed range. 2001-06-26 09:48:56 +00:00
Dr. Stephen Henson
1b822decb8 Don't set *pointer if add_lock_callback used. 2001-06-19 00:09:20 +00:00
Bodo Möller
dab4c2824f pay attention to blocksize before attempting decryption 2001-06-15 18:06:06 +00:00
Ulf Möller
19352b794d as in head 2001-06-08 14:17:12 +00:00
Lutz Jänicke
8746ee311e ERR_peek_error() returns "unsigned long". 2001-06-07 17:22:01 +00:00
Richard Levitte
e90323844f Use memmove() instead of memcpy() on areas that may overlap.
Spotted by Nalin Dahyabhai <nalin@redhat.com>
2001-06-07 04:45:55 +00:00
Bodo Möller
630c1aedd2 OAEP fix 2001-06-06 21:44:48 +00:00
Bodo Möller
a650df440b when checking OAEP, signal just a single kind of 'decoding error' 2001-06-06 18:48:57 +00:00
Ulf Möller
afd7b5affe as in head 2001-06-06 17:24:03 +00:00
Ulf Möller
38c3436577 make sure we don't write to seed[-1] 2001-06-06 17:15:47 +00:00
Richard Levitte
7e9547e126 Accept digits in symbol names. Spotted by Brian Havard <brianh@kheldar.apana.org.au> 2001-06-04 16:34:39 +00:00
Bodo Möller
83583e9479 Fix Bleichenbacher PKCS #1 1.5 countermeasure.
(The attack against SSL 3.1 and TLS 1.0 is impractical anyway,
otherwise this would be a security relevant patch.)
2001-06-01 09:43:23 +00:00
Bodo Möller
41d208db79 increase DEFAULT_BUFFER_SIZE (4K instead of just 1K) 2001-06-01 08:39:02 +00:00
Richard Levitte
9a1c40049e From revision 1.25, 2001/05/31 22:25:30 by levitte
Don't decrement the reference counter twice when destroying dynamic
links.
2001-06-01 05:36:44 +00:00
Dr. Stephen Henson
39bed15e53 Add missing variable length cipher flag for Blowfish.
Only use trust settings if either trust or reject settings
are present, otherwise use compatibility mode. This stops
root CAs being rejected if they have alias of keyid set.
2001-05-24 23:00:46 +00:00
Dr. Stephen Henson
4b04466f14 Fix for missing DSA parameters. 2001-05-24 22:33:16 +00:00
Richard Levitte
2474b596ad VMS doesn't support more than on period in a file name 2001-05-22 12:48:14 +00:00
Richard Levitte
a890c4e9bb Add development tools to the requirements 2001-05-17 05:03:47 +00:00
Lutz Jänicke
c62ddfbb6e Add missing item SSL_ERROR_WANT_CONNECT. 2001-05-16 09:46:47 +00:00
Lutz Jänicke
8b9351cf61 Typos. 2001-05-14 09:57:03 +00:00
Lutz Jänicke
b23f1df65f One more point to clarify, pointed out by "Greg Stark" <ghstark@pobox.com> 2001-05-14 09:03:35 +00:00
Lutz Jänicke
f05735c8c9 Clarify behaviour with respect to SSL/TLS records. 2001-05-12 09:49:46 +00:00
Lutz Jänicke
42f310f596 Clarify behaviour of SSL_write() by mentioning SSL_MODE_ENABLE_PARTIAL_WRITE
flag as discussed on the mailing list.
2001-05-11 09:54:20 +00:00
Bodo Möller
77c6edc1d1 fix an old entry 2001-05-08 12:46:33 +00:00
Bodo Möller
99bd4baa54 .rnd issues 2001-05-03 09:28:19 +00:00
Bodo Möller
c8913d8e8a bctest changes for Ultrix (don't return 1 from bctest, otherwise make aborts) 2001-05-03 08:50:32 +00:00
Richard Levitte
3c836ff0f8 Some platforms (most notably Windows) do not have a $HOME by default.
For those, unless the environment variables RANDFILE or HOME are
defined (the default case!), RAND_file_name() will return NULL.
This change adds a default HOME for those platforms.

To add a default HOME for any platform, just define DEFAULT_HOME in
the proper place, wrapped in appropriate #ifdef..#endif, in e_os.h.
2001-05-03 07:50:39 +00:00
Richard Levitte
a956392145 Add support for Sun C on Solaris x86. Contributed by Ben <mouring@etoh.eviladmin.org> 2001-05-03 06:15:05 +00:00
Richard Levitte
4760dc31c9 Merge in the following changes (from the main trunk log):
>----------------------------
>revision 1.24
>date: 2001/04/29 16:30:59;  author: steve;  state: Exp;  lines: +5 -1
>Win32 fixes:
>
>define LLONG properly for VC++.
>
>stop compiler complaining about signed/unsigned mismatch in apps/engine.c
>----------------------------
>revision 1.22
>date: 2001/02/27 23:59:18;  author: ulf;  state: Exp;  lines: +1 -1
>%f conversion bug fix
>Submitted by: Henrik Eriksson <henrik.eriksson@axis.com>
>----------------------------
>revision 1.21
>date: 2000/10/22 12:44:12;  author: levitte;  state: Exp;  lines: +3 -3
>On some operating systems, MAX is defined.  Call ours OSSL_MAX instead
2001-05-02 07:10:42 +00:00
Lutz Jänicke
5fde80cd56 Typo (Petr Lancaric <Petr.Lancaric@ips-ag.cz>). 2001-04-25 15:25:39 +00:00
Bodo Möller
ecacb136c5 typo 2001-04-18 15:12:26 +00:00
Bodo Möller
db17ecdae3 fix md_rand.c locking bugs 2001-04-18 15:08:19 +00:00
Lutz Jänicke
ee718b2c22 Clarify request of client certificates. This is a FAQ. 2001-04-17 13:20:05 +00:00
Lutz Jänicke
514481f686 -1 cannot work on platforms with unsigned char
(Jun-ichiro itojun Hagino <itojun@iijlab.net>).
2001-04-15 10:30:01 +00:00
Lutz Jänicke
b089e64654 Don't make half work when constifying... 2001-04-14 14:48:44 +00:00
Lutz Jänicke
3c1f0ccbf4 Constify "salt" (Jason Molenda <jason@molenda.com>) 2001-04-14 14:42:28 +00:00
Lutz Jänicke
c5e00a3ee2 Missing link ("Greg Stark" <gstark@ethentica.com>) 2001-04-12 21:12:30 +00:00
Lutz Jänicke
26c329cd84 Fix wrong information with respect to CAs listed to the client
(follows from technical discussion with Amit Chopra <amitc@pspl.co.in>).
2001-04-12 16:03:28 +00:00
Bodo Möller
d349c5f8fd some updates from 0.9.7-dev 2001-04-12 12:09:07 +00:00
Lutz Jänicke
3a11466381 Typo (Jun-ichiro itojun Hagino <itojun@iijlab.net>) 2001-04-12 11:46:23 +00:00
Richard Levitte
5c4c4c2b90 The changes that I just commited on this file is a mistake. Go back. This never happened :-) 2001-04-11 10:12:13 +00:00
Richard Levitte
ec11fa2159 NetBSD and OpenBSD use TOD as well 2001-04-11 10:06:44 +00:00
Lutz Jänicke
c4365acc48 Typo (was already fixed in 0.9.7-dev). 2001-04-09 15:00:31 +00:00
Lutz Jänicke
c29dbb9562 Add forgotten "-passin" option to smime.c usage help. 2001-04-08 10:53:27 +00:00
Richard Levitte
cb1c1555fa A small change that only went to the engine-0.9.6 branch...
This change will be part of 0.9.6a.
2001-04-05 21:08:33 +00:00
Richard Levitte
fa528639e3 Tagging has been done, move on to development of 0.9.6b.
(Hopefully, it will never be needed)
2001-04-05 17:59:14 +00:00
Richard Levitte
092ab05aef Forgot to update the STATUS file. This will be part of 0.9.6a 2001-04-05 17:42:00 +00:00
Richard Levitte
4f647957c5 Release OpenSSL 0.9.6a.
The tag will be OpenSSL_0_9_6a
2001-04-05 16:43:07 +00:00
Richard Levitte
4424a12c43 make update 2001-04-05 16:36:00 +00:00
Dr. Stephen Henson
592f5c5797 Fix couple of memory leaks in PKCS7_dataDecode(). 2001-04-04 22:30:26 +00:00
Ulf Möller
14ba311676 Unixware config.
Submitted by: Tim Rice <tim@multitalents.net>
2001-04-04 19:20:33 +00:00
Bodo Möller
b9a96c0134 don't use shell functions 2001-04-04 16:27:44 +00:00
Richard Levitte
75c3c831db Incorporate some changes that make OpenSSL compilable in CygWin. 2001-04-04 15:51:36 +00:00
Richard Levitte
385af2e9ec We're still just developping beta4 (or final release) 2001-04-04 04:30:39 +00:00
Richard Levitte
3c43aa1b82 Make do_bsd-gcc-shared depend on do_gnu-shared instead of the non-existent linux-shared 2001-04-04 04:24:35 +00:00
Bodo Möller
dea0f7dd0d As in the main branch, ignore the bctest exit value.
(I thought I had done this change before ...)
2001-04-03 15:20:22 +00:00
Bodo Möller
9a22ce66c9 This change should be suitable as a workaround for the Solaris x86
compiler bug reported in <01032110293775.22278@weba3.iname.net>
(the '++seq[i]' condition is evaluated as 256 rather than 0
when the previous value is 255).
2001-04-03 13:46:36 +00:00
Richard Levitte
72cd659df6 Plug a memory leak. Spotted by "Shijin" <shijin@comex.com> 2001-04-03 09:42:49 +00:00
Richard Levitte
58eef36b4d libfisdef.h and LIB do not exist on older VMS versions 2001-04-03 08:31:45 +00:00
Richard Levitte
79311176b2 Remove a typo in dgux-R4-gcc. 2001-04-03 08:27:53 +00:00
Richard Levitte
88f59f6152 Compaq C on OpenVMS is a little picky around producing empty object
files...
2001-04-02 09:10:59 +00:00
Bodo Möller
e32578847c avoid buffer overflow 2001-03-31 07:47:32 +00:00
Ulf Möller
323fd27435 Note that alpha.s is no longer used. 2001-03-31 01:19:42 +00:00
Richard Levitte
fcc88e4915 Tagging has been done, move on to develop beta 4 (hopefully not :-)). 2001-03-30 16:22:44 +00:00
Richard Levitte
86cb01870c make update 2001-03-30 15:59:57 +00:00
Bodo Möller
19086ef67b this time *really* fix the /../ check ... 2001-03-30 14:55:19 +00:00
Dr. Stephen Henson
ce3fc3956d Fix asn1_GetSequence() for indefinite length sequences. 2001-03-30 13:42:32 +00:00
Richard Levitte
787f25ab42 Release beta 3 of OpenSSL 0.9.6a.
The tag will be OpenSSL_0_9_6a-beta3.
2001-03-30 12:21:28 +00:00
Bodo Möller
85794e5556 Remove unused variable 'prev_slash' that I accidentily added. 2001-03-30 10:50:27 +00:00
Bodo Möller
7f950bd8a2 For -WWW, fix test for ".." directory references (and avoid warning for
index -1).
2001-03-30 10:47:56 +00:00
Bodo Möller
bf7b0d2d2b News for 0.9.6a. 2001-03-30 10:46:49 +00:00
Bodo Möller
83c4e75be9 Use enhanced bctest (as in main trunk), and add a workaround that
should solve the problems with FreeBSD's /bin/sh.
2001-03-30 09:23:14 +00:00
Richard Levitte
e5f3be2bbb Additionally, rename des_encrypt to des_encrypt1 in files that are
seldom used or read, but may still be...
2001-03-30 07:26:04 +00:00
Dr. Stephen Henson
fbca4281c8 Change des_encrypt to des_encrypt1 in assembly language perl
scripts and des_opts #defines.
2001-03-30 02:14:29 +00:00
Dr. Stephen Henson
a858b8036c Fix a bug caused by the 'fix' for empty X509_NAME encoding. 2001-03-30 00:58:49 +00:00
Richard Levitte
d2be2fb241 Merge in the latest news 2001-03-29 20:58:18 +00:00
Richard Levitte
4855eb75a7 One des_encrypt to des_encrypt1 I forgot to commit... 2001-03-29 20:37:32 +00:00
Richard Levitte
b1f88ec4e2 I forgot to rename des_encrypt to des_encrypt1 in libeay.num. 2001-03-29 10:49:01 +00:00
Richard Levitte
44924fb2b4 Since there has been reports of clashes between OpenSSL's
des_encrypt() and des_encrypt() defined on some systems (Solaris and
Unixware and maybe others), we rename des_encrypt() to des_encrypt1().
This should have very little impact on external software unless
someone has written a mode of DES, since that's all des_encrypt() is
meant for.
2001-03-29 07:45:01 +00:00
Richard Levitte
0e810cf6b0 Add news section for OpenSSL 0.9.6a. Please add what's missing 2001-03-28 13:35:48 +00:00
Ulf Möller
1777e3fd5e check the CRT result. 2001-03-28 04:49:39 +00:00
Ulf Möller
509ca689b0 Note the MIPS assembler bug fix. 2001-03-28 02:39:22 +00:00
Richard Levitte
3a1dbce19d Merge in the IRIX fix from the main development line. 2001-03-27 23:48:35 +00:00
Richard Levitte
10f2bf6d81 Reports seem to show that asm/mips3.s has faults. To be investigated, but let's avoid using it in the mean time 2001-03-27 09:12:51 +00:00
Richard Levitte
1714c07164 For mips3 and alpha, put the assembler file directives in separate
variables and disable the Alpha assembler for now, since it has been
shown to fail.

The Alpha failure can be shown by adding the following numbers:

FFFFFFFFFFFFFF0000FF2E00000000EBFFFFFF0000D1
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46FFE0FFFF0000

The result is:

1FFFFFFFFFFFEFF0000FF2E0000000032FFE0FEFF00D1

The result should really be:

1FFFFFFFFFFFFFF0000FF2E0000000032FFE0FEFF00D1
2001-03-26 16:26:41 +00:00
Richard Levitte
4cc3d1728f make update 2001-03-24 12:45:11 +00:00
Richard Levitte
3ae82255a9 Bring in the following changes:
ln on Solaris expects -f to come before -s.
The linux-shared method is actually gcc-specific, so call it
gnu-shared as well.

When using the native tools on Solaris, make damn sure the native ld
is used, even if the user has GNU ld earlier in his $PATH.
2001-03-24 12:37:32 +00:00
Richard Levitte
9bcab53f49 Bring in the following change:
gcc uses collect2, not ld, to link things.  Therefore, when using gcc
there's no need fooling ourselves, it's the gnu-shared method that we
should use.  Do it for Solaris to begin with.
2001-03-24 12:35:41 +00:00
Richard Levitte
ae17135ab5 Bring in the rest of the corrections for shared libraries from the
main trunk.
2001-03-24 12:26:03 +00:00
Richard Levitte
1f6b757ae9 For AIX 4.3 or above, allow the use of dlfcn. 2001-03-22 22:06:27 +00:00
Richard Levitte
a496f45f22 We really have no need for PEX_LIBS, so empty it. 2001-03-22 21:21:09 +00:00
Dr. Stephen Henson
3485cdb98e Oops... fix PKCS#7 bug properly this time. 2001-03-22 18:03:22 +00:00
Lutz Jänicke
3e3f04d4b7 Fix error caused by typo (len->strlen) and warning caused by long<->int
for HP-UX shl_* (32bit dynamic loading) interface.
2001-03-22 15:52:26 +00:00
Bodo Möller
879d230da3 solaris64-sparcv9-cc still works 2001-03-22 15:15:58 +00:00
Bodo Möller
2006dd12d6 Add missing '#ifndef NO_DSA'.
Submitted by: "Hellan,Kim KHE" <KHE@kmd.dk>
2001-03-22 15:13:43 +00:00
Bodo Möller
744b9066e2 Add missing '#ifndef NO_DSA'.
Submitted by: "Hellan,Kim KHE" <KHE@kmd.dk>
2001-03-22 15:05:23 +00:00
Bodo Möller
1e01dbfbb2 backport the comment (here it's NO_DH, not OPENSSL_NO_DH ...) 2001-03-22 15:00:45 +00:00
Bodo Möller
6ebcd441d6 Avoid compiler warning for NO_DH as in the main trunk. 2001-03-22 14:59:18 +00:00
Bodo Möller
ea09a504ef Add another "[This change does not apply to 0.9.7.]" line so
that we can combine the CHANGES files later on.
2001-03-22 14:56:55 +00:00
Richard Levitte
2e3b3c7be5 Got one positive report. 2001-03-22 14:56:04 +00:00
Richard Levitte
93389c86ca Remove redundant operations and update version info. 2001-03-22 14:42:24 +00:00
Dr. Stephen Henson
8d82218269 Fix bug in PKCS#7 decode routines when indefinite length
encoding is used inside definite length encoding.
2001-03-22 13:49:15 +00:00
Bodo Möller
a8e738f9ad Harmonize CHANGES and STATUS files between the 0.9.6a branch and
the trunk to keep diffs small.
2001-03-22 10:59:18 +00:00
Bodo Möller
bdcb9321ca The latest beta release is "2", not another "1" ... 2001-03-22 09:02:38 +00:00
Bodo Möller
d239b734e1 Avoid warning 2001-03-22 08:39:03 +00:00
Richard Levitte
d91722f8e0 Update the status. 2001-03-21 23:14:03 +00:00
Richard Levitte
b6282a2004 Tagging has been done (OpenSSL_0_9_6a-beta2), time to move on. 2001-03-21 20:54:52 +00:00
Richard Levitte
f14aa30118 Release OpenSSL 0.9.6a beta2. 2001-03-21 20:37:47 +00:00
Richard Levitte
a4c1a7e317 make update 2001-03-21 19:30:39 +00:00
Richard Levitte
b222cf0624 Since site_t is used, there's no more need to cast to int. 2001-03-21 18:39:43 +00:00
Bodo Möller
68b08abb14 Make sure the size_t declaration is available. 2001-03-21 15:30:28 +00:00
Bodo Möller
cee3fffab5 Turn 'num' argument to RAND_file_name into a size_t (rather than an int). 2001-03-21 15:26:47 +00:00
Richard Levitte
d1d8608464 Change from main development line, 2001-03-20 16:36 levitte
avoid linking problems when OpenSSL is built with no-dsa.
Spotted by Hellan,Kim KHE <khe@kmd.dk>
2001-03-21 14:18:06 +00:00
Richard Levitte
19d2a20a7f Change from main development line, 2001-03-18 15:24 levitte
New cofiguration for Unixwre and SCO,with slightly better granularity.
Contributed by Tim Rice <tim@multitalents.net>
2001-03-21 14:10:50 +00:00
Dr. Stephen Henson
0bf5d40787 Fix PKCS#12 key generation bug. 2001-03-18 02:10:25 +00:00
Richard Levitte
757d479536 make update 2001-03-16 12:26:29 +00:00
Richard Levitte
74c9ace6f0 From revision 1.54, 2001-03-16 10:30 levitte:
Correct a typo which might have lead to a dump.
Noted by Martin Kraemer <Martin.Kraemer@Fujitsu-Siemens.com>
2001-03-16 10:39:38 +00:00
Richard Levitte
cfb8afc558 From revision 1.6, 2001-03-08 13:27 bodo:
Throw out *all* absolute pathnames, not matter what they look like.
The filenames we are interested in for Makefile dependencies are
always relative.
2001-03-16 09:46:09 +00:00
Richard Levitte
e8acf5c6f8 Success with Mingw32. 2001-03-15 22:11:54 +00:00
Richard Levitte
d5864a1dcb Minimise the amount of -L. when linking the shared libraries. It
seems like some Unixen (SCO) have opinions about too many -L.
2001-03-15 22:11:03 +00:00
Richard Levitte
9f56705f96 The change on handling shared libraries was never applied in
0.9.6a-dev...
2001-03-15 21:44:17 +00:00
Richard Levitte
7b5b22af5a Add status on a few fixes. 2001-03-15 20:53:03 +00:00
Richard Levitte
00ecca84a8 BSDI ELF knows dlfcn. 2001-03-15 20:36:19 +00:00
Lutz Jänicke
38c3b405c8 Forgot cvs commands, so only the surrounding changes made it... sigh. 2001-03-15 12:42:56 +00:00
cvs2svn
e486ec5e0e This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-03-15 12:42:06 +00:00
Bodo Möller
9f06ce19dd Error codes are longs, not ints 2001-03-15 11:33:16 +00:00
Bodo Möller
ba61b14f1d More err_data memory leaks 2001-03-15 11:33:00 +00:00
Richard Levitte
5114966e00 It is a good thing to prepare the .def files. 2001-03-15 06:51:49 +00:00
Richard Levitte
eed7dd8d75 A number of things have now been corrected.
HP MPE/iX passes.
2001-03-15 06:15:26 +00:00
Bodo Möller
70bddeda24 0.9.6a-beta1 works for solaris64-sparcv9-cc. 2001-03-14 13:44:59 +00:00
Richard Levitte
f66efab8f7 The VMS build script was missing a couple of modules.
Reported by Mark Daniel <Mark.Daniel@wasd.vsm.com.au>
2001-03-14 13:39:30 +00:00
Richard Levitte
0caa1c11f8 Include openssl/rand.h so RAND_status() gets properly declared.
Reported by Rob Neff <neff.ra@home.com>
2001-03-14 13:36:50 +00:00
Richard Levitte
c68f050647 Signed vs. unsigned problem fix.
Reported by Rob Neff <neff.ra@home.com>
2001-03-14 13:32:16 +00:00
Richard Levitte
d58eb72f25 On HP-UX 10, shareable libraries end with '.sl', not '.so'.
In part reported by Lynn Gazis <lgazis@IVEA.com>.  The rest of the
report is about SHLIB_PATH being ignored.  It was decided that using
it would break security.
2001-03-14 13:30:07 +00:00
Richard Levitte
11bfaf6cff Irix fails. 2001-03-14 07:00:57 +00:00
Richard Levitte
68a54ab591 A few more reports. 2001-03-14 06:57:16 +00:00
Bodo Möller
9693045170 Fix: return 0 if no error occured. 2001-03-13 22:17:45 +00:00
Richard Levitte
311e4e9253 Update beta 1 status. 2001-03-13 21:39:34 +00:00
Richard Levitte
1874366208 We need to build MINFO. 2001-03-13 21:28:44 +00:00
Richard Levitte
18c497dffb Tagging has now been done, switch over to development of beta 2.
The tag for beta 1 is OpenSSL_0_9_6a-beta1.
2001-03-13 16:29:03 +00:00
Richard Levitte
15922ccdf6 Release Beta 1 of 0.9.6a. 2001-03-13 16:08:32 +00:00
Richard Levitte
5098bc92f8 A correction from the main trunk that was forgotten. 2001-03-13 14:39:51 +00:00
Richard Levitte
a411eaa858 make update
Since there was some functions added in libeay.num, it means things
are going to move in libeay.num in the OpenSSL-engine-0_9_6-stable
branch and in the main trunk.
2001-03-13 12:12:05 +00:00
Ulf Möller
42b848bcf1 that was useless - still fails with GCC 2001-03-13 07:12:02 +00:00
Bodo Möller
b670b1e3da Use err_clear_data macro 2001-03-13 07:03:39 +00:00
Ulf Möller
a1c769a5f6 Alpha workaround. This is a lot slower! 2001-03-13 06:31:36 +00:00
Bodo Möller
2c89d56a1d fix memory leak in err.c 2001-03-12 18:39:47 +00:00
Ulf Möller
142e22641e doh 2001-03-10 04:29:05 +00:00
Bodo Möller
b9cc6148f4 Workaround for solaris64 linking problem (explicit "ar rs" is needed
to create a symbol table).

Sun patches such as 109147-06 probably fix this problem,
but we can easily avoid it.
2001-03-09 13:00:52 +00:00
Bodo Möller
c6a15854ee Consistently use 'void *' for SSL read, peek and write functions. 2001-03-09 10:08:06 +00:00
Bodo Möller
ba41d8a556 ssl23_peek 2001-03-08 21:56:34 +00:00
Bodo Möller
f46a878e3f add ssl23_peek 2001-03-08 21:53:29 +00:00
Bodo Möller
fac683684b Avoid problems with multi-line NAME sections. 2001-03-08 21:53:01 +00:00
Lutz Jänicke
f51fee66ad Add newly learned knowledge from yesterday's discussion. 2001-03-08 17:25:49 +00:00
Ulf Möller
5fb0aa6487 Note the rand_win.c change 2001-03-08 16:58:07 +00:00
Ulf Möller
9c3cbe5d7f replace rdtsc as in HEAD 2001-03-08 16:49:03 +00:00
Richard Levitte
3e0d891828 SSLv2 session reuse bugfix from main development branch. 2001-03-05 14:52:30 +00:00
Lutz Jänicke
1c85e93c7c Typo, spotted by "Greg Stark" <gstark@ethentica.com>. 2001-03-01 16:48:12 +00:00
Dr. Stephen Henson
95d334f2db Fix bug in copy_email() which would not
find emailAddress at start of subject name.
2001-03-01 13:33:53 +00:00
Ulf Möller
98486a9310 improved bignum test as in 0.9.7.
We need this to find out if the bignum failures on Irix and Alpha are
caused by new 0.9.7 code or just aren't triggered in the 0.9.6 test suite.
2001-02-27 23:00:42 +00:00
Geoff Thorpe
4910cbf6db Backfit a bugfix from 0.9.7-dev to 0.9.6-stable. init() and finish()
handlers were previously getting called before (and after, respectively)
the "ex_data" structures - this meant init() had very little that it
could initialise, and finish() had very little it could cleanup.
2001-02-24 17:32:34 +00:00
Dr. Stephen Henson
75090e0365 Stop PKCS7_verify() core dumping with unknown public
key algorithms and leaking if the signature verify
fails.
2001-02-24 01:46:46 +00:00
Lutz Jänicke
6676457bba SSL_get_version() was an easy one :-) 2001-02-23 21:07:53 +00:00
cvs2svn
ad45ed9f5c This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-23 21:05:58 +00:00
Bodo Möller
32828e6ffd include e_os.h as "openssl/e_os.h" (as elsewhere) 2001-02-22 14:59:11 +00:00
Ulf Möller
a39ded513a BN_rand_range() as in main branch. 2001-02-21 15:54:31 +00:00
Bodo Möller
0069dbc4a5 honour -no_tmp_rsa 2001-02-20 12:58:57 +00:00
Bodo Möller
ac90362581 update 2001-02-20 11:31:20 +00:00
Bodo Möller
6d82a20624 Fix BN_[pseudo_]rand: 'mask' must be used even if top=-1.
Mention BN_[pseudo_]rand with top=-1 in CHANGES.
2001-02-20 08:22:25 +00:00
Ulf Möller
6c66fcba5f as in main branch 2001-02-20 00:38:02 +00:00
Ulf Möller
faa624f9f9 BN_rand_range() needs a BN_rand() variant that doesn't set the MSB. 2001-02-20 00:17:46 +00:00
Ulf Möller
15ed15d3e4 OPENSSL_issetugid() as in the main branch. 2001-02-19 23:57:18 +00:00
cvs2svn
54f7c8571f This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-19 22:04:03 +00:00
Bodo Möller
b6fefec364 Memory leak checking bugfixes for multi-threading. 2001-02-19 10:30:13 +00:00
Ulf Möller
2bf1c86d05 ispell 2001-02-16 02:11:12 +00:00
Ulf Möller
2147cd3540 pod format error 2001-02-16 01:46:47 +00:00
Lutz Jänicke
6a0fb6083c Move entry to match chronologic ordering. 2001-02-15 14:19:43 +00:00
Lutz Jänicke
0dbfc1da4a Add '-rand' option to s_server and s_client. 2001-02-15 10:35:29 +00:00
Ulf Möller
f945040633 IRIX bugfix 2001-02-14 00:23:27 +00:00
Lutz Jänicke
8b8e03dc66 Finish first round of session cache documentation. 2001-02-13 14:02:59 +00:00
cvs2svn
56ec43a0dd This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-13 14:00:10 +00:00
Lutz Jänicke
74ac7455c5 New manual page: SSL_CTX_set_mode. 2001-02-13 11:46:42 +00:00
cvs2svn
166850e315 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-13 11:43:12 +00:00
Dr. Stephen Henson
e15abbc69f Make X509_NAME produce correct encoding when empty. 2001-02-12 03:16:13 +00:00
Dr. Stephen Henson
c6b523d3dd Workaround for libsafe "error". 2001-02-12 03:04:59 +00:00
Lutz Jänicke
1e376e41a2 More about session caching. 2001-02-11 17:03:50 +00:00
cvs2svn
dc931b1fca This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-11 17:01:37 +00:00
Lutz Jänicke
7fcb1de839 Manual page for SSL_CTX_set_options(). Unfortunately for some of the
options someone much longer working with OpenSSL/SSLeay is needed.
2001-02-10 16:20:41 +00:00
cvs2svn
49b02a2d77 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-10 16:18:36 +00:00
Bodo Möller
418a0d151e Simplify BN_rand_range 2001-02-10 00:34:20 +00:00
Lutz Jänicke
7b0cb7f08d Fix "wierd" typo as submitted by Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>. 2001-02-09 19:05:11 +00:00
Bodo Möller
1c08c320c5 add linux-s390 configuration (based on information submitted by
Denis Beauchemin <Denis.Beauchemin@Courrier.USherb.ca>)
2001-02-09 08:35:03 +00:00
Ulf Möller
452b34a770 add comment and RAND_load_file() change as in main branch. 2001-02-08 17:50:55 +00:00
Ulf Möller
6bdb723259 cleanup 2001-02-08 17:14:47 +00:00
Bodo Möller
31a74acfd3 Another comment change. (Previous comment does not apply
for range = 11000000... or range = 100000...)
2001-02-08 12:33:55 +00:00
Bodo Möller
d82242169b Change comments. (The expected number of iterations in BN_rand_range
never exceeds 1.333...).
2001-02-08 12:27:00 +00:00
Bodo Möller
a0707e6170 oops -- remove observation code 2001-02-08 12:25:03 +00:00
Bodo Möller
07fc72fea1 Integrate my implementation of a countermeasure against
Bleichenbacher's DSA attack.  With this implementation, the expected
number of iterations never exceeds 2.

New semantics for BN_rand_range():
BN_rand_range(r, min, range) now generates r such that
     min <= r < min+range.
(Previously, BN_rand_range(r, min, max) generated r such that
     min <= r < max.
It is more convenient to have the range; also the previous
prototype was misleading because max was larger than
the actual maximum.)
2001-02-08 12:20:25 +00:00
Lutz Jänicke
813c7c415b Update documentation to match the state of OpenSSL 0.9.6. 2001-02-08 10:36:37 +00:00
Ulf Möller
38b3a46ffa DSA fix from main branch. 2001-02-07 22:35:11 +00:00
Ulf Möller
60b3b2c9d0 EBCDIC bug fix from main branch. 2001-02-07 22:13:10 +00:00
Bodo Möller
c7410f2693 Avoid coredumps for CONF_get_...(NULL, ...) 2001-02-06 10:14:57 +00:00
Bodo Möller
43a5e1409e don't dump core 2001-02-06 09:47:25 +00:00
Richard Levitte
cd4fad5488 Merge in memory leak correction from main trunk. 2001-02-05 13:33:28 +00:00
Richard Levitte
28b1bceb2f 0.9.6a will not be release in Y2K. :-) 2001-02-05 13:32:33 +00:00
Lutz Jänicke
d4d76b9e83 Documenting session caching, 2nd step. 2001-02-04 18:10:54 +00:00
cvs2svn
e1fee47759 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-04 18:05:28 +00:00
Lutz Jänicke
88e9984da5 Clarify why SSL_CTX_use_certificate_chain_file() should be preferred. 2001-02-03 15:15:44 +00:00
Lutz Jänicke
dac1169e82 Typo: on my screen it nicely wrapped around at 80 :-) 2001-02-03 11:02:35 +00:00
Lutz Jänicke
53ab745f7a If the source has already been succesfully queried, do not try to open it
again as file.
2001-02-03 10:59:16 +00:00
Lutz Jänicke
2bbe747045 Backport... 2001-02-02 14:44:02 +00:00
cvs2svn
55cd47ffb4 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-02-02 14:40:53 +00:00
Dr. Stephen Henson
2e1d669cba Tolerate some "variations" used in some
certificates.

One is a valid CA which has no basicConstraints
but does have certSign keyUsage.

Other is S/MIME signer with nonRepudiation but
no digitalSignature.
2001-02-01 02:03:58 +00:00
Lutz Jänicke
819d5cef08 Backport extended documentation. 2001-01-31 14:18:43 +00:00
cvs2svn
e9cba65a99 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-01-31 14:14:21 +00:00
Richard Levitte
3b1f393ae7 Transport from development branch. 2001-01-30 13:54:44 +00:00
Lutz Jänicke
61433519af Backported manual pages from 0.9.7. 2001-01-28 18:35:10 +00:00
Lutz Jänicke
c032563a0a Backport documentation added for 0.9.7. 2001-01-28 18:31:35 +00:00
Dr. Stephen Henson
943f8a46a4 For CRLs.
Shouldn't use the "encode empty" macros with the
revoked field since that is initialised.

Extensions should now be set to NULL so they
encode as absent if none are added.
2001-01-28 14:48:13 +00:00
Dr. Stephen Henson
7a60df7dd3 New ASN1 macros which will encode an empty SEQUENCE OF.
Fix CRL encoders to encode empty SEQUENCE OF.

The old code was breaking CRL signatures.

Note: it is best to add new macros because changing the
old ones could break other code which expects that behaviour.
None of this is needed with the new ASN1 code anyway...
2001-01-28 14:18:20 +00:00
Dr. Stephen Henson
de0b3ab7fb Zero the premaster secret after deriving the master secret in DH
ciphersuites.
2001-01-25 13:20:39 +00:00
cvs2svn
2b8d087ba1 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-01-25 02:26:59 +00:00
Richard Levitte
eec6e53851 Eh, this branch is not version 0.9.6, it's the development of 0.9.6a. 2001-01-24 16:21:21 +00:00
Ulf Möller
9cd9ae3e3e new year 2001-01-24 02:56:13 +00:00
Bodo Möller
c4fd88f519 EVP_add_digest_alias additions to SSL_library_init 2001-01-23 16:38:15 +00:00
Ulf Möller
0a0a261d64 Irix fix as in main branch 2001-01-23 16:29:06 +00:00
Bodo Möller
6610d4f3b9 For improved compatibility with 'strange' certificates, add some
digest aliases (as found in OpenSSL_add_all_digests).
2001-01-23 13:55:01 +00:00
Ulf Möller
70f74dd946 remove newline 2001-01-21 18:51:01 +00:00
Ulf Möller
92fdeb37a0 config bug fixes from the main branch. 2001-01-21 18:48:11 +00:00
Bodo Möller
ffac355834 Fix openssl passwd -1 2001-01-19 07:38:55 +00:00
Bodo Möller
2e72fde15f As in the main branch, there's no longer a need to guess the bc
version at compile time.
2001-01-18 12:41:25 +00:00
Bodo Möller
aa9be09088 Use 'bctest' script to test if bc works (as in the main branch). 2001-01-17 10:26:25 +00:00
Dr. Stephen Henson
8bcceacf34 Fix PKCS#12 PBE routines to cope with passwords
from PEM callbacks which are not null terminated.
2001-01-14 14:14:45 +00:00
Bodo Möller
a5a4b34a5a When we are waiting for user action, we should say this explicitly. 2001-01-12 10:35:32 +00:00
Bodo Möller
f99267cffc Fix C code generate by 'openssl dsaparam -C'. 2001-01-10 14:27:04 +00:00
Dr. Stephen Henson
5860ecb8ec Fix uni2asc() so it can properly convert zero length
unicode strings. Certain PKCS#12 files contain these
in BMPStrings and it used to crash on them.
2001-01-10 01:14:23 +00:00
Bodo Möller
799751bcff Get rid of unused error code. 2000-12-27 23:41:50 +00:00
Bodo Möller
beaea31a96 Finish SSL_peek/SSL_pending fixes. 2000-12-26 12:06:48 +00:00
Bodo Möller
a9c3dc60b9 Fix SSL_peek and SSL_pending. 2000-12-25 18:41:37 +00:00
Bodo Möller
2fb0c899c6 Include CRYPTO_mem_leaks deadlock fix. 2000-12-20 10:07:31 +00:00
Bodo Möller
73bc0cfd93 fix indentation 2000-12-19 12:39:12 +00:00
Bodo Möller
cbfa030de7 Don't hold CRYPTO_LOCK_RSA during time-consuming operations. 2000-12-19 12:19:16 +00:00
Bodo Möller
bb617a9646 Obtain lock CRYPTO_LOCK_RSA before creating BN_MONT_CTX
structures and setting rsa->_method_mod_{n,p,q}.

Submitted by: "Reddie, Steven" <Steven.Reddie@ca.com>
2000-12-18 16:36:07 +00:00
Bodo Möller
7947f98b9b Fix another buffer overrun bug (which is not really a bug because
s->s2->escape is never set when sending data because the escape
bit is just reserved for future use in SSL 2.0)
2000-12-18 11:32:09 +00:00
Bodo Möller
fc4868cb47 Increase wbuf by one byte to fix the bug reported by
Eric Day <eday@concentric.net> to openssl-dev@openssl.org,
Message-ID: <20001218013437.A5526@concentric.net>
2000-12-18 11:23:23 +00:00
Bodo Möller
555a8493cd typo 2000-12-14 17:45:36 +00:00
Bodo Möller
2452e013aa The first step towards a SSL_peek fix.
The main thing to verify about these changes is that nothing at all
has changed, as far as behaviour is concerned (except that some
SSLerr() invocations now have a different function code): SSL_read
(ssl2_read, ssl3_read) behaves exactly as before, and SSL_peek refuses
to do any work exactly as before.  But now the functions actually
doing the work have a 'peek' flag, so it should be easy to change them
to behave accordingly.
2000-12-14 17:34:42 +00:00
cvs2svn
a29b1a3f0f This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2000-12-11 17:28:08 +00:00
Bodo Möller
79370621ea Change error message to "bignum too long" 2000-12-04 09:32:26 +00:00
Bodo Möller
4c4f1ee4de include <limits.h> 2000-12-03 09:55:01 +00:00
Bodo Möller
fe772376ec Don't allow BIGNUMs to become so large that computations with dmax
might overflow.
2000-12-03 09:37:15 +00:00
Ulf Möller
99cf5acd5c fix for Borland C 2000-12-01 03:06:55 +00:00
Bodo Möller
d2c38b1c73 Fix BN_rshift. 2000-11-30 22:35:52 +00:00
Lutz Jänicke
673d7ac121 Store verify_result with sessions to avoid potential security hole.
For the server side this was already done one year ago :-(
2000-11-29 18:12:32 +00:00
Bodo Möller
666d437538 Disable SSL_peek. 2000-11-28 11:14:39 +00:00
Bodo Möller
ddf72ed59f SSL_CTX-related fixes. 2000-11-08 10:09:10 +00:00
Dr. Stephen Henson
6502735b9c Fix from main trunk, 2000-10-04 03:16:34 steve:
Fix for bug in DirectoryString mask setting.

Fix from main trunk, 2000-10-20 01:16:49 steve:

Move expired CA certificate.

Fix from main trunk, 2000-10-20 02:36:47 steve:

Stop MASM debug warning.
2000-10-27 23:52:35 +00:00
Richard Levitte
31a266cb93 make update 2000-10-27 21:49:59 +00:00
Richard Levitte
b703bce788 Corrected missing colons. This was part of a larger change in the
main development line.
2000-10-27 21:49:40 +00:00
Richard Levitte
0188a53d19 Fix from main trunk, 2000-10-22 14:47 levitte:
Pointer error corrected
2000-10-27 20:29:10 +00:00
Richard Levitte
e7ce15846d Fix from main trunk, 2000-10-17 00:56 steve:
Update test server certificate in apps/server.pem (it was expired).
2000-10-27 20:23:21 +00:00
Richard Levitte
1433ae4790 Fix from main trunk, 2000-10-13 10:30 levitte:
Make the new conf implementatoin bug-compatible with the old one.
Actually, it's a feature that it goes looking at environment
variables.  It's just a pity that it's at the cost of the error
checking...  I'll see if I can come up with a better interface for
this.

Fix from main trunk, 2000-10-16 15:08  ben:

Always return a value.
2000-10-27 20:18:00 +00:00
Richard Levitte
a506153219 Fix from main trunk, 2000-10-16 08:01 levitte:
CRYPTO_get_ex_new_index would never return an error.
2000-10-27 20:12:05 +00:00
Richard Levitte
bee4756251 Fix from main trunk, 2000-10-15 01:51 steve:
Fix for typo in certificate directory lookup code.
2000-10-27 20:09:13 +00:00
Bodo Möller
b3f4fb1f72 rsautl.c requires RSA. 2000-10-26 12:05:22 +00:00
cvs2svn
38654b070d This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2000-10-19 23:16:49 +00:00
Richard Levitte
82c31e1496 Fix from main trunk, 2000-10-04 00:02 levitte:
More SSL functions documented.
Submitted by Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>

Fix from main trunk, 2000-10-10 11:15  levitte:

A few small corrections to the SSL documentation.
Submitted by Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>
2000-10-11 12:12:06 +00:00
Richard Levitte
4c3853abea Fix from main trunk, 2000-10-09 18:40 bodo:
BIO_sock_init() returns 1 for success and -1 for failure, not 0; thus
the condition '!BIO_sock_init()' doesn't make sense.
2000-10-11 10:24:06 +00:00
Richard Levitte
5b88fe121d Fix from main trunk, 2000-10-09 02:50 levitte:
Make sure ranlib is only used on .a libraries.
2000-10-11 10:11:22 +00:00
Richard Levitte
a46db6ecce Fix from main trunk, 2000-10-08 21:38 levitte:
Linux on Alpha has the configuration name linux-alpha-gcc, not
linux-alpha.
2000-10-11 10:05:37 +00:00
Richard Levitte
f4d52a896e Fix from main trunk, 2000-10-08 21:40 levitte:
Linux on Alpha with gcc knows about shared libraries.

Fix from main trunk, 2000-10-09 02:48  levitte:

Make sure that shareable libraries are turned off if we don't know how
to make them...
2000-10-11 10:04:16 +00:00
Richard Levitte
57b6a64eed Fix from main trunk, 2000-09-26 14:15 bodo:
Add BUGS section.
2000-10-11 09:53:10 +00:00
Richard Levitte
c0a86cd5dd Fix from main trunk, 2000-09-27 23:45 ulf:
The des_modes manpage is in section 7.
2000-10-11 09:47:44 +00:00
Richard Levitte
43cbb1e3dd Fix from main trunk, 2000-09-27 15:54 levitte:
A compiler warning removed.  Thanks to the folks at HP!
2000-10-11 09:46:34 +00:00
Richard Levitte
2cb3c3b2bf Fix from main trunk, 2000-09-29 22:14 levitte:
Include arpa/inet.h, since that's where htons() and friends are
supposed to be defined according to XPG4.2.  Found by Evan
<n2xjk@ulster.net> for the MVS platform.
2000-10-11 09:45:30 +00:00
Richard Levitte
24802a6d91 Fix from main trunk, 2000-09-26 13:39 bodo:
Note read_ahead-flag related fixes.
2000-10-11 09:16:47 +00:00
Richard Levitte
c125ea2767 Fix from main trunk, 2000-09-26 13:30 bodo:
Don't modify s->read_ahead in SSL_clear, which is called from
accept/connect functions; those should not change the read_ahead
setting of the SSL structure.

Fix from main trunk, 2000-09-26 13:38  bodo:

Set s->read_ahead in SSL_new because SSL_clear no longer modifies it.
2000-10-11 09:15:53 +00:00
Richard Levitte
df4fd356df Fix from main trunk, 2000-09-26 13:25 bodo:
Fix SSL_CTX_set_read_ahead macro.

Submitted by: Anders Gertz <gertz@epact.se>
2000-10-11 09:14:17 +00:00
Richard Levitte
1f1f23a882 Fix from main trunk, 2000-09-25 13:12 levitte:
Document the change.
2000-10-11 02:28:39 +00:00
Richard Levitte
ee4462d2b1 Fix from main trunk, 2000-09-25 12:22 levitte:
Update
2000-10-11 02:27:07 +00:00
Richard Levitte
41faea737a Fix from main trunk, 2000-09-25 12:21 levitte:
When creating a .def file, be a bit more selective so disabled
algorithms do not get in...
2000-10-11 02:24:38 +00:00
Richard Levitte
7c69ce8bc0 Fix from main trunk, 2000-09-25 11:30 levitte:
echo=off works on NT, but not on W2K.
2000-10-11 02:22:59 +00:00
Richard Levitte
eb3633164e Fix from main trunk, 2000-09-25 10:52 levitte:
'ranlib' doesn't always run on some systems.  That's actually
acceptable, since all that happens if it fails is a library with an
index, which makes linking slower, but still working correctly.
2000-10-11 02:04:16 +00:00
Richard Levitte
a08d14fef4 Fix from main trunk, 2000-09-25 10:49 levitte:
Make the algorithm implementations depend on the corresponding
selection macros.
2000-10-11 01:57:07 +00:00
Richard Levitte
b73ff18078 Fix from main trunk, 2000-09-25 07:55 ulf:
typo
2000-10-11 01:56:00 +00:00
cvs2svn
9beaae61ec This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2000-10-10 09:15:48 +00:00
503 changed files with 4236 additions and 23713 deletions

512
CHANGES
View File

@@ -2,512 +2,6 @@
OpenSSL CHANGES OpenSSL CHANGES
_______________ _______________
Changes between 0.9.6g and 0.9.6h [21 Dec 2002]
*) New function OPENSSL_cleanse(), which is used to cleanse a section of
memory from it's contents. This is done with a counter that will
place alternating values in each byte. This can be used to solve
two issues: 1) the removal of calls to memset() by highly optimizing
compilers, and 2) cleansing with other values than 0, since those can
be read through on certain media, for example a swap space on disk.
[Geoff Thorpe]
*) Bugfix: client side session caching did not work with external caching,
because the session->cipher setting was not restored when reloading
from the external cache. This problem was masked, when
SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG (part of SSL_OP_ALL) was set.
(Found by Steve Haslam <steve@araqnid.ddts.net>.)
[Lutz Jaenicke]
*) Fix client_certificate (ssl/s2_clnt.c): The permissible total
length of the REQUEST-CERTIFICATE message is 18 .. 34, not 17 .. 33.
[Zeev Lieber <zeev-l@yahoo.com>]
*) Undo an undocumented change introduced in 0.9.6e which caused
repeated calls to OpenSSL_add_all_ciphers() and
OpenSSL_add_all_digests() to be ignored, even after calling
EVP_cleanup().
[Richard Levitte]
*) Change the default configuration reader to deal with last line not
being properly terminated.
[Richard Levitte]
*) Change X509_NAME_cmp() so it applies the special rules on handling
DN values that are of type PrintableString, as well as RDNs of type
emailAddress where the value has the type ia5String.
[stefank@valicert.com via Richard Levitte]
*) Add a SSL_SESS_CACHE_NO_INTERNAL_STORE flag to take over half
the job SSL_SESS_CACHE_NO_INTERNAL_LOOKUP was inconsistently
doing, define a new flag (SSL_SESS_CACHE_NO_INTERNAL) to be
the bitwise-OR of the two for use by the majority of applications
wanting this behaviour, and update the docs. The documented
behaviour and actual behaviour were inconsistent and had been
changing anyway, so this is more a bug-fix than a behavioural
change.
[Geoff Thorpe, diagnosed by Nadav Har'El]
*) Don't impose a 16-byte length minimum on session IDs in ssl/s3_clnt.c
(the SSL 3.0 and TLS 1.0 specifications allow any length up to 32 bytes).
[Bodo Moeller]
*) Fix initialization code race conditions in
SSLv23_method(), SSLv23_client_method(), SSLv23_server_method(),
SSLv2_method(), SSLv2_client_method(), SSLv2_server_method(),
SSLv3_method(), SSLv3_client_method(), SSLv3_server_method(),
TLSv1_method(), TLSv1_client_method(), TLSv1_server_method(),
ssl2_get_cipher_by_char(),
ssl3_get_cipher_by_char().
[Patrick McCormick <patrick@tellme.com>, Bodo Moeller]
*) Reorder cleanup sequence in SSL_CTX_free(): only remove the ex_data after
the cached sessions are flushed, as the remove_cb() might use ex_data
contents. Bug found by Sam Varshavchik <mrsam@courier-mta.com>
(see [openssl.org #212]).
[Geoff Thorpe, Lutz Jaenicke]
*) Fix typo in OBJ_txt2obj which incorrectly passed the content
length, instead of the encoding length to d2i_ASN1_OBJECT.
[Steve Henson]
Changes between 0.9.6f and 0.9.6g [9 Aug 2002]
*) [In 0.9.6g-engine release:]
Fix crypto/engine/vendor_defns/cswift.h for WIN32 (use '_stdcall').
[Lynn Gazis <lgazis@rainbow.com>]
Changes between 0.9.6e and 0.9.6f [8 Aug 2002]
*) Fix ASN1 checks. Check for overflow by comparing with LONG_MAX
and get fix the header length calculation.
[Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>,
Alon Kantor <alonk@checkpoint.com> (and others),
Steve Henson]
*) Use proper error handling instead of 'assertions' in buffer
overflow checks added in 0.9.6e. This prevents DoS (the
assertions could call abort()).
[Arne Ansper <arne@ats.cyber.ee>, Bodo Moeller]
Changes between 0.9.6d and 0.9.6e [30 Jul 2002]
*) Add various sanity checks to asn1_get_length() to reject
the ASN1 length bytes if they exceed sizeof(long), will appear
negative or the content length exceeds the length of the
supplied buffer.
[Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
*) Fix cipher selection routines: ciphers without encryption had no flags
for the cipher strength set and where therefore not handled correctly
by the selection routines (PR #130).
[Lutz Jaenicke]
*) Fix EVP_dsa_sha macro.
[Nils Larsch]
*) New option
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
for disabling the SSL 3.0/TLS 1.0 CBC vulnerability countermeasure
that was added in OpenSSL 0.9.6d.
As the countermeasure turned out to be incompatible with some
broken SSL implementations, the new option is part of SSL_OP_ALL.
SSL_OP_ALL is usually employed when compatibility with weird SSL
implementations is desired (e.g. '-bugs' option to 's_client' and
's_server'), so the new option is automatically set in many
applications.
[Bodo Moeller]
*) Changes in security patch:
Changes marked "(CHATS)" were sponsored by the Defense Advanced
Research Projects Agency (DARPA) and Air Force Research Laboratory,
Air Force Materiel Command, USAF, under agreement number
F30602-01-2-0537.
*) Add various sanity checks to asn1_get_length() to reject
the ASN1 length bytes if they exceed sizeof(long), will appear
negative or the content length exceeds the length of the
supplied buffer. (CAN-2002-0659)
[Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
*) Assertions for various potential buffer overflows, not known to
happen in practice.
[Ben Laurie (CHATS)]
*) Various temporary buffers to hold ASCII versions of integers were
too small for 64 bit platforms. (CAN-2002-0655)
[Matthew Byng-Maddick <mbm@aldigital.co.uk> and Ben Laurie (CHATS)>
*) Remote buffer overflow in SSL3 protocol - an attacker could
supply an oversized session ID to a client. (CAN-2002-0656)
[Ben Laurie (CHATS)]
*) Remote buffer overflow in SSL2 protocol - an attacker could
supply an oversized client master key. (CAN-2002-0656)
[Ben Laurie (CHATS)]
Changes between 0.9.6c and 0.9.6d [9 May 2002]
*) Fix crypto/asn1/a_sign.c so that 'parameters' is omitted (not
encoded as NULL) with id-dsa-with-sha1.
[Nils Larsch <nla@trustcenter.de>; problem pointed out by Bodo Moeller]
*) 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.6d-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] Changes between 0.9.6a and 0.9.6b [9 Jul 2001]
*) Change ssleay_rand_bytes (crypto/rand/md_rand.c) *) Change ssleay_rand_bytes (crypto/rand/md_rand.c)
@@ -562,7 +56,7 @@
[Ulf M<>ller, Bodo M<>ller] [Ulf M<>ller, Bodo M<>ller]
*) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5 *) 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 when fixing the server behaviour for backwards-compatible 'client
hello' messages. (Note that the attack is impractical against hello' messages. (Note that the attack is impractical against
SSL 3.0 and TLS 1.0 anyway because length and version checking SSL 3.0 and TLS 1.0 anyway because length and version checking
@@ -612,7 +106,7 @@
combination of a flag and a thread ID variable. combination of a flag and a thread ID variable.
Otherwise while one thread is in ssleay_rand_bytes (which sets the Otherwise while one thread is in ssleay_rand_bytes (which sets the
flag), *other* threads can enter ssleay_add_bytes without obeying 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). that they do not hold after the first thread unsets add_do_not_lock).
[Bodo Moeller] [Bodo Moeller]
@@ -1254,7 +748,7 @@
default is static libraries only, and the OpenSSL programs default is static libraries only, and the OpenSSL programs
are always statically linked for now, but there are are always statically linked for now, but there are
preparations for dynamic linking in place. preparations for dynamic linking in place.
This has been tested on Linux and Tru64. This has been tested on Linux and True64.
[Richard Levitte] [Richard Levitte]
*) Randomness polling function for Win9x, as described in: *) Randomness polling function for Win9x, as described in:

395
Configure
View File

@@ -10,7 +10,7 @@ use strict;
# see INSTALL for instructions. # see INSTALL for instructions.
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] [--test-sanity] os/compiler[:flags]\n"; my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] os/compiler[:flags]\n";
# Options: # Options:
# #
@@ -23,24 +23,11 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
# default). This needn't be set in advance, you can # default). This needn't be set in advance, you can
# just as well use "make INSTALL_PREFIX=/whatever install". # just as well use "make INSTALL_PREFIX=/whatever install".
# #
# 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.
#
# --test-sanity Make a number of sanity checks on the data in this file.
# This is a debugging tool for OpenSSL developers.
#
# rsaref use RSAref # rsaref use RSAref
# [no-]threads [don't] try to create a library that is suitable for # [no-]threads [don't] try to create a library that is suitable for
# multithreaded applications (default is "threads" if we # multithreaded applications (default is "threads" if we
# know how to do it) # know how to do it)
# [no-]shared [don't] try to create shared libraries when supported. # [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-asm do not use assembler
# no-dso do not compile in any native shared-library methods. This # no-dso do not compile in any native shared-library methods. This
# will ensure that all methods just return NULL. # will ensure that all methods just return NULL.
@@ -110,7 +97,7 @@ my $alpha_asm="::::::::";
# -DB_ENDIAN slows things down on a sparc for md5, but helps sha1. # -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 # 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=( my %table=(
# File 'TABLE' (created by 'make TABLE') contains the data from this list, # File 'TABLE' (created by 'make TABLE') contains the data from this list,
@@ -129,10 +116,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-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-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-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-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 -DPEDANTIC -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${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-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 -Wstrict-prototypes -Wmissing-prototypes -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "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):::::", "dist", "cc:-O::(unknown):::::",
# Basic configs that should work on any (32 and less bit) box # Basic configs that should work on any (32 and less bit) box
@@ -145,45 +132,44 @@ my %table=(
# surrounds it with #APP #NO_APP comment pair which (at least Solaris # surrounds it with #APP #NO_APP comment pair which (at least Solaris
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic" # 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
# error message. # 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 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 #### 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-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: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: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: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:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-gcc31","gcc:-mcpu=ultrasparc -m64 -O3 -fomit-frame-pointer -Wall -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:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8 # gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
# but keep the assembler modules. # 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-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: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:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### SPARC Solaris with Sun C setups #### 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 # 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.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 # 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! # 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-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-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)", "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", "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-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-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 #### 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::", "linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
# assisted with debugging of following two configs. # assisted with debugging of following two configs.
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "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 # it's a real mess with -mcpu=ultrasparc option under Linux, but
# -Wa,-Av8plus should do the trick no matter what. # -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:-ldl: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!!! # !!!Folowing can't be even tested yet!!!
# We have to wait till 64-bit glibc for SPARC is operational!!! # 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:", #"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:",
@@ -194,17 +180,17 @@ my %table=(
#### IRIX 5.x configs #### IRIX 5.x configs
# -mips2 flag is added by ./config when appropriate. # -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-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::::::::::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:::",
#### IRIX 6.x configs #### IRIX 6.x configs
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
# './Configure irix-[g]cc' manually. # './Configure irix-[g]cc' manually.
# -mips4 flag is added by ./config when appropriate. # -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-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}: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}",
# N64 ABI builds. # 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-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}: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}",
#### Unified HP-UX ANSI C configs. #### Unified HP-UX ANSI C configs.
# Special notes: # Special notes:
@@ -236,45 +222,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", #!#"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 # 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-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:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "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:hpux64-shared:+Z::.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-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# More attempts at unified 10.X and 11.X targets for HP C compiler. # More attempts at unified 10.X and 11.X targets for HP C compiler.
# #
# Chris Ruemmler <ruemmler@cup.hp.com> # Chris Ruemmler <ruemmler@cup.hp.com>
# Kevin Steves <ks@hp.se> # 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-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: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",
"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)", "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-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 9.X config. # HPUX 9.X config.
# Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or # Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or
# egcs. gcc 2.8.1 is also broken. # 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, # 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 # please report your OS and compiler version to the openssl-bugs@openssl.org
# mailing list. # 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: # 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-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
# HPUX 9.X on Motorola 68k platforms with gcc
"hpux-m68k-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::BN_LLONG DES_PTR DES_UNROLL:::",
# HPUX 10.X config. Supports threads. # 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): # 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: # 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. # HPUX 11.X from www.globus.org.
# Only works on PA-RISC 2.0 cpus, and not optimized. Why? # Only works on PA-RISC 2.0 cpus, and not optimized. Why?
@@ -285,43 +267,13 @@ my %table=(
#### HP MPE/iX http://jazz.external.hp.com/src/openssl/ #### 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:::", "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 # Dec Alpha, OSF/1 - the alpha164-cc is the flags for a 21164A with
"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::", # the new compiler
# 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.
#
# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version # 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:tru64-shared::.so",
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so", "alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-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::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread::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-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 Linux with GNU C and Compaq C setups #### Alpha Linux with GNU C and Compaq C setups
# Special notes: # Special notes:
@@ -336,8 +288,8 @@ my %table=(
# #
# <appro@fy.chalmers.se> # <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-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+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-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", "linux-alpha+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}",
@@ -346,24 +298,22 @@ my %table=(
# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the # 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. # 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)", "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)", "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", "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-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:-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::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-m68k", "gcc:-DB_ENDIAN -DTERMIO -O2 -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 -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR),\$(SHLIB_MINOR)", "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:-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::SIXTY_FOUR_BIT_LONG::",
"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-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-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)",
"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-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)",
"FreeBSD", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}", "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-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}:::", "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}:::", "nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
# NCR MP-RAS UNIX ver 02.03.01 # NCR MP-RAS UNIX ver 02.03.01
@@ -372,11 +322,8 @@ my %table=(
# QNX 4 # QNX 4
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown)::${x86_gcc_des} ${x86_gcc_opts}:", "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 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.0x fails destest with -O
"unixware-2.0","cc:-DFILIO_H::-Kthread:-lsocket -lnsl -lx:${x86_gcc_des} ${x86_gcc_opts}:::", "unixware-2.0","cc:-DFILIO_H::-Kthread:-lsocket -lnsl -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
@@ -391,24 +338,15 @@ my %table=(
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::", "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","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-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. # IBM's AIX.
"aix-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR:::", "aix-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR:::",
"aix-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::", "aix-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::",
"aix43-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:", "aix43-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:",
"aix43-gcc", "gcc:-O1 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:", "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 # 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 # 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 # B_ENDIAN code assumes 4 byte ints. Fortunately, the non-B_ENDIAN and
@@ -418,10 +356,7 @@ my %table=(
#'Taking the address of a bit field is not allowed. ' #'Taking the address of a bit field is not allowed. '
#'An expression with bit field exists as the operand of "sizeof" ' #'An expression with bit field exists as the operand of "sizeof" '
# (written by Wayne Schroeder <schroede@SDSC.EDU>) # (written by Wayne Schroeder <schroede@SDSC.EDU>)
# "cray-t90-cc", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT:::",
# 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 T3E (Research Center Juelich, beckman@acl.lanl.gov) # Cray T3E (Research Center Juelich, beckman@acl.lanl.gov)
@@ -443,11 +378,9 @@ my %table=(
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the
# SCO cc. # 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-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-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 -fomit-frame-pointer:::-lsocket -lresolv -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:svr3-shared:-fPIC", # the SCO assembler doesn't seem to like our assembler files ...
# Sinix/ReliantUNIX RM400 # Sinix/ReliantUNIX RM400
# NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */ # NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */
@@ -458,12 +391,6 @@ my %table=(
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown):-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::", "BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -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 # Windows NT, Microsoft Visual C++ 4.0
"VC-NT","cl:::::BN_LLONG RC4_INDEX ${x86_gcc_opts}::::::::::win32", "VC-NT","cl:::::BN_LLONG RC4_INDEX ${x86_gcc_opts}::::::::::win32",
@@ -482,12 +409,8 @@ my %table=(
# and its library files in util/pl/*) # 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", "Mingw32", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
# UWIN # CygWin32
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32", "CygWin32", "gcc:-DTERMIOS -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 -march=i486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32:cygwin-shared:::.dll",
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at> # Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown)::::::", "ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown)::::::",
@@ -496,55 +419,22 @@ my %table=(
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown)::::::", ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown)::::::",
# Some OpenBSD from Bob Beck <beck@obtuse.com> # 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-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-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", "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-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:::", "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 -fno-common::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
##### A/UX
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
##### Sony NEWS-OS 4.x ##### 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::::", "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:::::",
##### Compaq Non-Stop Kernel (Tandem)
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown)::THIRTY_TWO_BIT:::",
); );
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32 my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
BC-16 Mingw32); 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 $prefix="";
my $openssldir=""; my $openssldir="";
my $exe_ext=""; my $exe_ext="";
@@ -593,7 +483,6 @@ my $libs;
my $target; my $target;
my $options; my $options;
my $symlink; my $symlink;
my $make_depend=0;
my @argvcopy=@ARGV; my @argvcopy=@ARGV;
my $argvstring=""; my $argvstring="";
@@ -618,28 +507,12 @@ PROCESS_ARGS:
foreach (@argvcopy) foreach (@argvcopy)
{ {
s /^-no-/no-/; # some people just can't read the instructions s /^-no-/no-/; # some people just can't read the instructions
if (/^--test-sanity$/) if (/^no-asm$/)
{
exit(&test_sanity());
}
elsif (/^no-asm$/)
{ {
$no_asm=1; $no_asm=1;
$flags .= "-DNO_ASM "; $flags .= "-DNO_ASM ";
$openssl_other_defines .= "#define NO_ASM\n"; $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$/) elsif (/^no-dso$/)
{ $no_dso=1; } { $no_dso=1; }
elsif (/^no-threads$/) elsif (/^no-threads$/)
@@ -648,7 +521,7 @@ PROCESS_ARGS:
{ $threads=1; } { $threads=1; }
elsif (/^no-shared$/) elsif (/^no-shared$/)
{ $no_shared=1; } { $no_shared=1; }
elsif (/^shared$/ || /^-shared$/ || /^--shared$/) elsif (/^shared$/)
{ $no_shared=0; } { $no_shared=0; }
elsif (/^no-symlinks$/) elsif (/^no-symlinks$/)
{ $symlink=0; } { $symlink=0; }
@@ -763,17 +636,13 @@ if ($target eq "LIST") {
exit 0; exit 0;
} }
if ($target =~ m/^CygWin32(-.*)$/) {
$target = "Cygwin".$1;
}
print "Configuring for $target\n"; print "Configuring for $target\n";
&usage if (!defined($table{$target})); &usage if (!defined($table{$target}));
my $IsWindows=scalar grep /^$target$/,@WinTargets; 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 ""); $openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
$prefix=$openssldir if $prefix eq ""; $prefix=$openssldir if $prefix eq "";
@@ -786,29 +655,9 @@ $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /^\//;
print "IsWindows=$IsWindows\n"; print "IsWindows=$IsWindows\n";
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); (my $cc,my $cflags,my $unistd,my $thread_cflag,my $lflags,my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
my $cc = $fields[$idx_cc]; $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)=
my $cflags = $fields[$idx_cflags]; split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
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];
$cflags="$flags$cflags" if ($flags ne ""); $cflags="$flags$cflags" if ($flags ne "");
# The DSO code currently always implements all functions so that no # The DSO code currently always implements all functions so that no
@@ -933,10 +782,6 @@ if ($rmd160_obj =~ /\.o$/)
$cflags.=" -DRMD160_ASM"; $cflags.=" -DRMD160_ASM";
} }
# "Stringify" the C flags string. This permits it to be made part of a string
# and works as well on command lines.
$cflags =~ s/([\\\"])/\\\1/g;
my $version = "unknown"; my $version = "unknown";
my $major = "unknown"; my $major = "unknown";
my $minor = "unknown"; my $minor = "unknown";
@@ -1016,25 +861,7 @@ while (<IN>)
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/; s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/; s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared); s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/) s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.so.\$(SHLIB_MAJOR) .so/ 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 =~ /^\.[^\.]*\.dylib$/)
{
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.dylib/;
}
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/;
}
elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/)
{
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.\$(SHLIB_MAJOR).dylib .dylib/;
}
s/^SHARED_LDFLAGS=.*/SHARED_LDFLAGS=$shared_ldflag/;
print OUT $_."\n"; print OUT $_."\n";
} }
close(IN); close(IN);
@@ -1217,13 +1044,11 @@ if($IsWindows) {
EOF EOF
close(OUT); close(OUT);
} else { } else {
my $make_command = "make -f Makefile.ssl PERL=\'$perl\'"; (system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?
my $make_targets = ""; if $symlink;
$make_targets .= " links" if $symlink; ### (system 'make depend') == 0 or exit $? if $depflags ne "";
$make_targets .= " depend" if $depflags ne "" && $make_depend; # Run "make depend" manually if you want to be able to delete
$make_targets .= " gentests" if $symlink; # the source code files of ciphers you left out.
(system $make_command.$make_targets) == 0 or exit $?
if $make_targets ne "";
if ( $perl =~ m@^/@) { if ( $perl =~ m@^/@) {
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
&dofile("apps/der_chop",$perl,'^#!/', '#!%s'); &dofile("apps/der_chop",$perl,'^#!/', '#!%s');
@@ -1233,15 +1058,6 @@ EOF
&dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
&dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s'); &dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s');
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
}
if ($depflags ne "" && !$make_depend) {
print <<EOF;
Since you've disabled at least one algorithm, you need to do the following
before building:
make depend
EOF
} }
} }
@@ -1333,7 +1149,7 @@ sub print_table_entry
my $bn_obj,my $des_obj,my $bf_obj, 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 $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 $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); split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
print <<EOF print <<EOF
@@ -1357,44 +1173,7 @@ sub print_table_entry
\$dso_scheme = $dso_scheme \$dso_scheme = $dso_scheme
\$shared_target= $shared_target \$shared_target= $shared_target
\$shared_cflag = $shared_cflag \$shared_cflag = $shared_cflag
\$shared_ldflag = $shared_ldflag
\$shared_extension = $shared_extension \$shared_extension = $shared_extension
\$ranlib = $ranlib \$ranlib = $ranlib
EOF 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;
}

214
FAQ
View File

@@ -8,8 +8,6 @@ OpenSSL - Frequently Asked Questions
* How can I contact the OpenSSL developers? * How can I contact the OpenSSL developers?
* Where can I get a compiled version of OpenSSL? * Where can I get a compiled version of OpenSSL?
* Why aren't tools like 'autoconf' and 'libtool' used? * Why aren't tools like 'autoconf' and 'libtool' used?
* What is an 'engine' version?
* How do I check the authenticity of the OpenSSL distribution?
[LEGAL] Legal questions [LEGAL] Legal questions
@@ -29,19 +27,15 @@ OpenSSL - Frequently Asked Questions
* How can I remove the passphrase on a private key? * How can I remove the passphrase on a private key?
* Why can't I use OpenSSL certificates with SSL client authentication? * Why can't I use OpenSSL certificates with SSL client authentication?
* Why does my browser give a warning about a mismatched hostname? * 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 [BUILD] Questions about building and testing OpenSSL
* Why does the linker complain about undefined symbols? * 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: command not found"?
* Why does the OpenSSL test fail with "bc: 1 no implemented"? * Why does the OpenSSL test fail with "bc: 1 no implemented"?
* Why does the OpenSSL test fail with "bc: stack empty"? * Why does the OpenSSL compilation fail on Alpha True64 Unix?
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
* Why does the OpenSSL compilation fail with "ar: command not found"? * Why does the OpenSSL compilation fail with "ar: command not found"?
* Why does the OpenSSL compilation fail on Win32 with VC++? * Why does the OpenSSL compilation fail on Win32 with VC++?
* What is special about OpenSSL on Redhat?
* Why does the OpenSSL test suite fail on MacOS X?
[PROG] Questions about programming with OpenSSL [PROG] Questions about programming with OpenSSL
@@ -63,7 +57,7 @@ OpenSSL - Frequently Asked Questions
* Which is the current version of OpenSSL? * Which is the current version of OpenSSL?
The current version is available from <URL: http://www.openssl.org>. The current version is available from <URL: http://www.openssl.org>.
OpenSSL 0.9.6h was released on 5 December 2002. OpenSSL 0.9.6b was released on July 9th, 2001.
In addition to the current stable release, you can also access daily In addition to the current stable release, you can also access daily
snapshots of the OpenSSL development version at <URL: snapshots of the OpenSSL development version at <URL:
@@ -127,25 +121,6 @@ A number of Linux and *BSD distributions include OpenSSL.
autoconf will probably be used in future OpenSSL versions. If it was autoconf will probably be used in future OpenSSL versions. If it was
less Unix-centric, it might have been used much earlier. 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.
* How do I check the authenticity of the OpenSSL distribution?
We provide MD5 digests and ASC signatures of each tarball.
Use MD5 to check that a tarball from a mirror site is identical:
md5sum TARBALL | awk '{print $1;}' | cmp - TARBALL.md5
You can check authenticity using pgp or gpg. You need the OpenSSL team
member public key used to sign it (download it from a key server). Then
just do:
pgp TARBALL.asc
[LEGAL] ======================================================================= [LEGAL] =======================================================================
@@ -171,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. their software on operating systems that don't normally include OpenSSL.
If you develop open source software that uses OpenSSL, you may find it 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 "This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed." If you are using 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 GPL software developed by others, you may want to ask the copyright holder
@@ -211,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 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 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 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. Windows systems if the environment variable has not been set.
If the default seeding file does not exist or is too short, the "PRNG If the default seeding file does not exist or is too short, the "PRNG
@@ -232,13 +207,8 @@ For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
installing the SUNski package from Sun patch 105710-01 (Sparc) which installing the SUNski package from Sun patch 105710-01 (Sparc) which
adds a /dev/random device and make sure it gets used, usually through adds a /dev/random device and make sure it gets used, usually through
$RANDFILE. There are probably similar patches for the other Solaris $RANDFILE. There are probably similar patches for the other Solaris
versions. An official statement from Sun with respect to /dev/random versions. However, be warned that /dev/random is usually a blocking
support can be found at device, which may have some effects on OpenSSL.
http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski
However, be warned that /dev/random is usually a blocking device, which
may have some effects on OpenSSL.
A third party /dev/random solution for Solaris is available at
http://www.cosy.sbg.ac.at/~andi/
* Why do I get an "unable to write 'random state'" error message? * Why do I get an "unable to write 'random state'" error message?
@@ -327,7 +297,7 @@ there is little point presenting a certificate which the server will
reject. reject.
The solution is to add the relevant CA certificate to your servers "trusted 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: print out the servers list of acceptable CAs using the OpenSSL s_client tool:
openssl s_client -connect www.some.host:443 -prexit openssl s_client -connect www.some.host:443 -prexit
@@ -346,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. (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] ======================================================================= [BUILD] =======================================================================
* Why does the linker complain about undefined symbols? * Why does the linker complain about undefined symbols?
@@ -409,20 +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. for download instructions) can be safely used, for example.
* Why does the OpenSSL test fail with "bc: stack empty"? * Why does the OpenSSL compilation fail on Alpha True64 Unix?
On some DG/ux versions, bc seems to have a too small stack for calculations On some Alpha installations running True64 Unix and Compaq C, the compilation
that the OpenSSL bntest throws at it. This gets triggered when you run the
test suite (using "make test"). The message returned is "bc: stack empty".
The best way to deal with this is to find another implementation of bc
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?
On some Alpha installations running Tru64 Unix and Compaq C, the compilation
of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual 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 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 a compiler bug. What happens is that it eats up a lot of resident memory
@@ -484,52 +423,6 @@ under 'Program Files'). This needs to be done prior to running NMAKE,
and the changes are only valid for the current DOS session. and the changes are only valid for the current DOS session.
* What is special about OpenSSL on Redhat?
Red Hat Linux (release 7.0 and later) include a preinstalled limited
version of OpenSSL. For patent reasons, support for IDEA, RC5 and MDC2
is disabled in this version. The same may apply to other Linux distributions.
Users may therefore wish to install more or all of the features left out.
To do this you MUST ensure that you do not overwrite the openssl that is in
/usr/bin on your Red Hat machine. Several packages depend on this file,
including sendmail and ssh. /usr/local/bin is a good alternative choice. The
libraries that come with Red Hat 7.0 onwards have different names and so are
not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
/lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
/lib/libcrypto.so.2 respectively).
Please note that we have been advised by Red Hat attempting to recompile the
openssl rpm with all the cryptography enabled will not work. All other
packages depend on the original Red Hat supplied openssl package. It is also
worth noting that due to the way Red Hat supplies its packages, updates to
openssl on each distribution never change the package version, only the
build number. For example, on Red Hat 7.1, the latest openssl package has
version number 0.9.6 and build number 9 even though it contains all the
relevant updates in packages up to and including 0.9.6b.
A possible way around this is to persuade Red Hat to produce a non-US
version of Red Hat Linux.
FYI: Patent numbers and expiry dates of US patents:
MDC-2: 4,908,861 13/03/2007
IDEA: 5,214,703 25/05/2010
RC5: 5,724,428 03/03/2015
* Why does the OpenSSL test suite fail on MacOS X?
If the failure happens when running 'make test' and the RC4 test fails,
it's very probable that you have OpenSSL 0.9.6b delivered with the
operating system (you can find out by running '/usr/bin/openssl version')
and that you were trying to build OpenSSL 0.9.6d. The problem is that
the loader ('ld') in MacOS X has a misfeature that's quite difficult to
go around and has linked the programs "openssl" and the test programs
with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the
libraries you just built.
Look in the file PROBLEMS for a more detailed explanation and for possible
solutions.
[PROG] ======================================================================== [PROG] ========================================================================
* Is OpenSSL thread-safe? * Is OpenSSL thread-safe?
@@ -546,43 +439,10 @@ OpenSSL. This is described in the threads(3) manpage.
* I've compiled a program under Windows and it crashes: why? * I've compiled a program under Windows and it crashes: why?
This is usually because you've missed the comment in INSTALL.W32. This is usually because you've missed the comment in INSTALL.W32. You
Your application must link against the same version of the Win32 must link with the multithreaded DLL version of the VC++ runtime library
C-Runtime against which your openssl libraries were linked. The otherwise the conflict will cause a program to crash: typically on the
default version for OpenSSL is /MD - "Multithreaded DLL". first BIO related read or write operation.
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.
* How do I read or write a DER encoded buffer using the ASN1 functions? * How do I read or write a DER encoded buffer using the ASN1 functions?
@@ -663,16 +523,44 @@ OpenSSL_add_all_algorithms(). See the manual page for more information.
* Why can't the OpenSSH configure script detect OpenSSL? * Why can't the OpenSSH configure script detect OpenSSL?
Several reasons for problems with the automatic detection exist. There is a problem with OpenSSH 1.2.2p1, in that the configure script
OpenSSH requires at least version 0.9.5a of the OpenSSL libraries. can't find the installed OpenSSL libraries. The problem is actually
Sometimes the distribution has installed an older version in the system a small glitch that is easily solved with the following patch to be
locations that is detected instead of a new one installed. The OpenSSL applied to the OpenSSH distribution:
library might have been compiled for another CPU or another mode (32/64 bits).
Permissions might be wrong. ----- 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? * Can I use OpenSSL's SSL library with non-blocking I/O?
@@ -691,7 +579,7 @@ SSL_write() will try to continue any pending handshake.
* Why doesn't my server application receive a client certificate? * Why doesn't my server application receive a client certificate?
Due to the TLS protocol definition, a client will only send a 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. SSL_CTX_set_verify() function to enable the use of client certificates.

32
INSTALL
View File

@@ -57,10 +57,7 @@
shared In addition to the usual static libraries, create shared shared In addition to the usual static libraries, create shared
libraries on platforms where it's supported. See "Note on libraries on platforms where it's supported. See "Note on
shared libraries" below. THIS IS NOT RECOMMENDED! Since shared libraries" below.
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. no-asm Do not use assembler code.
@@ -131,11 +128,8 @@
the failure that aren't problems in OpenSSL itself (like missing the failure that aren't problems in OpenSSL itself (like missing
standard headers). If it is a problem with OpenSSL itself, please standard headers). If it is a problem with OpenSSL itself, please
report the problem to <openssl-bugs@openssl.org> (note that your report the problem to <openssl-bugs@openssl.org> (note that your
message will be recorded in the request tracker publicly readable message will be forwarded to a public mailing list). Include the
via http://www.openssl.org/rt2.html and will be forwarded to a public output of "make report" in your message.
mailing list). Include the output of "make report" in your message.
Please check out the request tracker. Maybe the bug was already
reported or has already been fixed.
[If you encounter assembler error messages, try the "no-asm" [If you encounter assembler error messages, try the "no-asm"
configuration option as an immediate fix.] configuration option as an immediate fix.]
@@ -153,8 +147,7 @@
try removing any compiler optimization flags from the CFLAGS line try removing any compiler optimization flags from the CFLAGS line
in Makefile.ssl and run "make clean; make". Please send a bug in Makefile.ssl and run "make clean; make". Please send a bug
report to <openssl-bugs@openssl.org>, including the output of report to <openssl-bugs@openssl.org>, including the output of
"make report" in order to be added to the request tracker at "make report".
http://www.openssl.org/rt2.html.
4. If everything tests ok, install OpenSSL with 4. If everything tests ok, install OpenSSL with
@@ -276,11 +269,6 @@
Note on shared libraries 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 For some systems, the OpenSSL Configure script knows what is needed to
build shared libraries for libcrypto and libssl. On these systems, build shared libraries for libcrypto and libssl. On these systems,
the shared libraries are currently not created by default, but giving the shared libraries are currently not created by default, but giving
@@ -288,15 +276,3 @@
targets for shared library creation, like linux-shared. Those targets targets for shared library creation, like linux-shared. Those targets
can currently be used on their own just as well, but this is expected can currently be used on their own just as well, but this is expected
to change in future versions of OpenSSL. to change in future versions of OpenSSL.
Note on random number generation
--------------------------------
Availability of cryptographically secure random numbers is required for
secret key generation. OpenSSL provides several options to seed the
internal PRNG. If not properly seeded, the internal PRNG will refuse
to deliver random bytes and a "PRNG not seeded error" will occur.
On systems without /dev/urandom (or similar) device, it may be necessary
to install additional support software to obtain random seed.
Please check out the manual pages for RAND_add(), RAND_bytes(), RAND_egd(),
and the FAQ for more information.

View File

@@ -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 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 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 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 BSD sockets and some other POSIX APIs. The GUSI distribution is
expected to be found in the same directory as openssl source tree, 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, 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 http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
Finally some essential comments from our generous contributor:-) Finally some essential comments from our generous contributor:-)

View File

@@ -2,19 +2,16 @@
INSTALLATION ON THE WIN32 PLATFORM INSTALLATION ON THE WIN32 PLATFORM
---------------------------------- ----------------------------------
Heres a few comments about building OpenSSL in Windows environments. Most Heres a few comments about building OpenSSL in Windows environments. Most of
of this is tested on Win32 but it may also work in Win 3.1 with some this is tested on Win32 but it may also work in Win 3.1 with some
modification. modification.
You need Perl for Win32. Unless you will build on Cygwin, you will need You need Perl for Win32 (available from http://www.activestate.com/ActivePerl)
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
For Cygwin users, there's more info in the Cygwin section.
and one of the following C compilers: and one of the following C compilers:
* Visual C++ * Visual C++
* Borland 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 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 you will need an assembler. This is worth doing because it will result in
@@ -81,9 +78,8 @@
There are various changes you can make to the Win32 compile environment. By 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' 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. Note that mk1mf.pl expects the platform to be the last argument compiled in.
on the command line, so 'debug' must appear before that, as all other options.
The default Win32 environment is to leave out any Windows NT specific The default Win32 environment is to leave out any Windows NT specific
features. features.
@@ -95,18 +91,6 @@
You can also build a static version of the library using the Makefile You can also build a static version of the library using the Makefile
ms\nt.mak ms\nt.mak
Borland C++ builder 5
---------------------
* Configure for building with Borland Builder:
> perl Configure BC-32
* Create the appropriate makefile
> ms\do_nasm
* Build
> make -f ms\bcb.mak
Borland C++ builder 3 and 4 Borland C++ builder 3 and 4
--------------------------- ---------------------------
@@ -150,30 +134,28 @@
> cd out > cd out
> ..\ms\test > ..\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 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. 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 contrasted to Mingw32 which links dynamically to msvcrt.dll or
crtdll.dll. 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 * Install Perl and ensure it is in the path
(version 5.6.1-2 of the latter has been reported to work) or
ActivePerl)
* Run the Cygwin bash shell * Run the CygWin bash shell
* $ tar zxvf openssl-x.x.x.tar.gz * $ tar zxvf openssl-x.x.x.tar.gz
$ cd openssl-x.x.x $ cd openssl-x.x.x
$ ./config $ ./Configure no-threads CygWin32
[...] [...]
$ make $ make
[...] [...]
@@ -182,28 +164,27 @@
This will create a default install in /usr/local/ssl. This will create a default install in /usr/local/ssl.
Cygwin Notes: CygWin32 Notes:
"make test" and normal file operations may fail in directories "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 stripping of carriage returns. To avoid this ensure that a binary
mount is used, e.g. mount -b c:\somewhere /home. 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 of cr/lf issues. These make procedures succeeded with versions 1.1 and
the snapshot 20000524 (Slow!). 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 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 Installation
------------ ------------
If you used the Cygwin procedure above, you have already installed and There's currently no real installation procedure for Win32. There are,
can skip this section. For all other procedures, there's currently no real however, some suggestions:
installation procedure for Win32. There are, however, some suggestions:
- do nothing. The include files are found in the inc32/ subdirectory, - do nothing. The include files are found in the inc32/ subdirectory,
all binaries are found in out32dll/ or out32/ depending if you built all binaries are found in out32dll/ or out32/ depending if you built

View File

@@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions

View File

@@ -1287,7 +1287,7 @@ EXITPOINT:
// Send some bytes // Send some bytes
int MacSocket_send(const int inSocketNum,const void *inBuff,int inBuffLength) int MacSocket_send(const int inSocketNum,void *inBuff,int inBuffLength)
{ {
OSErr errCode = noErr; OSErr errCode = noErr;
int bytesSent = 0; int bytesSent = 0;
@@ -1604,4 +1604,4 @@ EPInfo* epi = (EPInfo*) context;
} }
} }
} }
*/ */

View File

@@ -62,7 +62,7 @@ int MacSocket_recv(const int inSocketNum,void *outBuff,int outBuffLength,const B
// Call this to send data on a socket // Call this to send data on a socket
int MacSocket_send(const int inSocketNum,const void *inBuff,int inBuffLength); int MacSocket_send(const int inSocketNum,void *inBuff,int inBuffLength);
// If zero bytes were read in a call to MacSocket_recv(), it may be that the remote end has done a half-close // If zero bytes were read in a call to MacSocket_recv(), it may be that the remote end has done a half-close

View File

@@ -162,7 +162,7 @@ SHLIBDIRS= crypto ssl
SDIRS= \ SDIRS= \
md2 md4 md5 sha mdc2 hmac ripemd \ md2 md4 md5 sha mdc2 hmac ripemd \
des rc2 rc4 rc5 idea bf cast \ des rc2 rc4 rc5 idea bf cast \
bn rsa dsa dh dso engine \ bn rsa dsa dh dso \
buffer bio stack lhash rand err objects \ buffer bio stack lhash rand err objects \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp 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_SSL=libssl$(SHLIB_EXT)
SHARED_LIBS= SHARED_LIBS=
SHARED_LIBS_LINK_EXTS= SHARED_LIBS_LINK_EXTS=
SHARED_LDFLAGS=
GENERAL= Makefile GENERAL= Makefile
BASENAME= openssl BASENAME= openssl
@@ -236,23 +235,19 @@ clean-shared:
done; \ done; \
fi; \ fi; \
( set -x; rm -f lib$$i$(SHLIB_EXT) ); \ ( 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 done
link-shared: link-shared:
@if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ @for i in $(SHLIBDIRS); do \
tmp="$(SHARED_LIBS_LINK_EXTS)"; \ prev=lib$$i$(SHLIB_EXT); \
for i in $(SHLIBDIRS); do \ if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
prev=lib$$i$(SHLIB_EXT); \ tmp="$(SHARED_LIBS_LINK_EXTS)"; \
for j in $${tmp:-x}; do \ for j in $${tmp:-x}; do \
( set -x; \ ( set -x; ln -f -s $$prev lib$$i$$j ); \
rm -f lib$$i$$j; ln -s $$prev lib$$i$$j ); \
prev=lib$$i$$j; \ prev=lib$$i$$j; \
done; \ done; \
done; \ fi; \
fi done
build-shared: clean-shared do_$(SHLIB_TARGET) link-shared build-shared: clean-shared do_$(SHLIB_TARGET) link-shared
@@ -260,220 +255,29 @@ do_bsd-gcc-shared: do_gnu-shared
do_linux-shared: do_gnu-shared do_linux-shared: do_gnu-shared
do_gnu-shared: do_gnu-shared:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} ${SHARED_LDFLAGS} \ ( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ -Wl,-S,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-Bsymbolic \
-Wl,--whole-archive lib$$i.a \ -Wl,--whole-archive lib$$i.a \
-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \ -Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \ libs="$$libs -l$$i"; \
done done
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \ # This assumes that GNU utilities are *not* used
my_ld=`${CC} -print-prog-name=ld 2>&1` && \ do_tru64-shared:
[ -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:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x ; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \ ( set -x; ${CC} -shared -no_archive -o lib$$i.so \
lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \ -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
-compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \ -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
-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; \
libs="$$libs -l$$i"; \ libs="$$libs -l$$i"; \
done 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 # This assumes that GNU utilities are *not* used
do_solaris-shared: 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 \ libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \ ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
+vnocompatwarnings \ set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \ -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \ -z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
-Fl lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} ; \
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; \
chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} ; \
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; \
libs="$$libs -l$$i"; \ libs="$$libs -l$$i"; \
done done
@@ -527,10 +331,6 @@ links:
fi; \ fi; \
done; done;
gentests:
@(cd test && echo "generating dummy tests (if needed)..." && \
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' 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}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
dclean: dclean:
rm -f *.bak rm -f *.bak
@for i in $(DIRS) ;\ @for i in $(DIRS) ;\
@@ -550,7 +350,7 @@ test: tests
tests: rehash tests: rehash
@(cd test && echo "testing..." && \ @(cd test && echo "testing..." && \
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' 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}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' OPENSSL_DEBUG_MEMORY=on 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 @apps/openssl version -a
report: report:
@@ -561,7 +361,7 @@ depend:
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making dependencies $$i..." && \ (cd $$i && echo "making dependencies $$i..." && \
$(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ) || exit 1; \ $(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' depend ) || exit 1; \
fi; \ fi; \
done; done;
@@ -584,51 +384,42 @@ tags:
done; done;
errors: errors:
$(PERL) util/mkerr.pl -recurse -write perl util/mkerr.pl -recurse -write
stacks: stacks:
$(PERL) util/mkstack.pl -write perl util/mkstack.pl -write
util/libeay.num:: util/libeay.num::
$(PERL) util/mkdef.pl crypto update perl util/mkdef.pl crypto update
util/ssleay.num:: 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 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 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 TABLE: Configure
(echo 'Output of `Configure TABLE'"':"; \ (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 update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
# Build distribution tar-file. As the list of files returned by "find" is
# pretty long, on several platforms a "too many arguments" error or similar
# would occur. Therefore the list of files is temporarily stored into a file
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option.
tar: tar:
find . -type d -print | xargs chmod 755 @$(TAR) $(TARFLAGS) -cvf - \
find . -type f -print | xargs chmod a+r `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort` |\
find . -type f -perm -0100 -print | xargs chmod a+x
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
tardy --user_number=0 --user_name=openssl \ tardy --user_number=0 --user_name=openssl \
--group_number=0 --group_name=openssl \ --group_number=0 --group_name=openssl \
--prefix=openssl-$(VERSION) - |\ --prefix=openssl-$(VERSION) - |\
gzip --best >../$(TARFILE).gz; \ gzip --best >../$(TARFILE).gz; \
rm -f ../$(TARFILE).list; \
ls -l ../$(TARFILE).gz ls -l ../$(TARFILE).gz
dist: dist:
$(PERL) Configure dist $(PERL) Configure dist
@$(MAKE) dist_pem_h @$(MAKE) dist_pem_h
@$(MAKE) SDIRS='${SDIRS}' clean @$(MAKE) SDIRS='${SDIRS}' clean
@$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar @$(MAKE) tar
dist_pem_h: dist_pem_h:
(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean) (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
@@ -657,37 +448,24 @@ install: all install_docs
do \ do \
if [ -f "$$i" ]; then \ if [ -f "$$i" ]; then \
( echo installing $$i; \ ( echo installing $$i; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \ fi \
fi; \
done done
@if [ -n "$(SHARED_LIBS)" ]; then \ @if [ -n "$(SHARED_LIBS)" ]; then \
tmp="$(SHARED_LIBS)"; \ tmp="$(SHARED_LIBS)"; \
for i in $${tmp:-x}; \ for i in $${tmp:-x}; \
do \ do \
if [ -f "$$i" -o -f "$$i.a" ]; then \ if [ -f "$$i" ]; then \
( echo installing $$i; \ ( echo installing $$i; \
if [ "$(PLATFORM)" != "Cygwin" ]; then \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ fi \
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
else \
c=`echo $$i | sed 's/^lib/cyg/'`; \
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
mv $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
fi ); \
fi; \
done; \ done; \
( here="`pwd`"; \ ( here="`pwd`"; \
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
set $(MAKE); \ make -f $$here/Makefile link-shared ); \
$$1 -f $$here/Makefile link-shared ); \
fi fi
install_docs: install_docs:
@@ -696,25 +474,22 @@ install_docs:
$(INSTALL_PREFIX)$(MANDIR)/man3 \ $(INSTALL_PREFIX)$(MANDIR)/man3 \
$(INSTALL_PREFIX)$(MANDIR)/man5 \ $(INSTALL_PREFIX)$(MANDIR)/man5 \
$(INSTALL_PREFIX)$(MANDIR)/man7 $(INSTALL_PREFIX)$(MANDIR)/man7
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \ @for i in doc/apps/*.pod; do \
for i in doc/apps/*.pod; do \
fn=`basename $$i .pod`; \ fn=`basename $$i .pod`; \
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \ if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \ echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
(cd `$(PERL) util/dirname.pl $$i`; \ (cd `dirname $$i`; \
sh -c "$$pod2man \ $(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
--section=$$sec --center=OpenSSL \ --release=$(VERSION) `basename $$i`) \
--release=$(VERSION) `basename $$i`") \
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
done; \ done
for i in doc/crypto/*.pod doc/ssl/*.pod; do \ @for i in doc/crypto/*.pod doc/ssl/*.pod; do \
fn=`basename $$i .pod`; \ fn=`basename $$i .pod`; \
if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \ if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \ echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
(cd `$(PERL) util/dirname.pl $$i`; \ (cd `dirname $$i`; \
sh -c "$$pod2man \ $(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
--section=$$sec --center=OpenSSL \ --release=$(VERSION) `basename $$i`) \
--release=$(VERSION) `basename $$i`") \
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
done done

49
NEWS
View File

@@ -5,52 +5,7 @@
This file gives a brief overview of the major changes between each OpenSSL This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file. release. For more details please read the CHANGES file.
Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h: Changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
o New configuration targets for Tandem OSS and A/UX.
o New OIDs for Microsoft attributes.
o Better handling of SSL session caching.
o Better comparison of distinguished names.
o Better handling of shared libraries in a mixed GNU/non-GNU environment.
o Support assembler code with Borland C.
o Fixes for length problems.
o Fixes for uninitialised variables.
o Fixes for memory leaks, some unusual crashes and some race conditions.
o Fixes for smaller building problems.
o Updates of manuals, FAQ and other instructive documents.
Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g:
o Important building fixes on Unix.
Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f:
o Various important bugfixes.
Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e:
o Important security related bugfixes.
o Various SSL/TLS library bugfixes.
Major 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.
Major 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].
Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
o Security fix: PRNG improvements. o Security fix: PRNG improvements.
o Security fix: RSA OAEP check. o Security fix: RSA OAEP check.
@@ -83,7 +38,7 @@
o Bug fixes for Win32, HP/UX and Irix. o Bug fixes for Win32, HP/UX and Irix.
o Bug fixes in BIGNUM, SSL, PKCS#7, PKCS#12, X.509, CONF and o Bug fixes in BIGNUM, SSL, PKCS#7, PKCS#12, X.509, CONF and
memory checking routines. memory checking routines.
o Bug fixes for RSA operations in threaded environments. o Bug fixes for RSA operations in threaded enviroments.
o Bug fixes in misc. openssl applications. o Bug fixes in misc. openssl applications.
o Remove a few potential memory leaks. o Remove a few potential memory leaks.
o Add tighter checks of BIGNUM routines. o Add tighter checks of BIGNUM routines.

View File

@@ -1,58 +0,0 @@
* System libcrypto.dylib and libssl.dylib are used by system ld on MacOS X.
[NOTE: This is currently undergoing tests, and may be removed soon]
This is really a misfeature in ld, which seems to look for .dylib libraries
along the whole library path before it bothers looking for .a libraries. This
means that -L switches won't matter unless OpenSSL is built with shared
library support.
The workaround may be to change the following lines in apps/Makefile.ssl and
test/Makefile.ssl:
LIBCRYPTO=-L.. -lcrypto
LIBSSL=-L.. -lssl
to:
LIBCRYPTO=../libcrypto.a
LIBSSL=../libssl.a
It's possible that something similar is needed for shared library support
as well. That hasn't been well tested yet.
Another solution that many seem to recommend is to move the libraries
/usr/lib/libcrypto.0.9.dylib, /usr/lib/libssl.0.9.dylib to a different
directory, build and install OpenSSL and anything that depends on your
build, then move libcrypto.0.9.dylib and libssl.0.9.dylib back to their
original places. Note that the version numbers on those two libraries
may differ on your machine.
As long as Apple doesn't fix the problem with ld, this problem building
OpenSSL will remain as is.
* Parallell make leads to errors
While running tests, running a parallell make is a bad idea. Many test
scripts use the same name for output and input files, which means different
will interfere with each other and lead to test failure.
The solution is simple for now: don't run parallell make when testing.
* Bugs in gcc 3.0 triggered
According to a problem report, there are bugs in gcc 3.0 that are
triggered by some of the code in OpenSSL, more specifically in
PEM_get_EVP_CIPHER_INFO(). The triggering code is the following:
header+=11;
if (*header != '4') return(0); header++;
if (*header != ',') return(0); header++;
What happens is that gcc might optimize a little too agressively, and
you end up with an extra incrementation when *header != '4'.
We recommend that you upgrade gcc to as high a 3.x version as you can.

33
README
View File

@@ -1,7 +1,7 @@
OpenSSL 0.9.6h [engine] 5 Dec 2002 OpenSSL 0.9.6b 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 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
All rights reserved. All rights reserved.
@@ -62,7 +62,7 @@
X.509v3 certificates X.509v3 certificates
X509 encoding/decoding into/from binary ASN1 and a PEM 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 private key. Program to generate RSA and DSA certificate
requests and to generate RSA and DSA certificates. requests and to generate RSA and DSA certificates.
@@ -97,7 +97,7 @@
locations around the world. _YOU_ are responsible for ensuring that your use 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 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 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 RSA Security holds software patents on the RC5 algorithm. If you
intend to use this cipher, you must contact RSA Security for intend to use this cipher, you must contact RSA Security for
@@ -107,8 +107,8 @@
only be used with RSA Security's permission. only be used with RSA Security's permission.
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy, The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They Japan, Netherlands, Spain, Sweden, Switzerland, UK and the USA. They should
should be contacted if that algorithm is to be used; their web page is be contacted if that algorithm is to be used, their web page is
http://www.ascom.ch/. http://www.ascom.ch/.
INSTALLATION INSTALLATION
@@ -119,15 +119,8 @@
INSTALL.VMS. INSTALL.VMS.
Read the documentation in the doc/ directory. It is quite rough, but it 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 lists the functions, you will probably have to look at the code to work out
how to use them. Look at the example programs. how to used them. Look at the example programs.
PROBLEMS
--------
For some platforms, there are some known problems that may affect the user
or application author. We try to collect those in doc/PROBLEMS, with current
thoughts on how they should be solved in a future of OpenSSL.
SUPPORT SUPPORT
------- -------
@@ -153,13 +146,11 @@
- Problem Description (steps that will reproduce the problem, if known) - Problem Description (steps that will reproduce the problem, if known)
- Stack Traceback (if the application dumps core) - Stack Traceback (if the application dumps core)
Report the bug to the OpenSSL project via the Request Tracker Report the bug to the OpenSSL project at:
(http://www.openssl.org/rt2.html) by mail to:
openssl-bugs@openssl.org openssl-bugs@openssl.org
Note that mail to openssl-bugs@openssl.org is recorded in the publicly Note that mail to openssl-bugs@openssl.org is forwarded to a public
readable request tracker database and is forwarded to a public
mailing list. Confidential mail may be sent to openssl-security@openssl.org mailing list. Confidential mail may be sent to openssl-security@openssl.org
(PGP key available from the key servers). (PGP key available from the key servers).
@@ -173,9 +164,7 @@
textual explanation of what your patch does. textual explanation of what your patch does.
Note: For legal reasons, contributions from the US can be accepted only Note: For legal reasons, contributions from the US can be accepted only
if a TSA notification and a copy of the patch is sent to crypt@bis.doc.gov; if a copy of the patch is sent to crypt@bxa.doc.gov
see http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
and http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e)).
The preferred format for changes is "diff -u" output. You might The preferred format for changes is "diff -u" output. You might
generate it like this: generate it like this:

View File

@@ -5,7 +5,7 @@
With OpenSSL 0.9.6, a new component has been added to support external With OpenSSL 0.9.6, a new component has been added to support external
crypto devices, for example accelerator cards. The component is called crypto devices, for example accelerator cards. The component is called
ENGINE, and has still a pretty experimental status and almost no 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. calling programs.
There's currently built-in support for the following crypto devices: 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 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 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 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 device, or the built-in crypto routines will be used, just as in the
default OpenSSL distribution. default OpenSSL distribution.
@@ -56,7 +56,7 @@
PROBLEMS 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 Win32. A quick test done right before the release showed that trying
"openssl speed -engine cswift" generated errors. If the DSO gets enabled, "openssl speed -engine cswift" generated errors. If the DSO gets enabled,
an attempt is made to write at memory address 0x00000002. an attempt is made to write at memory address 0x00000002.

41
STATUS
View File

@@ -1,17 +1,9 @@
OpenSSL STATUS Last modified at OpenSSL STATUS Last modified at
______________ $Date: 2002/12/05 22:50:27 $ ______________ $Date: 2001/04/05 17:42:00 $
DEVELOPMENT STATE DEVELOPMENT STATE
o OpenSSL 0.9.7: Under development...
o OpenSSL 0.9.6h: Released on December 5th, 2002
o OpenSSL 0.9.6g: Released on August 9th, 2002
o OpenSSL 0.9.6f: Released on August 8th, 2002
o OpenSSL 0.9.6e: Released on July 30th, 2002
o OpenSSL 0.9.6d: Released on May 9th, 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.6a: Released on April 5th, 2001
o OpenSSL 0.9.6: Released on September 24th, 2000 o OpenSSL 0.9.6: Released on September 24th, 2000
o OpenSSL 0.9.5a: Released on April 1st, 2000 o OpenSSL 0.9.5a: Released on April 1st, 2000
@@ -24,12 +16,8 @@
RELEASE SHOWSTOPPERS RELEASE SHOWSTOPPERS
o none
AVAILABLE PATCHES AVAILABLE PATCHES
o
IN PROGRESS IN PROGRESS
o Steve is currently working on (in no particular order): o Steve is currently working on (in no particular order):
@@ -43,25 +31,32 @@
o Geoff and Richard are currently working on: o Geoff and Richard are currently working on:
ENGINE (the new code that gives hardware support among others). ENGINE (the new code that gives hardware support among others).
o Richard is currently working on: o Richard is currently working on:
UI (User Interface)
UTIL (a new set of library functions to support some higher level UTIL (a new set of library functions to support some higher level
functionality that is currently missing). functionality that is currently missing).
Shared library support for VMS. Shared library support for VMS.
OCSP
Kerberos 5 authentication Kerberos 5 authentication
Constification Constification
OCSP
NEEDS PATCH NEEDS PATCH
o apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file 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 o Whenever strncpy is used, make sure the resulting string is NULL-terminated
or an error is reported or an error is reported
o "OpenSSL STATUS" is never up-to-date.
OPEN ISSUES 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: o The Makefile hierarchy and build mechanism is still not a round thing:
1. The config vs. Configure scripts 1. The config vs. Configure scripts
@@ -104,14 +99,4 @@
WISHES WISHES
o SRP in TLS. o
[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.

941
TABLE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -170,8 +170,6 @@ int str2fmt(char *s)
|| (strcmp(s,"PKCS12") == 0) || (strcmp(s,"pkcs12") == 0) || (strcmp(s,"PKCS12") == 0) || (strcmp(s,"pkcs12") == 0)
|| (strcmp(s,"P12") == 0) || (strcmp(s,"p12") == 0)) || (strcmp(s,"P12") == 0) || (strcmp(s,"p12") == 0))
return(FORMAT_PKCS12); return(FORMAT_PKCS12);
else if ((*s == 'E') || (*s == 'e'))
return(FORMAT_ENGINE);
else else
return(FORMAT_UNDEF); return(FORMAT_UNDEF);
} }
@@ -230,16 +228,9 @@ void program_name(char *in, char *out, int size)
q=strrchr(p,'.'); q=strrchr(p,'.');
if (q == NULL) if (q == NULL)
q = p + strlen(p); q = in+size;
strncpy(out,p,size-1); strncpy(out,p,q-p);
if (q-p >= size) out[q-p]='\0';
{
out[size-1]='\0';
}
else
{
out[q-p]='\0';
}
} }
#else #else
void program_name(char *in, char *out, int size) void program_name(char *in, char *out, int size)
@@ -764,7 +755,7 @@ int set_name_ex(unsigned long *flags, const char *arg)
void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags) void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
{ {
char *buf; char buf[256];
char mline = 0; char mline = 0;
int indent = 0; int indent = 0;
if(title) BIO_puts(out, title); if(title) BIO_puts(out, title);
@@ -773,10 +764,9 @@ void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
indent = 4; indent = 4;
} }
if(lflags == XN_FLAG_COMPAT) { if(lflags == XN_FLAG_COMPAT) {
buf = X509_NAME_oneline(nm, 0, 0); X509_NAME_oneline(nm,buf,256);
BIO_puts(out, buf); BIO_puts(out,buf);
BIO_puts(out, "\n"); BIO_puts(out, "\n");
OPENSSL_free(buf);
} else { } else {
if(mline) BIO_puts(out, "\n"); if(mline) BIO_puts(out, "\n");
X509_NAME_print_ex(out, nm, indent, lflags); X509_NAME_print_ex(out, nm, indent, lflags);

View File

@@ -92,10 +92,8 @@ int WIN32_rename(char *oldname,char *newname);
#define MAIN(a,v) main(a,v) #define MAIN(a,v) main(a,v)
#ifndef NON_MAIN #ifndef NON_MAIN
LHASH *config=NULL;
BIO *bio_err=NULL; BIO *bio_err=NULL;
#else #else
extern LHASH *config;
extern BIO *bio_err; extern BIO *bio_err;
#endif #endif
@@ -164,8 +162,6 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format);
#define FORMAT_NETSCAPE 4 #define FORMAT_NETSCAPE 4
#define FORMAT_PKCS12 5 #define FORMAT_PKCS12 5
#define FORMAT_SMIME 6 #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" #define NETSCAPE_CERT_HDR "certificate"

View File

@@ -181,7 +181,7 @@ bad:
BIO_printf(bio_err,"where options are\n"); BIO_printf(bio_err,"where options are\n");
BIO_printf(bio_err," -inform arg input format - one of DER TXT PEM\n"); BIO_printf(bio_err," -inform arg input format - one of DER TXT PEM\n");
BIO_printf(bio_err," -in arg input file\n"); BIO_printf(bio_err," -in arg input file\n");
BIO_printf(bio_err," -out arg output file (output format is always DER\n"); BIO_printf(bio_err," -out arg output file\n");
BIO_printf(bio_err," -noout arg don't produce any output\n"); BIO_printf(bio_err," -noout arg don't produce any output\n");
BIO_printf(bio_err," -offset arg offset into file\n"); BIO_printf(bio_err," -offset arg offset into file\n");
BIO_printf(bio_err," -length arg length of section in file\n"); BIO_printf(bio_err," -length arg length of section in file\n");
@@ -192,6 +192,7 @@ bad:
BIO_printf(bio_err," -strparse offset\n"); BIO_printf(bio_err," -strparse offset\n");
BIO_printf(bio_err," a series of these can be used to 'dig' into multiple\n"); BIO_printf(bio_err," a series of these can be used to 'dig' into multiple\n");
BIO_printf(bio_err," ASN1 blob wrappings\n"); BIO_printf(bio_err," ASN1 blob wrappings\n");
BIO_printf(bio_err," -out filename output DER encoding to file\n");
goto end; goto end;
} }
@@ -328,6 +329,6 @@ end:
if (at != NULL) ASN1_TYPE_free(at); if (at != NULL) ASN1_TYPE_free(at);
if (osk != NULL) sk_free(osk); if (osk != NULL) sk_free(osk);
OBJ_cleanup(); OBJ_cleanup();
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -74,7 +74,6 @@
#include <openssl/x509v3.h> #include <openssl/x509v3.h>
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#ifndef W_OK #ifndef W_OK
# ifdef VMS # ifdef VMS
@@ -83,7 +82,7 @@
# else # else
# include <unixlib.h> # include <unixlib.h>
# endif # endif
# elif !defined(VXWORKS) # else
# include <sys/file.h> # include <sys/file.h>
# endif # endif
#endif #endif
@@ -168,7 +167,6 @@ static char *ca_usage[]={
" -revoke file - Revoke a certificate (given in file)\n", " -revoke file - Revoke a certificate (given in file)\n",
" -extensions .. - Extension section (override value in config file)\n", " -extensions .. - Extension section (override value in config file)\n",
" -crlexts .. - CRL 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 NULL
}; };
@@ -218,7 +216,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
char *key=NULL,*passargin=NULL; char *key=NULL,*passargin=NULL;
int total=0; int total=0;
int total_done=0; int total_done=0;
@@ -271,7 +268,6 @@ int MAIN(int argc, char **argv)
#define BSIZE 256 #define BSIZE 256
MS_STATIC char buf[3][BSIZE]; MS_STATIC char buf[3][BSIZE];
char *randfile=NULL; char *randfile=NULL;
char *engine = NULL;
#ifdef EFENCE #ifdef EFENCE
EF_PROTECT_FREE=1; EF_PROTECT_FREE=1;
@@ -423,11 +419,6 @@ EF_ALIGNMENT=0;
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
crl_ext= *(++argv); crl_ext= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else else
{ {
bad: bad:
@@ -448,24 +439,6 @@ bad:
ERR_load_crypto_strings(); 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("OPENSSL_CONF");
if (configfile == NULL) configfile = getenv("SSLEAY_CONF"); if (configfile == NULL) configfile = getenv("SSLEAY_CONF");
@@ -570,7 +543,7 @@ bad:
goto err; goto err;
} }
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,key); pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,key);
if(key) OPENSSL_cleanse(key,strlen(key)); if(key) memset(key,0,strlen(key));
if (pkey == NULL) if (pkey == NULL)
{ {
BIO_printf(bio_err,"unable to load CA private key\n"); BIO_printf(bio_err,"unable to load CA private key\n");
@@ -633,14 +606,12 @@ bad:
that to access(). However, time's too short to do that just that to access(). However, time's too short to do that just
now. now.
*/ */
#ifndef VXWORKS
if (access(outdir,R_OK|W_OK|X_OK) != 0) if (access(outdir,R_OK|W_OK|X_OK) != 0)
{ {
BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir); BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir);
perror(outdir); perror(outdir);
goto err; goto err;
} }
#endif
if (stat(outdir,&sb) != 0) if (stat(outdir,&sb) != 0)
{ {
@@ -858,14 +829,9 @@ bad:
} }
if (verbose) if (verbose)
{ {
if (BN_is_zero(serial)) if ((f=BN_bn2hex(serial)) == NULL) goto err;
BIO_printf(bio_err,"next serial number is 00\n"); BIO_printf(bio_err,"next serial number is %s\n",f);
else OPENSSL_free(f);
{
if ((f=BN_bn2hex(serial)) == NULL) goto err;
BIO_printf(bio_err,"next serial number is %s\n",f);
OPENSSL_free(f);
}
} }
if ((attribs=CONF_get_section(conf,policy)) == NULL) if ((attribs=CONF_get_section(conf,policy)) == NULL)
@@ -1142,7 +1108,7 @@ bad:
} }
if ((crldays == 0) && (crlhours == 0)) if ((crldays == 0) && (crlhours == 0))
{ {
BIO_printf(bio_err,"cannot lookup how long until the next CRL is issued\n"); BIO_printf(bio_err,"cannot lookup how long until the next CRL is issuer\n");
goto err; goto err;
} }
@@ -1309,7 +1275,7 @@ err:
X509_CRL_free(crl); X509_CRL_free(crl);
CONF_free(conf); CONF_free(conf);
OBJ_cleanup(); OBJ_cleanup();
OPENSSL_EXIT(ret); EXIT(ret);
} }
static void lookup_fail(char *name, char *tag) static void lookup_fail(char *name, char *tag)
@@ -1374,7 +1340,7 @@ static BIGNUM *load_serial(char *serialfile)
ret=ASN1_INTEGER_to_BN(ai,NULL); ret=ASN1_INTEGER_to_BN(ai,NULL);
if (ret == NULL) if (ret == NULL)
{ {
BIO_printf(bio_err,"error converting number from bin to BIGNUM\n"); BIO_printf(bio_err,"error converting number from bin to BIGNUM");
goto err; goto err;
} }
err: err:
@@ -1762,10 +1728,7 @@ again2:
BIO_printf(bio_err,"The subject name appears to be ok, checking data base for clashes\n"); BIO_printf(bio_err,"The subject name appears to be ok, checking data base for clashes\n");
row[DB_name]=X509_NAME_oneline(subject,NULL,0); row[DB_name]=X509_NAME_oneline(subject,NULL,0);
if (BN_is_zero(serial)) row[DB_serial]=BN_bn2hex(serial);
row[DB_serial]=BUF_strdup("00");
else
row[DB_serial]=BN_bn2hex(serial);
if ((row[DB_name] == NULL) || (row[DB_serial] == NULL)) if ((row[DB_name] == NULL) || (row[DB_serial] == NULL))
{ {
BIO_printf(bio_err,"Memory allocation failure\n"); BIO_printf(bio_err,"Memory allocation failure\n");
@@ -2179,10 +2142,7 @@ static int do_revoke(X509 *x509, TXT_DB *db)
row[i]=NULL; row[i]=NULL;
row[DB_name]=X509_NAME_oneline(X509_get_subject_name(x509),NULL,0); row[DB_name]=X509_NAME_oneline(X509_get_subject_name(x509),NULL,0);
bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(x509),NULL); bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(x509),NULL);
if (BN_is_zero(bn)) row[DB_serial]=BN_bn2hex(bn);
row[DB_serial]=BUF_strdup("00");
else
row[DB_serial]=BN_bn2hex(bn);
BN_free(bn); BN_free(bn);
if ((row[DB_name] == NULL) || (row[DB_serial] == NULL)) if ((row[DB_name] == NULL) || (row[DB_serial] == NULL))
{ {

View File

@@ -202,6 +202,6 @@ end:
if (ctx != NULL) SSL_CTX_free(ctx); if (ctx != NULL) SSL_CTX_free(ctx);
if (ssl != NULL) SSL_free(ssl); if (ssl != NULL) SSL_free(ssl);
if (STDout != NULL) BIO_free_all(STDout); if (STDout != NULL) BIO_free_all(STDout);
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -364,7 +364,7 @@ end:
X509_STORE_CTX_cleanup(&ctx); X509_STORE_CTX_cleanup(&ctx);
X509_STORE_free(store); X509_STORE_free(store);
} }
OPENSSL_EXIT(ret); EXIT(ret);
} }
static X509_CRL *load_crl(char *infile, int format) static X509_CRL *load_crl(char *infile, int format)

View File

@@ -166,7 +166,7 @@ bad:
BIO_printf(bio_err," -certfile arg certificates file of chain to a trusted CA\n"); BIO_printf(bio_err," -certfile arg certificates file of chain to a trusted CA\n");
BIO_printf(bio_err," (can be used more than once)\n"); BIO_printf(bio_err," (can be used more than once)\n");
BIO_printf(bio_err," -nocrl no crl to load, just certs from '-certfile'\n"); BIO_printf(bio_err," -nocrl no crl to load, just certs from '-certfile'\n");
OPENSSL_EXIT(1); EXIT(1);
} }
ERR_load_crypto_strings(); ERR_load_crypto_strings();
@@ -278,7 +278,7 @@ end:
if (p7 != NULL) PKCS7_free(p7); if (p7 != NULL) PKCS7_free(p7);
if (crl != NULL) X509_CRL_free(crl); if (crl != NULL) X509_CRL_free(crl);
OPENSSL_EXIT(ret); EXIT(ret);
} }
/* /*

View File

@@ -66,7 +66,6 @@
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef BUFSIZE #undef BUFSIZE
#define BUFSIZE 1024*8 #define BUFSIZE 1024*8
@@ -81,7 +80,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
unsigned char *buf=NULL; unsigned char *buf=NULL;
int i,err=0; int i,err=0;
const EVP_MD *md=NULL,*m; const EVP_MD *md=NULL,*m;
@@ -89,8 +87,8 @@ int MAIN(int argc, char **argv)
BIO *bmd=NULL; BIO *bmd=NULL;
BIO *out = NULL; BIO *out = NULL;
const char *name; const char *name;
#define PROG_NAME_SIZE 39 #define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE+1]; char pname[PROG_NAME_SIZE];
int separator=0; int separator=0;
int debug=0; int debug=0;
const char *outfile = NULL, *keyfile = NULL; const char *outfile = NULL, *keyfile = NULL;
@@ -99,7 +97,6 @@ int MAIN(int argc, char **argv)
EVP_PKEY *sigkey = NULL; EVP_PKEY *sigkey = NULL;
unsigned char *sigbuf = NULL; unsigned char *sigbuf = NULL;
int siglen = 0; int siglen = 0;
char *engine=NULL;
apps_startup(); apps_startup();
@@ -157,11 +154,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) break; if (--argc < 1) break;
sigfile=*(++argv); sigfile=*(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) break;
engine= *(++argv);
}
else if (strcmp(*argv,"-hex") == 0) else if (strcmp(*argv,"-hex") == 0)
out_bin = 0; out_bin = 0;
else if (strcmp(*argv,"-binary") == 0) else if (strcmp(*argv,"-binary") == 0)
@@ -198,7 +190,6 @@ 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,"-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,"-signature file signature to verify\n");
BIO_printf(bio_err,"-binary output in binary form\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", BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
LN_md5,LN_md5); LN_md5,LN_md5);
@@ -218,24 +209,6 @@ int MAIN(int argc, char **argv)
goto end; 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()); in=BIO_new(BIO_s_file());
bmd=BIO_new(BIO_f_md()); bmd=BIO_new(BIO_f_md());
if (debug) if (debug)
@@ -354,7 +327,7 @@ int MAIN(int argc, char **argv)
end: end:
if (buf != NULL) if (buf != NULL)
{ {
OPENSSL_cleanse(buf,BUFSIZE); memset(buf,0,BUFSIZE);
OPENSSL_free(buf); OPENSSL_free(buf);
} }
if (in != NULL) BIO_free(in); if (in != NULL) BIO_free(in);
@@ -362,7 +335,7 @@ end:
EVP_PKEY_free(sigkey); EVP_PKEY_free(sigkey);
if(sigbuf) OPENSSL_free(sigbuf); if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd); if (bmd != NULL) BIO_free(bmd);
OPENSSL_EXIT(err); EXIT(err);
} }
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,

View File

@@ -69,7 +69,6 @@
#include <openssl/dh.h> #include <openssl/dh.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG dh_main #define PROG dh_main
@@ -88,12 +87,11 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
DH *dh=NULL; DH *dh=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
int informat,outformat,check=0,noout=0,C=0,ret=1; int informat,outformat,check=0,noout=0,C=0,ret=1;
char *infile,*outfile,*prog,*engine; char *infile,*outfile,*prog;
apps_startup(); apps_startup();
@@ -101,7 +99,6 @@ int MAIN(int argc, char **argv)
if ((bio_err=BIO_new(BIO_s_file())) != NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
engine=NULL;
infile=NULL; infile=NULL;
outfile=NULL; outfile=NULL;
informat=FORMAT_PEM; informat=FORMAT_PEM;
@@ -132,11 +129,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
outfile= *(++argv); outfile= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-check") == 0) else if (strcmp(*argv,"-check") == 0)
check=1; check=1;
else if (strcmp(*argv,"-text") == 0) else if (strcmp(*argv,"-text") == 0)
@@ -168,30 +160,11 @@ bad:
BIO_printf(bio_err," -text print a text form of the DH parameters\n"); 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," -C Output C code\n");
BIO_printf(bio_err," -noout no output\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; goto end;
} }
ERR_load_crypto_strings(); 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()); in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL)) if ((in == NULL) || (out == NULL))
@@ -346,6 +319,6 @@ end:
if (in != NULL) BIO_free(in); if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out); if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh); if (dh != NULL) DH_free(dh);
OPENSSL_EXIT(ret); EXIT(ret);
} }
#endif #endif

View File

@@ -121,7 +121,6 @@
#include <openssl/dh.h> #include <openssl/dh.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#ifndef NO_DSA #ifndef NO_DSA
#include <openssl/dsa.h> #include <openssl/dsa.h>
@@ -149,7 +148,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
DH *dh=NULL; DH *dh=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
#ifndef NO_DSA #ifndef NO_DSA
@@ -158,7 +156,7 @@ int MAIN(int argc, char **argv)
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
int informat,outformat,check=0,noout=0,C=0,ret=1; int informat,outformat,check=0,noout=0,C=0,ret=1;
char *infile,*outfile,*prog; char *infile,*outfile,*prog;
char *inrand=NULL,*engine=NULL; char *inrand=NULL;
int num = 0, g = 0; int num = 0, g = 0;
apps_startup(); apps_startup();
@@ -197,11 +195,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
outfile= *(++argv); outfile= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-check") == 0) else if (strcmp(*argv,"-check") == 0)
check=1; check=1;
else if (strcmp(*argv,"-text") == 0) else if (strcmp(*argv,"-text") == 0)
@@ -247,7 +240,6 @@ bad:
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n"); 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," -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," 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," -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," - load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," the random number generator\n");
@@ -257,24 +249,6 @@ bad:
ERR_load_crypto_strings(); 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) if (g && !num)
num = DEFBITS; num = DEFBITS;
@@ -532,7 +506,7 @@ end:
if (in != NULL) BIO_free(in); if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out); if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh); if (dh != NULL) DH_free(dh);
OPENSSL_EXIT(ret); EXIT(ret);
} }
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */ /* dh_cb is identical to dsa_cb in apps/dsaparam.c */

View File

@@ -68,7 +68,6 @@
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG dsa_main #define PROG dsa_main
@@ -88,7 +87,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
int ret=1; int ret=1;
DSA *dsa=NULL; DSA *dsa=NULL;
int i,badops=0; int i,badops=0;
@@ -96,7 +94,7 @@ int MAIN(int argc, char **argv)
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
int informat,outformat,text=0,noout=0; int informat,outformat,text=0,noout=0;
int pubin = 0, pubout = 0; int pubin = 0, pubout = 0;
char *infile,*outfile,*prog,*engine; char *infile,*outfile,*prog;
char *passargin = NULL, *passargout = NULL; char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL; char *passin = NULL, *passout = NULL;
int modulus=0; int modulus=0;
@@ -107,7 +105,6 @@ int MAIN(int argc, char **argv)
if ((bio_err=BIO_new(BIO_s_file())) != NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
engine=NULL;
infile=NULL; infile=NULL;
outfile=NULL; outfile=NULL;
informat=FORMAT_PEM; informat=FORMAT_PEM;
@@ -148,11 +145,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passargout= *(++argv); passargout= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-noout") == 0) else if (strcmp(*argv,"-noout") == 0)
noout=1; noout=1;
else if (strcmp(*argv,"-text") == 0) else if (strcmp(*argv,"-text") == 0)
@@ -184,7 +176,6 @@ bad:
BIO_printf(bio_err," -passin arg input file pass phrase source\n"); 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," -out arg output file\n");
BIO_printf(bio_err," -passout arg output file pass phrase source\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," -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"); BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
#ifndef NO_IDEA #ifndef NO_IDEA
@@ -198,24 +189,6 @@ bad:
ERR_load_crypto_strings(); 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)) { if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n"); BIO_printf(bio_err, "Error getting passwords\n");
goto end; goto end;
@@ -320,6 +293,6 @@ end:
if(dsa != NULL) DSA_free(dsa); if(dsa != NULL) DSA_free(dsa);
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
OPENSSL_EXIT(ret); EXIT(ret);
} }
#endif #endif

View File

@@ -176,7 +176,7 @@ bad:
BIO_printf(bio_err," -outform arg output format - DER or PEM\n"); BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
BIO_printf(bio_err," -in arg input file\n"); BIO_printf(bio_err," -in arg input file\n");
BIO_printf(bio_err," -out arg output file\n"); BIO_printf(bio_err," -out arg output file\n");
BIO_printf(bio_err," -text print as text\n"); BIO_printf(bio_err," -text print the key in text\n");
BIO_printf(bio_err," -C Output C code\n"); BIO_printf(bio_err," -C Output C code\n");
BIO_printf(bio_err," -noout no output\n"); BIO_printf(bio_err," -noout no output\n");
BIO_printf(bio_err," -rand files to use for random number input\n"); BIO_printf(bio_err," -rand files to use for random number input\n");
@@ -357,7 +357,7 @@ end:
if (in != NULL) BIO_free(in); if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out); if (out != NULL) BIO_free_all(out);
if (dsa != NULL) DSA_free(dsa); if (dsa != NULL) DSA_free(dsa);
OPENSSL_EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK dsa_cb(int p, int n, void *arg) static void MS_CALLBACK dsa_cb(int p, int n, void *arg)

View File

@@ -70,7 +70,6 @@
#include <openssl/md5.h> #include <openssl/md5.h>
#endif #endif
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
int set_hex(char *in,unsigned char *out,int size); int set_hex(char *in,unsigned char *out,int size);
#undef SIZE #undef SIZE
@@ -85,7 +84,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
static const char magic[]="Salted__"; static const char magic[]="Salted__";
char mbuf[8]; /* should be 1 smaller than magic */ char mbuf[8]; /* should be 1 smaller than magic */
char *strbuf=NULL; char *strbuf=NULL;
@@ -101,9 +99,8 @@ int MAIN(int argc, char **argv)
const EVP_CIPHER *cipher=NULL,*c; const EVP_CIPHER *cipher=NULL,*c;
char *inf=NULL,*outf=NULL; char *inf=NULL,*outf=NULL;
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL; BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
#define PROG_NAME_SIZE 39 #define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE+1]; char pname[PROG_NAME_SIZE];
char *engine = NULL;
apps_startup(); apps_startup();
@@ -144,11 +141,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passarg= *(++argv); passarg= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-d") == 0) else if (strcmp(*argv,"-d") == 0)
enc=0; enc=0;
else if (strcmp(*argv,"-p") == 0) else if (strcmp(*argv,"-p") == 0)
@@ -249,7 +241,6 @@ bad:
BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv"); 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 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 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,"Cipher Types\n");
BIO_printf(bio_err,"des : 56 bit key DES encryption\n"); BIO_printf(bio_err,"des : 56 bit key DES encryption\n");
@@ -323,24 +314,6 @@ bad:
argv++; 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) if (bufsize != NULL)
{ {
unsigned long n; unsigned long n;
@@ -533,9 +506,9 @@ bad:
* bug picked up by * bug picked up by
* Larry J. Hughes Jr. <hughes@indiana.edu> */ * Larry J. Hughes Jr. <hughes@indiana.edu> */
if (str == strbuf) if (str == strbuf)
OPENSSL_cleanse(str,SIZE); memset(str,0,SIZE);
else else
OPENSSL_cleanse(str,strlen(str)); memset(str,0,strlen(str));
} }
if ((hiv != NULL) && !set_hex(hiv,iv,8)) if ((hiv != NULL) && !set_hex(hiv,iv,8))
{ {
@@ -631,7 +604,7 @@ end:
if (benc != NULL) BIO_free(benc); if (benc != NULL) BIO_free(benc);
if (b64 != NULL) BIO_free(b64); if (b64 != NULL) BIO_free(b64);
if(pass) OPENSSL_free(pass); if(pass) OPENSSL_free(pass);
OPENSSL_EXIT(ret); EXIT(ret);
} }
int set_hex(char *in, unsigned char *out, int size) int set_hex(char *in, unsigned char *out, int size)

View File

@@ -121,5 +121,5 @@ int MAIN(int argc, char **argv)
ret++; ret++;
} }
} }
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -70,7 +70,6 @@
#include <openssl/dh.h> #include <openssl/dh.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#define DEFBITS 512 #define DEFBITS 512
#undef PROG #undef PROG
@@ -82,13 +81,11 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
DH *dh=NULL; DH *dh=NULL;
int ret=1,num=DEFBITS; int ret=1,num=DEFBITS;
int g=2; int g=2;
char *outfile=NULL; char *outfile=NULL;
char *inrand=NULL; char *inrand=NULL;
char *engine=NULL;
BIO *out=NULL; BIO *out=NULL;
apps_startup(); apps_startup();
@@ -113,11 +110,6 @@ int MAIN(int argc, char **argv)
g=3; */ g=3; */
else if (strcmp(*argv,"-5") == 0) else if (strcmp(*argv,"-5") == 0)
g=5; g=5;
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -133,34 +125,15 @@ int MAIN(int argc, char **argv)
bad: bad:
BIO_printf(bio_err,"usage: gendh [args] [numbits]\n"); 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," -out file - output the key to 'file\n");
BIO_printf(bio_err," -2 - use 2 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," -3 use 3 as the generator value\n"); */
BIO_printf(bio_err," -5 - use 5 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," -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," - load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," the random number generator\n");
goto end; 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()); out=BIO_new(BIO_s_file());
if (out == NULL) if (out == NULL)
{ {
@@ -211,7 +184,7 @@ end:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
if (out != NULL) BIO_free_all(out); if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh); if (dh != NULL) DH_free(dh);
OPENSSL_EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK dh_cb(int p, int n, void *arg) static void MS_CALLBACK dh_cb(int p, int n, void *arg)

View File

@@ -68,7 +68,6 @@
#include <openssl/dsa.h> #include <openssl/dsa.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#define DEFBITS 512 #define DEFBITS 512
#undef PROG #undef PROG
@@ -78,7 +77,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
DSA *dsa=NULL; DSA *dsa=NULL;
int ret=1; int ret=1;
char *outfile=NULL; char *outfile=NULL;
@@ -86,7 +84,6 @@ int MAIN(int argc, char **argv)
char *passargout = NULL, *passout = NULL; char *passargout = NULL, *passout = NULL;
BIO *out=NULL,*in=NULL; BIO *out=NULL,*in=NULL;
EVP_CIPHER *enc=NULL; EVP_CIPHER *enc=NULL;
char *engine=NULL;
apps_startup(); apps_startup();
@@ -109,11 +106,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passargout= *(++argv); passargout= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -153,7 +145,6 @@ bad:
#ifndef NO_IDEA #ifndef NO_IDEA
BIO_printf(bio_err," -idea - encrypt the generated key with IDEA in cbc mode\n"); BIO_printf(bio_err," -idea - encrypt the generated key with IDEA in cbc mode\n");
#endif #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," -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," - load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," the random number generator\n");
@@ -162,24 +153,6 @@ bad:
goto end; 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)) { if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
BIO_printf(bio_err, "Error getting password\n"); BIO_printf(bio_err, "Error getting password\n");
goto end; goto end;
@@ -247,6 +220,6 @@ end:
if (out != NULL) BIO_free_all(out); if (out != NULL) BIO_free_all(out);
if (dsa != NULL) DSA_free(dsa); if (dsa != NULL) DSA_free(dsa);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
OPENSSL_EXIT(ret); EXIT(ret);
} }
#endif #endif

View File

@@ -69,7 +69,6 @@
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#define DEFBITS 512 #define DEFBITS 512
#undef PROG #undef PROG
@@ -81,7 +80,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
int ret=1; int ret=1;
RSA *rsa=NULL; RSA *rsa=NULL;
int i,num=DEFBITS; int i,num=DEFBITS;
@@ -90,7 +88,6 @@ int MAIN(int argc, char **argv)
unsigned long f4=RSA_F4; unsigned long f4=RSA_F4;
char *outfile=NULL; char *outfile=NULL;
char *passargout = NULL, *passout = NULL; char *passargout = NULL, *passout = NULL;
char *engine=NULL;
char *inrand=NULL; char *inrand=NULL;
BIO *out=NULL; BIO *out=NULL;
@@ -119,11 +116,6 @@ int MAIN(int argc, char **argv)
f4=3; f4=3;
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0) else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
f4=RSA_F4; f4=RSA_F4;
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -162,7 +154,6 @@ bad:
BIO_printf(bio_err," -passout arg output file pass phrase source\n"); 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," -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," -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," -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," load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," the random number generator\n");
@@ -176,24 +167,6 @@ bad:
goto err; 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) if (outfile == NULL)
{ {
BIO_set_fp(out,stdout,BIO_NOCLOSE); BIO_set_fp(out,stdout,BIO_NOCLOSE);
@@ -213,8 +186,7 @@ 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"); BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
} }
@@ -252,7 +224,7 @@ err:
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
if (ret != 0) if (ret != 0)
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
OPENSSL_EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg) static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)

View File

@@ -1077,7 +1077,7 @@ $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
$! $!
$! Show user the result $! Show user the result
$! $!
$ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC $ WRITE SYS$OUTPUT "Main Compiling Command: ",CC
$! $!
$! Special Threads For OpenVMS v7.1 Or Later $! Special Threads For OpenVMS v7.1 Or Later
$! $!
@@ -1133,7 +1133,6 @@ $!
$! Save directory information $! Save directory information
$! $!
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
$ __HERE = F$EDIT(__HERE,"UPCASE")
$ __TOP = __HERE - "APPS]" $ __TOP = __HERE - "APPS]"
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
$! $!

View File

@@ -102,7 +102,7 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-in file input file\n"); BIO_printf (bio_err, "-in file input file\n");
BIO_printf (bio_err, "-out file output file\n"); BIO_printf (bio_err, "-out file output file\n");
BIO_printf (bio_err, "-toseq output NS Sequence file\n"); BIO_printf (bio_err, "-toseq output NS Sequence file\n");
OPENSSL_EXIT(1); EXIT(1);
} }
if (infile) { if (infile) {
@@ -162,6 +162,6 @@ end:
BIO_free_all(out); BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq); NETSCAPE_CERT_SEQUENCE_free(seq);
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -77,19 +77,19 @@ static unsigned long MS_CALLBACK hash(FUNCTION *a);
static int MS_CALLBACK cmp(FUNCTION *a,FUNCTION *b); static int MS_CALLBACK cmp(FUNCTION *a,FUNCTION *b);
static LHASH *prog_init(void ); static LHASH *prog_init(void );
static int do_cmd(LHASH *prog,int argc,char *argv[]); static int do_cmd(LHASH *prog,int argc,char *argv[]);
LHASH *config=NULL;
char *default_config_file=NULL; char *default_config_file=NULL;
/* Make sure there is only one when MONOLITH is defined */ /* Make sure there is only one when MONOLITH is defined */
#ifdef MONOLITH #ifdef MONOLITH
LHASH *config=NULL;
BIO *bio_err=NULL; BIO *bio_err=NULL;
#endif #endif
int main(int Argc, char *Argv[]) int main(int Argc, char *Argv[])
{ {
ARGS arg; ARGS arg;
#define PROG_NAME_SIZE 39 #define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE+1]; char pname[PROG_NAME_SIZE];
FUNCTION f,*fp; FUNCTION f,*fp;
MS_STATIC char *prompt,buf[1024],config_name[256]; MS_STATIC char *prompt,buf[1024],config_name[256];
int n,i,ret=0; int n,i,ret=0;
@@ -215,7 +215,7 @@ end:
BIO_free(bio_err); BIO_free(bio_err);
bio_err=NULL; bio_err=NULL;
} }
OPENSSL_EXIT(ret); EXIT(ret);
} }
#define LIST_STANDARD_COMMANDS "list-standard-commands" #define LIST_STANDARD_COMMANDS "list-standard-commands"

View File

@@ -284,7 +284,7 @@ err:
BIO_free(in); BIO_free(in);
if (out) if (out)
BIO_free_all(out); BIO_free_all(out);
OPENSSL_EXIT(ret); EXIT(ret);
} }
@@ -498,6 +498,6 @@ err:
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
fputs("Program not available.\n", stderr) fputs("Program not available.\n", stderr)
OPENSSL_EXIT(1); EXIT(1);
} }
#endif #endif

View File

@@ -66,7 +66,6 @@
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/pkcs12.h> #include <openssl/pkcs12.h>
#include <openssl/engine.h>
#define PROG pkcs12_main #define PROG pkcs12_main
@@ -93,7 +92,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
char *infile=NULL, *outfile=NULL, *keyname = NULL; char *infile=NULL, *outfile=NULL, *keyname = NULL;
char *certfile=NULL; char *certfile=NULL;
BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL; BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL;
@@ -120,7 +118,6 @@ int MAIN(int argc, char **argv)
char *passin = NULL, *passout = NULL; char *passin = NULL, *passout = NULL;
char *inrand = NULL; char *inrand = NULL;
char *CApath = NULL, *CAfile = NULL; char *CApath = NULL, *CAfile = NULL;
char *engine=NULL;
apps_startup(); apps_startup();
@@ -239,11 +236,6 @@ int MAIN(int argc, char **argv)
args++; args++;
CAfile = *args; CAfile = *args;
} else badarg = 1; } else badarg = 1;
} else if (!strcmp(*args,"-engine")) {
if (args[1]) {
args++;
engine = *args;
} else badarg = 1;
} else badarg = 1; } else badarg = 1;
} else badarg = 1; } else badarg = 1;
@@ -287,27 +279,12 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-password p set import/export password source\n"); 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, "-passin p input file pass phrase source\n");
BIO_printf (bio_err, "-passout p output 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, "-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, " load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n"); BIO_printf(bio_err, " the random number generator\n");
goto end; 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(passarg) {
if(export_cert) passargout = passarg; if(export_cert) passargout = passarg;
else passargin = passarg; else passargin = passarg;
@@ -503,10 +480,9 @@ int MAIN(int argc, char **argv)
/* Exclude verified certificate */ /* Exclude verified certificate */
for (i = 1; i < sk_X509_num (chain2) ; i++) for (i = 1; i < sk_X509_num (chain2) ; i++)
sk_X509_push(certs, sk_X509_value (chain2, i)); sk_X509_push(certs, sk_X509_value (chain2, i));
/* Free first certificate */ }
X509_free(sk_X509_value(chain2, 0)); sk_X509_free(chain2);
sk_X509_free(chain2); if (vret) {
} else {
BIO_printf (bio_err, "Error %s getting chain.\n", BIO_printf (bio_err, "Error %s getting chain.\n",
X509_verify_cert_error_string(vret)); X509_verify_cert_error_string(vret));
goto export_end; goto export_end;
@@ -533,6 +509,8 @@ int MAIN(int argc, char **argv)
} }
sk_X509_pop_free(certs, X509_free); sk_X509_pop_free(certs, X509_free);
certs = NULL; certs = NULL;
/* ucert is part of certs so it is already freed */
ucert = NULL;
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
@@ -620,6 +598,7 @@ int MAIN(int argc, char **argv)
if (certs) sk_X509_pop_free(certs, X509_free); if (certs) sk_X509_pop_free(certs, X509_free);
if (safes) sk_PKCS7_pop_free(safes, PKCS7_free); if (safes) sk_PKCS7_pop_free(safes, PKCS7_free);
if (bags) sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free); if (bags) sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
if (ucert) X509_free(ucert);
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
@@ -689,7 +668,7 @@ int MAIN(int argc, char **argv)
if (canames) sk_free(canames); if (canames) sk_free(canames);
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
OPENSSL_EXIT(ret); EXIT(ret);
} }
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass, int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
@@ -770,10 +749,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
print_attribs (out, bag->attrib, "Bag Attributes"); print_attribs (out, bag->attrib, "Bag Attributes");
if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen))) if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen)))
return 0; return 0;
if (!(pkey = EVP_PKCS82PKEY (p8))) { if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
PKCS8_PRIV_KEY_INFO_free(p8);
return 0;
}
print_attribs (out, p8->attributes, "Key Attributes"); print_attribs (out, p8->attributes, "Key Attributes");
PKCS8_PRIV_KEY_INFO_free(p8); PKCS8_PRIV_KEY_INFO_free(p8);
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass); PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);

View File

@@ -67,7 +67,6 @@
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pkcs7.h> #include <openssl/pkcs7.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG pkcs7_main #define PROG pkcs7_main
@@ -83,15 +82,13 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
PKCS7 *p7=NULL; PKCS7 *p7=NULL;
int i,badops=0; int i,badops=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
int informat,outformat; int informat,outformat;
char *infile,*outfile,*prog; char *infile,*outfile,*prog;
int print_certs=0,text=0,noout=0; int print_certs=0,text=0,noout=0;
int ret=1; int ret=0;
char *engine=NULL;
apps_startup(); apps_startup();
@@ -135,11 +132,6 @@ int MAIN(int argc, char **argv)
text=1; text=1;
else if (strcmp(*argv,"-print_certs") == 0) else if (strcmp(*argv,"-print_certs") == 0)
print_certs=1; print_certs=1;
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else else
{ {
BIO_printf(bio_err,"unknown option %s\n",*argv); BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -162,30 +154,11 @@ bad:
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n"); 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," -text print full details of certificates\n");
BIO_printf(bio_err," -noout don't output encoded data\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);
OPENSSL_EXIT(1);
} }
ERR_load_crypto_strings(); 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()); in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL)) if ((in == NULL) || (out == NULL))
@@ -316,5 +289,5 @@ end:
if (p7 != NULL) PKCS7_free(p7); if (p7 != NULL) PKCS7_free(p7);
if (in != NULL) BIO_free(in); if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out); if (out != NULL) BIO_free_all(out);
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -62,7 +62,6 @@
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/pkcs12.h> #include <openssl/pkcs12.h>
#include <openssl/engine.h>
#include "apps.h" #include "apps.h"
#define PROG pkcs8_main #define PROG pkcs8_main
@@ -71,7 +70,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
char **args, *infile = NULL, *outfile = NULL; char **args, *infile = NULL, *outfile = NULL;
char *passargin = NULL, *passargout = NULL; char *passargin = NULL, *passargout = NULL;
BIO *in = NULL, *out = NULL; BIO *in = NULL, *out = NULL;
@@ -87,13 +85,9 @@ int MAIN(int argc, char **argv)
EVP_PKEY *pkey; EVP_PKEY *pkey;
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL; char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
int badarg = 0; int badarg = 0;
char *engine=NULL;
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE); if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
informat=FORMAT_PEM; informat=FORMAT_PEM;
outformat=FORMAT_PEM; outformat=FORMAT_PEM;
ERR_load_crypto_strings(); ERR_load_crypto_strings();
OpenSSL_add_all_algorithms(); OpenSSL_add_all_algorithms();
args = argv + 1; args = argv + 1;
@@ -144,11 +138,6 @@ int MAIN(int argc, char **argv)
if (!args[1]) goto bad; if (!args[1]) goto bad;
passargout= *(++args); passargout= *(++args);
} }
else if (strcmp(*args,"-engine") == 0)
{
if (!args[1]) goto bad;
engine= *(++args);
}
else if (!strcmp (*args, "-in")) { else if (!strcmp (*args, "-in")) {
if (args[1]) { if (args[1]) {
args++; args++;
@@ -181,28 +170,9 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n"); 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, "-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, "-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); 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)) { if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n"); BIO_printf(bio_err, "Error getting passwords\n");
return (1); return (1);
@@ -266,8 +236,7 @@ int MAIN(int argc, char **argv)
if(passout) p8pass = passout; if(passout) p8pass = passout;
else { else {
p8pass = pass; p8pass = pass;
if (EVP_read_pw_string(pass, 50, "Enter Encryption Password:", 1)) EVP_read_pw_string(pass, 50, "Enter Encryption Password:", 1);
return (1);
} }
app_RAND_load_file(NULL, bio_err, 0); app_RAND_load_file(NULL, bio_err, 0);
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher, if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,

View File

@@ -9,7 +9,6 @@
#include <openssl/bio.h> #include <openssl/bio.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG rand_main #define PROG rand_main
@@ -24,7 +23,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
int i, r, ret = 1; int i, r, ret = 1;
int badopt; int badopt;
char *outfile = NULL; char *outfile = NULL;
@@ -32,7 +30,6 @@ int MAIN(int argc, char **argv)
int base64 = 0; int base64 = 0;
BIO *out = NULL; BIO *out = NULL;
int num = -1; int num = -1;
char *engine=NULL;
apps_startup(); apps_startup();
@@ -51,13 +48,6 @@ int MAIN(int argc, char **argv)
else else
badopt = 1; badopt = 1;
} }
else 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) else if (strcmp(argv[i], "-rand") == 0)
{ {
if ((argv[i+1] != NULL) && (inrand == NULL)) if ((argv[i+1] != NULL) && (inrand == NULL))
@@ -94,31 +84,12 @@ int MAIN(int argc, char **argv)
{ {
BIO_printf(bio_err, "Usage: rand [options] num\n"); BIO_printf(bio_err, "Usage: rand [options] num\n");
BIO_printf(bio_err, "where options are\n"); BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, "-out file - write to file\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, "-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, "-base64 - encode output\n");
goto err; 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)); app_RAND_load_file(NULL, bio_err, (inrand != NULL));
if (inrand != NULL) if (inrand != NULL)
BIO_printf(bio_err,"%ld semi-random bytes loaded\n", BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
@@ -173,5 +144,5 @@ err:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
if (out) if (out)
BIO_free_all(out); BIO_free_all(out);
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -73,7 +73,6 @@
#include <openssl/x509v3.h> #include <openssl/x509v3.h>
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#define SECTION "req" #define SECTION "req"
@@ -141,7 +140,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
#ifndef NO_DSA #ifndef NO_DSA
DSA *dsa_params=NULL; DSA *dsa_params=NULL;
#endif #endif
@@ -154,7 +152,6 @@ int MAIN(int argc, char **argv)
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM; int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
int nodes=0,kludge=0,newhdr=0; int nodes=0,kludge=0,newhdr=0;
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL; char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
char *engine=NULL;
char *extensions = NULL; char *extensions = NULL;
char *req_exts = NULL; char *req_exts = NULL;
EVP_CIPHER *cipher=NULL; EVP_CIPHER *cipher=NULL;
@@ -198,11 +195,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
outformat=str2fmt(*(++argv)); outformat=str2fmt(*(++argv));
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-key") == 0) else if (strcmp(*argv,"-key") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -291,7 +283,7 @@ int MAIN(int argc, char **argv)
goto end; goto end;
} }
if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end; dtmp=X509_get_pubkey(xtmp);
if (dtmp->type == EVP_PKEY_DSA) if (dtmp->type == EVP_PKEY_DSA)
dsa_params=DSAparams_dup(dtmp->pkey.dsa); dsa_params=DSAparams_dup(dtmp->pkey.dsa);
EVP_PKEY_free(dtmp); EVP_PKEY_free(dtmp);
@@ -383,7 +375,6 @@ bad:
BIO_printf(bio_err," -verify verify signature on REQ\n"); BIO_printf(bio_err," -verify verify signature on REQ\n");
BIO_printf(bio_err," -modulus RSA modulus\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," -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," -key file use the private key contained in file\n");
BIO_printf(bio_err," -keyform arg key file format\n"); BIO_printf(bio_err," -keyform arg key file format\n");
BIO_printf(bio_err," -keyout arg file to send the key to\n"); BIO_printf(bio_err," -keyout arg file to send the key to\n");
@@ -392,7 +383,8 @@ bad:
BIO_printf(bio_err," the random number generator\n"); 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 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," -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," -config file request template file.\n");
BIO_printf(bio_err," -new new request.\n"); BIO_printf(bio_err," -new new request.\n");
BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n"); BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n");
@@ -431,7 +423,7 @@ bad:
if (template != NULL) if (template != NULL)
{ {
long errline = -1; long errline;
BIO_printf(bio_err,"Using configuration from %s\n",template); BIO_printf(bio_err,"Using configuration from %s\n",template);
req_conf=CONF_load(NULL,template,&errline); req_conf=CONF_load(NULL,template,&errline);
@@ -530,55 +522,24 @@ bad:
if ((in == NULL) || (out == NULL)) if ((in == NULL) || (out == NULL))
goto end; 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 != NULL) if (keyfile != NULL)
{ {
if (keyform == FORMAT_ENGINE) if (BIO_read_filename(in,keyfile) <= 0)
{ {
if (!e) perror(keyfile);
{ goto end;
BIO_printf(bio_err,"no engine specified\n"); }
goto end;
} if (keyform == FORMAT_ASN1)
pkey = ENGINE_load_private_key(e, keyfile, NULL); pkey=d2i_PrivateKey_bio(in,NULL);
else if (keyform == FORMAT_PEM)
{
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,passin);
} }
else else
{ {
if (BIO_read_filename(in,keyfile) <= 0) BIO_printf(bio_err,"bad input format specified for X509 request\n");
{ goto end;
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) if (pkey == NULL)
@@ -758,14 +719,17 @@ loop:
/* Set version to V3 */ /* Set version to V3 */
if(!X509_set_version(x509ss, 2)) goto end; 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; X509_set_issuer_name(x509ss,
if (!X509_gmtime_adj(X509_get_notBefore(x509ss),0)) goto end; X509_REQ_get_subject_name(req));
if (!X509_gmtime_adj(X509_get_notAfter(x509ss), (long)60*60*24*days)) goto end; X509_gmtime_adj(X509_get_notBefore(x509ss),0);
if (!X509_set_subject_name(x509ss, X509_REQ_get_subject_name(req))) goto end; 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); tmppkey = X509_REQ_get_pubkey(req);
if (!tmppkey || !X509_set_pubkey(x509ss,tmppkey)) goto end; X509_set_pubkey(x509ss,tmppkey);
EVP_PKEY_free(tmppkey); EVP_PKEY_free(tmppkey);
/* Set up V3 context struct */ /* Set up V3 context struct */
@@ -949,7 +913,7 @@ end:
#ifndef NO_DSA #ifndef NO_DSA
if (dsa_params != NULL) DSA_free(dsa_params); if (dsa_params != NULL) DSA_free(dsa_params);
#endif #endif
OPENSSL_EXIT(ex); EXIT(ex);
} }
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs) static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
@@ -996,7 +960,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); else i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs);
if(!i) goto err; if(!i) goto err;
if (!X509_REQ_set_pubkey(req,pkey)) goto err; X509_REQ_set_pubkey(req,pkey);
ret=1; ret=1;
err: err:

View File

@@ -68,7 +68,6 @@
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG rsa_main #define PROG rsa_main
@@ -91,7 +90,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *eng = NULL;
int ret=1; int ret=1;
RSA *rsa=NULL; RSA *rsa=NULL;
int i,badops=0, sgckey=0; int i,badops=0, sgckey=0;
@@ -102,7 +100,6 @@ int MAIN(int argc, char **argv)
char *infile,*outfile,*prog; char *infile,*outfile,*prog;
char *passargin = NULL, *passargout = NULL; char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL; char *passin = NULL, *passout = NULL;
char *engine=NULL;
int modulus=0; int modulus=0;
apps_startup(); apps_startup();
@@ -151,11 +148,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passargout= *(++argv); passargout= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-sgckey") == 0) else if (strcmp(*argv,"-sgckey") == 0)
sgckey=1; sgckey=1;
else if (strcmp(*argv,"-pubin") == 0) else if (strcmp(*argv,"-pubin") == 0)
@@ -203,30 +195,11 @@ bad:
BIO_printf(bio_err," -check verify key consistency\n"); 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," -pubin expect a public key in input file\n");
BIO_printf(bio_err," -pubout output a public key\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; goto end;
} }
ERR_load_crypto_strings(); ERR_load_crypto_strings();
if (engine != NULL)
{
if((eng = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(eng, 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(eng);
}
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) { if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n"); BIO_printf(bio_err, "Error getting passwords\n");
goto end; goto end;
@@ -416,7 +389,7 @@ end:
if(rsa != NULL) RSA_free(rsa); if(rsa != NULL) RSA_free(rsa);
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
OPENSSL_EXIT(ret); EXIT(ret);
} }
#else /* !NO_RSA */ #else /* !NO_RSA */

View File

@@ -62,7 +62,6 @@
#include <string.h> #include <string.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#define RSA_SIGN 1 #define RSA_SIGN 1
#define RSA_VERIFY 2 #define RSA_VERIFY 2
@@ -83,7 +82,6 @@ int MAIN(int argc, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
BIO *in = NULL, *out = NULL; BIO *in = NULL, *out = NULL;
char *infile = NULL, *outfile = NULL; char *infile = NULL, *outfile = NULL;
char *keyfile = NULL; char *keyfile = NULL;
@@ -97,7 +95,6 @@ int MAIN(int argc, char **argv)
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad; unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
int rsa_inlen, rsa_outlen = 0; int rsa_inlen, rsa_outlen = 0;
int keysize; int keysize;
char *engine=NULL;
int ret = 1; int ret = 1;
@@ -120,9 +117,6 @@ int MAIN(int argc, char **argv)
} else if(!strcmp(*argv, "-inkey")) { } else if(!strcmp(*argv, "-inkey")) {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
keyfile = *(++argv); keyfile = *(++argv);
} else if(!strcmp(*argv, "-engine")) {
if (--argc < 1) badarg = 1;
engine = *(++argv);
} else if(!strcmp(*argv, "-pubin")) { } else if(!strcmp(*argv, "-pubin")) {
key_type = KEY_PUBKEY; key_type = KEY_PUBKEY;
} else if(!strcmp(*argv, "-certin")) { } else if(!strcmp(*argv, "-certin")) {
@@ -157,24 +151,6 @@ int MAIN(int argc, char **argv)
goto end; 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 */ /* FIXME: seed PRNG only if needed */
app_RAND_load_file(NULL, bio_err, 0); app_RAND_load_file(NULL, bio_err, 0);
@@ -304,7 +280,6 @@ static void usage()
BIO_printf(bio_err, "-inkey file input key\n"); BIO_printf(bio_err, "-inkey file input key\n");
BIO_printf(bio_err, "-pubin input is an RSA public\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, "-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, "-ssl use SSL v2 padding\n");
BIO_printf(bio_err, "-raw use no padding\n"); BIO_printf(bio_err, "-raw use no padding\n");
BIO_printf(bio_err, "-pkcs use PKCS#1 v1.5 padding (default)\n"); BIO_printf(bio_err, "-pkcs use PKCS#1 v1.5 padding (default)\n");

View File

@@ -80,7 +80,6 @@ typedef unsigned int u_int;
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/engine.h>
#include "s_apps.h" #include "s_apps.h"
#ifdef WINDOWS #ifdef WINDOWS
@@ -155,7 +154,7 @@ static void sc_usage(void)
BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n"); 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," 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," -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 **); int MAIN(int, char **);
@@ -183,8 +182,6 @@ int MAIN(int argc, char **argv)
SSL_METHOD *meth=NULL; SSL_METHOD *meth=NULL;
BIO *sbio; BIO *sbio;
char *inrand=NULL; char *inrand=NULL;
char *engine_id=NULL;
ENGINE *e=NULL;
#ifdef WINDOWS #ifdef WINDOWS
struct timeval tv; struct timeval tv;
#endif #endif
@@ -327,11 +324,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
inrand= *(++argv); inrand= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine_id = *(++argv);
}
else else
{ {
BIO_printf(bio_err,"unknown option %s\n",*argv); BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -372,30 +364,6 @@ bad:
OpenSSL_add_ssl_algorithms(); OpenSSL_add_ssl_algorithms();
SSL_load_error_strings(); 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); ctx=SSL_CTX_new(meth);
if (ctx == NULL) if (ctx == NULL)
{ {
@@ -800,14 +768,14 @@ end:
if (con != NULL) SSL_free(con); if (con != NULL) SSL_free(con);
if (con2 != NULL) SSL_free(con2); if (con2 != NULL) SSL_free(con2);
if (ctx != NULL) SSL_CTX_free(ctx); if (ctx != NULL) SSL_CTX_free(ctx);
if (cbuf != NULL) { OPENSSL_cleanse(cbuf,BUFSIZZ); OPENSSL_free(cbuf); } if (cbuf != NULL) { memset(cbuf,0,BUFSIZZ); OPENSSL_free(cbuf); }
if (sbuf != NULL) { OPENSSL_cleanse(sbuf,BUFSIZZ); OPENSSL_free(sbuf); } if (sbuf != NULL) { memset(sbuf,0,BUFSIZZ); OPENSSL_free(sbuf); }
if (bio_c_out != NULL) if (bio_c_out != NULL)
{ {
BIO_free(bio_c_out); BIO_free(bio_c_out);
bio_c_out=NULL; bio_c_out=NULL;
} }
OPENSSL_EXIT(ret); EXIT(ret);
} }
@@ -928,7 +896,5 @@ static void print_stuff(BIO *bio, SSL *s, int full)
BIO_printf(bio,"---\n"); BIO_printf(bio,"---\n");
if (peer != NULL) if (peer != NULL)
X509_free(peer); X509_free(peer);
/* flush, or debugging output gets mixed with http response */
BIO_flush(bio);
} }

View File

@@ -84,7 +84,6 @@ typedef unsigned int u_int;
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/engine.h>
#include "s_apps.h" #include "s_apps.h"
#ifdef WINDOWS #ifdef WINDOWS
@@ -178,7 +177,6 @@ static int s_debug=0;
static int s_quiet=0; static int s_quiet=0;
static int hack=0; static int hack=0;
static char *engine_id=NULL;
#ifdef MONOLITH #ifdef MONOLITH
static void s_server_init(void) static void s_server_init(void)
@@ -201,7 +199,6 @@ static void s_server_init(void)
s_debug=0; s_debug=0;
s_quiet=0; s_quiet=0;
hack=0; hack=0;
engine_id=NULL;
} }
#endif #endif
@@ -247,7 +244,6 @@ 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 /' 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," -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," -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; static int local_argc=0;
@@ -257,10 +253,10 @@ static char **local_argv;
static int ebcdic_new(BIO *bi); static int ebcdic_new(BIO *bi);
static int ebcdic_free(BIO *a); static int ebcdic_free(BIO *a);
static int ebcdic_read(BIO *b, char *out, int outl); static int ebcdic_read(BIO *b, char *out, int outl);
static int ebcdic_write(BIO *b, const char *in, int inl); static int ebcdic_write(BIO *b, char *in, int inl);
static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr); static long ebcdic_ctrl(BIO *b, int cmd, long num, char *ptr);
static int ebcdic_gets(BIO *bp, char *buf, int size); static int ebcdic_gets(BIO *bp, char *buf, int size);
static int ebcdic_puts(BIO *bp, const char *str); static int ebcdic_puts(BIO *bp, char *str);
#define BIO_TYPE_EBCDIC_FILTER (18|0x0200) #define BIO_TYPE_EBCDIC_FILTER (18|0x0200)
static BIO_METHOD methods_ebcdic= static BIO_METHOD methods_ebcdic=
@@ -325,7 +321,7 @@ static int ebcdic_read(BIO *b, char *out, int outl)
return(ret); return(ret);
} }
static int ebcdic_write(BIO *b, const char *in, int inl) static int ebcdic_write(BIO *b, char *in, int inl)
{ {
EBCDIC_OUTBUFF *wbuf; EBCDIC_OUTBUFF *wbuf;
int ret=0; int ret=0;
@@ -358,7 +354,7 @@ static int ebcdic_write(BIO *b, const char *in, int inl)
return(ret); return(ret);
} }
static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr) static long ebcdic_ctrl(BIO *b, int cmd, long num, char *ptr)
{ {
long ret; long ret;
@@ -377,7 +373,7 @@ static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr)
static int ebcdic_gets(BIO *bp, char *buf, int size) static int ebcdic_gets(BIO *bp, char *buf, int size)
{ {
int i, ret=0; int i, ret;
if (bp->next_bio == NULL) return(0); if (bp->next_bio == NULL) return(0);
/* return(BIO_gets(bp->next_bio,buf,size));*/ /* return(BIO_gets(bp->next_bio,buf,size));*/
for (i=0; i<size-1; ++i) for (i=0; i<size-1; ++i)
@@ -396,7 +392,7 @@ static int ebcdic_gets(BIO *bp, char *buf, int size)
return (ret < 0 && i == 0) ? ret : i; return (ret < 0 && i == 0) ? ret : i;
} }
static int ebcdic_puts(BIO *bp, const char *str) static int ebcdic_puts(BIO *bp, char *str)
{ {
if (bp->next_bio == NULL) return(0); if (bp->next_bio == NULL) return(0);
return ebcdic_write(bp, str, strlen(str)); return ebcdic_write(bp, str, strlen(str));
@@ -418,8 +414,6 @@ int MAIN(int argc, char *argv[])
int state=0; int state=0;
SSL_METHOD *meth=NULL; SSL_METHOD *meth=NULL;
char *inrand=NULL; char *inrand=NULL;
char *engine=NULL;
ENGINE *e=NULL;
#ifndef NO_DH #ifndef NO_DH
DH *dh=NULL; DH *dh=NULL;
#endif #endif
@@ -579,11 +573,6 @@ int MAIN(int argc, char *argv[])
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
inrand= *(++argv); inrand= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine = *(++argv);
}
else else
{ {
BIO_printf(bio_err,"unknown option %s\n",*argv); BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -635,29 +624,6 @@ bad:
SSL_load_error_strings(); SSL_load_error_strings();
OpenSSL_add_ssl_algorithms(); OpenSSL_add_ssl_algorithms();
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == 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);
ENGINE_free(e);
}
ctx=SSL_CTX_new(meth); ctx=SSL_CTX_new(meth);
if (ctx == NULL) if (ctx == NULL)
{ {
@@ -775,7 +741,7 @@ end:
BIO_free(bio_s_out); BIO_free(bio_s_out);
bio_s_out=NULL; bio_s_out=NULL;
} }
OPENSSL_EXIT(ret); EXIT(ret);
} }
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx) static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
@@ -1077,7 +1043,7 @@ err:
BIO_printf(bio_s_out,"CONNECTION CLOSED\n"); BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
if (buf != NULL) if (buf != NULL)
{ {
OPENSSL_cleanse(buf,bufsize); memset(buf,0,bufsize);
OPENSSL_free(buf); OPENSSL_free(buf);
} }
if (ret >= 0) if (ret >= 0)
@@ -1284,7 +1250,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
else else
{ {
BIO_printf(bio_s_out,"read R BLOCK\n"); BIO_printf(bio_s_out,"read R BLOCK\n");
#if !defined(MSDOS) && !defined(VXWORKS) #ifndef MSDOS
sleep(1); sleep(1);
#endif #endif
continue; continue;

View File

@@ -82,7 +82,7 @@
#include "wintext.h" #include "wintext.h"
#endif #endif
#if !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC)) || defined (_DARWIN) #if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
#define TIMES #define TIMES
#endif #endif
@@ -102,7 +102,7 @@
#undef TIMES #undef TIMES
#endif #endif
#if !defined(TIMES) && !defined(VXWORKS) #ifndef TIMES
#include <sys/timeb.h> #include <sys/timeb.h>
#endif #endif
@@ -116,11 +116,6 @@
#include <sys/param.h> #include <sys/param.h>
#endif #endif
#ifdef VXWORKS
#include <tickLib.h>
#undef SIGALRM
#endif
/* The following if from times(3) man page. It may need to be changed /* The following if from times(3) man page. It may need to be changed
*/ */
#ifndef HZ #ifndef HZ
@@ -144,8 +139,6 @@
#undef BUFSIZZ #undef BUFSIZZ
#define BUFSIZZ 1024*10 #define BUFSIZZ 1024*10
#undef min
#undef max
#define min(a,b) (((a) < (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b))
@@ -375,22 +368,6 @@ static double tm_Time_F(int s)
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ; ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
return((ret == 0.0)?1e-6:ret); 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() */ #else /* !times() */
static struct timeb tstart,tend; static struct timeb tstart,tend;
long i; long i;
@@ -466,7 +443,7 @@ int MAIN(int argc, char **argv)
if (tm_cipher == NULL ) { if (tm_cipher == NULL ) {
fprintf( stderr, "No CIPHER specified\n" ); fprintf( stderr, "No CIPHER specified\n" );
/* OPENSSL_EXIT(1); */ /* EXIT(1); */
} }
if (!(perform & 1)) goto next; if (!(perform & 1)) goto next;
@@ -633,7 +610,7 @@ end:
SSL_CTX_free(tm_ctx); SSL_CTX_free(tm_ctx);
tm_ctx=NULL; tm_ctx=NULL;
} }
OPENSSL_EXIT(ret); EXIT(ret);
} }
/*********************************************************************** /***********************************************************************

View File

@@ -272,7 +272,7 @@ bad:
end: end:
if (out != NULL) BIO_free_all(out); if (out != NULL) BIO_free_all(out);
if (x != NULL) SSL_SESSION_free(x); if (x != NULL) SSL_SESSION_free(x);
OPENSSL_EXIT(ret); EXIT(ret);
} }
static SSL_SESSION *load_sess_id(char *infile, int format) static SSL_SESSION *load_sess_id(char *infile, int format)

View File

@@ -64,7 +64,6 @@
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG smime_main #define PROG smime_main
@@ -82,7 +81,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
int operation = 0; int operation = 0;
int ret = 0; int ret = 0;
char **args; char **args;
@@ -105,9 +103,8 @@ int MAIN(int argc, char **argv)
char *inrand = NULL; char *inrand = NULL;
int need_rand = 0; int need_rand = 0;
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME; int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
char *engine=NULL;
args = argv + 1; args = argv + 1;
ret = 1; ret = 1;
while (!badarg && *args && *args[0] == '-') { while (!badarg && *args && *args[0] == '-') {
@@ -156,11 +153,6 @@ int MAIN(int argc, char **argv)
inrand = *args; inrand = *args;
} else badarg = 1; } else badarg = 1;
need_rand = 1; need_rand = 1;
} else if (!strcmp(*args,"-engine")) {
if (args[1]) {
args++;
engine = *args;
} else badarg = 1;
} else if (!strcmp(*args,"-passin")) { } else if (!strcmp(*args,"-passin")) {
if (args[1]) { if (args[1]) {
args++; args++;
@@ -298,7 +290,6 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-text include or delete text MIME headers\n"); 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, "-CApath dir trusted certificates directory\n");
BIO_printf (bio_err, "-CAfile file trusted certificates file\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, "-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, "-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, " load the file (or the files in the directory) into\n");
@@ -307,24 +298,6 @@ int MAIN(int argc, char **argv)
goto end; 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)) { if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
BIO_printf(bio_err, "Error getting password\n"); BIO_printf(bio_err, "Error getting password\n");
goto end; goto end;
@@ -441,10 +414,7 @@ int MAIN(int argc, char **argv)
p7 = PKCS7_encrypt(encerts, in, cipher, flags); p7 = PKCS7_encrypt(encerts, in, cipher, flags);
} else if(operation == SMIME_SIGN) { } else if(operation == SMIME_SIGN) {
p7 = PKCS7_sign(signer, key, other, in, flags); p7 = PKCS7_sign(signer, key, other, in, flags);
if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) { BIO_reset(in);
BIO_printf(bio_err, "Can't rewind input file\n");
goto end;
}
} else { } else {
if(informat == FORMAT_SMIME) if(informat == FORMAT_SMIME)
p7 = SMIME_read_PKCS7(in, &indata); p7 = SMIME_read_PKCS7(in, &indata);
@@ -484,9 +454,9 @@ int MAIN(int argc, char **argv)
} else if(operation == SMIME_VERIFY) { } else if(operation == SMIME_VERIFY) {
STACK_OF(X509) *signers; STACK_OF(X509) *signers;
if(PKCS7_verify(p7, other, store, indata, out, flags)) { if(PKCS7_verify(p7, other, store, indata, out, flags)) {
BIO_printf(bio_err, "Verification successful\n"); BIO_printf(bio_err, "Verification Successful\n");
} else { } else {
BIO_printf(bio_err, "Verification failure\n"); BIO_printf(bio_err, "Verification Failure\n");
goto end; goto end;
} }
signers = PKCS7_get0_signers(p7, other, flags); signers = PKCS7_get0_signers(p7, other, flags);

View File

@@ -81,14 +81,13 @@
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/err.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 # define USE_TOD
#elif !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC)) #elif !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
# define TIMES # define TIMES
#endif #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 # define TIMEB
#endif #endif
@@ -116,7 +115,7 @@
#include <sys/timeb.h> #include <sys/timeb.h>
#endif #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!" #error "It seems neither struct tms nor struct timeb is supported in this platform!"
#endif #endif
@@ -225,7 +224,7 @@ static double Time_F(int s, int usertime)
#ifdef USE_TOD #ifdef USE_TOD
if(usertime) if(usertime)
{ {
static struct rusage tstart,tend; static struct rusage tstart,tend;
if (s == START) if (s == START)
@@ -285,23 +284,7 @@ static double Time_F(int s, int usertime)
# if defined(TIMES) && defined(TIMEB) # if defined(TIMES) && defined(TIMEB)
else else
# endif # endif
# ifdef VXWORKS # ifdef TIMEB
{
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)
{ {
static struct timeb tstart,tend; static struct timeb tstart,tend;
long i; long i;
@@ -320,7 +303,6 @@ static double Time_F(int s, int usertime)
} }
} }
# endif # endif
#endif #endif
} }
@@ -328,7 +310,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e;
unsigned char *buf=NULL,*buf2=NULL; unsigned char *buf=NULL,*buf2=NULL;
int mret=1; int mret=1;
#define ALGOR_NUM 15 #define ALGOR_NUM 15
@@ -337,9 +318,7 @@ int MAIN(int argc, char **argv)
#define DSA_NUM 3 #define DSA_NUM 3
long count,rsa_count; long count,rsa_count;
int i,j,k; int i,j,k;
#ifndef NO_RSA
unsigned rsa_num; unsigned rsa_num;
#endif
#ifndef NO_MD2 #ifndef NO_MD2
unsigned char md2[MD2_DIGEST_LENGTH]; unsigned char md2[MD2_DIGEST_LENGTH];
#endif #endif
@@ -491,37 +470,6 @@ int MAIN(int argc, char **argv)
{ {
if ((argc > 0) && (strcmp(*argv,"-elapsed") == 0)) if ((argc > 0) && (strcmp(*argv,"-elapsed") == 0))
usertime = 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 #ifndef NO_MD2
if (strcmp(*argv,"md2") == 0) doit[D_MD2]=1; if (strcmp(*argv,"md2") == 0) doit[D_MD2]=1;
else else
@@ -569,7 +517,7 @@ int MAIN(int argc, char **argv)
#ifdef RSAref #ifdef RSAref
if (strcmp(*argv,"rsaref") == 0) if (strcmp(*argv,"rsaref") == 0)
{ {
RSA_set_default_openssl_method(RSA_PKCS1_RSAref()); RSA_set_default_method(RSA_PKCS1_RSAref());
j--; j--;
} }
else else
@@ -577,7 +525,7 @@ int MAIN(int argc, char **argv)
#ifndef RSA_NULL #ifndef RSA_NULL
if (strcmp(*argv,"openssl") == 0) if (strcmp(*argv,"openssl") == 0)
{ {
RSA_set_default_openssl_method(RSA_PKCS1_SSLeay()); RSA_set_default_method(RSA_PKCS1_SSLeay());
j--; j--;
} }
else else
@@ -722,12 +670,11 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
#endif #endif
#ifdef TIMES
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
BIO_printf(bio_err,"Available options:\n"); BIO_printf(bio_err,"Available options:\n");
#if defined(TIMES) || defined(USE_TOD)
BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n"); BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n");
#endif #endif
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
goto end; goto end;
} }
argc--; argc--;
@@ -1434,7 +1381,6 @@ int MAIN(int argc, char **argv)
#endif #endif
mret=0; mret=0;
end: end:
ERR_print_errors(bio_err);
if (buf != NULL) OPENSSL_free(buf); if (buf != NULL) OPENSSL_free(buf);
if (buf2 != NULL) OPENSSL_free(buf2); if (buf2 != NULL) OPENSSL_free(buf2);
#ifndef NO_RSA #ifndef NO_RSA
@@ -1447,7 +1393,7 @@ end:
if (dsa_key[i] != NULL) if (dsa_key[i] != NULL)
DSA_free(dsa_key[i]); DSA_free(dsa_key[i]);
#endif #endif
OPENSSL_EXIT(mret); EXIT(mret);
} }
static void print_message(char *s, long num, int length) static void print_message(char *s, long num, int length)

View File

@@ -69,7 +69,6 @@
#include <openssl/lhash.h> #include <openssl/lhash.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG spkac_main #define PROG spkac_main
@@ -82,7 +81,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
int i,badops=0, ret = 1; int i,badops=0, ret = 1;
BIO *in = NULL,*out = NULL, *key = NULL; BIO *in = NULL,*out = NULL, *key = NULL;
int verify=0,noout=0,pubkey=0; int verify=0,noout=0,pubkey=0;
@@ -93,7 +91,6 @@ int MAIN(int argc, char **argv)
LHASH *conf = NULL; LHASH *conf = NULL;
NETSCAPE_SPKI *spki = NULL; NETSCAPE_SPKI *spki = NULL;
EVP_PKEY *pkey = NULL; EVP_PKEY *pkey = NULL;
char *engine=NULL;
apps_startup(); apps_startup();
@@ -139,11 +136,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
spksect= *(++argv); spksect= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-noout") == 0) else if (strcmp(*argv,"-noout") == 0)
noout=1; noout=1;
else if (strcmp(*argv,"-pubkey") == 0) else if (strcmp(*argv,"-pubkey") == 0)
@@ -169,7 +161,6 @@ bad:
BIO_printf(bio_err," -noout don't print SPKAC\n"); BIO_printf(bio_err," -noout don't print SPKAC\n");
BIO_printf(bio_err," -pubkey output public key\n"); BIO_printf(bio_err," -pubkey output public key\n");
BIO_printf(bio_err," -verify verify SPKAC signature\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; goto end;
} }
@@ -179,24 +170,6 @@ bad:
goto end; 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(keyfile) {
if(strcmp(keyfile, "-")) key = BIO_new_file(keyfile, "r"); if(strcmp(keyfile, "-")) key = BIO_new_file(keyfile, "r");
else key = BIO_new_fp(stdin, BIO_NOCLOSE); else key = BIO_new_fp(stdin, BIO_NOCLOSE);
@@ -315,5 +288,5 @@ end:
BIO_free(key); BIO_free(key);
EVP_PKEY_free(pkey); EVP_PKEY_free(pkey);
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -65,7 +65,6 @@
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/x509v3.h> #include <openssl/x509v3.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG verify_main #define PROG verify_main
@@ -79,7 +78,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
int i,ret=1; int i,ret=1;
int purpose = -1; int purpose = -1;
char *CApath=NULL,*CAfile=NULL; char *CApath=NULL,*CAfile=NULL;
@@ -87,7 +85,6 @@ int MAIN(int argc, char **argv)
STACK_OF(X509) *untrusted = NULL, *trusted = NULL; STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
X509_STORE *cert_ctx=NULL; X509_STORE *cert_ctx=NULL;
X509_LOOKUP *lookup=NULL; X509_LOOKUP *lookup=NULL;
char *engine=NULL;
cert_ctx=X509_STORE_new(); cert_ctx=X509_STORE_new();
if (cert_ctx == NULL) goto end; if (cert_ctx == NULL) goto end;
@@ -140,11 +137,6 @@ int MAIN(int argc, char **argv)
if (argc-- < 1) goto end; if (argc-- < 1) goto end;
trustfile= *(++argv); trustfile= *(++argv);
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto end;
engine= *(++argv);
}
else if (strcmp(*argv,"-help") == 0) else if (strcmp(*argv,"-help") == 0)
goto end; goto end;
else if (strcmp(*argv,"-issuer_checks") == 0) else if (strcmp(*argv,"-issuer_checks") == 0)
@@ -162,24 +154,6 @@ int MAIN(int argc, char **argv)
break; 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()); lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
if (lookup == NULL) abort(); if (lookup == NULL) abort();
if (CAfile) { if (CAfile) {
@@ -227,7 +201,7 @@ int MAIN(int argc, char **argv)
ret=0; ret=0;
end: end:
if (ret == 1) { if (ret == 1) {
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-engine e] cert1 cert2 ...\n"); BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] cert1 cert2 ...\n");
BIO_printf(bio_err,"recognized usages:\n"); BIO_printf(bio_err,"recognized usages:\n");
for(i = 0; i < X509_PURPOSE_get_count(); i++) { for(i = 0; i < X509_PURPOSE_get_count(); i++) {
X509_PURPOSE *ptmp; X509_PURPOSE *ptmp;
@@ -239,7 +213,7 @@ end:
if (cert_ctx != NULL) X509_STORE_free(cert_ctx); if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
sk_X509_pop_free(untrusted, X509_free); sk_X509_pop_free(untrusted, X509_free);
sk_X509_pop_free(trusted, X509_free); sk_X509_pop_free(trusted, X509_free);
OPENSSL_EXIT(ret); EXIT(ret);
} }
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose) static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose)

View File

@@ -128,5 +128,5 @@ int MAIN(int argc, char **argv)
} }
if (cflags) printf("%s\n",SSLeay_version(SSLEAY_CFLAGS)); if (cflags) printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
end: end:
OPENSSL_EXIT(ret); EXIT(ret);
} }

View File

@@ -73,7 +73,6 @@
#include <openssl/x509v3.h> #include <openssl/x509v3.h>
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG #undef PROG
#define PROG x509_main #define PROG x509_main
@@ -122,7 +121,7 @@ static char *x509_usage[]={
" -CAkey arg - set the CA key, must be PEM format\n", " -CAkey arg - set the CA key, must be PEM format\n",
" missing, it is assumed to be in the CA file.\n", " missing, it is assumed to be in the CA file.\n",
" -CAcreateserial - create serial number file if it does not exist\n", " -CAcreateserial - create serial number file if it does not exist\n",
" -CAserial arg - serial file\n", " -CAserial - serial file\n",
" -text - print the certificate in text form\n", " -text - print the certificate in text form\n",
" -C - print out C code forms\n", " -C - print out C code forms\n",
" -md2/-md5/-sha1/-mdc2 - digest to use\n", " -md2/-md5/-sha1/-mdc2 - digest to use\n",
@@ -130,7 +129,6 @@ static char *x509_usage[]={
" -extensions - section from config file with X509V3 extensions to add\n", " -extensions - section from config file with X509V3 extensions to add\n",
" -clrext - delete extensions before signing and input certificate\n", " -clrext - delete extensions before signing and input certificate\n",
" -nameopt arg - various certificate name options\n", " -nameopt arg - various certificate name options\n",
" -engine e - use engine e, possibly a hardware device.\n",
NULL NULL
}; };
@@ -147,7 +145,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL;
int ret=1; int ret=1;
X509_REQ *req=NULL; X509_REQ *req=NULL;
X509 *x=NULL,*xca=NULL; X509 *x=NULL,*xca=NULL;
@@ -178,7 +175,6 @@ int MAIN(int argc, char **argv)
int need_rand = 0; int need_rand = 0;
int checkend=0,checkoffset=0; int checkend=0,checkoffset=0;
unsigned long nmflag = 0; unsigned long nmflag = 0;
char *engine=NULL;
reqfile=0; reqfile=0;
@@ -237,7 +233,7 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-CAkeyform") == 0) else if (strcmp(*argv,"-CAkeyform") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
CAkeyformat=str2fmt(*(++argv)); CAformat=str2fmt(*(++argv));
} }
else if (strcmp(*argv,"-days") == 0) else if (strcmp(*argv,"-days") == 0)
{ {
@@ -341,11 +337,6 @@ int MAIN(int argc, char **argv)
alias= *(++argv); alias= *(++argv);
trustout = 1; trustout = 1;
} }
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-C") == 0) else if (strcmp(*argv,"-C") == 0)
C= ++num; C= ++num;
else if (strcmp(*argv,"-email") == 0) else if (strcmp(*argv,"-email") == 0)
@@ -429,24 +420,6 @@ bad:
goto end; 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) if (need_rand)
app_RAND_load_file(NULL, bio_err, 0); app_RAND_load_file(NULL, bio_err, 0);
@@ -474,7 +447,7 @@ bad:
if (extfile) if (extfile)
{ {
long errorline = -1; long errorline;
X509V3_CTX ctx2; X509V3_CTX ctx2;
if (!(extconf=CONF_load(NULL,extfile,&errorline))) if (!(extconf=CONF_load(NULL,extfile,&errorline)))
{ {
@@ -988,7 +961,7 @@ end:
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free); sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free); sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
if (passin) OPENSSL_free(passin); if (passin) OPENSSL_free(passin);
OPENSSL_EXIT(ret); EXIT(ret);
} }
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,

185
config
View File

@@ -68,11 +68,6 @@ if [ "x$XREL" != "x" ]; then
4.2) 4.2)
echo "whatever-whatever-unixware1"; exit 0 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) 5)
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
echo "${MACHINE}-sco-unixware7"; exit 0 echo "${MACHINE}-sco-unixware7"; exit 0
@@ -200,33 +195,15 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "${MACHINE}-whatever-openbsd"; exit 0 echo "${MACHINE}-whatever-openbsd"; exit 0
;; ;;
OpenUNIX:*)
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
;;
OSF1:*:*:*alpha*) OSF1:*:*:*alpha*)
OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'` echo "${MACHINE}-dec-osf"; exit 0
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
;; ;;
QNX:*) QNX:*)
case "$RELEASE" in case "$VERSION" in
4*) 4*)
echo "${MACHINE}-whatever-qnx4" echo "${MACHINE}-whatever-qnx4"
;; ;;
6*)
echo "${MACHINE}-whatever-qnx6"
;;
*) *)
echo "${MACHINE}-whatever-qnx" echo "${MACHINE}-whatever-qnx"
;; ;;
@@ -242,10 +219,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "ppc-apple-rhapsody"; exit 0 echo "ppc-apple-rhapsody"; exit 0
;; ;;
Darwin:*)
echo "ppc-apple-darwin"; exit 0
;;
SunOS:5.*) SunOS:5.*)
echo "${MACHINE}-whatever-solaris2"; exit 0 echo "${MACHINE}-whatever-solaris2"; exit 0
;; ;;
@@ -298,29 +271,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "mips-sony-newsos4"; exit 0; 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;
;;
NONSTOP_KERNEL*)
echo "nsr-tandem-nsk"; exit 0;
;;
esac esac
# #
@@ -385,33 +335,17 @@ done
# figure out if gcc is available and if so we use it otherwise # figure out if gcc is available and if so we use it otherwise
# we fallback to whatever cc does on the system # we fallback to whatever cc does on the system
GCCVER=`(gcc -dumpversion) 2>/dev/null` GCCVER=`(gcc --version) 2>/dev/null`
if [ "$GCCVER" != "" ]; then if [ "$GCCVER" != "" ]; then
CC=gcc CC=gcc
# then strip off whatever prefix egcs prepends the number with... # then strip off whatever prefix Cygnus prepends the number with...
# Hopefully, this will work for any future prefixes as well. GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'`
GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z]*\-//'`
# Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
# does give us what we want though, so we use that. We just just the
# major and minor version numbers.
# peak single digit before and after first dot, e.g. 2.95.1 gives 29 # peak single digit before and after first dot, e.g. 2.95.1 gives 29
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
else else
CC=cc CC=cc
fi fi
GCCVER=${GCCVER:-0}
if [ "$SYSTEM" = "HP-UX" ];then
# By default gcc is a ILP32 compiler (with long long == 64).
GCC_BITS="32"
if [ $GCCVER -ge 30 ]; then
# PA64 support only came in with gcc 3.0.x.
# We look for the preprocessor symbol __LP64__ indicating
# 64bit bit long and pointer. sizeof(int) == 32 on HPUX64.
if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
GCC_BITS="64"
fi
fi
fi
if [ "$SYSTEM" = "SunOS" ]; then if [ "$SYSTEM" = "SunOS" ]; then
# check for WorkShop C, expected output is "cc: blah-blah C x.x" # check for WorkShop C, expected output is "cc: blah-blah C x.x"
CCVER=`(cc -V 2>&1) 2>/dev/null | \ CCVER=`(cc -V 2>&1) 2>/dev/null | \
@@ -477,8 +411,7 @@ case "$GUESSOS" in
echo "WARNING! If you wish to build 64-bit library, then you have to" echo "WARNING! If you wish to build 64-bit library, then you have to"
echo " invoke './Configure irix64-mips4-$CC' *manually*." echo " invoke './Configure irix64-mips4-$CC' *manually*."
echo " Type return if you want to continue, Ctrl-C to abort." echo " Type return if you want to continue, Ctrl-C to abort."
# Do not stop if /dev/tty is unavailable read waste < /dev/tty
(read waste < /dev/tty) || true
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
CPU=${CPU:-0} CPU=${CPU:-0}
if [ $CPU -ge 5000 ]; then if [ $CPU -ge 5000 ]; then
@@ -502,39 +435,18 @@ case "$GUESSOS" in
esac esac
fi fi
;; ;;
mips-*-linux?) mips-*-linux?) OUT="linux-mips" ;;
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
;;
ppc64-*-linux2)
#Use the standard target for PPC architecture until we create a
#special one for the 64bit architecture.
OUT="linux-ppc" ;;
ppc-*-linux2) OUT="linux-ppc" ;; ppc-*-linux2) OUT="linux-ppc" ;;
m68k-*-linux*) OUT="linux-m68k" ;; m68k-*-linux*) OUT="linux-m68k" ;;
ia64-*-linux?) OUT="linux-ia64" ;; ia64-*-linux?) OUT="linux-ia64" ;;
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
sparc64-*-linux2) sparc64-*-linux2)
#Before we can uncomment following lines we have to wait at least #Before we can uncomment following lines we have to wait at least
#till 64-bit glibc for SPARC is operational:-( #till 64-bit glibc for SPARC is operational:-(
#echo "WARNING! If you wish to build 64-bit library, then you have to" #echo "WARNING! If you wish to build 64-bit library, then you have to"
#echo " invoke './Configure linux64-sparcv9' *manually*." #echo " invoke './Configure linux64-sparcv9' *manually*."
#echo " Type return if you want to continue, Ctrl-C to abort." #echo " Type return if you want to continue, Ctrl-C to abort."
# Do not stop if /dev/tty is unavailable #read waste < /dev/tty
#(read waste < /dev/tty) || true
OUT="linux-sparcv9" ;; OUT="linux-sparcv9" ;;
sparc-*-linux2) sparc-*-linux2)
KARCH=`awk '/^type/{print$3}' /proc/cpuinfo` KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
@@ -544,29 +456,8 @@ EOF
sun4d) OUT="linux-sparcv8" ;; sun4d) OUT="linux-sparcv8" ;;
*) OUT="linux-sparcv7" ;; *) OUT="linux-sparcv7" ;;
esac ;; 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" ;; arm*-*-linux2) OUT="linux-elf-arm" ;;
s390-*-linux2) OUT="linux-s390" ;; s390-*-linux2) OUT="linux-s390" ;;
s390x-*-linux?) OUT="linux-s390x" ;;
*-*-linux2) OUT="linux-elf" ;; *-*-linux2) OUT="linux-elf" ;;
*-*-linux1) OUT="linux-aout" ;; *-*-linux1) OUT="linux-aout" ;;
sun4u*-*-solaris2) sun4u*-*-solaris2)
@@ -575,8 +466,7 @@ EOF
echo "WARNING! If you wish to build 64-bit library, then you have to" echo "WARNING! If you wish to build 64-bit library, then you have to"
echo " invoke './Configure solaris64-sparcv9-cc' *manually*." echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
echo " Type return if you want to continue, Ctrl-C to abort." echo " Type return if you want to continue, Ctrl-C to abort."
# Do not stop if /dev/tty is unavailable read waste < /dev/tty
(read waste < /dev/tty) || true
fi fi
OUT="solaris-sparcv9-$CC" ;; OUT="solaris-sparcv9-$CC" ;;
sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;; sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
@@ -595,15 +485,7 @@ EOF
pmax*-*-openbsd) OUT="OpenBSD-mips" ;; pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
*-*-openbsd) OUT="OpenBSD" ;; *-*-openbsd) OUT="OpenBSD" ;;
*86*-*-bsdi4) OUT="bsdi-elf-gcc" ;; *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
*-*-osf) OUT="alphaold-cc" ;; *-*-osf) OUT="alpha-cc" ;;
*-*-tru64) OUT="alpha-cc" ;;
*-*-OpenUNIX*)
if [ "$CC" = "gcc" ]; then
OUT="OpenUNIX-8-gcc"
else
OUT="OpenUNIX-8"
fi
;;
*-*-unixware7) OUT="unixware-7" ;; *-*-unixware7) OUT="unixware-7" ;;
*-*-UnixWare7) OUT="unixware-7" ;; *-*-UnixWare7) OUT="unixware-7" ;;
*-*-Unixware7) OUT="unixware-7" ;; *-*-Unixware7) OUT="unixware-7" ;;
@@ -616,52 +498,21 @@ EOF
BS2000-siemens-sysv4) OUT="BS2000-OSD" ;; BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
RM*-siemens-sysv4) OUT="ReliantUNIX" ;; RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
*-siemens-sysv4) OUT="SINIX" ;; *-siemens-sysv4) OUT="SINIX" ;;
*-hpux1*) *-hpux1*) OUT="hpux-parisc-$CC"
if [ $CC = "gcc" ]; options="$options -D_REENTRANT" ;;
then
if [ $GCC_BITS = "64" ]; then
OUT="hpux64-parisc-gcc"
else
OUT="hpux-parisc-gcc"
fi
else
OUT="hpux-parisc-$CC"
fi
options="$options -D_REENTRANT" ;;
*-hpux) OUT="hpux-parisc-$CC" ;; *-hpux) OUT="hpux-parisc-$CC" ;;
# these are all covered by the catchall below # these are all covered by the catchall below
# *-aix) OUT="aix-$CC" ;; # *-aix) OUT="aix-$CC" ;;
# *-dgux) OUT="dgux" ;; # *-dgux) OUT="dgux" ;;
mips-sony-newsos4) OUT="newsos4-gcc" ;; 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" ;;
nsr-tandem-nsk) OUT="tandem-c89" ;;
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
esac 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 # See whether we can compile Atalla support
#if [ -f /usr/include/atasi.h ] if [ -f /usr/include/atasi.h ]
#then then
# options="$options -DATALLA" options="$options -DATALLA"
#fi 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 # gcc < 2.8 does not support -mcpu=ultrasparc
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
@@ -682,7 +533,7 @@ case "$GUESSOS" in
i386-*) options="$options 386" ;; i386-*) options="$options 386" ;;
esac 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 do
if [ ! -d crypto/$i ] if [ ! -d crypto/$i ]
then then

View File

@@ -6,7 +6,7 @@ DIR= crypto
TOP= .. TOP= ..
CC= cc CC= cc
INCLUDE= -I. -I../include INCLUDE= -I. -I../include
INCLUDES= -I.. -I../.. -I../../include INCLUDES= -I.. -I../../include
CFLAG= -g CFLAG= -g
INSTALL_PREFIX= INSTALL_PREFIX=
OPENSSLDIR= /usr/local/ssl OPENSSLDIR= /usr/local/ssl
@@ -27,15 +27,15 @@ LIBS=
SDIRS= md2 md5 sha mdc2 hmac ripemd \ SDIRS= md2 md5 sha mdc2 hmac ripemd \
des rc2 rc4 rc5 idea bf cast \ des rc2 rc4 rc5 idea bf cast \
bn rsa dsa dh dso engine \ bn rsa dsa dh dso \
buffer bio stack lhash rand err objects \ buffer bio stack lhash rand err objects \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
GENERAL=Makefile README crypto-lib.com install.com GENERAL=Makefile README crypto-lib.com install.com
LIB= $(TOP)/libcrypto.a LIB= $(TOP)/libcrypto.a
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c
LIBOBJ= cryptlib.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o
SRC= $(LIBSRC) SRC= $(LIBSRC)
@@ -51,11 +51,11 @@ all: buildinf.h lib subdirs
buildinf.h: ../Makefile.ssl buildinf.h: ../Makefile.ssl
( echo "#ifndef MK1MF_BUILD"; \ ( echo "#ifndef MK1MF_BUILD"; \
echo ' /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */'; \ echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \ echo " #define CFLAGS \"$(CC) $(CFLAG)\""; \
echo ' #define PLATFORM "$(PLATFORM)"'; \ echo " #define PLATFORM \"$(PLATFORM)\""; \
echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \ echo " #define DATE \"`date`\""; \
echo '#endif' ) >buildinf.h echo "#endif" ) >buildinf.h
testapps: testapps:
if echo ${SDIRS} | fgrep ' des '; \ if echo ${SDIRS} | fgrep ' des '; \
@@ -129,12 +129,12 @@ lint:
depend: depend:
if [ ! -f buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist if [ ! -f buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist
$(MAKEDEPEND) -- $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC)
if [ ! -s buildinf.h ]; then rm buildinf.h; fi if [ ! -s buildinf.h ]; then rm buildinf.h; fi
@for i in $(SDIRS) ;\ @for i in $(SDIRS) ;\
do \ do \
(cd $$i; echo "making depend in crypto/$$i..."; \ (cd $$i; echo "making depend in crypto/$$i..."; \
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ); \ $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
done; done;
clean: clean:
@@ -185,9 +185,6 @@ mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h
mem.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h mem.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
mem.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h mem.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
mem_clr.o: ../include/openssl/crypto.h ../include/openssl/opensslv.h
mem_clr.o: ../include/openssl/safestack.h ../include/openssl/stack.h
mem_clr.o: ../include/openssl/symhacks.h
mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h
mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h

View File

@@ -104,7 +104,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) -- $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
@@ -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/conf.h ../../include/openssl/crypto.h
t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.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/dsa.h ../../include/openssl/e_os.h
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h t_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
t_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h t_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_bitst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h t_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_bitst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h t_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h t_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_bitst.o: ../cryptlib.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/asn1.h ../../include/openssl/bio.h
t_crl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.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/buffer.h ../../include/openssl/cast.h
t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.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/des.h ../../include/openssl/dh.h
t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.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/e_os.h ../../include/openssl/e_os2.h
t_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h t_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_crl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h t_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h t_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h t_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_crl.o: ../cryptlib.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/bio.h ../../include/openssl/bn.h
t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.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/conf.h ../../include/openssl/crypto.h
t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.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/dsa.h ../../include/openssl/e_os.h
t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h t_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
t_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h t_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_req.o: ../../include/openssl/md4.h ../../include/openssl/md5.h t_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_req.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h t_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h t_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_req.o: ../cryptlib.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/asn1.h ../../include/openssl/asn1_mac.h
t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.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/conf.h ../../include/openssl/crypto.h
t_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.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/dsa.h ../../include/openssl/e_os.h
t_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h t_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h t_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h t_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h t_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h t_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h t_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_x509.o: ../cryptlib.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/asn1.h ../../include/openssl/asn1_mac.h
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.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/cast.h ../../include/openssl/conf.h
x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.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/dh.h ../../include/openssl/dsa.h
x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
x_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
x_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h x_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h x_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
x_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h x_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
x_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h x_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h x_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
x_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_x509.o: ../../include/openssl/x509v3.h ../cryptlib.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/asn1.h ../../include/openssl/asn1_mac.h
x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h

View File

@@ -89,6 +89,8 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
if (a == NULL) return(0); if (a == NULL) return(0);
len=a->length; len=a->length;
ret=1+len;
if (pp == NULL) return(ret);
if (len > 0) if (len > 0)
{ {
@@ -116,10 +118,6 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
} }
else else
bits=0; bits=0;
ret=1+len;
if (pp == NULL) return(ret);
p= *pp; p= *pp;
*(p++)=(unsigned char)bits; *(p++)=(unsigned char)bits;
@@ -226,7 +224,6 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
w=n/8; w=n/8;
v=1<<(7-(n&0x07)); v=1<<(7-(n&0x07));
iv= ~v; iv= ~v;
if (!value) v=0;
a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */ a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */

View File

@@ -205,18 +205,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
else ret->type=V_ASN1_ENUMERATED; else ret->type=V_ASN1_ENUMERATED;
j=BN_num_bits(bn); j=BN_num_bits(bn);
len=((j == 0)?0:((j/8)+1)); len=((j == 0)?0:((j/8)+1));
if (ret->length < len+4) ret->data=(unsigned char *)OPENSSL_malloc(len+4);
{
unsigned char *new_data=
OPENSSL_realloc(ret->data, len+4);
if (!new_data)
{
ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
goto err;
}
ret->data=new_data;
}
ret->length=BN_bn2bin(bn,ret->data); ret->length=BN_bn2bin(bn,ret->data);
return(ret); return(ret);
err: err:

View File

@@ -203,7 +203,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
if (s == NULL) if (s == NULL)
return(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 */ 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; ts=&data;
#else #else

View File

@@ -451,16 +451,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
else ret->type=V_ASN1_INTEGER; else ret->type=V_ASN1_INTEGER;
j=BN_num_bits(bn); j=BN_num_bits(bn);
len=((j == 0)?0:((j/8)+1)); len=((j == 0)?0:((j/8)+1));
if (ret->length < len+4) ret->data=(unsigned char *)OPENSSL_malloc(len+4);
{
unsigned char *new_data= OPENSSL_realloc(ret->data, len+4);
if (!new_data)
{
ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
goto err;
}
ret->data=new_data;
}
ret->length=BN_bn2bin(bn,ret->data); ret->length=BN_bn2bin(bn,ret->data);
return(ret); return(ret);
err: err:

View File

@@ -116,7 +116,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
} }
pStart = p; /* Catch the beg of Setblobs*/ pStart = p; /* Catch the beg of Setblobs*/
if (!(rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)))) return 0; /* In this array rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
we will store the SET blobs */ we will store the SET blobs */
for (i=0; i<sk_num(a); i++) for (i=0; i<sk_num(a); i++)
@@ -133,7 +133,7 @@ SetBlob
/* Now we have to sort the blobs. I am using a simple algo. /* Now we have to sort the blobs. I am using a simple algo.
*Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/ *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp); qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp);
if (!(pTempMem = OPENSSL_malloc(totSize))) return 0; pTempMem = OPENSSL_malloc(totSize);
/* Copy to temp mem */ /* Copy to temp mem */
p = pTempMem; p = pTempMem;

View File

@@ -55,59 +55,6 @@
* copied and put under another distribution licence * copied and put under another distribution licence
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
/* ====================================================================
* Copyright (c) 1998-2002 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 <stdio.h>
#include <time.h> #include <time.h>
@@ -140,14 +87,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
else else
a=algor2; a=algor2;
if (a == NULL) continue; if (a == NULL) continue;
if (type->pkey_type == NID_dsaWithSHA1) if ( (a->parameter == NULL) ||
{
/* special case: RFC 2459 tells us to omit 'parameters'
* with id-dsa-with-sha1 */
ASN1_TYPE_free(a->parameter);
a->parameter = NULL;
}
else if ((a->parameter == NULL) ||
(a->parameter->type != V_ASN1_NULL)) (a->parameter->type != V_ASN1_NULL))
{ {
ASN1_TYPE_free(a->parameter); ASN1_TYPE_free(a->parameter);
@@ -199,10 +139,10 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; signature->flags|=ASN1_STRING_FLAG_BITS_LEFT;
err: err:
OPENSSL_cleanse(&ctx,sizeof(ctx)); memset(&ctx,0,sizeof(ctx));
if (buf_in != NULL) if (buf_in != NULL)
{ OPENSSL_cleanse((char *)buf_in,(unsigned int)inl); OPENSSL_free(buf_in); } { memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
if (buf_out != NULL) if (buf_out != NULL)
{ OPENSSL_cleanse((char *)buf_out,outll); OPENSSL_free(buf_out); } { memset((char *)buf_out,0,outll); OPENSSL_free(buf_out); }
return(outl); return(outl);
} }

View File

@@ -519,7 +519,7 @@ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
{ {
ASN1_STRING stmp, *str = &stmp; ASN1_STRING stmp, *str = &stmp;
int mbflag, type, ret; int mbflag, type, ret;
if(!in) return -1; if(!*out || !in) return -1;
type = in->type; type = in->type;
if((type < 0) || (type > 30)) return -1; if((type < 0) || (type > 30)) return -1;
mbflag = tag2nbyte[type]; mbflag = tag2nbyte[type];
@@ -528,6 +528,6 @@ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
stmp.data = NULL; stmp.data = NULL;
ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING); ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING);
if(ret < 0) return ret; if(ret < 0) return ret;
*out = stmp.data; if(out) *out = stmp.data;
return stmp.length; return stmp.length;
} }

View File

@@ -105,9 +105,9 @@ int ASN1_STRING_set_default_mask_asc(char *p)
mask = strtoul(p + 5, &end, 0); mask = strtoul(p + 5, &end, 0);
if(*end) return 0; if(*end) return 0;
} else if(!strcmp(p, "nombstr")) } 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")) 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, "utf8only")) mask = B_ASN1_UTF8STRING;
else if(!strcmp(p, "default")) else if(!strcmp(p, "default"))
mask = 0xFFFFFFFFL; mask = 0xFFFFFFFFL;

View File

@@ -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) ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
{ {
struct tm *ts; struct tm *ts;
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN) #if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
struct tm data; struct tm data;
gmtime_r(&t,&data); gmtime_r(&t,&data);

View File

@@ -203,7 +203,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
if (s == NULL) if (s == NULL)
return(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 */ 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; ts=&data;
#else #else
@@ -246,8 +246,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
ts=(struct tm *)localtime(&t); ts=(struct tm *)localtime(&t);
} }
#endif #endif
if (ts == NULL)
return(NULL);
p=(char *)s->data; p=(char *)s->data;
if ((p == NULL) || (s->length < 14)) if ((p == NULL) || (s->length < 14))
{ {
@@ -272,9 +270,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
{ {
struct tm *tm; struct tm *tm;
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
struct tm data;
#endif
int offset; int offset;
int year; int year;
@@ -291,9 +286,8 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
t -= offset*60; /* FIXME: may overflow in extreme cases */ 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__)
gmtime_r(&t, &data); { struct tm data; gmtime_r(&t, &data); tm = &data; }
tm = &data;
#else #else
tm = gmtime(&t); tm = gmtime(&t);
#endif #endif

View File

@@ -100,7 +100,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
EVP_VerifyInit(&ctx,type); EVP_VerifyInit(&ctx,type);
EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl);
OPENSSL_cleanse(buf_in,(unsigned int)inl); memset(buf_in,0,(unsigned int)inl);
OPENSSL_free(buf_in); OPENSSL_free(buf_in);
if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data, if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data,

View File

@@ -834,6 +834,8 @@ void ASN1_HEADER_free(ASN1_HEADER *a);
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); 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 */ /* Not used that much at this point, except for the first two */
ASN1_METHOD *X509_asn1_meth(void); ASN1_METHOD *X509_asn1_meth(void);
ASN1_METHOD *RSAPrivateKey_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 /* 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. * 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. */ /* Error codes for the ASN1 functions. */
@@ -1147,3 +1148,4 @@ void ERR_load_ASN1_strings(void);
} }
#endif #endif
#endif #endif

View File

@@ -57,7 +57,6 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <limits.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/asn1.h> #include <openssl/asn1.h>
#include <openssl/asn1_mac.h> #include <openssl/asn1_mac.h>
@@ -125,13 +124,15 @@ int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
(int)(omax+ *pp)); (int)(omax+ *pp));
#endif #endif
if (*plength > (omax - (p - *pp))) #if 0
if ((p+ *plength) > (omax+ *pp))
{ {
ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG); ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG);
/* Set this so that even if things are not long enough /* Set this so that even if things are not long enough
* the values are set correctly */ * the values are set correctly */
ret|=0x80; ret|=0x80;
} }
#endif
*pp=p; *pp=p;
return(ret|inf); return(ret|inf);
err: err:
@@ -142,7 +143,7 @@ err:
static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max) static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
{ {
unsigned char *p= *pp; unsigned char *p= *pp;
unsigned long ret=0; long ret=0;
int i; int i;
if (max-- < 1) return(0); if (max-- < 1) return(0);
@@ -158,8 +159,6 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
i= *p&0x7f; i= *p&0x7f;
if (*(p++) & 0x80) if (*(p++) & 0x80)
{ {
if (i > sizeof(long))
return 0;
if (max-- == 0) return(0); if (max-- == 0) return(0);
while (i-- > 0) while (i-- > 0)
{ {
@@ -171,10 +170,8 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
else else
ret=i; ret=i;
} }
if (ret > LONG_MAX)
return 0;
*pp=p; *pp=p;
*rl=(long)ret; *rl=ret;
return(1); return(1);
} }
@@ -410,7 +407,7 @@ int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b)
void asn1_add_error(unsigned char *address, int offset) void asn1_add_error(unsigned char *address, int offset)
{ {
char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1]; char buf1[16],buf2[16];
sprintf(buf1,"%lu",(unsigned long)address); sprintf(buf1,"%lu",(unsigned long)address);
sprintf(buf2,"%d",offset); sprintf(buf2,"%d",offset);

View File

@@ -87,7 +87,6 @@ DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
} }
M_ASN1_BIT_STRING_free(bs); M_ASN1_BIT_STRING_free(bs);
bs = NULL;
M_ASN1_D2I_Finish_2(a); M_ASN1_D2I_Finish_2(a);

View File

@@ -84,7 +84,6 @@ DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length)
if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn; if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn;
M_ASN1_BIT_STRING_free(bs); M_ASN1_BIT_STRING_free(bs);
bs = NULL;
M_ASN1_D2I_Finish_2(a); M_ASN1_D2I_Finish_2(a);

View File

@@ -108,7 +108,6 @@ RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
goto err_bn; goto err_bn;
M_ASN1_INTEGER_free(bs); M_ASN1_INTEGER_free(bs);
bs = NULL;
M_ASN1_D2I_Finish_2(a); M_ASN1_D2I_Finish_2(a);
err_bn: err_bn:

View File

@@ -181,7 +181,7 @@ int i2d_RSA_NET(RSA *a, unsigned char **pp, int (*cb)(), int sgckey)
} }
EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL); EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL);
OPENSSL_cleanse(buf,256); memset(buf,0,256);
EVP_CIPHER_CTX_init(&ctx); EVP_CIPHER_CTX_init(&ctx);
EVP_EncryptInit(&ctx,EVP_rc4(),key,NULL); EVP_EncryptInit(&ctx,EVP_rc4(),key,NULL);
@@ -292,7 +292,7 @@ RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length,
} }
EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL); EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL);
OPENSSL_cleanse(buf,256); memset(buf,0,256);
EVP_CIPHER_CTX_init(&ctx); EVP_CIPHER_CTX_init(&ctx);
EVP_DecryptInit(&ctx,EVP_rc4(),key,NULL); EVP_DecryptInit(&ctx,EVP_rc4(),key,NULL);

View File

@@ -119,8 +119,8 @@ void PKCS8_PRIV_KEY_INFO_free (PKCS8_PRIV_KEY_INFO *a)
X509_ALGOR_free(a->pkeyalg); X509_ALGOR_free(a->pkeyalg);
/* Clear sensitive data */ /* Clear sensitive data */
if (a->pkey->value.octet_string) if (a->pkey->value.octet_string)
OPENSSL_cleanse(a->pkey->value.octet_string->data, memset (a->pkey->value.octet_string->data,
a->pkey->value.octet_string->length); 0, a->pkey->value.octet_string->length);
ASN1_TYPE_free (a->pkey); ASN1_TYPE_free (a->pkey);
sk_X509_ATTRIBUTE_pop_free (a->attributes, X509_ATTRIBUTE_free); sk_X509_ATTRIBUTE_pop_free (a->attributes, X509_ATTRIBUTE_free);
OPENSSL_free (a); OPENSSL_free (a);

View File

@@ -96,34 +96,10 @@ int RSA_print(BIO *bp, RSA *x, int off)
char str[128]; char str[128];
const char *s; const char *s;
unsigned char *m=NULL; unsigned char *m=NULL;
int ret=0; int i,ret=0;
size_t buf_len=0, i;
if (x->n) i=RSA_size(x);
buf_len = (size_t)BN_num_bytes(x->n); m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
if (x->e)
if (buf_len < (i = (size_t)BN_num_bytes(x->e)))
buf_len = i;
if (x->d)
if (buf_len < (i = (size_t)BN_num_bytes(x->d)))
buf_len = i;
if (x->p)
if (buf_len < (i = (size_t)BN_num_bytes(x->p)))
buf_len = i;
if (x->q)
if (buf_len < (i = (size_t)BN_num_bytes(x->q)))
buf_len = i;
if (x->dmp1)
if (buf_len < (i = (size_t)BN_num_bytes(x->dmp1)))
buf_len = i;
if (x->dmq1)
if (buf_len < (i = (size_t)BN_num_bytes(x->dmq1)))
buf_len = i;
if (x->iqmp)
if (buf_len < (i = (size_t)BN_num_bytes(x->iqmp)))
buf_len = i;
m=(unsigned char *)OPENSSL_malloc(buf_len+10);
if (m == NULL) if (m == NULL)
{ {
RSAerr(RSA_F_RSA_PRINT,ERR_R_MALLOC_FAILURE); RSAerr(RSA_F_RSA_PRINT,ERR_R_MALLOC_FAILURE);
@@ -185,25 +161,22 @@ int DSA_print(BIO *bp, DSA *x, int off)
{ {
char str[128]; char str[128];
unsigned char *m=NULL; unsigned char *m=NULL;
int ret=0; int i,ret=0;
size_t buf_len=0,i; BIGNUM *bn=NULL;
if (x->p) if (x->p != NULL)
buf_len = (size_t)BN_num_bytes(x->p); bn=x->p;
if (x->q) else if (x->priv_key != NULL)
if (buf_len < (i = (size_t)BN_num_bytes(x->q))) bn=x->priv_key;
buf_len = i; else if (x->pub_key != NULL)
if (x->g) bn=x->pub_key;
if (buf_len < (i = (size_t)BN_num_bytes(x->g)))
buf_len = i; /* larger than needed but what the hell :-) */
if (x->priv_key) if (bn != NULL)
if (buf_len < (i = (size_t)BN_num_bytes(x->priv_key))) i=BN_num_bytes(bn)*2;
buf_len = i; else
if (x->pub_key) i=256;
if (buf_len < (i = (size_t)BN_num_bytes(x->pub_key))) m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
buf_len = i;
m=(unsigned char *)OPENSSL_malloc(buf_len+10);
if (m == NULL) if (m == NULL)
{ {
DSAerr(DSA_F_DSA_PRINT,ERR_R_MALLOC_FAILURE); DSAerr(DSA_F_DSA_PRINT,ERR_R_MALLOC_FAILURE);
@@ -308,15 +281,10 @@ int DHparams_print_fp(FILE *fp, DH *x)
int DHparams_print(BIO *bp, DH *x) int DHparams_print(BIO *bp, DH *x)
{ {
unsigned char *m=NULL; unsigned char *m=NULL;
int reason=ERR_R_BUF_LIB,ret=0; int reason=ERR_R_BUF_LIB,i,ret=0;
size_t buf_len=0, i;
if (x->p) i=BN_num_bytes(x->p);
buf_len = (size_t)BN_num_bytes(x->p); m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
if (x->g)
if (buf_len < (i = (size_t)BN_num_bytes(x->g)))
buf_len = i;
m=(unsigned char *)OPENSSL_malloc(buf_len+10);
if (m == NULL) if (m == NULL)
{ {
reason=ERR_R_MALLOC_FAILURE; reason=ERR_R_MALLOC_FAILURE;
@@ -366,18 +334,10 @@ int DSAparams_print_fp(FILE *fp, DSA *x)
int DSAparams_print(BIO *bp, DSA *x) int DSAparams_print(BIO *bp, DSA *x)
{ {
unsigned char *m=NULL; unsigned char *m=NULL;
int reason=ERR_R_BUF_LIB,ret=0; int reason=ERR_R_BUF_LIB,i,ret=0;
size_t buf_len=0, i;
if (x->p) i=BN_num_bytes(x->p);
buf_len = (size_t)BN_num_bytes(x->p); m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
if (x->q)
if (buf_len < (i = (size_t)BN_num_bytes(x->q)))
buf_len = i;
if (x->g)
if (buf_len < (i = (size_t)BN_num_bytes(x->g)))
buf_len = i;
m=(unsigned char *)OPENSSL_malloc(buf_len+10);
if (m == NULL) if (m == NULL)
{ {
reason=ERR_R_MALLOC_FAILURE; reason=ERR_R_MALLOC_FAILURE;

View File

@@ -156,7 +156,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
dsa->write_params=0; dsa->write_params=0;
ASN1_TYPE_free(a->parameter); ASN1_TYPE_free(a->parameter);
i=i2d_DSAparams(dsa,NULL); i=i2d_DSAparams(dsa,NULL);
if ((p=(unsigned char *)OPENSSL_malloc(i)) == NULL) goto err; p=(unsigned char *)OPENSSL_malloc(i);
pp=p; pp=p;
i2d_DSAparams(dsa,&pp); i2d_DSAparams(dsa,&pp);
a->parameter=ASN1_TYPE_new(); a->parameter=ASN1_TYPE_new();

View File

@@ -96,7 +96,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) -- $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new

View File

@@ -63,8 +63,6 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "../e_os.h"
#ifdef NO_BF #ifdef NO_BF
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@@ -277,7 +275,7 @@ int main(int argc, char *argv[])
else else
ret=test(); ret=test();
EXIT(ret); exit(ret);
return(0); return(0);
} }

View File

@@ -78,7 +78,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) -- $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new

View File

@@ -56,13 +56,6 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
/* disable assert() unless BIO_DEBUG has been defined */
#ifndef BIO_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
/* /*
* Stolen from tjh's ssl/ssl_trc.c stuff. * Stolen from tjh's ssl/ssl_trc.c stuff.
*/ */
@@ -109,7 +102,7 @@
* o ... (for OpenSSL) * o ... (for OpenSSL)
*/ */
#ifdef HAVE_LONG_DOUBLE #if HAVE_LONG_DOUBLE
#define LDOUBLE long double #define LDOUBLE long double
#else #else
#define LDOUBLE double #define LDOUBLE double
@@ -576,7 +569,7 @@ pow10(int exp)
} }
static long static long
roundv(LDOUBLE value) round(LDOUBLE value)
{ {
long intpart; long intpart;
intpart = (long) value; intpart = (long) value;
@@ -628,7 +621,7 @@ fmtfp(
/* we "cheat" by converting the fractional part to integer by /* we "cheat" by converting the fractional part to integer by
multiplying by a factor of 10 */ multiplying by a factor of 10 */
fracpart = roundv((pow10(max)) * (ufvalue - intpart)); fracpart = round((pow10(max)) * (ufvalue - intpart));
if (fracpart >= pow10(max)) { if (fracpart >= pow10(max)) {
intpart++; intpart++;
@@ -723,13 +716,12 @@ doapr_outch(
if (buffer) { if (buffer) {
while (*currlen >= *maxlen) { while (*currlen >= *maxlen) {
if (*buffer == NULL) { if (*buffer == NULL) {
assert(*sbuffer != NULL);
if (*maxlen == 0) if (*maxlen == 0)
*maxlen = 1024; *maxlen = 1024;
*buffer = OPENSSL_malloc(*maxlen); *buffer = OPENSSL_malloc(*maxlen);
if (*currlen > 0) { if (*currlen > 0)
assert(*sbuffer != NULL);
memcpy(*buffer, *sbuffer, *currlen); memcpy(*buffer, *sbuffer, *currlen);
}
*sbuffer = NULL; *sbuffer = NULL;
} else { } else {
*maxlen += 1024; *maxlen += 1024;
@@ -769,9 +761,7 @@ int BIO_vprintf (BIO *bio, const char *format, va_list args)
{ {
int ret; int ret;
size_t retlen; size_t retlen;
char hugebuf[1024*2]; /* Was previously 10k, which is unreasonable MS_STATIC char hugebuf[1024*10];
in small-stack environments, like threads
or DOS programs. */
char *hugebufp = hugebuf; char *hugebufp = hugebuf;
size_t hugebufsize = sizeof(hugebuf); size_t hugebufsize = sizeof(hugebuf);
char *dynbuf = NULL; char *dynbuf = NULL;

View File

@@ -72,9 +72,9 @@
#endif #endif
#ifdef SO_MAXCONN #ifdef SO_MAXCONN
#define MAX_LISTEN SO_MAXCONN
#elif defined(SOMAXCONN)
#define MAX_LISTEN SOMAXCONN #define MAX_LISTEN SOMAXCONN
#elif defined(SO_MAXCONN)
#define MAX_LISTEN SO_MAXCONN
#else #else
#define MAX_LISTEN 32 #define MAX_LISTEN 32
#endif #endif
@@ -95,10 +95,8 @@ static struct ghbn_cache_st
} ghbn_cache[GHBN_NUM]; } ghbn_cache[GHBN_NUM];
static int get_ip(const char *str,unsigned char *ip); static int get_ip(const char *str,unsigned char *ip);
#if 0
static void ghbn_free(struct hostent *a); static void ghbn_free(struct hostent *a);
static struct hostent *ghbn_dup(struct hostent *a); static struct hostent *ghbn_dup(struct hostent *a);
#endif
int BIO_get_host_ip(const char *str, unsigned char *ip) int BIO_get_host_ip(const char *str, unsigned char *ip)
{ {
int i; int i;
@@ -268,7 +266,6 @@ long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)
return(1); return(1);
} }
#if 0
static struct hostent *ghbn_dup(struct hostent *a) static struct hostent *ghbn_dup(struct hostent *a)
{ {
struct hostent *ret; struct hostent *ret;
@@ -345,27 +342,21 @@ static void ghbn_free(struct hostent *a)
if (a->h_name != NULL) OPENSSL_free(a->h_name); if (a->h_name != NULL) OPENSSL_free(a->h_name);
OPENSSL_free(a); OPENSSL_free(a);
} }
#endif
struct hostent *BIO_gethostbyname(const char *name) 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; struct hostent *ret;
int i,lowi=0,j; int i,lowi=0,j;
unsigned long low= (unsigned long)-1; unsigned long low= (unsigned long)-1;
/* return(gethostbyname(name)); */
# if 0 #if 0 /* It doesn't make sense to use locking here: The function interface
/* It doesn't make sense to use locking here: The function interface * is not thread-safe, because threads can never be sure when
* is not thread-safe, because threads can never be sure when * some other thread destroys the data they were given a pointer to.
* some other thread destroys the data they were given a pointer to. */
*/
CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME); CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);
# endif #endif
j=strlen(name); j=strlen(name);
if (j < 128) if (j < 128)
{ {
@@ -393,21 +384,20 @@ struct hostent *BIO_gethostbyname(const char *name)
* parameter is 'char *', instead of 'const char *' * parameter is 'char *', instead of 'const char *'
*/ */
ret=gethostbyname( ret=gethostbyname(
# ifndef CONST_STRICT #ifndef CONST_STRICT
(char *) (char *)
# endif #endif
name); name);
if (ret == NULL) if (ret == NULL)
goto end; goto end;
if (j > 128) /* too big to cache */ if (j > 128) /* too big to cache */
{ {
# if 0 #if 0 /* If we were trying to make this function thread-safe (which
/* If we were trying to make this function thread-safe (which * is bound to fail), we'd have to give up in this case
* is bound to fail), we'd have to give up in this case * (or allocate more memory). */
* (or allocate more memory). */
ret = NULL; ret = NULL;
# endif #endif
goto end; goto end;
} }
@@ -431,14 +421,12 @@ struct hostent *BIO_gethostbyname(const char *name)
ghbn_cache[i].order=BIO_ghbn_miss+BIO_ghbn_hits; ghbn_cache[i].order=BIO_ghbn_miss+BIO_ghbn_hits;
} }
end: end:
# if 0 #if 0
CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME); CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME);
# endif
return(ret);
#endif #endif
return(ret);
} }
int BIO_sock_init(void) int BIO_sock_init(void)
{ {
#ifdef WINDOWS #ifdef WINDOWS

View File

@@ -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); BIO_write(b->next_bio, "<*<", 3);
#endif #endif
i=BIO_write(b->next_bio, i=BIO_write(b->next_bio,
@@ -210,13 +210,13 @@ BIO_write(b->next_bio, "<*<", 3);
ctx->obuf_len = orig_olen; ctx->obuf_len = orig_olen;
BIO_copy_next_retry(b); BIO_copy_next_retry(b);
#if 0 #ifdef DEBUG
BIO_write(b->next_bio, ">*>", 3); BIO_write(b->next_bio, ">*>", 3);
#endif #endif
if (i < 0) return((num > 0)?num:i); if (i < 0) return((num > 0)?num:i);
if (i == 0) return(num); if (i == 0) return(num);
} }
#if 0 #ifdef DEBUG
BIO_write(b->next_bio, ">*>", 3); BIO_write(b->next_bio, ">*>", 3);
#endif #endif
if (i < ctx->obuf_len) 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. */ buffer if a NL was found and there is anything to write. */
if ((foundnl || p - in > ctx->obuf_size) && p - in > 0) if ((foundnl || p - in > ctx->obuf_size) && p - in > 0)
{ {
#if 0 #ifdef DEBUG
BIO_write(b->next_bio, "<*<", 3); BIO_write(b->next_bio, "<*<", 3);
#endif #endif
i=BIO_write(b->next_bio,in,p - in); i=BIO_write(b->next_bio,in,p - in);
if (i <= 0) if (i <= 0)
{ {
BIO_copy_next_retry(b); BIO_copy_next_retry(b);
#if 0 #ifdef DEBUG
BIO_write(b->next_bio, ">*>", 3); BIO_write(b->next_bio, ">*>", 3);
#endif #endif
if (i < 0) return((num > 0)?num:i); if (i < 0) return((num > 0)?num:i);
if (i == 0) return(num); if (i == 0) return(num);
} }
#if 0 #ifdef DEBUG
BIO_write(b->next_bio, ">*>", 3); BIO_write(b->next_bio, ">*>", 3);
#endif #endif
num+=i; num+=i;

View File

@@ -104,7 +104,7 @@ static int nbiof_new(BIO *bi)
{ {
NBIO_TEST *nt; NBIO_TEST *nt;
if (!(nt=(NBIO_TEST *)OPENSSL_malloc(sizeof(NBIO_TEST)))) return(0); nt=(NBIO_TEST *)OPENSSL_malloc(sizeof(NBIO_TEST));
nt->lrn= -1; nt->lrn= -1;
nt->lwn= -1; nt->lwn= -1;
bi->ptr=(char *)nt; bi->ptr=(char *)nt;

View File

@@ -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_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_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_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_ip(b,ip) BIO_ptr_ctrl(b,BIO_C_SET_CONNECT,2)
#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3) #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) #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) \ #define BIO_set_ssl_renegotiate_bytes(b,num) \
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL); BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
#define BIO_get_num_renegotiates(b) \ #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) \ #define BIO_set_ssl_renegotiate_timeout(b,seconds) \
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL); 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); void BIO_sock_cleanup(void);
int BIO_set_tcp_ndelay(int sock,int turn_on); 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_socket(int sock, int close_flag);
BIO *BIO_new_fd(int fd, int close_flag); BIO *BIO_new_fd(int fd, int close_flag);
BIO *BIO_new_connect(char *host_port); 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 /* 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. * 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. */ /* Error codes for the BIO functions. */
@@ -683,3 +684,4 @@ void ERR_load_BIO_strings(void);
} }
#endif #endif
#endif #endif

View File

@@ -7,18 +7,9 @@
* for which no specific BIO method is available. * for which no specific BIO method is available.
* See ssl/ssltest.c for some hints on how this can be used. */ * See ssl/ssltest.c for some hints on how this can be used. */
/* BIO_DEBUG implies BIO_PAIR_DEBUG */
#ifdef BIO_DEBUG
# ifndef BIO_PAIR_DEBUG
# define BIO_PAIR_DEBUG
# endif
#endif
/* disable assert() unless BIO_PAIR_DEBUG has been defined */
#ifndef BIO_PAIR_DEBUG #ifndef BIO_PAIR_DEBUG
# ifndef NDEBUG # undef NDEBUG /* avoid conflicting definitions */
# define NDEBUG # define NDEBUG
# endif
#endif #endif
#include <assert.h> #include <assert.h>
@@ -32,12 +23,7 @@
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include "openssl/e_os.h" #include "openssl/e_os.h"
#ifndef SSIZE_MAX
/* 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)
# define SSIZE_MAX INT_MAX # define SSIZE_MAX INT_MAX
#endif #endif
@@ -488,8 +474,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
break; break;
case BIO_C_GET_WRITE_BUF_SIZE: case BIO_C_GET_WRITE_BUF_SIZE:
ret = (long) b->size; num = (long) b->size;
break;
case BIO_C_MAKE_BIO_PAIR: case BIO_C_MAKE_BIO_PAIR:
{ {

View File

@@ -75,7 +75,7 @@
# include <starlet.h> # include <starlet.h>
#elif defined(__ultrix) #elif defined(__ultrix)
# include <sys/syslog.h> # include <sys/syslog.h>
#elif !defined(MSDOS) && !defined(VXWORKS) /* Unix */ #elif !defined(MSDOS) /* Unix */
# include <syslog.h> # include <syslog.h>
#endif #endif

View File

@@ -124,8 +124,6 @@ asm/sparcv8plus-gcc27.o: asm/sparcv8plus.S
$(CC) $(ASFLAGS) -E asm/sparcv8plus.S | \ $(CC) $(ASFLAGS) -E asm/sparcv8plus.S | \
/usr/ccs/bin/as -xarch=v8plus - -o asm/sparcv8plus-gcc27.o /usr/ccs/bin/as -xarch=v8plus - -o asm/sparcv8plus-gcc27.o
asm/ia64.o: asm/ia64.S
files: files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
@@ -159,7 +157,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) -- $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new

File diff suppressed because it is too large Load Diff

View File

@@ -90,9 +90,7 @@ extern "C" {
* be on. Again this in only really a problem on machines * be on. Again this in only really a problem on machines
* using "long long's", are 32bit, and are not using my assembler code. */ * using "long long's", are 32bit, and are not using my assembler code. */
#if defined(MSDOS) || defined(WINDOWS) || defined(WIN32) || defined(linux) #if defined(MSDOS) || defined(WINDOWS) || defined(WIN32) || defined(linux)
# ifndef BN_DIV2W #define BN_DIV2W
# define BN_DIV2W
# endif
#endif #endif
/* assuming long is 64bit - this is the DEC Alpha /* assuming long is 64bit - this is the DEC Alpha
@@ -155,7 +153,7 @@ extern "C" {
#define BN_BYTES 4 #define BN_BYTES 4
#define BN_BITS2 32 #define BN_BITS2 32
#define BN_BITS4 16 #define BN_BITS4 16
#if defined(_MSC_VER) || defined(__BORLANDC__) #ifdef WIN32
/* VC++ doesn't like the LL suffix */ /* VC++ doesn't like the LL suffix */
#define BN_MASK (0xffffffffffffffffL) #define BN_MASK (0xffffffffffffffffL)
#else #else
@@ -331,7 +329,6 @@ void BN_CTX_end(BN_CTX *ctx);
int BN_rand(BIGNUM *rnd, int bits, int top,int bottom); 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_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
int BN_rand_range(BIGNUM *rnd, BIGNUM *range); 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(const BIGNUM *a);
int BN_num_bits_word(BN_ULONG); int BN_num_bits_word(BN_ULONG);
BIGNUM *BN_new(void); 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, int BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg, void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
int do_trial_division); int do_trial_division);
void ERR_load_BN_strings(void );
BN_MONT_CTX *BN_MONT_CTX_new(void ); BN_MONT_CTX *BN_MONT_CTX_new(void );
void BN_MONT_CTX_init(BN_MONT_CTX *ctx); void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
@@ -413,7 +411,7 @@ int BN_mod_mul_montgomery(BIGNUM *r,BIGNUM *a,BIGNUM *b,BN_MONT_CTX *mont,
BN_CTX *ctx); BN_CTX *ctx);
int BN_from_montgomery(BIGNUM *r,BIGNUM *a,BN_MONT_CTX *mont,BN_CTX *ctx); int BN_from_montgomery(BIGNUM *r,BIGNUM *a,BN_MONT_CTX *mont,BN_CTX *ctx);
void BN_MONT_CTX_free(BN_MONT_CTX *mont); void BN_MONT_CTX_free(BN_MONT_CTX *mont);
int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *modulus,BN_CTX *ctx);
BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from); BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from);
BN_BLINDING *BN_BLINDING_new(BIGNUM *A,BIGNUM *Ai,BIGNUM *mod); BN_BLINDING *BN_BLINDING_new(BIGNUM *A,BIGNUM *Ai,BIGNUM *mod);
@@ -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 /* 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. * 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. */ /* Error codes for the BN functions. */
@@ -520,3 +517,4 @@ void ERR_load_BN_strings(void);
} }
#endif #endif
#endif #endif

View File

@@ -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(NO_ASM) && !defined(NO_INLINE_ASM) && !defined(PEDANTIC) && !defined(BN_DIV3W)
# if defined(__GNUC__) && __GNUC__>=2 # if defined(__GNUC__) && __GNUC__>=2
# if defined(__i386) || defined (__i386__) # if defined(__i386)
/* /*
* There were two reasons for implementing this template: * There were two reasons for implementing this template:
* - GNU C generates a call to a function (__udivdi3 to be exact) * - GNU C generates a call to a function (__udivdi3 to be exact)
@@ -190,10 +190,10 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
/* First we normalise the numbers */ /* First we normalise the numbers */
norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2); norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2);
if (!(BN_lshift(sdiv,divisor,norm_shift))) goto err; BN_lshift(sdiv,divisor,norm_shift);
sdiv->neg=0; sdiv->neg=0;
norm_shift+=BN_BITS2; norm_shift+=BN_BITS2;
if (!(BN_lshift(snum,num,norm_shift))) goto err; BN_lshift(snum,num,norm_shift);
snum->neg=0; snum->neg=0;
div_n=sdiv->top; div_n=sdiv->top;
num_n=snum->top; num_n=snum->top;
@@ -315,7 +315,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
tmp->top=j; tmp->top=j;
j=wnum.top; j=wnum.top;
if (!BN_sub(&wnum,&wnum,tmp)) goto err; BN_sub(&wnum,&wnum,tmp);
snum->top=snum->top+wnum.top-j; snum->top=snum->top+wnum.top-j;
@@ -323,7 +323,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
{ {
q--; q--;
j=wnum.top; j=wnum.top;
if (!BN_add(&wnum,&wnum,sdiv)) goto err; BN_add(&wnum,&wnum,sdiv);
snum->top+=wnum.top-j; snum->top+=wnum.top-j;
} }
*(resp--)=q; *(resp--)=q;

View File

@@ -113,6 +113,13 @@
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include "bn_lcl.h" #include "bn_lcl.h"
#ifdef ATALLA
# include <alloca.h>
# include <atasi.h>
# include <assert.h>
# include <dlfcn.h>
#endif
#define TABLE_SIZE 32 #define TABLE_SIZE 32
@@ -176,6 +183,174 @@ 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, int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
BN_CTX *ctx) BN_CTX *ctx)
{ {
@@ -185,6 +360,13 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
bn_check_top(p); bn_check_top(p);
bn_check_top(m); 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 #ifdef MONT_MUL_MOD
/* I have finally been able to take out this pre-condition of /* 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 * the top bit being set. It was caused by an error in BN_div
@@ -210,6 +392,10 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
{ ret=BN_mod_exp_simple(r,a,p,m,ctx); } { ret=BN_mod_exp_simple(r,a,p,m,ctx); }
#endif #endif
#ifdef ATALLA
tried_atalla=0;
#endif
return(ret); return(ret);
} }
@@ -339,6 +525,12 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
bn_check_top(p); bn_check_top(p);
bn_check_top(m); 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)) if (!(m->d[0] & 1))
{ {
BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS); BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS);
@@ -501,6 +693,19 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
t = BN_CTX_get(ctx); t = BN_CTX_get(ctx);
if (d == NULL || r == NULL || t == NULL) goto err; 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) if (in_mont != NULL)
mont=in_mont; mont=in_mont;
else else

View File

@@ -168,8 +168,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *in, BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
R=in; R=in;
if (R == NULL) goto err; if (R == NULL) goto err;
if (!BN_zero(X)) goto err; BN_zero(X);
if (!BN_one(Y)) goto err; BN_one(Y);
if (BN_copy(A,a) == NULL) goto err; if (BN_copy(A,a) == NULL) goto err;
if (BN_copy(B,n) == NULL) goto err; if (BN_copy(B,n) == NULL) goto err;
sign=1; sign=1;

View File

@@ -263,12 +263,12 @@ void BN_clear_free(BIGNUM *a)
if (a == NULL) return; if (a == NULL) return;
if (a->d != NULL) if (a->d != NULL)
{ {
OPENSSL_cleanse(a->d,a->dmax*sizeof(a->d[0])); memset(a->d,0,a->dmax*sizeof(a->d[0]));
if (!(BN_get_flags(a,BN_FLG_STATIC_DATA))) if (!(BN_get_flags(a,BN_FLG_STATIC_DATA)))
OPENSSL_free(a->d); OPENSSL_free(a->d);
} }
i=BN_get_flags(a,BN_FLG_MALLOCED); i=BN_get_flags(a,BN_FLG_MALLOCED);
OPENSSL_cleanse(a,sizeof(BIGNUM)); memset(a,0,sizeof(BIGNUM));
if (i) if (i)
OPENSSL_free(a); OPENSSL_free(a);
} }

View File

@@ -224,7 +224,7 @@ int BN_from_montgomery(BIGNUM *ret, BIGNUM *a, BN_MONT_CTX *mont,
if (!BN_mul(t1,t2,&mont->N,ctx)) goto err; if (!BN_mul(t1,t2,&mont->N,ctx)) goto err;
if (!BN_add(t2,a,t1)) goto err; if (!BN_add(t2,a,t1)) goto err;
if (!BN_rshift(ret,t2,mont->ri)) goto err; BN_rshift(ret,t2,mont->ri);
#endif /* MONT_WORD */ #endif /* MONT_WORD */
if (BN_ucmp(ret, &(mont->N)) >= 0) if (BN_ucmp(ret, &(mont->N)) >= 0)
@@ -284,8 +284,8 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
BN_ULONG buf[2]; BN_ULONG buf[2];
mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2; mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2;
if (!(BN_zero(R))) goto err; BN_zero(R);
if (!(BN_set_bit(R,BN_BITS2))) goto err; /* R */ BN_set_bit(R,BN_BITS2); /* R */
buf[0]=mod->d[0]; /* tmod = N mod word size */ buf[0]=mod->d[0]; /* tmod = N mod word size */
buf[1]=0; buf[1]=0;
@@ -296,44 +296,36 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
/* Ri = R^-1 mod N*/ /* Ri = R^-1 mod N*/
if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL) if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL)
goto err; goto err;
/* R*Ri */ BN_lshift(&Ri,&Ri,BN_BITS2); /* R*Ri */
if (!(BN_lshift(&Ri,&Ri,BN_BITS2))) goto err;
if (!BN_is_zero(&Ri)) if (!BN_is_zero(&Ri))
{ BN_sub_word(&Ri,1);
if (!BN_sub_word(&Ri,1)) goto err;
}
else /* if N mod word size == 1 */ else /* if N mod word size == 1 */
/* Ri-- (mod word size) */ BN_set_word(&Ri,BN_MASK2); /* Ri-- (mod word size) */
{ BN_div(&Ri,NULL,&Ri,&tmod,ctx); /* Ni = (R*Ri-1)/N,
if (!BN_set_word(&Ri,BN_MASK2)) goto err; * keep only least significant word: */
}
/* Ni = (R*Ri-1)/N, keep only least significant word: */
if (!(BN_div(&Ri,NULL,&Ri,&tmod,ctx))) goto err;
mont->n0=Ri.d[0]; mont->n0=Ri.d[0];
BN_free(&Ri); BN_free(&Ri);
} }
#else /* !MONT_WORD */ #else /* !MONT_WORD */
{ /* bignum version */ { /* bignum version */
mont->ri=BN_num_bits(mod); mont->ri=BN_num_bits(mod);
if (!(BN_zero(R))) goto err; BN_zero(R);
/* R = 2^ri */ BN_set_bit(R,mont->ri); /* R = 2^ri */
if (!(BN_set_bit(R,mont->ri))) goto err;
/* Ri = R^-1 mod N*/ /* Ri = R^-1 mod N*/
if ((BN_mod_inverse(&Ri,R,mod,ctx)) == NULL) if ((BN_mod_inverse(&Ri,R,mod,ctx)) == NULL)
goto err; goto err;
/* R*Ri */ BN_lshift(&Ri,&Ri,mont->ri); /* R*Ri */
if (!(BN_lshift(&Ri,&Ri,mont->ri))) goto err; BN_sub_word(&Ri,1);
if (!(BN_sub_word(&Ri,1))) goto err;
/* Ni = (R*Ri-1) / N */ /* Ni = (R*Ri-1) / N */
if (!(BN_div(&(mont->Ni),NULL,&Ri,mod,ctx))) goto err; BN_div(&(mont->Ni),NULL,&Ri,mod,ctx);
BN_free(&Ri); BN_free(&Ri);
} }
#endif #endif
/* setup RR for conversions */ /* setup RR for conversions */
if (!(BN_zero(&(mont->RR)))) goto err; BN_zero(&(mont->RR));
if (!(BN_set_bit(&(mont->RR),mont->ri*2))) goto err; BN_set_bit(&(mont->RR),mont->ri*2);
if (!(BN_mod(&(mont->RR),&(mont->RR),&(mont->N),ctx))) goto err; BN_mod(&(mont->RR),&(mont->RR),&(mont->N),ctx);
return(1); return(1);
err: err:
@@ -344,9 +336,9 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
{ {
if (to == from) return(to); if (to == from) return(to);
if (!(BN_copy(&(to->RR),&(from->RR)))) return NULL; BN_copy(&(to->RR),&(from->RR));
if (!(BN_copy(&(to->N),&(from->N)))) return NULL; BN_copy(&(to->N),&(from->N));
if (!(BN_copy(&(to->Ni),&(from->Ni)))) return NULL; BN_copy(&(to->Ni),&(from->Ni));
to->ri=from->ri; to->ri=from->ri;
to->n0=from->n0; to->n0=from->n0;
return(to); return(to);

View File

@@ -634,7 +634,7 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
if ((al == 0) || (bl == 0)) if ((al == 0) || (bl == 0))
{ {
if (!BN_zero(r)) goto err; BN_zero(r);
return(1); return(1);
} }
top=al+bl; top=al+bl;
@@ -677,14 +677,14 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
{ {
if (i == 1 && !BN_get_flags(b,BN_FLG_STATIC_DATA)) if (i == 1 && !BN_get_flags(b,BN_FLG_STATIC_DATA))
{ {
if (bn_wexpand(b,al) == NULL) goto err; bn_wexpand(b,al);
b->d[bl]=0; b->d[bl]=0;
bl++; bl++;
i--; i--;
} }
else if (i == -1 && !BN_get_flags(a,BN_FLG_STATIC_DATA)) else if (i == -1 && !BN_get_flags(a,BN_FLG_STATIC_DATA))
{ {
if (bn_wexpand(a,bl) == NULL) goto err; bn_wexpand(a,bl);
a->d[al]=0; a->d[al]=0;
al++; al++;
i++; i++;
@@ -699,16 +699,16 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
t = BN_CTX_get(ctx); t = BN_CTX_get(ctx);
if (al == j) /* exact multiple */ if (al == j) /* exact multiple */
{ {
if (bn_wexpand(t,k*2) == NULL) goto err; bn_wexpand(t,k*2);
if (bn_wexpand(rr,k*2) == NULL) goto err; bn_wexpand(rr,k*2);
bn_mul_recursive(rr->d,a->d,b->d,al,t->d); bn_mul_recursive(rr->d,a->d,b->d,al,t->d);
} }
else else
{ {
if (bn_wexpand(a,k) == NULL ) goto err; bn_wexpand(a,k);
if (bn_wexpand(b,k) == NULL ) goto err; bn_wexpand(b,k);
if (bn_wexpand(t,k*4) == NULL ) goto err; bn_wexpand(t,k*4);
if (bn_wexpand(rr,k*4) == NULL ) goto err; bn_wexpand(rr,k*4);
for (i=a->top; i<k; i++) for (i=a->top; i<k; i++)
a->d[i]=0; a->d[i]=0;
for (i=b->top; i<k; i++) for (i=b->top; i<k; i++)

View File

@@ -225,15 +225,12 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
BN_MONT_CTX *mont = NULL; BN_MONT_CTX *mont = NULL;
const BIGNUM *A = NULL; const BIGNUM *A = NULL;
if (BN_cmp(a, BN_value_one()) <= 0)
return 0;
if (checks == BN_prime_checks) if (checks == BN_prime_checks)
checks = BN_prime_checks_for_size(BN_num_bits(a)); checks = BN_prime_checks_for_size(BN_num_bits(a));
/* first look for small factors */ /* first look for small factors */
if (!BN_is_odd(a)) if (!BN_is_odd(a))
return 0; return(0);
if (do_trial_division) if (do_trial_division)
{ {
for (i = 1; i < NUMPRIMES; i++) 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++) 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; goto err;
if (BN_cmp(check, A1) >= 0)
if (!BN_sub(check, check, A1))
goto err;
if (!BN_add_word(check, 1)) if (!BN_add_word(check, 1))
goto err; goto err;
/* now 1 <= check < A */ /* now 1 <= check < A */

View File

@@ -55,59 +55,6 @@
* copied and put under another distribution licence * copied and put under another distribution licence
* [including the GNU Public 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 <stdio.h>
#include <time.h> #include <time.h>
@@ -201,7 +148,7 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
err: err:
if (buf != NULL) if (buf != NULL)
{ {
OPENSSL_cleanse(buf,bytes); memset(buf,0,bytes);
OPENSSL_free(buf); OPENSSL_free(buf);
} }
return(ret); return(ret);
@@ -225,9 +172,8 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
#endif #endif
/* random number r: 0 <= r < range */ /* 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; int n;
if (range->neg || BN_is_zero(range)) 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 */ n = BN_num_bits(range); /* n > 0 */
/* BN_is_bit_set(range, n - 1) always holds */
if (n == 1) if (n == 1)
{ {
if (!BN_zero(r)) return 0; 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 */ * so 3*range (= 11..._2) is exactly one bit longer than range */
do 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 /* If r < 3*range, use r := r MOD range
* (which is either r, r - range, or r - 2*range). * (which is either r, r - range, or r - 2*range).
* Otherwise, iterate once more. * 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); 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; 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);
}

View File

@@ -245,7 +245,7 @@ printf(" bn_sqr_recursive %d * %d\n",n2,n2);
if (!zero) if (!zero)
bn_sqr_recursive(&(t[n2]),t,n,p); bn_sqr_recursive(&(t[n2]),t,n,p);
else 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,a,n,p);
bn_sqr_recursive(&(r[n2]),&(a[n]),n,p); bn_sqr_recursive(&(r[n2]),&(a[n]),n,p);

Some files were not shown because too many files have changed in this diff Show More