Compare commits

...

1263 Commits

Author SHA1 Message Date
cvs2svn
3e35b3a1a3 This commit was manufactured by cvs2svn to create tag
'LEVITTE_before_const'.
2004-03-15 23:02:56 +00:00
Richard Levitte
ec37635c94 It was just pointed out to me that it's better to cast to double... 2004-03-15 23:02:55 +00:00
Richard Levitte
fd836aeee0 Make sure that the last argument to RAND_add() is a float, or some
compilers may complain.
2004-03-15 22:37:08 +00:00
Richard Levitte
560f7abb7e Make sure we use unsigned constants, or come compilers may complain. 2004-03-15 22:33:19 +00:00
Geoff Thorpe
b6358c89a1 Convert openssl code not to assume the deprecated form of BN_zero().
Remove certain redundant BN_zero() initialisations, because BN_CTX_get(),
BN_init(), [etc] already initialise to zero.

Correct error checking in bn_sqr.c, and be less wishy-wash about how/why
the result's 'top' value is set (note also, 'max' is always > 0 at this
point).
2004-03-13 23:57:20 +00:00
Geoff Thorpe
5d735465d1 The efforts to eliminate the dual-representation of zero and to ensure
bignums are passed in and out of functions and APIs in a consistent form
has highlighted that zero-valued bignums don't need any allocated word
data. The use of BN_set_word() to initialise a bignum to zero causes
needless allocation and gives it a return value that must be checked. This
change converts BN_zero() to a self-contained macro that has no
return/expression value and does not cause any expansion of bignum data.

Note, it would be tempting to rewrite the deprecated version as a
success-valued comma expression, such as;
   #define BN_zero(a) ((a)->top = (a)->neg = 0, 1)
However, this evaluates 'a' twice and would confuse initialisation loops
(eg. while(..) { BN_zero(bn++) } ). As such, the deprecated version
continues to use BN_set_word().
2004-03-13 23:04:15 +00:00
Geoff Thorpe
9e051bac13 Document a change I'd already made, and at the same time, correct the
change to work properly; BN_zero() should set 'neg' to zero as well as
'top' to match the behaviour of BN_new().
2004-03-13 22:10:15 +00:00
Andy Polyakov
30fbcaa213 IRIX 6.x shared build fix-up.
For reference. Note that both cc and gcc support -Wl flag, but we can't
use -Wl,-[not]all with both drivers, because cc rearranges options
passed through -Wl. We can't use -Wl,-all,libcrypto.a,-notall with cc
either, because it refuses to start with "no input" error.
2004-03-12 21:52:54 +00:00
Geoff Thorpe
93825dddad static 2004-03-10 01:20:26 +00:00
Geoff Thorpe
a8aa764d3c Minimise the amount of code dependent on BN_DEBUG_RAND. In particular,
redefine bn_clear_top2max() to be a NOP in the non-debugging case, and
remove some unnecessary usages in bn_nist.c.

Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe, Ulf Möller
2004-03-09 03:53:40 +00:00
Geoff Thorpe
e7716b7a19 More changes coming out of the bignum auditing. BN_CTX_get() should ideally
return a "zero" bignum as BN_new() does - so reset 'top'. During
BN_CTX_end(), released bignums should be consistent so enforce this in
debug builds. Also, reduce the number of wasted BN_clear_free() calls from
BN_CTX_end() (typically by 75% or so).

Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe, Ulf Möller
2004-03-09 03:47:35 +00:00
Dr. Stephen Henson
a4e3150f00 Fix policy constraints syntax. 2004-03-08 18:15:32 +00:00
Dr. Stephen Henson
edec614efd Support for inhibitAnyPolicy extension. 2004-03-08 13:56:31 +00:00
Ulf Möller
2457c19df1 typo 2004-03-06 08:43:36 +00:00
Dr. Stephen Henson
5fa5eb71a4 Cleanup ASN1 OID module when it exits. 2004-03-05 23:47:56 +00:00
Dr. Stephen Henson
3f39976da3 Call autoconfig code in pkcs7 utility. 2004-03-05 23:46:29 +00:00
Dr. Stephen Henson
216ad9ef58 Memory leak fix. 2004-03-05 23:39:42 +00:00
Dr. Stephen Henson
bc50157010 Various X509 fixes. Disable broken certificate workarounds
when X509_V_FLAG_X509_STRICT is set. Check for CRLSign in
CRL issuer certificates. Reject CRLs with unhandled (any)
critical extensions.
2004-03-05 17:16:35 +00:00
Dr. Stephen Henson
91180d45f9 Typos.
Reported by: Jose Castejon-Amenedo <Jose.Castejon-Amenedo@hp.com>
2004-03-04 21:44:39 +00:00
Richard Levitte
d9f40bbe55 Make our page with pointers to binary distributions visible in the FAQ 2004-03-04 07:47:40 +00:00
Dr. Stephen Henson
ec7c9ee8b8 Indent some of the code examples. 2004-03-02 13:39:23 +00:00
Dr. Stephen Henson
f82bb9cb9c Config docs. 2004-03-02 13:31:32 +00:00
Dr. Stephen Henson
5a8922aed5 Documentation of the KISS autoconfig functions. 2004-03-02 01:01:11 +00:00
Dr. Stephen Henson
f2c1812560 More autoconfig docs. 2004-03-01 19:15:24 +00:00
Richard Levitte
4cfa4ae820 Avoid a memory leak in OCSP_parse_url().
Notified by Paul Siegel <psiegel@corestreet.com>
2004-03-01 14:58:22 +00:00
Dr. Stephen Henson
a30af36c77 Initial docs for the OpenSSL library configuration via openssl.cnf 2004-03-01 01:04:40 +00:00
Geoff Thorpe
5075521e75 Add ECDSA documentation.
Submitted by: Nils Larsch
2004-02-27 23:03:23 +00:00
Richard Levitte
ee3a47a994 AES is spelled AES, not ASE. Oops... 2004-02-27 02:24:49 +00:00
Richard Levitte
f727266ae8 Make sure the given EVP_PKEY is updated in the PEM_STRING_PKCS8INF case also.
PR: 833
2004-02-26 22:07:45 +00:00
Richard Levitte
8bb0c8522a Document the AES options for 'openssl smime'.
PR: 834
2004-02-26 21:44:41 +00:00
Geoff Thorpe
c6700d2746 A cleanup of the ecs_ossl.c code and some (doxygen) comments for ecdsa.h
Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
2004-02-22 19:32:53 +00:00
Geoff Thorpe
1b06804491 When adding positive elements, we can use BN_uadd() instead of BN_add().
Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
2004-02-22 19:30:41 +00:00
Dr. Stephen Henson
dc90f64d56 Use an OCTET STRING for the encoding of an OCSP nonce value.
The old raw format can't be handled by some implementations
and updates to RFC2560 will make this mandatory.
2004-02-19 18:16:38 +00:00
Geoff Thorpe
6c43032121 minor signed/unsigned warning fixes 2004-02-10 18:46:10 +00:00
Dr. Stephen Henson
37ead9be0b Fix handling of -offset and -length in asn1parse tool.
If -offset exceeds -length of data available exit with an error.

Don't read past end of total data available when -offset supplied.

If -length exceeds total available truncate it.
2004-02-08 13:30:04 +00:00
Andy Polyakov
1751034669 Typo in crypto/bn/asm/x86_64.c, bn_div_words().
PR: 821
2004-02-07 09:51:28 +00:00
Dr. Stephen Henson
d4575825f1 Add flag to avoid continuous
memory allocate when calling EVP_MD_CTX_copy_ex().

Without this HMAC is several times slower than
< 0.9.7.
2004-02-01 13:39:51 +00:00
Andy Polyakov
d04b1b4656 Typo in PA-RISC 2 rules in crypto/bn/Makefile.ssl 2004-01-30 05:41:23 +00:00
Andy Polyakov
1247092776 HP/UX PA-RISC 2 targets update. 2004-01-29 22:16:08 +00:00
Richard Levitte
7e22a1df55 Remove typos 2004-01-29 11:24:32 +00:00
Richard Levitte
bb5810d21d -Wtraditional was a little too much... 2004-01-29 10:56:18 +00:00
Richard Levitte
61a88c31c0 Typo 2004-01-29 02:55:43 +00:00
Richard Levitte
b86ed8d18f In the development branch, it feels quite all right to warn on a lot
more stuff.
2004-01-29 00:05:09 +00:00
Richard Levitte
e5886a2388 make update 2004-01-28 19:07:41 +00:00
Richard Levitte
8d1ebe0bd1 Add the missing parts for DES CFB1 and CFB8.
Add the corresponding AES parts while I'm at it.
make update
2004-01-28 19:05:35 +00:00
Richard Levitte
1fb724449d make update 2004-01-28 18:38:33 +00:00
Richard Levitte
721a5e83f9 Unsigned vs. signed problem removed 2004-01-28 08:48:11 +00:00
Andy Polyakov
6df617a59d #undef _POSIX_C_SOURCE in ui_openssl.c ruined IRIX builds. Comment on why
_POSIX_C_SOURCE needed in first place.
2004-01-27 22:06:48 +00:00
Andy Polyakov
8c6336b0aa CFB DES sync-up with FIPS branch. 2004-01-27 21:47:35 +00:00
Richard Levitte
87203dc99a Avoid signed vs. unsigned warnings (which are treated like errors on
Windows).
2004-01-27 01:16:38 +00:00
Richard Levitte
4de65cbc06 S_IFBLK and S_IFCHR may not exist in some places (like Windows), so
let's check for those macros, and if they aren't defined, let's assume
there aren't Unixly devices on this platform.
2004-01-26 23:45:32 +00:00
Andy Polyakov
27b2b78f90 Even though C specification explicitly says that constant type "stretches"
automatically to accomodate the value, some compilers fail to do so. Most
notably 0x0123456789ABCDEF should come out as long long in 32-bit context,
but HP compiler truncates it to 32-bit value. Which in turn breaks GF(2^m)
arithmetics in hpux-parisc2-cc build. Therefore this fix...
2004-01-25 10:53:43 +00:00
Andy Polyakov
3a160f1dc6 Fix declaration inconsistency in ecparam.c. 2004-01-24 16:51:59 +00:00
Andy Polyakov
7f24b1c3e9 Get rid of bogus warning when compiling with Sun vendor compiler. 2004-01-24 16:31:21 +00:00
Richard Levitte
a5e8bcfb7b We're passed p, so let's use p instead of making assumptions. 2004-01-24 01:16:02 +00:00
Richard Levitte
9d5c3c1939 Typo... 2004-01-22 22:36:46 +00:00
Dr. Stephen Henson
815d7057be Replace expired certificate. 2004-01-21 13:08:11 +00:00
Andy Polyakov
30cb9ec715 SHA-1 assembler tune-up for Intel P4 2004-01-21 08:17:08 +00:00
Richard Levitte
af6dab9b00 Adding a slash between the directoryt and the file is a problem with
VMS.  The C RTL can handle it well if the "directory" is a logical
name with no colon, therefore ending being 'logname/file'.  However,
if the given logical names actually has a colon, or if you use a full
VMS-syntax directory, you end up with 'logname:/file' or
'dev:[dir1.dir2]/file', and that isn't handled in any good way.

So, on VMS, we need to check if the directory string ends with a
separator (one of ':', ']' or '>' (< and > can be used instead [ and
])), and handle that by not inserting anything between the directory
spec and the file name.  In all other cases, it's assumed the
directory spec is a logical name, so we need to place a colon between
it and the file.

Notified by Kevin Greaney <kevin.greaney@hp.com>.
2004-01-10 18:04:38 +00:00
Lutz Jänicke
cdb42bcf0c Cover all DSA setups when running tests
PR: #748
Submitted by: Kirill Kochetkov <kochet@ixbt.com>
2004-01-08 07:46:37 +00:00
Lutz Jänicke
fc56b52924 Updates to s_time manual page
PR: #570
Submitted by: Martin Witzel <MWITZEL@de.ibm.com>
2004-01-08 07:38:15 +00:00
Lutz Jänicke
a32fc687de Add s_time manual page
Submitted by: "Martin Witzel" <MWITZEL@de.ibm.com>

PR: #570
2004-01-04 18:59:14 +00:00
Lutz Jänicke
c0017a5a65 Update URI
Submitted by: Gertjan van Oosten <gertjan@West.NL>

PR: #804
2004-01-04 18:05:50 +00:00
Lutz Jänicke
344e86645d unintptr_t and <inttypes.h> are not strictly portable with respect to
ANSI C 89.
Undo change to maintain compatibility.
2004-01-04 17:53:21 +00:00
Richard Levitte
075521725d Fix Perl problems on sparc64.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 16:13:18 +00:00
Richard Levitte
5fdf06666c Avoid including cryptlib.h, it's not really needed.
Check if IDEA is being built or not.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 16:10:30 +00:00
Richard Levitte
f28e8bd300 Only use environment variables if uid and gid are the same as euid and egid.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 16:07:20 +00:00
Richard Levitte
de02ec2767 Check if a random "file" is really a device file, and treat it
specially if it is.
Add a few OpenBSD-specific cases.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 16:02:22 +00:00
Richard Levitte
112341031b Correct documentation typos.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 15:04:54 +00:00
Richard Levitte
7cf803230b OpenBSD-internal changes.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 15:02:56 +00:00
Richard Levitte
79b42e7654 Use sh explicitely to run point.sh
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 14:59:07 +00:00
Richard Levitte
f0c5db92f7 Include strings.h so strcasecmp() and strncasecmp() get properly declared. 2003-12-27 14:54:48 +00:00
Richard Levitte
d420ac2c7d Use BUF_strlcpy() instead of strcpy().
Use BUF_strlcat() instead of strcat().
Use BIO_snprintf() instead of sprintf().
In some cases, keep better track of buffer lengths.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 14:40:17 +00:00
Richard Levitte
b79aa47a0c Add a newline at the end of the last line.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 14:26:14 +00:00
Dr. Stephen Henson
e88c577738 Typos. 2003-12-20 22:48:21 +00:00
Richard Levitte
a2b0de98af To figure out if we're going outside the buffer, use the size of the buffer,
not the size of the integer used to index in said buffer.

PR: 794
Notified by: Rhett Garber <rhett_garber@hp.com>
2003-12-11 18:01:03 +00:00
Richard Levitte
4775944f81 Document that you need to include x509.h (to get [i2d|d2i]_RSA_PUBKEY()).
Correct the typo PUKEY...
2003-12-10 14:31:55 +00:00
Richard Levitte
2abd5b7aa0 Document that you need to include x509.h (to get [i2d|d2i]_DSA_PUBKEY()).
Correct the typo PUKEY...
2003-12-10 13:57:51 +00:00
Ulf Möller
380e145daf Add "dif" variable to clean up the loop implementations.
Submitted by: Nils Larsch
2003-12-06 11:55:46 +00:00
Ulf Möller
a9f2330f43 Skip a curve with generator of non-prime order.
Submitted by: Nils Larsch
2003-12-06 11:41:22 +00:00
Ulf Möller
ce38bb1a8c Avoid segfault if ret==0.
Submitted by: Nils Larsch
2003-12-06 11:39:37 +00:00
Lutz Jänicke
919f8bcd21 Restructure make targets to allow parallel make.
Submitted by: Witold Filipczyk <witekfl@poczta.gazeta.pl>

PR: #513
2003-12-03 16:29:41 +00:00
Geoff Thorpe
2bfd2c74d2 Incremental cleanups to bn_lib.c.
- Add missing bn_check_top() calls and relocate some others
- Use BN_is_zero() where appropriate
- Remove assert()s that bn_check_top() is already covering
- Simplify the code in places (esp. bn_expand2())
- Only keep ambiguous zero handling if BN_STRICT isn't defined
- Remove some white-space and make some other aesthetic tweaks
2003-12-02 20:01:30 +00:00
Geoff Thorpe
82b2f57e30 Use the BN_is_odd() macro in place of code that (inconsistently) does much
the same thing.

Also, I have some stuff on the back-burner related to some BN_CTX notes
from Peter Gutmann about his cryptlib hacks to the bignum code. The BN_CTX
comments are there to remind me of some relevant points in the code.
2003-12-02 03:28:24 +00:00
Geoff Thorpe
2ae1ea3788 BN_FLG_FREE is of extremely dubious usefulness, and is only referred to
once in the source (where it is set for the benefit of no other code
whatsoever). I've deprecated the declaration in the header and likewise
made the use of the flag conditional in bn_lib.c. Note, this change also
NULLs the 'd' pointer in a BIGNUM when it is reset but not deallocated.
2003-12-02 03:16:56 +00:00
Geoff Thorpe
34066d741a Declare the static BIGNUM "BN_value_one()" more carefully. 2003-12-01 23:13:17 +00:00
Geoff Thorpe
b74cc0776b Add missing bn_check_top()s to bn_kron.c, remove some miscellaneous
white-space, and include extra headers to satisfy debugging builds.
2003-12-01 23:11:45 +00:00
Geoff Thorpe
e7e5fe4705 Add missing bn_check_top()s to bn_gf2m.c and remove some miscellaneous
white-space.
2003-12-01 23:10:21 +00:00
Geoff Thorpe
998ae048e7 The bn_set_max() macro is only "used" by the bn_set_[low|high]() macros
which, in turn, are used nowhere at all. This is a good thing because
bn_set_max() would currently generate code that wouldn't compile (BIGNUM
has no 'max' element).

The only apparent use for bn_set_[low|high] would be for implementing
windowing algorithms, and all of openssl's seem to use bn_***_words()
helpers instead (including the BN_div() that Nils fixed recently, which had
been using independently-coded versions of what these unused macros are
intended for). I'm therefore consigning these macros to cvs oblivion in the
name of readability.
2003-12-01 22:11:08 +00:00
Geoff Thorpe
e65c2b9872 bn_fix_top() exists for compatibility's sake and is mapped to
bn_correct_top() or bn_check_top() depending on debug settings. For
internal source, all bn_fix_top()s should be converted one way or the other
depending on whether the use of bn_correct_top() is justified.

For BN_div_recp(), these cases should not require correction if the other
bignum functions are doing their jobs properly, so convert to
bn_check_top().
2003-12-01 21:59:40 +00:00
Richard Levitte
2fe9ab8e20 It was pointed out to me that if the requested size is 0, we shouldn't
ty to allocate anything at all.  This will allow eNULL to still work.

PR: 751
Notified by: Lutz Jaenicke
2003-12-01 13:25:37 +00:00
Richard Levitte
1145e03870 Check that OPENSSL_malloc() really returned some memory.
PR: 751
Notified by: meder@mcs.anl.gov
Reviewed by: Lutz Jaenicke, Richard Levitte
2003-12-01 12:11:55 +00:00
Richard Levitte
6781efb92f CRYPTO_malloc(), CRYPTO_realloc() and variants of them should return NULL
if the give size is 0.

This is a thought that came up in PR 751.
2003-12-01 12:06:15 +00:00
Lutz Jänicke
0bf1c1d80d Some more ASFLAGS settings required
PR: #735
Submitted by: Tim Rice <tim@multitalents.net>
2003-12-01 08:12:47 +00:00
Geoff Thorpe
6ed474ca66 Add more debugging to my Configure target, and "make update" to incorporate
this and a few other changes.
2003-11-30 23:29:27 +00:00
Geoff Thorpe
46cb8d3689 If BN_STRICT is defined, don't accept an ambiguous representation of zero
(ie. where top may be zero, or it may be one if the corresponding word is
set to zero). Note, this only affects the macros in bn.h, there are probably
similar corrections required in some c files.

Also, clarify the audit-related macros at the top of the header. Mental
note: I must not forget to clean all this out before 0.9.8 is released ...
2003-11-30 22:23:12 +00:00
Geoff Thorpe
23fc5ac646 Improve a couple of the bignum macros. Note, this doesn't eliminate
tolerance of ambiguous zero-representation, it just improves
BN_abs_is_word() and simplifies other macros that depend on it.
2003-11-30 22:02:10 +00:00
Geoff Thorpe
5734bebe05 Make BN_DEBUG_RAND less painfully slow by only consuming one byte of
pseudo-random data for each bn_pollute().
2003-11-30 21:21:30 +00:00
Geoff Thorpe
657a919598 This improves the placement of check_top() macros in a couple of bn_lib
functions.
2003-11-29 20:34:07 +00:00
Richard Levitte
6859bb1a22 Make sure the documentation matches reality.
PR: 755
Notified by: Jakub Bogusz <qboosh@pld-linux.org>
2003-11-29 10:33:25 +00:00
Richard Levitte
3822740ce3 We're getting a clash with C++ because it has a type called 'list'.
Therefore, change all instances of the symbol 'list' to something else.

PR: 758
Submitted by: Frédéric Giudicelli <groups@newpki.org>
2003-11-29 10:25:37 +00:00
Richard Levitte
0d78bc3356 Add IPSec/IKE/Oakley curves.
PR: 768
Submitted by: Vadim Fedukovich <vf@unity.net>
2003-11-29 09:25:59 +00:00
Richard Levitte
d87b79bf31 Damnit, I'm sick of having to do something special every time a module
that gets built before objects barfs all over the place because it
uses a new NID that hasn't had a chance of getting defined yet (in
this case, it was about a couple of new EC curves, and therefore a
couple of new corresponding NIDs).

I'm placing objects first in SDIRS!  There.
2003-11-29 09:19:12 +00:00
Richard Levitte
70ef9c5a3d RSA_size() and DH_size() return the amount of bytes in a key, and we
compared it to the amount of bits required...
PR: 770
Submitted by: c zhang <czhang2005@hotmail.com>
2003-11-28 23:03:14 +00:00
Richard Levitte
b727907ae8 1024 is the export key bits limit according to current regulations, not 512.
PR: 771
Submitted by: c zhang <czhang2005@hotmail.com>
2003-11-28 22:39:19 +00:00
Geoff Thorpe
444c3a8492 Get rid of some signed/unsigned comparison warnings. 2003-11-28 16:39:16 +00:00
Richard Levitte
0b352c58db Make a number of changes to the OS/2 build. Submitter's comment below.
PR: 732
Submitted by: Ilya Zakharevich <nospam-abuse@ilyaz.org>

Submitter's comment:

This patch:

a) Introduces a new file os2/backwardify.pl.

b) Introduces a new mk1mf.pl variable $preamble.  As you can see, it may
   be used also to move some OS-specific code to VC-CE too (the the
   first chunk of the patch);

c) The DESCRIPTION specifier of the .def file is made more informative:
   now it contains the version number too.  On OS/2 it is made conformant
   to OS/2 conventions; in particular, when one runs the standard command
	BLDLEVEL this.DLL
   one can see:

   Vendor:      www.openssl.org/
   Revision:    0.9.7c
   Description: OpenSSL: implementation of Secure Socket Layer; DLL for library crypto.  Build for EMX -Zmtd

   [I did not make Win32 descriptions as informative as this - I'm afraid to
    break something.  Be welcome to fix this.]

d) On OS/2 the generated DLL was hardly usable (it had a shared initialized
   data segment).

e) On OS/2 the generated DLLs had names like ssl.dll.  However, DLL names on
   OS/2 are "global data".  It is hard to have several DLLs with the same
   name on the system.  Thus this precluded coexistence of OpenSSL with DLLs
   for other SLL implementations - or other name clashes.  I transparently
   changed the names of the DLLs to open_ssl.dll and cryptssl.dll.

f) The file added in (a) is used to create "forwarder" DLLs, so the
   applications expecting the "old" DLL names may use the new DLLs
   transparently.  (A presence of these DLLs on the system nullifies (e),
   but makes old applications work.  This is a stopgap measure until the
   old applications are relinked.  Systems with no old applications do not
   need these DLLs, so may enjoy all the benefits of (e).)

   The new DLLs are placed in os2/ and os2/noname subdirectories.

g) The makefiles created with os2/OS2-EMX.cmd did not work (some mysterious
   meaningless failures).  The change to util/pl/OS2-EMX.pl uses the
   variable introduced in (b) to switch the Makefiles to SHELL=sh syntax.
   All these backslashes are removed, and the generated Makefiles started to
   work.

h) Running os2/OS2-EMX.cmd now prints out what to do next.
2003-11-28 14:51:30 +00:00
Richard Levitte
03ddbdd9b9 Move another common functionality (reproduced so far with cut'n'paste)
to apps.c, and give it the hopefully descriptive name parse_yesno().
2003-11-28 14:45:09 +00:00
Richard Levitte
5ebdb39084 Let's use text/plain in the example instead of crapy HTML.
PR: 777
Submitted by: Michael Shields <mshields@sunblocksystems.com>
2003-11-28 14:32:31 +00:00
Richard Levitte
d45a098472 Forgot to change the declaration of do_subject() to one of parse_name()... 2003-11-28 14:18:05 +00:00
Richard Levitte
6d5ffb591b Move do_subject() to apps.c and rename it to parse_name(). The
rationale behind the move is that it's use by several applications.
The rationale behind the name change is that it describes what the
function does a bit better.
2003-11-28 14:07:14 +00:00
Richard Levitte
7ce9e425bc Allow multi-valued rdns in subjects. This adds the -multivalue-rdn option
to 'openssl req' and 'openssl ca'.

PR: 779
Submitted by: Michael Bell <michael.bell@cms.hu-berlin.de>
Reviewed by: Richard Levitte

(there will be some follow-up changes)
2003-11-28 14:04:09 +00:00
Richard Levitte
4d8743f490 Netware-specific changes,
PR: 780
Submitted by: Verdon Walker <VWalker@novell.com>
Reviewed by: Richard Levitte
2003-11-28 13:10:58 +00:00
Richard Levitte
4c8b4f9d03 Change my debugging entries to do fierce BIGNUM debugging. 2003-11-28 12:54:11 +00:00
Geoff Thorpe
81ba5f6713 Due to recent debugging bursts, openssl should be more or less solid
against inconsistent BIGNUMs coming out of any of its API functions. So
this change no longer "fixes" the bn_print.c functions, but it makes for
cleaner code. This patch was a part of ticket 697.

PR: 697
Submitted by: Otto Moerbeek
Reviewed by: Geoff Thorpe
2003-11-25 21:07:59 +00:00
Geoff Thorpe
6defae04f3 Fix some handling in bn_word. This also resolves the issues observed in
ticket 697 (though uses a different solution than the proposed one). This
problem was initially raised by Otto Moerbeek.

PR: 697
Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
2003-11-25 20:39:19 +00:00
Geoff Thorpe
e1064adfd3 Some changes for bn_gf2m.c: better error checking plus some minor
optimizations.

Submitted by: Nils Larsch
2003-11-25 03:41:20 +00:00
Lutz Jänicke
d7559f16cd Free "engine" resource in case of failure to prevent memory leak
PR: #778
Submitted by: George Mitchell <george@m5p.com>
2003-11-24 16:48:52 +00:00
Geoff Thorpe
9e989810ba BN_div() cleanup: replace the use of BN_sub and BN_add with bn_sub_words
and bn_add_words to avoid using fake bignums to window other bignums that
can lead to corruption. This change allows all bignum tests to pass with
BN_DEBUG and BN_DEBUG_RAND debugging and valgrind. NB: This should be
tested on a few different architectures and configuration targets, as the
bignum code this deals with is quite preprocessor (and assembly) sensitive.

Submitted by: Nils Narsch
Reviewed by: Geoff Thorpe, Ulf Moeller
2003-11-22 20:23:41 +00:00
Geoff Thorpe
ec2179cf81 Fix a small bug in str_copy: if more than one variable is replaced, make
sure the current length is used to calculate the new buffer length instead
of using the old length (prior to any variable substitution).

Submitted by: Nils Larsch
2003-11-21 21:42:35 +00:00
Dr. Stephen Henson
a8287a90ea Give CRLDP its standard name.
Max req -x509 use V1 if extensions section absent.
2003-11-20 22:45:06 +00:00
Andy Polyakov
ad5f0ed509 hpux64-parisc2-gcc target added. Once it is verified, ./config should
be modified to choose it instead of hpux64-parisc-gcc, which should
then be removed. hpux64-parisc-cc is removed already now as redundant
[in case you wonder, 64-bit HP-UX ABI *implies* PA-RISC2.0].
2003-11-20 19:10:36 +00:00
Andy Polyakov
0a4c8baf5e ./config failed to correctly detect if gcc uses 64-bit ABI on HP-UX.
PR: 772
2003-11-20 18:33:20 +00:00
Lutz Jänicke
95de3d204f Make sure to initialize AES counters to obtain proper results.
Submitted by: Kirill Kochetkov <kochet@ixbt.com>

PR: #748
2003-11-18 18:27:12 +00:00
Ulf Möller
31182ad39b re-enable the test, keeping the original method for RAND_pseudo_bytes
which is used by BN_DEBUG_RAND
Submitted by: Nils Larsch
2003-11-16 19:33:31 +00:00
Lutz Jänicke
f35232e6f3 Catch error condition to prevent NULL pointer dereference.
Submitted by: Goetz Babin-Ebell <babin-ebell@trustcenter.de>

PR: #766
2003-11-16 16:30:39 +00:00
Lutz Jänicke
fda5e38551 Provide ASFLAGS in the subdirectories handling assembler code.
Submitted by: Tim Rice <tim@multitalents.net>

PR: #735, #765
2003-11-16 14:38:34 +00:00
Ulf Möller
ac9c6e10a4 The x9.62 tests replace the PRNG with specific numbers,
so don't run them if BN_DEBUG_RAND is defined.

Also, fix another small bug.

Submitted by: Nils Larsch
2003-11-16 12:24:45 +00:00
Ulf Möller
1a01733047 BN_set_bit() etc should use "unsigned int".
Keep it as is to avoid an API change, but check for negativ values.

Submitted by: Nils Larsch
2003-11-15 08:37:50 +00:00
Richard Levitte
d2cd46127c Less restrictive debugging build. 2003-11-14 14:06:40 +00:00
Geoff Thorpe
9dde17e8b4 This rewrites two "for" loops in BN_rshift() - equality with zero is
generally a more efficient comparison than comparing two integers, and the
first of these two loops was off-by-one (copying one too many values). This
change also removes a superfluous assignment that would set an unused word
to zero (and potentially allow an overrun in some cases).

Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
2003-11-13 15:03:14 +00:00
Geoff Thorpe
37af03d311 General improvements to the ec_asn1.c code. This squashes at least one bug
(where it was impossible to create an EC certificate with a compressed
public key), and has some style improvements based on some comments from
Steve Henson about use of the ASN1 macros.

Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
2003-11-10 18:09:18 +00:00
Geoff Thorpe
f7a397cc8d Avoid possible memory leaks in error-handling.
Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
2003-11-10 18:05:22 +00:00
Dr. Stephen Henson
cd2e8a6f2d Print out GeneralizedTime and UTCTime in ASN1_STRING_print_ex(). 2003-11-10 01:37:23 +00:00
Ulf Möller
d18b993c43 Geoff suggested a more succinct description for "top". 2003-11-07 01:33:00 +00:00
Ulf Möller
e6e81c5894 oops... the description of ->top was inaccurate (the example is correct though) 2003-11-07 00:07:28 +00:00
Geoff Thorpe
f75abcefed This extends the debugging macros to use "pollution" during
bn_correct_top(), previously only bn_check_top() did this.
2003-11-06 23:24:44 +00:00
Geoff Thorpe
18f62d4b82 Add debug-screening of input parameters to some functions I'd missed
before.
2003-11-06 23:13:04 +00:00
Geoff Thorpe
5c0c22803e Put more debug screening in BN_div() and correct a comment. 2003-11-06 23:11:07 +00:00
Geoff Thorpe
0ef85c7f45 This is a revert of my previous commit to "improve" the declaration of
constant BIGNUMs. It turns out that this trips up different but equally
useful compiler warnings to -Wcast-qual, and so wasn't worth the ugliness
it created. (Thanks to Ulf for the forehead-slap.)
2003-11-05 19:30:29 +00:00
Ulf Möller
078dd1a0f9 typo in comment 2003-11-05 17:28:59 +00:00
Ulf Möller
2b96c95197 cleanup as discussed with Geoff 2003-11-05 17:28:25 +00:00
Ulf Möller
c5f1c7b4d8 Cygwin debugging 2003-11-05 17:27:13 +00:00
Geoff Thorpe
d870740cd7 Put the first stage of my bignum debugging adventures into CVS. This code
is itself experimental, and in addition may cause execution to break on
existing openssl "bugs" that previously were harmless or at least
invisible.
2003-11-04 22:54:49 +00:00
Geoff Thorpe
d8ec0dcf45 Avoid some shadowed variable names.
Submitted by: Nils Larsch
2003-11-04 00:51:32 +00:00
Geoff Thorpe
c465e7941e This is the least unacceptable way I've found for declaring the bignum data
and structures as constant without having to cast away const at any point.
There is still plenty of other code that makes gcc's "-Wcast-qual" unhappy,
but crypto/bn/ is now ok. Purists are welcome to suggest alternatives.
2003-11-04 00:29:09 +00:00
Richard Levitte
933398f110 Engines are usually binary, and should therefore be in INSTALLTOP
rather than OPENSSLDIR.
2003-10-31 10:48:48 +00:00
Richard Levitte
cfd06a6223 Let exit codes propagate from within for loops. 2003-10-31 06:58:24 +00:00
Geoff Thorpe
a9fd78f9da bn_div() does some pretty nasty things with temporary variables,
constructing BIGNUM structures with pointers offset into other bignums
(among other things). This corrects some of it that is too plainly insane,
and tries to ensure that bignums are normalised when passed to other
functions.
2003-10-31 01:35:16 +00:00
Geoff Thorpe
5f747c7f4b When a BN_CTX is used for temporary workspace, the variables are sometimes
left in an inconsistent state when they are released for later reuse. This
change resets the BIGNUMs when they are released back to the context.
2003-10-30 01:07:56 +00:00
Geoff Thorpe
c4db1a8b5c This fixes a couple of cases where an inconsistent BIGNUM could be passed as
input to a function.
2003-10-30 01:03:31 +00:00
Geoff Thorpe
f7939fcd9a make update 2003-10-29 23:25:52 +00:00
Geoff Thorpe
d531c9014d Tighten up my compiler settings. 2003-10-29 23:25:34 +00:00
Geoff Thorpe
aca95e0b2f Remove a line that was causing redundant declarations.
Obtained from: Stephen Henson <steve@openssl.org>
2003-10-29 22:55:19 +00:00
Geoff Thorpe
bc3c578208 Copy-n-paste bug (don't mix variable declarations and code). This sets the
callback structure just before it is needed.
2003-10-29 22:30:45 +00:00
Geoff Thorpe
06e4024d98 Oops, this file already had the "empty source file" workaround but it
requires -DPEDANTIC and was hidden at the bottom of the file. This moves it
to the top and removes the redundant declaration.
2003-10-29 22:25:04 +00:00
Geoff Thorpe
8087d8f7ea Make md32_common.h friendlier to compiler warnings.
Obtained from: Andy Polyakov <appro@openssl.org>
2003-10-29 20:55:03 +00:00
Geoff Thorpe
31166ec8f3 Some provisional bignum debugging has begun to detect inconsistent BIGNUM
structures being passed in to or out of API functions, and this corrects a
couple of cases found so far.

Also, lop off a couple of bytes of white-space.
2003-10-29 20:47:49 +00:00
Geoff Thorpe
2754597013 A general spring-cleaning (in autumn) to fix up signed/unsigned warnings.
I have tried to convert 'len' type variable declarations to unsigned as a
means to address these warnings when appropriate, but when in doubt I have
used casts in the comparisons instead. The better solution (that would get
us all lynched by API users) would be to go through and convert all the
function prototypes and structure definitions to use unsigned variables
except when signed is necessary. The proliferation of (signed) "int" for
strictly non-negative uses is unfortunate.
2003-10-29 20:24:15 +00:00
Geoff Thorpe
2ce90b9b74 BN_CTX is opaque and the static initialiser BN_CTX_init() is not used
except internally to the allocator BN_CTX_new(), as such this deprecates
the use of BN_CTX_init() in the API. Moreover, the structure definition of
BN_CTX is taken out of bn_lcl.h and moved into bn_ctx.c itself.

NDEBUG should probably only be "forced" in the top-level configuration, but
until it is I will avoid removing it from bn_ctx.c which might surprise
people with massive slow-downs in their keygens. So I've left it in
bn_ctx.c but tidied up the preprocessor logic a touch and made it more
tolerant of debugging efforts.
2003-10-29 18:04:37 +00:00
Richard Levitte
4e952ae4fc Removing those memcpy()s also took away the possibility for in and out to
be the same.  Therefore, the removed memcpy()s need to be restored.
2003-10-29 06:21:22 +00:00
Geoff Thorpe
db59141467 remove accidentally committed debugging cruft. 2003-10-29 05:35:31 +00:00
Geoff Thorpe
8a66d17899 Remove an unnecessary cast that causes certain compilers (eg. mine) some
confusion. Also silence a couple of signed/unsigned warnings.
2003-10-29 05:00:57 +00:00
Geoff Thorpe
2eeaa0261e Remove redundant declaration. 2003-10-29 04:58:23 +00:00
Geoff Thorpe
8dc344ccbf Relax some over-zealous constification that gave some lhash-based code no
choice but to have to cast away "const" qualifiers from their prototypes.
This does not remove constification restrictions from hash/compare
callbacks, but allows destructor commands to be run over a tables' elements
without bad casts.
2003-10-29 04:57:05 +00:00
Geoff Thorpe
6bcd3f903a Comments out some unimplemented functions instead of redeclaring them. 2003-10-29 04:42:29 +00:00
Geoff Thorpe
40f935f5b4 Avoid "empty source file" warnings. 2003-10-29 04:41:19 +00:00
Geoff Thorpe
0991f07034 For whatever reason (compiler or header bugs), at least one commonly-used
linux system (namely mine) chokes on our definitions and uses of the "HZ"
symbol in crypto/tmdiff.[ch] and apps/speed.c as a "bad function cast"
(when in fact there is no function casting involved at all). In both cases,
it is easily worked around by not defining a cast into the macro and
jiggling the expressions slightly.

In addition - this highlights some cruft in openssl that needs sorting out.
The tmdiff.h header is exported as part of the openssl API despite the fact
that it is ugly as the driven sludge and not used anywhere in the library,
applications, or utilities. More weird still, almost identical code exists
in apps/speed.c though it looks to be slightly tweaked - so either tmdiff
should be updated and used by speed.c, or it should be dumped because it's
obviously not useful enough.

Rather than removing it for now, I've changed the API for tmdiff to at
least make sense. This involves taking the object type (MS_TM) from the
implementation and using it in the header rather than using "char *" in the
API and casting mercilessly in the code (ugh). If someone doesn't like
"MS_TM" and the "ms_time_***" naming, by all means change it. This should
be a harmless improvement, because the existing API is clearly not very
useful (eg. we reimplement it rather than using it in our own utils).

However, someone still needs to take a hack at consolidating speed.c and
tmdiff.[ch] somehow.
2003-10-29 04:40:13 +00:00
Geoff Thorpe
2aaec9cced Update any code that was using deprecated functions so that everything builds
and links with OPENSSL_NO_DEPRECATED defined.
2003-10-29 04:14:08 +00:00
Geoff Thorpe
9d473aa2e4 When OPENSSL_NO_DEPRECATED is defined, deprecated functions are (or should
be) precompiled out in the API headers. This change is to ensure that if
it is defined when compiling openssl, the deprecated functions aren't
implemented either.
2003-10-29 04:06:50 +00:00
Geoff Thorpe
6145b0b183 The "cryptodev" engine preprocessor logic used undefined symbols in
comparisons. It's better not to allow this, because it gives false
positives when using compiler warnings that detect mistyped symbols.
2003-10-29 04:00:14 +00:00
Geoff Thorpe
2a85f77146 Add my own debug config target. 2003-10-28 22:57:18 +00:00
Geoff Thorpe
66b82f5aad make update 2003-10-28 22:10:47 +00:00
Geoff Thorpe
12bdceac8a Ignore derived file. 2003-10-28 17:26:46 +00:00
Geoff Thorpe
aea293e3bc crypto/evp/evptests.txt is copied to tests/ rather than symlinked because
of windows (see checkin 1.75 of crypto/evp/Makefile.ssl), so quiet cvs
noise for the copied version.
2003-10-28 17:24:29 +00:00
Geoff Thorpe
8ad7e3ad2a Remove duplicate prototypes have already been (correctly) added to rsa.h,
as this is already included by x509.h anyway.
2003-10-24 16:17:11 +00:00
Richard Levitte
0b6956b474 Correct serious bug in AES-CBC decryption when the message length isn't
a multiple of AES_BLOCK_SIZE.
Optimize decryption of all complete blocks in AES-CBC by removing an
unnecessary memcpy().

The error was notified by James Fernandes <jf210032@exchange.DAYTONOH.NCR.com>.
The unnecessary memcpy() was found as an effect of investigating that error.
2003-10-15 09:00:14 +00:00
Richard Levitte
0bb6187e71 The object file is o_str.o, not o_str.c.
Thanks to Peter Sylvester <Peter.Sylvester@EdelWeb.fr> for the notification.
2003-10-13 11:34:40 +00:00
Dr. Stephen Henson
c5a5546389 Add support for digested data PKCS#7 type. 2003-10-11 22:11:45 +00:00
Dr. Stephen Henson
77fe058c10 Simplify cipher and digest lookup in PKCS#7 code. 2003-10-11 16:46:40 +00:00
Dr. Stephen Henson
8d9086dfa2 New function to initialize a PKCS7 structure of type other. 2003-10-10 23:40:47 +00:00
Dr. Stephen Henson
0602abf5bd Initialize digested data type in PKCS7_set_type(). 2003-10-10 23:31:53 +00:00
Dr. Stephen Henson
caf044cb3e Retrieve correct content to sign when the
type is "other".
2003-10-10 23:25:43 +00:00
Dr. Stephen Henson
a08ced78c8 Avoid warnings: add missing prototype, don't shadow. 2003-10-10 23:07:24 +00:00
Richard Levitte
83eb412da8 In realloc, don't destroy the old memory area if a new one couldn't be
allocated.
Notified by Daniel Lucq <daniel@lucq.org>
2003-10-07 12:09:39 +00:00
Richard Levitte
4d1c443123 make update 2003-10-06 12:22:42 +00:00
Richard Levitte
f44e184ec6 s_client should inform the user of any compression/expansion methods used. 2003-10-06 12:19:38 +00:00
Richard Levitte
377dcdba44 Add functionality to get information on compression methods (not quite complete). 2003-10-06 12:18:39 +00:00
Richard Levitte
8242354952 Make sure int SSL_COMP_add_compression_method() checks if a certain
compression identity is already present among the registered
compression methods, and if so, reject the addition request.

Declare SSL_COMP_get_compression_method() so it can be used properly.

Change ssltest.c so it checks what compression methods are available
and enumerates them.  As a side-effect, built-in compression methods
will be automagically loaded that way.  Additionally, change the
identities for ZLIB and RLE to be conformant to
draft-ietf-tls-compression-05.txt.

Finally, make update.

Next on my list: have the built-in compression methods added
"automatically" instead of requiring that the author call
SSL_COMP_add_compression_method() or
SSL_COMP_get_compression_methods().
2003-10-06 11:00:15 +00:00
Richard Levitte
c40b9bdefb Setting the ex_data index is unsafe in a threaded environment, so
let's wrap it with a lock.
2003-10-06 09:09:44 +00:00
Richard Levitte
6895cca89d Remove unused code, don't use zlib functions that are really macros
and provide missing prototypes.
2003-10-04 09:09:19 +00:00
Richard Levitte
f82ab534c6 Check for errors from SSL_COMP_add_compression_method().
Notified by Andrew Marlow <AMARLOW1@bloomberg.net>
2003-10-02 10:41:48 +00:00
Richard Levitte
f6e8c19ed1 Correct a mixup of return values 2003-10-02 10:38:44 +00:00
Richard Levitte
cf89b40584 Include e_os.h to get a proper definition of memmove on the platforms
that do not have it.
2003-10-01 20:43:03 +00:00
Richard Levitte
c076599c18 Corrected misplacement of one of the greps... 2003-10-01 15:06:36 +00:00
Richard Levitte
4d8148fa98 Remove leading and trailing spaces and tabs 2003-10-01 15:04:13 +00:00
Richard Levitte
aed29ce5ea Avoid 'file names' with spaces 2003-10-01 15:03:15 +00:00
Richard Levitte
9ad82c123a Use correct case for manual page references 2003-10-01 15:02:45 +00:00
Richard Levitte
eeff6bb6b3 Correct incorrect mode bits change. 2003-09-30 17:31:48 +00:00
Richard Levitte
d90e74c50c Correct buggy PODs (missing commas and a prepended space). 2003-09-30 17:22:19 +00:00
Dr. Stephen Henson
2990244980 ASN1 parse fix and release file changes. 2003-09-30 16:47:33 +00:00
Richard Levitte
c798868d96 Further VxWorks changes from Bob Bradley <bob@chaoticsoftware.com>, this
time involving VxWorks on MIPS
2003-09-28 14:06:57 +00:00
Richard Levitte
057a04398d Synchronise util/libeay.num with the 0.9.7-stable one.
make update
2003-09-28 09:34:50 +00:00
Richard Levitte
7f3ba9428f Uhmm, It seem to have forgotten one file when I committed the MSDOS
change yesterday.
PR: 669
2003-09-28 07:11:33 +00:00
Richard Levitte
3c02e24bb3 Change the indentation from 12 to indent+4.
PR: 657
2003-09-27 22:48:33 +00:00
Richard Levitte
1be02dd842 Make MD5 assembler code able to handle messages larger than 2GB on 32-bit
systems and above.
PR: 664
2003-09-27 22:14:39 +00:00
Richard Levitte
3d7c4a5a6d Selected changes for MSDOS, contributed by Gisle Vanem <giva@bgnett.no>.
PR: 669
2003-09-27 21:56:08 +00:00
Richard Levitte
11171f3c74 Add reference counting around the thread state hash table.
Unfortunately, this means that the dynamic ENGINE version just went up, and
isn't backward compatible.
PR: 678
2003-09-27 20:29:05 +00:00
Richard Levitte
ba9f80c5d5 Have ssl3_ssl3_send_client_verify() change the state to SSL3_ST_SW_CERT_VRFY_B.
PR: 679
2003-09-27 19:32:06 +00:00
Richard Levitte
e59659dc41 Have ssl3_send_certificate_request() change the state to SSL3_ST_SW_CERT_REQ_B.
PR: 680
2003-09-27 19:27:06 +00:00
Richard Levitte
253e893c2b Include the instance in the Kerberos ticket information.
In s_server, print the received Kerberos information.
PR: 693
2003-09-27 17:55:13 +00:00
Richard Levitte
0ad2c4f85b Correct small documentation error.
PR: 698
2003-09-27 10:39:16 +00:00
Richard Levitte
0e6c20da46 Free the Kerberos context upon freeing the SSL.
Contributed by Andrew Mann <amann@tccgi.com>
2003-09-27 07:35:07 +00:00
Richard Levitte
f6b659cba4 Add necessary changes to be able to build on VxWorks for PPC860.
Contributed by Bob Bradley <bob@chaoticsoftware.com>
2003-09-27 07:34:49 +00:00
Ralf S. Engelschall
6bd27f8644 Fix prime generation loop in crypto/bn/bn_prime.pl by making
sure the loop does correctly stop and breaking ("division by zero")
modulus operations are not performed. The (pre-generated) prime
table crypto/bn/bn_prime.h was already correct, but it could not be
re-generated on some platforms because of the "division by zero"
situation in the script.
2003-09-25 13:57:58 +00:00
Dr. Stephen Henson
dfe399e7d9 Add -passin support to rsautl 2003-09-21 02:20:02 +00:00
Dr. Stephen Henson
7068c8b1a6 In order to get the expected self signed error when
calling X509_verify_cert() in x509.c the cert should
not be added to the trusted store.
2003-09-21 02:18:15 +00:00
Dr. Stephen Henson
82384690e2 Typos. 2003-09-09 23:44:39 +00:00
Richard Levitte
e6fa67fa93 Generalise the definition of strcasecmp() and strncasecmp() for
platforms that don't (necessarely) have it.  In the case of VMS, this
means moving a couple of functions from apps/ to crypto/ and make them
general (although only used privately).
2003-09-09 14:48:36 +00:00
Geoff Thorpe
9ea72d3705 These should be write-locks, not read-locks. 2003-09-08 15:47:55 +00:00
Bodo Möller
a907751350 certain changes have to be listed twice in this file because OpenSSL
0.9.6h forked into 0.9.6i and 0.9.7 ...
2003-09-04 12:52:56 +00:00
Dr. Stephen Henson
560dfd2a02 New -ignore_err option in ocsp application to stop the server
exiting on the first error in a request.
2003-09-03 23:56:01 +00:00
Dr. Stephen Henson
14f3d7c5cc Only accept a client certificate if the server requests
one, as required by SSL/TLS specs.
2003-09-03 23:47:34 +00:00
Dr. Stephen Henson
510dc1ecd0 outlen should be int * in out_utf8. 2003-08-21 12:32:12 +00:00
Bodo Möller
563c05e2dc fix out-of-bounds check in lock_dbg_cb (was too lose to detect all
invalid cases)

PR: 674
2003-08-14 10:33:56 +00:00
Bodo Möller
643ecd2ed6 make sure no error is left in the queue that is intentionally ignored 2003-08-11 18:56:22 +00:00
Richard Levitte
88401ed449 Correct two problems, found by Martin Kochanski <cardbox@easynet.co.uk>:
1. CreateToolhelp32Snapshot returns INVALID_HANDLE_VALUE, not NULL, on error.
2. On Windows CE, a snapshot handle is closed with CloseToolhelp32Snapshot,
   not CloseHandle.
2003-08-07 11:57:42 +00:00
Bodo Möller
3aa8d3a7f1 add OpenSSL license
fix typo
2003-08-06 10:36:25 +00:00
Richard Levitte
5b6e7c8c65 Inclusion of openssl/engine.h should always be wrapped with a check that
OPENSSL_NO_ENGINE is not defined.
2003-08-04 10:12:36 +00:00
Dr. Stephen Henson
f96d1af449 Avoid clashes with Win32 names in WinCrypt.h 2003-07-23 00:10:43 +00:00
Bodo Möller
968766cad8 updates for draft-ietf-tls-ecc-03.txt
Submitted by: Douglas Stebila
Reviewed by: Bodo Moeller
2003-07-22 12:34:21 +00:00
Bodo Möller
652ae06bad add test for secp160r1
add code for kP+lQ timings

Submitted by: Douglas Stebila <douglas.stebila@sun.com>
Reviewed by: Bodo Moeller
2003-07-22 10:39:10 +00:00
Bodo Möller
ddc38679ce tolerate extra data at end of client hello for SSL 3.0
PR: 659
2003-07-21 15:17:46 +00:00
Bodo Möller
02e0559477 fix: 0.9.7 is based on 0.9.6h, not on 0.9.6k
typo in 0.9.6k section
2003-07-21 15:08:01 +00:00
Bodo Möller
ada0e717fa new function EC_GROUP_cmp() (used by EVP_PKEY_cmp())
Submitted by: Nils Larsch
2003-07-21 13:43:28 +00:00
Bodo Möller
2c789c82be manpages for 'openssl ec' and 'openssl ecparam'
Submitted by: Nils Larsch
2003-07-21 13:40:02 +00:00
Richard Levitte
d143dce03c A document that has a very rough description of the X509
functionality.  This is mostly so there's a way to get from the
crypto.html page to the function descriptions.
2003-07-10 08:49:03 +00:00
Richard Levitte
f9d183c209 Replace CCITT with ITU-T. Keep CCITT around as an alias.
make update

PR: 80
2003-07-04 15:45:04 +00:00
Richard Levitte
182cd19dea Make sure openssl.pc is readable by everyone.
PR: 654
2003-07-04 11:41:13 +00:00
Richard Levitte
61f00386ab The counter is big-endian. Since it comes as an array of char,
there's absolutely no need to special-case it on little-endian
machines.

Notified by Thierry Boivin <Thierry.Boivin@celsecat.com>
2003-07-04 11:37:50 +00:00
Richard Levitte
2ae0352b0f Oops, I forgot to replace 'counter' with 'ivec' when used... 2003-07-03 20:50:44 +00:00
Richard Levitte
94805c84d1 Add -issuer_hash and make -subject_hash the default way to get the
subject hash, with -hash a synonym kept around for backward
compatibility reasons.
PR: 650
2003-07-03 20:45:09 +00:00
Richard Levitte
6f2f534b58 The convenience argumetn for -nameopt and -certopt is ca_default, not
default_ca.
PR: 653
2003-07-03 07:46:52 +00:00
Richard Levitte
da6c44fc97 The 'counter' is really the IV. 2003-07-03 06:42:43 +00:00
Richard Levitte
da0d33560f Change AES-CTR to increment the IV by 1 instead of 2^64. 2003-07-03 06:41:30 +00:00
Lutz Jänicke
9d19fbc4fc Clarify wording of verify_callback() behaviour. 2003-06-26 14:03:03 +00:00
Richard Levitte
aa5ae4841e Only remove old files if they exist. [Maing32].
Notified by Michael Gerdau <mgd@technosis.de>
2003-06-26 11:58:02 +00:00
Richard Levitte
eb3d68c454 Nils Larsch told me I could remove that variable entirely. 2003-06-26 11:52:23 +00:00
Richard Levitte
c89f31def0 make update 2003-06-26 10:27:11 +00:00
Richard Levitte
ed5fae580e Implement missing functions.
Have the f parameter to _ctrl functions have the prototype (*)(void)
rather than (*)(), for the sake of C++ compilers.
Disable unimplemented functionality.
2003-06-26 10:26:42 +00:00
Richard Levitte
d55141ed7a "Remove" unused variable 2003-06-26 10:23:00 +00:00
Richard Levitte
a99ce1a574 Conform with the standard prototype for engine control functions. 2003-06-26 07:10:10 +00:00
Richard Levitte
c687a3d5d5 Scan through the engines directory as well. 2003-06-26 07:05:19 +00:00
Richard Levitte
dfc3151925 The definition of dynamic_ctrl() should change along with the
declaration :-).
2003-06-26 07:03:49 +00:00
Bodo Möller
0fbffe7a71 implement PKCS #8 / SEC1 private key format for ECC
Submitted by: Nils Larsch
2003-06-25 21:35:05 +00:00
Dr. Stephen Henson
037f6e73f1 Return EOF when an S/MIME part have been read. 2003-06-24 17:11:44 +00:00
Richard Levitte
cf82439de8 Make sure the compiler knows we run with pedantic settings. 2003-06-20 00:57:18 +00:00
Richard Levitte
37fcd48f86 make update 2003-06-19 23:00:50 +00:00
Richard Levitte
cf9a88cad7 Document the last change.
PR: 587
2003-06-19 19:04:13 +00:00
Richard Levitte
4f1cd8324c Prepare for changes in the 0.9.6 branch 2003-06-19 19:01:05 +00:00
Richard Levitte
ed7f1d0bc6 Prepare for changes in the 0.9.6 branch 2003-06-19 18:59:27 +00:00
Richard Levitte
f6b9cd7f82 We set the export flag for 512 *bit* keys, not 512 *byte* ones.
PR: 587
2003-06-19 18:55:50 +00:00
Richard Levitte
8fbb2af392 Add documentation for the new crlnumber configuration option. 2003-06-19 17:52:57 +00:00
Richard Levitte
c5aba56c5b Typo. 2003-06-19 17:50:37 +00:00
Richard Levitte
fd4ef69913 Implement CRL numbers.
Contributed in whole by Laurent Genier <Laurent.Genier@intrinsec.com>
PR: 644
2003-06-19 17:40:16 +00:00
Richard Levitte
834ac33a37 dynamic_ctrl() didn't have exactly the same prototype as defined by
ENGINE_CTRL_FUNC_PTR.
2003-06-19 16:57:38 +00:00
Richard Levitte
4e9023f4d2 Unsigned vs. signed fixed. 2003-06-19 16:56:48 +00:00
Richard Levitte
d3a28e8b8d EXIT() should mainly be exit(n), not return(n). OPENSSL_EXIT() will
take care of returning if necessary.
2003-06-19 16:56:19 +00:00
Richard Levitte
0bd71d3b7e Add the application data type to the README. 2003-06-18 07:14:52 +00:00
Richard Levitte
d97322f0e6 Missing string and potential memory leaks.
Notified by Goetz Babin-Ebell <goetz@shomitefo.de>
2003-06-18 07:12:28 +00:00
Richard Levitte
b52d512dfa Slightly better check of attributes. Now, mem_list_next can actually stop when the searched for key doesn't have it's attributes within the range of the checked key. 2003-06-12 21:32:54 +00:00
Richard Levitte
a3a2ff4cd9 Beautify 2003-06-12 18:13:27 +00:00
Richard Levitte
5a1fd87ec1 Typo.
PR: 584
2003-06-12 01:04:05 +00:00
Richard Levitte
8645c415cf Do not try to use non-existent gmtime_r() on SunOS4.
PR: 585
2003-06-12 00:57:25 +00:00
Richard Levitte
700d86ea18 Make sure ssize_t is defined on SunOS4.
PR: 585
2003-06-12 00:56:27 +00:00
Richard Levitte
54bbde3c3f Make sure DSO-dlfcn works properly on SunOS4.
PR: 585
2003-06-12 00:51:54 +00:00
Richard Levitte
c14b337570 Typo.
PR: 593
2003-06-11 22:45:53 +00:00
Richard Levitte
e666c4599f Add the possibility to have symbols loaded globally with DSO. 2003-06-11 22:42:28 +00:00
Richard Levitte
98cec7fc7b make update 2003-06-11 22:27:19 +00:00
Richard Levitte
fadd2246a0 Avoid warnings saying that the format takes a void*. 2003-06-11 22:26:02 +00:00
Richard Levitte
c78b4f1d3d Remove unused variable 2003-06-11 21:47:21 +00:00
Richard Levitte
33862b90bb Add an entry for X509_TRUST_OBJECT_SIGN in trstandard[].
PR: 617
2003-06-11 21:22:30 +00:00
Richard Levitte
36bad5cdfd Add documentation for ERR_set_mark() and ERR_pop_to_mark(). 2003-06-11 20:51:49 +00:00
Richard Levitte
54f6451670 Add functionality to set marks on the error stack and to pop all errors to the next mark. 2003-06-11 20:49:58 +00:00
Richard Levitte
490967195a Handle des_modes.pod properly.
PR: 634
2003-06-11 19:44:37 +00:00
Richard Levitte
606c8048a0 Make sure to NUL-terminate the string on end-of-file (and error)
PR: 643
2003-06-11 18:43:45 +00:00
Richard Levitte
e66d863cd0 Add crypto/store to the directories to look through. 2003-06-11 04:46:08 +00:00
Richard Levitte
a069460015 Document the AES_cbc_encrypt() change 2003-06-10 04:42:38 +00:00
Richard Levitte
55b12f8641 The output from AES_cbc_encrypt() should be exact multiple blocks when encrypting 2003-06-10 04:11:42 +00:00
Richard Levitte
40e5b9abeb Typo 2003-06-09 07:56:18 +00:00
Geoff Thorpe
dcfb57c736 This memset() in the ubsec ENGINE is a bug. Zeroing out the result array
should not be necessary in any case, but more importantly the result and
input BIGNUMs could be the same, in which case this is clearly a problem.

Submitted by: Jonathan Hersch
Reviewed by: Joe Orton
Approved by: Geoff Thorpe
2003-06-06 17:51:34 +00:00
Richard Levitte
2ee67f1dad Make sure the sigaction structure and fileno function are properly declared with an ANSI compiler on Solaris (and possibly others). 2003-06-04 09:13:19 +00:00
Richard Levitte
4af3184662 Remove extra ; 2003-06-04 09:11:44 +00:00
Richard Levitte
e31047744a Make sure the function definitions match their declaration. 2003-06-04 09:11:15 +00:00
Richard Levitte
f6eba601b0 Make sure that size_t matches size_t. 2003-06-04 09:10:43 +00:00
Richard Levitte
f796dc5c06 Make sure debug-solaris-sparcv9-gcc is consistent with solaris-sparcv9-gcc. 2003-06-04 09:10:11 +00:00
Dr. Stephen Henson
50078051bd Really get X509_CRL_CHECK_ALL right this time... 2003-06-04 00:40:05 +00:00
Lutz Jänicke
db01746978 Clarify return value of SSL_connect() and SSL_accept() in case of the
WANT_READ and WANT_WRITE conditions.
2003-06-03 09:59:44 +00:00
Dr. Stephen Henson
63b815583b Update CHANGES to reflect base64 fix added to 0.9.7 2003-06-03 00:16:47 +00:00
Dr. Stephen Henson
ca82ac1fee Only count 'LF' as EOL in pk7_mime.c, this avoids incorrect
results if CR+LF straddles the line buffer.
2003-06-02 17:53:42 +00:00
Dr. Stephen Henson
aff0542844 Stop checking for CRLF when start of buffer is reached.
Add rest of long line fix which got missed before
2003-06-02 01:12:01 +00:00
Dr. Stephen Henson
beab098d53 Various S/MIME bug and compatibility fixes. 2003-06-01 20:51:58 +00:00
Lutz Jänicke
02b95b7499 Clarify ordering of certificates when using certificate chains 2003-05-30 07:45:07 +00:00
Richard Levitte
c4d471552f Include openssl/e_os.h so OPENSSL_SYSNAME_ULTRASPARC and other configuration
macros get properly defined.
2003-05-29 22:22:30 +00:00
Richard Levitte
01fc834bc9 Have ASFLAGS be defined the same way as CFLAGS 2003-05-29 22:20:47 +00:00
Richard Levitte
f7f8d82aaa PR: 630
Avoid looking outside the key_data array.
2003-05-29 20:59:38 +00:00
Lutz Jänicke
4f17dfcd75 Add minimum POP3 STLS hack to s_client.c (as was provided for STARTTLS before)
Submitted by: dg@sunet.ru (Daniel Ginsburg)

PR: #613
2003-05-28 20:24:57 +00:00
Lutz Jänicke
83b4f49c0a Move header file inclusion to prevent irritation of users forgetting to
call "make depend" after enabling or disabling ciphers...
Submitted by: Tal Mozes <talm@cyber-ark.com>

PR: #628
2003-05-28 19:56:46 +00:00
Dr. Stephen Henson
60790aff6f PR: 627
Allocate certificatePolicies correctly if CPS field is absent.

Fix various memory leaks in certificatePolicies.
2003-05-28 17:28:11 +00:00
Dr. Stephen Henson
e19d0ef068 PR: 631
Submitted by: Doug Sauder <dws+001@hunnysoft.com>

Fix bug in X509V3_get_d2i() when idx in not NULL.
2003-05-28 16:57:08 +00:00
Richard Levitte
f5f7dffdd1 Make sure to compare unsigned against unsigned. 2003-05-28 10:34:29 +00:00
Richard Levitte
edd55d08f5 Brackets are now allowed, after a small hack in the processing of the
docs-on-web.
2003-05-23 09:08:59 +00:00
Richard Levitte
83743ad039 Fix sign bugs.
PR: 621
2003-05-21 14:29:13 +00:00
Richard Levitte
163f5b236c Correct signedness 2003-05-21 14:21:26 +00:00
Richard Levitte
513c01a591 Make sure EC_window_bits_for_scalar_size() returns a size_t 2003-05-21 08:40:06 +00:00
Richard Levitte
d9a2a89a17 I have no idea how I cut away that piece of text... 2003-05-21 06:50:51 +00:00
Richard Levitte
31939f1544 I don't remember what my thinking was with str_compat.h. Maybe it'll
come back to me...
2003-05-20 09:00:59 +00:00
Richard Levitte
11ce33a71d make update 2003-05-20 08:59:37 +00:00
Richard Levitte
9acef3bbd7 Misspelled functions. 2003-05-20 08:50:18 +00:00
Richard Levitte
164bc7dae8 Some misspelled function names. 2003-05-20 08:49:12 +00:00
Richard Levitte
f59c941950 Make the function STORE_new_engine() public. 2003-05-19 23:06:09 +00:00
Richard Levitte
0239876511 Remove certain functions 2003-05-19 23:03:43 +00:00
Dr. Stephen Henson
93c929e411 The square brackets in BIO_s_bio.pod for some
reason cause wml to bomb out with the error
message:

** Slice:Error: Some slices were not closed:
** WML:Break: Error in Pass 9 (rc=1).
** WMK:Error: Error in WML (rc=256)

As a workaround delete them for now.
2003-05-19 21:28:49 +00:00
Dr. Stephen Henson
c2dac35a02 Fix docs. 2003-05-18 23:10:46 +00:00
Dr. Stephen Henson
727ef76ebd Add correct DN entry for serialNumber. 2003-05-07 23:20:58 +00:00
Richard Levitte
bca52f7d4e Define the two authentication parameter types for passphrase and
Kerberos 5 authentications.
2003-05-07 21:17:30 +00:00
Richard Levitte
48c36fdb2a Add the possibility to hand execution parameters (for example
authentication material) to the STORE functions.
Suggested by Götz Babin-Ebell <babin-ebell@trustcenter.de>.
2003-05-07 21:06:15 +00:00
Richard Levitte
9b2042fac3 /usr/lib/pkgconfig/openssl.pc was never installed in the RPM.
Notified by Bennett Todd <bet@rahul.net>.
2003-05-07 12:02:31 +00:00
Richard Levitte
816d785721 DO NOT constify RSA* in RSA_sign() and RSA_verify(), since there are function
called downstream that need it to be non-const.  The fact that the RSA_METHOD
functions take the RSA* as a const doesn't matter, it just expresses that
*they* won't touch it.
PR: 602
2003-05-07 11:38:10 +00:00
Richard Levitte
742b139f54 Add the possibility to store arbitrary data in a STORE.
Suggested by Götz Babin-Ebell <babin-ebell@trustcenter.de>.
2003-05-06 08:02:14 +00:00
Richard Levitte
3b30121bd9 Constify RSA_sign() and RSA_verify().
PR: 602
2003-05-05 13:55:18 +00:00
Richard Levitte
9ee789e6c3 Yeah, right, an object file ending with .c, that'll work! 2003-05-03 06:58:08 +00:00
Dr. Stephen Henson
b9d2d20086 Make DER option work again.
Fix typo.
2003-05-02 11:41:40 +00:00
Richard Levitte
b9d7ca9748 It's usually best if the function name matches everywhere... 2003-05-02 07:25:54 +00:00
Richard Levitte
5b194dfbd5 STORE was created 2003, darnit! 2003-05-01 20:44:20 +00:00
Richard Levitte
7f6af7d9db Get the year right... 2003-05-01 20:15:35 +00:00
Richard Levitte
42b2b6a2d5 Provide some extra comments about the STORE_Memory STORE method. 2003-05-01 04:31:12 +00:00
Richard Levitte
d1465bac90 make update 2003-05-01 04:10:32 +00:00
Richard Levitte
3bbb0212f3 Add STORE support in ENGINE. 2003-05-01 03:57:46 +00:00
Richard Levitte
a5db6fa576 Define a STORE type. For documentation, read the entry in CHANGES,
crypto/store/README, crypto/store/store.h and crypto/store/str_locl.h.
2003-05-01 03:53:12 +00:00
Richard Levitte
9236b5b013 Define a STORE lock (the STORE type will be committed later). 2003-05-01 03:46:10 +00:00
Richard Levitte
535fba4907 Define the OPENSSL_ITEM structure. 2003-05-01 03:45:18 +00:00
Richard Levitte
7e4140f73f make update 2003-04-29 22:24:17 +00:00
Richard Levitte
1ae0a83bdd Add BUF_strndup() and BUF_memdup(). Not currently used, but I've code
that uses them that I'll commit in a few days.
2003-04-29 22:08:57 +00:00
Richard Levitte
7ae46c6761 make update 2003-04-29 21:35:28 +00:00
Richard Levitte
d584fd6b66 Include objects.h to get a correct declaration of OBJ_bsearch_ex(),
not to mention the OBJ_BSEARCH_* macros.
2003-04-29 20:46:32 +00:00
Richard Levitte
54dbdd9837 Some variables were uninitialised... 2003-04-29 20:45:36 +00:00
Richard Levitte
9d6c32d6d1 Correct documentation. sk_find_ex() doesn't return a pointer, it
returns an index.
2003-04-29 20:31:58 +00:00
Richard Levitte
26851b6b42 Add an extended variant of sk_find() which returns a non-NULL pointer
even if an exact match wasn't found.
2003-04-29 20:30:55 +00:00
Richard Levitte
ea5240a5ed Add an extended variant of OBJ_bsearch() that can be given a few
flags.
2003-04-29 20:25:21 +00:00
Bodo Möller
eec7968f18 fix typo
Submitted by: Nils Larsch
2003-04-22 08:29:21 +00:00
Richard Levitte
1cc087fe4f Make it possible to affect the extension of man pages.
PR: 578
2003-04-21 22:00:36 +00:00
Richard Levitte
040c687ce4 Memory leak fix: RSA_blinding_on() didn't free Ai under certain circumstances.
Memory leak fix: RSA_blinding_on() would leave a dangling pointer in
                 rsa->blinding under certain circumstances.
Double definition fix: RSA_FLAG_NO_BLINDING was defined twice.
2003-04-16 06:25:21 +00:00
Richard Levitte
cd1226bc6a Memory leak fix: local blinding structure not freed in rsa_eay_private_decrypt() 2003-04-15 13:01:37 +00:00
Bodo Möller
7a04fdd87f include 'Changes between 0.9.6i and 0.9.6j' 2003-04-11 15:03:12 +00:00
Richard Levitte
138f970e6e Add the 0.9.6j news. 2003-04-10 20:38:24 +00:00
Richard Levitte
1a0c1f9052 make update 2003-04-10 20:11:09 +00:00
Richard Levitte
1774e22d6f New NEWS 2003-04-10 19:33:09 +00:00
Richard Levitte
26abc8f01a Remove all those infernal stupid CR characters 2003-04-10 19:11:32 +00:00
Richard Levitte
5924c21608 There's a problem building shared libraries on the sco5-gcc target. However,
it's time for a release, so I'm just adding an enty in PROBLEMS, and will
hopefully solve this for a later release
2003-04-10 18:36:31 +00:00
Richard Levitte
c93fbfaebc Explicitely tell the compiler we're mips3 for the target irix-mips3-cc. 2003-04-10 05:46:51 +00:00
Dr. Stephen Henson
0b1c00abeb Typo. 2003-04-10 00:04:02 +00:00
Richard Levitte
721688c2f8 Include rand.h, so RAND_status() and friends get properly declared. 2003-04-08 11:07:05 +00:00
Richard Levitte
a109220107 Correct a few typos.
It seems that svr3 and svr5 differ, after all.
2003-04-08 09:27:43 +00:00
Richard Levitte
4a4a04622e A single quote too many. 2003-04-08 08:58:56 +00:00
Richard Levitte
d6fd88fffd I forgot to continuation mark. 2003-04-08 08:57:23 +00:00
Richard Levitte
e96133e4cf It seems like OpenUnix's ld uses LD_LIBRARY_PATH to search for
libraries.  What's worse, the directories given in LD_LIBRARY_PATH are
checked first!  Therefore, we need a hack to prepend all the
directories we give with -L to the current value of LD_LIBRARY_PATH,
thereby temporarly forming a hacked value.

Only copy LIBEXTRAS if they are given.

Svr5 doesn't use -z allextract...
2003-04-08 08:36:20 +00:00
Lutz Jänicke
f65a75786b Fix ordering of compare functions: strncmp() must be used first, a
the cipher name in the list is not guaranteed to be at least "buflen"
long.
PR: 567
Submitted by: "Matt Harren" <matth@cs.berkeley.edu>
2003-04-08 06:31:36 +00:00
Richard Levitte
0b55368306 We seem to carry some rests of the 0.9.6 [engine] ENGINE framework, here in
form of unneeded direct calls through the engine pointer..
2003-04-08 06:01:55 +00:00
Richard Levitte
43eb3b0130 We seem to carry some rests of the 0.9.6 [engine] ENGINE framework in form
of unneeded includes of openssl/engine.h.
2003-04-08 06:00:05 +00:00
Richard Levitte
0a861ab7f3 RSA_FLAG_SIGN_VER indicates the special rsa_sign and rsa_verify function
pointers should be used.  It doesn't necessarely mean it should go through
the ENGINE framework.
2003-04-07 19:15:25 +00:00
Richard Levitte
7b36590b17 What was I smoking? EVP_PKEY_cmp() should return with 0 if
EVP_PKEY_cmp_parameters() returned 0, otherwise it should
go on processing the public key component.  Thia has nothing
to do with the proper handling of EC parameters or not.
2003-04-07 10:15:32 +00:00
Richard Levitte
a8b728445c Correct a typo.
Have EVP_PKEY_cmp() call EVP_PKEY_cmp_parameters(), and make a note
about the lack of parameter comparison for EC.
2003-04-07 10:09:44 +00:00
Richard Levitte
af0f0f3e8f Constify 2003-04-06 15:31:18 +00:00
Richard Levitte
8d570498a2 Do not call ENGINE_setup_bsd_cryptodev() when OPENSSL_NO_ENGINE is defined.
PR: 564
2003-04-05 21:21:26 +00:00
Richard Levitte
4c771796d5 Convert save_serial() to work like save_index(), and add a
rotate_serial() that works like rotate_index().
2003-04-04 15:10:35 +00:00
Richard Levitte
d6df2b281f Add documentation on the added functionality in 'openssl ca'. 2003-04-04 14:39:44 +00:00
Richard Levitte
6fcf735497 make update 2003-04-04 14:19:15 +00:00
Richard Levitte
b5f96e8818 There's no need to check for __attribute__ with ANSI functions, since
we only check to the opening parenthesis anyway...
2003-04-04 14:19:00 +00:00
Richard Levitte
3ae70939ba Correct a lot of printing calls. Remove extra arguments... 2003-04-03 23:39:48 +00:00
Richard Levitte
c433d72593 Make %p and %# work properly, at least with pointers and floats. 2003-04-03 23:35:14 +00:00
Richard Levitte
68b42986cb Add GCC attributes when compiled with gcc. This helps find out if
we're using the printing functions correctly or not.

I used the corresponding attributes found in the header files of my
Linux installation.
2003-04-03 23:06:05 +00:00
Richard Levitte
57544ee224 Counter for GCC attributes. 2003-04-03 23:04:48 +00:00
Richard Levitte
83b23ed967 One more debug line to conditionalise. 2003-04-03 23:01:20 +00:00
Richard Levitte
4342c5c1a0 Add a CA section, to make sure the test will work with the changes in
CA.sh.
2003-04-03 22:38:31 +00:00
Richard Levitte
16b1b03543 Implement self-signing in 'openssl ca'. This makes it easier to have
the CA certificate part of the CA database, and combined with
'unique_subject=no', it should make operations like CA certificate
roll-over easier.
2003-04-03 22:33:59 +00:00
Richard Levitte
e6526fbf4d Add functionality to help making self-signed certificate. 2003-04-03 22:27:24 +00:00
Richard Levitte
8152d88799 It's recommended to use req rather than x509 to create self-signed certificates 2003-04-03 22:12:48 +00:00
Richard Levitte
4ce4884a5b Typo correction 2003-04-03 21:55:55 +00:00
Richard Levitte
db598fbce2 Don't try to free NULL values... 2003-04-03 20:03:23 +00:00
Richard Levitte
8382ec5d37 Reindent for readability. 2003-04-03 19:10:32 +00:00
Richard Levitte
0998cfaadd Remove unused variable. 2003-04-03 19:07:27 +00:00
Richard Levitte
c4448f60d6 Reset the version number of the issuer certificate? I believe this
hasn't been tested in a long while...
2003-04-03 18:50:15 +00:00
Richard Levitte
63b6fe2bf6 Conditionalise all debug strings. 2003-04-03 18:07:39 +00:00
Richard Levitte
f85b68cd49 Make it possible to have multiple active certificates with the same
subject.
2003-04-03 16:33:03 +00:00
Bodo Möller
5679bcce07 make RSA blinding thread-safe 2003-04-02 09:50:22 +00:00
Richard Levitte
24692fc5d7 It seems like gcc-drivven shared library building on OpenUnix 8 requires
-shared rather than -G.
2003-04-01 10:59:15 +00:00
Dr. Stephen Henson
4390d66179 Update from stable branch. 2003-03-31 22:29:25 +00:00
Richard Levitte
d678cc07ed No need to test -setalias twice.
PR: 556
2003-03-31 13:56:52 +00:00
Richard Levitte
6dd6da6005 Don't feil when indent is 0.
PR: 559
2003-03-31 13:24:02 +00:00
Richard Levitte
03eeb07152 Add usage string for -fingerprint.
PR: 560
2003-03-31 13:06:24 +00:00
Dr. Stephen Henson
1a15c89988 Multi valued AVA support. 2003-03-30 01:51:16 +00:00
Richard Levitte
d0a4bd00b6 OpenUNIX 8 has some problems using -G with gcc. Maybe using gnu-shared works better (will be tested tonight). 2003-03-28 08:57:04 +00:00
Lutz Jänicke
423b1a840c Add warning about unwanted side effect when calling SSL_CTX_free():
sessions in the external session cache might be removed.
Submitted by: "Nadav Har'El" <nyh@math.technion.ac.il>

PR: 547
2003-03-27 22:04:05 +00:00
Richard Levitte
a47789e849 Update VMS building system 2003-03-26 14:34:38 +00:00
Dr. Stephen Henson
e5b0508a14 Update ocsp usage message and docs. 2003-03-26 00:46:47 +00:00
Richard Levitte
c4d00669a0 Let's limit the extent of the definition of _XOPEN_SOURCE. 2003-03-25 21:17:28 +00:00
Richard Levitte
d6cab100fa Missed a few dollars.
PR: 528
2003-03-25 20:56:06 +00:00
Dr. Stephen Henson
81bd0446a9 make update 2003-03-24 17:06:25 +00:00
Dr. Stephen Henson
520b76ffd9 Support for name constraints. 2003-03-24 17:04:44 +00:00
Dr. Stephen Henson
1c2d141238 Name Constraints OID. 2003-03-24 00:56:09 +00:00
Lutz Jänicke
32e75dd3f0 Add SCO5 shared library scripts.
Upate SVR5 scripts for the upcoming 0.9.7b.
Submitted by: Boyd Lynn Gerber <gerberb@zenez.com>
2003-03-23 10:18:05 +00:00
Richard Levitte
abfc6a3a9b To define OPENSSL_NO_FP_API for all MSDOS type targets was unfair
against DJGPP, and much more restricted than previous definitions.
2003-03-22 22:33:52 +00:00
Dr. Stephen Henson
5cc5ec1bba make update 2003-03-21 16:28:29 +00:00
Dr. Stephen Henson
f80153e20b Support for policy constraints. 2003-03-21 16:26:20 +00:00
Bodo Möller
33b34a9d8f remove patch ID (which is supposed to appear in patched variants of
old OpenSSL releases, but not in new releases)
2003-03-21 13:11:14 +00:00
Richard Levitte
9b94f215b1 Define COMP method function prototypes properly. 2003-03-21 00:05:14 +00:00
Richard Levitte
8b5bcef798 Make sure to declare mem*() properly. 2003-03-21 00:04:14 +00:00
Richard Levitte
ea17e1f00f make update 2003-03-20 23:54:33 +00:00
Richard Levitte
543105ac17 Don't put configuration macro definitions on the command line, we're
just fooling ourselves and then screwing up for other applications.
2003-03-20 23:52:41 +00:00
Richard Levitte
3789284807 Sometimes, we have partial comments on the same line as other stuff we
parse.  Make sure to read in the whole comment, so it can be entirely
removed.
2003-03-20 23:51:35 +00:00
Richard Levitte
be9bec9bc7 Make sure we get the definition of OPENSSL_NO_RSA. 2003-03-20 23:34:28 +00:00
Richard Levitte
9c35452842 Make sure we get the definition of OPENSSL_NO_HMAC and OPENSSL_NO_SHA. 2003-03-20 23:34:08 +00:00
Richard Levitte
69104cdf34 Make sure we get the definition of OPENSSL_NO_SHA. 2003-03-20 23:32:16 +00:00
Richard Levitte
dfefdb41f7 Make sure we get the definition of OPENSSL_NO_RIPEMD. 2003-03-20 23:31:56 +00:00
Richard Levitte
cd6ab56da0 Make sure we get the definition of OPENSSL_NO_MDC2. 2003-03-20 23:31:44 +00:00
Richard Levitte
c988c9b839 Make sure we get the definition of OPENSSL_NO_MD5. 2003-03-20 23:31:34 +00:00
Richard Levitte
bff8e1dddb Make sure we get the definition of OPENSSL_NO_MD4. 2003-03-20 23:31:24 +00:00
Richard Levitte
641e6ef2cb Make sure we get the definition of OPENSSL_NO_MD2. 2003-03-20 23:30:04 +00:00
Richard Levitte
9e9e8cb6a8 Make sure we get the definition of OPENSSL_NO_DES. 2003-03-20 23:29:38 +00:00
Richard Levitte
f118514501 Make sure we get the definition of OPENSSL_NO_RC5. 2003-03-20 23:29:26 +00:00
Richard Levitte
39c4b7092c Make sure we get the definition of OPENSSL_NO_RC4. 2003-03-20 23:29:17 +00:00
Richard Levitte
c7e7fc3ee4 Make sure we get the definition of OPENSSL_NO_RC2. 2003-03-20 23:29:06 +00:00
Richard Levitte
786b0075d5 Make sure we get the definition of OPENSSL_NO_IDEA. 2003-03-20 23:28:55 +00:00
Richard Levitte
fb10590910 Make sure we get the definition of OPENSSL_NO_CAST. 2003-03-20 23:28:27 +00:00
Richard Levitte
abf21308d2 Make sure we get the definition of OPENSSL_NO_BF. 2003-03-20 23:28:16 +00:00
Richard Levitte
8c84b677e2 Make sure we get the definition of OPENSSL_NO_AES. 2003-03-20 23:28:03 +00:00
Richard Levitte
d5ef144222 Make sure we get the definition of a number of OPENSSL_NO_* macros. 2003-03-20 23:27:17 +00:00
Richard Levitte
741dae576f Make sure we get the definition of OPENSSL_NO_BIO. 2003-03-20 23:26:46 +00:00
Richard Levitte
59ade20500 Include e_os.h correctly. 2003-03-20 23:26:32 +00:00
Richard Levitte
c11b9af75e Make sure we get the definition of OPENSSL_NO_MD2. 2003-03-20 23:24:59 +00:00
Richard Levitte
08a54f6e6a Make sure we get the definition of OPENSSL_NO_FP_API. 2003-03-20 23:24:47 +00:00
Richard Levitte
8305477157 Make sure we get the definition of OPENSSL_NO_IDEA and IDEA_INT. 2003-03-20 23:24:32 +00:00
Richard Levitte
e8cc7de4f4 Make sure we get the definition of OPENSSL_NO_HMAC. 2003-03-20 23:23:43 +00:00
Richard Levitte
3b6aa36c77 Make sure we get the definition of OPENSSL_NO_ECDSA. 2003-03-20 23:22:31 +00:00
Richard Levitte
03829b2b47 Make sure we get the definition of OPENSSL_NO_ECDH. 2003-03-20 23:22:17 +00:00
Richard Levitte
87c9c659de Make sure we get the definition of OPENSSL_NO_EC. 2003-03-20 23:22:06 +00:00
Richard Levitte
751ff1d376 Make sure we get the definition of OPENSSL_NO_DSA and OPENSSL_NO_SHA. 2003-03-20 23:21:51 +00:00
Richard Levitte
d3ae5b1c8a Make sure we get the definition of OPENSSL_NO_DH. 2003-03-20 23:21:27 +00:00
Richard Levitte
0f3879455b Make sure we get the definition of OPENSSL_EXTERN, OPENSSL_NO_DES,
DES_LONG and OPENSSL_NO_DESCBCM.
2003-03-20 23:21:10 +00:00
Richard Levitte
0c7d61ee0e Make sure we get the definition of OPENSSL_NO_CAST. 2003-03-20 23:20:15 +00:00
Richard Levitte
78951e7711 Make sure we get the definition of OPENSSL_NO_ERR. 2003-03-20 23:19:41 +00:00
Richard Levitte
9ba4cc007b Make sure we get the definition of OPENSSL_NO_SOCK. 2003-03-20 23:18:32 +00:00
Richard Levitte
7b5a6c7a62 Make sure we get the definition of OPENSSL_NO_FP_API. 2003-03-20 23:17:23 +00:00
Richard Levitte
44deca977d Make sure we get the definition of OPENSSL_NO_BF. 2003-03-20 23:17:04 +00:00
Richard Levitte
536b73e78e Make sure we get the definition of OPENSSL_NO_BIO and OPENSSL_NO_RSA. 2003-03-20 23:16:45 +00:00
Richard Levitte
940767b03f Make sure we get the definition of OPENSSL_NO_AES. 2003-03-20 23:15:51 +00:00
Richard Levitte
d4a47a5778 Because it may be needed in public header files, move the definition
of OPENSSL_NO_FP_API on existence of OPENSSL_SYS_MSDOS to e_os2.h.
2003-03-20 23:14:49 +00:00
Dr. Stephen Henson
b24668626e make update 2003-03-20 17:59:39 +00:00
Dr. Stephen Henson
ea3675b5b6 New ASN1 macros to just implement and declare the new and free functions
and changes to mkdef.pl so it recognises them.

Use these in policyMappings extension.
2003-03-20 17:58:33 +00:00
Bodo Möller
c554155b58 make sure RSA blinding works when the PRNG is not properly seeded;
enable it automatically for the built-in engine
2003-03-20 17:31:30 +00:00
Dr. Stephen Henson
a1d12daed2 Support for policyMappings 2003-03-20 17:26:44 +00:00
Dr. Stephen Henson
6f528cac5a Typo: OID should be policyMappings 2003-03-20 17:14:27 +00:00
Dr. Stephen Henson
10a66ad389 Avoid warning. 2003-03-20 17:09:46 +00:00
Richard Levitte
e986704d24 Add documentation for -starttls (s_client) and -id_prefix (s_server).
PR: 542
2003-03-20 16:34:27 +00:00
Dr. Stephen Henson
ce06265a37 make update 2003-03-20 14:21:36 +00:00
Richard Levitte
439909a068 Some shells (ksh in this case) don't say 'command not found'.
PR: 540
2003-03-20 11:44:28 +00:00
Richard Levitte
d177e6180d Spelling errors.
PR: 538
2003-03-20 11:41:59 +00:00
Richard Levitte
48f1fa7482 Make sure that all the library paths are modified in prepend mode, not
replace mode.
PR: 528
2003-03-20 11:37:47 +00:00
Richard Levitte
aa9d896b0d hinv may generate more than one line (1 line per CPU).
PR: 520
2003-03-20 11:15:12 +00:00
Richard Levitte
42a559163d Shut up an ANSI compiler about uninitialised variables.
PR: 517
2003-03-20 10:57:09 +00:00
Richard Levitte
3285eb336c Add the target linux-ia64-ecc, suggested by Keith Thompson <kst@sdsc.edu>.
PR: 516
2003-03-20 10:50:36 +00:00
Bodo Möller
02da5bcd83 countermeasure against new Klima-Pokorny-Rosa atack 2003-03-19 19:19:53 +00:00
Dr. Stephen Henson
9ed1fa4813 Fix Certificate and CRL adding in X509_load_cert_crl_file:
an X509_INFO structure can contain more than one object,
for example a certififcate and a CRL.
2003-03-19 13:55:48 +00:00
Bodo Möller
500df82a96 fix formatting 2003-03-18 12:52:02 +00:00
Dr. Stephen Henson
e8e0e3716a Fix for no-ec on Windows. 2003-03-15 01:28:55 +00:00
Dr. Stephen Henson
bc441b739b Don't give an error if response reason absent in OCSP HTTP. 2003-03-14 23:38:34 +00:00
Dr. Stephen Henson
e6539fe22d Add entry for domainComponent so it is treated correctly.
Add table order test to end of a_strnid.c
2003-03-14 01:44:42 +00:00
Dr. Stephen Henson
ba5df66a8b Add some OIDs. 2003-03-13 23:37:55 +00:00
Dr. Stephen Henson
12d4e7b8c8 Fix PEDANTIC stuff... 2003-03-13 21:28:03 +00:00
Geoff Thorpe
bba2cb3ada Fix a bone-head bug. This warrants a CHANGES entry because it could affect
applications if they were passing a bogus 'flags' parameter yet having
things work as they wanted anyway.
2003-03-13 20:28:42 +00:00
Dr. Stephen Henson
52c4c51f02 Return an error if gmtime returns NULL. 2003-03-13 14:13:53 +00:00
Dr. Stephen Henson
767712fa62 Avoid warnings for no-engine and PEDANTIC 2003-03-12 02:38:57 +00:00
Dr. Stephen Henson
90e8a3102b Fixes for EVP_DigestInit_ex() and OPENSSL_NO_ENGINE. 2003-03-12 02:31:40 +00:00
Geoff Thorpe
879650b866 The default implementation of DSA_METHOD has an interdependence on the
dsa_mod_exp() and bn_mod_exp() handlers from dsa_do_verify() and
dsa_sign_setup(). When another DSA_METHOD implementation does not define
these lower-level handlers, it becomes impossible to do a fallback to
software on errors using a simple DSA_OpenSSL()->fn(key).

This change allows the default DSA_METHOD to function in such circumstances
by only using dsa_mod_exp() and bn_mod_exp() handlers if they exist,
otherwise using BIGNUM implementations directly (which is what those
handlers did before this change). There should be no noticable difference
for the software case, or indeed any custom case that didn't already
segfault, except perhaps that there is now one less level of indirection in
all cases.

PR: 507
2003-03-11 01:49:21 +00:00
Bodo Möller
176f31ddec - new ECDH_compute_key interface (KDF is no longer a fixed built-in)
- bugfix: in ECDH_compute_key, pad x coordinate with leading zeros if necessary
2003-02-28 15:37:10 +00:00
Bodo Möller
fe14ee96db memset problem has been handled
PR: 343
2003-02-28 15:17:45 +00:00
Bodo Möller
57376542a0 use tabs for indentation, not spaces 2003-02-28 15:07:10 +00:00
Dr. Stephen Henson
b8dc9693a7 Encryption BIOs misbehave when used with non blocking I/O.
Two fixes:

1. If BIO_write() fails inside enc_write() it should return the
   total number of bytes successfully written.

2. If BIO_write() fails during BIO_flush() it should return immediately
   with the error code: previously it would fall through to the final
   encrypt, corrupting the buffer.
2003-02-27 14:07:59 +00:00
Dr. Stephen Henson
6ac26a5ce5 Typo. 2003-02-27 13:02:46 +00:00
Bodo Möller
155bd1137e add Certicom licensing e-mail address 2003-02-27 12:25:35 +00:00
Dr. Stephen Henson
f0dc08e656 Support for dirName from config files in GeneralName extensions. 2003-02-27 01:54:11 +00:00
Dr. Stephen Henson
e9ec63961b Fix indefinite length encoding so EOC correctly updates
the buffer pointer.

Rename PKCS7_PARTSIGN to PKCS7_STREAM.

Guess what that's for :-)
2003-02-25 19:03:31 +00:00
Bodo Möller
0185803cc2 year 2003 2003-02-24 17:18:01 +00:00
Bodo Möller
5c9a9c9c33 include OpenSSL license (in addition to EAY license) 2003-02-24 17:15:28 +00:00
Ulf Möller
63ff3e83fc Add instructions for building the MinGW target in Cygwin, and
rearrange some of the other text for better readability.
2003-02-22 23:03:42 +00:00
Ulf Möller
b4f43344d5 Copy rather than symlink the test data.
This is needed because Windows doesn't support symlinks.

The Cygwin/MinGW build now passes "make test".
2003-02-22 22:19:48 +00:00
Ulf Möller
c8c5cec1f9 remove some more useless code. The mingw target can now be built
under cygwin.
2003-02-22 22:15:31 +00:00
Ulf Möller
66ecdf3bfb more mingw related cleanups. 2003-02-22 18:00:14 +00:00
Richard Levitte
7841edc9c1 Remove duplication and have clean depend on libclean 2003-02-22 15:04:03 +00:00
Richard Levitte
132eaa59da Allow building applications against static libraries with Makefile.shared. 2003-02-22 14:41:34 +00:00
Dr. Stephen Henson
5562cfaca4 Base64 bio fixes. The base64 bio was seriously broken
when reading from a non blocking BIO.

It would incorrectly interpret retries as EOF, incorrectly
buffer initial data and have no buffering at all after initial
data (data would be sent one byte at a time to EVP_DecodeUpdate).
2003-02-22 02:12:52 +00:00
Ulf Möller
c8252b71b5 add test 2003-02-22 01:20:55 +00:00
Ulf Möller
94949a50aa avoid duplicate definiton of bn_sub_part_words 2003-02-21 23:19:50 +00:00
Ulf Möller
0214893e6a clean up MinGW build. MinGW make now supports the Windows path name
conventions.
2003-02-21 22:59:20 +00:00
Ulf Möller
5be4a42e99 update mingw info 2003-02-21 22:09:52 +00:00
Bodo Möller
f2aa055ec6 treat 'out' like i2d functions do; cf. asn1_item_flags_i2d (crypto/asn/tasn_enc.c) 2003-02-21 16:06:39 +00:00
Bodo Möller
62e3163b1b ECPublicKey_set_octet_string and ECPublicKey_get_octet_string
behaviour was not quite consistent with the conventions
for d2i and i2d functions as far as handling of the 'out'
or 'in' pointer is concerned.

This patch changes this behaviour, and renames the functions to
o2i_ECPublicKey and i2o_ECPublicKey (not 'd2i' and 'i2d' because the
external encoding is just a raw object string without any DER icing).

Submitted by: Nils Larsch
2003-02-21 13:58:23 +00:00
Dr. Stephen Henson
8214e74f76 Ooops forgot to recognise V_ASN1_GENERALSTRING. 2003-02-20 17:13:21 +00:00
Dr. Stephen Henson
542a1b1a2e Re enable the read side non blocking test BIO code.
For some reason it was disabled...
2003-02-20 13:39:30 +00:00
Dr. Stephen Henson
5672e3a321 Fix bug in base64 bios during write an non blocking I/O:
if the write fails when flushing the buffer return the
value to the application so it can retry.
2003-02-20 13:37:48 +00:00
Bodo Möller
fbbfd86b67 typo
PR: 511
Submitted by: Eric Cronin
2003-02-19 16:29:47 +00:00
Richard Levitte
d8cbc93585 Update release information 2003-02-19 14:02:37 +00:00
Richard Levitte
5b0b0e98ce Security fix: Vaudenay timing attack on CBC.
An advisory will be posted to the web.  Expect a release within the hour.
2003-02-19 12:03:59 +00:00
Richard Levitte
d5234c7b3a Make sure the memory allocation routines check for negative sizes 2003-02-19 11:54:42 +00:00
Richard Levitte
77e270d10e Borland C++ Builder 5 complains about unreachable statements. 2003-02-19 11:22:15 +00:00
Dr. Stephen Henson
c893bffae7 Update debub-steve* entries. 2003-02-19 01:04:34 +00:00
Dr. Stephen Henson
988e8458ad Typo. 2003-02-18 12:46:47 +00:00
Richard Levitte
758f942b88 Make the no-err option work properly 2003-02-18 12:14:57 +00:00
Bodo Möller
26e9724458 Remove "+Olibcalls" option from HPUX targets.
Reportedly this option is deprecated, and on some systems
"make test" fails if it is included.

PR: 495
2003-02-16 20:10:23 +00:00
Geoff Thorpe
4879ec7bf3 Session cache implementations shouldn't have to access SSL_SESSION
elements directly, so this missing functionality is required.

PR: 276
2003-02-15 20:38:57 +00:00
Geoff Thorpe
b653327d47 Declare prototypes for function pointer types, even if they are likely to
be cast later on.
2003-02-15 20:32:13 +00:00
Dr. Stephen Henson
4cadedef57 Update docs. 2003-02-15 01:09:55 +00:00
Dr. Stephen Henson
27068df7e0 Single pass processing to cleartext S/MIME signing. 2003-02-15 00:50:55 +00:00
Geoff Thorpe
b12753dffc We cache a montgomery form for 'n' if the PUBLIC flag is set, not PRIVATE.
Also, I've added handling for other mod_exp calls that were not using any
cached montgomery forms. These cases matter only for special RSA keys (eg.
ones that are missing information) so are unlikely to be used in normal
circumstances.
2003-02-15 00:18:38 +00:00
Geoff Thorpe
79221bc265 David Brumley <dbrumley@stanford.edu> noted and corrected a case in the
verification step of CRT private key operations in the RSA code -
previously no montgomery form was checked or used for 'n', and so it would
be generated on the fly each time. As a result, private key operations are
now a percent or two faster.

Rather than adding this as another repetition of the nearly-identical
montgomery "check for first-use" initialisation code blocks, I've taken
this chance to create a helper function and macro-wrapper to replace them.

PR: 475
2003-02-14 23:21:19 +00:00
Bodo Möller
ffa49dc3d9 make update 2003-02-14 14:21:58 +00:00
Richard Levitte
b7bbac72c4 Add support for IA64.
PR: 454
2003-02-14 13:30:35 +00:00
Richard Levitte
c1269c81fd Handle krb5 libraries separately and make sure only libssl.so depends
on it.
2003-02-14 13:12:00 +00:00
Richard Levitte
794a386af3 Update linux-mips and linux-mipsel to support threads and shared libraries.
I also updated the bn_ops field with values taken from OpenBSD-mips.
PR: 498
2003-02-14 08:56:21 +00:00
Richard Levitte
e270cf9c5e Pay attention to disabled SSL versions.
PR: 500
2003-02-14 05:24:22 +00:00
Richard Levitte
7e38616d1f Change no_rmd160 to no_ripemd for consistency.
PR: 500
2003-02-14 05:20:25 +00:00
Richard Levitte
85d686e723 Make it possible to disable OCSP, the speed application, and the use of sockets.
PR: 358
2003-02-14 01:02:58 +00:00
Richard Levitte
2d3de726c5 Add full support for -rpath/-R, both in shared libraries and
applications, at least on the platforms where it's known how
to do it.

Note: this has only been tested on GNU-based platforms (Linux), and
needs to be tested on all others.  Additionally, it's not yet
supported on the following platforms, for lack of information:

Darwin (MacOS X)
Cygwin
OSF1/Alpha
SVR3
ReliantUNIX

Please help out with testing and the platforms we don't yet know well
enough.
2003-02-13 23:52:54 +00:00
Richard Levitte
4989f0599f Another long name to deal with 2003-02-13 13:21:13 +00:00
Richard Levitte
e4b52ac353 Oh, the destest program did look at the return value... 2003-02-13 08:53:40 +00:00
Bodo Möller
abd22c9c46 new lock for EC_PRE_COMP structures
Submitted by: Nils Larsch
2003-02-12 22:01:12 +00:00
Bodo Möller
ba729265a8 Allow EC_GROUP objects to share precomputation for improved memory
efficiency (EC_PRE_COMP objects are now constant once completed).

Extend 'extra_data' API to support arbitrarily many slots (although we
need only one at the moment).

Modify EC internal 'extra_data' API: EC_GROUP_[clear_]free_extra_data
now frees only a single slot (the previous functions are available as
EC_GROUP_[clear_]free_all_extra_data).

Submitted by: Nils Larsch
Reviewed by: Bodo Moeller
2003-02-12 18:30:16 +00:00
Richard Levitte
9ec1d35f29 Adjust DES_cbc_cksum() so the returned value is the same as MIT's
mit_des_cbc_cksum().  The difference was first observed, then verified by
looking at the MIT source.
2003-02-12 17:20:39 +00:00
Dr. Stephen Henson
cf56663fb7 Option to disable SSL auto chain build 2003-02-12 17:06:02 +00:00
Bodo Möller
ea513641d0 comments 2003-02-12 14:17:41 +00:00
Bodo Möller
8537943e8b first section is now "Changes between 0.9.7a and 0.9.8", not "... 0.9.7 and 0.9.8" 2003-02-11 16:42:30 +00:00
Dr. Stephen Henson
a8f5b2ed50 GeneralString support in mini-ASN1 compiler 2003-02-11 14:06:27 +00:00
Dr. Stephen Henson
33075f229e Typo. 2003-02-10 17:52:10 +00:00
Richard Levitte
28f573a28d Make sure memcpy() is properly declared by including string.h. 2003-02-10 11:14:35 +00:00
Bodo Möller
e2c9c91b5b fix EC_GROUP_copy for EC_GFp_nist_method()
Submitted by: Nils Larsch
2003-02-08 19:51:37 +00:00
Bodo Möller
d42d2d1ab6 avoid coredump
Submitted by: Nils Larsch
2003-02-08 19:49:16 +00:00
Bodo Möller
65b254e8c0 remove debugging leftovers 2003-02-08 15:56:05 +00:00
Bodo Möller
82871eaa17 comment 2003-02-07 11:54:57 +00:00
Bodo Möller
24893ca999 typo 2003-02-06 19:32:06 +00:00
Richard Levitte
27a9bf17c7 PKCS#1 has a new RFC, which we do implement 2003-02-06 19:30:06 +00:00
Bodo Möller
37c660ff9b implement fast point multiplication with precomputation
Submitted by: Nils Larsch
Reviewed by: Bodo Moeller
2003-02-06 19:25:12 +00:00
Bodo Möller
772ec4135c typo in WIN16 section
Submitted by: Toni Andjelkovic <toni@soth.at>
2003-02-05 16:54:10 +00:00
Bodo Möller
0e9035ac98 SSL_add_dir_cert_subjects_to_stack now exists for WIN32 2003-02-05 16:40:29 +00:00
Dr. Stephen Henson
4e5d3a7f98 IPv6 display and input support for extensions usingh GeneralName. 2003-02-05 00:34:31 +00:00
Bodo Möller
379e568950 typo 2003-02-04 12:57:34 +00:00
Bodo Möller
c09a297892 Update PRNG entry:
- OpenSSL version differences
- Sun /dev/urandom patch information
2003-02-04 12:28:11 +00:00
Ben Laurie
2619676256 Old-style callbacks can be NULL! 2003-02-01 20:58:59 +00:00
Ben Laurie
33cc07f79a Fix warning. 2003-02-01 20:55:29 +00:00
Richard Levitte
c029841e36 We can't say in advance what the argument to BIO_socket_ioctl() should be, so
let's make that a void *.  Also, BIO_socket_nbio() should send it an int
argument, not a long.
PR: 457
2003-01-31 12:20:35 +00:00
Richard Levitte
bfa3555081 Document -engine where missing.
PR: 424
2003-01-30 22:02:27 +00:00
Richard Levitte
5d780babe3 A few small bugs with BIO popping.
PR: 364
2003-01-30 21:49:12 +00:00
Richard Levitte
5cd48abf9f The util scripts need to handled no-hw.
PR: 327
2003-01-30 20:03:45 +00:00
Richard Levitte
db5006df04 The MASM situation is more difficult than described so far. It is part of VC++ 7.
PR: 327
2003-01-30 19:05:25 +00:00
Richard Levitte
3d6a84c42a For VC++7 and up, the file is VSVARS32.BAT.
PR: 327
2003-01-30 19:01:56 +00:00
Richard Levitte
5fe11c7533 The OPENSSL_NO_ENGINE has small problem: it changes certain structures. That's
bad, so let's not check OPENSSL_NO_ENGINE in those places.  Fortunately, all
the header files where the problem existed include ossl_typ.h, which makes
a 'forward declaration' of the ENGINE type.
2003-01-30 18:52:46 +00:00
Richard Levitte
a1d57849b3 make update 2003-01-30 17:53:02 +00:00
Richard Levitte
0b13e9f055 Add the possibility to build without the ENGINE framework.
PR: 287
2003-01-30 17:39:26 +00:00
Geoff Thorpe
96f7065f63 Summarise the last couple of commits. 2003-01-30 15:52:40 +00:00
Geoff Thorpe
f3c22ef10d This glues the GMP wrapper ENGINE into OpenSSL if it is being built (ie. if
the OPENSSL_USE_GMP symbol is defined). Also, I've re-ordered the listing
of other builtin ENGINEs to be alphabetical (though "dynamic" will still
come first).
2003-01-30 15:49:03 +00:00
Geoff Thorpe
a85bef1899 Commit a slightly modified version of an old experiment to do RSA private
key operations using the GMP library. The default is not to build (or use)
this code unless OPENSSL_USE_GMP is defined (because it will impose header
and linker dependencies that might need specifying too).
2003-01-30 15:43:07 +00:00
Geoff Thorpe
bb3e67f315 "openssl engine" will not display ENGINE/DSO load failure errors when
testing availability of engines with "-t" - the old behaviour of is
produced by increasing the feature's verbosity with "-tt".
2003-01-30 14:58:44 +00:00
Richard Levitte
c0a93e31ab Small typo, OENSSL should really be spelled OPENSSL.
PR: 476
2003-01-30 11:08:44 +00:00
Richard Levitte
2e60ea7634 Fix a memory leak in SSL.
PR: 477
2003-01-30 11:00:34 +00:00
Richard Levitte
4e78074b39 cert_sk isn't always allocated, so freeing it may cause a crash.
PR: 481
2003-01-30 10:27:43 +00:00
Richard Levitte
b637670f03 DVCS (see RFC 3029) was missing among the possible purposes.
Notified privately to me by Peter Sylvester <Peter.Sylvester@EdelWeb.fr>,
one of the authors of said RFC
2003-01-29 15:06:35 +00:00
Bodo Möller
bd1217a176 simplify
Submitted by: Nils Larsch
2003-01-28 13:08:21 +00:00
Dr. Stephen Henson
da45180de4 Correct EVP_SealInit() documentation, iv is an output
parameter.
2003-01-26 13:38:56 +00:00
Bodo Möller
82516e3baf cofactor is optional in parameter encodings
Submitted by: Nils Larsch
2003-01-25 15:28:49 +00:00
Bodo Möller
c1862f9136 consistency 2003-01-24 22:28:32 +00:00
Bodo Möller
9048c7245b For ecdsa-with-SHA1, as for id-dsa-with-sha1, omit 'parameters'
in AlgorithmIdentifier

Submitted by: Nils Larsch
2003-01-24 21:43:08 +00:00
Andy Polyakov
02bf9a151a Provide "dummy" &main::picmeup even in Windows perlasm modules. 2003-01-24 09:39:31 +00:00
Dr. Stephen Henson
d3b5cb5343 Check return value of gmtime() and add error codes
where it fails in ASN1_TIME_set().

Edit asn1.h so the new error code is the same in 0.9.7
and 0.9.8, rebuild new error codes.

Clear error queue in req.c if *_min or *_max is absent.
2003-01-24 01:12:01 +00:00
Andy Polyakov
97e6bf6b22 Workaround for lame compiler bug introduced in "CPU pack" for MSVC6SP5. 2003-01-23 10:05:39 +00:00
Andy Polyakov
04da4558dd The patch speaks for itself. 2003-01-23 09:52:34 +00:00
Richard Levitte
0c3426da86 Missing 0 broke FreeBSD build.
PR: 470
2003-01-23 08:10:04 +00:00
Bodo Möller
9b3f03d5a2 fix warnings
Submitted by: Nils Larsch
2003-01-21 09:53:14 +00:00
Andy Polyakov
9abff96b2f Suggestion was to change ${MACHINE} to i586 in lines in question. Well,
"whatever" doesn't the same (avoids 386 being passed to ./Configure),
consistent with other elder SCO targets and denotes that we probably
shouldn't care much about every out-of-date platform.
2003-01-19 21:47:06 +00:00
Andy Polyakov
722d17cbac This is an *initial* tune-up. This update puts Itanium2 back on par with
Itanium. I mean if overall performance improvement over C version was X
for Itanium, it's X even for Itanium2.
2003-01-19 21:29:59 +00:00
Andy Polyakov
59b846c515 Oops! Missed closing quote... Didn't have time to verify before a snapshot
was cut...
2003-01-19 11:39:19 +00:00
Andy Polyakov
42bf2a5cdc SCO target missed .so suffix. 2003-01-18 21:57:30 +00:00
Andy Polyakov
80bcbaa02f -lresolv is not present on SCO Unix, RT#460. 2003-01-18 18:12:23 +00:00
Andy Polyakov
7c4e24af38 Caldera/SCO targets erroneously limit themselves to 386. See RT#464. 2003-01-18 15:17:26 +00:00
Andy Polyakov
726c223143 Fix for AIX shared build, see RT#463. 2003-01-18 15:13:03 +00:00
Dr. Stephen Henson
59ae8c9419 EVP_DecryptInit() should call EVP_CipherInit() not EVP_CipherInit_ex(). 2003-01-17 00:48:47 +00:00
Richard Levitte
0bdd2da5d2 Ingore the correct flag file. 2003-01-16 21:36:17 +00:00
Richard Levitte
2f09524501 A few more files to ignore 2003-01-16 21:32:56 +00:00
Richard Levitte
06492aef01 make update 2003-01-16 21:20:30 +00:00
Richard Levitte
c00cee00fd FreeBSD has /dev/crypto as well.
PR: 462
2003-01-16 18:29:30 +00:00
Richard Levitte
8228f302dd Add some debugging output. 2003-01-16 17:28:46 +00:00
Lutz Jänicke
018c56fdca Armor against systems without ranlib...
Submitted by: Thierry Lelegard <thierry.lelegard@canal-plus.fr>

PR: 461
2003-01-16 17:22:30 +00:00
Bodo Möller
d745af4b0c avoid potential confusion about curves (prime192v1 and prime256v1 are
also known as secp192r1 and secp256r1, respectively)

Submitted by: Nils Larsch, Bodo Moeller
2003-01-16 16:05:23 +00:00
Richard Levitte
44ea41cfff make update 2003-01-16 13:01:36 +00:00
Lutz Jänicke
acad5755a2 ncr-scde target needs -lc89 for strcasecmp() and ftime() (Tim Rice, Martin
Megele).

PR: 450
2003-01-16 07:54:52 +00:00
Richard Levitte
28b958f732 Fix possible NULL dereferencial.
Notified by Verdon Walker <VWalker@novell.com>
2003-01-16 06:00:55 +00:00
Richard Levitte
4e59cd3bb6 Add verbosity 2003-01-15 17:23:16 +00:00
Lutz Jänicke
a74333f905 Fix initialization sequence to prevent freeing of unitialized objects.
Submitted by: Nils Larsch <nla@trustcenter.de>

PR: 459
2003-01-15 14:54:59 +00:00
Bodo Möller
365e14622a update error library for EC... changes
Submitted by: Nils Larsch
2003-01-15 11:47:28 +00:00
Lutz Jänicke
8ec16ce711 Really fix SSLv2 session ID handling
PR: 377
2003-01-15 09:51:22 +00:00
Geoff Thorpe
0e4aa0d2d2 As with RSA, which was modified recently, this change makes it possible to
override key-generation implementations by placing handlers in the methods
for DSA and DH. Also, parameter generation for DSA and DH is possible by
another new handler for each method.
2003-01-15 02:01:55 +00:00
Dr. Stephen Henson
08cb96bba2 Set EXPORT_VAR_AS_FN for BC-32 to work around a compiler bug, 2003-01-14 20:54:18 +00:00
Richard Levitte
cdc5b4a41e Extend the HOWTO on creating certificates, and add a HOWTO in creating keys.
PR: 422
2003-01-14 15:42:16 +00:00
Lutz Jänicke
52e5e5c2ba Document hpux-parisc2-cc problems, probably due to optimizer bug.
PR: 426
2003-01-14 13:57:06 +00:00
Richard Levitte
c653b56937 Correct an example that has a few typos.
PR: 458
2003-01-14 13:56:38 +00:00
Richard Levitte
04aff67de4 Merge from 0.9.7-stable. 2003-01-13 17:16:25 +00:00
Andy Polyakov
1a6356b2ca Minor FAQ update 2003-01-13 16:34:05 +00:00
Bodo Möller
b05645902a "!Cname surname" has now become redundant ... 2003-01-13 15:57:33 +00:00
Bodo Möller
54d4f8c320 undo part of a recent change: it's "surname", not "surName"
(see X.520 aka ISO/IEC 9594-6)
2003-01-13 15:52:04 +00:00
Richard Levitte
c76153f31d Make sure not to declare a clashing read() for DJGPP.
PR: 440
2003-01-13 15:35:22 +00:00
Richard Levitte
8cbb91c857 DJGPP doesn't have DLLs, so skip adding to %PATH% in that environment.
PR: 453
2003-01-13 15:16:40 +00:00
Bodo Möller
aaae0aa48b add something to the '$no_shared_warn' text 2003-01-13 14:58:49 +00:00
Richard Levitte
0535d3b25f Correct a misleading comment.
PR: 456
2003-01-13 14:53:43 +00:00
Richard Levitte
62be003150 Revert: the names of the cygwin distribution will not be named openssl2-*.
Requested by Corinna Vinschen <vinschen@redhat.com>
2003-01-13 14:47:52 +00:00
Richard Levitte
364c7cd621 UI_UTIL_read_pw() misinterpreted the values returned from UI functions.
PR: 456
2003-01-13 14:17:43 +00:00
Bodo Möller
9d5390a049 document BN_GENCB API by adding an example 2003-01-13 13:44:20 +00:00
Bodo Möller
bda2fa364d Typo.
NB: This and other manual pages should be updated for the new
BN_GENCB interface.
2003-01-13 13:18:22 +00:00
Richard Levitte
caa7b2ad4f tty_in will never be stderr, so it will always be closed, which means stdin
might get closed...
Reported by Mark Daniel <Mark.Daniel@wasd.vsm.com.au>
2003-01-13 13:15:16 +00:00
Bodo Möller
c14b4d6b38 typo 2003-01-13 12:52:33 +00:00
Andy Polyakov
0382c95e4d OpenBSD FAQ update. Apparently gas from binutils-2.x makes it impossible to
use gcc -fPIC ... on OpenBSD-i386. Alternative solution is provided.
2003-01-12 21:39:13 +00:00
Andy Polyakov
fda20f08d0 Just an extra comment. 2003-01-12 15:50:59 +00:00
Richard Levitte
afd41c9fc7 Add better support for FreeBSD on non-x86 machines.
Add specific support for FreeBSD on sparc64.
PR: 427
2003-01-12 04:43:44 +00:00
Richard Levitte
2964ba8c6a If the user said 'shared' and we haven't included support for shared libraries,
warn him or her.
Reminder by Andrew Marlow <apm35@student.open.ac.uk>
2003-01-11 11:40:39 +00:00
Richard Levitte
c0cc5c3059 Double the dollars that are intended for the command line.
PR: 423
2003-01-10 16:32:32 +00:00
Richard Levitte
e68cb95d84 Add documentation on how to handle the shared libaries.
PR: 423
2003-01-10 16:14:32 +00:00
Richard Levitte
448666239c Name the flag file correctly 2003-01-10 16:04:07 +00:00
Richard Levitte
c0ac323360 CFLAG, not CFLAGS 2003-01-10 11:30:44 +00:00
Richard Levitte
a0cd3ca62b It's recommended to do 'make clean' after having prepared a new build tree.
PR: 437
2003-01-10 11:00:50 +00:00
Richard Levitte
4a9476dd8d When preparing a separate build tree, don't make softlinks to softlinks.
Add instructions in INSTALL, for easy access.
PR: 437
2003-01-10 10:56:14 +00:00
Richard Levitte
8d2511688d Force the removal.
PR: 437
2003-01-10 10:54:59 +00:00
Richard Levitte
969511d2cb Certain files must be removed before generating them, in case they point
into a read-only source tree.
PR: 437
2003-01-10 10:54:18 +00:00
Andy Polyakov
989f48d8c1 Avoid unnecessary pollution of object module name table. Cygwin shared
build workaround (DJGPP swallows it too). One probably should do same
as with ELF calling it COFF, but I'm very short in COFF platforms, so
I just go for easy ad-hoc solution. I'll take care of merge to 0.9.7
later.
2003-01-10 10:16:39 +00:00
Richard Levitte
f8ea5cb579 Make sure everything that may be freed is allocated or initiated.
PR: 446
2003-01-10 08:59:46 +00:00
Richard Levitte
360e506710 Typos corrected.
PR: 445
2003-01-10 08:54:01 +00:00
Dr. Stephen Henson
09ad2458b8 Typo. 2003-01-09 16:54:21 +00:00
Richard Levitte
ad200a864e The naming scheme wasn't quite correct for Cygwin 2003-01-09 16:15:46 +00:00
Andy Polyakov
9d1b5614f9 At least OpenBSD implements PIC in the same way ELF does. 2003-01-09 16:06:09 +00:00
Richard Levitte
416b19c6fc gcc wants character constants to be correct. Before this change, the
following would happen on Solaris:

  m4 -B 8192 asm/des_enc.m4 > asm/des_enc-sparc.S
  gcc -DOPENSSL_SYSNAME_ULTRASPARC -DOPENSSL_NO_STATIC_ENGINE -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_KRB5 -m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DMD5_ASM   -c -o asm/des_enc-sparc.o asm/des_enc-sparc.S
  asm/des_enc-sparc.S:2007: unterminated character constant
  asm/des_enc-sparc.S:2008: unterminated character constant
2003-01-09 13:25:14 +00:00
Dr. Stephen Henson
5b7249f302 NULL tofree when it is freed to avoid double free.
Make sure key is not NULL before freeing it.
2003-01-09 13:06:49 +00:00
Andy Polyakov
699543e4a2 Finalizing asm support for UnixWare, SCO, OpenUnix... Note that I've
replaced #if logic around bn_sub_part_words in bn_mul.c. I rely upon
OPENSSL_BN_ASM_PART_WORDS being added by ./Configure script. Would it
still work on non-Unix platforms?
2003-01-09 08:42:04 +00:00
Lutz Jänicke
4309c4ad46 Third argument to shl_load() is "long address", not a pointer.
(Didn't influence functionality, as on HP-UX 32bit the NULL pointer
is a 32bit 0-value and thus is identical to the required 0L.)

PR: 443
2003-01-08 08:27:50 +00:00
Geoff Thorpe
4ebb5293fc RSA_METHOD now supports key-generation, but (for now) none of these
ENGINEs implement it.
2003-01-07 05:53:58 +00:00
Geoff Thorpe
2814c62915 This is the first step in allowing RSA_METHODs to implement their own key
generation. This prototype matches the new API function
RSA_generate_key_ex(), though both may be subject to change during
development before 0.9.8.
2003-01-07 05:51:39 +00:00
Dr. Stephen Henson
876e96fdbf Fix leak. 2003-01-04 18:25:24 +00:00
Andy Polyakov
f68843e3d7 Fix a typo. 2003-01-04 15:18:00 +00:00
Andy Polyakov
19a97a1df0 Another GAS fix-up and some commentary... 2003-01-04 14:41:09 +00:00
Andy Polyakov
72997517b0 GAS can't stand stub, which is stb's synonym. 2003-01-04 12:49:38 +00:00
Andy Polyakov
2a9fca82d2 Oops! I've toasted Cygwin! Fixed now. 2003-01-03 21:49:49 +00:00
Andy Polyakov
55b1516770 Redundant now as it's moved to ./Makefile.org. 2003-01-03 20:45:59 +00:00
Andy Polyakov
3cc9a89dda Unified targets for ELF assembler modules. Tested on Linux, Solaris and
FreeBSD. Goal is to extend support even to SCO5, UnixWare/OpenUnix...
2003-01-03 17:37:53 +00:00
Andy Polyakov
46a0d4fbcb Support for ILP32 on HPUX-IA64. 2003-01-03 15:10:46 +00:00
Andy Polyakov
04945fda66 pa-risc2.s was not PIC, see RT#426. I strip call to fprintf as it's
never called anyway (it's a debugging assertion). If pa-risc2W.s is
PIC remains to be seen...
2003-01-03 10:52:40 +00:00
Andy Polyakov
97e2e71ef9 HP/UX 11i make gets upset by this line containing nothing but a Tab 2003-01-03 10:32:04 +00:00
Richard Levitte
c8a647846c Rijndael should be called AES everywhere 2003-01-03 08:51:45 +00:00
Andy Polyakov
90ce14cd84 Support for Intel compiler. More details will be provided in closing note
for RT#17 as snapshot becomes available for download.
2003-01-02 23:32:24 +00:00
Andy Polyakov
28e276f139 Complete integration of SPARC assembler DES implementation. Tested on Solaris
only. I'll keep my eyes open for Linux and OpenBSD targets.
2003-01-02 23:26:46 +00:00
Andy Polyakov
f22e1e4dd2 UltraSPARC assembler DES implementation tune-up. The code can be
compiled for any SPARC CPU (UltraSPARC performance is *not* affected),
can be compiled for 64-bit ABI and is position-independent.
2003-01-02 17:40:33 +00:00
Andy Polyakov
e0d769caa2 Very old submission (from 2000) of UltraSPARC assembler DES implementation.
It was not accepted because code is not PIC, too UltraSPARC-specific when
it doesn't have to and 32-bit only. I'm committing the original version
mostly for reference purposes. 64, PIC, blended CPU tune-up follows shortly.
Obtained from: http://inet.uni2.dk/~svolaf/des.htm
2003-01-02 17:36:26 +00:00
Andy Polyakov
4a37c48789 I implemented this when troubleshooting performance problem on SPARC Solaris.
As there is an apparent interest for optimization for footprint, I figured
that this can eventually become useful.
2003-01-02 17:19:05 +00:00
Richard Levitte
ad492c3601 Link engines against libcrypto, even when a TCP/IP implementation is
specified...
2003-01-02 00:26:01 +00:00
Richard Levitte
0c055b201e Adjust the parameter lists in some not commonly used files.
PR: 428
2003-01-01 23:41:46 +00:00
Richard Levitte
7eed0fc041 Make sure the last character of the ASN.1 time string (the 'Z') is copied.
PR: 429
2003-01-01 03:40:59 +00:00
Richard Levitte
7a1c6aa2a3 It's rather silly to believe we'd release 0.9.7a in 2002 :-).
It's even more silly to pretend we know which year 0.9.8 will be
released.
2002-12-31 01:00:06 +00:00
Richard Levitte
948dcdb81b Merge in changes from 0.9.7-stable. 2002-12-31 00:02:10 +00:00
Richard Levitte
08101d72ce Merge in changes from 0.9.7-stable. 2002-12-30 23:56:09 +00:00
Andy Polyakov
75c4028585 My English is definitely not good as my assembly skills:-) And it looks like
titles can't be multi-line...
2002-12-30 20:17:20 +00:00
Andy Polyakov
85f258d1c2 It probably belongs in PROBLEMS, but it's more likely to be a FAQ. 2002-12-30 11:10:03 +00:00
Richard Levitte
49be7042dc Since we're including Kerberos 5 headers in our exported header files (when
OpenSSL is configured to use Kerberos), we'd better tell pkg-config users
where they can be found.
PR: 421
2002-12-29 23:03:12 +00:00
Lutz Jänicke
44fcd3ef3e Add information about AES cipher suites to ciphers manual page.
If no authentication method is mentioned in the cipher suite name (e.g.
AES128-SHA), RSA authentication is used (PR #396).
2002-12-29 21:24:50 +00:00
Lutz Jänicke
21cde7a41c Fix wrong handling of session ID in SSLv2 client code.
PR: 377
2002-12-29 20:59:35 +00:00
Ben Laurie
8598289936 Correct asm exclusions. 2002-12-29 17:57:09 +00:00
Richard Levitte
35dde7480f OS/2 does binary by default, apparently.
Reported by Brian Havard <brianh@kheldar.apana.org.au>.
2002-12-29 10:19:58 +00:00
Richard Levitte
5e42f9ab46 make update 2002-12-29 01:38:15 +00:00
Richard Levitte
7acf00a633 Finally get rid of all the algorithm inclusions that were done from
evp.h.

Application authors BEWARE!  If you have had the habit to count on
evp.h to provide all those lower-level algorithm functions, you need
to think again!  Please change your programs NOW, or you will be sorry
when 0.9.8 gets release (it's quite some time away...).
2002-12-29 01:37:35 +00:00
Richard Levitte
69339d254b make update 2002-12-28 02:42:05 +00:00
Richard Levitte
ec517d25e8 Merge from 0.9.7-stable. 2002-12-28 02:41:17 +00:00
Andy Polyakov
ce9b1b0573 I can't confirm the claim being removed and nobody seems to speak up for it. 2002-12-27 15:04:45 +00:00
Andy Polyakov
0a2407a851 UltraSPARC performance "tune-up." 2002-12-27 14:51:49 +00:00
Andy Polyakov
76a03d568e FAQ addenum as discussed in RT#417. 2002-12-27 14:27:48 +00:00
Richard Levitte
7c03f26393 Kenneth R. Robinette just told me the latest snapshot works well with
MIT Kerberos.
2002-12-27 14:01:40 +00:00
Richard Levitte
9ff9e406ea Can't find the referense to errors on XP with Kerberos 2002-12-27 08:09:08 +00:00
Richard Levitte
b5beb13abb Add SPKM among the related stanrds. 2002-12-26 22:35:04 +00:00
Richard Levitte
ceb12d3074 Updates 2002-12-26 22:25:02 +00:00
Richard Levitte
59c0dd56ab Update our list of implemented and related standards. 2002-12-26 00:21:53 +00:00
Richard Levitte
dcf19c173c Update our list of implemented and related standards. 2002-12-26 00:17:46 +00:00
Richard Levitte
e235000169 Spelling error.
This patch was taken from the OpenBSD copy of OpenSSL 0.9.7 beta3 with patches
2002-12-25 22:16:56 +00:00
Richard Levitte
821951b851 Avoid double definition of config.
PR: 420
2002-12-24 23:53:46 +00:00
Richard Levitte
35ba1f17dc Updates 2002-12-24 23:52:07 +00:00
Lutz Jänicke
ea8e0cc7c2 Some more adjustments
Submitted by: Jeffrey Altman <jaltman@columbia.edu>, "Kenneth R. Robinette" <support@securenetterm.com>
2002-12-24 21:55:57 +00:00
Richard Levitte
cb661c56b0 Cygwin needs the library locatin for .DLLs to be set in PATH. Unfortunately,
the conditional was set to add the library directory to PATH when the
platform is NOT Cygwin.  Corrected.
PR: 404
2002-12-24 10:50:11 +00:00
Richard Levitte
e904bd0ddc All VMS-specific problems have been solved.
Confirmed by Mark Daniel <Mark.Daniel@wasd.vsm.com.au>
2002-12-24 10:38:05 +00:00
Richard Levitte
e9883d285d Finally, a bn_div_words() in VAX assembler that goes through all tests.
PR: 413
2002-12-23 11:25:51 +00:00
Richard Levitte
8d6ad9e39d Stop a possible memory leak.
(I wonder why s2_connect() handles the initial buffer allocation slightly
differently...)
PR: 416
2002-12-21 23:49:21 +00:00
Richard Levitte
aa18245f7e Make AES_ENCRYPT and AES_DECRYPT macros instead of static constants.
PR: 411
2002-12-20 18:21:35 +00:00
Andy Polyakov
316bfb77b5 Fix for "shift count too large" when compiling for hpux-parisc2 and
irix-mips. The bug was introduced with accelerated support for x86_64.
My fault! Fixed now.
2002-12-20 18:11:30 +00:00
Richard Levitte
9b58214e4a More accurate comments. 2002-12-20 16:38:36 +00:00
Richard Levitte
3c801fa460 A little debugging. 2002-12-20 16:38:06 +00:00
Richard Levitte
1c9202004b Propagate MAKEDEPPROG to the subdirs under crypto/. 2002-12-20 15:28:42 +00:00
Lutz Jänicke
1004c99c29 Fix Kerberos5/SSL interaction
Submitted by: "Kenneth R. Robinette" <support@securenetterm.com>
Reviewed by:
PR:
2002-12-20 12:48:00 +00:00
Richard Levitte
c9ecb1edd8 Keep the internal lowercase 'surname', for programmer's sake. 2002-12-20 09:39:34 +00:00
Richard Levitte
8baf5fdca0 Be consistent with capitalisation of object names. 2002-12-20 09:24:17 +00:00
Richard Levitte
aafafa314d Be consistent with capitalisation of object names. 2002-12-20 09:18:18 +00:00
Richard Levitte
49e42a1f60 There was a mixup between INSTALLTOP and OPENSSLDIR... 2002-12-20 07:51:03 +00:00
Richard Levitte
9cd16b1dea We stupidly had a separate LIBKRB5 variable for KRB5 library dependencies,
and then didn't support it very well.  And that when there already is a
useful variable for exactly this kind of thing; EX_LIBS...
2002-12-19 22:10:12 +00:00
Richard Levitte
12cd28258d Because the contents of openssl.pc may have to change when a configuration
has been performed (and possibly changed), have it depend on Makefile.ssl.
2002-12-19 21:56:40 +00:00
Richard Levitte
9564997222 Small tweaks for code consistency. 2002-12-19 21:55:48 +00:00
Richard Levitte
f968059c67 To avoid any future programming glitches, let's make each and every
assignment (modulo those I missed) individual statements.
2002-12-19 21:13:29 +00:00
Richard Levitte
0b900a5e93 I have no idea what possesed me to compile s_socket.c as POSIXly code.
Incidently, it now compiles so much better without _POSIX_C_SOURCE.
2002-12-19 19:42:53 +00:00
Richard Levitte
09867a47a4 If _XOPEN_SOURCE_EXTENDED or _XOPEN_SOURCE are defined, _POSIX_C_SOURCE gets
defined in DECC$TYPES.H.  If _POSIX_C_SOURCE is defined, certain types do
not get defined (u_char, u_int, ...).  DECC.H gets included by assert.h
and others.  Now, in6.h uses the types u_char, u_int and so on, and gets
included as part of other header inclusions, and will of course fail because
of the missing types.

On the other hand, _XOPEN_SOURCE_EXTENDED is needed to get gethostname()
properly declared...

Solution: define _XOPEN_SOURCE_EXTENDED much later, so DECC$TYPES.H has
a chance to be included *first*, so the otherwise missing types get defined
properly.

Personal: *mumble* *mumble*
2002-12-19 19:39:30 +00:00
Richard Levitte
9d5c42b61b It was pointed out to me that .pc files are normally stored in
${prefix}/lib/pkgconfig, not ${prefix}/lib/pkginfo.
2002-12-19 17:44:42 +00:00
Richard Levitte
8e7a8b68d2 It was pointed out to me that .pc files are normally stored in
${prefix}/lib/pkgconfig, not ${prefix}/lib/pkginfo.
2002-12-19 17:42:23 +00:00
Richard Levitte
4d625031a5 Update the current status 2002-12-18 10:24:02 +00:00
Andy Polyakov
26a60b2eb0 Better wording? 2002-12-18 09:42:51 +00:00
Andy Polyakov
07d09fdb66 Fix for RT#405, Solaris refuses to invoke preprocessor if egrep returns 1.
Linux for example doesn't exhibit this behaviour, but I add "exit 0" to all
potentially affected rules, just to be on the safe side.
2002-12-18 09:03:48 +00:00
Andy Polyakov
4553ed276b Make "perl des-586.pl a.out" work, see RT#402 2002-12-17 08:05:49 +00:00
Andy Polyakov
62966f3829 'a=b c=$a; echo $c' doesn't necessarily prints "b", '' vs. "", $s in
Makefiles... I suppose it wasn't tested very much...
2002-12-16 23:35:17 +00:00
Richard Levitte
c445142505 Transfer the Solaris shared library building changes from
0.9.7-stable.
2002-12-16 20:33:38 +00:00
Richard Levitte
f70ddce761 Protect loading routines with a lock.
PR: 373
2002-12-16 06:06:03 +00:00
Richard Levitte
e29246cb17 Synchronise with Makefiles. 2002-12-15 20:59:24 +00:00
Andy Polyakov
146e6776f5 Always forget this one... 2002-12-15 16:01:21 +00:00
Andy Polyakov
a45051fbfc DES PIC-ification. "Cygwin" companion. Problem was that preprocessor macro
is not expanded if prepended with a $-sign.
2002-12-15 10:06:27 +00:00
Richard Levitte
ec9f67f610 Make sure manual pages are properly linked to on systems that have case
insensitive file names, as well as those that do not have symlinks.
Incidently, both these cases apply on DOS/Windows...
2002-12-15 06:45:43 +00:00
Richard Levitte
30c08f2e3d Update the make system for installations:
- define a HERE variable to indicate where the source tree is (used
  very little right now)
- make more use of copying and making attribute changes to {file}.new,
  and then move it to {file}
- use 'mv -f' to avoid all those questions to the user when the file
  in question doesn't have write attributes for that user.
2002-12-15 05:59:13 +00:00
Richard Levitte
9f100cf344 Don't define macros in terms of asm() when __STRICT_ANSI is defined. 2002-12-15 05:54:56 +00:00
Richard Levitte
a5a01e9051 Bring des_locl.h at the same level as in the 0.9.7 branch.
Don't define macros in terms of asm() when __STRICT_ANSI is defined.
2002-12-15 05:54:26 +00:00
Andy Polyakov
6be4688bdc Ooops! No ROTATE on some platforms after x86_64 performance patch... 2002-12-15 00:47:47 +00:00
Andy Polyakov
717c5cdcc7 As you might have noticed I tried to change for . prefix, because it's
the one to be used to denote local labels in single function scope.
Problem is that SHA uses same label set across functions, therefore I
have to switch back to $ prefix.
2002-12-14 23:14:00 +00:00
Andy Polyakov
0654bba39f Solaris shared build fix-ups. See RT#238,239 for details. 2002-12-14 21:46:46 +00:00
Andy Polyakov
4d77d5b316 New DETECT_GNU_LD procedure. 2002-12-14 20:52:19 +00:00
Andy Polyakov
2f98abbcb6 x86_64 performance patch. 2002-12-14 20:42:05 +00:00
Andy Polyakov
270fa8aeda DES PIC-ification. Windows companion. 2002-12-14 17:54:30 +00:00
Geoff Thorpe
4329db3726 The ampersand is not required in these constructs, and was giving AIX
warnings.

Reported by: Bernhard Simon.
2002-12-13 22:01:46 +00:00
Andy Polyakov
6f7ac8e1b0 IA-32 assembler modules (primarily DES) PIC-ification. Idea is to keep
shared libraries shared.
2002-12-13 17:56:14 +00:00
Richard Levitte
a1457874c6 OK, there's at least one application author who has provided dynamic locking
callbacks
2002-12-13 07:30:53 +00:00
Richard Levitte
18be6c4116 BIO_new_bio_pair() was unnecessarily described in it's own page as well as in
BIO_s_bio.pod.  The most logical is to move everything needed from
BIO_new_bio_pair.pod to BIO_s_bio.pod (including the nice example)
and toss BIO_new_bio_pair.pod.  I hope I got all the info over properly.
PR: 370
2002-12-12 22:12:02 +00:00
Richard Levitte
dad1535f7a BIO_set_nbio() is enumerated, but not explained. Remove it from enumeration
since it's both enumerated and explained in BIO_s_connect.pod.
PR: 370
2002-12-12 22:08:49 +00:00
Richard Levitte
f60e6604b8 I forgot one item I intend to work on. 2002-12-12 19:40:55 +00:00
Richard Levitte
0d3f2ccb62 Skip DH-specific tests when no-dh has been configured.
PR: 353
2002-12-12 18:43:10 +00:00
Richard Levitte
14676ffcd6 Document the modifications in 0.9.7 that will make the hw_ncipher.c
engine work properly even in bad situations.
2002-12-12 17:40:15 +00:00
Geoff Thorpe
e5a08ce44d Make 'tunala' link with zlib if possible (so it works if openssl was
configured with zlib support).
2002-12-11 19:07:03 +00:00
Richard Levitte
b9b6e14b4a In CRYPTO_lock(), check that the application cares about locking (provided
callbacks) before attempting to lock.
2002-12-11 08:56:35 +00:00
Richard Levitte
442d42300b sk_*_push() returns the number of items on the stack, not the index of the
pushed item.  The index is the number of items - 1.  And if a NULL item was
found, actually use it.
Finally, provide a little bit of safety in CRYPTO_lock() by asserting the a
requested dynamic lock really must exist, instead of just being silent about it
2002-12-11 08:33:31 +00:00
Richard Levitte
75e1c74724 Let's not forget the other places where HEADER_DES_H and HEADER_DES_OLD_H
were defined.
2002-12-11 07:37:54 +00:00
Richard Levitte
5db2b5e573 Let's not forget the other places where HEADER_DES_H and HEADER_DES_OLD_H
were defined.
2002-12-11 07:24:43 +00:00
Richard Levitte
005ef84c5d Since HEADER_DES_H has been the protector of des.h since libdes
(before SSLeay, maybe?), it's better to have that macro protect
the compatibility header des_old.h.  In the new des.h, let's use
a slightly different protecting macro.

The rationale is that there are application that might include (via
other header files, perhaps) both an old libdes des.h and OpenSSL's
des.h.  Whichever comes first would overshadow the other because of
the clash in protecting macro.  This fix solves that problem.
2002-12-11 06:59:16 +00:00
Geoff Thorpe
f92570f00a This stops a compiler warning from -Wmissing-prototypes.
(Noticed by Nils Larsch)
2002-12-11 03:34:26 +00:00
Lutz Jänicke
9314e366c8 Update -Olimit setting.
Submitted by: Bernhard Simon <simon@zid.tuwien.ac.at>
Reviewed by:
PR:
2002-12-10 18:48:14 +00:00
Ralf S. Engelschall
b22c7a1cfb test commit (just removing tailing blanks) #2 after migration 2002-12-10 12:01:39 +00:00
Ralf S. Engelschall
99efc0f50f test commit (removing trailing blanks) after migration 2002-12-10 10:51:18 +00:00
Ralf S. Engelschall
d979d09ccc test blank-line commit after migration -- just ignore 2002-12-10 10:49:22 +00:00
Richard Levitte
c17810b087 A memset() too many got converted into a OPENSSL_cleanse().
PR: 393
2002-12-10 08:26:05 +00:00
Andy Polyakov
e0b2073fd4 BN_sqr test failure entry. 2002-12-09 13:43:38 +00:00
Lutz Jänicke
123e5dfc3a Fix wrong URI.
Submitted by: assar@kth.se
Reviewed by:
PR: 390
2002-12-09 08:49:58 +00:00
Richard Levitte
0edad88a31 make update 2002-12-09 02:19:27 +00:00
Richard Levitte
4ccfe5f49b Hmm, Geoff's change made things quite interesting. We can now give
users the option of disabling deprecated functions, which should of
course be reflected in libeay.num and .def files.  Quite nice,
actually.
2002-12-09 02:18:16 +00:00
Geoff Thorpe
e189872486 Nils Larsch submitted;
- a patch to fix a memory leak in rsa_gen.c
  - a note about compiler warnings with unions
  - a note about improving structure element names

This applies his patch and implements a solution to the notes.
2002-12-08 16:45:26 +00:00
Richard Levitte
fdaea9ed2e Since it's defined in draft-ietf-tls-compression-04.txt, let's make
ZLIB a known compression method, with the identity 1.
2002-12-08 09:31:41 +00:00
Geoff Thorpe
5daec7ea0e Undefine OPENSSL_NO_DEPRECATED inside openssl application code if we are
being built with it defined - it is not a symbol to affect how openssl
itself builds, but to alter the way openssl headers can be used from an API
point of view. The "deprecated" function wrappers will always remain inside
OpenSSL at least as long as they're still being used internally. :-)

The exception is dsaparam which has been updated to the BN_GENCB-based
functions to test the new functionality. If GENCB_TEST is defined, dsaparam
will support a "-timebomb <n>" switch to cancel parameter-generation if it
gets as far as 'n' seconds without completion.
2002-12-08 05:38:44 +00:00
Geoff Thorpe
e9224c7177 This is a first-cut at improving the callback mechanisms used in
key-generation and prime-checking functions. Rather than explicitly passing
callback functions and caller-defined context data for the callbacks, a new
structure BN_GENCB is defined that encapsulates this; a pointer to the
structure is passed to all such functions instead.

This wrapper structure allows the encapsulation of "old" and "new" style
callbacks - "new" callbacks return a boolean result on the understanding
that returning FALSE should terminate keygen/primality processing.  The
BN_GENCB abstraction will allow future callback modifications without
needing to break binary compatibility nor change the API function
prototypes. The new API functions have been given names ending in "_ex" and
the old functions are implemented as wrappers to the new ones.  The
OPENSSL_NO_DEPRECATED symbol has been introduced so that, if defined,
declaration of the older functions will be skipped. NB: Some
openssl-internal code will stick with the older callbacks for now, so
appropriate "#undef" logic will be put in place - this is in case the user
is *building* openssl (rather than *including* its headers) with this
symbol defined.

There is another change in the new _ex functions; the key-generation
functions do not return key structures but operate on structures passed by
the caller, the return value is a boolean. This will allow for a smoother
transition to having key-generation as "virtual function" in the various
***_METHOD tables.
2002-12-08 05:24:31 +00:00
Geoff Thorpe
e90e719739 Fix a warning, and do some constification as a lucky side-effect :-) 2002-12-08 05:19:43 +00:00
Richard Levitte
7ba666fa0e Since it's defined in draft-ietf-tls-compression-04.txt, let's make
ZLIB a known compression method, with the identity 1.
2002-12-08 02:41:11 +00:00
Richard Levitte
86a62cf15c Implement a stateful variant if the ZLIB compression method. The old
stateless variant is kept, but isn't used anywhere.
2002-12-08 02:39:38 +00:00
Richard Levitte
b11405723d Forgot one. 2002-12-07 20:03:42 +00:00
Richard Levitte
4c3a2b4f8a Add a few items I intend to work on for 0.9.8 and on. 2002-12-07 20:02:20 +00:00
Andy Polyakov
bbf8198feb Workaround for GCC-ia64 compiler bug.
Submitted by: <appro>
Reviewed by:
PR:
2002-12-06 17:18:10 +00:00
Richard Levitte
3dda0dd2a2 Some compilers are quite picky about non-void functions that don't return
anything.
2002-12-06 08:50:06 +00:00
Richard Levitte
fa63a98ad8 Apparently, bash is more forgiving than sh. To be backward
compatible, don't use ==, use = instead...
2002-12-06 08:43:41 +00:00
Richard Levitte
1fc73fef48 Keep NEWS in HEAD up to date. 2002-12-06 00:39:03 +00:00
Richard Levitte
90543bd07a Keep STATUS in HEAD up to date. 2002-12-05 23:01:17 +00:00
Richard Levitte
43ecece595 Merge in relevant changes from the OpenSSL 0.9.6h release. 2002-12-05 21:50:13 +00:00
Richard Levitte
4ba8cabf62 SSL_CERT_FILE should be used in place of the system default file, not as
a first alternative to try
2002-12-05 21:07:26 +00:00
Richard Levitte
f68bb3c51f Corrected DJGPP patch 2002-12-05 20:50:25 +00:00
Andy Polyakov
6d4ac67ac1 linux64-sparcv9 support finally debugged and tested.
Submitted by:
Reviewed by:
PR:
2002-12-05 13:17:52 +00:00
Richard Levitte
b84d5b72f1 Make sure to implement the cryptodev engine only when /dev/crypto exists. 2002-12-05 10:16:28 +00:00
Richard Levitte
8cbccedf7c make update 2002-12-05 01:55:48 +00:00
Richard Levitte
1c24347062 Declare another general file. 2002-12-05 01:42:14 +00:00
Richard Levitte
9ef888130d Allow users to modify /MD to /MT.
PR: 380
2002-12-05 01:35:04 +00:00
Richard Levitte
4387f47832 Make sure using SSL_CERT_FILE actually works, and has priority over system defaults.
PR: 376
2002-12-05 01:20:47 +00:00
Richard Levitte
38d6e4bb50 If an application supports static locks, it MUST support dynamic locks as
well to be able to use the CHIL engine.
PR: 281
2002-12-05 00:56:58 +00:00
Richard Levitte
ced621e3c2 PR: 381 2002-12-05 00:05:48 +00:00
Richard Levitte
85940ea8ea Only check for a result buffer if the allocated string is a prompt string.
PR: 381
2002-12-05 00:04:30 +00:00
Richard Levitte
439ae4d398 Do not implement RC4 stuff if RC4 is disabled. Concequently, apply the same
rule for SHA stuff.
PR: 381
2002-12-04 22:54:02 +00:00
Richard Levitte
4fbe40c54f gethostname() is more a BSD feature than an XOPEN one.
PR: 379
2002-12-04 22:48:01 +00:00
Richard Levitte
578ca7e4cd Correct a few typos that I introduced after applying DJGPP patches. 2002-12-04 19:13:43 +00:00
Bodo Möller
7e8c30b589 In ECPKParameters_print, output the private key length correctly
(length of the order of the group, not length of the actual key, which
will be shorter in some cases).

Submitted by: Nils Larsch
2002-12-04 17:43:01 +00:00
Bodo Möller
2b32b28191 Don't compute timings here, we can do this elsewhere.
Include X9.62 signature examples.

Submitted by: Nils Larsch
2002-12-04 17:38:40 +00:00
Lutz Jänicke
532215f2db Missing ")"
Submitted by: Christian Hohnstaedt <chohnstaedt@innominate.com>
Reviewed by:
PR:
2002-12-04 13:30:58 +00:00
Richard Levitte
5319be4438 DJGPP patches.
PR: 347
2002-12-04 09:54:10 +00:00
Richard Levitte
f7a3e73ef6 Add support for x86_64.
PR: 348
2002-12-04 09:17:43 +00:00
Richard Levitte
ff3345cb72 A gcc 3.0 bug is triggered by our code. Add a section about it in PROBLEMS.
PR: 375
2002-12-04 08:24:18 +00:00
Dr. Stephen Henson
716b2079dc Make ASN1_TYPE_get() work for V_ASN1_NULL type. 2002-12-04 00:49:46 +00:00
Dr. Stephen Henson
e7b6228fd3 Typo in X509v3_get_ext_by_critical 2002-12-04 00:16:00 +00:00
Dr. Stephen Henson
2053c43de2 In asn1_d2i_read_bio, don't assume BIO_read will
return the requested number of bytes when reading
content.
2002-12-03 23:50:59 +00:00
Richard Levitte
1c3e4a3660 EXIT() may mean return(). That's confusing, so let's have it really mean
exit() in whatever way works for the intended platform, and define
OPENSSL_EXIT() to have the old meaning (the name is of course because
it's only used in the openssl program)
2002-12-03 16:33:03 +00:00
Richard Levitte
4707991520 Make CRYPTO_cleanse() independent of endianness. 2002-12-03 16:06:40 +00:00
Richard Levitte
7a1f92fdc3 Windows CE updates, contributed by Steven Reddie <smr@essemer.com.au> 2002-12-03 14:20:44 +00:00
Richard Levitte
e7a285694e define USE_SOCKETS so sys/param.h gets included (and thusly, MAXHOSTNAMELEN
gets defined).
PR: 371
2002-12-02 22:49:02 +00:00
Richard Levitte
6ab285bf4c I think I got it now. Apparently, the case of having to shift down
the divisor was a bit more complex than I first saw.  The lost bit
can't just be discarded, as there are cases where it is important.
For example, look at dividing 320000 with 80000 vs. 80001 (all
decimals), the difference is crucial.  The trick here is to check if
that lost bit was 1, and in that case, do the following:

1. subtract the quotient from the remainder
2. as long as the remainder is negative, add the divisor (the whole
   divisor, not the shofted down copy) to it, and decrease the
   quotient by one.

There's probably a nice mathematical proof for this already, but I
won't bother with that, unless someone requests it from me.
2002-12-02 21:31:45 +00:00
Richard Levitte
1d3159bcca Make some names consistent. 2002-12-02 02:40:27 +00:00
Richard Levitte
f60ceb54eb Through some experimentation and thinking, I think I finally got the
proper implementation of bn_div_words() for VAX.

If the tests go through well, the next step will be to test on Alpha.
2002-12-02 02:28:27 +00:00
Richard Levitte
0f995b2f40 Small bugfix: even when r == d, we need to adjust r and q.
PR: 366
2002-12-01 02:17:23 +00:00
Richard Levitte
848f735ae4 EXIT() needs to be in a function that returns int. 2002-12-01 01:23:35 +00:00
Richard Levitte
a678430602 Redo the VAX assembler version of bn_div_words().
PR: 366
2002-12-01 00:49:36 +00:00
Richard Levitte
e9b553dac1 Remove incorrect assert.
PR: 360
2002-11-29 15:18:22 +00:00
Richard Levitte
db3758923b Make it so all names mentioned in the NAME section of each manpage becomes a
symlink to said manpage.
PR: 242
2002-11-29 15:00:58 +00:00
Richard Levitte
5e4a75e79f Correct some names. 2002-11-29 14:21:54 +00:00
Richard Levitte
43d601641f A few more memset()s converted to OPENSSL_cleanse().
I *think* I got them all covered by now, bu please, if you find any more,
tell me and I'll correct it.
PR: 343
2002-11-29 11:30:45 +00:00
Richard Levitte
55f78baf32 Have all tests use EXIT() to exit rather than exit(), since the latter doesn't
always give the expected result on some platforms.
2002-11-28 18:54:30 +00:00
Richard Levitte
6c359479d7 Make sure EXIT() can always be used as one statement. 2002-11-28 18:52:14 +00:00
Richard Levitte
4579924b7e Cleanse memory using the new OPENSSL_cleanse() function.
I've covered all the memset()s I felt safe modifying, but may have missed some.
2002-11-28 08:04:36 +00:00
Richard Levitte
2047bda6fb Unused variable removed. 2002-11-27 13:40:41 +00:00
Richard Levitte
406c6f6962 Extra ; removed. 2002-11-27 13:40:11 +00:00
Richard Levitte
df29cc8f77 Add OPENSSL_cleanse() to help cleanse memory and avoid certain compiler
and linker optimizations.
PR: 343
2002-11-27 12:24:05 +00:00
Richard Levitte
ec7164133d I forgot that @ in strings must be escaped in Perl 2002-11-26 15:27:05 +00:00
Richard Levitte
ba8ad07490 The logic in the main signing and verifying functions to check lengths was
incorrect.  Fortunately, there is a second check that's correct, when adding
the pads.
PR: 355
2002-11-26 11:14:32 +00:00
Richard Levitte
17582ccf21 Heimdal isn't really supported right now. Say so, and offer a possibility
to force the use of Heimdal, and warn if that's used.
PR: 346
2002-11-26 10:11:58 +00:00
Richard Levitte
31be2daa06 Small bugfixes to the KSSL implementation.
PR: 349
2002-11-26 10:09:36 +00:00
Richard Levitte
de868e0b94 Heimdal isn't really supported right now. Say so, and offer a possibility
to force the use of Heimdal, and warn if that's used.
PR: 346
2002-11-26 09:19:17 +00:00
Bodo Möller
15994b034a rename some functions to improve consistency
Submitted by: Sheueling Chang
2002-11-23 18:16:09 +00:00
Bodo Möller
922fa76e26 add a comment 2002-11-22 09:25:35 +00:00
Richard Levitte
19aa370573 Disable this module if OPENSSL_NO_SOCK is defined. 2002-11-22 08:45:20 +00:00
Richard Levitte
d020e701bb Typo. OPENSSL_NO_ECDH, not NO_OPENSSL_ECDH 2002-11-22 08:40:34 +00:00
Richard Levitte
364ff369d1 Mention a current showstopper 2002-11-21 22:39:08 +00:00
Bodo Möller
8a09b3866a avoid uninitialized memory read
Submitted by: Nils Larsch
2002-11-20 10:55:27 +00:00
Bodo Möller
137445140b Make ec_GFp_simple_point_get_affine_coordinates() faster
for Montgomery representations.

Submitted by: Sheueling Chang, Bodo Moeller
2002-11-20 10:53:33 +00:00
Lutz Jänicke
6a8afe2201 Fix bug introduced by the attempt to fix client side external session
caching (#288): now internal caching failed (#351):
Make sure, that cipher_id is set before comparing.
Submitted by:
Reviewed by:
PR: 288 (and 351)
2002-11-20 10:48:58 +00:00
Bodo Möller
1e3a9b650f allocate bio_err before memory debugging is enabled to avoid memory leaks
(we can't release it before the CRYPTO_mem_leaks() call!)

Submitted by: Nils Larsch
2002-11-19 11:56:05 +00:00
Richard Levitte
229dc0ee31 It works on my laptop :-). 2002-11-19 11:52:24 +00:00
Richard Levitte
fcc764639d make update 2002-11-19 11:40:14 +00:00
Richard Levitte
821385ad00 Fix an unsigned/signed mismatch. 2002-11-19 11:28:28 +00:00
Richard Levitte
25ff76d565 Update STATUS 2002-11-19 09:34:34 +00:00
Richard Levitte
9801fb61d0 Add news items for 0.9.6h and expand on the 0.9.7 news as well. 2002-11-18 23:58:24 +00:00
Richard Levitte
20199ca809 Document the addition of certificate pairs. 2002-11-18 23:56:15 +00:00
Richard Levitte
711f1a3c26 Add the ASN.1 structures and functions for CertificatePair, which is
defined as follows (according to X.509_4thEditionDraftV6.pdf):

CertificatePair ::= SEQUENCE {
	forward		[0]	Certificate OPTIONAL,
	reverse		[1]	Certificate OPTIONAL,
	-- at least one of the pair shall be present -- }

The only thing I'm not sure about is if it's implicit or explicit tags
that I should count on.  For now, I'm thinking explicit, but will
gladly stand corrected.

Also implement the PEM functions to read and write certificate pairs,
and defined the PEM tag as "CERTIFICATE PAIR".

This needed to be defined, mostly for the sake of the LDAP attribute
crossCertificatePair, but may prove useful elsewhere as well.
2002-11-18 23:54:27 +00:00
Richard Levitte
a1d85309ee Determine HZ exactly as in apps/speed.c. 2002-11-18 23:06:36 +00:00
Richard Levitte
450cee5c3a Make sure sysconf exists (it doesn't in the VMS C RTL lesser than version 7). 2002-11-18 23:05:39 +00:00
Bodo Möller
a2dbcf3644 remove redundant functions 2002-11-18 14:37:35 +00:00
Bodo Möller
4663355496 use consistent order of function definitions 2002-11-18 14:33:39 +00:00
Bodo Möller
9dc610495c fix memory leak in memory debuggin code ...
Submitted by: Nils Larsch
2002-11-18 14:00:42 +00:00
Bodo Möller
055076cd4f allocate bio_err before memory debugging is enabled to avoid memory leaks
(we can't release it before the CRYPTO_mem_leaks() call!)

Submitted by: Nils Larsch
2002-11-18 13:37:40 +00:00
Richard Levitte
527497a722 A variable of type time_t is supposed to be a time measurement starting at
Epoch.  offset isn't such a measurement, so let's stop pretend it is.
2002-11-18 13:04:08 +00:00
Lutz Jänicke
32d21c1ef6 Better workaround to the "=head1 NAME OPTIONS" pod2latex problem:
NAME OPTIONS are a subset of OPTIONS, so just make it =head2!
Submitted by:
Reviewed by:
PR: 333
2002-11-18 08:15:45 +00:00
Richard Levitte
629b58b7fb Make it possible to build for more than one CPU.
Clarify what the CE tests do.
2002-11-17 19:48:19 +00:00
Richard Levitte
7fa2a81d34 Ignore openssl.pc. This way, there's no risk that I'll add it again :-). 2002-11-17 08:07:08 +00:00
Richard Levitte
7f66ab4783 Adding openssl.pc to the repository was a mistake,
since it's generated.
2002-11-17 08:05:38 +00:00
Richard Levitte
95189389b0 Add the file openssl.pc that I forgot a while ago. 2002-11-17 08:03:24 +00:00
Richard Levitte
b4b82ab465 I forgot this is compiled in test/, not crypto/ec/... 2002-11-16 10:10:39 +00:00
Richard Levitte
89618e7a0d We don't want TARGETCPU expanded here. 2002-11-16 09:42:04 +00:00
Richard Levitte
b87e2576b5 Mention ActiveState Perl much earlier in INSTALL.WCE. 2002-11-15 22:54:13 +00:00
Richard Levitte
0bf23d9b20 WinCE patches 2002-11-15 22:37:18 +00:00
Lutz Jänicke
813f256783 Fix buggy #! magic and update ssleay->openssl
Submitted by:
Reviewed by:
PR: 305
2002-11-15 21:26:42 +00:00
Richard Levitte
bfa96bc20e Add the INHIBIT_SYMLINKS flag variable to help Cygwin.
Add missing semicolons.
Add a comment explaining a bunch of targets without any action lines.
2002-11-15 16:56:36 +00:00
Richard Levitte
6f17f16fd5 Changes to make shared library building and use work better with Cygwin 2002-11-15 16:48:38 +00:00
Richard Levitte
84034f7aec Document the change to remove the 'done' flag variable in the
OpenSSL_add_all_*() routines
2002-11-15 13:58:11 +00:00
Bodo Möller
acce40c585 this method does not need field_data1 2002-11-15 12:43:15 +00:00
Richard Levitte
6dc78bf7e8 make update 2002-11-15 11:20:43 +00:00
Richard Levitte
ce4f169ff9 A few more Microsoft OIDs added 2002-11-15 11:17:50 +00:00
Lutz Jänicke
c566205319 The pointer to the cipher object is not yet set, when session was reloaded
from external cache (using d2i_SSL_SESSION). Perform comparison based on
the cipher's id instead.
Submitted by: Steve Haslam <araqnid@innocent.com>
Reviewed by:
PR: 288
2002-11-15 10:53:33 +00:00
Richard Levitte
eaf6c61c9f The architecture name is i486, not just 486 2002-11-15 10:28:28 +00:00
Richard Levitte
4c53d11d7f -Wid-clash-n isn't support in gcc 3, and I get better result from continuously
rebuilding on a VMS box.
2002-11-15 10:19:23 +00:00
Richard Levitte
1d647444e3 I know ANSI C doesn't like 'long long', and I don't want to see it 2002-11-15 10:15:56 +00:00
Richard Levitte
c1eeb6078f Spell prototypes correctly :-). 2002-11-15 09:56:01 +00:00
Richard Levitte
953db08416 Add -Wstrict-prototype and -Wmissing-prototype to my debugging targets 2002-11-15 09:53:46 +00:00
Richard Levitte
0a5942093e We need to read one more byte of the REQUEST-CERTIFICATE message.
PR: 300
2002-11-15 09:15:55 +00:00
Dr. Stephen Henson
d78254aa28 Add SETWRAP modifier to ASN1 generate. 2002-11-15 00:26:07 +00:00
Richard Levitte
af67804bef make update 2002-11-14 23:56:12 +00:00
Richard Levitte
35a6db8640 Close the implicitely opened registry key.
PR: 264
2002-11-14 23:33:28 +00:00
Lutz Jänicke
56dc24d483 Use =back to finish =over (found using pod2latex).
Submitted by:
Reviewed by:
PR:
2002-11-14 21:50:30 +00:00
Lutz Jänicke
84d828ab70 No such reference to link to (found running pod2latex).
Submitted by:
Reviewed by:
PR:
2002-11-14 21:41:54 +00:00
Dr. Stephen Henson
cfae3d94e9 Fix documentation of i2d_X509_fp and i2d_X509_bio. 2002-11-14 18:15:52 +00:00
Richard Levitte
b9c23cca01 Add Tandem OSS target.
PR: 192
2002-11-14 16:30:11 +00:00
Richard Levitte
c863201780 Remove warnings. 2002-11-14 15:57:38 +00:00
Richard Levitte
cb21d001c9 DCL logic bugs fixed.
(I really need to review my knowledge of the language)
2002-11-14 15:38:47 +00:00
Richard Levitte
c7faede37b It seems like gcc 2.9aix5.1 doesn't do will with optimization level 3.
PR: 115
2002-11-14 14:07:48 +00:00
Richard Levitte
d4e573f305 Add a FAQ on how to check the authenticity of the openSSL distribution.
PR: 292
2002-11-14 13:00:59 +00:00
Richard Levitte
e20afbb340 Cygwin fixes 2002-11-14 12:39:39 +00:00
Bodo Möller
2b2ab52354 harmonize with 0.9.7 tree 2002-11-14 12:17:47 +00:00
Richard Levitte
8d6e60486f Fix to build better with DJGPP.
PR: 338

Here's the description, submitted by Gisle Vanem <giva@bgnett.no>:

1. sock_init() renamed to ssl_sock_init() in ./apps/s_socket.c due
   to name-clash with Watt-32.

2. rand() renamed to Rand() in ./crypto/bn/divtest.c due to name-clash
   with <stdlib.h>

3. Added calls to dbug_init()/sock_init() in some demo programs.

4. Changed cflags/lflags in configure. Watt-32 install root now taken
   from $WATT_ROOT.
2002-11-14 11:22:01 +00:00
Lutz Jänicke
1f30946481 Don't declare 2 WARNINGS sections
Submitted by:
Reviewed by:
PR:
2002-11-14 11:13:01 +00:00
Lutz Jänicke
b1697f189b Opportunistic change to work around pod2latex bug: rename NAME OPTIONS
section to SUBJECT AND ISSUER NAME OPTIONS
Submitted by:
Reviewed by:
PR: 333
2002-11-14 11:09:07 +00:00
Lutz Jänicke
17a202add7 Correct reference to section name.
Submitted by:
Reviewed by:
PR:
2002-11-14 11:03:30 +00:00
Bodo Möller
3bd16a8902 fix output
Submitted by: Nils Larsch
2002-11-14 10:57:45 +00:00
Bodo Möller
555d75252a use new BIO_indent() function here as well
Submitted by: Nils Larsch
2002-11-14 10:56:59 +00:00
Lutz Jänicke
eaad02a747 Missing =back
Submitted by:
Reviewed by:
PR:
2002-11-14 10:51:54 +00:00
Richard Levitte
97101fafd5 The directory 'rijndael' doesn't exist any more, let's check the aes
directory instead (this should have been done long ago...).
2002-11-14 08:23:32 +00:00
Richard Levitte
403f1bdc70 When AES is skipped because the option 'no-rijndael' was given,
make sure it's skipped from SDIRS as well.
2002-11-14 08:20:40 +00:00
Richard Levitte
d574d83993 Make the Windows test scripts consistent in their echoing 2002-11-14 08:08:55 +00:00
Richard Levitte
83411793b6 Handle last lines that aren't properly terminated.
PR: 308
2002-11-14 06:51:18 +00:00
Dr. Stephen Henson
65caee44ff Fix get_email: 0 is a valid return value 2002-11-14 00:46:11 +00:00
Richard Levitte
738554331b Constification needed.
PR: 241
2002-11-13 23:47:31 +00:00
Richard Levitte
3f083ef0eb free() -> OPENSSL_free() 2002-11-13 20:25:47 +00:00
Richard Levitte
17ed6c06a7 Merge from 0.9.7-stable. 2002-11-13 18:10:30 +00:00
Richard Levitte
c112323dd5 This didn't get to the 0.9.8-dev thread... 2002-11-13 18:09:27 +00:00
Richard Levitte
0709385d3c Correct support for SunOS 4.1.3_U1.
PR: 227
2002-11-13 16:11:14 +00:00
Ben Laurie
54a656ef08 Security fixes brought forward from 0.9.7. 2002-11-13 15:43:43 +00:00
Richard Levitte
8f797f14b8 When build as dynamic engines, the loading functions should be defined
static.
2002-11-13 15:30:25 +00:00
Richard Levitte
c0d64de660 Make internal functions static. 2002-11-13 14:34:53 +00:00
Richard Levitte
c1ce8cf3b8 Name the flag files correctly. 2002-11-13 14:31:34 +00:00
Dr. Stephen Henson
2d780dfd81 Typo 2002-11-13 14:07:37 +00:00
Bodo Möller
b6fee5c2fb disable weird assert()s 2002-11-13 14:01:34 +00:00
Bodo Möller
10fa047622 remove unused old directory crypto/rijndael (superseded by crypto/aes) 2002-11-13 13:55:41 +00:00
Dr. Stephen Henson
04f0a6ba39 Update docs 2002-11-13 13:18:14 +00:00
Ben Laurie
eb43641dd3 Fix warnings, makefile cockup. 2002-11-13 11:59:48 +00:00
Dr. Stephen Henson
d479dc1d02 Put NAME in right place, fix typo 2002-11-13 01:20:43 +00:00
Dr. Stephen Henson
7fb8d254fe Only accept exact match for modifier or tag name 2002-11-13 00:57:41 +00:00
Dr. Stephen Henson
c99935e32c Add header ctype.h 2002-11-13 00:42:11 +00:00
Dr. Stephen Henson
2232e262bf Fix memory leak in s2i_ASN_INTEGER and return an error
if any invalid characters are present.
2002-11-13 00:40:51 +00:00
Dr. Stephen Henson
137e7e3aa1 Update docs 2002-11-13 00:14:15 +00:00
Dr. Stephen Henson
ba36b61d3d Initial ASN1 generation documentation. 2002-11-12 18:20:28 +00:00
Richard Levitte
ccb13ded84 Synchronise... 2002-11-12 13:55:20 +00:00
Dr. Stephen Henson
9ea1b87862 Initial ASN1 generation code. This can construct
arbitrary encodings from strings and config files.

Documentation to follow...
2002-11-12 13:34:51 +00:00
Richard Levitte
688cf84d1f Make it possible to run individual tests even when linked with libcrypto.so and libssl.so 2002-11-12 11:25:23 +00:00
Richard Levitte
69ce48c307 Make the CBC mode od AES accept lengths that aren't multiples of 16.
PR: 330
2002-11-12 11:00:25 +00:00
Richard Levitte
06b7c8d5ba Variables on the stack must be initialized or we can't depend on any
initial value.  For errline/errorline, we did depend on that, erroneously
2002-11-11 21:34:21 +00:00
Richard Levitte
6722b62b36 Make the programs link against the static library on MacOS X.
PR: 335
2002-11-11 20:46:52 +00:00
Lutz Jänicke
7d80b27949 Typo.
Submitted by: assar <assar@kth.se>
Reviewed by:
PR:
2002-11-11 11:19:15 +00:00
Bodo Möller
d742bd882e do tests with all built-in curves
Submitted by: Nils Larsch
2002-11-11 10:25:12 +00:00
Bodo Möller
97a06ad9ef corrections to built-in curves
Submitted by: Nils Larsch
2002-11-11 10:24:52 +00:00
Lutz Jänicke
756b9a0046 Make sure permissions are friendly when building release tar file.
Submitted by:
Reviewed by:
PR: 171
2002-11-11 08:57:04 +00:00
Lutz Jänicke
96c930dd2f More information to the important issue of seeding the PRNG
Submitted by:
Reviewed by:
PR: 285
2002-11-11 08:33:10 +00:00
Richard Levitte
c81a15099a X509_NAME_cmp() now compares PrintableString and emailAddress with a value of type
ia5String correctly.
PR: 244
2002-11-09 21:52:20 +00:00
Dr. Stephen Henson
a8c125550c Typo 2002-11-09 18:05:33 +00:00
Richard Levitte
3782350c14 -CAserial does take a filename argument.
PR: 332
2002-11-08 21:53:54 +00:00
Richard Levitte
d6257073aa -CAcreateserial doesn't take a filename argument.
PR: 332
2002-11-08 21:51:09 +00:00
Richard Levitte
ddff68bee7 Windows doesn't know sys/file.h 2002-11-07 21:40:06 +00:00
Dr. Stephen Henson
491659c436 Typo in OCSP ASN1 module 2002-11-07 17:42:59 +00:00
Richard Levitte
8d6fc30bc7 Keep on using ${CC}, since gcc may act in disguise. 2002-11-06 23:39:03 +00:00
Richard Levitte
56824b9658 Generate openssl.pc so pkg-config can return proper data.
PR: 163
2002-11-06 23:35:00 +00:00
Richard Levitte
892e9625d3 Stupid bug fixes. I've forgotten my DCL... 2002-11-06 17:27:11 +00:00
Bodo Möller
e2916b2540 print less output (no details unless a test failed)
Submitted by: Nils Larsch
2002-11-06 11:48:09 +00:00
Richard Levitte
1810d2088e some people just can't read the instructions 2002-11-06 06:02:05 +00:00
Dr. Stephen Henson
d618f703ec CRL reason code docs. 2002-11-06 01:28:55 +00:00
Bodo Möller
896e4fef30 avoid Purify warnings
Submitted by: Nils Larsch
2002-11-05 13:54:41 +00:00
Dr. Stephen Henson
38c7271a39 Check for NULL ASN1_ITEM when initializeing
boolean option in ASN1_TYPE.
2002-11-05 13:48:33 +00:00
Bodo Möller
5e3247d8bc fix typo 2002-11-05 10:54:40 +00:00
Bodo Möller
b53e44e572 implement and use new macros BN_get_sign(), BN_set_sign()
Submitted by: Nils Larsch
2002-11-04 13:17:22 +00:00
Richard Levitte
e5f4d8279d Off-by-one-error corrected.
PR: 235
2002-11-04 11:30:47 +00:00
Richard Levitte
86e8b56ac4 Cosmetic change 2002-11-04 06:26:37 +00:00
Richard Levitte
bff1567623 Since we're currently assuming VMS can deal with dynamic engines,
don't include the static engine entry points in libcrypto.exe.
2002-11-04 00:29:26 +00:00
Richard Levitte
db199abd9e Depend on OPENSSL_NO_STATIC_ENGINE rather than OPENSSL_NO_DYNAMIC_ENGINE.
Make sure to include openssl/opensslconf.h to make sure we get the
definition of those macros.
2002-11-01 12:37:22 +00:00
Richard Levitte
b6d0defb98 Remove all referenses to RSAref, since that's been gone for more than
a year.
2002-10-31 16:46:52 +00:00
Richard Levitte
ad22b914d6 Add all that is needed to build external engines on VMS.
Currently, we simply assume that they shall always be built as
shareable images.
2002-10-31 15:43:38 +00:00
Richard Levitte
f216fae545 Add the command procedure to build external engines on VMS.
Currently, we simply assume that they shall always be built as
shareable images.
2002-10-31 15:43:00 +00:00
Richard Levitte
242823c9bc New files have appeared, tell VMS. 2002-10-30 09:46:21 +00:00
Richard Levitte
40efa67248 Plug potential memory leak.
Identified by Goetz Babin-Ebell <babinebell@trustcenter.de>
2002-10-30 09:42:42 +00:00
Geoff Thorpe
769fedc3ad Add a HISTORY section to the man page to mention the new flags. 2002-10-29 18:05:16 +00:00
Geoff Thorpe
9c3db400dc The recent CHANGES note between 0.9.6g and 0.9.6h needs copying into the
other branches.
2002-10-29 18:01:08 +00:00
Geoff Thorpe
d9ec9d990f The last character of inconsistency in my recent commits is hereby
squashed.
2002-10-29 17:51:32 +00:00
Richard Levitte
b5148cf1f7 synchronise util/libeay.num with the 0.9.7-stable variant (guys, this
is something we really need to keep track of!).
make update
2002-10-29 14:48:57 +00:00
Bodo Möller
90a617e050 avoid warnings ('index' shadows global declaration)
Submitted by: Nils Larsch
2002-10-29 11:50:20 +00:00
Bodo Möller
259cdf2af9 Sun has agreed to removing the covenant language from most files.
Submitted by: Sheueling Chang <Sheueling.Chang@Sun.COM>
2002-10-29 10:59:32 +00:00
Bodo Möller
6c950e0dc9 'covenant HOWTO' (what to do about the Sun covenant if you modify the code)
Submitted by: Bodo Moeller
2002-10-29 10:58:07 +00:00
Richard Levitte
62dd6f161a The #else part of the conditionals have two statements, so they need
to be surrounded with braces, or the surrounding if..else will fail
miserably in case the #else part is compiled.
2002-10-29 09:42:59 +00:00
Richard Levitte
6aba658cd8 Revert, that was an incorrect change.
PR: 156
2002-10-29 04:34:43 +00:00
Richard Levitte
accb0c6edb A small detail: since 0.9.7, DH_new_method() and DSA_new_method()
don't take an ENGINE* as parameter any more.
PR: 156
2002-10-29 04:31:46 +00:00
Geoff Thorpe
e0db2eed8d Correct and enhance the behaviour of "internal" session caching as it
relates to SSL_CTX flags and the use of "external" session caching. The
existing flag, "SSL_SESS_CACHE_NO_INTERNAL_LOOKUP" remains but is
supplemented with a complimentary flag, "SSL_SESS_CACHE_NO_INTERNAL_STORE".
The bitwise OR of the two flags is also defined as
"SSL_SESS_CACHE_NO_INTERNAL" and is the flag that should be used by most
applications wanting to implement session caching *entirely* by its own
provided callbacks. As the documented behaviour contradicted actual
behaviour up until recently, and since that point behaviour has itself been
inconsistent anyway, this change should not introduce any compatibility
problems. I've adjusted the relevant documentation to elaborate about how
this works.

Kudos to "Nadav Har'El" <nyh@math.technion.ac.il> for diagnosing these
anomalies and testing this patch for correctness.

PR: 311
2002-10-29 00:33:04 +00:00
Bodo Möller
00a357ab20 increase permissible message length so that we can handle
CertificateVerify for 4096 bit RSA signatures
2002-10-28 15:45:51 +00:00
Bodo Möller
8ee4845b65 'broken' PKCS #8 format does not apply to ECDSA
Submitted by: Nils Larsch
2002-10-28 14:13:38 +00:00
Bodo Möller
19b8d06a79 clean up new code for NIST primes
create new lock CRYPTO_LOCK_BN to avoid race condition
2002-10-28 14:02:19 +00:00
Bodo Möller
5c6bf03117 fast reduction for NIST curves
Submitted by: Nils Larsch
2002-10-28 13:23:24 +00:00
Bodo Möller
f72ed6153b remove superfluous code
Submitted by: Nils Larsch
2002-10-28 13:19:08 +00:00
Richard Levitte
d652a0957f Make sure toupper() is declared 2002-10-25 09:51:45 +00:00
Richard Levitte
fbcd27907b External engines aren't in crypto/engine/ any more, so don't try to
build them there.

A command procedure to build the external engines is on it's way.
2002-10-24 19:15:30 +00:00
Richard Levitte
a551bea52e make update 2002-10-24 19:12:10 +00:00
Richard Levitte
6cb686208e For the mkdef.pl to recognise if the "external" engines are inserted
into libcrypto, we need the "algorithm" STATIC_ENGINE.
2002-10-24 19:09:03 +00:00
Richard Levitte
bd1fb77245 There's a name clash between OpenSSL and RSAref. Since this engine handles
RSAref data, pretend we don't care for OpenSSL's MD2 and MD5 structures or
implementation.
Remove all kinds of silly warning
2002-10-24 17:02:27 +00:00
Richard Levitte
d610d27f30 On certain platforms, we redefine certain symbols using macros in
apps.h.  For those, it's better to include apps.h after the system
headers where those symbols may be defined, since there's otherwise a
chance that the C compiler will barf when it sees something that looks
like this after expansion:

int VMS_strcasecmp((str1),(str2))(const char *, const char *);
2002-10-24 10:03:55 +00:00
Richard Levitte
96b35c9e26 Signal an error if the entered output password didn't match itself.
PR: 314
2002-10-23 15:07:09 +00:00
Bodo Möller
907a8f1e6e fix warnings, and harmonize indentation 2002-10-23 13:11:38 +00:00
Bodo Möller
e1c191fe44 I don't like c-tab-always-indent ... 2002-10-23 13:09:19 +00:00
Dr. Stephen Henson
5aa3429c5d Typo: v3 is represented by 2. 2002-10-21 00:10:10 +00:00
Richard Levitte
ffd418f217 In my extreme debug mode, gcc complains that 'static' doesn't come
first.
2002-10-20 20:38:18 +00:00
Dr. Stephen Henson
0711be1696 New docs. 2002-10-20 13:20:57 +00:00
Geoff Thorpe
7521ab3d0b Make pod2man happier. 2002-10-18 22:04:26 +00:00
Geoff Thorpe
0587ec2645 If dynamically-loadable ENGINEs are linked against a shared-library version
of libcrypto, then it is possible that when they are loaded they will share
the same static data as the loading application/library. This means it will
be too late to set memory/ERR/ex_data/[etc] callbacks, but entirely
unnecessary to try. This change puts a static variable in the core ENGINE
code (contained in libcrypto) and a function returning a pointer to it. If
the loaded ENGINE's return value from this function matches the loading
application/library's return value - they share static data. If they don't
match, the loaded ENGINE has its own copy of libcrypto's static data and so
the callbacks need to be set.

Also, although 0.9.7 hasn't been released yet, it's clear this will
introduce a binary incompatibility between dynamic ENGINEs built for 0.9.7
and 0.9.8 (though others probably exist already from EC_*** hooks and
what-not) - so the version control values are correspondingly bumped.
2002-10-18 20:45:38 +00:00
Geoff Thorpe
b76d66fbf6 Another ENGINE implementation dependant on string.h. 2002-10-18 19:23:27 +00:00
Geoff Thorpe
06f851f721 We need to propogate SHARED_LIBS to sub-directories for "install" targets
now.
2002-10-18 19:05:32 +00:00
Geoff Thorpe
f6661d391c The loop variable is 'l', not 'i'. 2002-10-18 19:02:18 +00:00
Lutz Jänicke
284b216b3a Corrected exchanged parameters in example for EVP_EncryptInit_ex()
Submitted by: "Marcus Carey" <marcus.carey@verizon.net>
Reviewed by:
PR: 265
2002-10-18 09:47:14 +00:00
Bodo Möller
05dbe6ee1f change Emacs indentation style to make it easier to insert
tabs manually

Submitted by: Pierre Bacquet <pbacquet@delta.fr>
2002-10-17 09:16:02 +00:00
Richard Levitte
871d0f5126 Eh, -Wl,--whole-archive disappeared from the GNU targets. I've no
idea why, but that was definitely wrong...
2002-10-16 22:44:52 +00:00
Geoff Thorpe
5be1264b7e The ENGINE implementations in ./engines/ should be role models on how to
write external engines (and thus should require only installed openssl
headers and libs to compile without warnings). So this gets rid of recently
introduced compilation warnings (no longer including internal headers) by
including string.h directly.
2002-10-16 21:50:28 +00:00
Geoff Thorpe
314c667050 - Remo Inverardi noticed that ENGINEs don't have an "up_ref" function in the
normal 'structural' case (ENGINE_init() satisfies this in the less normal
'functional' case). This change provides such a function.

- Correct some "read" locks that should actually be "write" locks.

- make update.
2002-10-16 01:29:37 +00:00
Richard Levitte
28c8a911bd Typos.
PR: 189
2002-10-15 20:30:56 +00:00
Richard Levitte
437d1ed49f Typos.
PR: 189
2002-10-15 20:29:09 +00:00
Richard Levitte
12fd8be2c4 A much better idea, of course, is not to do a submake at all... 2002-10-15 12:09:22 +00:00
Richard Levitte
8258f7b361 Makefile.shared needs to know how it can reach itself. 2002-10-15 11:58:44 +00:00
Richard Levitte
e15ea3d9e1 When BN_add_word() reaches top, it shouldn't try to add the the corresponding
word, since that word may not be zero.
2002-10-14 11:33:32 +00:00
Richard Levitte
677532629d makedepend complains when a header file is included more than once in
the same source file.
2002-10-14 10:02:36 +00:00
Richard Levitte
57d8ff79b2 Complete the VxWorks fix by implementing a NULL RAND_poll() for it.
PR: 253
2002-10-14 09:44:57 +00:00
Richard Levitte
4b14ed760d libs is a timestamp that we don't really need to know about. 2002-10-14 09:35:11 +00:00
Richard Levitte
79a6260a11 Add needed libraries as per configuration to the list of libraries we
depend upon.
2002-10-14 09:25:48 +00:00
Richard Levitte
a0bf8f2008 Add missing quotes.
Make sure test doesn't barf because of missing spaces before the
closing ].
Add -lc to the list of libraries we depend upon.  Not always
necessary, but never hurts.
2002-10-14 09:24:50 +00:00
Richard Levitte
408bf2f0c4 Targeting the solaris platform for specific tests. Something is going
wrong, and my test engine doesn't show it.  The verbosity will be
temporary for about a day.
2002-10-13 22:57:51 +00:00
Richard Levitte
874fee478c Clarify where the engines are by default. 2002-10-12 16:07:31 +00:00
Richard Levitte
90d9a69bb1 Chase down the missing backslashes. 2002-10-12 09:16:10 +00:00
Richard Levitte
4006c56036 Add more commentary. Check that *num is smaller than the block size. 2002-10-11 22:42:34 +00:00
Richard Levitte
1729588435 The AES CTR API was buggy, we need to save the encrypted counter as well
between calls, or that will be lost if it returned with *num non-zero.
2002-10-11 22:37:29 +00:00
Richard Levitte
6f7c2cb31e Step 14 of move of engines: Final step, document the change. 2002-10-11 22:06:44 +00:00
Richard Levitte
a4629f4136 make update. 2002-10-11 20:45:56 +00:00
Richard Levitte
56b5f687e4 And if the path has a space, we definitely need to protect $openssl. 2002-10-11 20:31:27 +00:00
Richard Levitte
caa4f47f61 Oh, there were *two* places where we needed to protect the file
name...
2002-10-11 20:28:23 +00:00
Richard Levitte
36757b4438 For the platforms where version info is inserted separately into the
shared library, set those flags conditionally.
2002-10-11 19:56:57 +00:00
Richard Levitte
75871dda4b Step 13 of move of engines: Remove old files. 2002-10-11 18:52:42 +00:00
Richard Levitte
506fec1a95 Step 12 of move of engines: Time to make the changes to support
automatic load of dynamic engines.  Make the changes in the main
Makefile so the engines are built, but now in the engines/ directory.

Note: The changes in step 12 have all been made by Geoff Thorpe.
Credit where credit is due.
2002-10-11 18:51:29 +00:00
Richard Levitte
aae329c447 Step 11c of move of engines: Time to make the changes to support
automatic load of dynamic engines.  Change the iterator to try to load
the requested engine dynamically.  The environment variable
OPENSSL_ENGINES can be used to override the internal default directory
where one can expect to find dynamically loadable engines.

Note: The changes in step 11 have all been made by Geoff Thorpe.
Credit where credit is due.
2002-10-11 18:49:55 +00:00
Richard Levitte
02acf1409e Step 11b of move of engines: Time to make the changes to support
automatic load of dynamic engines.  Add functionality to the dynamic
engine to handle engine directories and loading from those.  This
is currently NOT compatible with the use of LD_LIBRARY_PATH and
similar environment variables.

Note: The changes in step 11 have all been made by Geoff Thorpe.
Credit where credit is due.
2002-10-11 18:47:51 +00:00
Richard Levitte
6ac3309c74 Step 11a of move of engines: Time to make the changes to support
automatic load of dynamic engines.  Unless we don't have shared
library support, do not try to load any "built-in" engines except for
cryptodev.
2002-10-11 18:42:54 +00:00
Richard Levitte
1b15cfa11d Step 10 of move of engines: Change crypto/engine/Makefile.ssl so we
don't build any "built-in" engines in that directory any more, except
fo the cryptodev one.
2002-10-11 18:40:47 +00:00
Richard Levitte
76dfca879f Step 9 of move of engines: rename crypto/engine/hw_cryptodev.c to
eng_cryptodev.c.  This is an engine that (at least currently) has
to be built in.
2002-10-11 18:38:26 +00:00
Richard Levitte
7cdc7bacea Typo 2002-10-11 18:32:32 +00:00
Richard Levitte
fbd78b5c08 Step 8 of move of engines: Remove the last little quirks.
DECIMAL_SIZE is copied from crypto/cryptlib.h.
2002-10-11 18:21:40 +00:00
Richard Levitte
fbcd0da597 We didn't copy the cryptodev engine here, darn it! 2002-10-11 18:20:06 +00:00
Richard Levitte
665dc3924d Step 7 of move of engines: Engines should not depend on private
OpenSSL header files.
2002-10-11 18:17:16 +00:00
Richard Levitte
4bdacff25b Typo. 2002-10-11 18:10:14 +00:00
Richard Levitte
ecd45314b8 Step 6 of move of engines: rename the macro ENGINE_DYNAMIC_SUPPORT to
OPENSSL_NO_DYNAMIC_ENGINE and make sure that gets defined unless
shared library support has been specifically requested.
2002-10-11 18:06:08 +00:00
Bodo Möller
3e06fb754e synchronize with 0.9.7-stable version of this file 2002-10-11 17:56:34 +00:00
Richard Levitte
b2e20a31ea That wasn't supposed to be there... 2002-10-11 17:43:53 +00:00
Richard Levitte
38e19a4220 Step 5 of move of engines: Add a makefile (and a .cvsignore). 2002-10-11 17:42:30 +00:00
Richard Levitte
f28164fefd Step 4 of move of engines: Split e.ec into individual files for each
engine.
2002-10-11 17:41:40 +00:00
Richard Levitte
2eaabb718b Step 3 of move of engines: copy the corresponding vendor header files. 2002-10-11 17:10:59 +00:00
Richard Levitte
5572f482e7 Step 2 of move of engines: copy engines to new directory and rename them
to be prefixed with e_ instead of hw_.  They aren't necessarely hardware
engines.  The files commited here are exact copies of the corresponding
hw_ files found in crypto/engine/.
2002-10-11 17:08:27 +00:00
Richard Levitte
729f0a277e Add a configuration target for A/UX.
PR: 271
2002-10-11 14:39:03 +00:00
Richard Levitte
c55d759168 make update 2002-10-11 12:22:47 +00:00
Richard Levitte
b7910992d8 There may be more than one single quote to fix.
PR: 256
2002-10-11 11:34:20 +00:00
Richard Levitte
cf3b8b52f1 Make sure it's properly detected when there's no version information
at all, and in all other cases, make sure foo.so is linked to
foo.so.{soversion}.
2002-10-11 11:14:41 +00:00
Richard Levitte
42b06fbaca Make sure $fname will not give us any surprises with any funny characters.
PR: 256
2002-10-11 11:07:28 +00:00
Richard Levitte
2245cd87d4 BN_bn2hex() returns "0" instead of "00" for zero. This disrputs the
requirement that the serial number always be an even amount of characters.
PR: 248
2002-10-11 09:38:56 +00:00
Richard Levitte
c199837c54 Fix inconsistencies in the Darwin targets.
Add a variant of SHLIB_SOVER without the preceding period.
2002-10-11 08:45:42 +00:00
Richard Levitte
83699c4784 Add a suffix for Darwin's sake, since it seems like .dylib comes after
the version in the file name.
2002-10-11 07:33:38 +00:00
Richard Levitte
30afcc072a Move the shared library construction stuff to Makefile.shared, a
helper makefile that generalises our way of building shared libraries
and is designed to take care of almost anything (I hope).
2002-10-11 00:37:11 +00:00
Richard Levitte
832f9304fd Rhapsody had ftime, Darwin doesn't (any longer?) 2002-10-10 13:35:49 +00:00
Richard Levitte
fa4bde98d2 Add a few more target platforms, to see how well the shared library
linking works on them.
2002-10-10 12:46:05 +00:00
Richard Levitte
ca80756c70 VMS below version 7 doesn't have strcasecmp, so let's roll our own on VMS.
PR: 184
2002-10-10 09:05:05 +00:00
Richard Levitte
ef0baf60aa Typo 2002-10-10 08:32:39 +00:00
Richard Levitte
7ba3a4c3d2 RFC 2712 redefines the codes for use of Kerberos 5 in SSL/TLS.
PR: 189
2002-10-10 07:59:03 +00:00
Dr. Stephen Henson
29e48c18b7 More docs. 2002-10-09 17:19:59 +00:00
Dr. Stephen Henson
982dfb7d10 Typo. 2002-10-09 17:15:35 +00:00
Dr. Stephen Henson
8c4b69d3ab Update docs. 2002-10-09 17:05:05 +00:00
Richard Levitte
0e2cc42cfb Make sure that the 'config' variable is correctly defined and declared
for monolithic as well as non-monolithic biuld.
More work is probably needed in this area.
PR: 144
2002-10-09 15:36:23 +00:00
Richard Levitte
1e5c205ccb Remove redundancy and use the main makefile better 2002-10-09 15:12:36 +00:00
Richard Levitte
4c82171a8e Keep the sub_all symbol so all the algorithm Makefiles won't break. 2002-10-09 15:03:21 +00:00
Richard Levitte
88c80b3e75 Change the main Makefile to have "mini-build" targets.
PR: 253, last part.
2002-10-09 14:52:01 +00:00
Richard Levitte
27bad5ad3d Don't fuss with the demo binaries 2002-10-09 13:57:55 +00:00
Richard Levitte
6a89a25c27 Add a few more VxWorks targets.
Correct misspelled VXWORKS macros.
Add VXWORKS identifying macros to e_os2.h.
Add required inclusions and mappings for VxWorks in e_os.h.
A few small modifications to make OpenSSL build and work on VxWorks.
PR: 253, except for the  change that was handled in an earlier
         commit, and a request for easy build of just parts of OpenSSL.
2002-10-09 13:40:48 +00:00
Richard Levitte
001ab3abad Use double dashes so makedepend doesn't misunderstand the flags we
give it.
For 0.9.7 and up, that means util/domd needs to remove those double
dashes from the argument list when gcc is used to find the
dependencies.
2002-10-09 13:25:12 +00:00
Dr. Stephen Henson
ec8ad2bb96 PKCS12_parse manual page. 2002-10-09 13:10:23 +00:00
Dr. Stephen Henson
5fbb02fcb1 PKCS12_create manual page 2002-10-09 12:06:58 +00:00
Dr. Stephen Henson
4e1b50e219 More man pages. 2002-10-09 12:06:12 +00:00
Richard Levitte
d7b2342a6a Add missing LF 2002-10-09 06:35:47 +00:00
Dr. Stephen Henson
7e9db7cefc PKCS7_verify() docs. 2002-10-08 00:40:58 +00:00
Dr. Stephen Henson
d30e4c5b0b More docs. 2002-10-07 17:31:00 +00:00
Dr. Stephen Henson
9de6bb8abc More d2i/i2d manual pages. 2002-10-07 13:07:00 +00:00
Dr. Stephen Henson
72e04bd13f Document "0" and "1" naming convention. 2002-10-06 12:59:25 +00:00
Dr. Stephen Henson
4ec0448122 Update docs. 2002-10-06 12:40:31 +00:00
Dr. Stephen Henson
842d8e209b Update docs. 2002-10-06 12:34:06 +00:00
Dr. Stephen Henson
292fcd5c7b Update DH parameter docs. 2002-10-06 12:24:09 +00:00
Dr. Stephen Henson
74e3931f84 Various Win32 fixes.
Resolve signed/unsigned conflicts

Make dso_win32.c compile.
2002-10-06 12:14:55 +00:00
Dr. Stephen Henson
12dadc555f Oops, remove old comment out debugging printf... 2002-10-06 12:10:35 +00:00
Richard Levitte
b75b2225e5 Since crypt() isn't defined anywhere, define it locally in destest.c 2002-10-06 00:41:12 +00:00
Richard Levitte
12f27bd414 Please do not use C++ comments in C code. 2002-10-06 00:33:23 +00:00
Richard Levitte
69deec58fb Do not define crypt(). The supported function is DES_crypt() (an des_crypt()
when backward compatibility is desired).
2002-10-06 00:23:28 +00:00
Dr. Stephen Henson
1e976bdc46 Update RSAPublicKey manual page... 2002-10-06 00:03:20 +00:00
Dr. Stephen Henson
9946fceb9d Some docs relating to X509 ASN1 functions.
Many other ASN1 functions are identical other
than the actual structure being handled.
2002-10-05 23:30:10 +00:00
Richard Levitte
6fed88113b For some reason, the random number support removed the destructor 2002-10-05 20:54:09 +00:00
Dr. Stephen Henson
97ebe047d0 Typo. 2002-10-05 01:38:58 +00:00
Dr. Stephen Henson
fc6a6a1030 Add version info to Win32 DLLs.
We might want to edit the strings a bit...

Maybe add to 0.9.7 too?
2002-10-04 21:22:47 +00:00
Dr. Stephen Henson
3d840c827f make update 2002-10-04 21:16:58 +00:00
Dr. Stephen Henson
a2a1a04e53 Add declaration got PKCS#7 NDEF. 2002-10-04 21:08:01 +00:00
Dr. Stephen Henson
f86abc2e80 Update mkdef.pl to handle new ASN1 macro 2002-10-04 20:24:50 +00:00
Richard Levitte
7104c376ae Installed libraries should not be overwritten, especially shared ones.
Use mv to make sure the old copy is unlinked instead of overwritten.
PR: 273, and probably others...
2002-10-04 13:43:43 +00:00
Richard Levitte
0638ced5cc Add random number generation capability to the cswift engine.
Should this be added to 0.9.6-stable as well?
PR: 275
2002-10-04 13:30:57 +00:00
Richard Levitte
e984b2af64 If we're loading libz dynamically, and COMP_zlib() is called more than once,
only the first call would provide the correct result.
PR: 277
2002-10-04 13:04:37 +00:00
Richard Levitte
70e96dcf59 Document should match reality :-).
PR: 255
2002-10-04 12:59:00 +00:00
Richard Levitte
2c696b2ddc Add a small note saying the 'debug' option should come before the platform in
the arguments to mk1mf.pl.
PR: 298
2002-10-04 12:58:44 +00:00
Dr. Stephen Henson
9a48b07ee4 Various enhancements to PKCS#12 code, new
medium level API, improved PKCS12_create
and additional functionality in pkcs12
utility.
2002-10-03 23:53:52 +00:00
Dr. Stephen Henson
230fd6b7b6 Preliminary streaming ASN1 encode support. 2002-10-03 12:38:52 +00:00
Richard Levitte
20b33a015f Removal missing 2002-10-02 00:22:44 +00:00
Richard Levitte
293d5082c7 The OpenBSD project has replaced the first implementation of the /dev/crypto
engine with something they claim is better.  I have nothing to compare to,
and I assume they know what they're talking about.  The interesting part with
this one is that it's loaded by default on OpenBSD systems.
This change was originally introduced in OpenBSD's tracking of OpenSSL.
2002-10-02 00:19:33 +00:00
Bodo Möller
929f116733 fix more race conditions
Submitted by: "Patrick McCormick" <patrick@tellme.com>
PR: 262
2002-09-26 15:52:34 +00:00
Lutz Jänicke
ba5ba5490d Add missing brackets.
Submitted by: "Chris Brook" <cbrook@v-one.com>
2002-09-25 20:19:04 +00:00
Bodo Möller
b8565a9af9 really fix race conditions
Submitted by: "Patrick McCormick" <patrick@tellme.com>

PR: 262
PR: 291
2002-09-25 15:38:57 +00:00
Richard Levitte
94960c8421 Make sure that the signal storage is regarded as volatile.
This correction was originally introduced in OpenBSD's tracking of OpenSSL.
2002-09-25 14:14:11 +00:00
Richard Levitte
6859cf7459 It makes more sense to refer to specific function manuals than the concept
manual when the specific function is refered to in the current manual text.
This correction was originally introduced in OpenBSD's tracking of OpenSSL.
2002-09-25 13:33:28 +00:00
Richard Levitte
2018681b33 Remove *all* references to RSA_PKCS1_RSAref, since it doesn't exist any more.
This correction was originally introduced in OpenBSD's tracking of OpenSSL.
2002-09-25 13:26:36 +00:00
Richard Levitte
e204516178 Remove reference to RSA_PKCS1_RSAref, since it doesn't exist any more.
This correction was originally introduced in OpenBSD's tracking of OpenSSL.
2002-09-25 13:25:44 +00:00
Richard Levitte
153aecf91a It makes more sense to refer to specific function manuals than the concept
manual when the specific function is refered to in the current manual text.
This correction was originally introduced in OpenBSD's tracking of OpenSSL.
2002-09-25 13:11:12 +00:00
Richard Levitte
cd98ab6491 Incorrect argument order to memset() 2002-09-25 12:52:13 +00:00
Richard Levitte
b3823ac64b Missing ; 2002-09-25 12:49:40 +00:00
Richard Levitte
5d9470ff8e -elapsed is also useful when using gettimeofday 2002-09-25 12:41:59 +00:00
Bodo Möller
e78f137899 really fix race condition
PR: 262
2002-09-23 14:25:07 +00:00
Ulf Möller
40e66398db use OPENSSL_SYS_MSDOS rather than __DJGPP__ to disable egd, this is not
compiler specific
2002-09-22 08:49:22 +00:00
Ulf Möller
6e32d0a74b make files didn't work on case insensitive filesystems 2002-09-22 08:44:03 +00:00
Bodo Möller
a4f53a1c73 there is no minimum length for session IDs
PR: 274
2002-09-19 11:44:07 +00:00
Bodo Möller
a90ae02454 fix race condition
PR: 262
2002-09-19 11:26:45 +00:00
Bodo Möller
4c8f79a33e make sure 'neg' flag (which does not really matter for GF(2^m), but
could cause confusion for ECDSA) is set to zero

Submitted by: Sheueling Chang
2002-09-16 13:52:48 +00:00
Bodo Möller
7cc6ec7af7 add URL for Internet Draft 2002-09-16 13:45:14 +00:00
Bodo Möller
c2bbf275b2 1. switch from "-newkey ecdsa:..." to "-newkey ec:..."
2. automatically create required sub-directories

Submitted by: Vipul Gupta <Vipul.Gupta@sun.com>
2002-09-10 07:36:52 +00:00
Bodo Möller
9226e2187c Let 'openssl req' fail if an argument to '-newkey' is not
recognized instead of using RSA as a default.
2002-09-10 07:34:45 +00:00
Dr. Stephen Henson
48921e00fc Really fix PKCS7_set_detached this time... 2002-09-08 16:25:03 +00:00
Dr. Stephen Henson
f804930150 Fix typos in PKCS#12 ASN1 code.
Make PKCS7_set_detached work again.
2002-09-07 22:57:49 +00:00
Lutz Jänicke
3403caf3da Consequently use term URI instead of URL
Submitted by: TJ Saunders <tj@castaglia.org>
Reviewed by:
PR: 268
2002-09-05 07:52:05 +00:00
Bodo Möller
ba11121731 -nameopt fix has been moved to 0.9.7 2002-09-02 14:22:51 +00:00
Bodo Möller
ed5e37c309 mention EC_get_builtin_curves() 2002-09-02 07:12:08 +00:00
Bodo Möller
65b1d31df5 change API for looking at the internal curve list
Submitted by: Nils Larsch
2002-09-02 07:08:33 +00:00
Dr. Stephen Henson
b499ed06d2 Fix ASN1_STRING_to_UTF8: remove non sensical !*out test. 2002-08-30 17:18:22 +00:00
Bodo Möller
6ff7c95843 don't memset(data,0,...) if data is NULL
Submitted by: anonymous
PR: 254
2002-08-29 11:45:40 +00:00
Geoff Thorpe
41cc7096b8 Fix a bug to allow the 4758 ENGINE to build as a DSO. 2002-08-28 19:11:08 +00:00
Bodo Möller
c237de058f don't write beyond buffer
Submitted by: Nils Larsch
2002-08-27 13:32:35 +00:00
Bodo Möller
e2aeb8174b change 'usage' formatting 2002-08-27 10:38:09 +00:00
Bodo Möller
34f1f2a81c less specific interface for EC_GROUP_get_basis_type
Submitted by: Nils Larsch, Bodo Moeller
2002-08-26 18:08:53 +00:00
Bodo Möller
c96f0fd2d1 fix spacing 2002-08-26 14:50:52 +00:00
Bodo Möller
8aefe253a7 move EC_GROUP_get_basis_type() from ec_lib.c to ec_asn1.c 2002-08-26 11:33:13 +00:00
Bodo Möller
7e31164ae0 ASN1 for binary curves
Submitted by: Nils Larsch
2002-08-26 11:25:54 +00:00
Bodo Möller
ad55f581f9 fix offsets
Submitted by: Nils Larsch
2002-08-26 11:25:14 +00:00
Bodo Möller
d4a8f90cab ecdsa => ec
Submitted by: Nils Larsch
2002-08-26 11:20:50 +00:00
Dr. Stephen Henson
41ab00bedf Reinstate the check for invalid length BIT STRINGS,
which was effectively bypassed in the ASN1 changed.
2002-08-23 00:02:11 +00:00
Dr. Stephen Henson
fc85ac20c7 Make -nameopt work in req and add support for -reqopt 2002-08-22 23:43:48 +00:00
Dr. Stephen Henson
e88479243c Change C++ style comments 2002-08-22 23:03:04 +00:00
Dr. Stephen Henson
c787525ac8 #if out unused function to shut the compiler up. 2002-08-22 23:00:54 +00:00
Dr. Stephen Henson
9a2601033d Fix crahses and leaks in pkcs12 utility -chain option 2002-08-22 21:54:51 +00:00
Richard Levitte
fbb311a7d2 Typo, I assigned the variable ld instead of my_ld... 2002-08-18 21:32:19 +00:00
Richard Levitte
f309c1ae50 So, I discovered that if you have your $PATH set so a ld different from
GNU ld comes first, checking the usage of collect2 gives that instead of
GNU ld, even if GNU ld would be the one that would get used if we link using
gcc.  It's much better, apparently, to ask gcc directly what the path to
GNU ld is (provided it's there at all and gcc knows about it), and ask
the result if it's a GNU or not.  The bonus is that our GNU ld detection
mechanism got shorter and easier to understand...
2002-08-17 13:46:42 +00:00
Lutz Jänicke
82a20fb0f0 Reorder cleanup sequence in SSL_CTX_free() to leave ex_data for remove_cb().
Submitted by:
Reviewed by:
PR: 212
2002-08-16 17:04:04 +00:00
Bodo Möller
428112ef10 typo
Submitted by: Nils Larsch
2002-08-16 11:19:59 +00:00
Bodo Möller
64376cd8ff 'EC' vs. 'ECDSA'
Submitted by: Nils Larsch
2002-08-16 11:19:07 +00:00
Richard Levitte
cc8aa08b02 isalist was less trustable than I thought (or rather, one can trust it to
come up with all kinds of names we don't have in our targets).
Besides, our sparcv9 targets currently generate sparcv8 code, I'm told.
2002-08-16 09:41:14 +00:00
Richard Levitte
1c4e4e4f56 Add -lz to the ld flags when the user has chosen to link in zlib *statically*.
Notified by Doug Kaufman <dkaufman@rahul.net>
2002-08-16 06:15:41 +00:00
Dr. Stephen Henson
3f6db7f518 Fix block_size field for CFB and OFB modes: it should be 1. 2002-08-16 01:53:24 +00:00
Richard Levitte
8435a755fd q may be used uninitialised 2002-08-15 22:06:00 +00:00
Bodo Möller
52c29b7b99 use correct function code in error message 2002-08-15 16:17:20 +00:00
Richard Levitte
c6bf63da7c It seems like sun4u doesn't always have a sparcv9 inside. Trust isalist.
PR: 220
2002-08-15 15:20:48 +00:00
Bodo Möller
0fd05a2f0f fix warnings (CHARSET_EBCDIC)
Submitted by: Lorinczy Zsigmond <lzsiga@mail.ahiv.hu>
2002-08-15 14:52:54 +00:00
Bodo Möller
1fd0338b49 fix manpage 2002-08-15 14:23:23 +00:00
Bodo Möller
b2be73e4e8 add crypto/ecdh 2002-08-15 14:17:19 +00:00
Richard Levitte
37f5fcf85c Missing =back.
Part of PR 196
2002-08-15 10:59:55 +00:00
Richard Levitte
f742e497dd Add a FAQ entry for yet another bc failure.
PR: 199
2002-08-15 10:50:31 +00:00
Richard Levitte
dcc426fcfe Yet a couple of modules forgotten. These weren't important for
OpenSSL itself, since they aren't used there (yet).  It became quite
visible qhen building a shared library, however...
2002-08-15 09:39:01 +00:00
Bodo Möller
7eb18f1237 Simplify handling of named curves: get rid of EC_GROUP_new_by_name(),
EC_GROUP_new_by_nid() should be enough.  This avoids a lot of
redundancy.

Submitted by: Nils Larsch
2002-08-15 09:21:31 +00:00
Richard Levitte
265e892fed Sometimes, the value of the variable containing the compiler call can
become rather large.  This becomes a problem when the default 1024
character large buffer that WRITE uses isn't enough.  WRITE/SYMBOL
uses a 2048 byte large buffer instead.
2002-08-15 08:28:38 +00:00
Bodo Möller
623e9e66c0 change how pod2man is handled: explicitly invoke '$PERL' only when
needed, call 'pod2man' directly if this works

PR: 217
2002-08-14 14:04:24 +00:00
Richard Levitte
90f5a2b6fe Instead of returning errors when certain flags are unusable, just ignore them.
That will make the test go through even if DH (or in some cases ECDH) aren't
built into OpenSSL.
PR: 216, part 2
2002-08-14 12:16:27 +00:00
Richard Levitte
bf625abe29 The applications 'ecdsa' and 'ecparam' were missing from the VMS
build.
2002-08-14 11:16:20 +00:00
Richard Levitte
b44069730b Make sure that the test input file comes in the same record format as the
typical output from a program in C.
PR: 222
2002-08-14 11:08:43 +00:00
Bodo Möller
749d055eba move a TODO from CHANGES to STATUS 2002-08-14 11:07:29 +00:00
Bodo Möller
49a0f77867 add 'TODO' items 2002-08-14 10:49:29 +00:00
Dr. Stephen Henson
2af52de7b5 Fix typo in OBJ_txt2obj which incorrectly passed the content
length, instead of the encoding length to d2i_ASN1_OBJECT.

This wasn't visible before becuse ASN1_get_object() used
to read past the length of the supplied buffer.
2002-08-14 00:48:02 +00:00
Richard Levitte
629d860cbc Some files deserve to be ignored 2002-08-13 22:41:18 +00:00
Richard Levitte
056cc163f5 Merge in demo engines from 0.9.7-stable. 2002-08-13 12:30:27 +00:00
Richard Levitte
e09efcf71a Comma forgotten. 2002-08-13 11:49:47 +00:00
Richard Levitte
763b4dcc66 Oh, ec2_smpt.c is #included by ec2_smpl.c! 2002-08-13 11:47:26 +00:00
Richard Levitte
83348e0b80 Do not include openssl/ripemd.h when the RIPEMD algorithm has been deselected.
PR: 216, point 1
2002-08-12 21:22:00 +00:00
Richard Levitte
f13ddd5d0a Do not use the word 'modulus', which is a class template name in VC++ 6.0/SP5.
PR: 216, point 3
2002-08-12 21:20:25 +00:00
Bodo Möller
18a31aa861 Scripts for testing ECC ciphersuites.
Submitted by: Sun Microsystems Labs
2002-08-12 15:18:48 +00:00
Richard Levitte
b2a4e959c9 A few files in the ENGINE and EVP sections forgotten. 2002-08-12 13:31:57 +00:00
Bodo Möller
f17ef241d1 fix previous commit (there's no SSLEAY_VERSION_TEXT) 2002-08-12 11:21:02 +00:00
Bodo Möller
aa1e56b0b9 remove comment
Submitted by: Douglas Stebila
2002-08-12 08:54:40 +00:00
Bodo Möller
7ef524ea1c remove debug messages
Submitted by: Douglas Stebila
2002-08-12 08:52:23 +00:00
Bodo Möller
0c7141a343 fix comment
Submitted by: Douglas Stebila
2002-08-12 08:51:30 +00:00
Bodo Möller
5488bb6197 get rid of EVP_PKEY_ECDSA (now we have EVP_PKEY_EC instead)
Submitted by: Nils Larsch
2002-08-12 08:47:41 +00:00
Bodo Möller
8e28c67155 add 0.9.6g information 2002-08-12 08:45:00 +00:00
Richard Levitte
36969082bb Update with the status for 0.9.6g. 2002-08-12 06:54:54 +00:00
Richard Levitte
4fde69b066 In case of shared libraries, we might run one version of the
application with a different version of the library.  Detect if there
is a difference of versions, and print both versions in that case.
This might prove to be a good enough debugging tool in case of doubt.
2002-08-11 21:48:44 +00:00
Richard Levitte
fd9a4dbe94 One more file to compile on VMS as well. 2002-08-11 12:27:28 +00:00
Richard Levitte
f0db0ed35d Remove clashes between symbols that have the same name except for
casing.
2002-08-11 12:23:08 +00:00
Richard Levitte
6d24cbf452 More long symbols to shorten. 2002-08-11 11:50:32 +00:00
Richard Levitte
5454829ae6 mem* functions are declared in string.h. 2002-08-10 01:36:14 +00:00
Richard Levitte
da0bca6466 Synchronise tests with Unix. 2002-08-10 01:35:10 +00:00
Richard Levitte
4705bd9b37 A new header. 2002-08-09 22:34:57 +00:00
Richard Levitte
5bd90983bc Synchronise with Unix.
(I expect the next run will generate lots of errors on VMS :-)).
2002-08-09 22:32:32 +00:00
Richard Levitte
329f981582 More long names to shorten. 2002-08-09 22:23:33 +00:00
Bodo Möller
cece7adcee .cvsignore for crypto/ecdh 2002-08-09 12:17:03 +00:00
Bodo Möller
74cc4903ef make update 2002-08-09 12:16:15 +00:00
Bodo Möller
41fdcfa71e fix warnings 2002-08-09 11:58:28 +00:00
Bodo Möller
60cc56b1a9 add field type to text output
don't print seed value as a number (leading zeros must not be removed)

Submitted by: Nils Larsch
2002-08-09 10:44:44 +00:00
Bodo Möller
f912e9293f use 0, not NULL
Submitted by: Nils Larsch
2002-08-09 09:39:53 +00:00
Bodo Möller
56939728b7 ECDH engine support
Submitted by: Douglas Stebila
2002-08-09 09:39:11 +00:00
Bodo Möller
ea26226046 ECC ciphersuite support
Submitted by: Douglas Stebila <douglas.stebila@sun.com>
(Authors: Vipul Gupta and Sumit Gupta, Sun Microsystems Laboratories)
2002-08-09 08:56:08 +00:00
Richard Levitte
17f6279317 When we want to give a -f argument to $(MAKE), we'd better make sure the
variable doesn't already contain a -f argument.
PR: 203, part 4
2002-08-09 08:50:30 +00:00
Bodo Möller
e172d60ddb Add ECDH support.
Additional changes:
 - use EC_GROUP_get_degree() in apps/req.c
 - add ECDSA and ECDH to apps/speed.c
 - adds support for EC curves over binary fields to ECDSA
 - new function EC_KEY_up_ref() in crypto/ec/ec_key.c
 - reorganize crypto/ecdsa/ecdsatest.c
 - add engine support for ECDH
 - fix a few bugs in ECDSA engine support

Submitted by: Douglas Stebila <douglas.stebila@sun.com>
2002-08-09 08:43:04 +00:00
Richard Levitte
f8fe7fa491 Parse version numbers prefixed with text (egcs does that, even with
-dumpversion).
PR: 203, part 1
2002-08-09 07:32:24 +00:00
Richard Levitte
fbe792f0ac 0.9.6f is released 2002-08-08 22:55:28 +00:00
Bodo Möller
14a7cfb32a use a generic EC_KEY structure (EC keys are not ECDSA specific)
Submitted by: Nils Larsch
2002-08-07 10:49:54 +00:00
Bodo Möller
7a8645d171 avoid SIGSEGV
Submitted by: Nils Larsch, Douglas Stebila
2002-08-07 07:53:47 +00:00
Geoff Thorpe
5bf738737d These are updates/fixes to DH/DSA/RAND docs based on the fixes to the RSA
docs. There were a couple of other places (including RSA) where the docs
were not quite synchronised with the API that are now fixed. One or two
still remain to be fixed though ...
2002-08-05 16:27:01 +00:00
Geoff Thorpe
415e03aa6f typo fix 2002-08-05 02:54:57 +00:00
Geoff Thorpe
ac120e20e3 Various parts of the RSA documentation were inaccurate and out of date and
this fixes those that I'm currently aware of. In particular, the ENGINE
interference in the RSA API has hopefully been clarified. This still needs
to be done for other areas of the API ...
2002-08-04 21:08:36 +00:00
Geoff Thorpe
3f90e45079 A single monolithic man page for the ENGINE stuff. This is a rough
first-cut but provides better documentation than having nothing on the
ENGINE API.
2002-08-04 20:57:19 +00:00
Geoff Thorpe
9dcc441a5f Fix "make install_docs" (and thus "make install"). 2002-08-04 20:40:23 +00:00
Bodo Möller
db4f691f9f oops -- must use EVP_MD_size, not EVP_MD_block_size 2002-08-03 18:49:39 +00:00
Bodo Möller
d28735a05b oops, undo previous change (was just for testing) 2002-08-03 18:28:34 +00:00
Bodo Möller
183847747a fix bn_expand2 2002-08-03 18:27:47 +00:00
Bodo Möller
bac6012308 use bn_wexpand instead of bn_expand2 (the latter is not needed here,
and it does not yet work correctly)

Submitted by: Douglas Stebila
2002-08-03 17:51:29 +00:00
Dr. Stephen Henson
aaa384ca1a Fix typo 2002-08-02 18:58:33 +00:00
Dr. Stephen Henson
f908226898 Fix the ASN1 sanity check: correct header length
calculation and check overflow against LONG_MAX.
2002-08-02 18:48:55 +00:00
Bodo Möller
909abce800 disable Sun divison algorithm by default 2002-08-02 18:26:02 +00:00
Bodo Möller
33d4e690cc fix bn_expand2 2002-08-02 18:23:55 +00:00
Bodo Möller
848c849584 optical changes 2002-08-02 17:25:05 +00:00
Bodo Möller
102c8f47bf typo 2002-08-02 15:28:31 +00:00
Bodo Möller
d3bcbba45c remove obsolete part of comment 2002-08-02 15:13:10 +00:00
Bodo Möller
0903e56196 remove obsoleted disabled code 2002-08-02 15:07:08 +00:00
Bodo Möller
95ecacf8a2 Let BN_rand_range() abort with an error after 100 iterations
without success.
2002-08-02 15:02:03 +00:00
Bodo Möller
be8a280e0b update 2002-08-02 14:58:09 +00:00
Bodo Möller
6fb60a84dd Change BN_mod_sqrt() so that it verifies that the input value is
really the square of the return value.
2002-08-02 14:57:53 +00:00
Bodo Möller
5af7d1a3b8 move GF2m tests to the end 2002-08-02 14:49:59 +00:00
Bodo Möller
35b73a1f20 Rename implementations of method functions so that they match
the new method names where _GF... suffixes have been removed.

Revert changes to ..._{get/set}_Jprojective_coordinates_...:
The current implementation for ECC over binary fields does not use
projective coordinates, and if it did, it would not use Jacobian
projective coordinates; so it's OK to use the ..._GFp prefix for all
this.

Add author attributions to some files so that it doesn't look
as if Sun wrote all of this :-)
2002-08-02 14:28:37 +00:00
Bodo Möller
9e4f9b36fc typos 2002-08-02 13:52:19 +00:00
Bodo Möller
84d7e365a0 ec2_smpt.c must be listed in LIBSRC 2002-08-02 13:50:12 +00:00
Bodo Möller
64c3da230f there is no alternative EC_METHOD for curves over GF(2^m) (yet) 2002-08-02 13:43:26 +00:00
Bodo Möller
7793f30e09 add support for elliptic curves over binary fields
Submitted by: Duglas Stebila <douglas.stebila@sun.com>,
              Sheueling Chang <sheueling.chang@sun.com>

(CHANGES entries by Bodo Moeller)
2002-08-02 13:42:24 +00:00
Bodo Möller
714df32e33 extend curve list (additional curves over binary fields)
Submitted by: Sheueling Chang Shantz and Douglas Stebila (Sun Microsystems Laboratories)
2002-08-02 13:06:17 +00:00
Bodo Möller
1dc920c8de Binary field arithmetic contributed by Sun Microsystems.
The 'OPENSSL_NO_SUN_DIV' default is still subject to change,
so I didn't bother to finish the CHANGES entry yet.

Submitted by: Douglas Stebila <douglas.stebila@sun.com>, Sheueling Chang <sheueling.chang@sun.com>
(CHANGES entry by Bodo Moeller)
2002-08-02 13:03:55 +00:00
Bodo Möller
16dc1cfb5c Add more WAP/WTLS elliptic curve OIDs.
Submitted by: Douglas Stebila <douglas.stebila@sun.com>
2002-08-02 12:28:34 +00:00
Bodo Möller
819ff32dc4 New error code ERR_R_DISABLED
Submitted by: Douglas Stebila <douglas.stebila@sun.com>
2002-08-02 12:27:21 +00:00
Bodo Möller
5574e0ed41 get rid of OpenSSLDie 2002-08-02 11:48:15 +00:00
Richard Levitte
042e57d562 make update 2002-08-02 11:23:12 +00:00
Richard Levitte
ba8fb52183 Certain flag macros were tested with #if instead if #ifdef... 2002-08-02 11:13:37 +00:00
Richard Levitte
f6f9961819 We don't need to find out which pod2man to use more than once 2002-08-01 21:52:56 +00:00
Richard Levitte
e74e9c48de Don't try testing with parallell make, that will just fail.
PR: 175
2002-08-01 21:34:24 +00:00
Richard Levitte
179add2b07 Add aix64-cc, and make sure that ar gets proper flags for 64-bit libraries 2002-08-01 20:28:16 +00:00
Richard Levitte
456bc309d8 make update 2002-08-01 19:45:54 +00:00
Richard Levitte
a7535a2727 Add the CBC flag for cbc ciphers 2002-08-01 19:32:48 +00:00
Richard Levitte
44c09667ff Avoid yet another name clash with libdes, and make the declaration consistent
with the definition.
2002-08-01 19:30:58 +00:00
Richard Levitte
da9b972466 Make it possible to load keys from stdin, and restore that
functionality in the programs that had that before.
Part fo PR 164
2002-08-01 16:28:40 +00:00
Richard Levitte
bd45950f4a OCSP and KRB5 Makefil.ssl should be consistent with all the others 2002-08-01 14:18:52 +00:00
Richard Levitte
f70cf11819 Linux on s390 really knows about loading dynamically.
PR: 183
2002-08-01 13:50:08 +00:00
Richard Levitte
5575f781ad Cut'n'paste error with other reposnder certificates cleared.
PR: 190
2002-08-01 13:39:39 +00:00
Richard Levitte
0472883cc2 If CRYPTO_realloc() is called with a NULL pointer, have it call
OPENSSL_malloc().
PR: 187
2002-08-01 10:08:37 +00:00
Richard Levitte
87e8feca95 If the email address is moved from the subject to the subject alternate name,
the subject in the certificate would differ from the subject in the index file,
which has quite bad concequences.
PR: 180
2002-07-31 14:05:57 +00:00
Richard Levitte
e70a39830c Make sure to use $(MAKE) everywhere instead of make.
Part of PR 181
2002-07-31 13:49:06 +00:00
Richard Levitte
ba25198517 ln -f -s doesn't always work, so do a rm -f followed by a ln -s.
Part of PR 181
2002-07-31 13:38:32 +00:00
Richard Levitte
6297bcd74c The version of the shared library should, for now, reflect the version
of OpenSSL.
Part of PR 181.
2002-07-31 13:24:26 +00:00
Lutz Jänicke
dd7ab82e75 Typo.
Submitted by: Jeffrey Altman <jaltman@columbia.edu>
Reviewed by:
PR: 169
2002-07-30 13:36:31 +00:00
Lutz Jänicke
c046fffa16 OpenSSL Security Advisory [30 July 2002]
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.
2002-07-30 13:04:04 +00:00
Lutz Jänicke
3aecef7697 "make update" 2002-07-30 12:44:33 +00:00
Lutz Jänicke
b218af2b27 0.9.6e and 0.9.7-beta3 are out. 2002-07-30 11:32:47 +00:00
Lutz Jänicke
77c46bbf29 Only use DSA-functions if available.
Submitted by: "Hellan,Kim KHE" <KHE@kmd.dk>
Reviewed by:
PR: 167
2002-07-29 13:31:44 +00:00
Bodo Möller
02750ff56f mention SSL_do_handshake() 2002-07-29 12:35:19 +00:00
Bodo Möller
0bee0e6294 Use SEC1 format for EC private keys.
This is not ECDSA specific, so it's now PEM_STRING_ECPRIVATEKEY etc.

Submitted by: Nils Larsch <nlarsch@compuserve.de>
2002-07-26 08:41:04 +00:00
Bodo Möller
12593e6f45 Move zeroing from bn_expand_internal() to bn_expand2() so that it
happens reliably, even if the BIGNUM is already sufficiently large.

[Note that the bn_expand()/bn_wexpand() macros call bn_expand2() only
if the BIGNUM actually has to grow, so this change does not add any
new overhead as currently bn_expand2() is never called directly.]
2002-07-25 12:12:39 +00:00
Bodo Möller
819a040f44 more detailed instructions for export from US 2002-07-25 11:19:58 +00:00
Richard Levitte
546405bece Don't clobber loop variable.
PR: 159
2002-07-24 14:43:00 +00:00
Richard Levitte
f013c7f2a6 Document the recent DJGPP-related changes 2002-07-23 13:45:38 +00:00
Richard Levitte
1cc67fa80c Make dummy tests to make it easier to physically remove unwanted algorithms.
This should complete PR 75
2002-07-23 13:31:04 +00:00
Bodo Möller
eefa6e4e2b harmonize options with those for 'ecparam',
remove redudant option '-pub'

Submitted by: Nils Larsch
2002-07-23 09:51:57 +00:00
Richard Levitte
6d9116f83d If DH is disabled, don't define the DH functions.
Notified by Kim Hellan <KHE@kmd.dk>
2002-07-22 14:18:11 +00:00
Bodo Möller
8be4e173e8 fix a typo and clarify 2002-07-22 09:04:36 +00:00
Bodo Möller
648765ba2f add an explanation and fix a typo 2002-07-22 08:39:44 +00:00
Lutz Jänicke
c6ccf055ba New cipher selection options COMPLEMENTOFALL and COMPLEMENTOFDEFAULT.
Submitted by:
Reviewed by:
PR: 127
2002-07-19 19:55:34 +00:00
Lutz Jänicke
1649d85d10 HP-UX shared libraries must be +x and should be -w. It doesn't hurt on
other platforms.
Submitted by:
Reviewed by:
PR: 134
2002-07-19 16:32:40 +00:00
Bodo Möller
cd72dcd925 update 2002-07-19 12:32:42 +00:00
Richard Levitte
7a5ed919ad The first compile of the new merger method for VMS *almost* got
through.  That's not enough, is it?  :-)
2002-07-19 11:57:17 +00:00
Richard Levitte
799d7a34cf Two more names that are a little too long for the standard VMS linker. 2002-07-19 11:56:02 +00:00
Lutz Jänicke
20adcfa058 The behaviour is undefined when calling SSL_write() with num=0.
Submitted by:
Reviewed by:
PR: 141
2002-07-19 11:53:54 +00:00
943 changed files with 62788 additions and 20197 deletions

View File

@@ -1,3 +1,4 @@
openssl.pc
Makefile.ssl Makefile.ssl
MINFO MINFO
makefile.one makefile.one

1118
CHANGES

File diff suppressed because it is too large Load Diff

402
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] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-engine] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
# Options: # Options:
# #
@@ -38,6 +38,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
# --test-sanity Make a number of sanity checks on the data in this file. # --test-sanity Make a number of sanity checks on the data in this file.
# This is a debugging tool for OpenSSL developers. # This is a debugging tool for OpenSSL developers.
# #
# no-engine do not compile in any engine code.
# no-hw-xxx do not compile support for specific crypto hardware. # no-hw-xxx do not compile support for specific crypto hardware.
# Generic OpenSSL-style methods relating to this support # Generic OpenSSL-style methods relating to this support
# are always compiled but return NULL if the hardware # are always compiled but return NULL if the hardware
@@ -107,7 +108,6 @@ my $tlib="-lnsl -lsocket";
my $bits1="THIRTY_TWO_BIT "; my $bits1="THIRTY_TWO_BIT ";
my $bits2="SIXTY_FOUR_BIT "; my $bits2="SIXTY_FOUR_BIT ";
my $x86_sol_asm="asm/bn86-sol.o asm/co86-sol.o:asm/dx86-sol.o asm/yx86-sol.o:asm/bx86-sol.o:asm/mx86-sol.o:asm/sx86-sol.o:asm/cx86-sol.o:asm/rx86-sol.o:asm/rm86-sol.o:asm/r586-sol.o";
my $x86_elf_asm="asm/bn86-elf.o asm/co86-elf.o:asm/dx86-elf.o asm/yx86-elf.o:asm/bx86-elf.o:asm/mx86-elf.o:asm/sx86-elf.o:asm/cx86-elf.o:asm/rx86-elf.o:asm/rm86-elf.o:asm/r586-elf.o"; my $x86_elf_asm="asm/bn86-elf.o asm/co86-elf.o:asm/dx86-elf.o asm/yx86-elf.o:asm/bx86-elf.o:asm/mx86-elf.o:asm/sx86-elf.o:asm/cx86-elf.o:asm/rx86-elf.o:asm/rm86-elf.o:asm/r586-elf.o";
my $x86_out_asm="asm/bn86-out.o asm/co86-out.o:asm/dx86-out.o asm/yx86-out.o:asm/bx86-out.o:asm/mx86-out.o:asm/sx86-out.o:asm/cx86-out.o:asm/rx86-out.o:asm/rm86-out.o:asm/r586-out.o"; my $x86_out_asm="asm/bn86-out.o asm/co86-out.o:asm/dx86-out.o asm/yx86-out.o:asm/bx86-out.o:asm/mx86-out.o:asm/sx86-out.o:asm/cx86-out.o:asm/rx86-out.o:asm/rm86-out.o:asm/r586-out.o";
my $x86_bsdi_asm="asm/bn86bsdi.o asm/co86bsdi.o:asm/dx86bsdi.o asm/yx86bsdi.o:asm/bx86bsdi.o:asm/mx86bsdi.o:asm/sx86bsdi.o:asm/cx86bsdi.o:asm/rx86bsdi.o:asm/rm86bsdi.o:asm/r586bsdi.o"; my $x86_bsdi_asm="asm/bn86bsdi.o asm/co86bsdi.o:asm/dx86bsdi.o asm/yx86bsdi.o:asm/bx86bsdi.o:asm/mx86bsdi.o:asm/sx86bsdi.o:asm/cx86bsdi.o:asm/rx86bsdi.o:asm/rm86bsdi.o:asm/r586bsdi.o";
@@ -120,7 +120,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 : $sys_id : $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 : $sys_id : $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 : $arflags
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,
@@ -142,11 +142,14 @@ my %table=(
"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 -DBIO_PAIR_DEBUG -DPEDANTIC -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 -DBIO_PAIR_DEBUG -DPEDANTIC -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT:::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32::::win32:cygwin-shared:::.dll",
"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -mcpu=i486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", "debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -mcpu=i486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared",
"debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT::dlfcn", "debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT::dlfcn:linux-shared",
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wid-clash-31 -Wcast-align -Wconversion -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wid-clash-31 -Wcast-align -Wconversion -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-geoff","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DBN_CTX_DEBUG -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -g -ggdb3 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"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
@@ -159,25 +162,24 @@ 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 -DOPENSSL_NO_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 -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.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:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR: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:asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc # -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-gcc31","gcc:-mcpu=ultrasparc -m64 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-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::-D_REENTRANT:ULTRASPARC:-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::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl: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)", "solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### ####
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -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:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -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 -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.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
@@ -186,9 +188,9 @@ my %table=(
# 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:asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs", "solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9:.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::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -197,17 +199,16 @@ my %table=(
"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::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# 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 -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-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 -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# !!!Folowing can't be even tested yet!!! # GCC 3.1 is a requirement
# We have to wait till 64-bit glibc for SPARC is operational!!! "linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv9.o::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:ULTRASPARC::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
# Sunos configs, assuming sparc for the gcc one. # Sunos configs, assuming sparc for the gcc one.
##"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):::DES_UNROLL:::", ##"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:::",
"sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:::", "sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:::",
#### IRIX 5.x configs #### IRIX 5.x configs
# -mips2 flag is added by ./config when appropriate. # -mips2 flag is added by ./config when appropriate.
@@ -215,13 +216,13 @@ my %table=(
"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::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### 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-cc -o32' 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}:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "irix-mips3-cc", "cc:-n32 -mips3 -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::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# 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}:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "irix64-mips4-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::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### Unified HP-UX ANSI C configs. #### Unified HP-UX ANSI C configs.
# Special notes: # Special notes:
@@ -240,7 +241,7 @@ my %table=(
# suitable for execution on the host you're currently compiling at. # suitable for execution on the host you're currently compiling at.
# If the toolkit is ment to be used on various PA-RISC processors # If the toolkit is ment to be used on various PA-RISC processors
# consider './config +DAportable'. # consider './config +DAportable'.
# - +DD64 is chosen in favour of +DA2.0W because it's ment to be # - +DD64 is chosen in favour of +DA2.0W because it's meant to be
# compatible with *future* releases. # compatible with *future* releases.
# - If you run ./Configure hpux-parisc-[g]cc manually don't forget to # - If you run ./Configure hpux-parisc-[g]cc manually don't forget to
# pass -D_REENTRANT on HP-UX 10 and later. # pass -D_REENTRANT on HP-UX 10 and later.
@@ -251,32 +252,35 @@ my %table=(
# crypto/sha/sha_lcl.h. # crypto/sha/sha_lcl.h.
# <appro@fy.chalmers.se> # <appro@fy.chalmers.se>
# #
#!#"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-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN::-D_REENTRANT::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1:asm/pa-risc2.o:::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# 64bit PARISC for GCC without optimization, which seems to make problems. # 64bit PARISC for GCC without optimization, which seems to make problems.
# Submitted by <ross.alexander@uk.neceur.com> # Submitted by <ross.alexander@uk.neceur.com>
"hpux64-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "hpux64-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# IA-64 targets
# I have no idea if this one actually works, feedback needed. <appro>
"hpux-ia64-cc","cc:-Ae +DD32 +O3 +ESlit -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted with
# with debugging of the following config.
"hpux64-ia64-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux64-shared:+Z::.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::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +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 -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)",
# Isn't the line below meaningless? HP-UX cc optimizes for host by default. # Isn't the line below meaningless? HP-UX cc optimizes for host by default.
# hpux-parisc1_0-cc with +DAportable flag would make more sense. <appro> # hpux-parisc1_0-cc with +DAportable flag would make more sense. <appro>
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# HP/UX IA-64 targets
"hpux-ia64-cc","cc:-Ae +DD32 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted with
# with debugging of the following config.
"hpux64-ia64-cc","cc:-Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# GCC builds [not tested yet]...
# _ILP32 should have been defined by compiler driver, but it isn't...
"hpux-ia64-gcc","gcc:-O3 -DB_ENDIAN -D_ILP32::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64.o:::::::::dlfcn:hpux-shared:-fpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux64-ia64-gcc","gcc:-mlp64 -O3 -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64.o:::::::::dlfcn:hpux-shared:-fpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# 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
@@ -374,6 +378,7 @@ 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-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -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)",
"linux-pentium", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentium -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-pentium", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentium -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-ppro", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentiumpro -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-ppro", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -383,17 +388,21 @@ my %table=(
"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:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -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-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown):::BN_LLONG:::", "linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"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-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 -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::", "linux-s390", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG:::::::::::linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ia64-ecc", "ecc:-DL_ENDIAN -DTERMIO -O2 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o:::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "NetBSD-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::-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-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-sparc64","gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE:::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2 BF_PTR::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"FreeBSD-ia64","gcc:-DL_ENDIAN -DTERMIOS -O -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64-cpp.o:::::::::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)",
@@ -401,7 +410,7 @@ my %table=(
"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
"ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:::", "ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown)::-lsocket -lnsl -lc89:${x86_gcc_des} ${x86_gcc_opts}:::",
# 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}:",
@@ -412,32 +421,36 @@ my %table=(
# 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 # SCO/Caldera targets.
#
# Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
# Now we only have blended unixware-* as it's the only one used by ./config.
# If you want to optimize for particular microarchitecture, bypass ./config
# and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
# Note that not all targets include assembler support. Mostly because of
# lack of motivation to support out-of-date platforms with out-of-date
# compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
# patiently assisted to debug most of it.
#
# UnixWare 2.0x fails destest with -O.
"unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", "unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
"unixware-2.0-pentium","cc:-DFILIO_H -DNO_STRINGS_H -Kpentium::-Kthread::-lsocket -lnsl -lresolv -lx:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
# UnixWare 2.1
"unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", "unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
"unixware-2.1-pentium","cc:-O -DFILIO_H -Kpentium::-Kthread::-lsocket -lnsl -lresolv -lx: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}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"unixware-2.1-p6","cc:-O -DFILIO_H -Kp6::-Kthread::-lsocket -lnsl -lresolv -lx: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}:${x86_elf_asm}:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenUNIX-8","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenUNIX-8-gcc","gcc:-O -DFILIO_H -fomit-frame-pointer::-pthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"sco3-gcc", "gcc:-O3 -fomit-frame-pointer -Dssize_t=int -DNO_SYS_UN_H::(unknown)::-lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
"sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# UnixWare 7
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"unixware-7-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"unixware-7-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"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}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenUNIX-8-gcc","gcc:-O -DFILIO_H -fomit-frame-pointer::-pthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenUNIX-8-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenUNIX-8-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# IBM's AIX. # IBM's AIX.
"aix-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::", "aix-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::",
"aix-gcc", "gcc:-O3 -DB_ENDIAN::(unknown):AIX::BN_LLONG RC4_CHAR:::", "aix-gcc", "gcc:-O3 -DB_ENDIAN::(unknown):AIX::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:aix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::",
"aix43-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:", "aix43-gcc", "gcc:-O1 -DAIX -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:",
"aix64-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384 -q64::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHAR::::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
# #
# Cray T90 and similar (SDSC) # Cray T90 and similar (SDSC)
@@ -470,15 +483,6 @@ my %table=(
"dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX DES_UNROLL:::", "dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX DES_UNROLL:::",
"dgux-R4-x86-gcc", "gcc:-O3 -fomit-frame-pointer -DL_ENDIAN::(unknown)::-lnsl -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "dgux-R4-x86-gcc", "gcc:-O3 -fomit-frame-pointer -DL_ENDIAN::(unknown)::-lnsl -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
# SCO 3 - Tim Rice <tim@multitalents.net>
"sco3-gcc", "gcc:-O3 -fomit-frame-pointer -Dssize_t=int -DNO_SYS_UN_H::(unknown)::-lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the
# SCO cc.
"sco5-cc", "cc:-belf::(unknown)::-lsocket -lresolv -lnsl:${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:svr3-shared:-Kpic", # 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 -lresolv -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}: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 */
"ReliantUNIX","cc:-KPIC -g -DTERMIOS -DB_ENDIAN::-Kthread:SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:reliantunix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "ReliantUNIX","cc:-KPIC -g -DTERMIOS -DB_ENDIAN::-Kthread:SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:reliantunix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -497,6 +501,7 @@ my %table=(
# Windows NT, Microsoft Visual C++ 4.0 # Windows NT, Microsoft Visual C++ 4.0
"VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}::::::::::win32", "VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}::::::::::win32",
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}::::::::::win32",
"VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}::::::::::win32", "VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}::::::::::win32",
"VC-WIN16","cl:::(unknown):WIN16::MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::", "VC-WIN16","cl:::(unknown):WIN16::MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
"VC-W31-16","cl:::(unknown):WIN16::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::", "VC-W31-16","cl:::(unknown):WIN16::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
@@ -504,26 +509,31 @@ my %table=(
"VC-MSDOS","cl:::(unknown):MSDOS::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::", "VC-MSDOS","cl:::(unknown):MSDOS::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
# Borland C++ 4.5 # Borland C++ 4.5
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX::::::::::win32", "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN::::::::::win32",
"BC-16","bcc:::(unknown):WIN16::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::", "BC-16","bcc:::(unknown):WIN16::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",
# Mingw32 # MinGW
# (Note: the real CFLAGS for Windows builds are defined by util/mk1mf.pl "mingw", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall:::MINGW32:-mno-cygwin -lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32::::.dll",
# 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",
# UWIN # UWIN
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32", "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
# Cygwin # Cygwin
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32", "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:::.dll", "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:::.dll",
"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32::::win32:cygwin-shared:::.dll",
# NetWare from David Ward (dsward@novell.com) - requires MetroWerks NLM development tools
# netware-clib => legacy CLib c-runtime support
"netware-clib", "mwccnlm:::::${x86_gcc_opts}:::",
# netware-libc => LibC/NKS support
"netware-libc", "mwccnlm:::::BN_LLONG ${x86_gcc_opts}:::",
# DJGPP # DJGPP
"DJGPP", "gcc:-I/dev/env/DJDIR/watt32/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/DJDIR/watt32/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::", "DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at> # Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown):::::::", "ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
"ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::", "ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::",
# K&R C is no longer supported; you need gcc on old Ultrix installations # K&R C is no longer supported; you need gcc on old Ultrix installations
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::", ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
@@ -536,16 +546,19 @@ my %table=(
"OpenBSD-m88k", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "OpenBSD-m88k", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-mips", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "OpenBSD-mips", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-powerpc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "OpenBSD-powerpc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "OpenBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2 BF_PTR::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "OpenBSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2 BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-vax", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "OpenBSD-vax", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-hppa", "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-hppa", "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)",
##### MacOS X (a.k.a. Rhapsody or Darwin) setup ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
"darwin-ppc-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "darwin-ppc-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
##### A/UX
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-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::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::", "newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
@@ -557,11 +570,18 @@ my %table=(
##### VxWorks for various targets ##### VxWorks for various targets
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", "vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
"vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
"vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::::::::::::::::ranlibmips:",
##### 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 @MK1MF_Builds=qw(VC-NT VC-CE VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS
BC-16 Mingw32 OS2-EMX); BC-32 BC-16 Mingw32 OS2-EMX netware-clib netware-libc);
my $idx = 0; my $idx = 0;
my $idx_cc = $idx++; my $idx_cc = $idx++;
@@ -586,6 +606,7 @@ my $idx_shared_cflag = $idx++;
my $idx_shared_ldflag = $idx++; my $idx_shared_ldflag = $idx++;
my $idx_shared_extension = $idx++; my $idx_shared_extension = $idx++;
my $idx_ranlib = $idx++; my $idx_ranlib = $idx++;
my $idx_arflags = $idx++;
my $prefix=""; my $prefix="";
my $openssldir=""; my $openssldir="";
@@ -643,6 +664,7 @@ my $openssl_thread_defines;
my $openssl_sys_defines=""; my $openssl_sys_defines="";
my $openssl_other_defines; my $openssl_other_defines;
my $libs; my $libs;
my $libkrb5="";
my $target; my $target;
my $options; my $options;
my $symlink; my $symlink;
@@ -680,19 +702,24 @@ PROCESS_ARGS:
elsif (/^no-asm$/) elsif (/^no-asm$/)
{ {
$no_asm=1; $no_asm=1;
$flags .= "-DOPENSSL_NO_ASM "; #$flags .= "-DOPENSSL_NO_ASM ";
$openssl_other_defines .= "#define OPENSSL_NO_ASM\n"; $openssl_other_defines .= "#define OPENSSL_NO_ASM\n";
} }
elsif (/^no-err$/)
{
$flags .= "-DOPENSSL_NO_ERR ";
$openssl_other_defines .= "#define OPENSSL_NO_ERR\n";
}
elsif (/^no-hw-(.+)$/) elsif (/^no-hw-(.+)$/)
{ {
my $hw=$1; my $hw=$1;
$hw =~ tr/[a-z]/[A-Z]/; $hw =~ tr/[a-z]/[A-Z]/;
$flags .= "-DOPENSSL_NO_HW_$hw "; #$flags .= "-DOPENSSL_NO_HW_$hw ";
$openssl_other_defines .= "#define OPENSSL_NO_HW_$hw\n"; $openssl_other_defines .= "#define OPENSSL_NO_HW_$hw\n";
} }
elsif (/^no-hw$/) elsif (/^no-hw$/)
{ {
$flags .= "-DOPENSSL_NO_HW "; #$flags .= "-DOPENSSL_NO_HW ";
$openssl_other_defines .= "#define OPENSSL_NO_HW\n"; $openssl_other_defines .= "#define OPENSSL_NO_HW\n";
} }
elsif (/^no-dso$/) elsif (/^no-dso$/)
@@ -705,7 +732,7 @@ PROCESS_ARGS:
{ $threads=1; } { $threads=1; }
elsif (/^no-shared$/) elsif (/^no-shared$/)
{ $no_shared=1; } { $no_shared=1; }
elsif (/^shared$/) elsif (/^shared$/ || /^-shared$/ || /^--shared$/)
{ $no_shared=0; } { $no_shared=0; }
elsif (/^no-zlib$/) elsif (/^no-zlib$/)
{ $zlib=0; } { $zlib=0; }
@@ -728,24 +755,38 @@ PROCESS_ARGS:
my $algo=$1; my $algo=$1;
push @skip,$algo; push @skip,$algo;
$algo =~ tr/[a-z]/[A-Z]/; $algo =~ tr/[a-z]/[A-Z]/;
$flags .= "-DOPENSSL_NO_$algo "; #$flags .= "-DOPENSSL_NO_$algo ";
$depflags .= "-DOPENSSL_NO_$algo "; #$depflags .= "-DOPENSSL_NO_$algo ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_$algo\n"; $openssl_algorithm_defines .= "#define OPENSSL_NO_$algo\n";
if ($algo eq "RIJNDAEL") if ($algo eq "RIJNDAEL")
{ {
$flags .= "-DOPENSSL_NO_AES "; push @skip, "aes";
$depflags .= "-DOPENSSL_NO_AES "; #$flags .= "-DOPENSSL_NO_AES ";
#$depflags .= "-DOPENSSL_NO_AES ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_AES\n"; $openssl_algorithm_defines .= "#define OPENSSL_NO_AES\n";
} }
if ($algo eq "DES") if ($algo eq "DES")
{ {
push @skip, "mdc2"; push @skip, "mdc2";
$options .= " no-mdc2"; $options .= " no-mdc2";
$flags .= "-DOPENSSL_NO_MDC2 "; #$flags .= "-DOPENSSL_NO_MDC2 ";
$depflags .= "-DOPENSSL_NO_MDC2 "; #$depflags .= "-DOPENSSL_NO_MDC2 ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_MDC2\n"; $openssl_algorithm_defines .= "#define OPENSSL_NO_MDC2\n";
} }
if ($algo eq "EC" || $algo eq "SHA" || $algo eq "SHA1") if ($algo eq "EC")
{
push @skip, "ecdsa";
push @skip, "ecdh";
$options .= " no-ecdsa";
$options .= " no-ecdh";
$flags .= "-DOPENSSL_NO_ECDSA ";
$flags .= "-DOPENSSL_NO_ECDH ";
$depflags .= "-DOPENSSL_NO_ECDSA ";
$depflags .= "-DOPENSSL_NO_ECDH ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_ECDSA\n";
$openssl_algorithm_defines .= "#define OPENSSL_NO_ECDH\n";
}
if ($algo eq "SHA" || $algo eq "SHA1")
{ {
push @skip, "ecdsa"; push @skip, "ecdsa";
$options .= " no-ecdsa"; $options .= " no-ecdsa";
@@ -865,24 +906,24 @@ $no_tls1=1 if ($no_dh);
if ($no_ssl2) if ($no_ssl2)
{ {
push @skip,"SSL2"; push @skip,"SSL2";
$flags .= "-DOPENSSL_NO_SSL2 "; #$flags .= "-DOPENSSL_NO_SSL2 ";
$depflags .= "-DOPENSSL_NO_SSL2 "; #$depflags .= "-DOPENSSL_NO_SSL2 ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL2\n"; $openssl_algorithm_defines .= "#define OPENSSL_NO_SSL2\n";
} }
if ($no_ssl3) if ($no_ssl3)
{ {
push @skip,"SSL3"; push @skip,"SSL3";
$flags .= "-DOPENSSL_NO_SSL3 "; #$flags .= "-DOPENSSL_NO_SSL3 ";
$depflags .= "-DOPENSSL_NO_SSL3 "; #$depflags .= "-DOPENSSL_NO_SSL3 ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL3\n"; $openssl_algorithm_defines .= "#define OPENSSL_NO_SSL3\n";
} }
if ($no_tls1) if ($no_tls1)
{ {
push @skip,"TLS1"; push @skip,"TLS1";
$flags .= "-DOPENSSL_NO_TLS1 "; #$flags .= "-DOPENSSL_NO_TLS1 ";
$depflags .= "-DOPENSSL_NO_TLS1 "; #$depflags .= "-DOPENSSL_NO_TLS1 ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_TLS1\n"; $openssl_algorithm_defines .= "#define OPENSSL_NO_TLS1\n";
} }
@@ -909,7 +950,7 @@ print "Configuring for $target\n";
&usage if (!defined($table{$target})); &usage if (!defined($table{$target}));
my $IsWindows=scalar grep /^$target$/,@WinTargets; my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
$exe_ext=".exe" if ($target eq "Cygwin"); $exe_ext=".exe" if ($target eq "Cygwin");
$exe_ext=".exe" if ($target eq "DJGPP"); $exe_ext=".exe" if ($target eq "DJGPP");
@@ -923,7 +964,7 @@ $openssldir=$prefix . "/ssl" if $openssldir eq "";
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/; $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
print "IsWindows=$IsWindows\n"; print "IsMK1MF=$IsMK1MF\n";
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
my $cc = $fields[$idx_cc]; my $cc = $fields[$idx_cc];
@@ -948,6 +989,9 @@ my $shared_cflag = $fields[$idx_shared_cflag];
my $shared_ldflag = $fields[$idx_shared_ldflag]; my $shared_ldflag = $fields[$idx_shared_ldflag];
my $shared_extension = $fields[$idx_shared_extension]; my $shared_extension = $fields[$idx_shared_extension];
my $ranlib = $fields[$idx_ranlib]; my $ranlib = $fields[$idx_ranlib];
my $arflags = $fields[$idx_arflags];
my $no_shared_warn=0;
$cflags="$flags$cflags" if ($flags ne ""); $cflags="$flags$cflags" if ($flags ne "");
@@ -957,7 +1001,7 @@ if ($no_krb5
|| !defined($withargs{"krb5-flavor"}) || !defined($withargs{"krb5-flavor"})
|| $withargs{"krb5-flavor"} eq "") || $withargs{"krb5-flavor"} eq "")
{ {
$cflags="-DOPENSSL_NO_KRB5 $cflags"; #$cflags="-DOPENSSL_NO_KRB5 $cflags";
$options.=" no-krb5" unless $no_krb5; $options.=" no-krb5" unless $no_krb5;
$openssl_algorithm_defines .= "#define OPENSSL_NO_KRB5\n"; $openssl_algorithm_defines .= "#define OPENSSL_NO_KRB5\n";
} }
@@ -966,6 +1010,17 @@ else
my ($lresolv, $lpath, $lext); my ($lresolv, $lpath, $lext);
if ($withargs{"krb5-flavor"} =~ /^[Hh]eimdal$/) if ($withargs{"krb5-flavor"} =~ /^[Hh]eimdal$/)
{ {
die "Sorry, Heimdal is currently not supported\n";
}
##### HACK to force use of Heimdal.
##### WARNING: Since we don't really have adequate support for Heimdal,
##### using this will break the build. You'll have to make
##### changes to the source, and if you do, please send
##### patches to openssl-dev@openssl.org
if ($withargs{"krb5-flavor"} =~ /^force-[Hh]eimdal$/)
{
warn "Heimdal isn't really supported. Your build WILL break\n";
warn "If you fix the problems, please send a patch to openssl-dev\@openssl.org\n";
$withargs{"krb5-dir"} = "/usr/heimdal" $withargs{"krb5-dir"} = "/usr/heimdal"
if $withargs{"krb5-dir"} eq ""; if $withargs{"krb5-dir"} eq "";
$withargs{"krb5-lib"} = "-L".$withargs{"krb5-dir"}. $withargs{"krb5-lib"} = "-L".$withargs{"krb5-dir"}.
@@ -998,7 +1053,7 @@ else
} }
} }
$withargs{"krb5-lib"} .= " -lresolv" $withargs{"krb5-lib"} .= " -lresolv"
if ("$lresolv"); if ("$lresolv" ne "");
$withargs{"krb5-include"} = "-I".$withargs{"krb5-dir"}."/include" $withargs{"krb5-include"} = "-I".$withargs{"krb5-dir"}."/include"
if $withargs{"krb5-include"} eq "" && if $withargs{"krb5-include"} eq "" &&
$withargs{"krb5-dir"} ne ""; $withargs{"krb5-dir"} ne "";
@@ -1057,7 +1112,7 @@ else
# } # }
} }
$lflags="$libs$lflags"if ($libs ne ""); $lflags="$libs$lflags" if ($libs ne "");
if ($no_asm) if ($no_asm)
{ {
@@ -1065,9 +1120,14 @@ if ($no_asm)
$sha1_obj=$md5_obj=$rmd160_obj=""; $sha1_obj=$md5_obj=$rmd160_obj="";
} }
if (!$no_shared)
{
$cast_obj=""; # CAST assembler is not PIC
}
if ($threads) if ($threads)
{ {
$cflags=$thread_cflags; #$cflags=$thread_cflags;
$openssl_thread_defines .= $thread_defines; $openssl_thread_defines .= $thread_defines;
} }
@@ -1075,30 +1135,38 @@ if ($zlib)
{ {
$cflags = "-DZLIB $cflags"; $cflags = "-DZLIB $cflags";
$cflags = "-DZLIB_SHARED $cflags" if $zlib == 2; $cflags = "-DZLIB_SHARED $cflags" if $zlib == 2;
$lflags = "$lflags -lz" if $zlib == 2; $lflags = "$lflags -lz" if $zlib == 1;
} }
# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org # You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
my $shared_mark = ""; my $shared_mark = "";
if ($shared_target ne "") if ($shared_target eq "")
{
$no_shared_warn = 1 if !$no_shared;
$no_shared = 1;
}
if (!$no_shared)
{ {
if ($shared_cflag ne "") if ($shared_cflag ne "")
{ {
$cflags = "$shared_cflag $cflags"; $cflags = "$shared_cflag -DOPENSSL_PIC $cflags";
}
if (!$no_shared)
{
#$shared_mark = "\$(SHARED_LIBS)";
} }
} }
if ($no_shared)
{
#$cflags="-DOPENSSL_NO_DYNAMIC_ENGINE $cflags";
$openssl_other_defines.="#define OPENSSL_NO_DYNAMIC_ENGINE\n";
}
else else
{ {
$no_shared = 1; #$cflags="-DOPENSSL_NO_STATIC_ENGINE $cflags";
$openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n";
} }
if ($sys_id ne "") if ($sys_id ne "")
{ {
$cflags="-DOPENSSL_SYSNAME_$sys_id $cflags"; #$cflags="-DOPENSSL_SYSNAME_$sys_id $cflags";
$openssl_sys_defines="#define OPENSSL_SYSNAME_$sys_id\n"; $openssl_sys_defines="#define OPENSSL_SYSNAME_$sys_id\n";
} }
@@ -1113,6 +1181,8 @@ if ($ranlib eq "")
#$bn_obj="$bn1"; #$bn_obj="$bn1";
$bn_obj = $bn_asm unless $bn_obj ne ""; $bn_obj = $bn_asm unless $bn_obj ne "";
# bn86* is the only one implementing bn_*_part_words
$cflags.=" -DOPENSSL_BN_ASM_PART_WORDS" if ($bn_obj =~ /bn86/);
$des_obj=$des_enc unless ($des_obj =~ /\.o$/); $des_obj=$des_enc unless ($des_obj =~ /\.o$/);
$bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/); $bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/);
@@ -1140,6 +1210,7 @@ if ($rmd160_obj =~ /\.o$/)
$cflags =~ s/([\\\"])/\\\1/g; $cflags =~ s/([\\\"])/\\\1/g;
my $version = "unknown"; my $version = "unknown";
my $version_num = "unknown";
my $major = "unknown"; my $major = "unknown";
my $minor = "unknown"; my $minor = "unknown";
my $shlib_version_number = "unknown"; my $shlib_version_number = "unknown";
@@ -1151,6 +1222,7 @@ open(IN,'<crypto/opensslv.h') || die "unable to read opensslv.h:$!\n";
while (<IN>) while (<IN>)
{ {
$version=$1 if /OPENSSL.VERSION.TEXT.*OpenSSL (\S+) /; $version=$1 if /OPENSSL.VERSION.TEXT.*OpenSSL (\S+) /;
$version_num=$1 if /OPENSSL.VERSION.NUMBER.*0x(\S+)/;
$shlib_version_number=$1 if /SHLIB_VERSION_NUMBER *"([^"]+)"/; $shlib_version_number=$1 if /SHLIB_VERSION_NUMBER *"([^"]+)"/;
$shlib_version_history=$1 if /SHLIB_VERSION_HISTORY *"([^"]*)"/; $shlib_version_history=$1 if /SHLIB_VERSION_HISTORY *"([^"]*)"/;
} }
@@ -1216,6 +1288,7 @@ while (<IN>)
s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/; s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/;
s/^PROCESSOR=.*/PROCESSOR= $processor/; s/^PROCESSOR=.*/PROCESSOR= $processor/;
s/^RANLIB=.*/RANLIB= $ranlib/; s/^RANLIB=.*/RANLIB= $ranlib/;
s/^ARFLAGS=.*/ARFLAGS= $arflags/;
s/^PERL=.*/PERL= $perl/; s/^PERL=.*/PERL= $perl/;
s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/; s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/;
s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/; s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
@@ -1262,11 +1335,10 @@ print "SHA1_OBJ_ASM =$sha1_obj\n";
print "RMD160_OBJ_ASM=$rmd160_obj\n"; print "RMD160_OBJ_ASM=$rmd160_obj\n";
print "PROCESSOR =$processor\n"; print "PROCESSOR =$processor\n";
print "RANLIB =$ranlib\n"; print "RANLIB =$ranlib\n";
print "ARFLAGS =$arflags\n";
print "PERL =$perl\n"; print "PERL =$perl\n";
print "KRB5_INCLUDES =",$withargs{"krb5-include"},"\n" print "KRB5_INCLUDES =",$withargs{"krb5-include"},"\n"
if $withargs{"krb5-include"} ne ""; if $withargs{"krb5-include"} ne "";
print "LIBKRB5 =",$withargs{"krb5-lib"},"\n"
if $withargs{"krb5-lib"} ne "";
my $des_ptr=0; my $des_ptr=0;
my $des_risc1=0; my $des_risc1=0;
@@ -1440,7 +1512,7 @@ print "RC2 uses u$type[$rc2_int]\n" if $rc2_int != $def_int;
print "BF_PTR used\n" if $bf_ptr == 1; print "BF_PTR used\n" if $bf_ptr == 1;
print "BF_PTR2 used\n" if $bf_ptr == 2; print "BF_PTR2 used\n" if $bf_ptr == 2;
if($IsWindows) { if($IsMK1MF) {
open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h"; open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h";
printf OUT <<EOF; printf OUT <<EOF;
#ifndef MK1MF_BUILD #ifndef MK1MF_BUILD
@@ -1457,6 +1529,7 @@ EOF
my $make_targets = ""; my $make_targets = "";
$make_targets .= " links" if $symlink; $make_targets .= " links" if $symlink;
$make_targets .= " depend" if $depflags ne "" && $make_depend; $make_targets .= " depend" if $depflags ne "" && $make_depend;
$make_targets .= " gentests" if $symlink;
(system $make_command.$make_targets) == 0 or exit $? (system $make_command.$make_targets) == 0 or exit $?
if $make_targets ne ""; if $make_targets ne "";
if ( $perl =~ m@^/@) { if ( $perl =~ m@^/@) {
@@ -1480,6 +1553,68 @@ EOF
} }
} }
# create the ms/version32.rc file if needed
if ($IsMK1MF) {
my ($v1, $v2, $v3, $v4);
if ($version_num =~ /(^[0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i) {
$v1=hex $1;
$v2=hex $2;
$v3=hex $3;
$v4=hex $4;
}
open (OUT,">ms/version32.rc") || die "Can't open ms/version32.rc";
print OUT <<EOF;
#include <winver.h>
LANGUAGE 0x09,0x01
1 VERSIONINFO
FILEVERSION $v1,$v2,$v3,$v4
PRODUCTVERSION $v1,$v2,$v3,$v4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x01L
#else
FILEFLAGS 0x00L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
// Required:
VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0"
VALUE "FileDescription", "OpenSSL Shared Library\\0"
VALUE "FileVersion", "$version\\0"
#if defined(CRYPTO)
VALUE "InternalName", "libeay32\\0"
VALUE "OriginalFilename", "libeay32.dll\\0"
#elif defined(SSL)
VALUE "InternalName", "ssleay32\\0"
VALUE "OriginalFilename", "ssleay32.dll\\0"
#endif
VALUE "ProductName", "The OpenSSL Toolkit\\0"
VALUE "ProductVersion", "$version\\0"
// Optional:
//VALUE "Comments", "\\0"
VALUE "LegalCopyright", "Copyright <20> 1998-2002 The OpenSSL Project. Copyright <20> 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
//VALUE "LegalTrademarks", "\\0"
//VALUE "PrivateBuild", "\\0"
//VALUE "SpecialBuild", "\\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 0x4b0
END
END
EOF
close(OUT);
}
print <<EOF; print <<EOF;
Configured for $target. Configured for $target.
@@ -1492,6 +1627,16 @@ applications as the compiler options required on this system are not known.
See file INSTALL for details if you need multi-threading. See file INSTALL for details if you need multi-threading.
EOF EOF
print <<\EOF if ($no_shared_warn);
You gave the option 'shared'. Normally, that would give you shared libraries.
Unfortunately, the OpenSSL configuration doesn't include shared library support
for this platform yet, so it will pretend you gave the option 'no-shared'. If
you can inform the developpers (openssl-dev\@openssl.org) how to support shared
libraries on this platform, they will at least look at it and try their best
(but please first make sure you have tried with a current version of OpenSSL).
EOF
exit(0); exit(0);
sub usage sub usage
@@ -1568,7 +1713,7 @@ sub print_table_entry
my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj, my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj, my $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_ldflag,my $shared_extension,my $ranlib,my $arflags)=
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
print <<EOF print <<EOF
@@ -1596,6 +1741,7 @@ sub print_table_entry
\$shared_ldflag = $shared_ldflag \$shared_ldflag = $shared_ldflag
\$shared_extension = $shared_extension \$shared_extension = $shared_extension
\$ranlib = $ranlib \$ranlib = $ranlib
\$arflags = $arflags
EOF EOF
} }

144
FAQ
View File

@@ -9,6 +9,7 @@ OpenSSL - Frequently Asked Questions
* 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? * What is an 'engine' version?
* How do I check the authenticity of the OpenSSL distribution?
[LEGAL] Legal questions [LEGAL] Legal questions
@@ -36,12 +37,15 @@ OpenSSL - Frequently Asked Questions
* 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 Tru64 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? * What is special about OpenSSL on Redhat?
* Why does the OpenSSL compilation fail on MacOS X? * Why does the OpenSSL compilation fail on MacOS X?
* Why does the OpenSSL test suite fail on MacOS X? * Why does the OpenSSL test suite fail on MacOS X?
* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
[PROG] Questions about programming with OpenSSL [PROG] Questions about programming with OpenSSL
@@ -64,7 +68,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.6d was released on May 9, 2002. OpenSSL 0.9.7c was released on September 30, 2003.
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:
@@ -112,11 +116,14 @@ OpenSSL. Information on the OpenSSL mailing lists is available from
* Where can I get a compiled version of OpenSSL? * Where can I get a compiled version of OpenSSL?
You can finder pointers to binary distributions in
http://www.openssl.org/related/binaries.html .
Some applications that use OpenSSL are distributed in binary form. Some applications that use OpenSSL are distributed in binary form.
When using such an application, you don't need to install OpenSSL When using such an application, you don't need to install OpenSSL
yourself; the application will include the required parts (e.g. DLLs). yourself; the application will include the required parts (e.g. DLLs).
If you want to install OpenSSL on a Windows system and you don't have If you want to build OpenSSL on a Windows system and you don't have
a C compiler, read the "Mingw32" section of INSTALL.W32 for information a C compiler, read the "Mingw32" section of INSTALL.W32 for information
on how to obtain and install the free GNU C compiler. on how to obtain and install the free GNU C compiler.
@@ -135,6 +142,19 @@ 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 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. 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] =======================================================================
* Do I need patent licenses to use OpenSSL? * Do I need patent licenses to use OpenSSL?
@@ -172,18 +192,30 @@ for permission to use their software with OpenSSL.
Cryptographic software needs a source of unpredictable data to work Cryptographic software needs a source of unpredictable data to work
correctly. Many open source operating systems provide a "randomness correctly. Many open source operating systems provide a "randomness
device" that serves this purpose. On other systems, applications have device" (/dev/urandom or /dev/random) that serves this purpose.
to call the RAND_add() or RAND_seed() function with appropriate data All OpenSSL versions try to use /dev/urandom by default; starting with
before generating keys or performing public key encryption. version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not
(These functions initialize the pseudo-random number generator, PRNG.) available.
Some broken applications do not do this. As of version 0.9.5, the On other systems, applications have to call the RAND_add() or
OpenSSL functions that need randomness report an error if the random RAND_seed() function with appropriate data before generating keys or
number generator has not been seeded with at least 128 bits of performing public key encryption. (These functions initialize the
randomness. If this error occurs, please contact the author of the pseudo-random number generator, PRNG.) Some broken applications do
application you are using. It is likely that it never worked not do this. As of version 0.9.5, the OpenSSL functions that need
correctly. OpenSSL 0.9.5 and later make the error visible by refusing randomness report an error if the random number generator has not been
to perform potentially insecure encryption. seeded with at least 128 bits of randomness. If this error occurs and
is not discussed in the documentation of the application you are
using, please contact the author of that application; it is likely
that it never worked correctly. OpenSSL 0.9.5 and later make the
error visible by refusing to perform potentially insecure encryption.
If you are using Solaris 8, you can add /dev/urandom and /dev/random
devices by installing patch 112438 (Sparc) or 112439 (x86), which are
available via the Patchfinder at <URL: http://sunsolve.sun.com>
(Solaris 9 includes these devices by default). For /dev/random support
for earlier Solaris versions, see Sun's statement at
<URL: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski>
(the SUNWski package is available in patch 105710).
On systems without /dev/urandom and /dev/random, it is a good idea to On systems without /dev/urandom and /dev/random, it is a good idea to
use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
@@ -216,16 +248,6 @@ OpenSSL command line tools. Applications using the OpenSSL library
provide their own configuration options to specify the entropy source, provide their own configuration options to specify the entropy source,
please check out the documentation coming the with application. please check out the documentation coming the with application.
For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
installing the SUNski package from Sun patch 105710-01 (Sparc) which
adds a /dev/random device and make sure it gets used, usually through
$RANDFILE. There are probably similar patches for the other Solaris
versions. An official statement from Sun with respect to /dev/random
support can be found at
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.
* Why do I get an "unable to write 'random state'" error message? * Why do I get an "unable to write 'random state'" error message?
@@ -402,6 +424,17 @@ 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"?
On some DG/ux versions, bc seems to have a too small stack for calculations
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? * Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
On some Alpha installations running Tru64 Unix and Compaq C, the compilation On some Alpha installations running Tru64 Unix and Compaq C, the compilation
@@ -460,10 +493,13 @@ and then redo the compilation. What you should really do is make sure
Sometimes, you may get reports from VC++ command line (cl) that it Sometimes, you may get reports from VC++ command line (cl) that it
can't find standard include files like stdio.h and other weirdnesses. can't find standard include files like stdio.h and other weirdnesses.
One possible cause is that the environment isn't correctly set up. One possible cause is that the environment isn't correctly set up.
To solve that problem, one should run VCVARS32.BAT which is found in To solve that problem for VC++ versions up to 6, one should run
the 'bin' subdirectory of the VC++ installation directory (somewhere VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
under 'Program Files'). This needs to be done prior to running NMAKE, installation directory (somewhere under 'Program Files'). For VC++
and the changes are only valid for the current DOS session. version 7 (and up?), which is also called VS.NET, the file is called
VSVARS32.BAT instead.
This needs to be done prior to running NMAKE, and the changes are only
valid for the current DOS session.
* What is special about OpenSSL on Redhat? * What is special about OpenSSL on Redhat?
@@ -524,6 +560,37 @@ libraries you just built.
Look in the file PROBLEMS for a more detailed explanation and for possible Look in the file PROBLEMS for a more detailed explanation and for possible
solutions. solutions.
* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
Failure in BN_sqr test is most likely caused by a failure to configure the
toolkit for current platform or lack of support for the platform in question.
Run './config -t' and './apps/openssl version -p'. Do these platform
identifiers match? If they don't, then you most likely failed to run
./config and you're hereby advised to do so before filing a bug report.
If ./config itself fails to run, then it's most likely problem with your
local environment and you should turn to your system administrator (or
similar). If identifiers match (and/or no alternative identifier is
suggested by ./config script), then the platform is unsupported. There might
or might not be a workaround. Most notably on SPARC64 platforms with GNU
C compiler you should be able to produce a working build by running
'./config -m32'. I understand that -m32 might not be what you want/need,
but the build should be operational. For further details turn to
<openssl-dev@openssl.org>.
* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
As of 0.9.7 assembler routines were overhauled for position independence
of the machine code, which is essential for shared library support. For
some reason OpenBSD is equipped with an out-of-date GNU assembler which
finds the new code offensive. To work around the problem, configure with
no-asm (and sacrifice a great deal of performance) or patch your assembler
according to <URL: http://www.openssl.org/~appro/gas-1.92.3.OpenBSD.patch>.
For your convenience a pre-compiled replacement binary is provided at
<URL: http://www.openssl.org/~appro/gas-1.92.3.static.aout.bin>.
Reportedly elder *BSD a.out platforms also suffer from this problem and
remedy should be same. Provided binary is statically linked and should be
working across wider range of *BSD branches, not just OpenBSD.
[PROG] ======================================================================== [PROG] ========================================================================
* Is OpenSSL thread-safe? * Is OpenSSL thread-safe?
@@ -582,26 +649,26 @@ 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?
You have two options. You can either use a memory BIO in conjunction You have two options. You can either use a memory BIO in conjunction
with the i2d_XXX_bio() or d2i_XXX_bio() functions or you can use the with the i2d_*_bio() or d2i_*_bio() functions or you can use the
i2d_XXX(), d2i_XXX() functions directly. Since these are often the i2d_*(), d2i_*() functions directly. Since these are often the
cause of grief here are some code fragments using PKCS7 as an example: cause of grief here are some code fragments using PKCS7 as an example:
unsigned char *buf, *p; unsigned char *buf, *p;
int len; int len;
len = i2d_PKCS7(p7, NULL); len = i2d_PKCS7(p7, NULL);
buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */ buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */
p = buf; p = buf;
i2d_PKCS7(p7, &p); i2d_PKCS7(p7, &p);
At this point buf contains the len bytes of the DER encoding of At this point buf contains the len bytes of the DER encoding of
p7. p7.
The opposite assumes we already have len bytes in buf: The opposite assumes we already have len bytes in buf:
unsigned char *p; unsigned char *p;
p = buf; p = buf;
p7 = d2i_PKCS7(NULL, &p, len); p7 = d2i_PKCS7(NULL, &p, len);
At this point p7 contains a valid PKCS7 structure of NULL if an error At this point p7 contains a valid PKCS7 structure of NULL if an error
occurred. If an error occurred ERR_print_errors(bio) should give more occurred. If an error occurred ERR_print_errors(bio) should give more
@@ -668,6 +735,7 @@ The general answer is to check the config.log file generated when running
the OpenSSH configure script. It should contain the detailed information the OpenSSH configure script. It should contain the detailed information
on why the OpenSSL library was not detected or considered incompatible. 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?
Yes; make sure to read the SSL_get_error(3) manual page! Yes; make sure to read the SSL_get_error(3) manual page!

48
INSTALL
View File

@@ -2,8 +2,10 @@
INSTALLATION ON THE UNIX PLATFORM INSTALLATION ON THE UNIX PLATFORM
--------------------------------- ---------------------------------
[Installation on DOS (with djgpp), Windows, OpenVMS and MacOS (before MacOS X) [Installation on DOS (with djgpp), Windows, OpenVMS, MacOS (before MacOS X)
is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS and INSTALL.MacOS. and NetWare is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS,
INSTALL.MacOS and INSTALL.NW.
This document describes installation on operating systems in the Unix This document describes installation on operating systems in the Unix
family.] family.]
@@ -140,8 +142,8 @@
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 recorded in the request tracker publicly readable
via http://www.openssl.org/rt2.html and will be forwarded to a public via http://www.openssl.org/support/rt2.html and will be forwarded to a
mailing list). Include the output of "make report" in your message. public mailing list). Include the output of "make report" in your message.
Please check out the request tracker. Maybe the bug was already Please check out the request tracker. Maybe the bug was already
reported or has already been fixed. reported or has already been fixed.
@@ -158,11 +160,11 @@
If a test fails, look at the output. There may be reasons for If a test fails, look at the output. There may be reasons for
the failure that isn't a problem in OpenSSL itself (like a missing the failure that isn't a problem in OpenSSL itself (like a missing
or malfunctioning bc). If it is a problem with OpenSSL itself, or malfunctioning bc). If it is a problem with OpenSSL itself,
try removing any compiler optimization flags from the CFLAGS line try removing any compiler optimization flags from the CFLAG 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" in order to be added to the request tracker at
http://www.openssl.org/rt2.html. http://www.openssl.org/support/rt2.html.
4. If everything tests ok, install OpenSSL with 4. If everything tests ok, install OpenSSL with
@@ -296,3 +298,37 @@
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.
Note on support for multiple builds
-----------------------------------
OpenSSL is usually built in it's source tree. Unfortunately, this doesn't
support building for multiple platforms from the same source tree very well.
It is however possible to build in a separate tree through the use of lots
of symbolic links, which should be prepared like this:
mkdir -p objtree/"`uname -s`-`uname -r`-`uname -m`"
cd objtree/"`uname -s`-`uname -r`-`uname -m`"
(cd $OPENSSL_SOURCE; find . -type f) | while read F; do
mkdir -p `dirname $F`
rm -f $F; ln -s $OPENSSL_SOURCE/$F $F
echo $F '->' $OPENSSL_SOURCE/$F
done
make -f Makefile.org clean
OPENSSL_SOURCE is an environment variable that contains the absolute (this
is important!) path to the OpenSSL source tree.
Also, operations like 'make update' should still be made in the source tree.

View File

@@ -12,12 +12,14 @@
latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package
requires that PERL and BC also be installed. requires that PERL and BC also be installed.
All of these can be obtained from the usual DJGPP mirror sites, such as All of these can be obtained from the usual DJGPP mirror sites, such
"ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp". You also need to have as "ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp". You also need to
the WATT-32 networking package installed before you try to compile have the WATT-32 networking package installed before you try to compile
openssl. This can be obtained from "http://www.bgnett.no/~giva/". The openssl. This can be obtained from "http://www.bgnett.no/~giva/".
Makefile assumes that the WATT-32 code is in directory "watt32" under The Makefile assumes that the WATT-32 code is in the directory
/dev/env/DJDIR. specified by the environment variable WATT_ROOT. If you have watt-32
in directory "watt32" under your main DJGPP directory, specify
WATT_ROOT="/dev/env/DJDIR/watt32".
To compile openssl, start your BASH shell. Then configure for DOS by To compile openssl, start your BASH shell. Then configure for DOS by
running "./Configure" with appropriate arguments. The basic syntax for running "./Configure" with appropriate arguments. The basic syntax for

437
INSTALL.NW Normal file
View File

@@ -0,0 +1,437 @@
INSTALLATION ON THE NETWARE PLATFORM
------------------------------------
Notes about building OpenSSL for NetWare.
BUILD PLATFORM:
---------------
The build scripts (batch files, perl scripts, etc) have been developed and
tested on W2K. The scripts should run fine on other Windows
platforms (NT, Win9x, WinXP) but they haven't been tested. They may require
some modifications.
Supported NetWare Platforms - NetWare 5.x, NetWare 6.x:
------------------------------------------
OpenSSL uses the WinSock interfaces introduced in NetWare 5. Therefore,
previous versions of NetWare, 4.x and 3.x, are not supported.
On NetWare there are two c-runtime libraries. There is the legacy CLIB
interfaces and the newer LibC interfaces. Being ANSI-C libraries, the
functionality in CLIB and LibC is similar but the LibC interfaces are built
using Novell Kernal Services (NKS) which is designed to leverage
multi-processor environments.
The NetWare port of OpenSSL can configured to build using CLIB or LibC. The
CLIB build was developed and tested using NetWare 5.0 sp6.0a. The LibC
build was developed and tested using the NetWare 6.0 FCS.
The necessary LibC functionality ships with NetWare 6. However, earlier
NetWare 5.x versions will require updates in order to run the OpenSSL LibC
build.
REQUIRED TOOLS:
---------------
Based upon the configuration and build options used, some or all of the
following tools may be required:
* Perl for Win32 - required (http://www.activestate.com/ActivePerl)
Used to run the various perl scripts on the build platform.
* Perl 5.8.0 for NetWare v3.20 (or later) - required
(http://developer.novell.com) Used to run the test script on NetWare
after building.
* Metrowerks CodeWarrior PDK 2.1 (or later) for NetWare - required:
Provides command line tools used for building.
Tools:
mwccnlm.exe - C/C++ Compiler for NetWare
mwldnlm.exe - Linker for NetWare
mwasmnlm.exe - x86 assembler for NetWare (if using assembly option)
* Assemblers - optional:
If you intend to build using the assembly options you will need an
assembler. Work has been completed to support two assemblers, Metrowerks
and NASM. However, during development, a bug was found in the Metrowerks
assembler which generates incorrect code. Until this problem is fixed,
the Metrowerks assembler cannot be used.
mwasmnlm.exe - Metrowerks x86 assembler - part of CodeWarrior tools.
(version 2.2 Built Aug 23, 1999 - not useable due to code
generation bug)
nasmw.exe - Netwide Assembler NASM
version 0.98 was used in development and testing
* Make Tool - required:
In order to build you will need a make tool. Two make tools are
supported, GNU make (gmake.exe) or Microsoft nmake.exe.
gmake.exe - GNU make for Windows (version 3.75 used for development)
http://www.gnu.org/software/make/make.html
nmake.exe - Microsoft make (Version 6.00.8168.0 used for development)
* Novell Developer Kit (NDK) - required: (http://developer.novell.com)
CLIB - BUILDS:
WinSock2 Developer Components for NetWare:
For initial development, the October 27, 2000 version was used.
However, future versions should also work.
NOTE: The WinSock2 components include headers & import files for
NetWare, but you will also need the winsock2.h and supporting
headers (pshpack4.h, poppack.h, qos.h) delivered in the
Microsoft SDK. Note: The winsock2.h support headers may change
with various versions of winsock2.h. Check the dependencies
section on the NDK WinSock2 download page for the latest
information on dependencies.
NLM and NetWare libraries for C (including CLIB and XPlat):
If you are going to build a CLIB version of OpenSSL, you will
need the CLIB headers and imports. The March, 2001 NDK release or
later is recommended.
Earlier versions should work but haven't been tested. In recent
versions the import files have been consolidated and function
names moved. This means you may run into link problems
(undefined symbols) when using earlier versions. The functions
are available in earlier versions, but you will have to modifiy
the make files to include additional import files (see
openssl\util\pl\netware.pl).
LIBC - BUILDS:
Libraries for C (LibC) - LibC headers and import files
If you are going to build a LibC version of OpenSSL, you will
need the LibC headers and imports. The March 14, 2002 NDK release or
later is required.
NOTE: The LibC SDK includes the necessary WinSock2 support. It
It is not necessary to download the WinSock2 Developer when building
for LibC.
BUILDING:
---------
Before building, you will need to set a few environment variables. You can
set them manually or you can modify the "netware\set_env.bat" file.
The set_env.bat file is a template you can use to set up the path
and environment variables you will need to build. Modify the
various lines to point to YOUR tools and run set_env.bat.
netware\set_env.bat [target]
target - "netware-clib" - CLib NetWare build
- "netware-libc" - LibC NetWare build
If you don't use set_env.bat, you will need to set up the following
environment variables:
path - Set path to point to the tools you will use.
MWCIncludes - The location of the NDK include files.
CLIB ex: set MWCIncludes=c:\ndk\nwsdk\include\nlm
LibC ex: set MWCIncludes=c:\ndk\libc\include
PRELUDE - The absolute path of the prelude object to link with. For
a CLIB build it is recommended you use the "nwpre.obj" file shipped
with the Metrowerks PDK for NetWare. For a LibC build you should
use the "libcpre.o" file delivered with the LibC NDK components.
CLIB ex: set PRELUDE=c:\codewar\novell support\metrowerks support\
libraries\runtime\nwpre.obj
LibC ex: set PRELUDE=c:\ndk\libc\imports\libcpre.o
IMPORTS - The locaton of the NDK import files.
CLIB ex: set IMPORTS=c:\ndk\nwsdk\imports
LibC ex: set IMPORTS=c:\ndk\libc\imports
In order to build, you need to run the Perl scripts to configure the build
process and generate a make file. There is a batch file,
"netware\build.bat", to automate the process.
Build.bat runs the build configuration scripts and generates a make file.
If an assembly option is specified, it also runs the scripts to generate
the assembly code. Always run build.bat from the "openssl" directory.
netware\build [target] [debug opts] [assembly opts] [configure opts]
target - "netware-clib" - CLib NetWare build
- "netware-libc" - LibC NetWare build
debug opts - "debug" - build debug
assembly opts - "nw-mwasm" - use Metrowerks assembler
"nw-nasm" - use NASM assembler
"no-asm" - don't use assembly
configure opts- all unrecognized arguments are passed to the
perl configure script
examples:
CLIB build, debug, without assembly:
netware\build.bat netware-clib debug no-asm
LibC build, non-debug, using NASM assembly:
netware\build.bat netware-libc nw-nasm
Running build.bat generates a make file to be processed by your make
tool (gmake or nmake):
CLIB ex: gmake -f netware\nlm_clib.mak
LibC ex: gmake -f netware\nlm_libc.mak
You can also run the build scripts manually if you do not want to use the
build.bat file. Run the following scripts in the "\openssl"
subdirectory (in the order listed below):
perl configure no-asm [other config opts] [netware-clib|netware-libc]
configures no assembly build for specified netware environment
(CLIB or LibC).
perl util\mkfiles.pl >MINFO
generates a listing of source files (used by mk1mf)
perl util\mk1mf.pl no-asm [other config opts] [netware-clib|netware-libc >netware\nlm.mak
generates the makefile for NetWare
gmake -f netware\nlm.mak
build with the make tool (nmake.exe also works)
NOTE: If you are building using the assembly option, you must also run the
various Perl scripts to generate the assembly files. See build.bat
for an example of running the various assembly scripts. You must use the
"no-asm" option to build without assembly. The configure and mk1mf scripts
also have various other options. See the scripts for more information.
The output from the build is placed in the following directories:
CLIB Debug build:
out_nw_clib.dbg - static libs & test nlm(s)
tmp_nw_clib.dbg - temporary build files
outinc_nw_clib - necessary include files
CLIB Non-debug build:
out_nw_clib - static libs & test nlm(s)
tmp_nw_clib - temporary build files
outinc_nw_clib - necesary include files
LibC Debug build:
out_nw_libc.dbg - static libs & test nlm(s)
tmp_nw_libc.dbg - temporary build files
outinc_nw_libc - necessary include files
LibC Non-debug build:
out_nw_libc - static libs & test nlm(s)
tmp_nw_libc - temporary build files
outinc_nw_libc - necesary include files
TESTING:
--------
The build process creates the OpenSSL static libs ( crypto.lib, ssl.lib,
rsaglue.lib ) and several test programs. You should copy the test programs
to your NetWare server and run the tests.
The batch file "netware\cpy_tests.bat" will copy all the necessary files
to your server for testing. In order to run the batch file, you need a
drive mapped to your target server. It will create an "OpenSSL" directory
on the drive and copy the test files to it. CAUTION: If a directory with the
name of "OpenSSL" already exists, it will be deleted.
To run cpy_tests.bat:
netware\cpy_tests [output directory] [NetWare drive]
output directory - "out_nw_clib.dbg", "out_nw_libc", etc.
NetWare drive - drive letter of mapped drive
CLIB ex: netware\cpy_tests out_nw_clib m:
LibC ex: netware\cpy_tests out_nw_libc m:
The Perl script, "do_tests.pl", in the "OpenSSL" directory on the server
should be used to execute the tests. Before running the script, make sure
your SEARCH PATH includes the "OpenSSL" directory. For example, if you
copied the files to the "sys:" volume you use the command:
SEARCH ADD SYS:\OPENSSL
To run do_tests.pl type (at the console prompt):
perl \openssl\do_tests.pl [options]
options:
-p - pause after executing each test
The do_tests.pl script generates a log file "\openssl\test_out\tests.log"
which should be reviewed for errors. Any errors will be denoted by the word
"ERROR" in the log.
NOTE: Currently (11/2002), the LibC test nlms report an error while loading
when launched from the perl script (do_tests.pl). The problems are
being addressed by the LibC development team and should be fixed in the
next release. Until the problems are corrected, the LibC test nlms
will have to be executed manually.
DEVELOPING WITH THE OPENSSL SDK:
--------------------------------
Now that everything is built and tested, you are ready to use the OpenSSL
libraries in your development.
There is no real installation procedure, just copy the static libs and
headers to your build location. The libs (crypto.lib & ssl.lib) are
located in the appropriate "out_nw_XXXX" directory
(out_nw_clib, out_nw_libc, etc).
The headers are located in the appropriate "outinc_nw_XXX" directory
(outinc_nw_clib, outinc_nw_libc).
One suggestion is to create the following directory
structure for the OpenSSL SDK:
\openssl
|- bin
| |- openssl.nlm
| |- (other tests you want)
|
|- lib
| | - crypto.lib
| | - ssl.lib
|
|- include
| | - openssl
| | | - (all the headers in "outinc_nw\openssl")
The program "openssl.nlm" can be very useful. It has dozens of
options and you may want to keep it handy for debugging, testing, etc.
When building your apps using OpenSSL, define "NETWARE". It is needed by
some of the OpenSSL headers. One way to do this is with a compile option,
for example "-DNETWARE".
NOTES:
------
Resource leaks in Tests
------------------------
Some OpenSSL tests do not clean up resources and NetWare reports
the resource leaks when the tests unload. If this really bugs you,
you can stop the messages by setting the developer option off at the console
prompt (set developer option = off). Or better yet, fix the tests to
clean up the resources!
Multi-threaded Development
---------------------------
The NetWare version of OpenSSL is thread-safe however, multi-threaded
applications must provide the necessary locking function callbacks. This
is described in doc\threads.doc. The file "openssl\crypto\threads\mttest.c"
is a multi-threaded test program and demonstrates the locking functions.
What is openssl2.nlm?
---------------------
The openssl program has numerous options and can be used for many different
things. Many of the options operate in an interactive mode requiring the
user to enter data. Because of this, a default screen is created for the
program. However, when running the test script it is not desirable to
have a seperate screen. Therefore, the build also creates openssl2.nlm.
Openssl2.nlm is functionally identical but uses the console screen.
Openssl2 can be used when a non-interactive mode is desired.
NOTE: There are may other possibilities (command line options, etc)
which could have been used to address the screen issue. The openssl2.nlm
option was chosen because it impacted only the build not the code.
Why only static libraries?
--------------------------
Globals, globals, and more globals. The OpenSSL code uses many global
variables that are allocated and initialized when used for the first time.
On NetWare, most applications (at least historically) run in the kernel.
When running in the kernel, there is one instance of global variables.
For regular application type NLM(s) this isn't a problem because they are
the only ones using the globals. However, for a library NLM (an NLM which
exposes functions and has no threads of execution), the globals cause
problems. Applications could inadvertently step on each other if they
change some globals. Even worse, the first application that triggers a
global to be allocated and initialized has the allocated memory charged to
itself. Now when that application unloads, NetWare will clean up all the
applicaton's memory. The global pointer variables inside OpenSSL now
point to freed memory. An abend waiting to happen!
To work correctly in the kernel, library NLM(s) that use globals need to
provide a set of globals (instance data) for each application. Another
option is to require the library only be loaded in a protected address
space along with the application using it.
Modifying the OpenSSL code to provide a set of globals (instance data) for
each application isn't technically difficult, but due to the large number
globals it would require substantial code changes and it wasn't done. Hence,
the build currently only builds static libraries which are then linked
into each application.
NOTE: If you are building a library NLM that uses the OpenSSL static
libraries, you will still have to deal with the global variable issue.
This is because when you link in the OpenSSL code you bring in all the
globals. One possible solution for the global pointer variables is to
register memory functions with OpenSSL which allocate memory and charge it
to your library NLM (see the function CRYPTO_set_mem_functions). However,
be aware that now all memory allocated by OpenSSL is charged to your NLM.
CodeWarrior Tools and W2K
---------------------------
There have been problems reported with the CodeWarrior Linker
(mwldnlm.exe) in the PDK 2.1 for NetWare when running on Windows 2000. The
problems cause the link step to fail. The only work around is to obtain an
updated linker from Metrowerks. It is expected Metrowerks will release
PDK 3.0 (in beta testing at this time - May, 2001) in the near future which
will fix these problems.
Makefile "vclean"
------------------
The generated makefile has a "vclean" target which cleans up the build
directories. If you have been building successfully and suddenly
experience problems, use "vclean" (gmake -f netware\nlm.mak vclean) and retry.
"Undefined Symbol" Linker errors
--------------------------------
There have been linker errors reported when doing a CLIB build. The problems
occur because some versions of the CLIB SDK import files inadvertently
left out some symbols. One symbol in particular is "_lrotl". The missing
functions are actually delivered in the binaries, but they were left out of
the import files. The issues should be fixed in the September 2001 release
of the NDK. If you experience the problems you can temporarily
work around it by manually adding the missing symbols to your version of
"clib.imp".

View File

@@ -2,19 +2,28 @@
INSTALLATION ON THE WIN32 PLATFORM INSTALLATION ON THE WIN32 PLATFORM
---------------------------------- ----------------------------------
[Instructions for building for Windows CE can be found in INSTALL.WCE]
Heres a few comments about building OpenSSL in Windows environments. Most Heres a few comments about building OpenSSL in Windows environments. Most
of this is tested on Win32 but it may also work in Win 3.1 with some of 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. Unless you will build on Cygwin, you will need
ActiveState Perl, 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 (Cygwin or MinGW)
If you are compiling from a tarball or a CVS snapshot then the Win32 files
may well be not up to date. This may mean that some "tweaking" is required to
get it all to work. See the trouble shooting section later on for if (when?)
it goes wrong.
Visual C++
----------
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
@@ -24,26 +33,19 @@
* Microsoft MASM (aka "ml") * Microsoft MASM (aka "ml")
* Free Netwide Assembler NASM. * Free Netwide Assembler NASM.
MASM was at one point distributed with VC++. It is now distributed with some MASM is distributed with most versions of VC++. For the versions where it is
Microsoft DDKs, for example the Windows NT 4.0 DDK and the Windows 98 DDK. If not included in VC++, it is also distributed with some Microsoft DDKs, for
you do not have either of these DDKs then you can just download the binaries example the Windows NT 4.0 DDK and the Windows 98 DDK. If you do not have
for the Windows 98 DDK and extract and rename the two files XXXXXml.exe and either of these DDKs then you can just download the binaries for the Windows
XXXXXml.err, to ml.exe and ml.err and install somewhere on your PATH. Both 98 DDK and extract and rename the two files XXXXXml.exe and XXXXXml.err, to
DDKs can be downloaded from the Microsoft developers site www.msdn.com. ml.exe and ml.err and install somewhere on your PATH. Both DDKs can be
downloaded from the Microsoft developers site www.msdn.com.
NASM is freely available. Version 0.98 was used during testing: other versions NASM is freely available. Version 0.98 was used during testing: other versions
may also work. It is available from many places, see for example: may also work. It is available from many places, see for example:
http://www.kernel.org/pub/software/devel/nasm/binaries/win32/ http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
The NASM binary nasmw.exe needs to be installed anywhere on your PATH. The NASM binary nasmw.exe needs to be installed anywhere on your PATH.
If you are compiling from a tarball or a CVS snapshot then the Win32 files
may well be not up to date. This may mean that some "tweaking" is required to
get it all to work. See the trouble shooting section later on for if (when?)
it goes wrong.
Visual C++
----------
Firstly you should run Configure: Firstly you should run Configure:
> perl Configure VC-WIN32 > perl Configure VC-WIN32
@@ -82,7 +84,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 mk1mf.pl lines in the do_* batch file then debugging symbols will be
compiled in. compiled in. Note that mk1mf.pl expects the platform to be the last argument
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.
@@ -116,18 +119,72 @@
* Run make: * Run make:
> make -f bcb.mak > make -f bcb.mak
GNU C (Mingw32) GNU C (Cygwin)
--------------- --------------
To build OpenSSL, you need the Mingw32 package and GNU make. Cygwin provides a bash shell and GNU tools environment running
on NT 4.0, Windows 9x, Windows ME, Windows 2000, and Windows XP.
Consequently, a make of OpenSSL with Cygwin is closer to a GNU
bash environment such as Linux than to other the other Win32
makes.
Cygwin implements a Posix/Unix runtime system (cygwin1.dll).
It is also possible to create Win32 binaries that only use the
Microsoft C runtime system (msvcrt.dll or crtdll.dll) using
MinGW. MinGW can be used in the Cygwin development environment
or in a standalone setup as described in the following section.
To build OpenSSL using Cygwin:
* Install Cygwin (see http://cygwin.com/)
* Install Perl and ensure it is in the path. Both Cygwin perl
(5.6.1-2 or newer) and ActivePerl work.
* Run the Cygwin bash shell
* $ tar zxvf openssl-x.x.x.tar.gz
$ cd openssl-x.x.x
To build the Cygwin version of OpenSSL:
$ ./config
[...]
$ make
[...]
$ make test
$ make install
This will create a default install in /usr/local/ssl.
To build the MinGW version (native Windows) in Cygwin:
$ ./Configure mingw
[...]
$ make
[...]
$ make test
$ make install
Cygwin Notes:
"make test" and normal file operations may fail in directories
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
stripping of carriage returns. To avoid this ensure that a binary
mount is used, e.g. mount -b c:\somewhere /home.
"bc" is not provided in older Cygwin distribution. This causes a
non-fatal error in "make test" but is otherwise harmless. If
desired and needed, GNU bc can be built with Cygwin without change.
GNU C (MinGW)
-------------
* Compiler installation: * Compiler installation:
Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/ MinGW is available from http://www.mingw.org. Run the installer and
gnu-win32/mingw32/gcc-2.95.2/gcc-2.95.2-msvcrt.exe>. Extract it set the MinGW bin directory to the PATH in "System Properties" or
to a directory such as C:\gcc-2.95.2 and add c:\gcc-2.95.2\bin to autoexec.bat.
the PATH environment variable in "System Properties"; or edit and
run C:\gcc-2.95.2\mingw32.bat to set the PATH.
* Compile OpenSSL: * Compile OpenSSL:
@@ -149,49 +206,6 @@
> cd out > cd out
> ..\ms\test > ..\ms\test
GNU C (Cygwin)
--------------
Cygwin provides a bash shell and GNU tools environment running
on NT 4.0, Windows 9x, Windows ME, Windows 2000, and Windows XP.
Consequently, a make of OpenSSL with Cygwin is closer to a GNU
bash environment such as Linux than to other W32 makes which are
based on a single makefile approach. Cygwin implements Posix/Unix
calls through cygwin1.dll, and is contrasted to Mingw32 which links
dynamically to msvcrt.dll or crtdll.dll.
To build OpenSSL using Cygwin:
* Install Cygwin (see http://cygwin.com/)
* Install Perl and ensure it is in the path (recent Cygwin perl
(version 5.6.1-2 of the latter has been reported to work) or
ActivePerl)
* Run the Cygwin bash shell
* $ tar zxvf openssl-x.x.x.tar.gz
$ cd openssl-x.x.x
$ ./config
[...]
$ make
[...]
$ make test
$ make install
This will create a default install in /usr/local/ssl.
Cygwin Notes:
"make test" and normal file operations may fail in directories
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
stripping of carriage returns. To avoid this ensure that a binary
mount is used, e.g. mount -b c:\somewhere /home.
"bc" is not provided in older Cygwin distribution. This causes a
non-fatal error in "make test" but is otherwise harmless. If
desired and needed, GNU bc can be built with Cygwin without change.
Installation Installation
------------ ------------
@@ -211,7 +225,7 @@
$ md c:\openssl\lib $ md c:\openssl\lib
$ md c:\openssl\include $ md c:\openssl\include
$ md c:\openssl\include\openssl $ md c:\openssl\include\openssl
$ copy /b inc32\* c:\openssl\include\openssl $ copy /b inc32\openssl\* c:\openssl\include\openssl
$ copy /b out32dll\ssleay32.lib c:\openssl\lib $ copy /b out32dll\ssleay32.lib c:\openssl\lib
$ copy /b out32dll\libeay32.lib c:\openssl\lib $ copy /b out32dll\libeay32.lib c:\openssl\lib
$ copy /b out32dll\ssleay32.dll c:\openssl\bin $ copy /b out32dll\ssleay32.dll c:\openssl\bin

71
INSTALL.WCE Normal file
View File

@@ -0,0 +1,71 @@
INSTALLATION FOR THE WINDOWS CE PLATFORM
----------------------------------------
Building OpenSSL for Windows CE requires the following external tools:
* Microsoft eMbedded Visual C++ 3.0
* wcecompat compatibility library (www.essemer.com.au)
* Optionally ceutils for running automated tests (www.essemer.com.au)
You also need Perl for Win32. You will need ActiveState Perl, available
from http://www.activestate.com/ActivePerl.
Windows CE support in OpenSSL relies on wcecompat. All Windows CE specific
issues should be directed to www.essemer.com.au.
The C Runtime Library implementation for Windows CE that is included with
Microsoft eMbedded Visual C++ 3.0 is incomplete and in some places
incorrect. wcecompat plugs the holes and tries to bring the Windows CE
CRT to a level that is more compatible with ANSI C. wcecompat goes further
and provides low-level IO and stream IO support for stdin/stdout/stderr
(which Windows CE does not provide). This IO functionality is not needed
by the OpenSSL library itself but is used for the tests and openssl.exe.
More information is available at www.essemer.com.au.
Building
--------
Setup the eMbedded Visual C++ environment. There are batch files for doing
this installed with eVC++. For an ARM processor, for example, execute:
> "C:\Program Files\Microsoft eMbedded Tools\EVC\WCE300\BIN\WCEARM.BAT"
Next indicate where wcecompat is located:
> set WCECOMPAT=C:\wcecompat
Next you should run Configure:
> perl Configure VC-CE
Next you need to build the Makefiles:
> ms\do_ms
If you get errors about things not having numbers assigned then check the
troubleshooting section in INSTALL.W32: you probably won't be able to compile
it as it stands.
Then from the VC++ environment at a prompt do:
- to build static libraries:
> nmake -f ms\ce.mak
- or to build DLLs:
> nmake -f ms\cedll.mak
If all is well it should compile and you will have some static libraries and
executables in out32, or some DLLs and executables in out32dll. If you want
to try the tests then make sure the ceutils are in the path and do:
> cd out32
> ..\ms\testce
This will copy each of the test programs to the Windows CE device and execute
them, displaying the output of the tests on this computer. The output should
look similar to the output produced by running the tests for a regular Windows
build.

View File

@@ -12,7 +12,7 @@
--------------- ---------------
/* ==================================================================== /* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Copyright (c) 1998-2003 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

@@ -2750,4 +2750,4 @@ void SkipWhiteSpace(char **ioSrcCharPtr,const Boolean inStopAtEOL)
} }
} }
} }
} }

View File

@@ -167,4 +167,4 @@ void ThrowErrorMessageException(void)
ThrowDescriptiveException(gErrorMessage); ThrowDescriptiveException(gErrorMessage);
} }
#endif #endif

View File

@@ -1287,7 +1287,7 @@ EXITPOINT:
// Send some bytes // Send some bytes
int MacSocket_send(const int inSocketNum,void *inBuff,int inBuffLength) int MacSocket_send(const int inSocketNum,const 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,void *inBuff,int inBuffLength); int MacSocket_send(const int inSocketNum,const 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

@@ -15,6 +15,11 @@ OPTIONS=
CONFIGURE_ARGS= CONFIGURE_ARGS=
SHLIB_TARGET= SHLIB_TARGET=
# HERE indicates where this Makefile lives. This can be used to indicate
# where sub-Makefiles are expected to be. Currently has very limited usage,
# and should probably not be bothered with at all.
HERE=.
# INSTALL_PREFIX is for package builders so that they can configure # INSTALL_PREFIX is for package builders so that they can configure
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/. # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
# Normally it is left empty. # Normally it is left empty.
@@ -59,13 +64,22 @@ DEPFLAG=
PEX_LIBS= PEX_LIBS=
EX_LIBS= EX_LIBS=
EXE_EXT= EXE_EXT=
AR=ar r ARFLAGS=
AR=ar $(ARFLAGS) r
RANLIB= ranlib RANLIB= ranlib
PERL= perl PERL= perl
TAR= tar TAR= tar
TARFLAGS= --no-recursion TARFLAGS= --no-recursion
MAKEDEPPROG=makedepend MAKEDEPPROG=makedepend
# We let the C compiler driver to take care of .s files. This is done in
# order to be excused from maintaining a separate set of architecture
# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
# gcc, then the driver will automatically translate it to -xarch=v8plus
# and pass it down to assembler.
AS=$(CC) -c
ASFLAG=$(CFLAG)
# Set BN_ASM to bn_asm.o if you want to use the C version # Set BN_ASM to bn_asm.o if you want to use the C version
BN_ASM= bn_asm.o BN_ASM= bn_asm.o
#BN_ASM= bn_asm.o #BN_ASM= bn_asm.o
@@ -155,31 +169,31 @@ RMD160_ASM_OBJ= asm/rm86-out.o
KRB5_INCLUDES= KRB5_INCLUDES=
LIBKRB5= LIBKRB5=
# When we're prepared to use shared libraries in the programs we link here DIRS= crypto ssl engines apps test tools
# we might set SHLIB_MARK to '$(SHARED_LIBS)'.
SHLIB_MARK=
DIRS= crypto ssl $(SHLIB_MARK) apps test tools
SHLIBDIRS= crypto ssl SHLIBDIRS= crypto ssl
# dirs in crypto to build # dirs in crypto to build
SDIRS= \ SDIRS= \
objects \
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 ec rsa dsa ecdsa dh dso engine aes \ bn ec rsa dsa ecdsa dh ecdh dso engine aes \
buffer bio stack lhash rand err objects \ buffer bio stack lhash rand err \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
store
# tests to perform. "alltests" is a special word indicating that all tests # tests to perform. "alltests" is a special word indicating that all tests
# should be performed. # should be performed.
TESTS = alltests TESTS = alltests
MAKEFILE= Makefile.ssl MAKEFILE= Makefile.ssl
MAKE= make -f Makefile.ssl NEWMAKE= make
MAKE= $(NEWMAKE) -f Makefile.ssl
MANDIR=$(OPENSSLDIR)/man MANDIR=$(OPENSSLDIR)/man
MAN1=1 MAN1=1
MAN3=3 MAN3=3
MANSUFFIX=
SHELL=/bin/sh SHELL=/bin/sh
TOP= . TOP= .
@@ -201,21 +215,33 @@ WTARFILE= $(NAME)-win.tar
EXHEADER= e_os2.h EXHEADER= e_os2.h
HEADER= e_os.h HEADER= e_os.h
# When we're prepared to use shared libraries in the programs we link here all: Makefile.ssl build_all openssl.pc
# we might remove 'clean-shared' from the targets to perform at this stage
all: Makefile.ssl sub_all BUILD_CMD=if echo " $(DIRS) " | grep " $$i " >/dev/null 2>/dev/null; then \
sub_all:
@for i in $(DIRS); \
do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making all in $$i..." && \ (cd $$i && echo "making all in $$i..." && \
$(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}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \ $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' 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}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
else \ else \
$(MAKE) $$i; \ $(MAKE) $$i; \
fi; \ fi; fi
done;
sub_all: build_all
build_all: build_libs build_apps build_tests build_tools
build_libs: build_crypto build_ssl build_engines
build_crypto:
@i=crypto; $(BUILD_CMD)
build_ssl:
@i=ssl; $(BUILD_CMD)
build_engines:
@i=engines; $(BUILD_CMD)
build_apps:
@i=apps; $(BUILD_CMD)
build_tests:
@i=test; $(BUILD_CMD)
build_tools:
@i=tools; $(BUILD_CMD)
libcrypto$(SHLIB_EXT): libcrypto.a libcrypto$(SHLIB_EXT): libcrypto.a
@if [ "$(SHLIB_TARGET)" != "" ]; then \ @if [ "$(SHLIB_TARGET)" != "" ]; then \
@@ -232,7 +258,7 @@ libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
fi fi
clean-shared: clean-shared:
@for i in $(SHLIBDIRS); do \ @set -e; for i in $(SHLIBDIRS); do \
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
tmp="$(SHARED_LIBS_LINK_EXTS)"; \ tmp="$(SHARED_LIBS_LINK_EXTS)"; \
for j in $${tmp:-x}; do \ for j in $${tmp:-x}; do \
@@ -246,273 +272,44 @@ clean-shared:
done done
link-shared: link-shared:
@if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ @ set -e; for i in ${SHLIBDIRS}; do \
tmp="$(SHARED_LIBS_LINK_EXTS)"; \ $(NEWMAKE) -f $(HERE)/Makefile.shared \
for i in $(SHLIBDIRS); do \ LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
prev=lib$$i$(SHLIB_EXT); \ LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
for j in $${tmp:-x}; do \ symlink.$(SHLIB_TARGET); \
( set -x; ln -f -s $$prev lib$$i$$j ); \ libs="$$libs -l$$i"; \
prev=lib$$i$$j; \
done; \
done; \
fi
build-shared: clean-shared do_$(SHLIB_TARGET) link-shared
do_bsd-gcc-shared: do_gnu-shared
do_linux-shared: do_gnu-shared
do_gnu-shared:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} ${SHARED_LDFLAGS} \
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-Bsymbolic \
-Wl,--whole-archive lib$$i.a \
-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \
done done
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \ build-shared: do_$(SHLIB_TARGET) link-shared
collect2=`gcc -print-prog-name=collect2 2>&1` && \
[ -n "$$collect2" ] && \
my_ld=`$$collect2 --help 2>&1 | grep Usage: | sed 's/^Usage: *\([^ ][^ ]*\).*/\1/'` && \
[ -n "$$my_ld" ] && \
$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
# For Darwin AKA Mac OS/X (dyld) do_$(SHLIB_TARGET):
do_darwin-shared: @ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
( set -x ; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \ libs="$(LIBKRB5) $$libs"; \
lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \ fi; \
-compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \ $(NEWMAKE) -f Makefile.shared \
-install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \ CC="$(CC)" LDFLAGS="$(LDFLAGS)" \
libs="$$libs -l`basename $$i${SHLIB_EXT} .dylib`"; \ SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
echo "" ; \ LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
LIBDEPS="$$libs $(EX_LIBS)" \
LIBRPATH="$(INSTALLTOP)/lib" \
link_a.$(SHLIB_TARGET); \
libs="-l$$i $$libs"; \
done done
do_cygwin-shared: openssl.pc: Makefile.ssl
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ @ ( echo 'prefix=$(INSTALLTOP)'; \
( set -x; ${CC} -shared -o cyg$$i.dll \ echo 'exec_prefix=$${prefix}'; \
-Wl,-Bsymbolic \ echo 'libdir=$${exec_prefix}/lib'; \
-Wl,--whole-archive lib$$i.a \ echo 'includedir=$${prefix}/include'; \
-Wl,--out-implib,lib$$i.dll.a \ echo ''; \
-Wl,--no-whole-archive $$libs ) || exit 1; \ echo 'Name: OpenSSL'; \
libs="$$libs -l$$i"; \ echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
done echo 'Version: '$(VERSION); \
echo 'Requires: '; \
# This assumes that GNU utilities are *not* used echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
do_alpha-osf1-shared: echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} ${SHARED_LDFLAGS} \
-shared -o lib$$i.so \
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# This assumes that GNU utilities are *not* used
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
# option passed to the linker.
do_tru64-shared:
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} ${SHARED_LDFLAGS} \
-shared -msym -o lib$$i.so \
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# This assumes that GNU utilities are *not* used
# The difference between tru64-shared and tru64-shared-rpath is the
# -rpath ${INSTALLTOP}/lib passed to the linker.
do_tru64-shared-rpath:
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} ${SHARED_LDFLAGS} \
-shared -msym -o lib$$i.so \
-rpath ${INSTALLTOP}/lib \
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# This assumes that GNU utilities are *not* used
do_solaris-shared:
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
set -x; ${CC} ${SHARED_LDFLAGS} \
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# OpenServer 5 native compilers used
do_svr3-shared:
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
find . -name "*.o" -print > allobjs ; \
OBJS= ; export OBJS ; \
for obj in `ar t lib$$i.a` ; do \
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
done ; \
set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# UnixWare 7 and OpenUNIX 8 native compilers used
do_svr5-shared:
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
find . -name "*.o" -print > allobjs ; \
OBJS= ; export OBJS ; \
for obj in `ar t lib$$i.a` ; do \
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
done ; \
set -x; ${CC} ${SHARED_LDFLAGS} \
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# This assumes that GNU utilities are *not* used
do_irix-shared:
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} ${SHARED_LDFLAGS} \
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# This assumes that GNU utilities are *not* used
# HP-UX includes the full pathname of libs we depend on, so we would get
# ./libcrypto (with ./ as path information) compiled into libssl, hence
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
# anyway.
# The object modules are loaded from lib$i.a using the undocumented -Fl
# option.
#
# WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
# by temporarily specifying "+s"!
#
do_hpux-shared:
for i in ${SHLIBDIRS}; do \
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
+vnocompatwarnings \
-b -z +s \
-o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Fl lib$$i.a -ldld -lc ) || exit 1; \
chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
done
# This assumes that GNU utilities are *not* used
# HP-UX includes the full pathname of libs we depend on, so we would get
# ./libcrypto (with ./ as path information) compiled into libssl, hence
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
# anyway.
#
# HP-UX in 64bit mode has "+s" enabled by default; it will search for
# shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
#
do_hpux64-shared:
for i in ${SHLIBDIRS}; do \
( 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 -ldl -lc ) || exit 1; \
chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
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"; \
done
do_reliantunix-shared:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
tmpdir=/tmp/openssl.$$$$ ; rm -rf $$tmpdir ; \
( set -x; \
( Opwd=`pwd` ; mkdir $$tmpdir || exit 1; \
cd $$tmpdir || exit 1 ; ar x $$Opwd/lib$$i.a ; \
${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
) || exit 1; \
cp $$tmpdir/lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} . ; \
) || exit 1; \
rm -rf $$tmpdir ; \
libs="$$libs -l$$i"; \
done
Makefile.ssl: Makefile.org Makefile.ssl: Makefile.org
@echo "Makefile.ssl is older than Makefile.org." @echo "Makefile.ssl is older than Makefile.org."
@@ -520,11 +317,11 @@ Makefile.ssl: Makefile.org
@false @false
libclean: libclean:
rm -f *.a */lib */*/lib rm -f *.map *.so *.so.* engines/*.so *.a */lib */*/lib
clean: clean: libclean
rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
@for i in $(DIRS) ;\ @set -e; for i in $(DIRS) ;\
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making clean in $$i..." && \ (cd $$i && echo "making clean in $$i..." && \
@@ -532,9 +329,10 @@ clean:
rm -f $(LIBS); \ rm -f $(LIBS); \
fi; \ fi; \
done; done;
rm -f *.a *.o speed.* *.map *.so .pure core rm -f openssl.pc
rm -f speed.* .pure
rm -f $(TARFILE) rm -f $(TARFILE)
@for i in $(ONEDIRS) ;\ @set -e; for i in $(ONEDIRS) ;\
do \ do \
rm -fr $$i/*; \ rm -fr $$i/*; \
done done
@@ -545,7 +343,7 @@ makefile.one: files
files: files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO $(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
@for i in $(DIRS) ;\ @set -e; for i in $(DIRS) ;\
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making 'files' in $$i..." && \ (cd $$i && echo "making 'files' in $$i..." && \
@@ -557,16 +355,20 @@ links:
@$(TOP)/util/point.sh Makefile.ssl Makefile @$(TOP)/util/point.sh Makefile.ssl Makefile
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER) @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
@for i in $(DIRS); do \ @set -e; for i in $(DIRS); do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making links in $$i..." && \ (cd $$i && echo "making links in $$i..." && \
$(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}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \ $(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}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
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) ;\ @set -e; for i in $(DIRS) ;\
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making dclean in $$i..." && \ (cd $$i && echo "making dclean in $$i..." && \
@@ -578,8 +380,12 @@ rehash: rehash.time
rehash.time: certs rehash.time: certs
@(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \ @(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
export OPENSSL OPENSSL_DEBUG_MEMORY; \ export OPENSSL OPENSSL_DEBUG_MEMORY; \
LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \ LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
LIBPATH="`pwd`:$$LIBPATH"; \
if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
$(PERL) tools/c_rehash certs) $(PERL) tools/c_rehash certs)
touch rehash.time touch rehash.time
@@ -588,15 +394,19 @@ 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}' 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 tests ); $(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 tests );
@LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \ @LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
apps/openssl version -a SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
LIBPATH="`pwd`:$$LIBPATH"; \
if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
apps/openssl version -a
report: report:
@$(PERL) util/selftest.pl @$(PERL) util/selftest.pl
depend: depend:
@for i in $(DIRS) ;\ @set -e; for i in $(DIRS) ;\
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making dependencies $$i..." && \ (cd $$i && echo "making dependencies $$i..." && \
@@ -605,7 +415,7 @@ depend:
done; done;
lint: lint:
@for i in $(DIRS) ;\ @set -e; for i in $(DIRS) ;\
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making lint $$i..." && \ (cd $$i && echo "making lint $$i..." && \
@@ -614,7 +424,7 @@ lint:
done; done;
tags: tags:
@for i in $(DIRS) ;\ @set -e; for i in $(DIRS) ;\
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i && echo "making tags $$i..." && \ (cd $$i && echo "making tags $$i..." && \
@@ -624,7 +434,7 @@ tags:
errors: errors:
$(PERL) util/mkerr.pl -recurse -write $(PERL) util/mkerr.pl -recurse -write
(cd crypto/engine; $(MAKE) PERL=$(PERL) errors) (cd engines; $(MAKE) PERL=$(PERL) errors)
stacks: stacks:
$(PERL) util/mkstack.pl -write $(PERL) util/mkstack.pl -write
@@ -652,6 +462,9 @@ update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option. # tar does not support the --files-from option.
tar: tar:
find . -type d -print | xargs chmod 755
find . -type f -print | xargs chmod a+r
find . -type f -perm -0100 -print | xargs chmod a+x
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
tardy --user_number=0 --user_name=openssl \ tardy --user_number=0 --user_name=openssl \
@@ -681,54 +494,68 @@ dist_pem_h:
install: all install_docs install: all install_docs
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \ $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
$(INSTALL_PREFIX)$(INSTALLTOP)/engines \
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
$(INSTALL_PREFIX)$(OPENSSLDIR)/private \ $(INSTALL_PREFIX)$(OPENSSLDIR)/private \
$(INSTALL_PREFIX)$(OPENSSLDIR)/lib $(INSTALL_PREFIX)$(OPENSSLDIR)/lib
@for i in $(EXHEADER) ;\ @set -e; for i in $(EXHEADER) ;\
do \ do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done; done;
@for i in $(DIRS) ;\ @set -e; for i in $(DIRS) ;\
do \ do \
if [ -d "$$i" ]; then \ if [ -d "$$i" ]; then \
(cd $$i; echo "installing $$i..."; \ (cd $$i; echo "installing $$i..."; \
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' install ); \ $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' install ); \
fi; \ fi; \
done done
@for i in $(LIBS) ;\ @set -e; for i in $(LIBS) ;\
do \ do \
if [ -f "$$i" ]; then \ if [ -f "$$i" ]; then \
( echo installing $$i; \ ( echo installing $$i; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
fi; \ fi; \
done; done;
@if [ -n "$(SHARED_LIBS)" ]; then \ @set -e; 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" -o -f "$$i.a" ]; then \
( echo installing $$i; \ ( echo installing $$i; \
if [ "$(PLATFORM)" != "Cygwin" ]; then \ 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; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
else \ else \
c=`echo $$i | sed 's/^lib/cyg/'`; \ c=`echo $$i | sed 's/^lib/cyg/'`; \
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \ cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \ cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
fi ); \ fi ); \
fi; \ fi; \
done; \ done; \
( here="`pwd`"; \ ( here="`pwd`"; \
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
make -f $$here/Makefile link-shared ); \ $(NEWMAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
if [ "$(INSTALLTOP)" != "/usr" ]; then \
echo 'OpenSSL shared libraries have been installed in:'; \
echo ' $(INSTALLTOP)'; \
echo ''; \
sed -e '1,/^$$/d' doc/openssl-shared.txt; \
fi; \
fi fi
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
install_docs: install_docs:
@$(PERL) $(TOP)/util/mkdir-p.pl \ @$(PERL) $(TOP)/util/mkdir-p.pl \
@@ -736,25 +563,45 @@ 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
@for i in doc/apps/*.pod; do \ @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
here="`pwd`"; \
filecase=; \
if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" ]; then \
filecase=-i; \
fi; \
set -e; 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/$$fn.$${sec}$(MANSUFFIX)"; \
(cd `$(PERL) util/dirname.pl $$i`; \ (cd `$(PERL) util/dirname.pl $$i`; \
sh -c "$(PERL) `cd ../../util; ./pod2mantest ignore` \ sh -c "$$pod2man \
--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/$$fn.$${sec}$(MANSUFFIX); \
done $(PERL) util/extract-names.pl < $$i | \
@for i in doc/crypto/*.pod doc/ssl/*.pod; do \ grep -v $$filecase "^$$fn\$$" | \
grep -v "[ ]" | \
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
while read n; do \
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
done); \
done; \
set -e; 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/$$fn.$${sec}$(MANSUFFIX)"; \
(cd `$(PERL) util/dirname.pl $$i`; \ (cd `$(PERL) util/dirname.pl $$i`; \
sh -c "$(PERL) `cd ../../util; ./pod2mantest ignore` \ sh -c "$$pod2man \
--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/$$fn.$${sec}$(MANSUFFIX); \
$(PERL) util/extract-names.pl < $$i | \
grep -v $$filecase "^$$fn\$$" | \
grep -v "[ ]" | \
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
while read n; do \
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
done); \
done done
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

786
Makefile.shared Normal file
View File

@@ -0,0 +1,786 @@
#
# Helper makefile to link shared libraries in a portable way.
# This is much simpler than libtool, and hopefully not too error-prone.
#
# The following variables need to be set on the command line to build
# properly
# CC contains the current compiler. This one MUST be defined
CC=cc
# LDFLAGS contains flags to be used when temporary object files (when building
# shared libraries) are created, or when an application is linked.
# SHARED_LDFLAGS contains flags to be used when the shared library is created.
LDFLAGS=
SHARED_LDFLAGS=
# LIBNAME contains just the name of the library, without prefix ("lib"
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
# .dll, ...). This one MUST have a value when using this makefile to
# build shared libraries.
# For example, to build libfoo.so, you need to do the following:
#LIBNAME=foo
LIBNAME=
# APPNAME contains just the name of the application, without suffix (""
# on Unix, ".exe" on Windows, ...). This one MUST have a value when using
# this makefile to build applications.
# For example, to build foo, you need to do the following:
#APPNAME=foo
APPNAME=
# OBJECTS contains all the object files to link together into the application.
# This must contain at least one object file.
#OBJECTS=foo.o
OBJECTS=
# LIBEXTRAS contains extra modules to link together with the library.
# For example, if a second library, say libbar.a needs to be linked into
# libfoo.so, you need to do the following:
#LIBEXTRAS=libbar.a
# Note that this MUST be used when using the link_o targets, to hold the
# names of all object files that go into the target library.
LIBEXTRAS=
# LIBVERSION contains the current version of the library.
# For example, to build libfoo.so.1.2, you need to do the following:
#LIBVERSION=1.2
LIBVERSION=
# LIBCOMPATVERSIONS contains the compatibility versions (a list) of
# the library. They MUST be in decreasing order.
# For example, if libfoo.so.1.2.1 is backward compatible with libfoo.so.1.2
# and libfoo.so.1, you need to do the following:
#LIBCOMPATVERSIONS=1.2 1
# Note that on systems that use sonames, the last number will appear as
# part of it.
# It's also possible, for systems that support it (Tru64, for example),
# to add extra compatibility info with more precision, by adding a second
# list of versions, separated from the first with a semicolon, like this:
#LIBCOMPATVERSIONS=1.2 1;1.2.0 1.1.2 1.1.1 1.1.0 1.0.0
LIBCOMPATVERSIONS=
# LIBDEPS contains all the flags necessary to cover all necessary
# dependencies to other libraries.
LIBDEPS=
#------------------------------------------------------------------------------
# The rest is private to this makefile.
#DEBUG=:
DEBUG=set -x
top:
echo "Trying to use this makefile interactively? Don't."
CALC_VERSIONS= \
SHLIB_COMPAT=; SHLIB_SOVER=; \
if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
prev=""; \
for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
SHLIB_SOVER_NODOT=$$v; \
SHLIB_SOVER=.$$v; \
if [ -n "$$prev" ]; then \
SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
fi; \
prev=$$v; \
done; \
fi
LINK_APP= \
( $(DEBUG); \
LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
$$LDCMD $(LDFLAGS) $$LDFLAGS -o $$APPNAME $(OBJECTS) $$LIBDEPS )
LINK_SO= \
( $(DEBUG); \
nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
$$SHAREDCMD $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
$(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp )
SYMLINK_SO= \
if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
if [ -n "$$SHLIB_COMPAT" ]; then \
for x in $$SHLIB_COMPAT; do \
( $(DEBUG); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
done; \
fi; \
if [ -n "$$SHLIB_SOVER" ]; then \
( $(DEBUG); rm -f $$SHLIB$$SHLIB_SUFFIX; \
ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
fi; \
fi
LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
LINK_SO_A_VIA_O= \
SHOBJECTS=lib$(LIBNAME).o; \
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
( $(DEBUG); \
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
$(LINK_SO) && rm -f $(LIBNAME).o
LINK_SO_A_UNPACKED= \
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
(cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && \
([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
SHOBJECTS=$$UNPACKDIR/*.o; \
$(LINK_SO) && rm -rf $$UNPACKDIR
DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
DO_GNU_SO=$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
SHAREDCMD='$(CC)'
DO_GNU_APP=LDCMD=$(CC);\
LDFLAGS="-Wl,-rpath,$(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME=$(APPNAME)
#This is rather special. It's a special target with which one can link
#applications without bothering with any features that have anything to
#do with shared libraries, for example when linking against static
#libraries. It's mostly here to avoid a lot of conditionals everywhere
#else...
link_app.:
LDCMD=$(CC); \
LDFLAGS=""; \
LIBDEPS="$(LIBDEPS)"; \
APPNAME="$(APPNAME)"; \
$(LINK_APP)
link_o.gnu:
@ $(DO_GNU_SO); $(LINK_SO_O)
link_a.gnu:
@ $(DO_GNU_SO); $(LINK_SO_A)
link_app.gnu:
@ $(DO_GNU_APP); $(LINK_APP)
# For Darwin AKA Mac OS/X (dyld)
link_o.darwin:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.dylib; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='-all_load'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="-dynamiclib"; \
SHAREDCMD='$(CC)'; \
if [ -n "$(LIBVERSION)" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
fi; \
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
fi; \
$(LINK_SO_O)
link_a.darwin:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.dylib; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='-all_load'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="-dynamiclib"; \
SHAREDCMD='$(CC)'; \
if [ -n "$(LIBVERSION)" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
fi; \
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
fi; \
$(LINK_SO_A)
link_app.darwin:
LDCMD=$(CC);\
LDFLAGS=""; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"; \
$(LINK_APP)
link_o.cygwin:
@ $(CALC_VERSIONS); \
INHIBIT_SYMLINKS=yes; \
SHLIB=cyg$(LIBNAME); \
SHLIB_SUFFIX=.dll; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_SOVER=-$(LIBVERSION); \
ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
SHAREDCMD='${CC}'; \
$(LINK_SO_O)
link_a.cygwin:
@ $(CALC_VERSIONS); \
INHIBIT_SYMLINKS=yes; \
SHLIB=cyg$(LIBNAME); \
SHLIB_SUFFIX=.dll; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
SHAREDCMD='${CC}'; \
$(LINK_SO_A)
link_app.cygwin:
LDCMD=$(CC);\
LDFLAGS=""; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME).exe"
$(LINK_APP)
link_o.alpha-osf1:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB_HIST="$(LIBVERSION)"; \
fi; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-all'; \
NOALLSYMSFLAGS='-none'; \
SHAREDFLAGS="-shared"; \
SHAREDCMD='$(CC)'; \
if [ -n "$$SHLIB_HIST" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
fi; \
fi; \
$(LINK_SO_O)
link_a.alpha-osf1:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB_HIST="$(LIBVERSION)"; \
fi; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-all'; \
NOALLSYMSFLAGS='-none'; \
SHAREDFLAGS="-shared"; \
SHAREDCMD='$(CC)'; \
if [ -n "$$SHLIB_HIST" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
fi; \
fi; \
$(LINK_SO_A)
link_app.alpha-osf1:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_APP); \
else \
LDCMD=$(CC);\
LDFLAGS=""; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"
fi; \
$(LINK_APP)
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
# option passed to the linker.
link_o.tru64:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB_HIST="$(LIBVERSION)"; \
fi; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-all'; \
NOALLSYMSFLAGS='-none'; \
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
if [ -n "$$SHLIB_HIST" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
fi; \
fi; \
$(LINK_SO_O)
link_a.tru64:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB_HIST="$(LIBVERSION)"; \
fi; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-all'; \
NOALLSYMSFLAGS='-none'; \
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
if [ -n "$$SHLIB_HIST" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
fi; \
fi; \
$(LINK_SO_A)
link_app.tru64:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_APP); \
else \
LDCMD=$(CC);\
LDFLAGS="-rpath $(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
# The difference between tru64-shared and tru64-shared-rpath is the
# -rpath ${LIBRPATH} passed to the linker.
link_o.tru64-rpath:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB_HIST="$(LIBVERSION)"; \
fi; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-all'; \
NOALLSYMSFLAGS='-none'; \
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
if [ -n "$$SHLIB_HIST" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
fi; \
fi; \
$(LINK_SO_O)
link_a.tru64-rpath:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB_HIST="$(LIBVERSION)"; \
fi; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-all'; \
NOALLSYMSFLAGS='-none'; \
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
if [ -n "$$SHLIB_HIST" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
fi; \
fi; \
$(LINK_SO_A)
link_app.tru64-rpath:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_APP); \
else \
LDCMD=$(CC);\
LDFLAGS="-rpath $(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
link_o.solaris:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
MINUSZ='-z '; \
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_O)
link_a.solaris:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
MINUSZ='-z '; \
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=;\
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_A)
link_app.solaris:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_APP); \
else \
LDCMD=$(CC);\
LDFLAGS="-R $(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
# OpenServer 5 native compilers used
link_o.svr3:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_O)
link_a.svr3:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_A_UNPACKED)
link_app.svr3:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_APP); \
else \
LDCMD=$(CC);\
LDFLAGS=""; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
# UnixWare 7 and OpenUNIX 8 native compilers used
link_o.svr5:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
SHARE_FLAG='-G'; \
(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_O)
link_a.svr5:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
SHARE_FLAG='-G'; \
(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_A_UNPACKED)
link_app.svr5:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_APP); \
else \
LDCMD=$(CC);\
LDFLAGS=""; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
link_o.irix:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
MINUSWL=""; \
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
ALLSYMSFLAGS="$${MINUSWL}-all"; \
NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_O)
link_a.irix:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
else \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
MINUSWL=""; \
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
ALLSYMSFLAGS="$${MINUSWL}-all"; \
NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
SHAREDCMD='$(CC)'; \
fi; \
$(LINK_SO_A)
link_app.irix:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_APP); \
else \
LDCMD=$(CC);\
LDFLAGS="-Wl,-rpath,$(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
# HP-UX includes the full pathname of libs we depend on, so we would get
# ./libcrypto (with ./ as path information) compiled into libssl, hence
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
# anyway.
# The object modules are loaded from lib$i.a using the undocumented -Fl
# option.
#
# WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
# by temporarily specifying "+s"!
#
link_o.hpux32:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).sl; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='-Fl'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
SHAREDCMD='/usr/ccs/bin/ld'; \
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
link_a.hpux32:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).sl; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='-Fl'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
SHAREDCMD='/usr/ccs/bin/ld'; \
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
link_app.hpux32:
LDCMD=$(CC);\
LDFLAGS="-Wl,+b,$(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"
$(LINK_APP)
# HP-UX includes the full pathname of libs we depend on, so we would get
# ./libcrypto (with ./ as path information) compiled into libssl, hence
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
# anyway.
#
# HP-UX in 64bit mode has "+s" enabled by default; it will search for
# shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
#
link_o.hpux64:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).sl; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='+forceload'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
SHAREDCMD='/usr/ccs/bin/ld'; \
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
link_a.hpux64:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).sl; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='+forceload'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
SHAREDCMD='/usr/ccs/bin/ld'; \
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
link_app.hpux64:
LDCMD=$(CC);\
LDFLAGS="-Wl,+b,$(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"
$(LINK_APP)
link_o.aix:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='-bnogc'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
SHAREDCMD='$(CC)'; \
$(LINK_SO_O)
link_a.aix:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS='-bnogc'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
SHAREDCMD='$(CC)'; \
$(LINK_SO_A_VIA_O)
link_app.aix:
LDCMD=$(CC);\
LDFLAGS="-blibpath:$(LIBRPATH)"; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"
$(LINK_APP)
link_o.reliantunix:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS=; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='-G'; \
SHAREDCMD='$(CC)'; \
$(LINK_SO_O)
link_a.reliantunix:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
LIBDEPS="$(LIBDEPS) -lc"; \
ALLSYMSFLAGS=; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='-G'; \
SHAREDCMD='$(CC)'; \
$(LINK_SO_A_UNPACKED)
link_app.reliantunix:
LDCMD=$(CC);\
LDFLAGS=""; \
LIBDEPS="$(LIBDEPS) -lc"; \
APPNAME="$(APPNAME)"
$(LINK_APP)
# Targets to build symbolic links when needed
symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
symlink.aix symlink.reliantunix:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
$(SYMLINK_SO)
symlink.darwin:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.dylib; \
$(SYMLINK_SO)
symlink.hpux32 symlink.hpux64:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).sl; \
$(SYMLINK_SO)
# The following lines means those specific architectures do no symlinks
symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
# Compatibility targets
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
link_o.darwin-shared: link_o.darwin
link_a.darwin-shared: link_a.darwin
link_app.darwin-shared: link_app.darwin
symlink.darwin-shared: symlink.darwin
link_o.cygwin-shared: link_o.cygwin
link_a.cygwin-shared: link_a.cygwin
link_app.cygwin-shared: link_app.cygwin
symlink.cygwin-shared: symlink.cygwin
link_o.alpha-osf1-shared: link_o.alpha-osf1
link_a.alpha-osf1-shared: link_a.alpha-osf1
link_app.alpha-osf1-shared: link_app.alpha-osf1
symlink.alpha-osf1-shared: symlink.alpha-osf1
link_o.tru64-shared: link_o.tru64
link_a.tru64-shared: link_a.tru64
link_app.tru64-shared: link_app.tru64
symlink.tru64-shared: symlink.tru64
link_o.tru64-shared-rpath: link_o.tru64-rpath
link_a.tru64-shared-rpath: link_a.tru64-rpath
link_app.tru64-shared-rpath: link_app.tru64-rpath
symlink.tru64-shared-rpath: symlink.tru64-rpath
link_o.solaris-shared: link_o.solaris
link_a.solaris-shared: link_a.solaris
link_app.solaris-shared: link_app.solaris
symlink.solaris-shared: symlink.solaris
link_o.svr3-shared: link_o.svr3
link_a.svr3-shared: link_a.svr3
link_app.svr3-shared: link_app.svr3
symlink.svr3-shared: symlink.svr3
link_o.svr5-shared: link_o.svr5
link_a.svr5-shared: link_a.svr5
link_app.svr5-shared: link_app.svr5
symlink.svr5-shared: symlink.svr5
link_o.irix-shared: link_o.irix
link_a.irix-shared: link_a.irix
link_app.irix-shared: link_app.irix
symlink.irix-shared: symlink.irix
link_o.hpux-shared: link_o.hpux32
link_a.hpux-shared: link_a.hpux32
link_app.hpux-shared: link_app.hpux32
symlink.hpux-shared: symlink.hpux32
link_o.hpux64-shared: link_o.hpux64
link_a.hpux64-shared: link_a.hpux64
link_app.hpux64-shared: link_app.hpux64
symlink.hpux64-shared: symlink.hpux64
link_o.aix-shared: link_o.aix
link_a.aix-shared: link_a.aix
link_app.aix-shared: link_app.aix
symlink.aix-shared: symlink.aix
link_o.reliantunix-shared: link_o.reliantunix
link_a.reliantunix-shared: link_a.reliantunix
link_app.reliantunix-shared: link_app.reliantunix
symlink.reliantunix-shared: symlink.reliantunix

83
NEWS
View File

@@ -5,6 +5,35 @@
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.7b and OpenSSL 0.9.7c:
o Security: fix various ASN1 parsing bugs.
o New -ignore_err option to OCSP utility.
o Various interop and bug fixes in S/MIME code.
o SSL/TLS protocol fix for unrequested client certificates.
Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b:
o Security: counter the Klima-Pokorny-Rosa extension of
Bleichbacher's attack
o Security: make RSA blinding default.
o Configuration: Irix fixes, AIX fixes, better mingw support.
o Support for new platforms: linux-ia64-ecc.
o Build: shared library support fixes.
o ASN.1: treat domainComponent correctly.
o Documentation: fixes and additions.
Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a:
o Security: Important security related bugfixes.
o Enhanced compatibility with MIT Kerberos.
o Can be built without the ENGINE framework.
o IA32 assembler enhancements.
o Support for new platforms: FreeBSD/IA64 and FreeBSD/Sparc64.
o Configuration: the no-err option now works properly.
o SSL/TLS: now handles manual certificate chain building.
o SSL/TLS: certain session ID malfunctions corrected.
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7: Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7:
o New library section OCSP. o New library section OCSP.
@@ -17,6 +46,15 @@
a separate distribution. a separate distribution.
o New elliptic curve library section. o New elliptic curve library section.
o New AES (Rijndael) library section. o New AES (Rijndael) library section.
o Support for new platforms: Windows CE, Tandem OSS, A/UX, AIX 64-bit,
Linux x86_64, Linux 64-bit on Sparc v9
o Extended support for some platforms: VxWorks
o Enhanced support for shared libraries.
o Now only builds PIC code when shared library support is requested.
o Support for pkg-config.
o Lots of new manuals.
o Makes symbolic links to or copies of manuals to cover all described
functions.
o Change DES API to clean up the namespace (some applications link also o Change DES API to clean up the namespace (some applications link also
against libdes providing similar functions having the same name). against libdes providing similar functions having the same name).
Provide macros for backward compatibility (will be removed in the Provide macros for backward compatibility (will be removed in the
@@ -30,16 +68,61 @@
o Reworked parts of the BIGNUM code. o Reworked parts of the BIGNUM code.
o Support for new engines: Broadcom ubsec, Accelerated Encryption o Support for new engines: Broadcom ubsec, Accelerated Encryption
Processing, IBM 4758. Processing, IBM 4758.
o A few new engines added in the demos area.
o Extended and corrected OID (object identifier) table. o Extended and corrected OID (object identifier) table.
o PRNG: query at more locations for a random device, automatic query for o PRNG: query at more locations for a random device, automatic query for
EGD style random sources at several locations. EGD style random sources at several locations.
o SSL/TLS: allow optional cipher choice according to server's preference. o SSL/TLS: allow optional cipher choice according to server's preference.
o SSL/TLS: allow server to explicitly set new session ids. o SSL/TLS: allow server to explicitly set new session ids.
o SSL/TLS: support Kerberos cipher suites (RFC2712). o SSL/TLS: support Kerberos cipher suites (RFC2712).
Only supports MIT Kerberos for now.
o SSL/TLS: allow more precise control of renegotiations and sessions. o SSL/TLS: allow more precise control of renegotiations and sessions.
o SSL/TLS: add callback to retrieve SSL/TLS messages. o SSL/TLS: add callback to retrieve SSL/TLS messages.
o SSL/TLS: support AES cipher suites (RFC3268). o SSL/TLS: support AES cipher suites (RFC3268).
Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k:
o Security: fix various ASN1 parsing bugs.
o SSL/TLS protocol fix for unrequested client certificates.
Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j:
o Security: counter the Klima-Pokorny-Rosa extension of
Bleichbacher's attack
o Security: make RSA blinding default.
o Build: shared library support fixes.
Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i:
o Important security related bugfixes.
Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h:
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: Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
o Various SSL/TLS library bugfixes. o Various SSL/TLS library bugfixes.

204
Netware/build.bat Normal file
View File

@@ -0,0 +1,204 @@
@echo off
rem ========================================================================
rem Batch file to automate building OpenSSL for NetWare.
rem
rem usage:
rem build [target] [debug opts] [assembly opts] [configure opts]
rem
rem target - "netware-clib" - CLib NetWare build
rem - "netware-libc" - LibC NKS NetWare build
rem
rem debug opts - "debug" - build debug
rem
rem assembly opts - "nw-mwasm" - use Metrowerks assembler
rem "nw-nasm" - use NASM assembler
rem "no-asm" - don't use assembly
rem
rem configure opts- all unrecognized arguments are passed to the
rem perl configure script
rem
rem If no arguments are specified the default is to build non-debug with
rem no assembly. NOTE: there is no default BLD_TARGET.
rem
rem No assembly is the default - Uncomment section below to change
rem the assembler default
set ASM_MODE=
set ASSEMBLER=
set NO_ASM=no-asm
rem Uncomment to default to the Metrowerks assembler
rem set ASM_MODE=nw-mwasm
rem set ASSEMBLER=Metrowerks
rem set NO_ASM=
rem Uncomment to default to the NASM assembler
rem set ASM_MODE=nw-nasm
rem set ASSEMBLER=NASM
rem set NO_ASM=
rem No default Bld target
set BLD_TARGET=no_target
rem set BLD_TARGET=netware-clib
rem set BLD_TARGET=netware-libc
rem Default to build non-debug
set DEBUG=
rem Uncomment to default to debug build
rem set DEBUG=debug
set CONFIG_OPTS=
set ARG_PROCESSED=NO
rem Process command line args
:opts
if "a%1" == "a" goto endopt
if "%1" == "no-asm" set NO_ASM=no-asm
if "%1" == "no-asm" set ARG_PROCESSED=YES
if "%1" == "debug" set DEBUG=debug
if "%1" == "debug" set ARG_PROCESSED=YES
if "%1" == "nw-nasm" set ASM_MODE=nw-nasm
if "%1" == "nw-nasm" set ASSEMBLER=NASM
if "%1" == "nw-nasm" set NO_ASM=
if "%1" == "nw-nasm" set ARG_PROCESSED=YES
if "%1" == "nw-mwasm" set ASM_MODE=nw-mwasm
if "%1" == "nw-mwasm" set ASSEMBLER=Metrowerks
if "%1" == "nw-mwasm" set NO_ASM=
if "%1" == "nw-mwasm" set ARG_PROCESSED=YES
if "%1" == "netware-clib" set BLD_TARGET=netware-clib
if "%1" == "netware-clib" set ARG_PROCESSED=YES
if "%1" == "netware-libc" set BLD_TARGET=netware-libc
if "%1" == "netware-libc" set ARG_PROCESSED=YES
rem If we didn't recognize the argument, consider it an option for config
if "%ARG_PROCESSED%" == "NO" set CONFIG_OPTS=%CONFIG_OPTS% %1
if "%ARG_PROCESSED%" == "YES" set ARG_PROCESSED=NO
shift
goto opts
:endopt
rem make sure a valid BLD_TARGET was specified
if "%BLD_TARGET%" == "no_target" goto no_target
rem build the nlm make file name which includes target and debug info
set NLM_MAKE=
if "%BLD_TARGET%" == "netware-clib" set NLM_MAKE=netware\nlm_clib
if "%BLD_TARGET%" == "netware-libc" set NLM_MAKE=netware\nlm_libc
if "%DEBUG%" == "" set NLM_MAKE=%NLM_MAKE%.mak
if "%DEBUG%" == "debug" set NLM_MAKE=%NLM_MAKE%_dbg.mak
if "%NO_ASM%" == "no-asm" set ASM_MODE=
if "%NO_ASM%" == "no-asm" set ASSEMBLER=
if "%NO_ASM%" == "no-asm" set CONFIG_OPTS=%CONFIG_OPTS% no-asm
if "%NO_ASM%" == "no-asm" goto do_config
rem ==================================================
echo Generating x86 for %ASSEMBLER% assembler
echo Bignum
cd crypto\bn\asm
perl x86.pl %ASM_MODE% > bn-nw.asm
cd ..\..\..
echo DES
cd crypto\des\asm
perl des-586.pl %ASM_MODE% > d-nw.asm
cd ..\..\..
echo "crypt(3)"
cd crypto\des\asm
perl crypt586.pl %ASM_MODE% > y-nw.asm
cd ..\..\..
echo Blowfish
cd crypto\bf\asm
perl bf-586.pl %ASM_MODE% > b-nw.asm
cd ..\..\..
echo CAST5
cd crypto\cast\asm
perl cast-586.pl %ASM_MODE% > c-nw.asm
cd ..\..\..
echo RC4
cd crypto\rc4\asm
perl rc4-586.pl %ASM_MODE% > r4-nw.asm
cd ..\..\..
echo MD5
cd crypto\md5\asm
perl md5-586.pl %ASM_MODE% > m5-nw.asm
cd ..\..\..
echo SHA1
cd crypto\sha\asm
perl sha1-586.pl %ASM_MODE% > s1-nw.asm
cd ..\..\..
echo RIPEMD160
cd crypto\ripemd\asm
perl rmd-586.pl %ASM_MODE% > rm-nw.asm
cd ..\..\..
echo RC5\32
cd crypto\rc5\asm
perl rc5-586.pl %ASM_MODE% > r5-nw.asm
cd ..\..\..
rem ===============================================================
rem
:do_config
echo .
echo configure options: %CONFIG_OPTS% %BLD_TARGET%
echo .
perl configure %CONFIG_OPTS% %BLD_TARGET%
perl util\mkfiles.pl >MINFO
echo .
echo mk1mf.pl options: %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET%
echo .
perl util\mk1mf.pl %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% >%NLM_MAKE%
echo The makefile "%NLM_MAKE%" has been created use your maketool to
echo build (ex: gmake -f %NLM_MAKE%)
goto end
rem ===============================================================
rem
:no_target
echo .
echo . No build target specified!!!
echo .
echo . usage: build [target] [debug opts] [assembly opts] [configure opts]
echo .
echo . target - "netware-clib" - CLib NetWare build
echo . - "netware-libc" - LibC NKS NetWare build
echo .
echo . debug opts - "debug" - build debug
echo .
echo . assembly opts - "nw-mwasm" - use Metrowerks assembler
echo . "nw-nasm" - use NASM assembler
echo . "no-asm" - don't use assembly
echo .
echo . configure opts- all unrecognized arguments are passed to the
echo . perl configure script
echo .
echo . If no debug or assembly opts are specified the default is to build
echo . non-debug without assembly
echo .
:end

112
Netware/cpy_tests.bat Normal file
View File

@@ -0,0 +1,112 @@
@echo off
rem Batch file to copy OpenSSL stuff to a NetWare server for testing
rem This batch file will create an "opensssl" directory at the root of the
rem specified NetWare drive and copy the required files to run the tests.
rem It should be run from inside the "openssl\netware" subdirectory.
rem Usage:
rem cpy_tests.bat <test subdirectory> <NetWare drive>
rem <test subdirectory> - out_nw.dbg | out_nw
rem <NetWare drive> - any mapped drive letter
rem
rem example ( copy from debug build to m: dirve ):
rem cpy_tests.bat out_nw.dbg m:
rem
rem CAUTION: If a directory named OpenSSL exists on the target drive
rem it will be deleted first.
if "%1" == "" goto usage
if "%2" == "" goto usage
rem Assume running in \openssl directory unless cpy_tests.bat exists then
rem it must be the \openssl\netware directory
set loc=.
if exist cpy_tests.bat set loc=..
rem make sure the local build subdirectory specified is valid
if not exist %loc%\%1\NUL goto invalid_dir
rem make sure target drive is valid
if not exist %2\NUL goto invalid_drive
rem If an OpenSSL directory exists on the target drive, remove it
if exist %2\openssl\NUL goto remove_openssl
goto do_copy
:remove_openssl
echo .
echo OpenSSL directory exists on %2 - it will be removed!
pause
rmdir %2\openssl /s /q
:do_copy
rem make an "openssl" directory and others at the root of the NetWare drive
mkdir %2\openssl
mkdir %2\openssl\test_out
mkdir %2\openssl\apps
mkdir %2\openssl\certs
mkdir %2\openssl\test
rem copy the test nlms
copy %loc%\%1\*.nlm %2\openssl\
rem copy the test perl script
copy %loc%\netware\do_tests.pl %2\openssl\
rem copy the certs directory stuff
xcopy %loc%\certs\*.* %2\openssl\certs\ /s
rem copy the test directory stuff
copy %loc%\test\CAss.cnf %2\openssl\test\
copy %loc%\test\Uss.cnf %2\openssl\test\
copy %loc%\test\pkcs7.pem %2\openssl\test\
copy %loc%\test\pkcs7-1.pem %2\openssl\test\
copy %loc%\test\testcrl.pem %2\openssl\test\
copy %loc%\test\testp7.pem %2\openssl\test\
copy %loc%\test\testreq2.pem %2\openssl\test\
copy %loc%\test\testrsa.pem %2\openssl\test\
copy %loc%\test\testsid.pem %2\openssl\test\
copy %loc%\test\testx509.pem %2\openssl\test\
copy %loc%\test\v3-cert1.pem %2\openssl\test\
copy %loc%\test\v3-cert2.pem %2\openssl\test\
rem copy the apps directory stuff
copy %loc%\apps\client.pem %2\openssl\apps\
copy %loc%\apps\server.pem %2\openssl\apps\
copy %loc%\apps\openssl.cnf %2\openssl\apps\
echo .
echo Tests copied
echo Run the test script at the console by typing:
echo "Perl \openssl\do_tests.pl"
echo .
echo Make sure the Search path includes the OpenSSL subdirectory
goto end
:invalid_dir
echo.
echo Invalid build directory specified: %1
echo.
goto usage
:invalid_drive
echo.
echo Invalid drive: %2
echo.
goto usage
:usage
echo.
echo usage: cpy_tests.bat [test subdirectory] [NetWare drive]
echo [test subdirectory] - out_nw_clib.dbg, out_nw_libc.dbg, etc.
echo [NetWare drive] - any mapped drive letter
echo.
echo example: cpy_test out_nw_clib.dbg M:
echo (copy from clib debug build area to M: drive)
:end

585
Netware/do_tests.pl Normal file
View File

@@ -0,0 +1,585 @@
# perl script to run OpenSSL tests
my $base_path = "\\openssl";
my $output_path = "$base_path\\test_out";
my $cert_path = "$base_path\\certs";
my $test_path = "$base_path\\test";
my $app_path = "$base_path\\apps";
my $tmp_cert = "$output_path\\cert.tmp";
my $OpenSSL_config = "$app_path\\openssl.cnf";
my $log_file = "$output_path\\tests.log";
my $pause = 0;
# process the command line args to see if they wanted us to pause
# between executing each command
foreach $i (@ARGV)
{
if ($i =~ /^-p$/)
{ $pause=1; }
}
main();
############################################################################
sub main()
{
# delete all the output files in the output directory
unlink <$output_path\\*.*>;
# open the main log file
open(OUT, ">$log_file") || die "unable to open $log_file\n";
algorithm_tests();
encryption_tests();
pem_tests();
verify_tests();
ssl_tests();
ca_tests();
close(OUT);
print("\nCompleted running tests.\n\n");
print("Check log file for errors: $log_file\n");
}
############################################################################
sub algorithm_tests
{
my $i;
my $outFile;
my @tests = ( rsa_test, destest, ideatest, bftest, shatest, sha1test,
md5test, dsatest, md2test, mdc2test, rc2test, rc4test, randtest,
dhtest, exptest );
print( "\nRUNNING CRYPTO ALGORITHM TESTS:\n\n");
print( OUT "\n========================================================\n");
print( OUT "CRYPTO ALGORITHM TESTS:\n\n");
foreach $i (@tests)
{
$outFile = "$output_path\\$i.out";
system("$i > $outFile");
log_desc("Test: $i\.nlm:");
log_output("", $outFile );
}
}
############################################################################
sub encryption_tests
{
my $i;
my $outFile;
my @enc_tests = ( "enc", "rc4", "des-cfb", "des-ede-cfb", "des-ede3-cfb",
"des-ofb", "des-ede-ofb", "des-ede3-ofb",
"des-ecb", "des-ede", "des-ede3", "des-cbc",
"des-ede-cbc", "des-ede3-cbc", "idea-ecb", "idea-cfb",
"idea-ofb", "idea-cbc", "rc2-ecb", "rc2-cfb",
"rc2-ofb", "rc2-cbc", "bf-ecb", "bf-cfb",
"bf-ofb", "bf-cbc" );
my $input = "$base_path\\do_tests.pl";
my $cipher = "$output_path\\cipher.out";
my $clear = "$output_path\\clear.out";
print( "\nRUNNING ENCRYPTION & DECRYPTION TESTS:\n\n");
print( OUT "\n========================================================\n");
print( OUT "FILE ENCRYPTION & DECRYPTION TESTS:\n\n");
foreach $i (@enc_tests)
{
log_desc("Testing: $i");
# do encryption
$outFile = "$output_path\\enc.out";
system("openssl2 $i -e -bufsize 113 -k test -in $input -out $cipher > $outFile" );
log_output("Encrypting: $input --> $cipher", $outFile);
# do decryption
$outFile = "$output_path\\dec.out";
system("openssl2 $i -d -bufsize 157 -k test -in $cipher -out $clear > $outFile");
log_output("Decrypting: $cipher --> $clear", $outFile);
# compare files
$x = compare_files( $input, $clear, 1);
if ( $x == 0 )
{
print( "SUCCESS - files match: $input, $clear\n");
print( OUT "SUCCESS - files match: $input, $clear\n");
}
else
{
print( "ERROR: files don't match\n");
print( OUT "ERROR: files don't match\n");
}
do_wait();
# Now do the same encryption but use Base64
# do encryption B64
$outFile = "$output_path\\B64enc.out";
system("openssl2 $i -a -e -bufsize 113 -k test -in $input -out $cipher > $outFile");
log_output("Encrypting(B64): $cipher --> $clear", $outFile);
# do decryption B64
$outFile = "$output_path\\B64dec.out";
system("openssl2 $i -a -d -bufsize 157 -k test -in $cipher -out $clear > $outFile");
log_output("Decrypting(B64): $cipher --> $clear", $outFile);
# compare files
$x = compare_files( $input, $clear, 1);
if ( $x == 0 )
{
print( "SUCCESS - files match: $input, $clear\n");
print( OUT "SUCCESS - files match: $input, $clear\n");
}
else
{
print( "ERROR: files don't match\n");
print( OUT "ERROR: files don't match\n");
}
do_wait();
} # end foreach
# delete the temporary files
unlink($cipher);
unlink($clear);
}
############################################################################
sub pem_tests
{
my $i;
my $tmp_out;
my $outFile = "$output_path\\pem.out";
my %pem_tests = (
"crl" => "testcrl.pem",
"pkcs7" => "testp7.pem",
"req" => "testreq2.pem",
"rsa" => "testrsa.pem",
"x509" => "testx509.pem",
"x509" => "v3-cert1.pem",
"sess_id" => "testsid.pem" );
print( "\nRUNNING PEM TESTS:\n\n");
print( OUT "\n========================================================\n");
print( OUT "PEM TESTS:\n\n");
foreach $i (keys(%pem_tests))
{
log_desc( "Testing: $i");
my $input = "$test_path\\$pem_tests{$i}";
$tmp_out = "$output_path\\$pem_tests{$i}";
if ($i ne "req" )
{
system("openssl2 $i -in $input -out $tmp_out > $outFile");
log_output( "openssl2 $i -in $input -out $tmp_out", $outFile);
}
else
{
system("openssl2 $i -in $input -out $tmp_out -config $OpenSSL_config > $outFile");
log_output( "openssl2 $i -in $input -out $tmp_out -config $OpenSSL_config", $outFile );
}
$x = compare_files( $input, $tmp_out);
if ( $x == 0 )
{
print( "SUCCESS - files match: $input, $tmp_out\n");
print( OUT "SUCCESS - files match: $input, $tmp_out\n");
}
else
{
print( "ERROR: files don't match\n");
print( OUT "ERROR: files don't match\n");
}
do_wait();
} # end foreach
}
############################################################################
sub verify_tests
{
my $i;
my $outFile = "$output_path\\verify.out";
my @cert_files = <$cert_path\\*.pem>;
print( "\nRUNNING VERIFY TESTS:\n\n");
print( OUT "\n========================================================\n");
print( OUT "VERIFY TESTS:\n\n");
make_tmp_cert_file();
foreach $i (@cert_files)
{
system("openssl2 verify -CAfile $tmp_cert $i >$outFile");
log_desc("Verifying cert: $i");
log_output("openssl2 verify -CAfile $tmp_cert $i", $outFile);
}
}
############################################################################
sub ssl_tests
{
my $outFile = "$output_path\\ssl_tst.out";
print( "\nRUNNING SSL TESTS:\n\n");
print( OUT "\n========================================================\n");
print( OUT "SSL TESTS:\n\n");
make_tmp_cert_file();
system("ssltest -ssl2 >$outFile");
log_desc("Testing sslv2:");
log_output("ssltest -ssl2", $outFile);
system("ssltest -ssl2 -server_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2 with server authentication:");
log_output("ssltest -ssl2 -server_auth -CAfile $tmp_cert", $outFile);
system("ssltest -ssl2 -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2 with client authentication:");
log_output("ssltest -ssl2 -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -ssl2 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2 with both client and server authentication:");
log_output("ssltest -ssl2 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -ssl3 >$outFile");
log_desc("Testing sslv3:");
log_output("ssltest -ssl3", $outFile);
system("ssltest -ssl3 -server_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv3 with server authentication:");
log_output("ssltest -ssl3 -server_auth -CAfile $tmp_cert", $outFile);
system("ssltest -ssl3 -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv3 with client authentication:");
log_output("ssltest -ssl3 -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -ssl3 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv3 with both client and server authentication:");
log_output("ssltest -ssl3 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest >$outFile");
log_desc("Testing sslv2/sslv3:");
log_output("ssltest", $outFile);
system("ssltest -server_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2/sslv3 with server authentication:");
log_output("ssltest -server_auth -CAfile $tmp_cert", $outFile);
system("ssltest -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2/sslv3 with client authentication:");
log_output("ssltest -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -server_auth -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2/sslv3 with both client and server authentication:");
log_output("ssltest -server_auth -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -ssl2 >$outFile");
log_desc("Testing sslv2 via BIO pair:");
log_output("ssltest -bio_pair -ssl2", $outFile);
system("ssltest -bio_pair -dhe1024dsa -v >$outFile");
log_desc("Testing sslv2/sslv3 with 1024 bit DHE via BIO pair:");
log_output("ssltest -bio_pair -dhe1024dsa -v", $outFile);
system("ssltest -bio_pair -ssl2 -server_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2 with server authentication via BIO pair:");
log_output("ssltest -bio_pair -ssl2 -server_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -ssl2 -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2 with client authentication via BIO pair:");
log_output("ssltest -bio_pair -ssl2 -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -ssl2 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2 with both client and server authentication via BIO pair:");
log_output("ssltest -bio_pair -ssl2 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -ssl3 >$outFile");
log_desc("Testing sslv3 via BIO pair:");
log_output("ssltest -bio_pair -ssl3", $outFile);
system("ssltest -bio_pair -ssl3 -server_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv3 with server authentication via BIO pair:");
log_output("ssltest -bio_pair -ssl3 -server_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -ssl3 -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv3 with client authentication via BIO pair:");
log_output("ssltest -bio_pair -ssl3 -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -ssl3 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv3 with both client and server authentication via BIO pair:");
log_output("ssltest -bio_pair -ssl3 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair >$outFile");
log_desc("Testing sslv2/sslv3 via BIO pair:");
log_output("ssltest -bio_pair", $outFile);
system("ssltest -bio_pair -server_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2/sslv3 with server authentication via BIO pair:");
log_output("ssltest -bio_pair -server_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2/sslv3 with client authentication via BIO pair:");
log_output("ssltest -bio_pair -client_auth -CAfile $tmp_cert", $outFile);
system("ssltest -bio_pair -server_auth -client_auth -CAfile $tmp_cert >$outFile");
log_desc("Testing sslv2/sslv3 with both client and server authentication via BIO pair:");
log_output("ssltest -bio_pair -server_auth -client_auth -CAfile $tmp_cert", $outFile);
}
############################################################################
sub ca_tests
{
my $outFile = "$output_path\\ca_tst.out";
my($CAkey) = "$output_path\\keyCA.ss";
my($CAcert) = "$output_path\\certCA.ss";
my($CAserial) = "$output_path\\certCA.srl";
my($CAreq) = "$output_path\\reqCA.ss";
my($CAreq2) = "$output_path\\req2CA.ss";
my($CAconf) = "$test_path\\CAss.cnf";
my($Uconf) = "$test_path\\Uss.cnf";
my($Ukey) = "$output_path\\keyU.ss";
my($Ureq) = "$output_path\\reqU.ss";
my($Ucert) = "$output_path\\certU.ss";
print( "\nRUNNING CA TESTS:\n\n");
print( OUT "\n========================================================\n");
print( OUT "CA TESTS:\n");
system("openssl2 req -config $CAconf -out $CAreq -keyout $CAkey -new >$outFile");
log_desc("Make a certificate request using req:");
log_output("openssl2 req -config $CAconf -out $CAreq -keyout $CAkey -new", $outFile);
system("openssl2 x509 -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey >$outFile");
log_desc("Convert the certificate request into a self signed certificate using x509:");
log_output("openssl2 x509 -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey", $outFile);
system("openssl2 x509 -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >$outFile");
log_desc("Convert a certificate into a certificate request using 'x509':");
log_output("openssl2 x509 -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2", $outFile);
system("openssl2 req -config $OpenSSL_config -verify -in $CAreq -noout >$outFile");
log_output("openssl2 req -config $OpenSSL_config -verify -in $CAreq -noout", $outFile);
system("openssl2 req -config $OpenSSL_config -verify -in $CAreq2 -noout >$outFile");
log_output( "openssl2 req -config $OpenSSL_config -verify -in $CAreq2 -noout", $outFile);
system("openssl2 verify -CAfile $CAcert $CAcert >$outFile");
log_output("openssl2 verify -CAfile $CAcert $CAcert", $outFile);
system("openssl2 req -config $Uconf -out $Ureq -keyout $Ukey -new >$outFile");
log_desc("Make another certificate request using req:");
log_output("openssl2 req -config $Uconf -out $Ureq -keyout $Ukey -new", $outFile);
system("openssl2 x509 -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -CAserial $CAserial >$outFile");
log_desc("Sign certificate request with the just created CA via x509:");
log_output("openssl2 x509 -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -CAserial $CAserial", $outFile);
system("openssl2 verify -CAfile $CAcert $Ucert >$outFile");
log_output("openssl2 verify -CAfile $CAcert $Ucert", $outFile);
system("openssl2 x509 -subject -issuer -startdate -enddate -noout -in $Ucert >$outFile");
log_desc("Certificate details");
log_output("openssl2 x509 -subject -issuer -startdate -enddate -noout -in $Ucert", $outFile);
print(OUT "-- \n");
print(OUT "The generated CA certificate is $CAcert\n");
print(OUT "The generated CA private key is $CAkey\n");
print(OUT "The current CA signing serial number is in $CAserial\n");
print(OUT "The generated user certificate is $Ucert\n");
print(OUT "The generated user private key is $Ukey\n");
print(OUT "--\n");
}
############################################################################
sub log_output( $ $ )
{
my( $desc, $file ) = @_;
my($error) = 0;
my($key);
my($msg);
if ($desc)
{
print("$desc\n");
print(OUT "$desc\n");
}
# loop waiting for test program to complete
while ( stat($file) == 0)
{ print(". "); sleep(1); }
# copy test output to log file
open(IN, "<$file");
while (<IN>)
{
print(OUT $_);
if ( $_ =~ /ERROR/ )
{
$error = 1;
}
}
# close and delete the temporary test output file
close(IN);
unlink($file);
if ( $error == 0 )
{
$msg = "Test Succeeded";
}
else
{
$msg = "Test Failed";
}
print(OUT "$msg\n");
if ($pause)
{
print("$msg - press ENTER to continue...");
$key = getc;
print("\n");
}
# Several of the testing scripts run a loop loading the
# same NLM with different options.
# On slow NetWare machines there appears to be some delay in the
# OS actually unloading the test nlms and the OS complains about.
# the NLM already being loaded. This additional pause is to
# to help provide a little more time for unloading before trying to
# load again.
sleep(1);
}
############################################################################
sub log_desc( $ )
{
my( $desc ) = @_;
print("\n");
print("$desc\n");
print(OUT "\n");
print(OUT "$desc\n");
print(OUT "======================================\n");
}
############################################################################
sub compare_files( $ $ $ )
{
my( $file1, $file2, $binary ) = @_;
my( $n1, $n2, $b1, $b2 );
my($ret) = 1;
open(IN0, $file1) || die "\nunable to open $file1\n";
open(IN1, $file2) || die "\nunable to open $file2\n";
if ($binary)
{
binmode IN0;
binmode IN1;
}
for (;;)
{
$n1 = read(IN0, $b1, 512);
$n2 = read(IN1, $b2, 512);
if ($n1 != $n2) {last;}
if ($b1 != $b2) {last;}
if ($n1 == 0)
{
$ret = 0;
last;
}
}
close(IN0);
close(IN1);
return($ret);
}
############################################################################
sub do_wait()
{
my($key);
if ($pause)
{
print("Press ENTER to continue...");
$key = getc;
print("\n");
}
}
############################################################################
sub make_tmp_cert_file()
{
my @cert_files = <$cert_path\\*.pem>;
# delete the file if it already exists
unlink($tmp_cert);
open( TMP_CERT, ">$tmp_cert") || die "\nunable to open $tmp_cert\n";
print("building temporary cert file\n");
# create a temporary cert file that contains all the certs
foreach $i (@cert_files)
{
open( IN_CERT, $i ) || die "\nunable to open $i\n";
for(;;)
{
$n = sysread(IN_CERT, $data, 1024);
if ($n == 0)
{
close(IN_CERT);
last;
};
syswrite(TMP_CERT, $data, $n);
}
}
close( TMP_CERT );
}

254
Netware/globals.txt Normal file
View File

@@ -0,0 +1,254 @@
An initial review of the OpenSSL code was done to determine how many
global variables where present. The idea was to determine the amount of
work required to pull the globals into an instance data structure in
order to build a Library NLM for NetWare. This file contains the results
of the review. Each file is listed along with the globals in the file.
The initial review was done very quickly so this list is probably
not a comprehensive list.
cryptlib.c
===========================================
static STACK *app_locks=NULL;
static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL;
static void (MS_FAR *locking_callback)(int mode,int type,
const char *file,int line)=NULL;
static int (MS_FAR *add_lock_callback)(int *pointer,int amount,
int type,const char *file,int line)=NULL;
static unsigned long (MS_FAR *id_callback)(void)=NULL;
static struct CRYPTO_dynlock_value *(MS_FAR *dynlock_create_callback)
(const char *file,int line)=NULL;
static void (MS_FAR *dynlock_lock_callback)(int mode,
struct CRYPTO_dynlock_value *l, const char *file,int line)=NULL;
static void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l,
const char *file,int line)=NULL;
mem.c
===========================================
static int allow_customize = 1; /* we provide flexible functions for */
static int allow_customize_debug = 1;/* exchanging memory-related functions at
/* may be changed as long as `allow_customize' is set */
static void *(*malloc_locked_func)(size_t) = malloc;
static void (*free_locked_func)(void *) = free;
static void *(*malloc_func)(size_t) = malloc;
static void *(*realloc_func)(void *, size_t)= realloc;
static void (*free_func)(void *) = free;
/* use default functions from mem_dbg.c */
static void (*malloc_debug_func)(void *,int,const char *,int,int)
= CRYPTO_dbg_malloc;
static void (*realloc_debug_func)(void *,void *,int,const char *,int,int)
= CRYPTO_dbg_realloc;
static void (*free_debug_func)(void *,int) = CRYPTO_dbg_free;
static void (*set_debug_options_func)(long) = CRYPTO_dbg_set_options;
static long (*get_debug_options_func)(void) = CRYPTO_dbg_get_options;
mem_dbg.c
===========================================
static int mh_mode=CRYPTO_MEM_CHECK_OFF;
static unsigned long order = 0; /* number of memory requests */
static LHASH *mh=NULL; /* hash-table of memory requests (address as key) */
static LHASH *amih=NULL; /* hash-table with those app_mem_info_st's */
static long options = /* extra information to be recorded */
static unsigned long disabling_thread = 0;
err.c
===========================================
static LHASH *error_hash=NULL;
static LHASH *thread_hash=NULL;
several files have routines with static "init" to track if error strings
have been loaded ( may not want seperate error strings for each process )
The "init" variable can't be left "global" because the error has is a ptr
that is malloc'ed. The malloc'ed error has is dependant on the "init"
vars.
files:
pem_err.c
cpt_err.c
pk12err.c
asn1_err.c
bio_err.c
bn_err.c
buf_err.c
comp_err.c
conf_err.c
cpt_err.c
dh_err.c
dsa_err.c
dso_err.c
evp_err.c
obj_err.c
pkcs7err.c
rand_err.c
rsa_err.c
rsar_err.c
ssl_err.c
x509_err.c
v3err.c
err.c
These file have similar "init" globals but they are for other stuff not
error strings:
bn_lib.c
ecc_enc.c
s23_clnt.c
s23_meth.c
s23_srvr.c
s2_clnt.c
s2_lib.c
s2_meth.c
s2_srvr.c
s3_clnt.c
s3_lib.c
s3_srvr.c
t1_clnt.c
t1_meth.c
t1_srvr.c
rand_lib.c
===========================================
static RAND_METHOD *rand_meth= &rand_ssleay_meth;
md_rand.c
===========================================
static int state_num=0,state_index=0;
static unsigned char state[STATE_SIZE+MD_DIGEST_LENGTH];
static unsigned char md[MD_DIGEST_LENGTH];
static long md_count[2]={0,0};
static double entropy=0;
static int initialized=0;
/* This should be set to 1 only when ssleay_rand_add() is called inside
an already locked state, so it doesn't try to lock and thereby cause
a hang. And it should always be reset back to 0 before unlocking. */
static int add_do_not_lock=0;
obj_dat.c
============================================
static int new_nid=NUM_NID;
static LHASH *added=NULL;
b_sock.c
===========================================
static unsigned long BIO_ghbn_hits=0L;
static unsigned long BIO_ghbn_miss=0L;
static struct ghbn_cache_st
{
char name[129];
struct hostent *ent;
unsigned long order;
} ghbn_cache[GHBN_NUM];
static int wsa_init_done=0;
bio_lib.c
===========================================
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *bio_meth=NULL;
static int bio_meth_num=0;
bn_lib.c
========================================
static int bn_limit_bits=0;
static int bn_limit_num=8; /* (1<<bn_limit_bits) */
static int bn_limit_bits_low=0;
static int bn_limit_num_low=8; /* (1<<bn_limit_bits_low) */
static int bn_limit_bits_high=0;
static int bn_limit_num_high=8; /* (1<<bn_limit_bits_high) */
static int bn_limit_bits_mont=0;
static int bn_limit_num_mont=8; /* (1<<bn_limit_bits_mont) */
conf_lib.c
========================================
static CONF_METHOD *default_CONF_method=NULL;
dh_lib.c
========================================
static DH_METHOD *default_DH_method;
static int dh_meth_num = 0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;
dsa_lib.c
========================================
static DSA_METHOD *default_DSA_method;
static int dsa_meth_num = 0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;
dso_lib.c
========================================
static DSO_METHOD *default_DSO_meth = NULL;
rsa_lib.c
========================================
static RSA_METHOD *default_RSA_meth=NULL;
static int rsa_meth_num=0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *rsa_meth=NULL;
x509_trs.c
=======================================
static int (*default_trust)(int id, X509 *x, int flags) = obj_trust;
static STACK_OF(X509_TRUST) *trtable = NULL;
x509_req.c
=======================================
static int *ext_nids = ext_nid_list;
o_names.c
======================================
static LHASH *names_lh=NULL;
static STACK_OF(NAME_FUNCS) *name_funcs_stack;
static int free_type;
static int names_type_num=OBJ_NAME_TYPE_NUM;
th-lock.c - NEED to add support for locking for NetWare
==============================================
static long *lock_count;
(other platform specific globals)
x_x509.c
==============================================
static int x509_meth_num = 0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL;
evp_pbe.c
============================================
static STACK *pbe_algs;
evp_key.c
============================================
static char prompt_string[80];
ssl_ciph.c
============================================
static STACK_OF(SSL_COMP) *ssl_comp_methods=NULL;
ssl_lib.c
=============================================
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_meth=NULL;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_ctx_meth=NULL;
static int ssl_meth_num=0;
static int ssl_ctx_meth_num=0;
ssl_sess.c
=============================================
static int ssl_session_num=0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_session_meth=NULL;
x509_vfy.c
============================================
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_ctx_method=NULL;
static int x509_store_ctx_num=0;

19
Netware/readme.txt Normal file
View File

@@ -0,0 +1,19 @@
Contents of the openssl\netware directory
==========================================
Regular files:
readme.txt - this file
do_tests.pl - perl script used to run the OpenSSL tests on NetWare
cpy_tests.bat - batch to to copy test stuff to NetWare server
build.bat - batch file to help with builds
set_env.bat - batch file to help setup build environments
globals.txt - results of initial code review to identify OpenSSL global variables
The following files are generated by the various scripts. They are
recreated each time and it is okay to delete them.
*.def - command files used by Metrowerks linker
*.mak - make files generated by mk1mf.pl

90
Netware/set_env.bat Normal file
View File

@@ -0,0 +1,90 @@
@echo off
rem ========================================================================
rem Batch file to assist in setting up the necessary enviroment for
rem building OpenSSL for NetWare.
rem
rem usage:
rem set_env [target]
rem
rem target - "netware-clib" - Clib build
rem - "netware-libc" - LibC build
rem
rem
if "a%1" == "a" goto usage
set LIBC_BUILD=
set CLIB_BUILD=
if "%1" == "netware-clib" set CLIB_BUILD=Y
if "%1" == "netware-clib" set LIBC_BUILD=
if "%1" == "netware-libc" set LIBC_BUILD=Y
if "%1" == "netware-libc" set CLIB_BUILD=
rem Location of tools (compiler, linker, etc)
set TOOLS=d:\i_drive\tools
rem If Perl for Win32 is not already in your path, add it here
set PERL_PATH=
rem Define path to the Metrowerks command line tools
rem ( compiler, assembler, linker)
set METROWERKS_PATH=%TOOLS%\codewar\pdk_21\tools\command line tools
rem set METROWERKS_PATH=%TOOLS%\codewar\PDK_40\Other Metrowerks Tools\Command Line Tools
rem If using gnu make define path to utility
set GNU_MAKE_PATH=%TOOLS%\gnu
rem If using ms nmake define path to nmake
set MS_NMAKE_PATH=%TOOLS%\msvc\600\bin
rem If using NASM assembler define path
set NASM_PATH=%TOOLS%\nasm
rem Update path to include tool paths
set path=%path%;%METROWERKS_PATH%
if not "%GNU_MAKE_PATH%" == "" set path=%path%;%GNU_MAKE_PATH%
if not "%MS_NMAKE_PATH%" == "" set path=%path%;%MS_NMAKE_PATH%
if not "%NASM_PATH%" == "" set path=%path%;%NASM_PATH%
if not "%PERL_PATH%" == "" set path=%path%;%PERL_PATH%
rem Set MWCIncludes to location of Novell NDK includes
if "%LIBC_BUILD%" == "Y" set MWCIncludes=%TOOLS%\ndk\libc\include;%TOOLS%\ndk\libc\include\winsock;.\engines
if "%CLIB_BUILD%" == "Y" set MWCIncludes=%TOOLS%\ndk\nwsdk\include\nlm;.\engines
set include=
rem Set Imports to location of Novell NDK import files
if "%LIBC_BUILD%" == "Y" set IMPORTS=%TOOLS%\ndk\libc\imports
if "%CLIB_BUILD%" == "Y" set IMPORTS=%TOOLS%\ndk\nwsdk\imports
rem Set PRELUDE to the absolute path of the prelude object to link with in
rem the Metrowerks NetWare PDK - NOTE: for Clib builds "nwpre.obj" is
rem recommended, for LibC NKS builds libcpre.o must be used
if "%LIBC_BUILD%" == "Y" set PRELUDE=%TOOLS%\ndk\libc\imports\libcpre.o
if "%CLIB_BUILD%" == "Y" set PRELUDE=%TOOLS%\codewar\pdk_21\novell support\metrowerks support\libraries\runtime\nwpre.obj
if "%LIBC_BUILD%" == "Y" echo Enviroment configured for LibC build
if "%LIBC_BUILD%" == "Y" echo use "netware\build.bat netware-libc ..."
if "%CLIB_BUILD%" == "Y" echo Enviroment configured for CLib build
if "%CLIB_BUILD%" == "Y" echo use "netware\build.bat netware-clib ..."
goto end
:usage
rem ===============================================================
echo .
echo . No target build specified!
echo .
echo . usage: set_env [target]
echo .
echo . target - "netware-clib" - Clib build
echo . - "netware-libc" - LibC build
echo .
:end

View File

@@ -38,3 +38,94 @@ may differ on your machine.
As long as Apple doesn't fix the problem with ld, this problem building As long as Apple doesn't fix the problem with ld, this problem building
OpenSSL will remain as is. 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.
* solaris64-sparcv9-cc SHA-1 performance with WorkShop 6 compiler.
As subject suggests SHA-1 might perform poorly (4 times slower)
if compiled with WorkShop 6 compiler and -xarch=v9. The cause for
this seems to be the fact that compiler emits multiplication to
perform shift operations:-( To work the problem around configure
with './Configure solaris64-sparcv9-cc -DMD32_REG_T=int'.
* Problems with hp-parisc2-cc target when used with "no-asm" flag
When using the hp-parisc2-cc target, wrong bignum code is generated.
This is due to the SIXTY_FOUR_BIT build being compiled with the +O3
aggressive optimization.
The problem manifests itself by the BN_kronecker test hanging in an
endless loop. Reason: the BN_kronecker test calls BN_generate_prime()
which itself hangs. The reason could be tracked down to the bn_mul_comba8()
function in bn_asm.c. At some occasions the higher 32bit value of r[7]
is off by 1 (meaning: calculated=shouldbe+1). Further analysis failed,
as no debugger support possible at +O3 and additional fprintf()'s
introduced fixed the bug, therefore it is most likely a bug in the
optimizer.
The bug was found in the BN_kronecker test but may also lead to
failures in other parts of the code.
(See Ticket #426.)
Workaround: modify the target to +O2 when building with no-asm.
* Poor support for AIX shared builds.
do_aix-shared rule is not flexible enough to parameterize through a
config-line. './Configure aix43-cc shared' is working, but not
'./Configure aix64-gcc shared'. In latter case make fails to create shared
libraries. It's possible to build 64-bit shared libraries by running
'env OBJECT_MODE=64 make', but we need more elegant solution. Preferably one
supporting even gcc shared builds. See RT#463 for background information.
* Problems building shared libraries on SCO OpenServer Release 5.0.6
with gcc 2.95.3
The symptoms appear when running the test suite, more specifically
test/ectest, with the following result:
OSSL_LIBPATH="`cd ..; pwd`"; LD_LIBRARY_PATH="$OSSL_LIBPATH:$LD_LIBRARY_PATH"; DYLD_LIBRARY_PATH="$OSSL_LIBPATH:$DYLD_LIBRARY_PATH"; SHLIB_PATH="$OSSL_LIBPATH:$SHLIB_PATH"; LIBPATH="$OSSL_LIBPATH:$LIBPATH"; if [ "debug-sco5-gcc" = "Cygwin" ]; then PATH="${LIBPATH}:$PATH"; fi; export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; ./ectest
ectest.c:186: ABORT
The cause of the problem seems to be that isxdigit(), called from
BN_hex2bn(), returns 0 on a perfectly legitimate hex digit. Further
investigation shows that any of the isxxx() macros return 0 on any
input. A direct look in the information array that the isxxx() use,
called __ctype, shows that it contains all zeroes...
Taking a look at the newly created libcrypto.so with nm, one can see
that the variable __ctype is defined in libcrypto's .bss (which
explains why it is filled with zeroes):
$ nm -Pg libcrypto.so | grep __ctype
__ctype B 0011659c
__ctype2 U
Curiously, __ctype2 is undefined, in spite of being declared in
/usr/include/ctype.h in exactly the same way as __ctype.
Any information helping to solve this issue would be deeply
appreciated.
NOTE: building non-shared doesn't come with this problem.

15
README
View File

@@ -14,13 +14,13 @@
protocols as well as a full-strength general purpose cryptography library. protocols as well as a full-strength general purpose cryptography library.
The project is managed by a worldwide community of volunteers that use the The project is managed by a worldwide community of volunteers that use the
Internet to communicate, plan, and develop the OpenSSL toolkit and its Internet to communicate, plan, and develop the OpenSSL toolkit and its
related documentation. related documentation.
OpenSSL is based on the excellent SSLeay library developed from Eric A. Young OpenSSL is based on the excellent SSLeay library developed from Eric A. Young
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
OpenSSL license plus the SSLeay license) situation, which basically means OpenSSL license plus the SSLeay license) situation, which basically means
that you are free to get and use it for commercial and non-commercial that you are free to get and use it for commercial and non-commercial
purposes as long as you fulfill the conditions of both licenses. purposes as long as you fulfill the conditions of both licenses.
OVERVIEW OVERVIEW
-------- --------
@@ -53,11 +53,11 @@
MDC2 message digest. A DES based hash that is popular on smart cards. MDC2 message digest. A DES based hash that is popular on smart cards.
Public Key Public Key
RSA encryption/decryption/generation. RSA encryption/decryption/generation.
There is no limit on the number of bits. There is no limit on the number of bits.
DSA encryption/decryption/generation. DSA encryption/decryption/generation.
There is no limit on the number of bits. There is no limit on the number of bits.
Diffie-Hellman key-exchange/key generation. Diffie-Hellman key-exchange/key generation.
There is no limit on the number of bits. There is no limit on the number of bits.
X.509v3 certificates X.509v3 certificates
@@ -173,7 +173,9 @@
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 copy of the patch is sent to crypt@bxa.doc.gov if a TSA notification and a copy of the patch is sent to crypt@bis.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:
@@ -183,3 +185,4 @@
# ./Configure dist; make clean # ./Configure dist; make clean
# cd .. # cd ..
# diff -ur openssl-orig openssl-work > mydiffs.patch # diff -ur openssl-orig openssl-work > mydiffs.patch

25
STATUS
View File

@@ -1,12 +1,17 @@
OpenSSL STATUS Last modified at OpenSSL STATUS Last modified at
______________ $Date: 2002/06/16 18:20:28 $ ______________ $Date: 2003/02/28 15:17:45 $
DEVELOPMENT STATE DEVELOPMENT STATE
o OpenSSL 0.9.8: Under development... o OpenSSL 0.9.8: Under development...
o OpenSSL 0.9.7-beta2: Released on June 16th, 2002 o OpenSSL 0.9.7a: Released on February 19th, 2003
o OpenSSL 0.9.7-beta1: Released on June 1st, 2002 o OpenSSL 0.9.7: Released on December 31st, 2002
o OpenSSL 0.9.6i: Released on February 19th, 2003
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.6d: Released on May 9th, 2002
o OpenSSL 0.9.6c: Released on December 21st, 2001 o OpenSSL 0.9.6c: Released on December 21st, 2001
o OpenSSL 0.9.6b: Released on July 9th, 2001 o OpenSSL 0.9.6b: Released on July 9th, 2001
@@ -24,8 +29,7 @@
RELEASE SHOWSTOPPERS RELEASE SHOWSTOPPERS
o BN_mod_mul verification fails for mips3-sgi-irix o
unless configured with no-asm
AVAILABLE PATCHES AVAILABLE PATCHES
@@ -48,12 +52,19 @@
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.
Kerberos 5 authentication Kerberos 5 authentication (Heimdal)
Constification Constification
OCSP Compression
Attribute Certificate support
Certificate Pair support
Storage Engines (primarly an LDAP storage engine)
Certificate chain validation with full RFC 3280 compatibility
NEEDS PATCH NEEDS PATCH
o 0.9.8-dev: COMPLEMENTOFALL and COMPLEMENTOFDEFAULT do not
handle ECCdraft cipher suites correctly.
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 STATUS" is never up-to-date. o "OpenSSL STATUS" is never up-to-date.

1326
TABLE

File diff suppressed because it is too large Load Diff

View File

@@ -285,6 +285,7 @@ $ if alg_entry .eqs. "" then goto loop2
$ if alg_entry .nes. "," $ if alg_entry .nes. ","
$ then $ then
$ if alg_entry .eqs. "KRB5" then goto loop ! Special for now $ if alg_entry .eqs. "KRB5" then goto loop ! Special for now
$ if alg_entry .eqs. "STATIC_ENGINE" then goto loop ! Special for now
$ if f$trnlnm("OPENSSL_NO_"+alg_entry) .nes. "" then goto loop $ if f$trnlnm("OPENSSL_NO_"+alg_entry) .nes. "" then goto loop
$ goto loop2 $ goto loop2
$ endif $ endif

View File

@@ -37,7 +37,8 @@
# demoCA ... where everything is stored # demoCA ... where everything is stored
$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"}; $SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"};
$DAYS="-days 365"; $DAYS="-days 365"; # 1 year
$CADAYS="-days 1095"; # 3 years
$REQ="openssl req $SSLEAY_CONFIG"; $REQ="openssl req $SSLEAY_CONFIG";
$CA="openssl ca $SSLEAY_CONFIG"; $CA="openssl ca $SSLEAY_CONFIG";
$VERIFY="openssl verify"; $VERIFY="openssl verify";
@@ -46,6 +47,7 @@ $PKCS12="openssl pkcs12";
$CATOP="./demoCA"; $CATOP="./demoCA";
$CAKEY="cakey.pem"; $CAKEY="cakey.pem";
$CAREQ="careq.pem";
$CACERT="cacert.pem"; $CACERT="cacert.pem";
$DIRMODE = 0777; $DIRMODE = 0777;
@@ -101,8 +103,11 @@ foreach (@ARGV) {
$RET=$?; $RET=$?;
} else { } else {
print "Making CA certificate ...\n"; print "Making CA certificate ...\n";
system ("$REQ -new -x509 -keyout " . system ("$REQ -new -keyout " .
"${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT $DAYS"); "${CATOP}/private/$CAKEY -out ${CATOP}/$CAREQ");
system ("$CA -out ${CATOP}/$CACERT $CADAYS -batch " .
"-keyfile ${CATOP}/private/$CAKEY -selfsign " .
"-infiles ${CATOP}/$CAREQ ");
$RET=$?; $RET=$?;
} }
} }

View File

@@ -30,7 +30,8 @@
# default openssl.cnf file has setup as per the following # default openssl.cnf file has setup as per the following
# demoCA ... where everything is stored # demoCA ... where everything is stored
DAYS="-days 365" DAYS="-days 365" # 1 year
CADAYS="-days 1095" # 3 years
REQ="openssl req $SSLEAY_CONFIG" REQ="openssl req $SSLEAY_CONFIG"
CA="openssl ca $SSLEAY_CONFIG" CA="openssl ca $SSLEAY_CONFIG"
VERIFY="openssl verify" VERIFY="openssl verify"
@@ -38,6 +39,7 @@ X509="openssl x509"
CATOP=./demoCA CATOP=./demoCA
CAKEY=./cakey.pem CAKEY=./cakey.pem
CAREQ=./careq.pem
CACERT=./cacert.pem CACERT=./cacert.pem
for i for i
@@ -70,7 +72,7 @@ case $i in
mkdir ${CATOP}/crl mkdir ${CATOP}/crl
mkdir ${CATOP}/newcerts mkdir ${CATOP}/newcerts
mkdir ${CATOP}/private mkdir ${CATOP}/private
echo "01" > ${CATOP}/serial echo "00" > ${CATOP}/serial
touch ${CATOP}/index.txt touch ${CATOP}/index.txt
fi fi
if [ ! -f ${CATOP}/private/$CAKEY ]; then if [ ! -f ${CATOP}/private/$CAKEY ]; then
@@ -83,8 +85,11 @@ case $i in
RET=$? RET=$?
else else
echo "Making CA certificate ..." echo "Making CA certificate ..."
$REQ -new -x509 -keyout ${CATOP}/private/$CAKEY \ $REQ -new -keyout ${CATOP}/private/$CAKEY \
-out ${CATOP}/$CACERT $DAYS -out ${CATOP}/$CAREQ
$CA -out ${CATOP}/$CACERT $CADAYS -batch \
-keyfile ${CATOP}/private/$CAKEY -selfsign \
-infiles ${CATOP}/$CAREQ
RET=$? RET=$?
fi fi
fi fi

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -121,7 +121,9 @@
#include <openssl/lhash.h> #include <openssl/lhash.h>
#include <openssl/conf.h> #include <openssl/conf.h>
#include <openssl/txt_db.h> #include <openssl/txt_db.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h> #include <openssl/engine.h>
#endif
#include <openssl/ossl_typ.h> #include <openssl/ossl_typ.h>
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn); int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
@@ -144,8 +146,10 @@ 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
CONF *config=NULL;
BIO *bio_err=NULL; BIO *bio_err=NULL;
#else #else
extern CONF *config;
extern BIO *bio_err; extern BIO *bio_err;
#endif #endif
@@ -158,7 +162,9 @@ extern BIO *bio_err;
#endif #endif
#ifndef OPENSSL_SYS_NETWARE
#include <signal.h> #include <signal.h>
#endif
#ifdef SIGPIPE #ifdef SIGPIPE
#define do_pipe_sig() signal(SIGPIPE,SIG_IGN) #define do_pipe_sig() signal(SIGPIPE,SIG_IGN)
@@ -171,30 +177,57 @@ extern BIO *bio_err;
do_pipe_sig() do_pipe_sig()
# define apps_shutdown() # define apps_shutdown()
#else #else
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \ # ifndef OPENSSL_NO_ENGINE
defined(OPENSSL_SYS_WIN32) # if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
# ifdef _O_BINARY defined(OPENSSL_SYS_WIN32)
# define apps_startup() \ # ifdef _O_BINARY
do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \ # define apps_startup() \
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0) ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
# else
# define apps_startup() \
do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
# endif
# else # else
# define apps_startup() \ # define apps_startup() \
do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \ do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ ERR_load_crypto_strings(); ENGINE_load_builtin_engines(); \
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0) setup_ui_method(); } while(0)
# endif # endif
# define apps_shutdown() \
do { CONF_modules_unload(1); destroy_ui_method(); \
EVP_cleanup(); ENGINE_cleanup(); \
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
ERR_free_strings(); } while(0)
# else # else
# define apps_startup() \ # if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \ defined(OPENSSL_SYS_WIN32)
ERR_load_crypto_strings(); ENGINE_load_builtin_engines(); \ # ifdef _O_BINARY
setup_ui_method(); } while(0) # define apps_startup() \
do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
setup_ui_method(); } while(0)
# else
# define apps_startup() \
do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
setup_ui_method(); } while(0)
# endif
# else
# define apps_startup() \
do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
ERR_load_crypto_strings(); \
setup_ui_method(); } while(0)
# endif
# define apps_shutdown() \
do { CONF_modules_unload(1); destroy_ui_method(); \
EVP_cleanup(); \
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
ERR_free_strings(); } while(0)
# endif # endif
# define apps_shutdown() \
do { CONF_modules_unload(1); destroy_ui_method(); \
EVP_cleanup(); ENGINE_cleanup(); \
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
ERR_free_strings(); } while(0)
#endif #endif
typedef struct args_st typedef struct args_st
@@ -233,23 +266,58 @@ int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
int add_oid_section(BIO *err, CONF *conf); int add_oid_section(BIO *err, CONF *conf);
X509 *load_cert(BIO *err, const char *file, int format, X509 *load_cert(BIO *err, const char *file, int format,
const char *pass, ENGINE *e, const char *cert_descrip); const char *pass, ENGINE *e, const char *cert_descrip);
EVP_PKEY *load_key(BIO *err, const char *file, int format, EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
const char *pass, ENGINE *e, const char *key_descrip); const char *pass, ENGINE *e, const char *key_descrip);
EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
const char *pass, ENGINE *e, const char *key_descrip); const char *pass, ENGINE *e, const char *key_descrip);
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
const char *pass, ENGINE *e, const char *cert_descrip); const char *pass, ENGINE *e, const char *cert_descrip);
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath); X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
#ifndef OPENSSL_NO_ENGINE
ENGINE *setup_engine(BIO *err, const char *engine, int debug); ENGINE *setup_engine(BIO *err, const char *engine, int debug);
#endif
int load_config(BIO *err, CONF *cnf); int load_config(BIO *err, CONF *cnf);
char *make_config_name(void);
/* Functions defined in ca.c and also used in ocsp.c */ /* Functions defined in ca.c and also used in ocsp.c */
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
ASN1_GENERALIZEDTIME **pinvtm, char *str); ASN1_GENERALIZEDTIME **pinvtm, char *str);
int make_serial_index(TXT_DB *db);
X509_NAME *do_subject(char *str, long chtype); #define DB_type 0
#define DB_exp_date 1
#define DB_rev_date 2
#define DB_serial 3 /* index - unique */
#define DB_file 4
#define DB_name 5 /* index - unique when active and not disabled */
#define DB_NUMBER 6
#define DB_TYPE_REV 'R'
#define DB_TYPE_EXP 'E'
#define DB_TYPE_VAL 'V'
typedef struct db_attr_st
{
int unique_subject;
} DB_ATTR;
typedef struct ca_db_st
{
DB_ATTR attributes;
TXT_DB *db;
} CA_DB;
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai);
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
int index_index(CA_DB *db);
int save_index(char *dbfile, char *suffix, CA_DB *db);
int rotate_index(char *dbfile, char *new_suffix, char *old_suffix);
void free_index(CA_DB *db);
int index_name_cmp(const char **a, const char **b);
int parse_yesno(char *str, int def);
X509_NAME *parse_name(char *str, long chtype, int multirdn);
#define FORMAT_UNDEF 0 #define FORMAT_UNDEF 0
#define FORMAT_ASN1 1 #define FORMAT_ASN1 1

View File

@@ -82,6 +82,8 @@
int MAIN(int, char **); int MAIN(int, char **);
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
int i,badops=0,offset=0,ret=1,j; int i,badops=0,offset=0,ret=1,j;
@@ -90,6 +92,7 @@ int MAIN(int argc, char **argv)
BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL; BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL;
int informat,indent=0, noout = 0, dump = 0; int informat,indent=0, noout = 0, dump = 0;
char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL; char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
char *genstr=NULL, *genconf=NULL;
unsigned char *tmpbuf; unsigned char *tmpbuf;
BUF_MEM *buf=NULL; BUF_MEM *buf=NULL;
STACK *osk=NULL; STACK *osk=NULL;
@@ -167,6 +170,16 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
sk_push(osk,*(++argv)); sk_push(osk,*(++argv));
} }
else if (strcmp(*argv,"-genstr") == 0)
{
if (--argc < 1) goto bad;
genstr= *(++argv);
}
else if (strcmp(*argv,"-genconf") == 0)
{
if (--argc < 1) goto bad;
genconf= *(++argv);
}
else else
{ {
BIO_printf(bio_err,"unknown option %s\n",*argv); BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -195,6 +208,8 @@ 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," -genstr str string to generate ASN1 structure from\n");
BIO_printf(bio_err," -genconf file file to generate ASN1 structure from\n");
goto end; goto end;
} }
@@ -248,25 +263,39 @@ bad:
if ((buf=BUF_MEM_new()) == NULL) goto end; if ((buf=BUF_MEM_new()) == NULL) goto end;
if (!BUF_MEM_grow(buf,BUFSIZ*8)) goto end; /* Pre-allocate :-) */ if (!BUF_MEM_grow(buf,BUFSIZ*8)) goto end; /* Pre-allocate :-) */
if (informat == FORMAT_PEM) if (genstr || genconf)
{ {
BIO *tmp; num = do_generate(bio_err, genstr, genconf, buf);
if (num < 0)
if ((b64=BIO_new(BIO_f_base64())) == NULL) {
ERR_print_errors(bio_err);
goto end; goto end;
BIO_push(b64,in); }
tmp=in;
in=b64;
b64=tmp;
} }
num=0; else
for (;;)
{ {
if (!BUF_MEM_grow(buf,(int)num+BUFSIZ)) goto end;
i=BIO_read(in,&(buf->data[num]),BUFSIZ); if (informat == FORMAT_PEM)
if (i <= 0) break; {
num+=i; BIO *tmp;
if ((b64=BIO_new(BIO_f_base64())) == NULL)
goto end;
BIO_push(b64,in);
tmp=in;
in=b64;
b64=tmp;
}
num=0;
for (;;)
{
if (!BUF_MEM_grow(buf,(int)num+BUFSIZ)) goto end;
i=BIO_read(in,&(buf->data[num]),BUFSIZ);
if (i <= 0) break;
num+=i;
}
} }
str=buf->data; str=buf->data;
@@ -304,7 +333,15 @@ bad:
num=tmplen; num=tmplen;
} }
if (length == 0) length=(unsigned int)num; if (offset >= num)
{
BIO_printf(bio_err, "Error: offset too large\n");
goto end;
}
num -= offset;
if ((length == 0) || ((long)length > num)) length=(unsigned int)num;
if(derout) { if(derout) {
if(BIO_write(derout, str + offset, length) != (int)length) { if(BIO_write(derout, str + offset, length) != (int)length) {
BIO_printf(bio_err, "Error writing output\n"); BIO_printf(bio_err, "Error writing output\n");
@@ -332,6 +369,64 @@ end:
if (osk != NULL) sk_free(osk); if (osk != NULL) sk_free(osk);
OBJ_cleanup(); OBJ_cleanup();
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
{
CONF *cnf = NULL;
int len;
long errline;
unsigned char *p;
ASN1_TYPE *atyp = NULL;
if (genconf)
{
cnf = NCONF_new(NULL);
if (!NCONF_load(cnf, genconf, &errline))
goto conferr;
if (!genstr)
genstr = NCONF_get_string(cnf, "default", "asn1");
if (!genstr)
{
BIO_printf(bio, "Can't find 'asn1' in '%s'\n", genconf);
goto err;
}
}
atyp = ASN1_generate_nconf(genstr, cnf);
NCONF_free(cnf);
if (!atyp)
return -1;
len = i2d_ASN1_TYPE(atyp, NULL);
if (len <= 0)
goto err;
if (!BUF_MEM_grow(buf,len))
goto err;
p=(unsigned char *)buf->data;
i2d_ASN1_TYPE(atyp, &p);
ASN1_TYPE_free(atyp);
return len;
conferr:
if (errline > 0)
BIO_printf(bio, "Error on line %ld of config file '%s'\n",
errline, genconf);
else
BIO_printf(bio, "Error loading config file '%s'\n", genconf);
err:
NCONF_free(cnf);
ASN1_TYPE_free(atyp);
return -1;
}

870
apps/ca.c

File diff suppressed because it is too large Load Diff

View File

@@ -187,7 +187,7 @@ int MAIN(int argc, char **argv)
{ {
BIO_puts(STDout,SSL_CIPHER_description( BIO_puts(STDout,SSL_CIPHER_description(
sk_SSL_CIPHER_value(sk,i), sk_SSL_CIPHER_value(sk,i),
buf,512)); buf,sizeof buf));
} }
} }
@@ -203,6 +203,6 @@ end:
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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }

View File

@@ -81,6 +81,7 @@ static char *crl_usage[]={
" -in arg - input file - default stdin\n", " -in arg - input file - default stdin\n",
" -out arg - output file - default stdout\n", " -out arg - output file - default stdout\n",
" -hash - print hash value\n", " -hash - print hash value\n",
" -fingerprint - print the crl fingerprint\n",
" -issuer - print issuer DN\n", " -issuer - print issuer DN\n",
" -lastupdate - lastUpdate field\n", " -lastupdate - lastUpdate field\n",
" -nextupdate - nextUpdate field\n", " -nextupdate - nextUpdate field\n",
@@ -377,7 +378,7 @@ end:
X509_STORE_free(store); X509_STORE_free(store);
} }
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static X509_CRL *load_crl(char *infile, int format) static X509_CRL *load_crl(char *infile, int format)

View File

@@ -280,7 +280,7 @@ end:
if (crl != NULL) X509_CRL_free(crl); if (crl != NULL) X509_CRL_free(crl);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
/* /*

View File

@@ -100,7 +100,9 @@ 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;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
apps_startup(); apps_startup();
@@ -117,7 +119,7 @@ int MAIN(int argc, char **argv)
goto end; goto end;
/* first check the program name */ /* first check the program name */
program_name(argv[0],pname,PROG_NAME_SIZE); program_name(argv[0],pname,sizeof pname);
md=EVP_get_digestbyname(pname); md=EVP_get_digestbyname(pname);
@@ -166,11 +168,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) break; if (--argc < 1) break;
keyform=str2fmt(*(++argv)); keyform=str2fmt(*(++argv));
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) break; if (--argc < 1) break;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -208,7 +212,9 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\n"); BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
#endif
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);
@@ -228,7 +234,9 @@ int MAIN(int argc, char **argv)
goto end; goto end;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
in=BIO_new(BIO_s_file()); in=BIO_new(BIO_s_file());
bmd=BIO_new(BIO_f_md()); bmd=BIO_new(BIO_f_md());
@@ -277,10 +285,10 @@ int MAIN(int argc, char **argv)
if(keyfile) if(keyfile)
{ {
if (want_pub) if (want_pub)
sigkey = load_pubkey(bio_err, keyfile, keyform, NULL, sigkey = load_pubkey(bio_err, keyfile, keyform, 0, NULL,
e, "key file"); e, "key file");
else else
sigkey = load_key(bio_err, keyfile, keyform, NULL, sigkey = load_key(bio_err, keyfile, keyform, 0, NULL,
e, "key file"); e, "key file");
if (!sigkey) if (!sigkey)
{ {
@@ -339,8 +347,9 @@ int MAIN(int argc, char **argv)
} }
if(!out_bin) if(!out_bin)
{ {
tmp=tofree=OPENSSL_malloc(strlen(name)+strlen(argv[i])+5); size_t len = strlen(name)+strlen(argv[i])+5;
sprintf(tmp,"%s(%s)= ",name,argv[i]); tmp=tofree=OPENSSL_malloc(len);
BIO_snprintf(tmp,len,"%s(%s)= ",name,argv[i]);
} }
else else
tmp=""; tmp="";
@@ -356,7 +365,7 @@ int MAIN(int argc, char **argv)
end: end:
if (buf != NULL) if (buf != NULL)
{ {
memset(buf,0,BUFSIZE); OPENSSL_cleanse(buf,BUFSIZE);
OPENSSL_free(buf); OPENSSL_free(buf);
} }
if (in != NULL) BIO_free(in); if (in != NULL) BIO_free(in);
@@ -365,7 +374,7 @@ end:
if(sigbuf) OPENSSL_free(sigbuf); if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd); if (bmd != NULL) BIO_free(bmd);
apps_shutdown(); apps_shutdown();
EXIT(err); OPENSSL_EXIT(err);
} }
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,

View File

@@ -87,12 +87,17 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
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;
#ifndef OPENSSL_NO_ENGINE
char *engine;
#endif
apps_startup(); apps_startup();
@@ -103,7 +108,9 @@ int MAIN(int argc, char **argv)
if (!load_config(bio_err, NULL)) if (!load_config(bio_err, NULL))
goto end; goto end;
#ifndef OPENSSL_NO_ENGINE
engine=NULL; engine=NULL;
#endif
infile=NULL; infile=NULL;
outfile=NULL; outfile=NULL;
informat=FORMAT_PEM; informat=FORMAT_PEM;
@@ -134,11 +141,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
outfile= *(++argv); outfile= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -170,13 +179,17 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
goto end; goto end;
} }
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
in=BIO_new(BIO_s_file()); in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());
@@ -333,6 +346,6 @@ end:
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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
#endif #endif

View File

@@ -142,13 +142,15 @@
* -C * -C
*/ */
static void MS_CALLBACK dh_cb(int p, int n, void *arg); static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **); int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
DH *dh=NULL; DH *dh=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
@@ -157,7 +159,10 @@ 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;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL;
#endif
int num = 0, g = 0; int num = 0, g = 0;
apps_startup(); apps_startup();
@@ -199,11 +204,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
outfile= *(++argv); outfile= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -249,7 +256,9 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
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");
@@ -259,7 +268,9 @@ bad:
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if (g && !num) if (g && !num)
num = DEFBITS; num = DEFBITS;
@@ -283,6 +294,8 @@ bad:
if(num) { if(num) {
BN_GENCB cb;
BN_GENCB_set(&cb, dh_cb, bio_err);
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
{ {
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");
@@ -294,12 +307,13 @@ bad:
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
if (dsaparam) if (dsaparam)
{ {
DSA *dsa; DSA *dsa = DSA_new();
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num); BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
dsa = DSA_generate_parameters(num, NULL, 0, NULL, NULL, dh_cb, bio_err); if(!dsa || !DSA_generate_parameters_ex(dsa, num,
if (dsa == NULL) NULL, 0, NULL, NULL, &cb))
{ {
if(dsa) DSA_free(dsa);
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto end; goto end;
} }
@@ -315,12 +329,12 @@ bad:
else else
#endif #endif
{ {
dh = DH_new();
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
BIO_printf(bio_err,"This is going to take a long time\n"); BIO_printf(bio_err,"This is going to take a long time\n");
dh=DH_generate_parameters(num,g,dh_cb,bio_err); if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb))
if (dh == NULL)
{ {
if(dh) DH_free(dh);
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto end; goto end;
} }
@@ -519,11 +533,11 @@ end:
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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */ /* dh_cb is identical to dsa_cb in apps/dsaparam.c */
static void MS_CALLBACK dh_cb(int p, int n, void *arg) static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
{ {
char c='*'; char c='*';
@@ -531,11 +545,12 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg)
if (p == 1) c='+'; if (p == 1) c='+';
if (p == 2) c='*'; if (p == 2) c='*';
if (p == 3) c='\n'; if (p == 3) c='\n';
BIO_write((BIO *)arg,&c,1); BIO_write(cb->arg,&c,1);
(void)BIO_flush((BIO *)arg); (void)BIO_flush(cb->arg);
#ifdef LINT #ifdef LINT
p=n; p=n;
#endif #endif
return 1;
} }
#endif #endif

View File

@@ -90,7 +90,9 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
int ret=1; int ret=1;
DSA *dsa=NULL; DSA *dsa=NULL;
int i,badops=0; int i,badops=0;
@@ -98,7 +100,10 @@ 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;
#ifndef OPENSSL_NO_ENGINE
char *engine;
#endif
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;
@@ -112,7 +117,9 @@ int MAIN(int argc, char **argv)
if (!load_config(bio_err, NULL)) if (!load_config(bio_err, NULL))
goto end; goto end;
#ifndef OPENSSL_NO_ENGINE
engine=NULL; engine=NULL;
#endif
infile=NULL; infile=NULL;
outfile=NULL; outfile=NULL;
informat=FORMAT_PEM; informat=FORMAT_PEM;
@@ -153,11 +160,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passargout= *(++argv); passargout= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -189,7 +198,9 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
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 OPENSSL_NO_IDEA #ifndef OPENSSL_NO_IDEA
@@ -207,7 +218,9 @@ bad:
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
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");
@@ -314,6 +327,6 @@ end:
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
#endif #endif

View File

@@ -56,6 +56,12 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
* deprecated functions for openssl-internal code */
#ifdef OPENSSL_NO_DEPRECATED
#undef OPENSSL_NO_DEPRECATED
#endif
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
@@ -82,15 +88,31 @@
* -C * -C
* -noout * -noout
* -genkey * -genkey
* #ifdef GENCB_TEST
* -timebomb n - interrupt keygen after <n> seconds
* #endif
*/ */
static void MS_CALLBACK dsa_cb(int p, int n, void *arg); #ifdef GENCB_TEST
static int stop_keygen_flag = 0;
static void timebomb_sigalarm(int foo)
{
stop_keygen_flag = 1;
}
#endif
static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **); int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
DSA *dsa=NULL; DSA *dsa=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
@@ -98,7 +120,12 @@ int MAIN(int argc, char **argv)
char *infile,*outfile,*prog,*inrand=NULL; char *infile,*outfile,*prog,*inrand=NULL;
int numbits= -1,num,genkey=0; int numbits= -1,num,genkey=0;
int need_rand=0; int need_rand=0;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
#ifdef GENCB_TEST
int timebomb=0;
#endif
apps_startup(); apps_startup();
@@ -139,11 +166,20 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
outfile= *(++argv); outfile= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if(strcmp(*argv, "-engine") == 0) else if(strcmp(*argv, "-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine = *(++argv); engine = *(++argv);
} }
#endif
#ifdef GENCB_TEST
else if(strcmp(*argv, "-timebomb") == 0)
{
if (--argc < 1) goto bad;
timebomb = atoi(*(++argv));
}
#endif
else if (strcmp(*argv,"-text") == 0) else if (strcmp(*argv,"-text") == 0)
text=1; text=1;
else if (strcmp(*argv,"-C") == 0) else if (strcmp(*argv,"-C") == 0)
@@ -191,7 +227,12 @@ bad:
BIO_printf(bio_err," -noout no output\n"); BIO_printf(bio_err," -noout no output\n");
BIO_printf(bio_err," -genkey generate a DSA key\n"); BIO_printf(bio_err," -genkey generate a DSA key\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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
#ifdef GENCB_TEST
BIO_printf(bio_err," -timebomb n interrupt keygen after <n> seconds\n");
#endif
BIO_printf(bio_err," number number of bits to use for generating private key\n"); BIO_printf(bio_err," number number of bits to use for generating private key\n");
goto end; goto end;
} }
@@ -235,7 +276,9 @@ bad:
} }
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if (need_rand) if (need_rand)
{ {
@@ -247,10 +290,47 @@ bad:
if (numbits > 0) if (numbits > 0)
{ {
BN_GENCB cb;
BN_GENCB_set(&cb, dsa_cb, bio_err);
assert(need_rand); assert(need_rand);
dsa = DSA_new();
if(!dsa)
{
BIO_printf(bio_err,"Error allocating DSA object\n");
goto end;
}
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num); BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
BIO_printf(bio_err,"This could take some time\n"); BIO_printf(bio_err,"This could take some time\n");
dsa=DSA_generate_parameters(num,NULL,0,NULL,NULL, dsa_cb,bio_err); #ifdef GENCB_TEST
if(timebomb > 0)
{
struct sigaction act;
act.sa_handler = timebomb_sigalarm;
act.sa_flags = 0;
BIO_printf(bio_err,"(though I'll stop it if not done within %d secs)\n",
timebomb);
if(sigaction(SIGALRM, &act, NULL) != 0)
{
BIO_printf(bio_err,"Error, couldn't set SIGALRM handler\n");
goto end;
}
alarm(timebomb);
}
#endif
if(!DSA_generate_parameters_ex(dsa,num,NULL,0,NULL,NULL, &cb))
{
#ifdef GENCB_TEST
if(stop_keygen_flag)
{
BIO_printf(bio_err,"DSA key generation time-stopped\n");
/* This is an asked-for behaviour! */
ret = 0;
goto end;
}
#endif
BIO_printf(bio_err,"Error, DSA key generation failed\n");
goto end;
}
} }
else if (informat == FORMAT_ASN1) else if (informat == FORMAT_ASN1)
dsa=d2i_DSAparams_bio(in,NULL); dsa=d2i_DSAparams_bio(in,NULL);
@@ -372,10 +452,10 @@ 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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static void MS_CALLBACK dsa_cb(int p, int n, void *arg) static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
{ {
char c='*'; char c='*';
@@ -383,10 +463,15 @@ static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
if (p == 1) c='+'; if (p == 1) c='+';
if (p == 2) c='*'; if (p == 2) c='*';
if (p == 3) c='\n'; if (p == 3) c='\n';
BIO_write(arg,&c,1); BIO_write(cb->arg,&c,1);
(void)BIO_flush(arg); (void)BIO_flush(cb->arg);
#ifdef LINT #ifdef LINT
p=n; p=n;
#endif #endif
#ifdef GENCB_TEST
if(stop_keygen_flag)
return 0;
#endif
return 1;
} }
#endif #endif

395
apps/ec.c Normal file
View File

@@ -0,0 +1,395 @@
/* apps/ec.c */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
/* ====================================================================
* 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).
*
*/
#ifndef OPENSSL_NO_EC
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#undef PROG
#define PROG ec_main
/* -inform arg - input format - default PEM (one of DER, NET or PEM)
* -outform arg - output format - default PEM
* -in arg - input file - default stdin
* -out arg - output file - default stdout
* -des - encrypt output if PEM format with DES in cbc mode
* -text - print a text version
* -param_out - print the elliptic curve parameters
* -conv_form arg - specifies the point encoding form
* -param_enc arg - specifies the parameter encoding
*/
int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int ret = 1;
EC_KEY *eckey = NULL;
int i, badops = 0;
const EVP_CIPHER *enc = NULL;
BIO *in = NULL, *out = NULL;
int informat, outformat, text=0, noout=0;
int pubin = 0, pubout = 0, param_out = 0;
char *infile, *outfile, *prog, *engine;
char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL;
point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
int new_form = 0;
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
int new_asn1_flag = 0;
apps_startup();
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
if (!load_config(bio_err, NULL))
goto end;
engine = NULL;
infile = NULL;
outfile = NULL;
informat = FORMAT_PEM;
outformat = FORMAT_PEM;
prog = argv[0];
argc--;
argv++;
while (argc >= 1)
{
if (strcmp(*argv,"-inform") == 0)
{
if (--argc < 1) goto bad;
informat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-outform") == 0)
{
if (--argc < 1) goto bad;
outformat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-in") == 0)
{
if (--argc < 1) goto bad;
infile= *(++argv);
}
else if (strcmp(*argv,"-out") == 0)
{
if (--argc < 1) goto bad;
outfile= *(++argv);
}
else if (strcmp(*argv,"-passin") == 0)
{
if (--argc < 1) goto bad;
passargin= *(++argv);
}
else if (strcmp(*argv,"-passout") == 0)
{
if (--argc < 1) goto bad;
passargout= *(++argv);
}
else if (strcmp(*argv, "-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv, "-noout") == 0)
noout = 1;
else if (strcmp(*argv, "-text") == 0)
text = 1;
else if (strcmp(*argv, "-conv_form") == 0)
{
if (--argc < 1)
goto bad;
++argv;
new_form = 1;
if (strcmp(*argv, "compressed") == 0)
form = POINT_CONVERSION_COMPRESSED;
else if (strcmp(*argv, "uncompressed") == 0)
form = POINT_CONVERSION_UNCOMPRESSED;
else if (strcmp(*argv, "hybrid") == 0)
form = POINT_CONVERSION_HYBRID;
else
goto bad;
}
else if (strcmp(*argv, "-param_enc") == 0)
{
if (--argc < 1)
goto bad;
++argv;
new_asn1_flag = 1;
if (strcmp(*argv, "named_curve") == 0)
asn1_flag = OPENSSL_EC_NAMED_CURVE;
else if (strcmp(*argv, "explicit") == 0)
asn1_flag = 0;
else
goto bad;
}
else if (strcmp(*argv, "-param_out") == 0)
param_out = 1;
else if (strcmp(*argv, "-pubin") == 0)
pubin=1;
else if (strcmp(*argv, "-pubout") == 0)
pubout=1;
else if ((enc=EVP_get_cipherbyname(&(argv[0][1]))) == NULL)
{
BIO_printf(bio_err, "unknown option %s\n", *argv);
badops=1;
break;
}
argc--;
argv++;
}
if (badops)
{
bad:
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, " -inform arg input 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, " -passin arg input file pass "
"phrase source\n");
BIO_printf(bio_err, " -out arg output file\n");
BIO_printf(bio_err, " -passout arg output file pass "
"phrase source\n");
BIO_printf(bio_err, " -engine e use engine e, "
"possibly a hardware device.\n");
BIO_printf(bio_err, " -des encrypt PEM output, "
"instead of 'des' every other \n"
" cipher "
"supported by OpenSSL can be used\n");
BIO_printf(bio_err, " -text print the key\n");
BIO_printf(bio_err, " -noout don't print key out\n");
BIO_printf(bio_err, " -param_out print the elliptic "
"curve parameters\n");
BIO_printf(bio_err, " -conv_form arg specifies the "
"point conversion form \n");
BIO_printf(bio_err, " possible values:"
" compressed\n");
BIO_printf(bio_err, " "
" uncompressed (default)\n");
BIO_printf(bio_err, " "
" hybrid\n");
BIO_printf(bio_err, " -param_enc arg specifies the way"
" the ec parameters are encoded\n");
BIO_printf(bio_err, " in the asn1 der "
"encoding\n");
BIO_printf(bio_err, " possilbe values:"
" named_curve (default)\n");
BIO_printf(bio_err," "
"explicit\n");
goto end;
}
ERR_load_crypto_strings();
e = setup_engine(bio_err, engine, 0);
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout))
{
BIO_printf(bio_err, "Error getting passwords\n");
goto end;
}
in = BIO_new(BIO_s_file());
out = BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL))
{
ERR_print_errors(bio_err);
goto end;
}
if (infile == NULL)
BIO_set_fp(in, stdin, BIO_NOCLOSE);
else
{
if (BIO_read_filename(in, infile) <= 0)
{
perror(infile);
goto end;
}
}
BIO_printf(bio_err, "read EC key\n");
if (informat == FORMAT_ASN1)
{
if (pubin)
eckey = d2i_EC_PUBKEY_bio(in, NULL);
else
eckey = d2i_ECPrivateKey_bio(in, NULL);
}
else if (informat == FORMAT_PEM)
{
if (pubin)
eckey = PEM_read_bio_EC_PUBKEY(in, NULL, NULL,
NULL);
else
eckey = PEM_read_bio_ECPrivateKey(in, NULL, NULL,
passin);
}
else
{
BIO_printf(bio_err, "bad input format specified for key\n");
goto end;
}
if (eckey == NULL)
{
BIO_printf(bio_err,"unable to load Key\n");
ERR_print_errors(bio_err);
goto end;
}
if (outfile == NULL)
{
BIO_set_fp(out, stdout, BIO_NOCLOSE);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
out = BIO_push(tmpbio, out);
}
#endif
}
else
{
if (BIO_write_filename(out, outfile) <= 0)
{
perror(outfile);
goto end;
}
}
if (new_form)
{
EC_GROUP_set_point_conversion_form(eckey->group, form);
eckey->conv_form = form;
}
if (new_asn1_flag)
EC_GROUP_set_asn1_flag(eckey->group, asn1_flag);
if (text)
if (!EC_KEY_print(out, eckey, 0))
{
perror(outfile);
ERR_print_errors(bio_err);
goto end;
}
if (noout)
goto end;
BIO_printf(bio_err, "writing EC key\n");
if (outformat == FORMAT_ASN1)
{
if (param_out)
i = i2d_ECPKParameters_bio(out, eckey->group);
else if (pubin || pubout)
i = i2d_EC_PUBKEY_bio(out, eckey);
else
i = i2d_ECPrivateKey_bio(out, eckey);
}
else if (outformat == FORMAT_PEM)
{
if (param_out)
i = PEM_write_bio_ECPKParameters(out, eckey->group);
else if (pubin || pubout)
i = PEM_write_bio_EC_PUBKEY(out, eckey);
else
i = PEM_write_bio_ECPrivateKey(out, eckey, enc,
NULL, 0, NULL, passout);
}
else
{
BIO_printf(bio_err, "bad output format specified for "
"outfile\n");
goto end;
}
if (!i)
{
BIO_printf(bio_err, "unable to write private key\n");
ERR_print_errors(bio_err);
}
else
ret=0;
end:
if (in)
BIO_free(in);
if (out)
BIO_free_all(out);
if (eckey)
EC_KEY_free(eckey);
if (passin)
OPENSSL_free(passin);
if (passout)
OPENSSL_free(passout);
apps_shutdown();
OPENSSL_EXIT(ret);
}
#endif

View File

@@ -1,445 +0,0 @@
/* apps/ecdsa.c */
/* ====================================================================
* 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).
*
*/
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* 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 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 acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS 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 AUTHOR OR 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.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef OPENSSL_NO_ECDSA
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#undef PROG
#define PROG ecdsa_main
/* -inform arg - input format - default PEM (one of DER, NET or PEM)
* -outform arg - output format - default PEM
* -in arg - input file - default stdin
* -out arg - output file - default stdout
* -des - encrypt output if PEM format with DES in cbc mode
* -des3 - encrypt output if PEM format
* -idea - encrypt output if PEM format
* -aes128 - encrypt output if PEM format
* -aes192 - encrypt output if PEM format
* -aes256 - encrypt output if PEM format
* -text - print a text version
* -pub - print the ECDSA public key
* -compressed - print the public key in compressed form ( default )
* -hybrid - print the public key in hybrid form
* -uncompressed - print the public key in uncompressed form
* the last three options ( compressed, hybrid and uncompressed )
* are only used if the "-pub" option is also selected.
* For a precise description of the the meaning of compressed,
* hybrid and uncompressed please refer to the X9.62 standart.
* All three forms represents ways to express the ecdsa public
* key ( a point on a elliptic curve ) as octet string. Let len be
* the length ( in bytes ) of an element of the field over which
* the curve is defined, then a compressed octet string has the form
* 0x02 + result of BN_bn2bin() of the x coordinate of the public key
*/
int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int ret = 1;
ECDSA *ecdsa = NULL;
int i, badops = 0;
const EVP_CIPHER *enc = NULL;
BIO *in = NULL, *out = NULL;
int informat, outformat, text=0, noout=0;
int pubin = 0, pubout = 0;
char *infile, *outfile, *prog, *engine;
char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL;
int pub = 0, point_form = 0;
unsigned char *buffer = NULL;
unsigned int buf_len = 0;
BIGNUM *tmp_bn = NULL;
apps_startup();
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
if (!load_config(bio_err, NULL))
goto end;
engine = NULL;
infile = NULL;
outfile = NULL;
informat = FORMAT_PEM;
outformat = FORMAT_PEM;
prog = argv[0];
argc--;
argv++;
while (argc >= 1)
{
if (strcmp(*argv,"-inform") == 0)
{
if (--argc < 1) goto bad;
informat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-outform") == 0)
{
if (--argc < 1) goto bad;
outformat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-in") == 0)
{
if (--argc < 1) goto bad;
infile= *(++argv);
}
else if (strcmp(*argv,"-out") == 0)
{
if (--argc < 1) goto bad;
outfile= *(++argv);
}
else if (strcmp(*argv,"-passin") == 0)
{
if (--argc < 1) goto bad;
passargin= *(++argv);
}
else if (strcmp(*argv,"-passout") == 0)
{
if (--argc < 1) goto bad;
passargout= *(++argv);
}
else if (strcmp(*argv, "-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv, "-noout") == 0)
noout = 1;
else if (strcmp(*argv, "-text") == 0)
text = 1;
else if (strcmp(*argv, "-pub") == 0)
{
pub = 1;
buffer = (unsigned char *)(*(argv+1));
if (strcmp((char *)buffer, "compressed") == 0)
point_form = POINT_CONVERSION_COMPRESSED;
else if (strcmp((char *)buffer, "hybrid") == 0)
point_form = POINT_CONVERSION_HYBRID;
else if (strcmp((char *)buffer, "uncompressed") == 0)
point_form = POINT_CONVERSION_UNCOMPRESSED;
if (point_form)
{
argc--;
argv++;
}
}
else if (strcmp(*argv, "-pubin") == 0)
pubin=1;
else if (strcmp(*argv, "-pubout") == 0)
pubout=1;
else if ((enc=EVP_get_cipherbyname(&(argv[0][1]))) == NULL)
{
BIO_printf(bio_err,"unknown option %s\n",*argv);
badops=1;
break;
}
argc--;
argv++;
}
if (badops)
{
bad:
BIO_printf(bio_err, "%s [options] <infile >outfile\n",prog);
BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, " -inform arg input 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, " -passin arg input file pass phrase source\n");
BIO_printf(bio_err, " -out arg output file\n");
BIO_printf(bio_err, " -passout arg output file pass phrase source\n");
BIO_printf(bio_err, " -engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err, " -des encrypt PEM output with cbc des\n");
BIO_printf(bio_err, " -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
#ifndef OPENSSL_NO_IDEA
BIO_printf(bio_err, " -idea encrypt PEM output with cbc idea\n");
#endif
#ifndef OPENSSL_NO_AES
BIO_printf(bio_err, " -aes128, -aes192, -aes256\n");
BIO_printf(bio_err, " encrypt PEM output with cbc aes\n");
#endif
BIO_printf(bio_err, " -text print the key in text\n");
BIO_printf(bio_err, " -noout don't print key out\n");
BIO_printf(bio_err, " -pub [compressed | hybrid | uncompressed] \n");
BIO_printf(bio_err, " compressed print the public key in compressed form ( default )\n");
BIO_printf(bio_err, " hybrid print the public key in hybrid form\n");
BIO_printf(bio_err, " uncompressed print the public key in uncompressed form\n");
goto end;
}
ERR_load_crypto_strings();
e = setup_engine(bio_err, engine, 0);
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout))
{
BIO_printf(bio_err, "Error getting passwords\n");
goto end;
}
in = BIO_new(BIO_s_file());
out = BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL))
{
ERR_print_errors(bio_err);
goto end;
}
if (infile == NULL)
BIO_set_fp(in,stdin,BIO_NOCLOSE);
else
{
if (BIO_read_filename(in,infile) <= 0)
{
perror(infile);
goto end;
}
}
BIO_printf(bio_err,"read ECDSA key\n");
if (informat == FORMAT_ASN1)
{
if (pubin)
ecdsa = d2i_ECDSA_PUBKEY_bio(in, NULL);
else
ecdsa = d2i_ECDSAPrivateKey_bio(in, NULL);
} else if (informat == FORMAT_PEM)
{
if (pubin)
ecdsa = PEM_read_bio_ECDSA_PUBKEY(in, NULL, NULL, NULL);
else
ecdsa = PEM_read_bio_ECDSAPrivateKey(in, NULL, NULL, passin);
} else
{
BIO_printf(bio_err, "bad input format specified for key\n");
goto end;
}
if (ecdsa == NULL)
{
BIO_printf(bio_err,"unable to load Key\n");
ERR_print_errors(bio_err);
goto end;
}
if (outfile == NULL)
{
BIO_set_fp(out, stdout, BIO_NOCLOSE);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
out = BIO_push(tmpbio, out);
}
#endif
}
else
{
if (BIO_write_filename(out, outfile) <= 0)
{
perror(outfile);
goto end;
}
}
if (text)
if (!ECDSA_print(out, ecdsa, 0))
{
perror(outfile);
ERR_print_errors(bio_err);
goto end;
}
if (pub)
{
fprintf(stdout, "Public Key (");
if (point_form == POINT_CONVERSION_COMPRESSED)
fprintf(stdout, "COMPRESSED");
else if (point_form == POINT_CONVERSION_UNCOMPRESSED)
fprintf(stdout, "UNCOMPRESSED");
else if (point_form == POINT_CONVERSION_HYBRID)
fprintf(stdout, "HYBRID");
fprintf(stdout, ")=");
buf_len = EC_POINT_point2oct(ecdsa->group, EC_GROUP_get0_generator(ecdsa->group),
point_form, NULL, 0, NULL);
if (!buf_len)
{
BIO_printf(bio_err,"invalid public key length\n");
ERR_print_errors(bio_err);
goto end;
}
if ((tmp_bn = BN_new()) == NULL ||
(buffer = OPENSSL_malloc(buf_len)) == NULL) goto end;
if (!EC_POINT_point2oct(ecdsa->group, EC_GROUP_get0_generator(ecdsa->group),
point_form, buffer, buf_len, NULL) ||
!BN_bin2bn(buffer, buf_len, tmp_bn))
{
BIO_printf(bio_err,"can not encode public key\n");
ERR_print_errors(bio_err);
OPENSSL_free(buffer);
goto end;
}
BN_print(out, tmp_bn);
fprintf(stdout,"\n");
}
if (noout)
goto end;
BIO_printf(bio_err, "writing ECDSA key\n");
if (outformat == FORMAT_ASN1)
{
if(pubin || pubout)
i = i2d_ECDSA_PUBKEY_bio(out, ecdsa);
else
i = i2d_ECDSAPrivateKey_bio(out, ecdsa);
} else if (outformat == FORMAT_PEM)
{
if(pubin || pubout)
i = PEM_write_bio_ECDSA_PUBKEY(out, ecdsa);
else
i = PEM_write_bio_ECDSAPrivateKey(out, ecdsa, enc,
NULL, 0, NULL, passout);
} else
{
BIO_printf(bio_err, "bad output format specified for outfile\n");
goto end;
}
if (!i)
{
BIO_printf(bio_err, "unable to write private key\n");
ERR_print_errors(bio_err);
}
else
ret=0;
end:
if (in) BIO_free(in);
if (out) BIO_free_all(out);
if (ecdsa) ECDSA_free(ecdsa);
if (tmp_bn) BN_free(tmp_bn);
if (passin) OPENSSL_free(passin);
if (passout) OPENSSL_free(passout);
apps_shutdown();
EXIT(ret);
}
#endif

View File

@@ -1,4 +1,7 @@
/* apps/ecparam.c */ /* apps/ecparam.c */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
/* ==================================================================== /* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
* *
@@ -52,7 +55,20 @@
* Hudson (tjh@cryptsoft.com). * Hudson (tjh@cryptsoft.com).
* *
*/ */
#ifndef OPENSSL_NO_ECDSA /* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
* Portions of the attached software ("Contribution") are developed by
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
*
* The Contribution is licensed pursuant to the OpenSSL open source
* license provided above.
*
* The elliptic curve binary polynomial software is originally written by
* Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
*
*/
#ifndef OPENSSL_NO_EC
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -63,62 +79,36 @@
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/ec.h> #include <openssl/ec.h>
#include <openssl/ecdsa.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#undef PROG #undef PROG
#define PROG ecparam_main #define PROG ecparam_main
/* -inform arg - input format - default PEM (DER or PEM) /* -inform arg - input format - default PEM (DER or PEM)
* -outform arg - output format - default PEM * -outform arg - output format - default PEM
* -in arg - input file - default stdin * -in arg - input file - default stdin
* -out arg - output file - default stdout * -out arg - output file - default stdout
* -noout * -noout - do not print the ec parameter
* -text * -text - print the ec parameters in text form
* -check - validate the ec parameters * -check - validate the ec parameters
* -C * -C - print a 'C' function creating the parameters
* -noout * -name arg - use the ec parameters with 'short name' name
* -name file - use the ecparameters with 'short name' name * -list_curves - prints a list of all currently available curve 'short names'
* -list_curves - prints a list of all currently available curve * -conv_form arg - specifies the point conversion form
* 'short names' and exits * - possible values: compressed
* -conv_form - specifies the point conversion form * uncompressed (default)
* possible values : compressed * hybrid
* uncompressed (default) * -param_enc arg - specifies the way the ec parameters are encoded
* hybrid * in the asn1 der encoding
* -param_enc - specifies the way the ec parameters are encoded * possible values: named_curve (default)
* in the asn1 der encoding * explicit
* possilbe values : named_curve (default) * -no_seed - if 'explicit' parameters are choosen do not use the seed
* explicit * -genkey - generate ec key
* -no_seed - if 'explicit' parameters are choosen do not * -rand file - files to use for random number input
* use the seed * -engine e - use engine e, possibly a hardware device
* -genkey - generates a ecdsa private key
* -rand file
* -engine e - use engine e, possible a hardware device
*/ */
static const char *curve_list[20] = {
"prime192v1 - NIST recommended curve over a 192 bit prime field",
"prime192v2 - 192 bit prime curve from the X9.62 draft",
"prime192v3 - 192 bit prime curve from the X9.62 draft",
"prime239v1 - 239 bit prime curve from the X9.62 draft",
"prime239v2 - 239 bit prime curve from the X9.62 draft",
"prime239v3 - 239 bit prime curve from the X9.62 draft",
"prime256v1 - NIST recommended curve over a 256 bit prime field",
"secp112r1 - SECG recommended curve over a 112 bit prime field",
"secp112r2 - SECG recommended curve over a 112 bit prime field",
"secp128r1 - SECG recommended curve over a 128 bit prime field",
"secp128r2 - SECG recommended curve over a 128 bit prime field",
"secp160k1 - SECG recommended curve over a 160 bit prime field",
"secp160r1 - SECG recommended curve over a 160 bit prime field",
"secp160r2 - SECG recommended curve over a 160 bit prime field",
"secp192k1 - SECG recommended curve over a 192 bit prime field",
"secp224k1 - SECG recommended curve over a 224 bit prime field",
"secp224r1 - NIST recommended curve over a 224 bit prime field",
"secp256k1 - SECG recommended curve over a 256 bit prime field",
"secp384r1 - NIST recommended curve over a 384 bit prime field",
"secp521r1 - NIST recommended curve over a 521 bit prime field"
};
static int ecparam_print_var(BIO *,BIGNUM *,const char *,int,unsigned char *); static int ecparam_print_var(BIO *,BIGNUM *,const char *,int,unsigned char *);
@@ -258,52 +248,51 @@ int MAIN(int argc, char **argv)
bad: bad:
BIO_printf(bio_err, "%s [options] <infile >outfile\n",prog); BIO_printf(bio_err, "%s [options] <infile >outfile\n",prog);
BIO_printf(bio_err, "where options are\n"); BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, " -inform arg input format - " BIO_printf(bio_err, " -inform arg input format - "
"default PEM (DER or PEM)\n"); "default PEM (DER or PEM)\n");
BIO_printf(bio_err, " -outform arg output format - " BIO_printf(bio_err, " -outform arg output format - "
"default PEM\n"); "default PEM\n");
BIO_printf(bio_err, " -in arg input file - " BIO_printf(bio_err, " -in arg input file - "
"default stdin\n"); "default stdin\n");
BIO_printf(bio_err, " -out arg output file - " BIO_printf(bio_err, " -out arg output file - "
"default stdout\n"); "default stdout\n");
BIO_printf(bio_err, " -noout do not print the " BIO_printf(bio_err, " -noout do not print the "
"ec parameter\n"); "ec parameter\n");
BIO_printf(bio_err, " -text print the ec " BIO_printf(bio_err, " -text print the ec "
"parameters in text form\n"); "parameters in text form\n");
BIO_printf(bio_err, " -check validate the ec " BIO_printf(bio_err, " -check validate the ec "
"parameters\n"); "parameters\n");
BIO_printf(bio_err, " -C print a 'C' " BIO_printf(bio_err, " -C print a 'C' "
"function creating the parameters\n"); "function creating the parameters\n");
BIO_printf(bio_err, " -name arg use the " BIO_printf(bio_err, " -name arg use the "
"ec parameters with 'short name' name\n"); "ec parameters with 'short name' name\n");
BIO_printf(bio_err, " -list_curves prints a list of " BIO_printf(bio_err, " -list_curves prints a list of "
"all currently available curve\n"); "all currently available curve 'short names'\n");
BIO_printf(bio_err, " 'short names'\n"); BIO_printf(bio_err, " -conv_form arg specifies the "
BIO_printf(bio_err, " -conv_form arg specifies the "
"point conversion form \n"); "point conversion form \n");
BIO_printf(bio_err, " possible values :" BIO_printf(bio_err, " possible values:"
" compressed\n"); " compressed\n");
BIO_printf(bio_err, " " BIO_printf(bio_err, " "
" uncompressed (default)\n"); " uncompressed (default)\n");
BIO_printf(bio_err, " " BIO_printf(bio_err, " "
" hybrid\n"); " hybrid\n");
BIO_printf(bio_err, " -param_enc arg specifies the way" BIO_printf(bio_err, " -param_enc arg specifies the way"
" the ec parameters are encoded\n"); " the ec parameters are encoded\n");
BIO_printf(bio_err, " in the asn1 der " BIO_printf(bio_err, " in the asn1 der "
"encoding\n"); "encoding\n");
BIO_printf(bio_err, " possilbe values :" BIO_printf(bio_err, " possible values:"
" named_curve (default)\n"); " named_curve (default)\n");
BIO_printf(bio_err," " BIO_printf(bio_err, " "
" explicit\n"); " explicit\n");
BIO_printf(bio_err, " -no_seed if 'explicit'" BIO_printf(bio_err, " -no_seed if 'explicit'"
" parameters are choosen do not\n"); " parameters are choosen do not"
BIO_printf(bio_err, " use the seed\n"); " use the seed\n");
BIO_printf(bio_err, " -genkey generate ecdsa" BIO_printf(bio_err, " -genkey generate ec"
" key\n"); " key\n");
BIO_printf(bio_err, " -rand file files to use for" BIO_printf(bio_err, " -rand file files to use for"
" random number input\n"); " random number input\n");
BIO_printf(bio_err, " -engine e use engine e, " BIO_printf(bio_err, " -engine e use engine e, "
"possible a hardware device\n"); "possibly a hardware device\n");
goto end; goto end;
} }
@@ -350,19 +339,70 @@ bad:
if (list_curves) if (list_curves)
{ {
int counter=0; EC_builtin_curve *curves = NULL;
size_t crv_len = 0;
size_t n = 0;
size_t len;
for (; counter < sizeof(curve_list)/sizeof(char *); counter++) crv_len = EC_get_builtin_curves(NULL, 0);
if (BIO_printf(bio_err, " %s\n", curve_list[counter])
<= 0) curves = OPENSSL_malloc(sizeof(EC_builtin_curve) * crv_len);
goto end;
if (curves == NULL)
goto end;
if (!EC_get_builtin_curves(curves, crv_len))
{
OPENSSL_free(curves);
goto end;
}
for (n = 0; n < crv_len; n++)
{
const char *comment;
const char *sname;
comment = curves[n].comment;
sname = OBJ_nid2sn(curves[n].nid);
if (comment == NULL)
comment = "CURVE DESCRIPTION NOT AVAILABLE";
if (sname == NULL)
sname = "";
len = BIO_printf(out, " %-10s: ", sname);
if (len + strlen(comment) > 80)
BIO_printf(out, "\n%80s\n", comment);
else
BIO_printf(out, "%s\n", comment);
}
OPENSSL_free(curves);
ret = 0; ret = 0;
goto end; goto end;
} }
if (curve_name != NULL) if (curve_name != NULL)
{ {
int nid = OBJ_sn2nid(curve_name); int nid;
/* workaround for the SECG curve names secp192r1
* and secp256r1 (which are the same as the curves
* prime192v1 and prime256v1 defined in X9.62)
*/
if (!strcmp(curve_name, "secp192r1"))
{
BIO_printf(bio_err, "using curve name prime192v1 "
"instead of secp192r1\n");
nid = NID_X9_62_prime192v1;
}
else if (!strcmp(curve_name, "secp256r1"))
{
BIO_printf(bio_err, "using curve name prime256v1 "
"instead of secp256r1\n");
nid = NID_X9_62_prime256v1;
}
else
nid = OBJ_sn2nid(curve_name);
if (nid == 0) if (nid == 0)
{ {
@@ -600,36 +640,36 @@ bad:
if (genkey) if (genkey)
{ {
ECDSA *ecdsa = ECDSA_new(); EC_KEY *eckey = EC_KEY_new();
if (ecdsa == NULL) if (eckey == NULL)
goto end; goto end;
assert(need_rand); assert(need_rand);
ecdsa->group = group; eckey->group = group;
if (!ECDSA_generate_key(ecdsa)) if (!EC_KEY_generate_key(eckey))
{ {
ecdsa->group = NULL; eckey->group = NULL;
ECDSA_free(ecdsa); EC_KEY_free(eckey);
goto end; goto end;
} }
if (outformat == FORMAT_ASN1) if (outformat == FORMAT_ASN1)
i = i2d_ECDSAPrivateKey_bio(out, ecdsa); i = i2d_ECPrivateKey_bio(out, eckey);
else if (outformat == FORMAT_PEM) else if (outformat == FORMAT_PEM)
i = PEM_write_bio_ECDSAPrivateKey(out, ecdsa, NULL, i = PEM_write_bio_ECPrivateKey(out, eckey, NULL,
NULL, 0, NULL, NULL); NULL, 0, NULL, NULL);
else else
{ {
BIO_printf(bio_err, "bad output format specified " BIO_printf(bio_err, "bad output format specified "
"for outfile\n"); "for outfile\n");
ecdsa->group = NULL; eckey->group = NULL;
ECDSA_free(ecdsa); EC_KEY_free(eckey);
goto end; goto end;
} }
ecdsa->group = NULL; eckey->group = NULL;
ECDSA_free(ecdsa); EC_KEY_free(eckey);
} }
if (need_rand) if (need_rand)
@@ -658,10 +698,10 @@ end:
if (group != NULL) if (group != NULL)
EC_GROUP_free(group); EC_GROUP_free(group);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
int ecparam_print_var(BIO *out, BIGNUM *in, const char *var, static int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
int len, unsigned char *buffer) int len, unsigned char *buffer)
{ {
BIO_printf(out, "static unsigned char %s_%d[] = {", var, len); BIO_printf(out, "static unsigned char %s_%d[] = {", var, len);

View File

@@ -100,9 +100,11 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
static const char magic[]="Salted__"; static const char magic[]="Salted__";
char mbuf[8]; /* should be 1 smaller than magic */ char mbuf[sizeof magic-1];
char *strbuf=NULL; char *strbuf=NULL;
unsigned char *buff=NULL,*bufsize=NULL; unsigned char *buff=NULL,*bufsize=NULL;
int bsize=BSIZE,verbose=0; int bsize=BSIZE,verbose=0;
@@ -119,7 +121,9 @@ int MAIN(int argc, char **argv)
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 39
char pname[PROG_NAME_SIZE+1]; char pname[PROG_NAME_SIZE+1];
#ifndef OPENSSL_NO_ENGINE
char *engine = NULL; char *engine = NULL;
#endif
apps_startup(); apps_startup();
@@ -131,7 +135,7 @@ int MAIN(int argc, char **argv)
goto end; goto end;
/* first check the program name */ /* first check the program name */
program_name(argv[0],pname,PROG_NAME_SIZE); program_name(argv[0],pname,sizeof pname);
if (strcmp(pname,"base64") == 0) if (strcmp(pname,"base64") == 0)
base64=1; base64=1;
@@ -163,11 +167,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passarg= *(++argv); passarg= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -216,7 +222,7 @@ int MAIN(int argc, char **argv)
goto bad; goto bad;
} }
buf[0]='\0'; buf[0]='\0';
fgets(buf,128,infile); fgets(buf,sizeof buf,infile);
fclose(infile); fclose(infile);
i=strlen(buf); i=strlen(buf);
if ((i > 0) && if ((i > 0) &&
@@ -270,7 +276,9 @@ 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>");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e"); BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
#endif
BIO_printf(bio_err,"Cipher Types\n"); BIO_printf(bio_err,"Cipher Types\n");
OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH,
@@ -284,7 +292,9 @@ bad:
argv++; argv++;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if (bufsize != NULL) if (bufsize != NULL)
{ {
@@ -363,9 +373,9 @@ bad:
{ {
char buf[200]; char buf[200];
sprintf(buf,"enter %s %s password:", BIO_snprintf(buf,sizeof buf,"enter %s %s password:",
OBJ_nid2ln(EVP_CIPHER_nid(cipher)), OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
(enc)?"encryption":"decryption"); (enc)?"encryption":"decryption");
strbuf[0]='\0'; strbuf[0]='\0';
i=EVP_read_pw_string((char *)strbuf,SIZE,buf,enc); i=EVP_read_pw_string((char *)strbuf,SIZE,buf,enc);
if (i == 0) if (i == 0)
@@ -442,12 +452,12 @@ bad:
else { else {
if(enc) { if(enc) {
if(hsalt) { if(hsalt) {
if(!set_hex(hsalt,salt,PKCS5_SALT_LEN)) { if(!set_hex(hsalt,salt,sizeof salt)) {
BIO_printf(bio_err, BIO_printf(bio_err,
"invalid hex salt value\n"); "invalid hex salt value\n");
goto end; goto end;
} }
} else if (RAND_pseudo_bytes(salt, PKCS5_SALT_LEN) < 0) } else if (RAND_pseudo_bytes(salt, sizeof salt) < 0)
goto end; goto end;
/* If -P option then don't bother writing */ /* If -P option then don't bother writing */
if((printkey != 2) if((printkey != 2)
@@ -455,14 +465,14 @@ bad:
sizeof magic-1) != sizeof magic-1 sizeof magic-1) != sizeof magic-1
|| BIO_write(wbio, || BIO_write(wbio,
(char *)salt, (char *)salt,
PKCS5_SALT_LEN) != PKCS5_SALT_LEN)) { sizeof salt) != sizeof salt)) {
BIO_printf(bio_err,"error writing output file\n"); BIO_printf(bio_err,"error writing output file\n");
goto end; goto end;
} }
} else if(BIO_read(rbio,mbuf,sizeof mbuf) != sizeof mbuf } else if(BIO_read(rbio,mbuf,sizeof mbuf) != sizeof mbuf
|| BIO_read(rbio, || BIO_read(rbio,
(unsigned char *)salt, (unsigned char *)salt,
PKCS5_SALT_LEN) != PKCS5_SALT_LEN) { sizeof salt) != sizeof salt) {
BIO_printf(bio_err,"error reading input file\n"); BIO_printf(bio_err,"error reading input file\n");
goto end; goto end;
} else if(memcmp(mbuf,magic,sizeof magic-1)) { } else if(memcmp(mbuf,magic,sizeof magic-1)) {
@@ -481,9 +491,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)
memset(str,0,SIZE); OPENSSL_cleanse(str,SIZE);
else else
memset(str,0,strlen(str)); OPENSSL_cleanse(str,strlen(str));
} }
if ((hiv != NULL) && !set_hex(hiv,iv,sizeof iv)) if ((hiv != NULL) && !set_hex(hiv,iv,sizeof iv))
{ {
@@ -524,7 +534,7 @@ bad:
if (!nosalt) if (!nosalt)
{ {
printf("salt="); printf("salt=");
for (i=0; i<PKCS5_SALT_LEN; i++) for (i=0; i<(int)sizeof(salt); i++)
printf("%02X",salt[i]); printf("%02X",salt[i]);
printf("\n"); printf("\n");
} }
@@ -586,7 +596,7 @@ end:
if (b64 != NULL) BIO_free(b64); if (b64 != NULL) BIO_free(b64);
if(pass) OPENSSL_free(pass); if(pass) OPENSSL_free(pass);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
int set_hex(char *in, unsigned char *out, int size) int set_hex(char *in, unsigned char *out, int size)

View File

@@ -56,6 +56,8 @@
* *
*/ */
#ifndef OPENSSL_NO_ENGINE
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -77,7 +79,8 @@ static char *engine_usage[]={
" -vvv will also add the input flags for each command\n", " -vvv will also add the input flags for each command\n",
" -vvvv will also show internal input flags\n", " -vvvv will also show internal input flags\n",
" -c - for each engine, also list the capabilities\n", " -c - for each engine, also list the capabilities\n",
" -t - for each engine, check that they are really available\n", " -t[t] - for each engine, check that they are really available\n",
" -tt will display error trace for unavailable engines\n",
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n", " -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n",
" to load it (if -t is used)\n", " to load it (if -t is used)\n",
" -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n", " -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n",
@@ -120,8 +123,8 @@ static int append_buf(char **buf, const char *s, int *size, int step)
return 0; return 0;
if (**buf != '\0') if (**buf != '\0')
strcat(*buf, ", "); BUF_strlcat(*buf, ", ", *size);
strcat(*buf, s); BUF_strlcat(*buf, s, *size);
return 1; return 1;
} }
@@ -342,7 +345,7 @@ int MAIN(int argc, char **argv)
{ {
int ret=1,i; int ret=1,i;
char **pp; char **pp;
int verbose=0, list_cap=0, test_avail=0; int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0;
ENGINE *e; ENGINE *e;
STACK *engines = sk_new_null(); STACK *engines = sk_new_null();
STACK *pre_cmds = sk_new_null(); STACK *pre_cmds = sk_new_null();
@@ -380,8 +383,14 @@ int MAIN(int argc, char **argv)
} }
else if (strcmp(*argv,"-c") == 0) else if (strcmp(*argv,"-c") == 0)
list_cap=1; list_cap=1;
else if (strcmp(*argv,"-t") == 0) else if (strncmp(*argv,"-t",2) == 0)
{
test_avail=1; test_avail=1;
if(strspn(*argv + 1, "t") < strlen(*argv + 1))
goto skip_arg_loop;
if((test_avail_noise = strlen(*argv + 1) - 1) > 1)
goto skip_arg_loop;
}
else if (strcmp(*argv,"-pre") == 0) else if (strcmp(*argv,"-pre") == 0)
{ {
argc--; argv++; argc--; argv++;
@@ -496,7 +505,8 @@ skip_digests:
else else
{ {
BIO_printf(bio_out, "[ unavailable ]\n"); BIO_printf(bio_out, "[ unavailable ]\n");
ERR_print_errors_fp(stdout); if(test_avail_noise)
ERR_print_errors_fp(stdout);
ERR_clear_error(); ERR_clear_error();
} }
} }
@@ -510,11 +520,19 @@ skip_digests:
ret=0; ret=0;
end: end:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
sk_pop_free(engines, identity); sk_pop_free(engines, identity);
sk_pop_free(pre_cmds, identity); sk_pop_free(pre_cmds, identity);
sk_pop_free(post_cmds, identity); sk_pop_free(post_cmds, identity);
if (bio_out != NULL) BIO_free_all(bio_out); if (bio_out != NULL) BIO_free_all(bio_out);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
#else
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif

View File

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

View File

@@ -57,6 +57,12 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
* deprecated functions for openssl-internal code */
#ifdef OPENSSL_NO_DEPRECATED
#undef OPENSSL_NO_DEPRECATED
#endif
#ifndef OPENSSL_NO_DH #ifndef OPENSSL_NO_DH
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -75,23 +81,29 @@
#undef PROG #undef PROG
#define PROG gendh_main #define PROG gendh_main
static void MS_CALLBACK dh_cb(int p, int n, void *arg); static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **); int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
BN_GENCB cb;
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
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;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
BIO *out=NULL; BIO *out=NULL;
apps_startup(); apps_startup();
BN_GENCB_set(&cb, dh_cb, bio_err);
if (bio_err == NULL) if (bio_err == NULL)
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);
@@ -115,11 +127,13 @@ 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;
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -138,14 +152,18 @@ bad:
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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
#endif
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;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());
if (out == NULL) if (out == NULL)
@@ -183,10 +201,10 @@ bad:
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
BIO_printf(bio_err,"This is going to take a long time\n"); BIO_printf(bio_err,"This is going to take a long time\n");
dh=DH_generate_parameters(num,g,dh_cb,bio_err);
if (dh == NULL) goto end;
if(((dh = DH_new()) == NULL) || !DH_generate_parameters_ex(dh, num, g, &cb))
goto end;
app_RAND_write_file(NULL, bio_err); app_RAND_write_file(NULL, bio_err);
if (!PEM_write_bio_DHparams(out,dh)) if (!PEM_write_bio_DHparams(out,dh))
@@ -198,10 +216,10 @@ end:
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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static void MS_CALLBACK dh_cb(int p, int n, void *arg) static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
{ {
char c='*'; char c='*';
@@ -209,10 +227,11 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg)
if (p == 1) c='+'; if (p == 1) c='+';
if (p == 2) c='*'; if (p == 2) c='*';
if (p == 3) c='\n'; if (p == 3) c='\n';
BIO_write((BIO *)arg,&c,1); BIO_write(cb->arg,&c,1);
(void)BIO_flush((BIO *)arg); (void)BIO_flush(cb->arg);
#ifdef LINT #ifdef LINT
p=n; p=n;
#endif #endif
return 1;
} }
#endif #endif

View File

@@ -77,7 +77,9 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
DSA *dsa=NULL; DSA *dsa=NULL;
int ret=1; int ret=1;
char *outfile=NULL; char *outfile=NULL;
@@ -85,7 +87,9 @@ 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;
const EVP_CIPHER *enc=NULL; const EVP_CIPHER *enc=NULL;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
apps_startup(); apps_startup();
@@ -111,11 +115,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passargout= *(++argv); passargout= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -167,7 +173,9 @@ bad:
BIO_printf(bio_err," -aes128, -aes192, -aes256\n"); BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
BIO_printf(bio_err," encrypt PEM output with cbc aes\n"); BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
#endif #endif
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
#endif
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,7 +184,9 @@ bad:
goto end; goto end;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
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");
@@ -246,6 +256,6 @@ end:
if (dsa != NULL) DSA_free(dsa); if (dsa != NULL) DSA_free(dsa);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
#endif #endif

View File

@@ -56,6 +56,12 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
* deprecated functions for openssl-internal code */
#ifdef OPENSSL_NO_DEPRECATED
#undef OPENSSL_NO_DEPRECATED
#endif
#ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_RSA
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -75,13 +81,16 @@
#undef PROG #undef PROG
#define PROG genrsa_main #define PROG genrsa_main
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg); static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **); int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
BN_GENCB cb;
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
int ret=1; int ret=1;
RSA *rsa=NULL; RSA *rsa=NULL;
int i,num=DEFBITS; int i,num=DEFBITS;
@@ -90,11 +99,14 @@ 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;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
char *inrand=NULL; char *inrand=NULL;
BIO *out=NULL; BIO *out=NULL;
apps_startup(); apps_startup();
BN_GENCB_set(&cb, genrsa_cb, bio_err);
if (bio_err == NULL) if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL)
@@ -122,11 +134,13 @@ 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;
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -177,7 +191,9 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
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");
@@ -191,7 +207,9 @@ bad:
goto err; goto err;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if (outfile == NULL) if (outfile == NULL)
{ {
@@ -223,7 +241,9 @@ bad:
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
num); num);
rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err);
if(((rsa = RSA_new()) == NULL) || !RSA_generate_key_ex(rsa, num, f4, &cb))
goto err;
app_RAND_write_file(NULL, bio_err); app_RAND_write_file(NULL, bio_err);
@@ -258,10 +278,10 @@ err:
if (ret != 0) if (ret != 0)
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg) static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb)
{ {
char c='*'; char c='*';
@@ -269,11 +289,12 @@ static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
if (p == 1) c='+'; if (p == 1) c='+';
if (p == 2) c='*'; if (p == 2) c='*';
if (p == 3) c='\n'; if (p == 3) c='\n';
BIO_write((BIO *)arg,&c,1); BIO_write(cb->arg,&c,1);
(void)BIO_flush((BIO *)arg); (void)BIO_flush(cb->arg);
#ifdef LINT #ifdef LINT
p=n; p=n;
#endif #endif
return 1;
} }
#else /* !OPENSSL_NO_RSA */ #else /* !OPENSSL_NO_RSA */

View File

@@ -15,22 +15,10 @@ $!
$! It was written so it would try to determine what "C" compiler to $! It was written so it would try to determine what "C" compiler to
$! use or you can specify which "C" compiler to use. $! use or you can specify which "C" compiler to use.
$! $!
$! Specify RSAREF as P1 to compile with the RSAREF library instead of $! Specify DEBUG or NODEBUG as P1 to compile with or without debugger
$! the regular one. If you specify NORSAREF it will compile with the
$! regular RSAREF routines. (Note: If you are in the United States
$! you MUST compile with RSAREF unless you have a license from RSA).
$!
$! Note: The RSAREF libraries are NOT INCLUDED and you have to
$! download it from "ftp://ftp.rsa.com/rsaref". You have to
$! get the ".tar-Z" file as the ".zip" file dosen't have the
$! directory structure stored. You have to extract the file
$! into the [.RSAREF] directory under the root directory as that
$! is where the scripts will look for the files.
$!
$! Specify DEBUG or NODEBUG as P2 to compile with or without debugger
$! information. $! information.
$! $!
$! Specify which compiler at P3 to try to compile under. $! Specify which compiler at P2 to try to compile under.
$! $!
$! VAXC For VAX C. $! VAXC For VAX C.
$! DECC For DEC C. $! DECC For DEC C.
@@ -39,16 +27,16 @@ $!
$! If you don't speficy a compiler, it will try to determine which $! If you don't speficy a compiler, it will try to determine which
$! "C" compiler to use. $! "C" compiler to use.
$! $!
$! P4, if defined, sets a TCP/IP library to use, through one of the following $! P3, if defined, sets a TCP/IP library to use, through one of the following
$! keywords: $! keywords:
$! $!
$! UCX for UCX $! UCX for UCX
$! SOCKETSHR for SOCKETSHR+NETLIB $! SOCKETSHR for SOCKETSHR+NETLIB
$! TCPIP for TCPIP (post UCX) $! TCPIP for TCPIP (post UCX)
$! $!
$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
$! $!
$! P6, if defined, sets a choice of programs to compile. $! P5, if defined, sets a choice of programs to compile.
$! $!
$! $!
$! Define A TCP/IP Library That We Will Need To Link To. $! Define A TCP/IP Library That We Will Need To Link To.
@@ -101,10 +89,6 @@ $! Define The CRYPTO Library.
$! $!
$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB $ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB
$! $!
$! Define The RSAREF Library.
$!
$ RSAREF_LIB := SYS$DISK:[-.'ARCH'.EXE.RSAREF]LIBRSAGLUE.OLB
$!
$! Define The SSL Library. $! Define The SSL Library.
$! $!
$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB $ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB
@@ -155,13 +139,13 @@ $! Define The Application Files.
$! $!
$ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;DHPARAM;ENC;PASSWD;GENDH;ERRSTR;"+- $ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;DHPARAM;ENC;PASSWD;GENDH;ERRSTR;"+-
"CA;PKCS7;CRL2P7;CRL;"+- "CA;PKCS7;CRL2P7;CRL;"+-
"RSA;RSAUTL;DSA;DSAPARAM;"+- "RSA;RSAUTL;DSA;DSAPARAM;EC;ECPARAM;"+-
"X509;GENRSA;GENDSA;S_SERVER;S_CLIENT;SPEED;"+- "X509;GENRSA;GENDSA;S_SERVER;S_CLIENT;SPEED;"+-
"S_TIME;APPS;S_CB;S_SOCKET;APP_RAND;VERSION;SESS_ID;"+- "S_TIME;APPS;S_CB;S_SOCKET;APP_RAND;VERSION;SESS_ID;"+-
"CIPHERS;NSEQ;PKCS12;PKCS8;SPKAC;SMIME;RAND;ENGINE;OCSP" "CIPHERS;NSEQ;PKCS12;PKCS8;SPKAC;SMIME;RAND;ENGINE;OCSP"
$ APP_FILES := OPENSSL,'OBJ_DIR'VERIFY.OBJ,ASN1PARS.OBJ,REQ.OBJ,DGST.OBJ,DH.OBJ,DHPARAM.OBJ,ENC.OBJ,PASSWD.OBJ,GENDH.OBJ,ERRSTR.OBJ,- $ APP_FILES := OPENSSL,'OBJ_DIR'VERIFY.OBJ,ASN1PARS.OBJ,REQ.OBJ,DGST.OBJ,DH.OBJ,DHPARAM.OBJ,ENC.OBJ,PASSWD.OBJ,GENDH.OBJ,ERRSTR.OBJ,-
CA.OBJ,PKCS7.OBJ,CRL2P7.OBJ,CRL.OBJ,- CA.OBJ,PKCS7.OBJ,CRL2P7.OBJ,CRL.OBJ,-
RSA.OBJ,RSAUTL.OBJ,DSA.OBJ,DSAPARAM.OBJ,- RSA.OBJ,RSAUTL.OBJ,DSA.OBJ,DSAPARAM.OBJ,EC.OBJ,ECPARAM.OBJ,-
X509.OBJ,GENRSA.OBJ,GENDSA.OBJ,S_SERVER.OBJ,S_CLIENT.OBJ,SPEED.OBJ,- X509.OBJ,GENRSA.OBJ,GENDSA.OBJ,S_SERVER.OBJ,S_CLIENT.OBJ,SPEED.OBJ,-
S_TIME.OBJ,APPS.OBJ,S_CB.OBJ,S_SOCKET.OBJ,APP_RAND.OBJ,VERSION.OBJ,SESS_ID.OBJ,- S_TIME.OBJ,APPS.OBJ,S_CB.OBJ,S_SOCKET.OBJ,APP_RAND.OBJ,VERSION.OBJ,SESS_ID.OBJ,-
CIPHERS.OBJ,NSEQ.OBJ,PKCS12.OBJ,PKCS8.OBJ,SPKAC.OBJ,SMIME.OBJ,RAND.OBJ,ENGINE.OBJ,OCSP.OBJ CIPHERS.OBJ,NSEQ.OBJ,PKCS12.OBJ,PKCS8.OBJ,SPKAC.OBJ,SMIME.OBJ,RAND.OBJ,ENGINE.OBJ,OCSP.OBJ
@@ -182,7 +166,7 @@ $! TCPIP_PROGRAMS = ",S_SERVER,S_CLIENT,SESS_ID,CIPHERS,S_TIME,"
$! $!
$! Setup exceptional compilations $! Setup exceptional compilations
$! $!
$ COMPILEWITH_CC2 = ",S_SOCKET,S_SERVER,S_CLIENT," $ COMPILEWITH_CC2 = ",S_SERVER,S_CLIENT,"
$! $!
$ PHASE := LIB $ PHASE := LIB
$! $!
@@ -293,73 +277,31 @@ $ WRITE SYS$OUTPUT FILE_NAME," needs a TCP/IP library. Can't link. Skipping.
$ GOTO NEXT_FILE $ GOTO NEXT_FILE
$ ENDIF $ ENDIF
$! $!
$! Link The Program, Check To See If We Need To Link With RSAREF Or Not. $! Link The Program.
$! Check To See If We Are To Link With A Specific TCP/IP Library.
$! $!
$ IF (RSAREF.EQS."TRUE") $ IF (TCPIP_LIB.NES."")
$ THEN $ THEN
$! $!
$! Check To See If We Are To Link With A Specific TCP/IP Library. $! Don't Link With The RSAREF Routines And TCP/IP Library.
$! $!
$ IF (TCPIP_LIB.NES."") $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
$ THEN 'OBJECT_FILE''EXTRA_OBJ', -
$! 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
$! Link With The RSAREF Library And A Specific TCP/IP Library. 'TCPIP_LIB','OPT_FILE'/OPTION
$!
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
'OBJECT_FILE''EXTRA_OBJ', -
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, -
'TCPIP_LIB','OPT_FILE'/OPTION
$!
$! Else...
$!
$ ELSE
$!
$! Link With The RSAREF Library And NO TCP/IP Library.
$!
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
'OBJECT_FILE''EXTRA_OBJ', -
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, -
'OPT_FILE'/OPTION
$!
$! End The TCP/IP Library Check.
$!
$ ENDIF
$! $!
$! Else... $! Else...
$! $!
$ ELSE $ ELSE
$! $!
$! Don't Link With The RSAREF Routines. $! Don't Link With The RSAREF Routines And Link With A TCP/IP Library.
$! $!
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
'OBJECT_FILE''EXTRA_OBJ', -
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
'OPT_FILE'/OPTION
$! $!
$! Check To See If We Are To Link With A Specific TCP/IP Library. $! End The TCP/IP Library Check.
$!
$ IF (TCPIP_LIB.NES."")
$ THEN
$!
$! Don't Link With The RSAREF Routines And TCP/IP Library.
$!
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
'OBJECT_FILE''EXTRA_OBJ', -
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
'TCPIP_LIB','OPT_FILE'/OPTION
$!
$! Else...
$!
$ ELSE
$!
$! Don't Link With The RSAREF Routines And Link With A TCP/IP Library.
$!
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
'OBJECT_FILE''EXTRA_OBJ', -
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
'OPT_FILE'/OPTION
$!
$! End The TCP/IP Library Check.
$!
$ ENDIF
$!
$! End The RSAREF Link Check.
$! $!
$ ENDIF $ ENDIF
$! $!
@@ -526,32 +468,6 @@ $! End The Crypto Library Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! See If We Need The RSAREF Library.
$!
$ IF (RSAREF.EQS."TRUE")
$ THEN
$!
$! Look For The Library LIBRSAGLUE.OLB.
$!
$ IF (F$SEARCH(RSAREF_LIB).EQS."")
$ THEN
$!
$! Tell The User We Can't Find The LIBRSAGLUE.OLB Library.
$!
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "Can't Find The Library ",RSAREF_LIB,"."
$ WRITE SYS$OUTPUT "We Can't Link Without It."
$ WRITE SYS$OUTPUT ""
$!
$! Since We Can't Link Without It, Exit.
$!
$ EXIT
$ ENDIF
$!
$! End The RSAREF Library Check.
$!
$ ENDIF
$!
$! Look For The Library LIBSSL.OLB. $! Look For The Library LIBSSL.OLB.
$! $!
$ IF (F$SEARCH(SSL_LIB).EQS."") $ IF (F$SEARCH(SSL_LIB).EQS."")
@@ -582,87 +498,10 @@ $ CHECK_OPTIONS:
$! $!
$! Check To See If P1 Is Blank. $! Check To See If P1 Is Blank.
$! $!
$ P1 = "NORSAREF" $ IF (P1.EQS."NODEBUG")
$ IF (P1.EQS."NORSAREF")
$ THEN $ THEN
$! $!
$! P1 Is NORSAREF, So Compile With The Regular RSA Libraries. $! P1 Is NODEBUG, So Compile Without Debugger Information.
$!
$ RSAREF = "FALSE"
$!
$! Else...
$!
$ ELSE
$!
$! Check To See If We Are To Use The RSAREF Library.
$!
$ IF (P1.EQS."RSAREF")
$ THEN
$!
$! Check To Make Sure We Have The RSAREF Source Code Directory.
$!
$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]SOURCE.DIR").EQS."")
$ THEN
$!
$! We Don't Have The RSAREF Souce Code Directory, So Tell The
$! User This.
$!
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code."
$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to"
$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the"
$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file"
$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory"
$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files."
$ WRITE SYS$OUTPUT ""
$!
$! Time To Exit.
$!
$ EXIT
$!
$! Else...
$!
$ ELSE
$!
$! Compile Using The RSAREF Library.
$!
$ RSAREF = "TRUE"
$!
$! End The RSAREF Soure Directory Check.
$!
$ ENDIF
$!
$! Else...
$!
$ ELSE
$!
$! They Entered An Invalid Option..
$!
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT " RSAREF : Compile With The RSAREF Library."
$ WRITE SYS$OUTPUT " NORSAREF : Compile With The Regular RSA Library."
$ WRITE SYS$OUTPUT ""
$!
$! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$!
$ ENDIF
$!
$! End P1 Check.
$!
$ ENDIF
$!
$! Check To See If P2 Is Blank.
$!
$ IF (P2.EQS."NODEBUG")
$ THEN
$!
$! P2 Is NODEBUG, So Compile Without Debugger Information.
$! $!
$ DEBUGGER = "NODEBUG" $ DEBUGGER = "NODEBUG"
$ TRACEBACK = "NOTRACEBACK" $ TRACEBACK = "NOTRACEBACK"
@@ -677,7 +516,7 @@ $ ELSE
$! $!
$! Check To See If We Are To Compile With Debugger Information. $! Check To See If We Are To Compile With Debugger Information.
$! $!
$ IF (P2.EQS."DEBUG") $ IF (P1.EQS."DEBUG")
$ THEN $ THEN
$! $!
$! Compile With Debugger Information. $! Compile With Debugger Information.
@@ -693,7 +532,7 @@ $!
$! Tell The User Entered An Invalid Option.. $! Tell The User Entered An Invalid Option..
$! $!
$ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
$ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
@@ -707,13 +546,13 @@ $! End The Valid Arguement Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! End The P2 Check. $! End The P1 Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! Check To See If P3 Is Blank. $! Check To See If P2 Is Blank.
$! $!
$ IF (P3.EQS."") $ IF (P2.EQS."")
$ THEN $ THEN
$! $!
$! O.K., The User Didn't Specify A Compiler, Let's Try To $! O.K., The User Didn't Specify A Compiler, Let's Try To
@@ -726,7 +565,7 @@ $ THEN
$! $!
$! Looks Like GNUC, Set To Use GNUC. $! Looks Like GNUC, Set To Use GNUC.
$! $!
$ P3 = "GNUC" $ P2 = "GNUC"
$! $!
$! Else... $! Else...
$! $!
@@ -739,7 +578,7 @@ $ THEN
$! $!
$! Looks Like DECC, Set To Use DECC. $! Looks Like DECC, Set To Use DECC.
$! $!
$ P3 = "DECC" $ P2 = "DECC"
$! $!
$! Else... $! Else...
$! $!
@@ -747,7 +586,7 @@ $ ELSE
$! $!
$! Looks Like VAXC, Set To Use VAXC. $! Looks Like VAXC, Set To Use VAXC.
$! $!
$ P3 = "VAXC" $ P2 = "VAXC"
$! $!
$! End The VAXC Compiler Check. $! End The VAXC Compiler Check.
$! $!
@@ -761,9 +600,9 @@ $! End The Compiler Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! Check To See If We Have A Option For P4. $! Check To See If We Have A Option For P3.
$! $!
$ IF (P4.EQS."") $ IF (P3.EQS."")
$ THEN $ THEN
$! $!
$! Find out what socket library we have available $! Find out what socket library we have available
@@ -773,7 +612,7 @@ $ THEN
$! $!
$! We have SOCKETSHR, and it is my opinion that it's the best to use. $! We have SOCKETSHR, and it is my opinion that it's the best to use.
$! $!
$ P4 = "SOCKETSHR" $ P3 = "SOCKETSHR"
$! $!
$! Tell the user $! Tell the user
$! $!
@@ -793,7 +632,7 @@ $ THEN
$! $!
$! Last resort: a UCX or UCX-compatible library $! Last resort: a UCX or UCX-compatible library
$! $!
$ P4 = "UCX" $ P3 = "UCX"
$! $!
$! Tell the user $! Tell the user
$! $!
@@ -817,12 +656,12 @@ $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
$! $!
$! Check To See If The User Entered A Valid Paramter. $! Check To See If The User Entered A Valid Paramter.
$! $!
$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC")
$ THEN $ THEN
$! $!
$! Check To See If The User Wanted DECC. $! Check To See If The User Wanted DECC.
$! $!
$ IF (P3.EQS."DECC") $ IF (P2.EQS."DECC")
$ THEN $ THEN
$! $!
$! Looks Like DECC, Set To Use DECC. $! Looks Like DECC, Set To Use DECC.
@@ -852,7 +691,7 @@ $ ENDIF
$! $!
$! Check To See If We Are To Use VAXC. $! Check To See If We Are To Use VAXC.
$! $!
$ IF (P3.EQS."VAXC") $ IF (P2.EQS."VAXC")
$ THEN $ THEN
$! $!
$! Looks Like VAXC, Set To Use VAXC. $! Looks Like VAXC, Set To Use VAXC.
@@ -889,7 +728,7 @@ $ ENDIF
$! $!
$! Check To See If We Are To Use GNU C. $! Check To See If We Are To Use GNU C.
$! $!
$ IF (P3.EQS."GNUC") $ IF (P2.EQS."GNUC")
$ THEN $ THEN
$! $!
$! Looks Like GNUC, Set To Use GNUC. $! Looks Like GNUC, Set To Use GNUC.
@@ -918,31 +757,6 @@ $! Set up default defines
$! $!
$ CCDEFS = """FLAT_INC=1""," + CCDEFS $ CCDEFS = """FLAT_INC=1""," + CCDEFS
$! $!
$! Check To See If We Are To Compile With RSAREF Routines.
$!
$ IF (RSAREF.EQS."TRUE")
$ THEN
$!
$! Compile With RSAREF.
$!
$ CCDEFS = CCDEFS + ",""RSAref=1"""
$!
$! Tell The User This.
$!
$ WRITE SYS$OUTPUT "Compiling With RSAREF Routines."
$!
$! Else, We Don't Care. Compile Without The RSAREF Library.
$!
$ ELSE
$!
$! Tell The User We Are Compile Without The RSAREF Routines.
$!
$ WRITE SYS$OUTPUT "Compiling Without The RSAREF Routines.
$!
$! End The RSAREF Check.
$!
$ ENDIF
$!
$! Else The User Entered An Invalid Arguement. $! Else The User Entered An Invalid Arguement.
$! $!
$ ELSE $ ELSE
@@ -950,7 +764,7 @@ $!
$! Tell The User We Don't Know What They Want. $! Tell The User We Don't Know What They Want.
$! $!
$ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
$ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
@@ -964,13 +778,13 @@ $ ENDIF
$! $!
$! Time to check the contents, and to make sure we get the correct library. $! Time to check the contents, and to make sure we get the correct library.
$! $!
$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" - $ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" -
.OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE" .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE"
$ THEN $ THEN
$! $!
$! Check to see if SOCKETSHR was chosen $! Check to see if SOCKETSHR was chosen
$! $!
$ IF P4.EQS."SOCKETSHR" $ IF P3.EQS."SOCKETSHR"
$ THEN $ THEN
$! $!
$! Set the library to use SOCKETSHR $! Set the library to use SOCKETSHR
@@ -983,12 +797,12 @@ $ ENDIF
$! $!
$! Check to see if MULTINET was chosen $! Check to see if MULTINET was chosen
$! $!
$ IF P4.EQS."MULTINET" $ IF P3.EQS."MULTINET"
$ THEN $ THEN
$! $!
$! Set the library to use UCX emulation. $! Set the library to use UCX emulation.
$! $!
$ P4 = "UCX" $ P3 = "UCX"
$! $!
$! Done with MULTINET $! Done with MULTINET
$! $!
@@ -996,7 +810,7 @@ $ ENDIF
$! $!
$! Check to see if UCX was chosen $! Check to see if UCX was chosen
$! $!
$ IF P4.EQS."UCX" $ IF P3.EQS."UCX"
$ THEN $ THEN
$! $!
$! Set the library to use UCX. $! Set the library to use UCX.
@@ -1016,7 +830,7 @@ $ ENDIF
$! $!
$! Check to see if TCPIP (post UCX) was chosen $! Check to see if TCPIP (post UCX) was chosen
$! $!
$ IF P4.EQS."TCPIP" $ IF P3.EQS."TCPIP"
$ THEN $ THEN
$! $!
$! Set the library to use TCPIP. $! Set the library to use TCPIP.
@@ -1029,7 +843,7 @@ $ ENDIF
$! $!
$! Check to see if NONE was chosen $! Check to see if NONE was chosen
$! $!
$ IF P4.EQS."NONE" $ IF P3.EQS."NONE"
$ THEN $ THEN
$! $!
$! Do not use TCPIP. $! Do not use TCPIP.
@@ -1042,7 +856,7 @@ $ ENDIF
$! $!
$! Add TCP/IP type to CC definitions. $! Add TCP/IP type to CC definitions.
$! $!
$ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P4'" $ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P3'"
$! $!
$! Print info $! Print info
$! $!
@@ -1055,7 +869,7 @@ $!
$! Tell The User We Don't Know What They Want. $! Tell The User We Don't Know What They Want.
$! $!
$ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
$ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
@@ -1086,7 +900,7 @@ $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
$! $!
$! Show user the result $! Show user the result
$! $!
$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC $ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC
$! $!
$! Special Threads For OpenVMS v7.1 Or Later $! Special Threads For OpenVMS v7.1 Or Later
$! $!
@@ -1094,9 +908,9 @@ $! Written By: Richard Levitte
$! richard@levitte.org $! richard@levitte.org
$! $!
$! $!
$! Check To See If We Have A Option For P5. $! Check To See If We Have A Option For P4.
$! $!
$ IF (P5.EQS."") $ IF (P4.EQS."")
$ THEN $ THEN
$! $!
$! Get The Version Of VMS We Are Using. $! Get The Version Of VMS We Are Using.
@@ -1118,15 +932,15 @@ $! End The VMS Version Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! End The P5 Check. $! End The P4 Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! Check if the user wanted to compile just a subset of all the programs. $! Check if the user wanted to compile just a subset of all the programs.
$! $!
$ IF P6 .NES. "" $ IF P5 .NES. ""
$ THEN $ THEN
$ PROGRAMS = P6 $ PROGRAMS = P5
$ ENDIF $ ENDIF
$! $!
$! Time To RETURN... $! Time To RETURN...

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");
EXIT(1); OPENSSL_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);
EXIT(ret); OPENSSL_EXIT(ret);
} }

View File

@@ -55,6 +55,7 @@
* Hudson (tjh@cryptsoft.com). * Hudson (tjh@cryptsoft.com).
* *
*/ */
#ifndef OPENSSL_NO_OCSP
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -67,19 +68,6 @@
/* Maximum leeway in validity period: default 5 minutes */ /* Maximum leeway in validity period: default 5 minutes */
#define MAX_VALIDITY_PERIOD (5 * 60) #define MAX_VALIDITY_PERIOD (5 * 60)
/* CA index.txt definitions */
#define DB_type 0
#define DB_exp_date 1
#define DB_rev_date 2
#define DB_serial 3 /* index - unique */
#define DB_file 4
#define DB_name 5 /* index - unique for active */
#define DB_NUMBER 6
#define DB_TYPE_REV 'R'
#define DB_TYPE_EXP 'E'
#define DB_TYPE_VAL 'V'
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer, static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
STACK_OF(OCSP_CERTID) *ids); STACK_OF(OCSP_CERTID) *ids);
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer, static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer,
@@ -88,12 +76,12 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
STACK *names, STACK_OF(OCSP_CERTID) *ids, STACK *names, STACK_OF(OCSP_CERTID) *ids,
long nsec, long maxage); long nsec, long maxage);
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db, static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
X509 *ca, X509 *rcert, EVP_PKEY *rkey, X509 *ca, X509 *rcert, EVP_PKEY *rkey,
STACK_OF(X509) *rother, unsigned long flags, STACK_OF(X509) *rother, unsigned long flags,
int nmin, int ndays); int nmin, int ndays);
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser); static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser);
static BIO *init_responder(char *port); static BIO *init_responder(char *port);
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port); static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port);
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp); static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp);
@@ -135,13 +123,14 @@ int MAIN(int argc, char **argv)
int accept_count = -1; int accept_count = -1;
int badarg = 0; int badarg = 0;
int i; int i;
int ignore_err = 0;
STACK *reqnames = NULL; STACK *reqnames = NULL;
STACK_OF(OCSP_CERTID) *ids = NULL; STACK_OF(OCSP_CERTID) *ids = NULL;
X509 *rca_cert = NULL; X509 *rca_cert = NULL;
char *ridx_filename = NULL; char *ridx_filename = NULL;
char *rca_filename = NULL; char *rca_filename = NULL;
TXT_DB *rdb = NULL; CA_DB *rdb = NULL;
int nmin = 0, ndays = -1; int nmin = 0, ndays = -1;
if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
@@ -194,6 +183,8 @@ int MAIN(int argc, char **argv)
} }
else badarg = 1; else badarg = 1;
} }
else if (!strcmp(*args, "-ignore_err"))
ignore_err = 1;
else if (!strcmp(*args, "-noverify")) else if (!strcmp(*args, "-noverify"))
noverify = 1; noverify = 1;
else if (!strcmp(*args, "-nonce")) else if (!strcmp(*args, "-nonce"))
@@ -523,7 +514,7 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-serial n serial number to check\n"); BIO_printf (bio_err, "-serial n serial number to check\n");
BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n"); BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n");
BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n"); BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n");
BIO_printf (bio_err, "-sign_certs file additional certificates to include in signed request\n"); BIO_printf (bio_err, "-sign_other file additional certificates to include in signed request\n");
BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n"); BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n");
BIO_printf (bio_err, "-req_text print text form of request\n"); BIO_printf (bio_err, "-req_text print text form of request\n");
BIO_printf (bio_err, "-resp_text print text form of response\n"); BIO_printf (bio_err, "-resp_text print text form of response\n");
@@ -543,10 +534,10 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n"); BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n");
BIO_printf (bio_err, "-status_age n maximum status age in seconds\n"); BIO_printf (bio_err, "-status_age n maximum status age in seconds\n");
BIO_printf (bio_err, "-noverify don't verify response at all\n"); BIO_printf (bio_err, "-noverify don't verify response at all\n");
BIO_printf (bio_err, "-verify_certs file additional certificates to search for signer\n"); BIO_printf (bio_err, "-verify_other file additional certificates to search for signer\n");
BIO_printf (bio_err, "-trust_other don't verify additional certificates\n"); BIO_printf (bio_err, "-trust_other don't verify additional certificates\n");
BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n"); BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n");
BIO_printf (bio_err, "-no_sig_verify don't check signature on response\n"); BIO_printf (bio_err, "-no_signature_verify don't check signature on response\n");
BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n"); BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n");
BIO_printf (bio_err, "-no_chain don't chain verify response\n"); BIO_printf (bio_err, "-no_chain don't chain verify response\n");
BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n"); BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n");
@@ -613,11 +604,11 @@ int MAIN(int argc, char **argv)
NULL, e, "CA certificate"); NULL, e, "CA certificate");
if (rcertfile) if (rcertfile)
{ {
rother = load_certs(bio_err, sign_certfile, FORMAT_PEM, rother = load_certs(bio_err, rcertfile, FORMAT_PEM,
NULL, e, "responder other certificates"); NULL, e, "responder other certificates");
if (!sign_other) goto end; if (!rother) goto end;
} }
rkey = load_key(bio_err, rkeyfile, FORMAT_PEM, NULL, NULL, rkey = load_key(bio_err, rkeyfile, FORMAT_PEM, 0, NULL, NULL,
"responder private key"); "responder private key");
if (!rkey) if (!rkey)
goto end; goto end;
@@ -663,7 +654,7 @@ int MAIN(int argc, char **argv)
NULL, e, "signer certificates"); NULL, e, "signer certificates");
if (!sign_other) goto end; if (!sign_other) goto end;
} }
key = load_key(bio_err, keyfile, FORMAT_PEM, NULL, NULL, key = load_key(bio_err, keyfile, FORMAT_PEM, 0, NULL, NULL,
"signer private key"); "signer private key");
if (!key) if (!key)
goto end; goto end;
@@ -696,22 +687,9 @@ int MAIN(int argc, char **argv)
if (ridx_filename && !rdb) if (ridx_filename && !rdb)
{ {
BIO *db_bio = NULL; rdb = load_index(ridx_filename, NULL);
db_bio = BIO_new_file(ridx_filename, "r"); if (!rdb) goto end;
if (!db_bio) if (!index_index(rdb)) goto end;
{
BIO_printf(bio_err, "Error opening index file %s\n", ridx_filename);
goto end;
}
rdb = TXT_DB_read(db_bio, DB_NUMBER);
BIO_free(db_bio);
if (!rdb)
{
BIO_printf(bio_err, "Error reading index file %s\n", ridx_filename);
goto end;
}
if (!make_serial_index(rdb))
goto end;
} }
if (rdb) if (rdb)
@@ -722,7 +700,12 @@ int MAIN(int argc, char **argv)
} }
else if (host) else if (host)
{ {
#ifndef OPENSSL_NO_SOCK
cbio = BIO_new_connect(host); cbio = BIO_new_connect(host);
#else
BIO_printf(bio_err, "Error creating connect BIO - sockets not supported.\n");
goto end;
#endif
if (!cbio) if (!cbio)
{ {
BIO_printf(bio_err, "Error creating connect BIO\n"); BIO_printf(bio_err, "Error creating connect BIO\n");
@@ -732,7 +715,16 @@ int MAIN(int argc, char **argv)
if (use_ssl == 1) if (use_ssl == 1)
{ {
BIO *sbio; BIO *sbio;
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
ctx = SSL_CTX_new(SSLv23_client_method()); ctx = SSL_CTX_new(SSLv23_client_method());
#elif !defined(OPENSSL_NO_SSL3)
ctx = SSL_CTX_new(SSLv3_client_method());
#elif !defined(OPENSSL_NO_SSL2)
ctx = SSL_CTX_new(SSLv2_client_method());
#else
BIO_printf(bio_err, "SSL is disabled\n");
goto end;
#endif
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY); SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
sbio = BIO_new_ssl(ctx, 1); sbio = BIO_new_ssl(ctx, 1);
cbio = BIO_push(sbio, cbio); cbio = BIO_push(sbio, cbio);
@@ -792,8 +784,10 @@ int MAIN(int argc, char **argv)
if (i != OCSP_RESPONSE_STATUS_SUCCESSFUL) if (i != OCSP_RESPONSE_STATUS_SUCCESSFUL)
{ {
BIO_printf(out, "Responder Error: %s (%ld)\n", BIO_printf(out, "Responder Error: %s (%d)\n",
OCSP_response_status_str(i), i); OCSP_response_status_str(i), i);
if (ignore_err)
goto redo_accept;
ret = 0; ret = 0;
goto end; goto end;
} }
@@ -856,7 +850,7 @@ int MAIN(int argc, char **argv)
if(i <= 0) if(i <= 0)
{ {
BIO_printf(bio_err, "Response Verify Failure\n", i); BIO_printf(bio_err, "Response Verify Failure\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
} }
else else
@@ -879,7 +873,7 @@ end:
X509_free(cert); X509_free(cert);
X509_free(rsigner); X509_free(rsigner);
X509_free(rca_cert); X509_free(rca_cert);
TXT_DB_free(rdb); free_index(rdb);
BIO_free_all(cbio); BIO_free_all(cbio);
BIO_free_all(acbio); BIO_free_all(acbio);
BIO_free(out); BIO_free(out);
@@ -899,7 +893,7 @@ end:
SSL_CTX_free(ctx); SSL_CTX_free(ctx);
} }
EXIT(ret); OPENSSL_EXIT(ret);
} }
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer, static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
@@ -1021,7 +1015,7 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
} }
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db, static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
X509 *ca, X509 *rcert, EVP_PKEY *rkey, X509 *ca, X509 *rcert, EVP_PKEY *rkey,
STACK_OF(X509) *rother, unsigned long flags, STACK_OF(X509) *rother, unsigned long flags,
int nmin, int ndays) int nmin, int ndays)
@@ -1113,17 +1107,20 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *d
} }
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser) static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser)
{ {
int i; int i;
BIGNUM *bn = NULL; BIGNUM *bn = NULL;
char *itmp, *row[DB_NUMBER],**rrow; char *itmp, *row[DB_NUMBER],**rrow;
for (i = 0; i < DB_NUMBER; i++) row[i] = NULL; for (i = 0; i < DB_NUMBER; i++) row[i] = NULL;
bn = ASN1_INTEGER_to_BN(ser,NULL); bn = ASN1_INTEGER_to_BN(ser,NULL);
itmp = BN_bn2hex(bn); if (BN_is_zero(bn))
itmp = BUF_strdup("00");
else
itmp = BN_bn2hex(bn);
row[DB_serial] = itmp; row[DB_serial] = itmp;
BN_free(bn); BN_free(bn);
rrow=TXT_DB_get_by_index(db,DB_serial,row); rrow=TXT_DB_get_by_index(db->db,DB_serial,row);
OPENSSL_free(itmp); OPENSSL_free(itmp);
return rrow; return rrow;
} }
@@ -1136,7 +1133,11 @@ static BIO *init_responder(char *port)
bufbio = BIO_new(BIO_f_buffer()); bufbio = BIO_new(BIO_f_buffer());
if (!bufbio) if (!bufbio)
goto err; goto err;
#ifndef OPENSSL_NO_SOCK
acbio = BIO_new_accept(port); acbio = BIO_new_accept(port);
#else
BIO_printf(bio_err, "Error setting up accept BIO - sockets not supported.\n");
#endif
if (!acbio) if (!acbio)
goto err; goto err;
BIO_set_accept_bios(acbio, bufbio); BIO_set_accept_bios(acbio, bufbio);
@@ -1176,7 +1177,7 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port
for(;;) for(;;)
{ {
len = BIO_gets(cbio, inbuf, 1024); len = BIO_gets(cbio, inbuf, sizeof inbuf);
if (len <= 0) if (len <= 0)
return 1; return 1;
/* Look for "POST" signalling start of query */ /* Look for "POST" signalling start of query */
@@ -1223,3 +1224,4 @@ static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp)
return 1; return 1;
} }
#endif

View File

@@ -122,7 +122,9 @@
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h> #include <openssl/engine.h>
#endif
#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */ #define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
#include "progs.h" #include "progs.h"
#include "s_apps.h" #include "s_apps.h"
@@ -139,11 +141,11 @@ static unsigned long MS_CALLBACK hash(const void *a_void);
static int MS_CALLBACK cmp(const void *a_void,const void *b_void); static int MS_CALLBACK cmp(const void *a_void,const void *b_void);
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[]);
CONF *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
CONF *config=NULL;
BIO *bio_err=NULL; BIO *bio_err=NULL;
#endif #endif
@@ -161,7 +163,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line)
goto err; goto err;
} }
if (type < 0 || type > CRYPTO_NUM_LOCKS) if (type < 0 || type >= CRYPTO_NUM_LOCKS)
{ {
errstr = "type out of bounds"; errstr = "type out of bounds";
goto err; goto err;
@@ -218,7 +220,8 @@ int main(int Argc, char *Argv[])
#define PROG_NAME_SIZE 39 #define PROG_NAME_SIZE 39
char pname[PROG_NAME_SIZE+1]; char pname[PROG_NAME_SIZE+1];
FUNCTION f,*fp; FUNCTION f,*fp;
MS_STATIC char *prompt,buf[1024],config_name[256]; MS_STATIC char *prompt,buf[1024];
char *to_free=NULL;
int n,i,ret=0; int n,i,ret=0;
int argc; int argc;
char **argv,*p; char **argv,*p;
@@ -228,6 +231,10 @@ int main(int Argc, char *Argv[])
arg.data=NULL; arg.data=NULL;
arg.count=0; arg.count=0;
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) /* if not defined, use compiled-in library defaults */ if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) /* if not defined, use compiled-in library defaults */
{ {
if (!(0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off"))) if (!(0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))
@@ -252,23 +259,12 @@ int main(int Argc, char *Argv[])
apps_startup(); apps_startup();
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
/* Lets load up our environment a little */ /* Lets load up our environment a little */
p=getenv("OPENSSL_CONF"); p=getenv("OPENSSL_CONF");
if (p == NULL) if (p == NULL)
p=getenv("SSLEAY_CONF"); p=getenv("SSLEAY_CONF");
if (p == NULL) if (p == NULL)
{ p=to_free=make_config_name();
strcpy(config_name,X509_get_default_cert_area());
#ifndef OPENSSL_SYS_VMS
strcat(config_name,"/");
#endif
strcat(config_name,OPENSSL_CONF);
p=config_name;
}
default_config_file=p; default_config_file=p;
@@ -284,7 +280,7 @@ int main(int Argc, char *Argv[])
prog=prog_init(); prog=prog_init();
/* first check the program name */ /* first check the program name */
program_name(Argv[0],pname,PROG_NAME_SIZE); program_name(Argv[0],pname,sizeof pname);
f.name=pname; f.name=pname;
fp=(FUNCTION *)lh_retrieve(prog,&f); fp=(FUNCTION *)lh_retrieve(prog,&f);
@@ -312,7 +308,7 @@ int main(int Argc, char *Argv[])
{ {
ret=0; ret=0;
p=buf; p=buf;
n=1024; n=sizeof buf;
i=0; i=0;
for (;;) for (;;)
{ {
@@ -346,6 +342,8 @@ int main(int Argc, char *Argv[])
BIO_printf(bio_err,"bad exit\n"); BIO_printf(bio_err,"bad exit\n");
ret=1; ret=1;
end: end:
if (to_free)
OPENSSL_free(to_free);
if (config != NULL) if (config != NULL)
{ {
NCONF_free(config); NCONF_free(config);
@@ -362,7 +360,7 @@ end:
BIO_free(bio_err); BIO_free(bio_err);
bio_err=NULL; bio_err=NULL;
} }
EXIT(ret); OPENSSL_EXIT(ret);
} }
#define LIST_STANDARD_COMMANDS "list-standard-commands" #define LIST_STANDARD_COMMANDS "list-standard-commands"

View File

@@ -38,10 +38,14 @@ dir = ./demoCA # Where everything is kept
certs = $dir/certs # Where the issued certs are kept certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file. database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/newcerts # default place for new certs. new_certs_dir = $dir/newcerts # default place for new certs.
certificate = $dir/cacert.pem # The CA certificate certificate = $dir/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number
# must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL crl = $dir/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number file RANDFILE = $dir/private/.rand # private random number file
@@ -58,6 +62,7 @@ cert_opt = ca_default # Certificate field options
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs # Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
# so this is commented out by default to leave a V1 CRL. # so this is commented out by default to leave a V1 CRL.
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions = crl_ext # crl_extensions = crl_ext
default_days = 365 # how long to certify for default_days = 365 # how long to certify for

View File

@@ -19,7 +19,6 @@
# include <openssl/des.h> # include <openssl/des.h>
#endif #endif
#ifndef NO_MD5CRYPT_1 #ifndef NO_MD5CRYPT_1
# include <openssl/evp.h>
# include <openssl/md5.h> # include <openssl/md5.h>
#endif #endif
@@ -293,7 +292,7 @@ err:
if (out) if (out)
BIO_free_all(out); BIO_free_all(out);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
@@ -313,7 +312,8 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */ static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
unsigned char buf[MD5_DIGEST_LENGTH]; unsigned char buf[MD5_DIGEST_LENGTH];
char *salt_out; char *salt_out;
int n, i; int n;
unsigned int i;
EVP_MD_CTX md,md2; EVP_MD_CTX md,md2;
size_t passwd_len, salt_len; size_t passwd_len, salt_len;
@@ -506,6 +506,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)
EXIT(1); OPENSSL_EXIT(1);
} }
#endif #endif

View File

@@ -2,10 +2,10 @@
#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1) #if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 1999. * project.
*/ */
/* ==================================================================== /* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved. * Copyright (c) 1999-2002 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
@@ -120,7 +120,9 @@ 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;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
apps_startup(); apps_startup();
@@ -164,10 +166,14 @@ int MAIN(int argc, char **argv)
maciter = PKCS12_DEFAULT_ITER; maciter = PKCS12_DEFAULT_ITER;
else if (!strcmp (*args, "-nomaciter")) else if (!strcmp (*args, "-nomaciter"))
maciter = 1; maciter = 1;
else if (!strcmp (*args, "-nomac"))
maciter = -1;
else if (!strcmp (*args, "-nodes")) enc=NULL; else if (!strcmp (*args, "-nodes")) enc=NULL;
else if (!strcmp (*args, "-certpbe")) { else if (!strcmp (*args, "-certpbe")) {
if (args[1]) { if (args[1]) {
args++; args++;
if (!strcmp(*args, "NONE"))
cert_pbe = -1;
cert_pbe=OBJ_txt2nid(*args); cert_pbe=OBJ_txt2nid(*args);
if(cert_pbe == NID_undef) { if(cert_pbe == NID_undef) {
BIO_printf(bio_err, BIO_printf(bio_err,
@@ -178,7 +184,10 @@ int MAIN(int argc, char **argv)
} else if (!strcmp (*args, "-keypbe")) { } else if (!strcmp (*args, "-keypbe")) {
if (args[1]) { if (args[1]) {
args++; args++;
key_pbe=OBJ_txt2nid(*args); if (!strcmp(*args, "NONE"))
key_pbe = -1;
else
key_pbe=OBJ_txt2nid(*args);
if(key_pbe == NID_undef) { if(key_pbe == NID_undef) {
BIO_printf(bio_err, BIO_printf(bio_err,
"Unknown PBE algorithm %s\n", *args); "Unknown PBE algorithm %s\n", *args);
@@ -252,11 +261,13 @@ int MAIN(int argc, char **argv)
args++; args++;
CAfile = *args; CAfile = *args;
} else badarg = 1; } else badarg = 1;
#ifndef OPENSSL_NO_ENGINE
} else if (!strcmp(*args,"-engine")) { } else if (!strcmp(*args,"-engine")) {
if (args[1]) { if (args[1]) {
args++; args++;
engine = *args; engine = *args;
} else badarg = 1; } else badarg = 1;
#endif
} else badarg = 1; } else badarg = 1;
} else badarg = 1; } else badarg = 1;
@@ -304,14 +315,18 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n"); BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
#endif
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;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if(passarg) { if(passarg) {
if(export_cert) passargout = passarg; if(export_cert) passargout = passarg;
@@ -357,24 +372,6 @@ int MAIN(int argc, char **argv)
goto end; goto end;
} }
#if 0
if (certfile) {
if(!(certsin = BIO_new_file(certfile, "r"))) {
BIO_printf(bio_err, "Can't open certificate file %s\n", certfile);
perror (certfile);
goto end;
}
}
if (keyname) {
if(!(inkey = BIO_new_file(keyname, "r"))) {
BIO_printf(bio_err, "Can't key certificate file %s\n", keyname);
perror (keyname);
goto end;
}
}
#endif
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
CRYPTO_push_info("write files"); CRYPTO_push_info("write files");
@@ -399,7 +396,7 @@ int MAIN(int argc, char **argv)
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_push_info("read MAC password"); CRYPTO_push_info("read MAC password");
#endif #endif
if(EVP_read_pw_string (macpass, 50, "Enter MAC Password:", export_cert)) if(EVP_read_pw_string (macpass, sizeof macpass, "Enter MAC Password:", export_cert))
{ {
BIO_printf (bio_err, "Can't read Password\n"); BIO_printf (bio_err, "Can't read Password\n");
goto end; goto end;
@@ -411,27 +408,31 @@ int MAIN(int argc, char **argv)
if (export_cert) { if (export_cert) {
EVP_PKEY *key = NULL; EVP_PKEY *key = NULL;
STACK_OF(PKCS12_SAFEBAG) *bags = NULL; X509 *ucert = NULL, *x = NULL;
STACK_OF(PKCS7) *safes = NULL;
PKCS12_SAFEBAG *bag = NULL;
PKCS8_PRIV_KEY_INFO *p8 = NULL;
PKCS7 *authsafe = NULL;
X509 *ucert = NULL;
STACK_OF(X509) *certs=NULL; STACK_OF(X509) *certs=NULL;
char *catmp = NULL; unsigned char *catmp = NULL;
int i; int i;
unsigned char keyid[EVP_MAX_MD_SIZE];
unsigned int keyidlen = 0; if ((options & (NOCERTS|NOKEYS)) == (NOCERTS|NOKEYS))
{
BIO_printf(bio_err, "Nothing to do!\n");
goto export_end;
}
if (options & NOCERTS)
chain = 0;
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_push_info("process -export_cert"); CRYPTO_push_info("process -export_cert");
CRYPTO_push_info("reading private key"); CRYPTO_push_info("reading private key");
#endif #endif
key = load_key(bio_err, keyname ? keyname : infile, FORMAT_PEM, if (!(options & NOKEYS))
passin, e, "private key"); {
if (!key) { key = load_key(bio_err, keyname ? keyname : infile,
goto export_end; FORMAT_PEM, 1, passin, e, "private key");
} if (!key)
goto export_end;
}
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
@@ -439,50 +440,62 @@ int MAIN(int argc, char **argv)
#endif #endif
/* Load in all certs in input file */ /* Load in all certs in input file */
if(!(certs = load_certs(bio_err, infile, FORMAT_PEM, NULL, e, if(!(options & NOCERTS))
"certificates"))) { {
goto export_end; certs = load_certs(bio_err, infile, FORMAT_PEM, NULL, e,
} "certificates");
if (!certs)
goto export_end;
if (key)
{
/* Look for matching private key */
for(i = 0; i < sk_X509_num(certs); i++)
{
x = sk_X509_value(certs, i);
if(X509_check_private_key(x, key))
{
ucert = x;
/* Zero keyid and alias */
X509_keyid_set1(ucert, NULL, 0);
X509_alias_set1(ucert, NULL, 0);
/* Remove from list */
sk_X509_delete(certs, i);
break;
}
}
if (!ucert)
{
BIO_printf(bio_err, "No certificate matches private key\n");
goto export_end;
}
}
}
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
CRYPTO_push_info("reading certs from input 2"); CRYPTO_push_info("reading certs from input 2");
#endif #endif
for(i = 0; i < sk_X509_num(certs); i++) { /* Add any more certificates asked for */
ucert = sk_X509_value(certs, i); if(certfile)
if(X509_check_private_key(ucert, key)) { {
X509_digest(ucert, EVP_sha1(), keyid, &keyidlen); STACK_OF(X509) *morecerts=NULL;
break; if(!(morecerts = load_certs(bio_err, certfile, FORMAT_PEM,
} NULL, e,
} "certificates from certfile")))
if(!keyidlen) { goto export_end;
ucert = NULL; while(sk_X509_num(morecerts) > 0)
BIO_printf(bio_err, "No certificate matches private key\n"); sk_X509_push(certs, sk_X509_shift(morecerts));
goto export_end; sk_X509_free(morecerts);
} }
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
CRYPTO_push_info("reading certs from certfile"); CRYPTO_push_info("reading certs from certfile");
#endif #endif
bags = sk_PKCS12_SAFEBAG_new_null ();
/* Add any more certificates asked for */
if (certfile) {
STACK_OF(X509) *morecerts=NULL;
if(!(morecerts = load_certs(bio_err, certfile, FORMAT_PEM,
NULL, e,
"certificates from certfile"))) {
goto export_end;
}
while(sk_X509_num(morecerts) > 0) {
sk_X509_push(certs, sk_X509_shift(morecerts));
}
sk_X509_free(morecerts);
}
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
CRYPTO_push_info("building chain"); CRYPTO_push_info("building chain");
@@ -508,111 +521,61 @@ 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 */
sk_X509_free(chain2); X509_free(sk_X509_value(chain2, 0));
if (vret) { sk_X509_free(chain2);
} 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;
} }
} }
#ifdef CRYPTO_MDEBUG /* Add any CA names */
CRYPTO_pop_info();
CRYPTO_push_info("building bags");
#endif
/* We now have loads of certificates: include them all */ for (i = 0; i < sk_num(canames); i++)
for(i = 0; i < sk_X509_num(certs); i++) { {
X509 *cert = NULL; catmp = (unsigned char *)sk_value(canames, i);
cert = sk_X509_value(certs, i); X509_alias_set1(sk_X509_value(certs, i), catmp, -1);
bag = PKCS12_x5092certbag(cert); }
/* If it matches private key set id */
if(cert == ucert) {
if(name) PKCS12_add_friendlyname(bag, name, -1);
PKCS12_add_localkeyid(bag, keyid, keyidlen);
} else if((catmp = sk_shift(canames)))
PKCS12_add_friendlyname(bag, catmp, -1);
sk_PKCS12_SAFEBAG_push(bags, bag);
}
sk_X509_pop_free(certs, X509_free);
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();
CRYPTO_push_info("encrypting bags"); CRYPTO_push_info("reading password");
#endif #endif
if(!noprompt && if(!noprompt &&
EVP_read_pw_string(pass, 50, "Enter Export Password:", 1)) { EVP_read_pw_string(pass, sizeof pass, "Enter Export Password:", 1))
BIO_printf (bio_err, "Can't read Password\n"); {
goto export_end; BIO_printf (bio_err, "Can't read Password\n");
} goto export_end;
if (!twopass) strcpy(macpass, pass); }
/* Turn certbags into encrypted authsafe */ if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass);
authsafe = PKCS12_pack_p7encdata(cert_pbe, cpass, -1, NULL, 0,
iter, bags);
sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
bags = NULL;
if (!authsafe) { #ifdef CRYPTO_MDEBUG
ERR_print_errors (bio_err); CRYPTO_pop_info();
CRYPTO_push_info("creating PKCS#12 structure");
#endif
p12 = PKCS12_create(cpass, name, key, ucert, certs,
key_pbe, cert_pbe, iter, -1, keytype);
if (!p12)
{
ERR_print_errors (bio_err);
goto export_end; goto export_end;
} }
safes = sk_PKCS7_new_null (); if (maciter != -1)
sk_PKCS7_push (safes, authsafe); PKCS12_set_mac(p12, mpass, -1, NULL, 0, maciter, NULL);
#ifdef CRYPTO_MDEBUG
CRYPTO_pop_info();
CRYPTO_push_info("building shrouded key bag");
#endif
/* Make a shrouded key bag */
p8 = EVP_PKEY2PKCS8 (key);
if(keytype) PKCS8_add_keyusage(p8, keytype);
bag = PKCS12_MAKE_SHKEYBAG(key_pbe, cpass, -1, NULL, 0, iter, p8);
PKCS8_PRIV_KEY_INFO_free(p8);
p8 = NULL;
if (name) PKCS12_add_friendlyname (bag, name, -1);
if(csp_name) PKCS12_add_CSPName_asc(bag, csp_name, -1);
PKCS12_add_localkeyid (bag, keyid, keyidlen);
bags = sk_PKCS12_SAFEBAG_new_null();
sk_PKCS12_SAFEBAG_push (bags, bag);
#ifdef CRYPTO_MDEBUG
CRYPTO_pop_info();
CRYPTO_push_info("encrypting shrouded key bag");
#endif
/* Turn it into unencrypted safe bag */
authsafe = PKCS12_pack_p7data (bags);
sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
bags = NULL;
sk_PKCS7_push (safes, authsafe);
#ifdef CRYPTO_MDEBUG
CRYPTO_pop_info();
CRYPTO_push_info("building pkcs12");
#endif
p12 = PKCS12_init(NID_pkcs7_data);
PKCS12_pack_authsafes(p12, safes);
sk_PKCS7_pop_free(safes, PKCS7_free);
safes = NULL;
PKCS12_set_mac (p12, mpass, -1, NULL, 0, maciter, NULL);
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_pop_info(); CRYPTO_pop_info();
CRYPTO_push_info("writing pkcs12"); CRYPTO_push_info("writing pkcs12");
#endif #endif
i2d_PKCS12_bio (out, p12); i2d_PKCS12_bio(out, p12);
ret = 0; ret = 0;
@@ -625,8 +588,6 @@ int MAIN(int argc, char **argv)
if (key) EVP_PKEY_free(key); if (key) EVP_PKEY_free(key);
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 (bags) sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
if (ucert) X509_free(ucert); if (ucert) X509_free(ucert);
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
@@ -644,7 +605,7 @@ int MAIN(int argc, char **argv)
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_push_info("read import password"); CRYPTO_push_info("read import password");
#endif #endif
if(!noprompt && EVP_read_pw_string(pass, 50, "Enter Import Password:", 0)) { if(!noprompt && EVP_read_pw_string(pass, sizeof pass, "Enter Import Password:", 0)) {
BIO_printf (bio_err, "Can't read Password\n"); BIO_printf (bio_err, "Can't read Password\n");
goto end; goto end;
} }
@@ -652,7 +613,7 @@ int MAIN(int argc, char **argv)
CRYPTO_pop_info(); CRYPTO_pop_info();
#endif #endif
if (!twopass) strcpy(macpass, pass); if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass);
if (options & INFO) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1); if (options & INFO) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1);
if(macver) { if(macver) {
@@ -698,7 +659,7 @@ int MAIN(int argc, char **argv)
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass, int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
@@ -853,8 +814,9 @@ int alg_print (BIO *x, X509_ALGOR *alg)
unsigned char *p; unsigned char *p;
p = alg->parameter->value.sequence->data; p = alg->parameter->value.sequence->data;
pbe = d2i_PBEPARAM (NULL, &p, alg->parameter->value.sequence->length); pbe = d2i_PBEPARAM (NULL, &p, alg->parameter->value.sequence->length);
BIO_printf (bio_err, "%s, Iteration %d\n", BIO_printf (bio_err, "%s, Iteration %ld\n",
OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)), ASN1_INTEGER_get(pbe->iter)); OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)),
ASN1_INTEGER_get(pbe->iter));
PBEPARAM_free (pbe); PBEPARAM_free (pbe);
return 0; return 0;
} }

View File

@@ -82,7 +82,9 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
PKCS7 *p7=NULL; PKCS7 *p7=NULL;
int i,badops=0; int i,badops=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
@@ -90,7 +92,9 @@ int MAIN(int argc, char **argv)
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=1;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
apps_startup(); apps_startup();
@@ -98,6 +102,9 @@ 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);
if (!load_config(bio_err, NULL))
goto end;
infile=NULL; infile=NULL;
outfile=NULL; outfile=NULL;
informat=FORMAT_PEM; informat=FORMAT_PEM;
@@ -134,11 +141,13 @@ 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;
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
else else
{ {
BIO_printf(bio_err,"unknown option %s\n",*argv); BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -161,14 +170,18 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
ret = 1; ret = 1;
goto end; goto end;
} }
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
in=BIO_new(BIO_s_file()); in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());
@@ -301,5 +314,5 @@ 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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }

View File

@@ -63,7 +63,6 @@
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/pkcs12.h> #include <openssl/pkcs12.h>
#include "apps.h"
#define PROG pkcs8_main #define PROG pkcs8_main
int MAIN(int, char **); int MAIN(int, char **);
@@ -86,7 +85,9 @@ int MAIN(int argc, char **argv)
EVP_PKEY *pkey=NULL; EVP_PKEY *pkey=NULL;
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL; char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
int badarg = 0; int badarg = 0;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE); if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
@@ -146,11 +147,13 @@ int MAIN(int argc, char **argv)
if (!args[1]) goto bad; if (!args[1]) goto bad;
passargout= *(++args); passargout= *(++args);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*args,"-engine") == 0) else if (strcmp(*args,"-engine") == 0)
{ {
if (!args[1]) goto bad; if (!args[1]) goto bad;
engine= *(++args); engine= *(++args);
} }
#endif
else if (!strcmp (*args, "-in")) { else if (!strcmp (*args, "-in")) {
if (args[1]) { if (args[1]) {
args++; args++;
@@ -183,11 +186,15 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
return (1); return (1);
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
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");
@@ -222,13 +229,17 @@ int MAIN(int argc, char **argv)
if (topk8) if (topk8)
{ {
BIO_free(in); /* Not needed in this section */ BIO_free(in); /* Not needed in this section */
pkey = load_key(bio_err, infile, informat, passin, e, "key"); pkey = load_key(bio_err, infile, informat, 1,
passin, e, "key");
if (!pkey) { if (!pkey) {
BIO_free_all(out);
return (1); return (1);
} }
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) { if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
BIO_printf(bio_err, "Error converting key\n", outfile); BIO_printf(bio_err, "Error converting key\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
EVP_PKEY_free(pkey);
BIO_free_all(out);
return (1); return (1);
} }
if(nocrypt) { if(nocrypt) {
@@ -238,21 +249,32 @@ int MAIN(int argc, char **argv)
i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8inf); i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8inf);
else { else {
BIO_printf(bio_err, "Bad format specified for key\n"); BIO_printf(bio_err, "Bad format specified for key\n");
PKCS8_PRIV_KEY_INFO_free(p8inf);
EVP_PKEY_free(pkey);
BIO_free_all(out);
return (1); return (1);
} }
} else { } else {
if(passout) p8pass = passout; if(passout) p8pass = passout;
else { else {
p8pass = pass; p8pass = pass;
EVP_read_pw_string(pass, 50, "Enter Encryption Password:", 1); if (EVP_read_pw_string(pass, sizeof pass, "Enter Encryption Password:", 1))
{
PKCS8_PRIV_KEY_INFO_free(p8inf);
EVP_PKEY_free(pkey);
BIO_free_all(out);
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,
p8pass, strlen(p8pass), p8pass, strlen(p8pass),
NULL, 0, iter, p8inf))) { NULL, 0, iter, p8inf))) {
BIO_printf(bio_err, "Error encrypting key\n", BIO_printf(bio_err, "Error encrypting key\n");
outfile);
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
PKCS8_PRIV_KEY_INFO_free(p8inf);
EVP_PKEY_free(pkey);
BIO_free_all(out);
return (1); return (1);
} }
app_RAND_write_file(NULL, bio_err); app_RAND_write_file(NULL, bio_err);
@@ -262,6 +284,9 @@ int MAIN(int argc, char **argv)
i2d_PKCS8_bio(out, p8); i2d_PKCS8_bio(out, p8);
else { else {
BIO_printf(bio_err, "Bad format specified for key\n"); BIO_printf(bio_err, "Bad format specified for key\n");
PKCS8_PRIV_KEY_INFO_free(p8inf);
EVP_PKEY_free(pkey);
BIO_free_all(out);
return (1); return (1);
} }
X509_SIG_free(p8); X509_SIG_free(p8);
@@ -294,27 +319,27 @@ int MAIN(int argc, char **argv)
} }
if (!p8) { if (!p8) {
BIO_printf (bio_err, "Error reading key\n", outfile); BIO_printf (bio_err, "Error reading key\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
return (1); return (1);
} }
if(passin) p8pass = passin; if(passin) p8pass = passin;
else { else {
p8pass = pass; p8pass = pass;
EVP_read_pw_string(pass, 50, "Enter Password:", 0); EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0);
} }
p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass)); p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
X509_SIG_free(p8); X509_SIG_free(p8);
} }
if (!p8inf) { if (!p8inf) {
BIO_printf(bio_err, "Error decrypting key\n", outfile); BIO_printf(bio_err, "Error decrypting key\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
return (1); return (1);
} }
if (!(pkey = EVP_PKCS82PKEY(p8inf))) { if (!(pkey = EVP_PKCS82PKEY(p8inf))) {
BIO_printf(bio_err, "Error converting key\n", outfile); BIO_printf(bio_err, "Error converting key\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
return (1); return (1);
} }

View File

@@ -17,7 +17,7 @@ extern int rsa_main(int argc,char *argv[]);
extern int rsautl_main(int argc,char *argv[]); extern int rsautl_main(int argc,char *argv[]);
extern int dsa_main(int argc,char *argv[]); extern int dsa_main(int argc,char *argv[]);
extern int dsaparam_main(int argc,char *argv[]); extern int dsaparam_main(int argc,char *argv[]);
extern int ecdsa_main(int argc,char *argv[]); extern int ec_main(int argc,char *argv[]);
extern int ecparam_main(int argc,char *argv[]); extern int ecparam_main(int argc,char *argv[]);
extern int x509_main(int argc,char *argv[]); extern int x509_main(int argc,char *argv[]);
extern int genrsa_main(int argc,char *argv[]); extern int genrsa_main(int argc,char *argv[]);
@@ -37,7 +37,9 @@ extern int pkcs8_main(int argc,char *argv[]);
extern int spkac_main(int argc,char *argv[]); extern int spkac_main(int argc,char *argv[]);
extern int smime_main(int argc,char *argv[]); extern int smime_main(int argc,char *argv[]);
extern int rand_main(int argc,char *argv[]); extern int rand_main(int argc,char *argv[]);
#ifndef OPENSSL_NO_ENGINE
extern int engine_main(int argc,char *argv[]); extern int engine_main(int argc,char *argv[]);
#endif
extern int ocsp_main(int argc,char *argv[]); extern int ocsp_main(int argc,char *argv[]);
#define FUNC_TYPE_GENERAL 1 #define FUNC_TYPE_GENERAL 1
@@ -81,10 +83,10 @@ FUNCTION functions[] = {
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
{FUNC_TYPE_GENERAL,"dsaparam",dsaparam_main}, {FUNC_TYPE_GENERAL,"dsaparam",dsaparam_main},
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_EC
{FUNC_TYPE_GENERAL,"ecdsa",ecdsa_main}, {FUNC_TYPE_GENERAL,"ec",ec_main},
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_EC
{FUNC_TYPE_GENERAL,"ecparam",ecparam_main}, {FUNC_TYPE_GENERAL,"ecparam",ecparam_main},
#endif #endif
{FUNC_TYPE_GENERAL,"x509",x509_main}, {FUNC_TYPE_GENERAL,"x509",x509_main},
@@ -100,7 +102,9 @@ FUNCTION functions[] = {
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) #if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
{FUNC_TYPE_GENERAL,"s_client",s_client_main}, {FUNC_TYPE_GENERAL,"s_client",s_client_main},
#endif #endif
#ifndef OPENSSL_NO_SPEED
{FUNC_TYPE_GENERAL,"speed",speed_main}, {FUNC_TYPE_GENERAL,"speed",speed_main},
#endif
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) #if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
{FUNC_TYPE_GENERAL,"s_time",s_time_main}, {FUNC_TYPE_GENERAL,"s_time",s_time_main},
#endif #endif
@@ -119,7 +123,9 @@ FUNCTION functions[] = {
{FUNC_TYPE_GENERAL,"spkac",spkac_main}, {FUNC_TYPE_GENERAL,"spkac",spkac_main},
{FUNC_TYPE_GENERAL,"smime",smime_main}, {FUNC_TYPE_GENERAL,"smime",smime_main},
{FUNC_TYPE_GENERAL,"rand",rand_main}, {FUNC_TYPE_GENERAL,"rand",rand_main},
#ifndef OPENSSL_NO_ENGINE
{FUNC_TYPE_GENERAL,"engine",engine_main}, {FUNC_TYPE_GENERAL,"engine",engine_main},
#endif
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main}, {FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
#ifndef OPENSSL_NO_MD2 #ifndef OPENSSL_NO_MD2
{FUNC_TYPE_MD,"md2",dgst_main}, {FUNC_TYPE_MD,"md2",dgst_main},

View File

@@ -33,8 +33,8 @@ foreach (@ARGV)
{ print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n"; } { print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n"; }
elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/)) elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/))
{ print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n"; } { print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n"; }
elsif ( ($_ =~ /^ecdsa$/) || ($_ =~ /^ecdsaparam$/)) elsif ( ($_ =~ /^ec$/) || ($_ =~ /^ecparam$/))
{ print "#ifndef OPENSSL_NO_ECDSA\n${str}#endif\n";} { print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";}
elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/)) elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/))
{ print "#ifndef OPENSSL_NO_DH\n${str}#endif\n"; } { print "#ifndef OPENSSL_NO_DH\n${str}#endif\n"; }
elsif ( ($_ =~ /^pkcs12$/)) elsif ( ($_ =~ /^pkcs12$/))

View File

@@ -76,7 +76,9 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
int i, r, ret = 1; int i, r, ret = 1;
int badopt; int badopt;
char *outfile = NULL; char *outfile = NULL;
@@ -84,7 +86,9 @@ int MAIN(int argc, char **argv)
int base64 = 0; int base64 = 0;
BIO *out = NULL; BIO *out = NULL;
int num = -1; int num = -1;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
apps_startup(); apps_startup();
@@ -106,6 +110,7 @@ int MAIN(int argc, char **argv)
else else
badopt = 1; badopt = 1;
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(argv[i], "-engine") == 0) else if (strcmp(argv[i], "-engine") == 0)
{ {
if ((argv[i+1] != NULL) && (engine == NULL)) if ((argv[i+1] != NULL) && (engine == NULL))
@@ -113,6 +118,7 @@ int MAIN(int argc, char **argv)
else else
badopt = 1; badopt = 1;
} }
#endif
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))
@@ -150,13 +156,17 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n"); BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n");
#endif
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;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
app_RAND_load_file(NULL, bio_err, (inrand != NULL)); app_RAND_load_file(NULL, bio_err, (inrand != NULL));
if (inrand != NULL) if (inrand != NULL)
@@ -195,7 +205,7 @@ int MAIN(int argc, char **argv)
int chunk; int chunk;
chunk = num; chunk = num;
if (chunk > sizeof buf) if (chunk > (int)sizeof(buf))
chunk = sizeof buf; chunk = sizeof buf;
r = RAND_bytes(buf, chunk); r = RAND_bytes(buf, chunk);
if (r <= 0) if (r <= 0)
@@ -213,5 +223,5 @@ err:
if (out) if (out)
BIO_free_all(out); BIO_free_all(out);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }

View File

@@ -56,6 +56,12 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
* deprecated functions for openssl-internal code */
#ifdef OPENSSL_NO_DEPRECATED
#undef OPENSSL_NO_DEPRECATED
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
@@ -73,6 +79,7 @@
#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 "../crypto/cryptlib.h"
#define SECTION "req" #define SECTION "req"
@@ -112,9 +119,10 @@
* require. This format is wrong * require. This format is wrong
*/ */
static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,char *dn,int attribs, static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,char *dn,int mutlirdn,
unsigned long chtype); int attribs,unsigned long chtype);
static int build_subject(X509_REQ *req, char *subj, unsigned long chtype); static int build_subject(X509_REQ *req, char *subj, unsigned long chtype,
int multirdn);
static int prompt_info(X509_REQ *req, static int prompt_info(X509_REQ *req,
STACK_OF(CONF_VALUE) *dn_sk, char *dn_sect, STACK_OF(CONF_VALUE) *dn_sk, char *dn_sect,
STACK_OF(CONF_VALUE) *attr_sk, char *attr_sect, int attribs, STACK_OF(CONF_VALUE) *attr_sk, char *attr_sect, int attribs,
@@ -126,15 +134,14 @@ static int add_attribute_object(X509_REQ *req, char *text,
char *def, char *value, int nid, int n_min, char *def, char *value, int nid, int n_min,
int n_max, unsigned long chtype); int n_max, unsigned long chtype);
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value, static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
int nid,int n_min,int n_max, unsigned long chtype); int nid,int n_min,int n_max, unsigned long chtype, int mval);
#ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_RSA
static void MS_CALLBACK req_cb(int p,int n,void *arg); static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb);
#endif #endif
static int req_check_len(int len,int n_min,int n_max); static int req_check_len(int len,int n_min,int n_max);
static int check_end(char *str, char *end); static int check_end(char *str, char *end);
#ifndef MONOLITH #ifndef MONOLITH
static char *default_config_file=NULL; static char *default_config_file=NULL;
static CONF *config=NULL;
#endif #endif
static CONF *req_conf=NULL; static CONF *req_conf=NULL;
static int batch=0; static int batch=0;
@@ -142,7 +149,7 @@ static int batch=0;
#define TYPE_RSA 1 #define TYPE_RSA 1
#define TYPE_DSA 2 #define TYPE_DSA 2
#define TYPE_DH 3 #define TYPE_DH 3
#define TYPE_ECDSA 4 #define TYPE_EC 4
int MAIN(int, char **); int MAIN(int, char **);
@@ -153,9 +160,9 @@ int MAIN(int argc, char **argv)
DSA *dsa_params=NULL; DSA *dsa_params=NULL;
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
ECDSA *ecdsa_params = NULL; EC_KEY *ec_params = NULL;
#endif #endif
unsigned long nmflag = 0; unsigned long nmflag = 0, reqflag = 0;
int ex=1,x509=0,days=30; int ex=1,x509=0,days=30;
X509 *x509ss=NULL; X509 *x509ss=NULL;
X509_REQ *req=NULL; X509_REQ *req=NULL;
@@ -166,7 +173,9 @@ 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,subject=0,pubkey=0; int nodes=0,kludge=0,newhdr=0,subject=0,pubkey=0;
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL; char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
char *extensions = NULL; char *extensions = NULL;
char *req_exts = NULL; char *req_exts = NULL;
const EVP_CIPHER *cipher=NULL; const EVP_CIPHER *cipher=NULL;
@@ -177,10 +186,11 @@ int MAIN(int argc, char **argv)
char *passin = NULL, *passout = NULL; char *passin = NULL, *passout = NULL;
char *p; char *p;
char *subj = NULL; char *subj = NULL;
int multirdn = 0;
const EVP_MD *md_alg=NULL,*digest=EVP_md5(); const EVP_MD *md_alg=NULL,*digest=EVP_md5();
unsigned long chtype = MBSTRING_ASC; unsigned long chtype = MBSTRING_ASC;
#ifndef MONOLITH #ifndef MONOLITH
MS_STATIC char config_name[256]; char *to_free;
long errline; long errline;
#endif #endif
@@ -214,11 +224,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
outformat=str2fmt(*(++argv)); outformat=str2fmt(*(++argv));
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
else if (strcmp(*argv,"-key") == 0) else if (strcmp(*argv,"-key") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -328,40 +340,41 @@ int MAIN(int argc, char **argv)
else else
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
if (strncmp("ecdsa:",p,4) == 0) if (strncmp("ec:",p,3) == 0)
{ {
X509 *xtmp=NULL; X509 *xtmp=NULL;
EVP_PKEY *dtmp; EVP_PKEY *dtmp;
pkey_type=TYPE_ECDSA; pkey_type=TYPE_EC;
p+=6; p+=3;
if ((in=BIO_new_file(p,"r")) == NULL) if ((in=BIO_new_file(p,"r")) == NULL)
{ {
perror(p); perror(p);
goto end; goto end;
} }
if ((ecdsa_params = ECDSA_new()) == NULL) if ((ec_params = EC_KEY_new()) == NULL)
goto end; goto end;
if ((ecdsa_params->group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL)) == NULL) if ((ec_params->group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL)) == NULL)
{ {
if (ecdsa_params) if (ec_params)
ECDSA_free(ecdsa_params); EC_KEY_free(ec_params);
ERR_clear_error(); ERR_clear_error();
(void)BIO_reset(in); (void)BIO_reset(in);
if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL) if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL)
{ {
BIO_printf(bio_err,"unable to load ECDSA parameters from file\n"); BIO_printf(bio_err,"unable to load EC parameters from file\n");
goto end; goto end;
} }
if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end; if ((dtmp=X509_get_pubkey(xtmp))==NULL)
if (dtmp->type == EVP_PKEY_ECDSA) goto end;
ecdsa_params = ECDSAParameters_dup(dtmp->pkey.ecdsa); if (dtmp->type == EVP_PKEY_EC)
ec_params = ECParameters_dup(dtmp->pkey.eckey);
EVP_PKEY_free(dtmp); EVP_PKEY_free(dtmp);
X509_free(xtmp); X509_free(xtmp);
if (ecdsa_params == NULL) if (ec_params == NULL)
{ {
BIO_printf(bio_err,"Certificate does not contain ECDSA parameters\n"); BIO_printf(bio_err,"Certificate does not contain EC parameters\n");
goto end; goto end;
} }
} }
@@ -369,16 +382,7 @@ int MAIN(int argc, char **argv)
BIO_free(in); BIO_free(in);
in=NULL; in=NULL;
{ newkey = EC_GROUP_get_degree(ec_params->group);
BIGNUM *order = BN_new();
if (!order)
goto end;
if (!EC_GROUP_get_order(ecdsa_params->group, order, NULL))
goto end;
newkey = BN_num_bits(order);
BN_free(order);
}
} }
else else
@@ -391,7 +395,9 @@ int MAIN(int argc, char **argv)
} }
else else
#endif #endif
pkey_type=TYPE_RSA; {
goto bad;
}
newreq=1; newreq=1;
} }
@@ -416,6 +422,11 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
if (!set_name_ex(&nmflag, *(++argv))) goto bad; if (!set_name_ex(&nmflag, *(++argv))) goto bad;
} }
else if (strcmp(*argv,"-reqopt") == 0)
{
if (--argc < 1) goto bad;
if (!set_cert_ex(&reqflag, *(++argv))) goto bad;
}
else if (strcmp(*argv,"-subject") == 0) else if (strcmp(*argv,"-subject") == 0)
subject=1; subject=1;
else if (strcmp(*argv,"-text") == 0) else if (strcmp(*argv,"-text") == 0)
@@ -431,6 +442,8 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
subj= *(++argv); subj= *(++argv);
} }
else if (strcmp(*argv,"-multivalue-rdn") == 0)
multirdn=1;
else if (strcmp(*argv,"-days") == 0) else if (strcmp(*argv,"-days") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -483,7 +496,9 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device\n");
#endif
BIO_printf(bio_err," -subject output the request's subject\n"); BIO_printf(bio_err," -subject output the request's subject\n");
BIO_printf(bio_err," -passin private key password source\n"); BIO_printf(bio_err," -passin private key password source\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");
@@ -494,10 +509,13 @@ 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," -newkey ecdsa:file generate a new ECDSA key, parameters taken from CA in 'file'\n"); #ifndef OPENSSL_NO_ECDSA
BIO_printf(bio_err," -newkey ec:file generate a new EC key, parameters taken from CA in 'file'\n");
#endif
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, md4)\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," -subj arg set or modify request subject\n"); BIO_printf(bio_err," -subj arg set or modify request subject\n");
BIO_printf(bio_err," -multivalue-rdn enable support for multivalued RDNs\n");
BIO_printf(bio_err," -new new request.\n"); BIO_printf(bio_err," -new new request.\n");
BIO_printf(bio_err," -batch do not ask anything during request generation\n"); BIO_printf(bio_err," -batch do not ask anything during request generation\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");
@@ -510,6 +528,7 @@ bad:
BIO_printf(bio_err," -reqexts .. specify request extension section (override value in config file)\n"); BIO_printf(bio_err," -reqexts .. specify request extension section (override value in config file)\n");
BIO_printf(bio_err," -utf8 input characters are UTF8 (default ASCII)\n"); BIO_printf(bio_err," -utf8 input characters are UTF8 (default ASCII)\n");
BIO_printf(bio_err," -nameopt arg - various certificate name options\n"); BIO_printf(bio_err," -nameopt arg - various certificate name options\n");
BIO_printf(bio_err," -reqopt arg - various request text options\n\n");
goto end; goto end;
} }
@@ -525,14 +544,7 @@ bad:
if (p == NULL) if (p == NULL)
p=getenv("SSLEAY_CONF"); p=getenv("SSLEAY_CONF");
if (p == NULL) if (p == NULL)
{ p=to_free=make_config_name();
strcpy(config_name,X509_get_default_cert_area());
#ifndef OPENSSL_SYS_VMS
strcat(config_name,"/");
#endif
strcat(config_name,OPENSSL_CONF);
p=config_name;
}
default_config_file=p; default_config_file=p;
config=NCONF_new(NULL); config=NCONF_new(NULL);
i=NCONF_load(config, p, &errline); i=NCONF_load(config, p, &errline);
@@ -540,7 +552,7 @@ bad:
if (template != NULL) if (template != NULL)
{ {
long errline; long errline = -1;
if( verbose ) if( verbose )
BIO_printf(bio_err,"Using configuration from %s\n",template); BIO_printf(bio_err,"Using configuration from %s\n",template);
@@ -679,11 +691,13 @@ bad:
if ((in == NULL) || (out == NULL)) if ((in == NULL) || (out == NULL))
goto end; goto end;
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if (keyfile != NULL) if (keyfile != NULL)
{ {
pkey = load_key(bio_err, keyfile, keyform, passin, e, pkey = load_key(bio_err, keyfile, keyform, 0, passin, e,
"Private Key"); "Private Key");
if (!pkey) if (!pkey)
{ {
@@ -691,7 +705,8 @@ bad:
message */ message */
goto end; goto end;
} }
if (EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA || EVP_PKEY_type(pkey->type) == EVP_PKEY_ECDSA) if (EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA ||
EVP_PKEY_type(pkey->type) == EVP_PKEY_EC)
{ {
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE"); char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
if (randfile == NULL) if (randfile == NULL)
@@ -702,6 +717,7 @@ bad:
if (newreq && (pkey == NULL)) if (newreq && (pkey == NULL))
{ {
BN_GENCB cb;
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE"); char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
if (randfile == NULL) if (randfile == NULL)
ERR_clear_error(); ERR_clear_error();
@@ -716,24 +732,28 @@ bad:
} }
if (newkey < MIN_KEY_LENGTH && (pkey_type == TYPE_RSA || pkey_type == TYPE_DSA)) if (newkey < MIN_KEY_LENGTH && (pkey_type == TYPE_RSA || pkey_type == TYPE_DSA))
/* TODO: appropriate minimal keylength for the different algorithm (esp. ECDSA) */
{ {
BIO_printf(bio_err,"private key length is too short,\n"); BIO_printf(bio_err,"private key length is too short,\n");
BIO_printf(bio_err,"it needs to be at least %d bits, not %d\n",MIN_KEY_LENGTH,newkey); BIO_printf(bio_err,"it needs to be at least %d bits, not %ld\n",MIN_KEY_LENGTH,newkey);
goto end; goto end;
} }
BIO_printf(bio_err,"Generating a %d bit %s private key\n", BIO_printf(bio_err,"Generating a %ld bit %s private key\n",
newkey,(pkey_type == TYPE_RSA)?"RSA":(pkey_type == TYPE_DSA)?"DSA":"ECDSA"); newkey,(pkey_type == TYPE_RSA)?"RSA":
(pkey_type == TYPE_DSA)?"DSA":"EC");
if ((pkey=EVP_PKEY_new()) == NULL) goto end; if ((pkey=EVP_PKEY_new()) == NULL) goto end;
#ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_RSA
BN_GENCB_set(&cb, req_cb, bio_err);
if (pkey_type == TYPE_RSA) if (pkey_type == TYPE_RSA)
{ {
if (!EVP_PKEY_assign_RSA(pkey, RSA *rsa = RSA_new();
RSA_generate_key(newkey,0x10001, if(!rsa || !RSA_generate_key_ex(rsa, newkey, 0x10001, &cb) ||
req_cb,bio_err))) !EVP_PKEY_assign_RSA(pkey, rsa))
{
if(rsa) RSA_free(rsa);
goto end; goto end;
}
} }
else else
#endif #endif
@@ -746,11 +766,12 @@ bad:
} }
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
if (pkey_type == TYPE_ECDSA) if (pkey_type == TYPE_EC)
{ {
if (!ECDSA_generate_key(ecdsa_params)) goto end; if (!EC_KEY_generate_key(ec_params)) goto end;
if (!EVP_PKEY_assign_ECDSA(pkey, ecdsa_params)) goto end; if (!EVP_PKEY_assign_EC_KEY(pkey, ec_params))
ecdsa_params = NULL; goto end;
ec_params = NULL;
} }
#endif #endif
@@ -860,7 +881,7 @@ loop:
digest=EVP_dss1(); digest=EVP_dss1();
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA) if (pkey->type == EVP_PKEY_EC)
digest=EVP_ecdsa(); digest=EVP_ecdsa();
#endif #endif
if (req == NULL) if (req == NULL)
@@ -871,7 +892,7 @@ loop:
goto end; goto end;
} }
i=make_REQ(req,pkey,subj,!x509, chtype); i=make_REQ(req,pkey,subj,multirdn,!x509, chtype);
subj=NULL; /* done processing '-subj' option */ subj=NULL; /* done processing '-subj' option */
if ((kludge > 0) && !sk_X509_ATTRIBUTE_num(req->req_info->attributes)) if ((kludge > 0) && !sk_X509_ATTRIBUTE_num(req->req_info->attributes))
{ {
@@ -891,7 +912,7 @@ loop:
if ((x509ss=X509_new()) == NULL) goto end; if ((x509ss=X509_new()) == NULL) goto end;
/* Set version to V3 */ /* Set version to V3 */
if(!X509_set_version(x509ss, 2)) goto end; if(extensions && !X509_set_version(x509ss, 2)) goto end;
if (serial) if (serial)
{ {
if (!X509_set_serialNumber(x509ss, serial)) goto end; if (!X509_set_serialNumber(x509ss, serial)) goto end;
@@ -964,7 +985,7 @@ loop:
print_name(bio_err, "old subject=", X509_REQ_get_subject_name(req), nmflag); print_name(bio_err, "old subject=", X509_REQ_get_subject_name(req), nmflag);
} }
if (build_subject(req, subj, chtype) == 0) if (build_subject(req, subj, chtype, multirdn) == 0)
{ {
BIO_printf(bio_err, "ERROR: cannot modify subject\n"); BIO_printf(bio_err, "ERROR: cannot modify subject\n");
ex=1; ex=1;
@@ -1055,9 +1076,9 @@ loop:
if (text) if (text)
{ {
if (x509) if (x509)
X509_print(out,x509ss); X509_print_ex(out, x509ss, nmflag, reqflag);
else else
X509_REQ_print(out,req); X509_REQ_print_ex(out, req, nmflag, reqflag);
} }
if(subject) if(subject)
@@ -1127,6 +1148,10 @@ loop:
} }
ex=0; ex=0;
end: end:
#ifndef MONOLITH
if(to_free)
OPENSSL_free(to_free);
#endif
if (ex) if (ex)
{ {
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
@@ -1145,14 +1170,14 @@ end:
if (dsa_params != NULL) DSA_free(dsa_params); if (dsa_params != NULL) DSA_free(dsa_params);
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
if (ecdsa_params != NULL) ECDSA_free(ecdsa_params); if (ec_params != NULL) EC_KEY_free(ec_params);
#endif #endif
apps_shutdown(); apps_shutdown();
EXIT(ex); OPENSSL_EXIT(ex);
} }
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs, static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn,
unsigned long chtype) int attribs, unsigned long chtype)
{ {
int ret=0,i; int ret=0,i;
char no_prompt = 0; char no_prompt = 0;
@@ -1202,7 +1227,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs,
else else
{ {
if (subj) if (subj)
i = build_subject(req, subj, chtype); i = build_subject(req, subj, chtype, multirdn);
else else
i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs, chtype); i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs, chtype);
} }
@@ -1219,11 +1244,11 @@ err:
* subject is expected to be in the format /type0=value0/type1=value1/type2=... * subject is expected to be in the format /type0=value0/type1=value1/type2=...
* where characters may be escaped by \ * where characters may be escaped by \
*/ */
static int build_subject(X509_REQ *req, char *subject, unsigned long chtype) static int build_subject(X509_REQ *req, char *subject, unsigned long chtype, int multirdn)
{ {
X509_NAME *n; X509_NAME *n;
if (!(n = do_subject(subject, chtype))) if (!(n = parse_name(subject, chtype, multirdn)))
return 0; return 0;
if (!X509_REQ_set_subject_name(req, n)) if (!X509_REQ_set_subject_name(req, n))
@@ -1244,7 +1269,7 @@ static int prompt_info(X509_REQ *req,
int i; int i;
char *p,*q; char *p,*q;
char buf[100]; char buf[100];
int nid; int nid, mval;
long n_min,n_max; long n_min,n_max;
char *type,*def,*value; char *type,*def,*value;
CONF_VALUE *v; CONF_VALUE *v;
@@ -1287,32 +1312,51 @@ start: for (;;)
if(*p) type = p; if(*p) type = p;
break; break;
} }
if (*type == '+')
{
mval = -1;
type++;
}
else
mval = 0;
/* If OBJ not recognised ignore it */ /* If OBJ not recognised ignore it */
if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start; if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start;
sprintf(buf,"%s_default",v->name); if (BIO_snprintf(buf,sizeof buf,"%s_default",v->name)
>= (int)sizeof(buf))
{
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
return 0;
}
if ((def=NCONF_get_string(req_conf,dn_sect,buf)) == NULL) if ((def=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
{ {
ERR_clear_error(); ERR_clear_error();
def=""; def="";
} }
sprintf(buf,"%s_value",v->name); BIO_snprintf(buf,sizeof buf,"%s_value",v->name);
if ((value=NCONF_get_string(req_conf,dn_sect,buf)) == NULL) if ((value=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
{ {
ERR_clear_error(); ERR_clear_error();
value=NULL; value=NULL;
} }
sprintf(buf,"%s_min",v->name); BIO_snprintf(buf,sizeof buf,"%s_min",v->name);
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_min)) if (!NCONF_get_number(req_conf,dn_sect,buf, &n_min))
{
ERR_clear_error();
n_min = -1; n_min = -1;
}
sprintf(buf,"%s_max",v->name); BIO_snprintf(buf,sizeof buf,"%s_max",v->name);
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_max)) if (!NCONF_get_number(req_conf,dn_sect,buf, &n_max))
{
ERR_clear_error();
n_max = -1; n_max = -1;
}
if (!add_DN_object(subj,v->value,def,value,nid, if (!add_DN_object(subj,v->value,def,value,nid,
n_min,n_max, chtype)) n_min,n_max, chtype, mval))
return 0; return 0;
} }
if (X509_NAME_entry_count(subj) == 0) if (X509_NAME_entry_count(subj) == 0)
@@ -1342,7 +1386,13 @@ start2: for (;;)
if ((nid=OBJ_txt2nid(type)) == NID_undef) if ((nid=OBJ_txt2nid(type)) == NID_undef)
goto start2; goto start2;
sprintf(buf,"%s_default",type); if (BIO_snprintf(buf,sizeof buf,"%s_default",type)
>= (int)sizeof(buf))
{
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
return 0;
}
if ((def=NCONF_get_string(req_conf,attr_sect,buf)) if ((def=NCONF_get_string(req_conf,attr_sect,buf))
== NULL) == NULL)
{ {
@@ -1351,7 +1401,7 @@ start2: for (;;)
} }
sprintf(buf,"%s_value",type); BIO_snprintf(buf,sizeof buf,"%s_value",type);
if ((value=NCONF_get_string(req_conf,attr_sect,buf)) if ((value=NCONF_get_string(req_conf,attr_sect,buf))
== NULL) == NULL)
{ {
@@ -1359,11 +1409,11 @@ start2: for (;;)
value=NULL; value=NULL;
} }
sprintf(buf,"%s_min",type); BIO_snprintf(buf,sizeof buf,"%s_min",type);
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min)) if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
n_min = -1; n_min = -1;
sprintf(buf,"%s_max",type); BIO_snprintf(buf,sizeof buf,"%s_max",type);
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max)) if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
n_max = -1; n_max = -1;
@@ -1396,6 +1446,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++)
{ {
int mval;
v=sk_CONF_VALUE_value(dn_sk,i); v=sk_CONF_VALUE_value(dn_sk,i);
p=q=NULL; p=q=NULL;
type=v->name; type=v->name;
@@ -1412,8 +1463,19 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
if(*p) type = p; if(*p) type = p;
break; break;
} }
#ifndef CHARSET_EBCDIC
if (*p == '+')
#else
if (*p == os_toascii['+'])
#endif
{
p++;
mval = -1;
}
else
mval = 0;
if (!X509_NAME_add_entry_by_txt(subj,type, chtype, if (!X509_NAME_add_entry_by_txt(subj,type, chtype,
(unsigned char *) v->value,-1,-1,0)) return 0; (unsigned char *) v->value,-1,-1,mval)) return 0;
} }
@@ -1436,7 +1498,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value, static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
int nid, int n_min, int n_max, unsigned long chtype) int nid, int n_min, int n_max, unsigned long chtype, int mval)
{ {
int i,ret=0; int i,ret=0;
MS_STATIC char buf[1024]; MS_STATIC char buf[1024];
@@ -1445,8 +1507,8 @@ start:
(void)BIO_flush(bio_err); (void)BIO_flush(bio_err);
if(value != NULL) if(value != NULL)
{ {
strcpy(buf,value); BUF_strlcpy(buf,value,sizeof buf);
strcat(buf,"\n"); BUF_strlcat(buf,"\n",sizeof buf);
BIO_printf(bio_err,"%s\n",value); BIO_printf(bio_err,"%s\n",value);
} }
else else
@@ -1454,7 +1516,7 @@ start:
buf[0]='\0'; buf[0]='\0';
if (!batch) if (!batch)
{ {
fgets(buf,1024,stdin); fgets(buf,sizeof buf,stdin);
} }
else else
{ {
@@ -1468,8 +1530,8 @@ start:
{ {
if ((def == NULL) || (def[0] == '\0')) if ((def == NULL) || (def[0] == '\0'))
return(1); return(1);
strcpy(buf,def); BUF_strlcpy(buf,def,sizeof buf);
strcat(buf,"\n"); BUF_strlcat(buf,"\n",sizeof buf);
} }
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1); else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
@@ -1485,7 +1547,7 @@ start:
#endif #endif
if(!req_check_len(i, n_min, n_max)) goto start; if(!req_check_len(i, n_min, n_max)) goto start;
if (!X509_NAME_add_entry_by_NID(n,nid, chtype, if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
(unsigned char *) buf, -1,-1,0)) goto err; (unsigned char *) buf, -1,-1,mval)) goto err;
ret=1; ret=1;
err: err:
return(ret); return(ret);
@@ -1503,8 +1565,8 @@ start:
(void)BIO_flush(bio_err); (void)BIO_flush(bio_err);
if (value != NULL) if (value != NULL)
{ {
strcpy(buf,value); BUF_strlcpy(buf,value,sizeof buf);
strcat(buf,"\n"); BUF_strlcat(buf,"\n",sizeof buf);
BIO_printf(bio_err,"%s\n",value); BIO_printf(bio_err,"%s\n",value);
} }
else else
@@ -1512,7 +1574,7 @@ start:
buf[0]='\0'; buf[0]='\0';
if (!batch) if (!batch)
{ {
fgets(buf,1024,stdin); fgets(buf,sizeof buf,stdin);
} }
else else
{ {
@@ -1526,8 +1588,8 @@ start:
{ {
if ((def == NULL) || (def[0] == '\0')) if ((def == NULL) || (def[0] == '\0'))
return(1); return(1);
strcpy(buf,def); BUF_strlcpy(buf,def,sizeof buf);
strcat(buf,"\n"); BUF_strlcat(buf,"\n",sizeof buf);
} }
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1); else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
@@ -1556,7 +1618,7 @@ err:
} }
#ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_RSA
static void MS_CALLBACK req_cb(int p, int n, void *arg) static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb)
{ {
char c='*'; char c='*';
@@ -1564,11 +1626,12 @@ static void MS_CALLBACK req_cb(int p, int n, void *arg)
if (p == 1) c='+'; if (p == 1) c='+';
if (p == 2) c='*'; if (p == 2) c='*';
if (p == 3) c='\n'; if (p == 3) c='\n';
BIO_write((BIO *)arg,&c,1); BIO_write(cb->arg,&c,1);
(void)BIO_flush((BIO *)arg); (void)BIO_flush(cb->arg);
#ifdef LINT #ifdef LINT
p=n; p=n;
#endif #endif
return 1;
} }
#endif #endif

View File

@@ -104,7 +104,9 @@ 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;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
int modulus=0; int modulus=0;
apps_startup(); apps_startup();
@@ -156,11 +158,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
passargout= *(++argv); passargout= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -212,13 +216,17 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
goto end; goto end;
} }
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
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");
@@ -238,12 +246,12 @@ bad:
if (pubin) if (pubin)
pkey = load_pubkey(bio_err, infile, pkey = load_pubkey(bio_err, infile,
(informat == FORMAT_NETSCAPE && sgckey ? (informat == FORMAT_NETSCAPE && sgckey ?
FORMAT_IISSGC : informat), FORMAT_IISSGC : informat), 1,
passin, e, "Public Key"); passin, e, "Public Key");
else else
pkey = load_key(bio_err, infile, pkey = load_key(bio_err, infile,
(informat == FORMAT_NETSCAPE && sgckey ? (informat == FORMAT_NETSCAPE && sgckey ?
FORMAT_IISSGC : informat), FORMAT_IISSGC : informat), 1,
passin, e, "Private Key"); passin, e, "Private Key");
if (pkey != NULL) if (pkey != NULL)
@@ -369,7 +377,7 @@ end:
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
#else /* !OPENSSL_NO_RSA */ #else /* !OPENSSL_NO_RSA */

View File

@@ -85,7 +85,9 @@ int MAIN(int argc, char **argv)
ENGINE *e = NULL; ENGINE *e = NULL;
BIO *in = NULL, *out = NULL; BIO *in = NULL, *out = NULL;
char *infile = NULL, *outfile = NULL; char *infile = NULL, *outfile = NULL;
#ifndef OPENSSL_NO_ENGINE
char *engine = NULL; char *engine = NULL;
#endif
char *keyfile = NULL; char *keyfile = NULL;
char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY; char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY;
int keyform = FORMAT_PEM; int keyform = FORMAT_PEM;
@@ -95,6 +97,7 @@ int MAIN(int argc, char **argv)
EVP_PKEY *pkey = NULL; EVP_PKEY *pkey = NULL;
RSA *rsa = NULL; RSA *rsa = NULL;
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad; unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
char *passargin = NULL, *passin = NULL;
int rsa_inlen, rsa_outlen = 0; int rsa_inlen, rsa_outlen = 0;
int keysize; int keysize;
@@ -122,12 +125,17 @@ 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,"-passin")) {
if (--argc < 1) badarg = 1;
passargin= *(++argv);
} else if (strcmp(*argv,"-keyform") == 0) { } else if (strcmp(*argv,"-keyform") == 0) {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
keyform=str2fmt(*(++argv)); keyform=str2fmt(*(++argv));
#ifndef OPENSSL_NO_ENGINE
} else if(!strcmp(*argv, "-engine")) { } else if(!strcmp(*argv, "-engine")) {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
engine = *(++argv); engine = *(++argv);
#endif
} 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")) {
@@ -162,19 +170,25 @@ int MAIN(int argc, char **argv)
goto end; goto end;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
BIO_printf(bio_err, "Error getting password\n");
goto end;
}
/* 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);
switch(key_type) { switch(key_type) {
case KEY_PRIVKEY: case KEY_PRIVKEY:
pkey = load_key(bio_err, keyfile, keyform, pkey = load_key(bio_err, keyfile, keyform, 0,
NULL, e, "Private Key"); passin, e, "Private Key");
break; break;
case KEY_PUBKEY: case KEY_PUBKEY:
pkey = load_pubkey(bio_err, keyfile, keyform, pkey = load_pubkey(bio_err, keyfile, keyform, 0,
NULL, e, "Public Key"); NULL, e, "Public Key");
break; break;
@@ -284,6 +298,7 @@ int MAIN(int argc, char **argv)
BIO_free_all(out); BIO_free_all(out);
if(rsa_in) OPENSSL_free(rsa_in); if(rsa_in) OPENSSL_free(rsa_in);
if(rsa_out) OPENSSL_free(rsa_out); if(rsa_out) OPENSSL_free(rsa_out);
if(passin) OPENSSL_free(passin);
return ret; return ret;
} }
@@ -305,7 +320,10 @@ static void usage()
BIO_printf(bio_err, "-encrypt encrypt with public key\n"); BIO_printf(bio_err, "-encrypt encrypt with public key\n");
BIO_printf(bio_err, "-decrypt decrypt with private key\n"); BIO_printf(bio_err, "-decrypt decrypt with private key\n");
BIO_printf(bio_err, "-hexdump hex dump output\n"); BIO_printf(bio_err, "-hexdump hex dump output\n");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
BIO_printf (bio_err, "-passin arg pass phrase source\n");
#endif
} }

View File

@@ -108,10 +108,19 @@
* Hudson (tjh@cryptsoft.com). * Hudson (tjh@cryptsoft.com).
* *
*/ */
#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
#include <sys/types.h> #include <sys/types.h>
#endif
#include <openssl/opensslconf.h> #include <openssl/opensslconf.h>
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
#include <conio.h>
#endif
#ifdef OPENSSL_SYS_MSDOS
#define _kbhit kbhit
#endif
#if defined(OPENSSL_SYS_VMS) && !defined(FD_SET) #if defined(OPENSSL_SYS_VMS) && !defined(FD_SET)
/* VAX C does not defined fd_set and friends, but it's actually quite simple */ /* VAX C does not defined fd_set and friends, but it's actually quite simple */
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */ /* These definitions are borrowed from SOCKETSHR. /Richard Levitte */

View File

@@ -134,7 +134,7 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
err= X509_STORE_CTX_get_error(ctx); err= X509_STORE_CTX_get_error(ctx);
depth= X509_STORE_CTX_get_error_depth(ctx); depth= X509_STORE_CTX_get_error_depth(ctx);
X509_NAME_oneline(X509_get_subject_name(err_cert),buf,256); X509_NAME_oneline(X509_get_subject_name(err_cert),buf,sizeof buf);
BIO_printf(bio_err,"depth=%d %s\n",depth,buf); BIO_printf(bio_err,"depth=%d %s\n",depth,buf);
if (!ok) if (!ok)
{ {
@@ -154,7 +154,7 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
switch (ctx->error) switch (ctx->error)
{ {
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert),buf,256); X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert),buf,sizeof buf);
BIO_printf(bio_err,"issuer= %s\n",buf); BIO_printf(bio_err,"issuer= %s\n",buf);
break; break;
case X509_V_ERR_CERT_NOT_YET_VALID: case X509_V_ERR_CERT_NOT_YET_VALID:
@@ -239,15 +239,15 @@ long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi,
if (cmd == (BIO_CB_READ|BIO_CB_RETURN)) if (cmd == (BIO_CB_READ|BIO_CB_RETURN))
{ {
BIO_printf(out,"read from %08X [%08lX] (%d bytes => %ld (0x%X))\n", BIO_printf(out,"read from %p [%p] (%d bytes => %ld (0x%lX))\n",
bio,argp,argi,ret,ret); (void *)bio,argp,argi,ret,ret);
BIO_dump(out,argp,(int)ret); BIO_dump(out,argp,(int)ret);
return(ret); return(ret);
} }
else if (cmd == (BIO_CB_WRITE|BIO_CB_RETURN)) else if (cmd == (BIO_CB_WRITE|BIO_CB_RETURN))
{ {
BIO_printf(out,"write to %08X [%08lX] (%d bytes => %ld (0x%X))\n", BIO_printf(out,"write to %p [%p] (%d bytes => %ld (0x%lX))\n",
bio,argp,argi,ret,ret); (void *)bio,argp,argi,ret,ret);
BIO_dump(out,argp,(int)ret); BIO_dump(out,argp,(int)ret);
} }
return(ret); return(ret);

View File

@@ -136,8 +136,12 @@ typedef unsigned int u_int;
#include <openssl/rand.h> #include <openssl/rand.h>
#include "s_apps.h" #include "s_apps.h"
#ifdef OPENSSL_SYS_WINDOWS #ifdef OPENSSL_SYS_WINCE
#include <conio.h> /* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
#ifdef fileno
#undef fileno
#endif
#define fileno(a) (int)_fileno(a)
#endif #endif
@@ -213,8 +217,10 @@ static void sc_usage(void)
BIO_printf(bio_err," -starttls prot - use the STARTTLS command before starting TLS\n"); BIO_printf(bio_err," -starttls prot - use the STARTTLS command before starting TLS\n");
BIO_printf(bio_err," for those protocols that support it, where\n"); BIO_printf(bio_err," for those protocols that support it, where\n");
BIO_printf(bio_err," 'prot' defines which one to assume. Currently,\n"); BIO_printf(bio_err," 'prot' defines which one to assume. Currently,\n");
BIO_printf(bio_err," only \"smtp\" is supported.\n"); BIO_printf(bio_err," only \"smtp\" and \"pop3\" are supported.\n");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n"); BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
#endif
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);
} }
@@ -241,14 +247,16 @@ int MAIN(int argc, char **argv)
int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending; int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
SSL_CTX *ctx=NULL; SSL_CTX *ctx=NULL;
int ret=1,in_init=1,i,nbio_test=0; int ret=1,in_init=1,i,nbio_test=0;
int smtp_starttls = 0; int starttls_proto = 0;
int prexit = 0, vflags = 0; int prexit = 0, vflags = 0;
SSL_METHOD *meth=NULL; SSL_METHOD *meth=NULL;
BIO *sbio; BIO *sbio;
char *inrand=NULL; char *inrand=NULL;
#ifndef OPENSSL_NO_ENGINE
char *engine_id=NULL; char *engine_id=NULL;
ENGINE *e=NULL; ENGINE *e=NULL;
#ifdef OPENSSL_SYS_WINDOWS #endif
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
struct timeval tv; struct timeval tv;
#endif #endif
@@ -403,15 +411,19 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
++argv; ++argv;
if (strcmp(*argv,"smtp") == 0) if (strcmp(*argv,"smtp") == 0)
smtp_starttls = 1; starttls_proto = 1;
else if (strcmp(*argv,"pop3") == 0)
starttls_proto = 2;
else else
goto bad; goto bad;
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine_id = *(++argv); engine_id = *(++argv);
} }
#endif
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -436,7 +448,9 @@ bad:
OpenSSL_add_ssl_algorithms(); OpenSSL_add_ssl_algorithms();
SSL_load_error_strings(); SSL_load_error_strings();
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine_id, 1); e = setup_engine(bio_err, engine_id, 1);
#endif
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
&& !RAND_status()) && !RAND_status())
@@ -571,12 +585,18 @@ re_start:
sbuf_off=0; sbuf_off=0;
/* This is an ugly hack that does a lot of assumptions */ /* This is an ugly hack that does a lot of assumptions */
if (smtp_starttls) if (starttls_proto == 1)
{ {
BIO_read(sbio,mbuf,BUFSIZZ); BIO_read(sbio,mbuf,BUFSIZZ);
BIO_printf(sbio,"STARTTLS\r\n"); BIO_printf(sbio,"STARTTLS\r\n");
BIO_read(sbio,sbuf,BUFSIZZ); BIO_read(sbio,sbuf,BUFSIZZ);
} }
if (starttls_proto == 2)
{
BIO_read(sbio,mbuf,BUFSIZZ);
BIO_printf(sbio,"STLS\r\n");
BIO_read(sbio,sbuf,BUFSIZZ);
}
for (;;) for (;;)
{ {
@@ -597,11 +617,11 @@ re_start:
print_stuff(bio_c_out,con,full_log); print_stuff(bio_c_out,con,full_log);
if (full_log > 0) full_log--; if (full_log > 0) full_log--;
if (smtp_starttls) if (starttls_proto)
{ {
BIO_printf(bio_err,"%s",mbuf); BIO_printf(bio_err,"%s",mbuf);
/* We don't need to know any more */ /* We don't need to know any more */
smtp_starttls = 0; starttls_proto = 0;
} }
if (reconnect) if (reconnect)
@@ -620,7 +640,7 @@ re_start:
if (!ssl_pending) if (!ssl_pending)
{ {
#ifndef OPENSSL_SYS_WINDOWS #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE)
if (tty_on) if (tty_on)
{ {
if (read_tty) FD_SET(fileno(stdin),&readfds); if (read_tty) FD_SET(fileno(stdin),&readfds);
@@ -647,8 +667,8 @@ re_start:
* will choke the compiler: if you do have a cast then * will choke the compiler: if you do have a cast then
* you can either go for (int *) or (void *). * you can either go for (int *) or (void *).
*/ */
#ifdef OPENSSL_SYS_WINDOWS #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
/* Under Windows we make the assumption that we can /* Under Windows/DOS we make the assumption that we can
* always write to the tty: therefore if we need to * always write to the tty: therefore if we need to
* write to the tty we just fall through. Otherwise * write to the tty we just fall through. Otherwise
* we timeout the select every second and see if there * we timeout the select every second and see if there
@@ -662,7 +682,11 @@ re_start:
tv.tv_usec = 0; tv.tv_usec = 0;
i=select(width,(void *)&readfds,(void *)&writefds, i=select(width,(void *)&readfds,(void *)&writefds,
NULL,&tv); NULL,&tv);
#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
if(!i && (!_kbhit() || !read_tty) ) continue;
#else
if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue; if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
#endif
} else i=select(width,(void *)&readfds,(void *)&writefds, } else i=select(width,(void *)&readfds,(void *)&writefds,
NULL,NULL); NULL,NULL);
} }
@@ -746,8 +770,8 @@ re_start:
goto shut; goto shut;
} }
} }
#ifdef OPENSSL_SYS_WINDOWS #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
/* Assume Windows can always write */ /* Assume Windows/DOS can always write */
else if (!ssl_pending && write_tty) else if (!ssl_pending && write_tty)
#else #else
else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds)) else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
@@ -827,8 +851,14 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
} }
} }
#ifdef OPENSSL_SYS_WINDOWS #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
else if (_kbhit())
#else
else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
#endif
#elif defined (OPENSSL_SYS_NETWARE)
else if (_kbhit())
#else #else
else if (FD_ISSET(fileno(stdin),&readfds)) else if (FD_ISSET(fileno(stdin),&readfds))
#endif #endif
@@ -892,16 +922,16 @@ 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) { memset(cbuf,0,BUFSIZZ); OPENSSL_free(cbuf); } if (cbuf != NULL) { OPENSSL_cleanse(cbuf,BUFSIZZ); OPENSSL_free(cbuf); }
if (sbuf != NULL) { memset(sbuf,0,BUFSIZZ); OPENSSL_free(sbuf); } if (sbuf != NULL) { OPENSSL_cleanse(sbuf,BUFSIZZ); OPENSSL_free(sbuf); }
if (mbuf != NULL) { memset(mbuf,0,BUFSIZZ); OPENSSL_free(mbuf); } if (mbuf != NULL) { OPENSSL_cleanse(mbuf,BUFSIZZ); OPENSSL_free(mbuf); }
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;
} }
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
@@ -916,6 +946,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
SSL_CIPHER *c; SSL_CIPHER *c;
X509_NAME *xn; X509_NAME *xn;
int j,i; int j,i;
const COMP_METHOD *comp, *expansion;
if (full) if (full)
{ {
@@ -930,10 +961,10 @@ static void print_stuff(BIO *bio, SSL *s, int full)
for (i=0; i<sk_X509_num(sk); i++) for (i=0; i<sk_X509_num(sk); i++)
{ {
X509_NAME_oneline(X509_get_subject_name( X509_NAME_oneline(X509_get_subject_name(
sk_X509_value(sk,i)),buf,BUFSIZ); sk_X509_value(sk,i)),buf,sizeof buf);
BIO_printf(bio,"%2d s:%s\n",i,buf); BIO_printf(bio,"%2d s:%s\n",i,buf);
X509_NAME_oneline(X509_get_issuer_name( X509_NAME_oneline(X509_get_issuer_name(
sk_X509_value(sk,i)),buf,BUFSIZ); sk_X509_value(sk,i)),buf,sizeof buf);
BIO_printf(bio," i:%s\n",buf); BIO_printf(bio," i:%s\n",buf);
if (c_showcerts) if (c_showcerts)
PEM_write_bio_X509(bio,sk_X509_value(sk,i)); PEM_write_bio_X509(bio,sk_X509_value(sk,i));
@@ -948,10 +979,10 @@ static void print_stuff(BIO *bio, SSL *s, int full)
if (!(c_showcerts && got_a_chain)) /* Redundant if we showed the whole chain */ if (!(c_showcerts && got_a_chain)) /* Redundant if we showed the whole chain */
PEM_write_bio_X509(bio,peer); PEM_write_bio_X509(bio,peer);
X509_NAME_oneline(X509_get_subject_name(peer), X509_NAME_oneline(X509_get_subject_name(peer),
buf,BUFSIZ); buf,sizeof buf);
BIO_printf(bio,"subject=%s\n",buf); BIO_printf(bio,"subject=%s\n",buf);
X509_NAME_oneline(X509_get_issuer_name(peer), X509_NAME_oneline(X509_get_issuer_name(peer),
buf,BUFSIZ); buf,sizeof buf);
BIO_printf(bio,"issuer=%s\n",buf); BIO_printf(bio,"issuer=%s\n",buf);
} }
else else
@@ -973,7 +1004,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
{ {
BIO_printf(bio,"---\nNo client certificate CA names sent\n"); BIO_printf(bio,"---\nNo client certificate CA names sent\n");
} }
p=SSL_get_shared_ciphers(s,buf,BUFSIZ); p=SSL_get_shared_ciphers(s,buf,sizeof buf);
if (p != NULL) if (p != NULL)
{ {
/* This works only for SSL 2. In later protocol /* This works only for SSL 2. In later protocol
@@ -1018,6 +1049,12 @@ static void print_stuff(BIO *bio, SSL *s, int full)
EVP_PKEY_bits(pktmp)); EVP_PKEY_bits(pktmp));
EVP_PKEY_free(pktmp); EVP_PKEY_free(pktmp);
} }
comp=SSL_get_current_compression(s);
expansion=SSL_get_current_expansion(s);
BIO_printf(bio,"Compression: %s\n",
comp ? SSL_COMP_get_name(comp) : "NONE");
BIO_printf(bio,"Expansion: %s\n",
expansion ? SSL_COMP_get_name(expansion) : "NONE");
SSL_SESSION_print(bio,SSL_get_session(s)); SSL_SESSION_print(bio,SSL_get_session(s));
BIO_printf(bio,"---\n"); BIO_printf(bio,"---\n");
if (peer != NULL) if (peer != NULL)

View File

@@ -108,18 +108,33 @@
* Hudson (tjh@cryptsoft.com). * Hudson (tjh@cryptsoft.com).
* *
*/ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
* ECC cipher suite support in OpenSSL originally developed by
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
* deprecated functions for openssl-internal code */
#ifdef OPENSSL_NO_DEPRECATED
#undef OPENSSL_NO_DEPRECATED
#endif
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <openssl/e_os2.h> #include <openssl/e_os2.h>
#ifdef OPENSSL_NO_STDIO #ifdef OPENSSL_NO_STDIO
#define APPS_WIN16 #define APPS_WIN16
#endif #endif
#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
#include <sys/types.h>
#endif
/* With IPv6, it looks like Digital has mixed up the proper order of /* With IPv6, it looks like Digital has mixed up the proper order of
recursive header file inclusion, resulting in the compiler complaining recursive header file inclusion, resulting in the compiler complaining
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
@@ -140,8 +155,12 @@ typedef unsigned int u_int;
#include <openssl/rand.h> #include <openssl/rand.h>
#include "s_apps.h" #include "s_apps.h"
#ifdef OPENSSL_SYS_WINDOWS #ifdef OPENSSL_SYS_WINCE
#include <conio.h> /* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
#ifdef fileno
#undef fileno
#endif
#define fileno(a) (int)_fileno(a)
#endif #endif
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000) #if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
@@ -164,6 +183,7 @@ static int generate_session_id(const SSL *ssl, unsigned char *id,
static DH *load_dh_param(char *dhfile); static DH *load_dh_param(char *dhfile);
static DH *get_dh512(void); static DH *get_dh512(void);
#endif #endif
#ifdef MONOLITH #ifdef MONOLITH
static void s_server_init(void); static void s_server_init(void);
#endif #endif
@@ -202,6 +222,7 @@ static DH *get_dh512(void)
} }
#endif #endif
/* static int load_CA(SSL_CTX *ctx, char *file);*/ /* static int load_CA(SSL_CTX *ctx, char *file);*/
#undef BUFSIZZ #undef BUFSIZZ
@@ -234,7 +255,9 @@ static int s_msg=0;
static int s_quiet=0; static int s_quiet=0;
static int hack=0; static int hack=0;
#ifndef OPENSSL_NO_ENGINE
static char *engine_id=NULL; static char *engine_id=NULL;
#endif
static const char *session_id_prefix=NULL; static const char *session_id_prefix=NULL;
#ifdef MONOLITH #ifdef MONOLITH
@@ -259,7 +282,9 @@ static void s_server_init(void)
s_msg=0; s_msg=0;
s_quiet=0; s_quiet=0;
hack=0; hack=0;
#ifndef OPENSSL_NO_ENGINE
engine_id=NULL; engine_id=NULL;
#endif
} }
#endif #endif
@@ -279,6 +304,11 @@ static void sv_usage(void)
BIO_printf(bio_err," -dkey arg - second private key file to use (usually for DSA)\n"); BIO_printf(bio_err," -dkey arg - second private key file to use (usually for DSA)\n");
BIO_printf(bio_err," -dhparam arg - DH parameter file to use, in cert file if not specified\n"); BIO_printf(bio_err," -dhparam arg - DH parameter file to use, in cert file if not specified\n");
BIO_printf(bio_err," or a default set of parameters is used\n"); BIO_printf(bio_err," or a default set of parameters is used\n");
#ifndef OPENSSL_NO_ECDH
BIO_printf(bio_err," -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" \
" Use \"openssl ecparam -list_curves\" for all names\n" \
" (default is sect163r2).\n");
#endif
#ifdef FIONBIO #ifdef FIONBIO
BIO_printf(bio_err," -nbio - Run with non-blocking IO\n"); BIO_printf(bio_err," -nbio - Run with non-blocking IO\n");
#endif #endif
@@ -302,13 +332,18 @@ static void sv_usage(void)
BIO_printf(bio_err," -no_tls1 - Just disable TLSv1\n"); BIO_printf(bio_err," -no_tls1 - Just disable TLSv1\n");
#ifndef OPENSSL_NO_DH #ifndef OPENSSL_NO_DH
BIO_printf(bio_err," -no_dhe - Disable ephemeral DH\n"); BIO_printf(bio_err," -no_dhe - Disable ephemeral DH\n");
#endif
#ifndef OPENSSL_NO_ECDH
BIO_printf(bio_err," -no_ecdhe - Disable ephemeral ECDH\n");
#endif #endif
BIO_printf(bio_err," -bugs - Turn on SSL bug compatibility\n"); BIO_printf(bio_err," -bugs - Turn on SSL bug compatibility\n");
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," -HTTP - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n"); BIO_printf(bio_err," -HTTP - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
BIO_printf(bio_err," with the assumption it contains a complete HTTP response.\n"); BIO_printf(bio_err," with the assumption it contains a complete HTTP response.\n");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n"); BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
#endif
BIO_printf(bio_err," -id_prefix arg - Generate SSL/TLS session IDs prefixed by 'arg'\n"); BIO_printf(bio_err," -id_prefix arg - Generate SSL/TLS session IDs prefixed by 'arg'\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);
} }
@@ -320,10 +355,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, char *in, int inl); static int ebcdic_write(BIO *b, const char *in, int inl);
static long ebcdic_ctrl(BIO *b, int cmd, long num, char *ptr); 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);
static int ebcdic_puts(BIO *bp, char *str); static int ebcdic_puts(BIO *bp, const 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=
@@ -388,7 +423,7 @@ static int ebcdic_read(BIO *b, char *out, int outl)
return(ret); return(ret);
} }
static int ebcdic_write(BIO *b, char *in, int inl) static int ebcdic_write(BIO *b, const char *in, int inl)
{ {
EBCDIC_OUTBUFF *wbuf; EBCDIC_OUTBUFF *wbuf;
int ret=0; int ret=0;
@@ -421,7 +456,7 @@ static int ebcdic_write(BIO *b, char *in, int inl)
return(ret); return(ret);
} }
static long ebcdic_ctrl(BIO *b, int cmd, long num, char *ptr) static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr)
{ {
long ret; long ret;
@@ -440,7 +475,7 @@ 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)
{ {
int i, ret; int i, ret=0;
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)
@@ -459,7 +494,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, char *str) static int ebcdic_puts(BIO *bp, const 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));
@@ -476,13 +511,16 @@ int MAIN(int argc, char *argv[])
char *CApath=NULL,*CAfile=NULL; char *CApath=NULL,*CAfile=NULL;
char *context = NULL; char *context = NULL;
char *dhfile = NULL; char *dhfile = NULL;
char *named_curve = NULL;
int badop=0,bugs=0; int badop=0,bugs=0;
int ret=1; int ret=1;
int off=0; int off=0;
int no_tmp_rsa=0,no_dhe=0,nocert=0; int no_tmp_rsa=0,no_dhe=0,no_ecdhe=0,nocert=0;
int state=0; int state=0;
SSL_METHOD *meth=NULL; SSL_METHOD *meth=NULL;
#ifndef OPENSSL_NO_ENGINE
ENGINE *e=NULL; ENGINE *e=NULL;
#endif
char *inrand=NULL; char *inrand=NULL;
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
@@ -560,6 +598,13 @@ int MAIN(int argc, char *argv[])
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
dhfile = *(++argv); dhfile = *(++argv);
} }
#ifndef OPENSSL_NO_ECDH
else if (strcmp(*argv,"-named_curve") == 0)
{
if (--argc < 1) goto bad;
named_curve = *(++argv);
}
#endif
else if (strcmp(*argv,"-dcert") == 0) else if (strcmp(*argv,"-dcert") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -628,6 +673,8 @@ int MAIN(int argc, char *argv[])
{ no_tmp_rsa=1; } { no_tmp_rsa=1; }
else if (strcmp(*argv,"-no_dhe") == 0) else if (strcmp(*argv,"-no_dhe") == 0)
{ no_dhe=1; } { no_dhe=1; }
else if (strcmp(*argv,"-no_ecdhe") == 0)
{ no_ecdhe=1; }
else if (strcmp(*argv,"-www") == 0) else if (strcmp(*argv,"-www") == 0)
{ www=1; } { www=1; }
else if (strcmp(*argv,"-WWW") == 0) else if (strcmp(*argv,"-WWW") == 0)
@@ -657,11 +704,13 @@ int MAIN(int argc, char *argv[])
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
session_id_prefix = *(++argv); session_id_prefix = *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine_id= *(++argv); engine_id= *(++argv);
} }
#endif
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -686,7 +735,9 @@ bad:
SSL_load_error_strings(); SSL_load_error_strings();
OpenSSL_add_ssl_algorithms(); OpenSSL_add_ssl_algorithms();
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine_id, 1); e = setup_engine(bio_err, engine_id, 1);
#endif
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
&& !RAND_status()) && !RAND_status())
@@ -798,6 +849,59 @@ bad:
DH_free(dh); DH_free(dh);
} }
#endif #endif
#ifndef OPENSSL_NO_ECDH
if (!no_ecdhe)
{
EC_KEY *ecdh=NULL;
ecdh = EC_KEY_new();
if (ecdh == NULL)
{
BIO_printf(bio_err,"Could not create ECDH struct.\n");
goto end;
}
if (named_curve)
{
int nid = OBJ_sn2nid(named_curve);
if (nid == 0)
{
BIO_printf(bio_err, "unknown curve name (%s)\n",
named_curve);
goto end;
}
ecdh->group = EC_GROUP_new_by_nid(nid);
if (ecdh->group == NULL)
{
BIO_printf(bio_err, "unable to create curve (%s)\n",
named_curve);
goto end;
}
}
if (ecdh->group != NULL)
{
BIO_printf(bio_s_out,"Setting temp ECDH parameters\n");
}
else
{
BIO_printf(bio_s_out,"Using default temp ECDH parameters\n");
ecdh->group=EC_GROUP_new_by_nid(NID_sect163r2);
if (ecdh->group == NULL)
{
BIO_printf(bio_err, "unable to create curve (sect163r2)\n");
goto end;
}
}
(void)BIO_flush(bio_s_out);
SSL_CTX_set_tmp_ecdh(ctx,ecdh);
EC_KEY_free(ecdh);
}
#endif
if (!set_cert_stuff(ctx,s_cert_file,s_key_file)) if (!set_cert_stuff(ctx,s_cert_file,s_key_file))
goto end; goto end;
@@ -860,30 +964,30 @@ end:
bio_s_out=NULL; bio_s_out=NULL;
} }
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx) static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
{ {
BIO_printf(bio,"%4ld items in the session cache\n", BIO_printf(bio,"%4ld items in the session cache\n",
SSL_CTX_sess_number(ssl_ctx)); SSL_CTX_sess_number(ssl_ctx));
BIO_printf(bio,"%4d client connects (SSL_connect())\n", BIO_printf(bio,"%4ld client connects (SSL_connect())\n",
SSL_CTX_sess_connect(ssl_ctx)); SSL_CTX_sess_connect(ssl_ctx));
BIO_printf(bio,"%4d client renegotiates (SSL_connect())\n", BIO_printf(bio,"%4ld client renegotiates (SSL_connect())\n",
SSL_CTX_sess_connect_renegotiate(ssl_ctx)); SSL_CTX_sess_connect_renegotiate(ssl_ctx));
BIO_printf(bio,"%4d client connects that finished\n", BIO_printf(bio,"%4ld client connects that finished\n",
SSL_CTX_sess_connect_good(ssl_ctx)); SSL_CTX_sess_connect_good(ssl_ctx));
BIO_printf(bio,"%4d server accepts (SSL_accept())\n", BIO_printf(bio,"%4ld server accepts (SSL_accept())\n",
SSL_CTX_sess_accept(ssl_ctx)); SSL_CTX_sess_accept(ssl_ctx));
BIO_printf(bio,"%4d server renegotiates (SSL_accept())\n", BIO_printf(bio,"%4ld server renegotiates (SSL_accept())\n",
SSL_CTX_sess_accept_renegotiate(ssl_ctx)); SSL_CTX_sess_accept_renegotiate(ssl_ctx));
BIO_printf(bio,"%4d server accepts that finished\n", BIO_printf(bio,"%4ld server accepts that finished\n",
SSL_CTX_sess_accept_good(ssl_ctx)); SSL_CTX_sess_accept_good(ssl_ctx));
BIO_printf(bio,"%4d session cache hits\n",SSL_CTX_sess_hits(ssl_ctx)); BIO_printf(bio,"%4ld session cache hits\n",SSL_CTX_sess_hits(ssl_ctx));
BIO_printf(bio,"%4d session cache misses\n",SSL_CTX_sess_misses(ssl_ctx)); BIO_printf(bio,"%4ld session cache misses\n",SSL_CTX_sess_misses(ssl_ctx));
BIO_printf(bio,"%4d session cache timeouts\n",SSL_CTX_sess_timeouts(ssl_ctx)); BIO_printf(bio,"%4ld session cache timeouts\n",SSL_CTX_sess_timeouts(ssl_ctx));
BIO_printf(bio,"%4d callback cache hits\n",SSL_CTX_sess_cb_hits(ssl_ctx)); BIO_printf(bio,"%4ld callback cache hits\n",SSL_CTX_sess_cb_hits(ssl_ctx));
BIO_printf(bio,"%4d cache full overflows (%d allowed)\n", BIO_printf(bio,"%4ld cache full overflows (%ld allowed)\n",
SSL_CTX_sess_cache_full(ssl_ctx), SSL_CTX_sess_cache_full(ssl_ctx),
SSL_CTX_sess_get_cache_size(ssl_ctx)); SSL_CTX_sess_get_cache_size(ssl_ctx));
} }
@@ -897,7 +1001,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
unsigned long l; unsigned long l;
SSL *con=NULL; SSL *con=NULL;
BIO *sbio; BIO *sbio;
#ifdef OPENSSL_SYS_WINDOWS #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
struct timeval tv; struct timeval tv;
#endif #endif
@@ -971,7 +1075,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
if (!read_from_sslcon) if (!read_from_sslcon)
{ {
FD_ZERO(&readfds); FD_ZERO(&readfds);
#ifndef OPENSSL_SYS_WINDOWS #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE)
FD_SET(fileno(stdin),&readfds); FD_SET(fileno(stdin),&readfds);
#endif #endif
FD_SET(s,&readfds); FD_SET(s,&readfds);
@@ -981,8 +1085,8 @@ static int sv_body(char *hostname, int s, unsigned char *context)
* the compiler: if you do have a cast then you can either * the compiler: if you do have a cast then you can either
* go for (int *) or (void *). * go for (int *) or (void *).
*/ */
#ifdef OPENSSL_SYS_WINDOWS #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
/* Under Windows we can't select on stdin: only /* Under DOS (non-djgpp) and Windows we can't select on stdin: only
* on sockets. As a workaround we timeout the select every * on sockets. As a workaround we timeout the select every
* second and check for any keypress. In a proper Windows * second and check for any keypress. In a proper Windows
* application we wouldn't do this because it is inefficient. * application we wouldn't do this because it is inefficient.
@@ -1176,7 +1280,7 @@ err:
BIO_printf(bio_s_out,"CONNECTION CLOSED\n"); BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
if (buf != NULL) if (buf != NULL)
{ {
memset(buf,0,bufsize); OPENSSL_cleanse(buf,bufsize);
OPENSSL_free(buf); OPENSSL_free(buf);
} }
if (ret >= 0) if (ret >= 0)
@@ -1228,14 +1332,14 @@ static int init_ssl_connection(SSL *con)
{ {
BIO_printf(bio_s_out,"Client certificate\n"); BIO_printf(bio_s_out,"Client certificate\n");
PEM_write_bio_X509(bio_s_out,peer); PEM_write_bio_X509(bio_s_out,peer);
X509_NAME_oneline(X509_get_subject_name(peer),buf,BUFSIZ); X509_NAME_oneline(X509_get_subject_name(peer),buf,sizeof buf);
BIO_printf(bio_s_out,"subject=%s\n",buf); BIO_printf(bio_s_out,"subject=%s\n",buf);
X509_NAME_oneline(X509_get_issuer_name(peer),buf,BUFSIZ); X509_NAME_oneline(X509_get_issuer_name(peer),buf,sizeof buf);
BIO_printf(bio_s_out,"issuer=%s\n",buf); BIO_printf(bio_s_out,"issuer=%s\n",buf);
X509_free(peer); X509_free(peer);
} }
if (SSL_get_shared_ciphers(con,buf,BUFSIZ) != NULL) if (SSL_get_shared_ciphers(con,buf,sizeof buf) != NULL)
BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf); BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf);
str=SSL_CIPHER_get_name(SSL_get_current_cipher(con)); str=SSL_CIPHER_get_name(SSL_get_current_cipher(con));
BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)"); BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)");
@@ -1243,7 +1347,13 @@ static int init_ssl_connection(SSL *con)
if (SSL_ctrl(con,SSL_CTRL_GET_FLAGS,0,NULL) & if (SSL_ctrl(con,SSL_CTRL_GET_FLAGS,0,NULL) &
TLS1_FLAGS_TLS_PADDING_BUG) TLS1_FLAGS_TLS_PADDING_BUG)
BIO_printf(bio_s_out,"Peer has incorrect TLSv1 block padding\n"); BIO_printf(bio_s_out,"Peer has incorrect TLSv1 block padding\n");
#ifndef OPENSSL_NO_KRB5
if (con->kssl_ctx->client_princ != NULL)
{
BIO_printf(bio_s_out,"Kerberos peer principal is %s\n",
con->kssl_ctx->client_princ);
}
#endif /* OPENSSL_NO_KRB5 */
return(1); return(1);
} }
@@ -1395,7 +1505,9 @@ 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");
#ifndef OPENSSL_SYS_MSDOS #if defined(OPENSSL_SYS_NETWARE)
delay(1000);
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
sleep(1); sleep(1);
#endif #endif
continue; continue;
@@ -1679,7 +1791,12 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength); BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength);
(void)BIO_flush(bio_err); (void)BIO_flush(bio_err);
} }
rsa_tmp=RSA_generate_key(keylength,RSA_F4,NULL,NULL); if(((rsa_tmp = RSA_new()) == NULL) || !RSA_generate_key_ex(
rsa_tmp, keylength,RSA_F4,NULL))
{
if(rsa_tmp) RSA_free(rsa_tmp);
rsa_tmp = NULL;
}
if (!s_quiet) if (!s_quiet)
{ {
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");

View File

@@ -62,8 +62,6 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <openssl/e_os2.h>
/* With IPv6, it looks like Digital has mixed up the proper order of /* With IPv6, it looks like Digital has mixed up the proper order of
recursive header file inclusion, resulting in the compiler complaining recursive header file inclusion, resulting in the compiler complaining
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
@@ -81,11 +79,19 @@ typedef unsigned int u_int;
#include "s_apps.h" #include "s_apps.h"
#include <openssl/ssl.h> #include <openssl/ssl.h>
static struct hostent *GetHostByName(char *name); #ifdef FLAT_INC
#ifdef OPENSSL_SYS_WINDOWS #include "e_os.h"
static void sock_cleanup(void); #else
#include "../e_os.h"
#endif #endif
static int sock_init(void);
#ifndef OPENSSL_NO_SOCK
static struct hostent *GetHostByName(char *name);
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
static void ssl_sock_cleanup(void);
#endif
static int ssl_sock_init(void);
static int init_client_ip(int *sock,unsigned char ip[4], int port); static int init_client_ip(int *sock,unsigned char ip[4], int port);
static int init_server(int *sock, int port); static int init_server(int *sock, int port);
static int init_server_long(int *sock, int port,char *ip); static int init_server_long(int *sock, int port,char *ip);
@@ -98,6 +104,10 @@ static int host_ip(char *str, unsigned char ip[4]);
#define SOCKET_PROTOCOL IPPROTO_TCP #define SOCKET_PROTOCOL IPPROTO_TCP
#endif #endif
#ifdef OPENSSL_SYS_NETWARE
static int wsa_init_done=0;
#endif
#ifdef OPENSSL_SYS_WINDOWS #ifdef OPENSSL_SYS_WINDOWS
static struct WSAData wsa_state; static struct WSAData wsa_state;
static int wsa_init_done=0; static int wsa_init_done=0;
@@ -118,7 +128,7 @@ static LONG FAR PASCAL topHookProc(HWND hwnd, UINT message, WPARAM wParam,
case WM_DESTROY: case WM_DESTROY:
case WM_CLOSE: case WM_CLOSE:
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopWndProc); SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopWndProc);
sock_cleanup(); ssl_sock_cleanup();
break; break;
} }
} }
@@ -135,26 +145,43 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
#endif /* OPENSSL_SYS_WINDOWS */ #endif /* OPENSSL_SYS_WINDOWS */
#ifdef OPENSSL_SYS_WINDOWS #ifdef OPENSSL_SYS_WINDOWS
static void sock_cleanup(void) static void ssl_sock_cleanup(void)
{ {
if (wsa_init_done) if (wsa_init_done)
{ {
wsa_init_done=0; wsa_init_done=0;
#ifndef OPENSSL_SYS_WINCE
WSACancelBlockingCall(); WSACancelBlockingCall();
#endif
WSACleanup();
}
}
#elif defined(OPENSSL_SYS_NETWARE)
static void sock_cleanup(void)
{
if (wsa_init_done)
{
wsa_init_done=0;
WSACleanup(); WSACleanup();
} }
} }
#endif #endif
static int sock_init(void) static int ssl_sock_init(void)
{ {
#ifdef OPENSSL_SYS_WINDOWS #ifdef WATT32
extern int _watt_do_exit;
_watt_do_exit = 0;
dbug_init();
if (sock_init())
return (0);
#elif defined(OPENSSL_SYS_WINDOWS)
if (!wsa_init_done) if (!wsa_init_done)
{ {
int err; int err;
#ifdef SIGINT #ifdef SIGINT
signal(SIGINT,(void (*)(int))sock_cleanup); signal(SIGINT,(void (*)(int))ssl_sock_cleanup);
#endif #endif
wsa_init_done=1; wsa_init_done=1;
memset(&wsa_state,0,sizeof(wsa_state)); memset(&wsa_state,0,sizeof(wsa_state));
@@ -173,6 +200,27 @@ static int sock_init(void)
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc); SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
#endif /* OPENSSL_SYS_WIN16 */ #endif /* OPENSSL_SYS_WIN16 */
} }
#elif defined(OPENSSL_SYS_NETWARE)
WORD wVerReq;
WSADATA wsaData;
int err;
if (!wsa_init_done)
{
# ifdef SIGINT
signal(SIGINT,(void (*)(int))sock_cleanup);
# endif
wsa_init_done=1;
wVerReq = MAKEWORD( 2, 0 );
err = WSAStartup(wVerReq,&wsaData);
if (err != 0)
{
BIO_printf(bio_err,"unable to start WINSOCK2, error code=%d\n",err);
return(0);
}
}
#endif /* OPENSSL_SYS_WINDOWS */ #endif /* OPENSSL_SYS_WINDOWS */
return(1); return(1);
} }
@@ -196,7 +244,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port)
struct sockaddr_in them; struct sockaddr_in them;
int s,i; int s,i;
if (!sock_init()) return(0); if (!ssl_sock_init()) return(0);
memset((char *)&them,0,sizeof(them)); memset((char *)&them,0,sizeof(them));
them.sin_family=AF_INET; them.sin_family=AF_INET;
@@ -261,7 +309,7 @@ static int init_server_long(int *sock, int port, char *ip)
struct sockaddr_in server; struct sockaddr_in server;
int s= -1,i; int s= -1,i;
if (!sock_init()) return(0); if (!ssl_sock_init()) return(0);
memset((char *)&server,0,sizeof(server)); memset((char *)&server,0,sizeof(server));
server.sin_family=AF_INET; server.sin_family=AF_INET;
@@ -318,7 +366,7 @@ static int do_accept(int acc_sock, int *sock, char **host)
int len; int len;
/* struct linger ling; */ /* struct linger ling; */
if (!sock_init()) return(0); if (!ssl_sock_init()) return(0);
#ifndef OPENSSL_SYS_WINDOWS #ifndef OPENSSL_SYS_WINDOWS
redoit: redoit:
@@ -334,7 +382,7 @@ redoit:
ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len); ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
if (ret == INVALID_SOCKET) if (ret == INVALID_SOCKET)
{ {
#ifdef OPENSSL_SYS_WINDOWS #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
i=WSAGetLastError(); i=WSAGetLastError();
BIO_printf(bio_err,"accept error %d\n",i); BIO_printf(bio_err,"accept error %d\n",i);
#else #else
@@ -381,7 +429,7 @@ redoit:
perror("OPENSSL_malloc"); perror("OPENSSL_malloc");
return(0); return(0);
} }
strcpy(*host,h1->h_name); BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
h2=GetHostByName(*host); h2=GetHostByName(*host);
if (h2 == NULL) if (h2 == NULL)
@@ -448,7 +496,7 @@ static int host_ip(char *str, unsigned char ip[4])
{ /* do a gethostbyname */ { /* do a gethostbyname */
struct hostent *he; struct hostent *he;
if (!sock_init()) return(0); if (!ssl_sock_init()) return(0);
he=GetHostByName(str); he=GetHostByName(str);
if (he == NULL) if (he == NULL)
@@ -529,9 +577,12 @@ static struct hostent *GetHostByName(char *name)
ret=gethostbyname(name); ret=gethostbyname(name);
if (ret == NULL) return(NULL); if (ret == NULL) return(NULL);
/* else add to cache */ /* else add to cache */
strncpy(ghbn_cache[lowi].name,name,128); if(strlen(name) < sizeof ghbn_cache[0].name)
memcpy((char *)&(ghbn_cache[lowi].ent),ret,sizeof(struct hostent)); {
ghbn_cache[lowi].order=ghbn_miss+ghbn_hits; strcpy(ghbn_cache[lowi].name,name);
memcpy((char *)&(ghbn_cache[lowi].ent),ret,sizeof(struct hostent));
ghbn_cache[lowi].order=ghbn_miss+ghbn_hits;
}
return(ret); return(ret);
} }
else else
@@ -542,3 +593,5 @@ static struct hostent *GetHostByName(char *name)
return(ret); return(ret);
} }
} }
#endif

View File

@@ -85,7 +85,7 @@
#include OPENSSL_UNISTD #include OPENSSL_UNISTD
#endif #endif
#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #if !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
#define TIMES #define TIMES
#endif #endif
@@ -105,7 +105,7 @@
#undef TIMES #undef TIMES
#endif #endif
#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) #if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE)
#include <sys/timeb.h> #include <sys/timeb.h>
#endif #endif
@@ -146,6 +146,8 @@
#undef BUFSIZZ #undef BUFSIZZ
#define BUFSIZZ 1024*10 #define BUFSIZZ 1024*10
#define MYBUFSIZ 1024*8
#undef min #undef min
#undef max #undef max
#define min(a,b) (((a) < (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b))
@@ -320,6 +322,11 @@ static int parseArgs(int argc, char **argv)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
s_www_path= *(++argv); s_www_path= *(++argv);
if(strlen(s_www_path) > MYBUFSIZ-100)
{
BIO_printf(bio_err,"-www option too long\n");
badop=1;
}
} }
else if(strcmp(*argv,"-bugs") == 0) else if(strcmp(*argv,"-bugs") == 0)
st_bugs=1; st_bugs=1;
@@ -377,6 +384,20 @@ 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(OPENSSL_SYS_NETWARE)
static clock_t tstart,tend;
if (s == START)
{
tstart=clock();
return(0);
}
else
{
tend=clock();
ret=(double)((double)(tend)-(double)(tstart));
return((ret < 0.001)?0.001:ret);
}
#elif defined(OPENSSL_SYS_VXWORKS) #elif defined(OPENSSL_SYS_VXWORKS)
{ {
static unsigned long tick_start, tick_end; static unsigned long tick_start, tick_end;
@@ -480,7 +501,7 @@ int MAIN(int argc, char **argv)
tm_Time_F(START); tm_Time_F(START);
for (;;) for (;;)
{ {
if (finishtime < time(NULL)) break; if (finishtime < (long)time(NULL)) break;
#ifdef WIN32_STUFF #ifdef WIN32_STUFF
if( flushWinMsgs(0) == -1 ) if( flushWinMsgs(0) == -1 )
@@ -495,7 +516,7 @@ int MAIN(int argc, char **argv)
if (s_www_path != NULL) if (s_www_path != NULL)
{ {
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path); BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
SSL_write(scon,buf,strlen(buf)); SSL_write(scon,buf,strlen(buf));
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0) while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
bytes_read+=i; bytes_read+=i;
@@ -531,9 +552,9 @@ int MAIN(int argc, char **argv)
} }
totalTime += tm_Time_F(STOP); /* Add the time for this iteration */ totalTime += tm_Time_F(STOP); /* Add the time for this iteration */
i=(int)(time(NULL)-finishtime+maxTime); i=(int)((long)time(NULL)-finishtime+maxTime);
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read); printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,time(NULL)-finishtime+maxTime,bytes_read/nConn); printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,(long)time(NULL)-finishtime+maxTime,bytes_read/nConn);
/* Now loop and time connections using the same session id over and over */ /* Now loop and time connections using the same session id over and over */
@@ -550,7 +571,7 @@ next:
if (s_www_path != NULL) if (s_www_path != NULL)
{ {
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path); BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
SSL_write(scon,buf,strlen(buf)); SSL_write(scon,buf,strlen(buf));
while (SSL_read(scon,buf,sizeof(buf)) > 0) while (SSL_read(scon,buf,sizeof(buf)) > 0)
; ;
@@ -565,7 +586,7 @@ next:
nConn = 0; nConn = 0;
totalTime = 0.0; totalTime = 0.0;
finishtime=time(NULL)+maxTime; finishtime=(long)time(NULL)+maxTime;
printf( "starting\n" ); printf( "starting\n" );
bytes_read=0; bytes_read=0;
@@ -573,7 +594,7 @@ next:
for (;;) for (;;)
{ {
if (finishtime < time(NULL)) break; if (finishtime < (long)time(NULL)) break;
#ifdef WIN32_STUFF #ifdef WIN32_STUFF
if( flushWinMsgs(0) == -1 ) if( flushWinMsgs(0) == -1 )
@@ -588,7 +609,7 @@ next:
if (s_www_path) if (s_www_path)
{ {
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path); BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
SSL_write(scon,buf,strlen(buf)); SSL_write(scon,buf,strlen(buf));
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0) while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
bytes_read+=i; bytes_read+=i;
@@ -623,7 +644,7 @@ next:
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read); printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,time(NULL)-finishtime+maxTime,bytes_read/nConn); printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,(long)time(NULL)-finishtime+maxTime,bytes_read/nConn);
ret=0; ret=0;
end: end:
@@ -635,7 +656,7 @@ end:
tm_ctx=NULL; tm_ctx=NULL;
} }
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
/*********************************************************************** /***********************************************************************

View File

@@ -273,7 +273,7 @@ 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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static SSL_SESSION *load_sess_id(char *infile, int format) static SSL_SESSION *load_sess_id(char *infile, int format)

View File

@@ -1,9 +1,9 @@
/* smime.c */ /* smime.c */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 1999. * project.
*/ */
/* ==================================================================== /* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved. * Copyright (c) 1999-2003 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
@@ -104,7 +104,9 @@ int MAIN(int argc, char **argv)
int need_rand = 0; int need_rand = 0;
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME; int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
int keyform = FORMAT_PEM; int keyform = FORMAT_PEM;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
args = argv + 1; args = argv + 1;
ret = 1; ret = 1;
@@ -166,6 +168,10 @@ int MAIN(int argc, char **argv)
flags |= PKCS7_BINARY; flags |= PKCS7_BINARY;
else if (!strcmp (*args, "-nosigs")) else if (!strcmp (*args, "-nosigs"))
flags |= PKCS7_NOSIGS; flags |= PKCS7_NOSIGS;
else if (!strcmp (*args, "-nooldmime"))
flags |= PKCS7_NOOLDMIMETYPE;
else if (!strcmp (*args, "-crlfeol"))
flags |= PKCS7_CRLFEOL;
else if (!strcmp (*args, "-crl_check")) else if (!strcmp (*args, "-crl_check"))
store_flags |= X509_V_FLAG_CRL_CHECK; store_flags |= X509_V_FLAG_CRL_CHECK;
else if (!strcmp (*args, "-crl_check_all")) else if (!strcmp (*args, "-crl_check_all"))
@@ -176,11 +182,13 @@ int MAIN(int argc, char **argv)
inrand = *args; inrand = *args;
} else badarg = 1; } else badarg = 1;
need_rand = 1; need_rand = 1;
#ifndef OPENSSL_NO_ENGINE
} else if (!strcmp(*args,"-engine")) { } else if (!strcmp(*args,"-engine")) {
if (args[1]) { if (args[1]) {
args++; args++;
engine = *args; engine = *args;
} else badarg = 1; } else badarg = 1;
#endif
} else if (!strcmp(*args,"-passin")) { } else if (!strcmp(*args,"-passin")) {
if (args[1]) { if (args[1]) {
args++; args++;
@@ -330,7 +338,9 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-CAfile file trusted certificates file\n"); BIO_printf (bio_err, "-CAfile file trusted certificates file\n");
BIO_printf (bio_err, "-crl_check check revocation status of signer's certificate using CRLs\n"); BIO_printf (bio_err, "-crl_check check revocation status of signer's certificate using CRLs\n");
BIO_printf (bio_err, "-crl_check_all check revocation status of signer's certificate chain using CRLs\n"); BIO_printf (bio_err, "-crl_check_all check revocation status of signer's certificate chain using CRLs\n");
#ifndef OPENSSL_NO_ENGINE
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n"); BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
#endif
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");
@@ -339,7 +349,9 @@ int MAIN(int argc, char **argv)
goto end; goto end;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
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");
@@ -428,7 +440,7 @@ int MAIN(int argc, char **argv)
} else keyfile = NULL; } else keyfile = NULL;
if(keyfile) { if(keyfile) {
key = load_key(bio_err, keyfile, keyform, passin, e, key = load_key(bio_err, keyfile, keyform, 0, passin, e,
"signing key file"); "signing key file");
if (!key) { if (!key) {
goto end; goto end;
@@ -470,8 +482,14 @@ int MAIN(int argc, char **argv)
if(operation == SMIME_ENCRYPT) { if(operation == SMIME_ENCRYPT) {
p7 = PKCS7_encrypt(encerts, in, cipher, flags); p7 = PKCS7_encrypt(encerts, in, cipher, flags);
} else if(operation == SMIME_SIGN) { } else if(operation == SMIME_SIGN) {
/* If detached data and SMIME output enable partial
* signing.
*/
if ((flags & PKCS7_DETACHED) && (outformat == FORMAT_SMIME))
flags |= PKCS7_STREAM;
p7 = PKCS7_sign(signer, key, other, in, flags); p7 = PKCS7_sign(signer, key, other, in, flags);
if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) { /* Don't need to rewind for partial signing */
if (!(flags & PKCS7_STREAM) && (BIO_reset(in) != 0)) {
BIO_printf(bio_err, "Can't rewind input file\n"); BIO_printf(bio_err, "Can't rewind input file\n");
goto end; goto end;
} }

View File

@@ -55,13 +55,30 @@
* 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 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
* Portions of the attached software ("Contribution") are developed by
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
*
* The Contribution is licensed pursuant to the OpenSSL open source
* license provided above.
*
* The ECDH and ECDSA speed test software is originally written by
* Sumit Gupta of Sun Microsystems Laboratories.
*
*/
/* most of this code has been pilfered from my libdes speed.c program */ /* most of this code has been pilfered from my libdes speed.c program */
#ifndef OPENSSL_NO_SPEED
#undef SECONDS #undef SECONDS
#define SECONDS 3 #define SECONDS 3
#define RSA_SECONDS 10 #define RSA_SECONDS 10
#define DSA_SECONDS 10 #define DSA_SECONDS 10
#define ECDSA_SECONDS 10
#define ECDH_SECONDS 10
/* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */
/* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */
@@ -71,7 +88,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "apps.h" #include "apps.h"
@@ -87,6 +104,10 @@
#include OPENSSL_UNISTD #include OPENSSL_UNISTD
#endif #endif
#ifndef OPENSSL_SYS_NETWARE
#include <signal.h>
#endif
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX) #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX)
# define USE_TOD # define USE_TOD
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
@@ -96,6 +117,12 @@
# define TIMEB # define TIMEB
#endif #endif
#if defined(OPENSSL_SYS_NETWARE)
#undef TIMES
#undef TIMEB
#include <time.h>
#endif
#ifndef _IRIX #ifndef _IRIX
# include <time.h> # include <time.h>
#endif #endif
@@ -120,7 +147,7 @@
#include <sys/timeb.h> #include <sys/timeb.h>
#endif #endif
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) #if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE)
#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
@@ -184,11 +211,28 @@
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
#include "./testdsa.h" #include "./testdsa.h"
#endif #endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
#ifndef OPENSSL_NO_ECDH
#include <openssl/ecdh.h>
#endif
/*
* The following "HZ" timing stuff should be sync'd up with the code in
* crypto/tmdiff.[ch]. That appears to try to do the same job, though I think
* this code is more up to date than libcrypto's so there may be features to
* migrate over first. This is used in two places further down AFAICS.
* The point is that nothing in openssl actually *uses* that tmdiff stuff, so
* either speed.c should be using it or it should go because it's obviously not
* useful enough. Anyone want to do a janitorial job on this?
*/
/* 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
# ifdef _SC_CLK_TCK # if defined(_SC_CLK_TCK) \
# define HZ ((double)sysconf(_SC_CLK_TCK)) && (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
# define HZ sysconf(_SC_CLK_TCK)
# else # else
# ifndef CLK_TCK # ifndef CLK_TCK
# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */ # ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
@@ -202,7 +246,7 @@
# endif # endif
#endif #endif
#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) #if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
# define HAVE_FORK 1 # define HAVE_FORK 1
#endif #endif
@@ -226,6 +270,10 @@ static int do_multi(int multi);
#define SIZE_NUM 5 #define SIZE_NUM 5
#define RSA_NUM 4 #define RSA_NUM 4
#define DSA_NUM 3 #define DSA_NUM 3
#define EC_NUM 16
#define MAX_ECDH_SIZE 256
static const char *names[ALGOR_NUM]={ static const char *names[ALGOR_NUM]={
"md2","mdc2","md4","md5","hmac(md5)","sha1","rmd160","rc4", "md2","mdc2","md4","md5","hmac(md5)","sha1","rmd160","rc4",
"des cbc","des ede3","idea cbc", "des cbc","des ede3","idea cbc",
@@ -235,6 +283,9 @@ static double results[ALGOR_NUM][SIZE_NUM];
static int lengths[SIZE_NUM]={16,64,256,1024,8*1024}; static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
static double rsa_results[RSA_NUM][2]; static double rsa_results[RSA_NUM][2];
static double dsa_results[DSA_NUM][2]; static double dsa_results[DSA_NUM][2];
static double ecdsa_results[EC_NUM][2];
static double ecdh_results[EC_NUM][1];
#ifdef SIGALRM #ifdef SIGALRM
#if defined(__STDC__) || defined(sgi) || defined(_AIX) #if defined(__STDC__) || defined(sgi) || defined(_AIX)
@@ -257,13 +308,39 @@ static SIGRETTYPE sig_done(int sig)
#define START 0 #define START 0
#define STOP 1 #define STOP 1
#if defined(OPENSSL_SYS_NETWARE)
/* for NetWare the best we can do is use clock() which returns the
* time, in hundredths of a second, since the NLM began executing
*/
static double Time_F(int s)
{
double ret;
static clock_t tstart,tend;
if (s == START)
{
tstart=clock();
return(0);
}
else
{
tend=clock();
ret=(double)((double)(tend)-(double)(tstart));
return((ret < 0.001)?0.001:ret);
}
}
#else
static double Time_F(int s) static double Time_F(int s)
{ {
double ret; double ret;
#ifdef USE_TOD #ifdef USE_TOD
if(usertime) if(usertime)
{ {
static struct rusage tstart,tend; static struct rusage tstart,tend;
getrusage_used = 1; getrusage_used = 1;
@@ -318,7 +395,8 @@ static double Time_F(int s)
else else
{ {
times(&tend); times(&tend);
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ; ret = HZ;
ret=(double)(tend.tms_utime-tstart.tms_utime) / ret;
return((ret < 1e-3)?1e-3:ret); return((ret < 1e-3)?1e-3:ret);
} }
} }
@@ -364,12 +442,29 @@ static double Time_F(int s)
# endif # endif
#endif #endif
} }
#endif /* if defined(OPENSSL_SYS_NETWARE) */
static const int KDF1_SHA1_len = 20;
static void *KDF1_SHA1(void *in, size_t inlen, void *out, size_t outlen)
{
#ifndef OPENSSL_NO_SHA
if (outlen != SHA_DIGEST_LENGTH)
return NULL;
return SHA1(in, inlen, out);
#else
return NULL;
#endif
}
int MAIN(int, char **); int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL; ENGINE *e = NULL;
#endif
unsigned char *buf=NULL,*buf2=NULL; unsigned char *buf=NULL,*buf2=NULL;
int mret=1; int mret=1;
long count=0,save_count=0; long count=0,save_count=0;
@@ -477,6 +572,24 @@ int MAIN(int argc, char **argv)
#define R_RSA_1024 1 #define R_RSA_1024 1
#define R_RSA_2048 2 #define R_RSA_2048 2
#define R_RSA_4096 3 #define R_RSA_4096 3
#define R_EC_P160 0
#define R_EC_P192 1
#define R_EC_P224 2
#define R_EC_P256 3
#define R_EC_P384 4
#define R_EC_P521 5
#define R_EC_K163 6
#define R_EC_K233 7
#define R_EC_K283 8
#define R_EC_K409 9
#define R_EC_K571 10
#define R_EC_B163 11
#define R_EC_B233 12
#define R_EC_B283 13
#define R_EC_B409 14
#define R_EC_B571 15
#ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_RSA
RSA *rsa_key[RSA_NUM]; RSA *rsa_key[RSA_NUM];
long rsa_c[RSA_NUM][2]; long rsa_c[RSA_NUM][2];
@@ -492,8 +605,83 @@ int MAIN(int argc, char **argv)
long dsa_c[DSA_NUM][2]; long dsa_c[DSA_NUM][2];
static unsigned int dsa_bits[DSA_NUM]={512,1024,2048}; static unsigned int dsa_bits[DSA_NUM]={512,1024,2048};
#endif #endif
#ifndef OPENSSL_NO_EC
/* We only test over the following curves as they are representative,
* To add tests over more curves, simply add the curve NID
* and curve name to the following arrays and increase the
* EC_NUM value accordingly.
*/
static unsigned int test_curves[EC_NUM] =
{
/* Prime Curves */
NID_secp160r1,
NID_X9_62_prime192v1,
NID_secp224r1,
NID_X9_62_prime256v1,
NID_secp384r1,
NID_secp521r1,
/* Binary Curves */
NID_sect163k1,
NID_sect233k1,
NID_sect283k1,
NID_sect409k1,
NID_sect571k1,
NID_sect163r2,
NID_sect233r1,
NID_sect283r1,
NID_sect409r1,
NID_sect571r1
};
static char * test_curves_names[EC_NUM] =
{
/* Prime Curves */
"secp160r1",
"nistp192",
"nistp224",
"nistp256",
"nistp384",
"nistp521",
/* Binary Curves */
"nistk163",
"nistk233",
"nistk283",
"nistk409",
"nistk571",
"nistb163",
"nistb233",
"nistb283",
"nistb409",
"nistb571"
};
static int test_curves_bits[EC_NUM] =
{
160, 192, 224, 256, 384, 521,
163, 233, 283, 409, 571,
163, 233, 283, 409, 571
};
#endif
#ifndef OPENSSL_NO_ECDSA
unsigned char ecdsasig[256];
unsigned int ecdsasiglen;
EC_KEY *ecdsa[EC_NUM];
long ecdsa_c[EC_NUM][2];
#endif
#ifndef OPENSSL_NO_ECDH
EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM];
unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE];
int secret_size_a, secret_size_b;
int ecdh_checks = 0;
int secret_idx = 0;
long ecdh_c[EC_NUM][2];
#endif
int rsa_doit[RSA_NUM]; int rsa_doit[RSA_NUM];
int dsa_doit[DSA_NUM]; int dsa_doit[DSA_NUM];
int ecdsa_doit[EC_NUM];
int ecdh_doit[EC_NUM];
int doit[ALGOR_NUM]; int doit[ALGOR_NUM];
int pr_header=0; int pr_header=0;
const EVP_CIPHER *evp_cipher=NULL; const EVP_CIPHER *evp_cipher=NULL;
@@ -512,6 +700,17 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
memset(dsa_key,0,sizeof(dsa_key)); memset(dsa_key,0,sizeof(dsa_key));
#endif #endif
#ifndef OPENSSL_NO_ECDSA
for (i=0; i<EC_NUM; i++) ecdsa[i] = NULL;
#endif
#ifndef OPENSSL_NO_ECDH
for (i=0; i<EC_NUM; i++)
{
ecdh_a[i] = NULL;
ecdh_b[i] = NULL;
}
#endif
if (bio_err == NULL) if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL)
@@ -550,6 +749,15 @@ int MAIN(int argc, char **argv)
rsa_doit[i]=0; rsa_doit[i]=0;
for (i=0; i<DSA_NUM; i++) for (i=0; i<DSA_NUM; i++)
dsa_doit[i]=0; dsa_doit[i]=0;
#ifndef OPENSSL_NO_ECDSA
for (i=0; i<EC_NUM; i++)
ecdsa_doit[i]=0;
#endif
#ifndef OPENSSL_NO_ECDH
for (i=0; i<EC_NUM; i++)
ecdh_doit[i]=0;
#endif
j=0; j=0;
argc--; argc--;
@@ -589,6 +797,7 @@ int MAIN(int argc, char **argv)
j--; /* Otherwise, -elapsed gets confused with j--; /* Otherwise, -elapsed gets confused with
an algorithm. */ an algorithm. */
} }
#ifndef OPENSSL_NO_ENGINE
else if ((argc > 0) && (strcmp(*argv,"-engine") == 0)) else if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
{ {
argc--; argc--;
@@ -605,6 +814,7 @@ int MAIN(int argc, char **argv)
means all of them should be run) */ means all of them should be run) */
j--; j--;
} }
#endif
#ifdef HAVE_FORK #ifdef HAVE_FORK
else if ((argc > 0) && (strcmp(*argv,"-multi") == 0)) else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
{ {
@@ -766,6 +976,53 @@ int MAIN(int argc, char **argv)
{ {
dsa_doit[R_DSA_512]=1; dsa_doit[R_DSA_512]=1;
dsa_doit[R_DSA_1024]=1; dsa_doit[R_DSA_1024]=1;
dsa_doit[R_DSA_2048]=1;
}
else
#endif
#ifndef OPENSSL_NO_ECDSA
if (strcmp(*argv,"ecdsap160") == 0) ecdsa_doit[R_EC_P160]=2;
else if (strcmp(*argv,"ecdsap224") == 0) ecdsa_doit[R_EC_P224]=2;
else if (strcmp(*argv,"ecdsap256") == 0) ecdsa_doit[R_EC_P256]=2;
else if (strcmp(*argv,"ecdsap384") == 0) ecdsa_doit[R_EC_P384]=2;
else if (strcmp(*argv,"ecdsap521") == 0) ecdsa_doit[R_EC_P521]=2;
else if (strcmp(*argv,"ecdsak163") == 0) ecdsa_doit[R_EC_K163]=2;
else if (strcmp(*argv,"ecdsak233") == 0) ecdsa_doit[R_EC_K233]=2;
else if (strcmp(*argv,"ecdsak283") == 0) ecdsa_doit[R_EC_K283]=2;
else if (strcmp(*argv,"ecdsak409") == 0) ecdsa_doit[R_EC_K409]=2;
else if (strcmp(*argv,"ecdsak571") == 0) ecdsa_doit[R_EC_K571]=2;
else if (strcmp(*argv,"ecdsab163") == 0) ecdsa_doit[R_EC_B163]=2;
else if (strcmp(*argv,"ecdsab233") == 0) ecdsa_doit[R_EC_B233]=2;
else if (strcmp(*argv,"ecdsab283") == 0) ecdsa_doit[R_EC_B283]=2;
else if (strcmp(*argv,"ecdsab409") == 0) ecdsa_doit[R_EC_B409]=2;
else if (strcmp(*argv,"ecdsab571") == 0) ecdsa_doit[R_EC_B571]=2;
else if (strcmp(*argv,"ecdsa") == 0)
{
for (i=0; i < EC_NUM; i++)
ecdsa_doit[i]=1;
}
else
#endif
#ifndef OPENSSL_NO_ECDH
if (strcmp(*argv,"ecdhp160") == 0) ecdh_doit[R_EC_P160]=2;
else if (strcmp(*argv,"ecdhp224") == 0) ecdh_doit[R_EC_P224]=2;
else if (strcmp(*argv,"ecdhp256") == 0) ecdh_doit[R_EC_P256]=2;
else if (strcmp(*argv,"ecdhp384") == 0) ecdh_doit[R_EC_P384]=2;
else if (strcmp(*argv,"ecdhp521") == 0) ecdh_doit[R_EC_P521]=2;
else if (strcmp(*argv,"ecdhk163") == 0) ecdh_doit[R_EC_K163]=2;
else if (strcmp(*argv,"ecdhk233") == 0) ecdh_doit[R_EC_K233]=2;
else if (strcmp(*argv,"ecdhk283") == 0) ecdh_doit[R_EC_K283]=2;
else if (strcmp(*argv,"ecdhk409") == 0) ecdh_doit[R_EC_K409]=2;
else if (strcmp(*argv,"ecdhk571") == 0) ecdh_doit[R_EC_K571]=2;
else if (strcmp(*argv,"ecdhb163") == 0) ecdh_doit[R_EC_B163]=2;
else if (strcmp(*argv,"ecdhb233") == 0) ecdh_doit[R_EC_B233]=2;
else if (strcmp(*argv,"ecdhb283") == 0) ecdh_doit[R_EC_B283]=2;
else if (strcmp(*argv,"ecdhb409") == 0) ecdh_doit[R_EC_B409]=2;
else if (strcmp(*argv,"ecdhb571") == 0) ecdh_doit[R_EC_B571]=2;
else if (strcmp(*argv,"ecdh") == 0)
{
for (i=0; i < EC_NUM; i++)
ecdh_doit[i]=1;
} }
else else
#endif #endif
@@ -834,6 +1091,18 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
BIO_printf(bio_err,"dsa512 dsa1024 dsa2048\n"); BIO_printf(bio_err,"dsa512 dsa1024 dsa2048\n");
#endif #endif
#ifndef OPENSSL_NO_ECDSA
BIO_printf(bio_err,"ecdsap160 ecdsap224 ecdsap256 ecdsap384 ecdsap521\n");
BIO_printf(bio_err,"ecdsak163 ecdsak233 ecdsak283 ecdsak409 ecdsak571\n");
BIO_printf(bio_err,"ecdsab163 ecdsab233 ecdsab283 ecdsab409 ecdsab571\n");
BIO_printf(bio_err,"ecdsa\n");
#endif
#ifndef OPENSSL_NO_ECDH
BIO_printf(bio_err,"ecdhp160 ecdhp224 ecdhp256 ecdhp384 ecdhp521\n");
BIO_printf(bio_err,"ecdhk163 ecdhk233 ecdhk283 ecdhk409 ecdhk571\n");
BIO_printf(bio_err,"ecdhb163 ecdhb233 ecdhb283 ecdhb409 ecdhb571\n");
BIO_printf(bio_err,"ecdh\n");
#endif
#ifndef OPENSSL_NO_IDEA #ifndef OPENSSL_NO_IDEA
BIO_printf(bio_err,"idea "); BIO_printf(bio_err,"idea ");
@@ -861,10 +1130,12 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
BIO_printf(bio_err,"Available options:\n"); BIO_printf(bio_err,"Available options:\n");
#ifdef TIMES #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
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
#endif
BIO_printf(bio_err,"-evp e use EVP e.\n"); BIO_printf(bio_err,"-evp e use EVP e.\n");
BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n"); BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n");
BIO_printf(bio_err,"-mr produce machine readable output.\n"); BIO_printf(bio_err,"-mr produce machine readable output.\n");
@@ -997,6 +1268,9 @@ int MAIN(int argc, char **argv)
c[D_CBC_RC5][0]=count; c[D_CBC_RC5][0]=count;
c[D_CBC_BF][0]=count; c[D_CBC_BF][0]=count;
c[D_CBC_CAST][0]=count; c[D_CBC_CAST][0]=count;
c[D_CBC_128_AES][0]=count;
c[D_CBC_192_AES][0]=count;
c[D_CBC_256_AES][0]=count;
for (i=1; i<SIZE_NUM; i++) for (i=1; i<SIZE_NUM; i++)
{ {
@@ -1022,6 +1296,9 @@ int MAIN(int argc, char **argv)
c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1; c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;
c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1; c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1; c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;
c[D_CBC_128_AES][i]=c[D_CBC_128_AES][i-1]*l0/l1;
c[D_CBC_192_AES][i]=c[D_CBC_192_AES][i-1]*l0/l1;
c[D_CBC_256_AES][i]=c[D_CBC_256_AES][i-1]*l0/l1;
} }
#ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_RSA
rsa_c[R_RSA_512][0]=count/2000; rsa_c[R_RSA_512][0]=count/2000;
@@ -1063,6 +1340,114 @@ int MAIN(int argc, char **argv)
} }
#endif #endif
#ifndef OPENSSL_NO_ECDSA
ecdsa_c[R_EC_P160][0]=count/1000;
ecdsa_c[R_EC_P160][1]=count/1000/2;
for (i=R_EC_P224; i<=R_EC_P521; i++)
{
ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
ecdsa_doit[i]=0;
else
{
if (ecdsa_c[i] == 0)
{
ecdsa_c[i][0]=1;
ecdsa_c[i][1]=1;
}
}
}
ecdsa_c[R_EC_K163][0]=count/1000;
ecdsa_c[R_EC_K163][1]=count/1000/2;
for (i=R_EC_K233; i<=R_EC_K571; i++)
{
ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
ecdsa_doit[i]=0;
else
{
if (ecdsa_c[i] == 0)
{
ecdsa_c[i][0]=1;
ecdsa_c[i][1]=1;
}
}
}
ecdsa_c[R_EC_B163][0]=count/1000;
ecdsa_c[R_EC_B163][1]=count/1000/2;
for (i=R_EC_B233; i<=R_EC_B571; i++)
{
ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
ecdsa_doit[i]=0;
else
{
if (ecdsa_c[i] == 0)
{
ecdsa_c[i][0]=1;
ecdsa_c[i][1]=1;
}
}
}
#endif
#ifndef OPENSSL_NO_ECDH
ecdh_c[R_EC_P160][0]=count/1000;
ecdh_c[R_EC_P160][1]=count/1000;
for (i=R_EC_P224; i<=R_EC_P521; i++)
{
ecdh_c[i][0]=ecdh_c[i-1][0]/2;
ecdh_c[i][1]=ecdh_c[i-1][1]/2;
if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
ecdh_doit[i]=0;
else
{
if (ecdh_c[i] == 0)
{
ecdh_c[i][0]=1;
ecdh_c[i][1]=1;
}
}
}
ecdh_c[R_EC_K163][0]=count/1000;
ecdh_c[R_EC_K163][1]=count/1000;
for (i=R_EC_K233; i<=R_EC_K571; i++)
{
ecdh_c[i][0]=ecdh_c[i-1][0]/2;
ecdh_c[i][1]=ecdh_c[i-1][1]/2;
if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
ecdh_doit[i]=0;
else
{
if (ecdh_c[i] == 0)
{
ecdh_c[i][0]=1;
ecdh_c[i][1]=1;
}
}
}
ecdh_c[R_EC_B163][0]=count/1000;
ecdh_c[R_EC_B163][1]=count/1000;
for (i=R_EC_B233; i<=R_EC_B571; i++)
{
ecdh_c[i][0]=ecdh_c[i-1][0]/2;
ecdh_c[i][1]=ecdh_c[i-1][1]/2;
if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
ecdh_doit[i]=0;
else
{
if (ecdh_c[i] == 0)
{
ecdh_c[i][0]=1;
ecdh_c[i][1]=1;
}
}
}
#endif
#define COND(d) (count < (d)) #define COND(d) (count < (d))
#define COUNT(d) (d) #define COUNT(d) (d)
#else #else
@@ -1392,6 +1777,7 @@ int MAIN(int argc, char **argv)
else else
EVP_EncryptFinal_ex(&ctx,buf,&outl); EVP_EncryptFinal_ex(&ctx,buf,&outl);
d=Time_F(STOP); d=Time_F(STOP);
EVP_CIPHER_CTX_cleanup(&ctx);
} }
if (evp_md) if (evp_md)
{ {
@@ -1587,6 +1973,239 @@ int MAIN(int argc, char **argv)
} }
if (rnd_fake) RAND_cleanup(); if (rnd_fake) RAND_cleanup();
#endif #endif
#ifndef OPENSSL_NO_ECDSA
if (RAND_status() != 1)
{
RAND_seed(rnd_seed, sizeof rnd_seed);
rnd_fake = 1;
}
for (j=0; j<EC_NUM; j++)
{
int ret;
if (!ecdsa_doit[j]) continue; /* Ignore Curve */
ecdsa[j] = EC_KEY_new();
if (ecdsa[j] == NULL)
{
BIO_printf(bio_err,"ECDSA failure.\n");
ERR_print_errors(bio_err);
rsa_count=1;
}
else
{
ecdsa[j]->group = EC_GROUP_new_by_nid(test_curves[j]);
/* Could not obtain group information */
if (ecdsa[j]->group == NULL)
{
BIO_printf(bio_err,"ECDSA failure.Could not obtain group information\n");
ERR_print_errors(bio_err);
rsa_count=1;
}
else
{
#if 1
EC_GROUP_precompute_mult(ecdsa[j]->group, NULL);
#endif
/* Perform ECDSA signature test */
EC_KEY_generate_key(ecdsa[j]);
ret = ECDSA_sign(0, buf, 20, ecdsasig,
&ecdsasiglen, ecdsa[j]);
if (ret == 0)
{
BIO_printf(bio_err,"ECDSA sign failure. No ECDSA sign will be done.\n");
ERR_print_errors(bio_err);
rsa_count=1;
}
else
{
pkey_print_message("sign","ecdsa",
ecdsa_c[j][0],
test_curves_bits[j],
ECDSA_SECONDS);
Time_F(START);
for (count=0,run=1; COND(ecdsa_c[j][0]);
count++)
{
ret=ECDSA_sign(0, buf, 20,
ecdsasig, &ecdsasiglen,
ecdsa[j]);
if (ret == 0)
{
BIO_printf(bio_err, "ECDSA sign failure\n");
ERR_print_errors(bio_err);
count=1;
break;
}
}
d=Time_F(STOP);
BIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\n" :
"%ld %d bit ECDSA signs in %.2fs \n",
count, test_curves_bits[j], d);
ecdsa_results[j][0]=d/(double)count;
rsa_count=count;
}
/* Perform ECDSA verification test */
ret=ECDSA_verify(0, buf, 20, ecdsasig,
ecdsasiglen, ecdsa[j]);
if (ret != 1)
{
BIO_printf(bio_err,"ECDSA verify failure. No ECDSA verify will be done.\n");
ERR_print_errors(bio_err);
ecdsa_doit[j] = 0;
}
else
{
pkey_print_message("verify","ecdsa",
ecdsa_c[j][1],
test_curves_bits[j],
ECDSA_SECONDS);
Time_F(START);
for (count=0,run=1; COND(ecdsa_c[j][1]); count++)
{
ret=ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]);
if (ret != 1)
{
BIO_printf(bio_err, "ECDSA verify failure\n");
ERR_print_errors(bio_err);
count=1;
break;
}
}
d=Time_F(STOP);
BIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\n"
: "%ld %d bit ECDSA verify in %.2fs\n",
count, test_curves_bits[j], d);
ecdsa_results[j][1]=d/(double)count;
}
if (rsa_count <= 1)
{
/* if longer than 10s, don't do any more */
for (j++; j<EC_NUM; j++)
ecdsa_doit[j]=0;
}
}
}
}
if (rnd_fake) RAND_cleanup();
#endif
#ifndef OPENSSL_NO_ECDH
if (RAND_status() != 1)
{
RAND_seed(rnd_seed, sizeof rnd_seed);
rnd_fake = 1;
}
for (j=0; j<EC_NUM; j++)
{
if (!ecdh_doit[j]) continue;
ecdh_a[j] = EC_KEY_new();
ecdh_b[j] = EC_KEY_new();
if ((ecdh_a[j] == NULL) || (ecdh_b[j] == NULL))
{
BIO_printf(bio_err,"ECDH failure.\n");
ERR_print_errors(bio_err);
rsa_count=1;
}
else
{
ecdh_a[j]->group = EC_GROUP_new_by_nid(test_curves[j]);
if (ecdh_a[j]->group == NULL)
{
BIO_printf(bio_err,"ECDH failure.\n");
ERR_print_errors(bio_err);
rsa_count=1;
}
else
{
ecdh_b[j]->group = EC_GROUP_dup(ecdh_a[j]->group);
/* generate two ECDH key pairs */
if (!EC_KEY_generate_key(ecdh_a[j]) ||
!EC_KEY_generate_key(ecdh_b[j]))
{
BIO_printf(bio_err,"ECDH key generation failure.\n");
ERR_print_errors(bio_err);
rsa_count=1;
}
else
{
/* If field size is not more than 24 octets, then use SHA-1 hash of result;
* otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt).
*/
int field_size, outlen;
void *(*kdf)(void *in, size_t inlen, void *out, size_t xoutlen);
field_size = EC_GROUP_get_degree(ecdh_a[j]->group);
if (field_size <= 24 * 8)
{
outlen = KDF1_SHA1_len;
kdf = KDF1_SHA1;
}
else
{
outlen = (field_size+7)/8;
kdf = NULL;
}
secret_size_a = ECDH_compute_key(secret_a, outlen,
ecdh_b[j]->pub_key,
ecdh_a[j], kdf);
secret_size_b = ECDH_compute_key(secret_b, outlen,
ecdh_a[j]->pub_key,
ecdh_b[j], kdf);
if (secret_size_a != secret_size_b)
ecdh_checks = 0;
else
ecdh_checks = 1;
for (secret_idx = 0;
(secret_idx < secret_size_a)
&& (ecdh_checks == 1);
secret_idx++)
{
if (secret_a[secret_idx] != secret_b[secret_idx])
ecdh_checks = 0;
}
if (ecdh_checks == 0)
{
BIO_printf(bio_err,"ECDH computations don't match.\n");
ERR_print_errors(bio_err);
rsa_count=1;
}
pkey_print_message("","ecdh",
ecdh_c[j][0],
test_curves_bits[j],
ECDH_SECONDS);
Time_F(START);
for (count=0,run=1; COND(ecdh_c[j][0]); count++)
{
ECDH_compute_key(secret_a, outlen,
ecdh_b[j]->pub_key,
ecdh_a[j], kdf);
}
d=Time_F(STOP);
BIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\n" :"%ld %d-bit ECDH ops in %.2fs\n",
count, test_curves_bits[j], d);
ecdh_results[j][0]=d/(double)count;
rsa_count=count;
}
}
}
if (rsa_count <= 1)
{
/* if longer than 10s, don't do any more */
for (j++; j<EC_NUM; j++)
ecdh_doit[j]=0;
}
}
if (rnd_fake) RAND_cleanup();
#endif
#ifdef HAVE_FORK #ifdef HAVE_FORK
show_res: show_res:
#endif #endif
@@ -1627,7 +2246,10 @@ show_res:
#endif #endif
#ifdef HZ #ifdef HZ
#define as_string(s) (#s) #define as_string(s) (#s)
printf("HZ=%g", (double)HZ); {
double dbl = HZ;
printf("HZ=%g", dbl);
}
# ifdef _SC_CLK_TCK # ifdef _SC_CLK_TCK
printf(" [sysconf value]"); printf(" [sysconf value]");
# endif # endif
@@ -1712,7 +2334,57 @@ show_res:
1.0/dsa_results[k][0],1.0/dsa_results[k][1]); 1.0/dsa_results[k][0],1.0/dsa_results[k][1]);
} }
#endif #endif
#ifndef OPENSSL_NO_ECDSA
j=1;
for (k=0; k<EC_NUM; k++)
{
if (!ecdsa_doit[k]) continue;
if (j && !mr)
{
printf("%30ssign verify sign/s verify/s\n"," ");
j=0;
}
if (mr)
fprintf(stdout,"+F4:%u:%u:%f:%f\n",
k, test_curves_bits[k],
ecdsa_results[k][0],ecdsa_results[k][1]);
else
fprintf(stdout,
"%4u bit ecdsa (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
test_curves_bits[k],
test_curves_names[k],
ecdsa_results[k][0],ecdsa_results[k][1],
1.0/ecdsa_results[k][0],1.0/ecdsa_results[k][1]);
}
#endif
#ifndef OPENSSL_NO_ECDH
j=1;
for (k=0; k<EC_NUM; k++)
{
if (!ecdh_doit[k]) continue;
if (j && !mr)
{
printf("%30sop op/s\n"," ");
j=0;
}
if (mr)
fprintf(stdout,"+F5:%u:%u:%f:%f\n",
k, test_curves_bits[k],
ecdh_results[k][0], 1.0/ecdh_results[k][0]);
else
fprintf(stdout,"%4u bit ecdh (%s) %8.4fs %8.1f\n",
test_curves_bits[k],
test_curves_names[k],
ecdh_results[k][0], 1.0/ecdh_results[k][0]);
}
#endif
mret=0; mret=0;
end: end:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
if (buf != NULL) OPENSSL_free(buf); if (buf != NULL) OPENSSL_free(buf);
@@ -1727,8 +2399,24 @@ end:
if (dsa_key[i] != NULL) if (dsa_key[i] != NULL)
DSA_free(dsa_key[i]); DSA_free(dsa_key[i]);
#endif #endif
#ifndef OPENSSL_NO_ECDSA
for (i=0; i<EC_NUM; i++)
if (ecdsa[i] != NULL)
EC_KEY_free(ecdsa[i]);
#endif
#ifndef OPENSSL_NO_ECDH
for (i=0; i<EC_NUM; i++)
{
if (ecdh_a[i] != NULL)
EC_KEY_free(ecdh_a[i]);
if (ecdh_b[i] != NULL)
EC_KEY_free(ecdh_b[i]);
}
#endif
apps_shutdown(); apps_shutdown();
EXIT(mret); OPENSSL_EXIT(mret);
} }
static void print_message(const char *s, long num, int length) static void print_message(const char *s, long num, int length)
@@ -1768,8 +2456,8 @@ static void pkey_print_message(char *str, char *str2, long num, int bits,
static void print_result(int alg,int run_no,int count,double time_used) static void print_result(int alg,int run_no,int count,double time_used)
{ {
BIO_printf(bio_err,mr ? "+R:%ld:%s:%f\n" BIO_printf(bio_err,mr ? "+R:%d:%s:%f\n"
: "%ld %s's in %.2fs\n",count,names[alg],time_used); : "%d %s's in %.2fs\n",count,names[alg],time_used);
results[alg][run_no]=((double)count)/time_used*lengths[run_no]; results[alg][run_no]=((double)count)/time_used*lengths[run_no];
} }
@@ -1781,7 +2469,7 @@ static char *sstrsep(char **string, const char *delim)
if (**string == 0) if (**string == 0)
return NULL; return NULL;
memset(isdelim, 0, 256); memset(isdelim, 0, sizeof isdelim);
isdelim[0] = 1; isdelim[0] = 1;
while (*delim) while (*delim)
@@ -1928,6 +2616,49 @@ static int do_multi(int multi)
else else
dsa_results[k][1]=d; dsa_results[k][1]=d;
} }
#ifndef OPENSSL_NO_ECDSA
else if(!strncmp(buf,"+F4:",4))
{
int k;
double d;
p=buf+4;
k=atoi(sstrsep(&p,sep));
sstrsep(&p,sep);
d=atof(sstrsep(&p,sep));
if(n)
ecdsa_results[k][0]=1/(1/ecdsa_results[k][0]+1/d);
else
ecdsa_results[k][0]=d;
d=atof(sstrsep(&p,sep));
if(n)
ecdsa_results[k][1]=1/(1/ecdsa_results[k][1]+1/d);
else
ecdsa_results[k][1]=d;
}
#endif
#ifndef OPENSSL_NO_ECDH
else if(!strncmp(buf,"+F5:",4))
{
int k;
double d;
p=buf+4;
k=atoi(sstrsep(&p,sep));
sstrsep(&p,sep);
d=atof(sstrsep(&p,sep));
if(n)
ecdh_results[k][0]=1/(1/ecdh_results[k][0]+1/d);
else
ecdh_results[k][0]=d;
}
#endif
else if(!strncmp(buf,"+H:",3)) else if(!strncmp(buf,"+H:",3))
{ {
} }
@@ -1938,3 +2669,4 @@ static int do_multi(int multi)
return 1; return 1;
} }
#endif #endif
#endif

View File

@@ -92,7 +92,9 @@ int MAIN(int argc, char **argv)
CONF *conf = NULL; CONF *conf = NULL;
NETSCAPE_SPKI *spki = NULL; NETSCAPE_SPKI *spki = NULL;
EVP_PKEY *pkey = NULL; EVP_PKEY *pkey = NULL;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
apps_startup(); apps_startup();
@@ -141,11 +143,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
spksect= *(++argv); spksect= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -171,7 +175,9 @@ 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");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
#endif
goto end; goto end;
} }
@@ -181,12 +187,14 @@ bad:
goto end; goto end;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if(keyfile) { if(keyfile) {
pkey = load_key(bio_err, pkey = load_key(bio_err,
strcmp(keyfile, "-") ? keyfile : NULL, strcmp(keyfile, "-") ? keyfile : NULL,
FORMAT_PEM, passin, e, "private key"); FORMAT_PEM, 1, passin, e, "private key");
if(!pkey) { if(!pkey) {
goto end; goto end;
} }
@@ -295,5 +303,5 @@ end:
EVP_PKEY_free(pkey); EVP_PKEY_free(pkey);
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }

View File

@@ -86,7 +86,9 @@ 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;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
cert_ctx=X509_STORE_new(); cert_ctx=X509_STORE_new();
if (cert_ctx == NULL) goto end; if (cert_ctx == NULL) goto end;
@@ -142,11 +144,13 @@ int MAIN(int argc, char **argv)
if (argc-- < 1) goto end; if (argc-- < 1) goto end;
trustfile= *(++argv); trustfile= *(++argv);
} }
#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto end; if (--argc < 1) goto end;
engine= *(++argv); engine= *(++argv);
} }
#endif
else if (strcmp(*argv,"-help") == 0) else if (strcmp(*argv,"-help") == 0)
goto end; goto end;
else if (strcmp(*argv,"-ignore_critical") == 0) else if (strcmp(*argv,"-ignore_critical") == 0)
@@ -170,7 +174,9 @@ int MAIN(int argc, char **argv)
break; break;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
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();
@@ -219,7 +225,11 @@ 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] [-crl_check] [-engine e] cert1 cert2 ...\n"); BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," [-engine e]");
#endif
BIO_printf(bio_err," 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;
@@ -232,7 +242,7 @@ end:
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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e) static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e)
@@ -330,7 +340,8 @@ static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
if (!ok) if (!ok)
{ {
X509_NAME_oneline( X509_NAME_oneline(
X509_get_subject_name(ctx->current_cert),buf,256); X509_get_subject_name(ctx->current_cert),buf,
sizeof buf);
printf("%s\n",buf); printf("%s\n",buf);
printf("error %d at %d depth lookup:%s\n",ctx->error, printf("error %d at %d depth lookup:%s\n",ctx->error,
ctx->error_depth, ctx->error_depth,

View File

@@ -172,7 +172,19 @@ int MAIN(int argc, char **argv)
} }
} }
if (version) printf("%s\n",SSLeay_version(SSLEAY_VERSION)); if (version)
{
if (SSLeay() == SSLEAY_VERSION_NUMBER)
{
printf("%s\n",SSLeay_version(SSLEAY_VERSION));
}
else
{
printf("%s (Library: %s)\n",
OPENSSL_VERSION_TEXT,
SSLeay_version(SSLEAY_VERSION));
}
}
if (date) printf("%s\n",SSLeay_version(SSLEAY_BUILT_ON)); if (date) printf("%s\n",SSLeay_version(SSLEAY_BUILT_ON));
if (platform) printf("%s\n",SSLeay_version(SSLEAY_PLATFORM)); if (platform) printf("%s\n",SSLeay_version(SSLEAY_PLATFORM));
if (options) if (options)
@@ -200,5 +212,5 @@ int MAIN(int argc, char **argv)
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR)); if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
end: end:
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }

View File

@@ -118,7 +118,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
HDC hdc; HDC hdc;
PAINTSTRUCT ps; PAINTSTRUCT ps;
RECT rect; RECT rect;
char buffer[200];
static int seeded = 0; static int seeded = 0;
switch (iMsg) switch (iMsg)

View File

@@ -92,7 +92,9 @@ static char *x509_usage[]={
" -out arg - output file - default stdout\n", " -out arg - output file - default stdout\n",
" -passin arg - private key password source\n", " -passin arg - private key password source\n",
" -serial - print serial number value\n", " -serial - print serial number value\n",
" -hash - print hash value\n", " -subject_hash - print subject hash value\n",
" -issuer_hash - print issuer hash value\n",
" -hash - synonym for -subject_hash\n",
" -subject - print subject DN\n", " -subject - print subject DN\n",
" -issuer - print issuer DN\n", " -issuer - print issuer DN\n",
" -email - print email address(es)\n", " -email - print email address(es)\n",
@@ -122,7 +124,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 - serial file\n", " -CAserial arg - serial file\n",
" -set_serial - serial number to use\n", " -set_serial - serial number to use\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",
@@ -131,7 +133,9 @@ 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",
#ifndef OPENSSL_NO_ENGINE
" -engine e - use engine e, possibly a hardware device.\n", " -engine e - use engine e, possibly a hardware device.\n",
#endif
" -certopt arg - various certificate text options\n", " -certopt arg - various certificate text options\n",
NULL NULL
}; };
@@ -165,8 +169,8 @@ int MAIN(int argc, char **argv)
char *infile=NULL,*outfile=NULL,*keyfile=NULL,*CAfile=NULL; char *infile=NULL,*outfile=NULL,*keyfile=NULL,*CAfile=NULL;
char *CAkeyfile=NULL,*CAserial=NULL; char *CAkeyfile=NULL,*CAserial=NULL;
char *alias=NULL; char *alias=NULL;
int text=0,serial=0,hash=0,subject=0,issuer=0,startdate=0,enddate=0; int text=0,serial=0,subject=0,issuer=0,startdate=0,enddate=0;
int ocspid=0; int subject_hash=0,issuer_hash=0,ocspid=0;
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0; int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0;
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0; int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
int C=0; int C=0;
@@ -183,7 +187,9 @@ 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, certflag = 0; unsigned long nmflag = 0, certflag = 0;
#ifndef OPENSSL_NO_ENGINE
char *engine=NULL; char *engine=NULL;
#endif
reqfile=0; reqfile=0;
@@ -354,17 +360,13 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
if (!set_name_ex(&nmflag, *(++argv))) goto bad; if (!set_name_ex(&nmflag, *(++argv))) goto bad;
} }
else if (strcmp(*argv,"-setalias") == 0) #ifndef OPENSSL_NO_ENGINE
{
if (--argc < 1) goto bad;
alias= *(++argv);
trustout = 1;
}
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
engine= *(++argv); engine= *(++argv);
} }
#endif
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)
@@ -379,8 +381,11 @@ int MAIN(int argc, char **argv)
x509req= ++num; x509req= ++num;
else if (strcmp(*argv,"-text") == 0) else if (strcmp(*argv,"-text") == 0)
text= ++num; text= ++num;
else if (strcmp(*argv,"-hash") == 0) else if (strcmp(*argv,"-hash") == 0
hash= ++num; || strcmp(*argv,"-subject_hash") == 0)
subject_hash= ++num;
else if (strcmp(*argv,"-issuer_hash") == 0)
issuer_hash= ++num;
else if (strcmp(*argv,"-subject") == 0) else if (strcmp(*argv,"-subject") == 0)
subject= ++num; subject= ++num;
else if (strcmp(*argv,"-issuer") == 0) else if (strcmp(*argv,"-issuer") == 0)
@@ -450,7 +455,9 @@ bad:
goto end; goto end;
} }
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); e = setup_engine(bio_err, engine, 0);
#endif
if (need_rand) if (need_rand)
app_RAND_load_file(NULL, bio_err, 0); app_RAND_load_file(NULL, bio_err, 0);
@@ -479,7 +486,7 @@ bad:
if (extfile) if (extfile)
{ {
long errorline; long errorline = -1;
X509V3_CTX ctx2; X509V3_CTX ctx2;
extconf = NCONF_new(NULL); extconf = NCONF_new(NULL);
if (!NCONF_load(extconf, extfile,&errorline)) if (!NCONF_load(extconf, extfile,&errorline))
@@ -705,10 +712,14 @@ bad:
if (alstr) BIO_printf(STDout,"%s\n", alstr); if (alstr) BIO_printf(STDout,"%s\n", alstr);
else BIO_puts(STDout,"<No Alias>\n"); else BIO_puts(STDout,"<No Alias>\n");
} }
else if (hash == i) else if (subject_hash == i)
{ {
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x)); BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x));
} }
else if (issuer_hash == i)
{
BIO_printf(STDout,"%08lx\n",X509_issuer_name_hash(x));
}
else if (pprint == i) else if (pprint == i)
{ {
X509_PURPOSE *ptmp; X509_PURPOSE *ptmp;
@@ -770,10 +781,11 @@ bad:
int y,z; int y,z;
X509_NAME_oneline(X509_get_subject_name(x), X509_NAME_oneline(X509_get_subject_name(x),
buf,256); buf,sizeof buf);
BIO_printf(STDout,"/* subject:%s */\n",buf); BIO_printf(STDout,"/* subject:%s */\n",buf);
m=X509_NAME_oneline( m=X509_NAME_oneline(
X509_get_issuer_name(x),buf,256); X509_get_issuer_name(x),buf,
sizeof buf);
BIO_printf(STDout,"/* issuer :%s */\n",buf); BIO_printf(STDout,"/* issuer :%s */\n",buf);
z=i2d_X509(x,NULL); z=i2d_X509(x,NULL);
@@ -861,8 +873,8 @@ bad:
if (Upkey == NULL) if (Upkey == NULL)
{ {
Upkey=load_key(bio_err, Upkey=load_key(bio_err,
keyfile,keyformat, passin, e, keyfile, keyformat, 0,
"Private key"); passin, e, "Private key");
if (Upkey == NULL) goto end; if (Upkey == NULL) goto end;
} }
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
@@ -870,7 +882,7 @@ bad:
digest=EVP_dss1(); digest=EVP_dss1();
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
if (Upkey->type == EVP_PKEY_ECDSA) if (Upkey->type == EVP_PKEY_EC)
digest=EVP_ecdsa(); digest=EVP_ecdsa();
#endif #endif
@@ -884,8 +896,9 @@ bad:
if (CAkeyfile != NULL) if (CAkeyfile != NULL)
{ {
CApkey=load_key(bio_err, CApkey=load_key(bio_err,
CAkeyfile,CAkeyformat, passin, CAkeyfile, CAkeyformat,
e, "CA Private Key"); 0, passin, e,
"CA Private Key");
if (CApkey == NULL) goto end; if (CApkey == NULL) goto end;
} }
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
@@ -893,7 +906,7 @@ bad:
digest=EVP_dss1(); digest=EVP_dss1();
#endif #endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
if (CApkey->type == EVP_PKEY_ECDSA) if (CApkey->type == EVP_PKEY_EC)
digest = EVP_ecdsa(); digest = EVP_ecdsa();
#endif #endif
@@ -916,17 +929,21 @@ bad:
else else
{ {
pk=load_key(bio_err, pk=load_key(bio_err,
keyfile,FORMAT_PEM, passin, e, keyfile, FORMAT_PEM, 0,
"request key"); passin, e, "request key");
if (pk == NULL) goto end; if (pk == NULL) goto end;
} }
BIO_printf(bio_err,"Generating certificate request\n"); BIO_printf(bio_err,"Generating certificate request\n");
#ifndef OPENSSL_NO_DSA
if (pk->type == EVP_PKEY_DSA) if (pk->type == EVP_PKEY_DSA)
digest=EVP_dss1(); digest=EVP_dss1();
else if (pk->type == EVP_PKEY_ECDSA) #endif
#ifndef OPENSSL_NO_ECDSA
if (pk->type == EVP_PKEY_EC)
digest=EVP_ecdsa(); digest=EVP_ecdsa();
#endif
rq=X509_to_X509_REQ(x,pk,digest); rq=X509_to_X509_REQ(x,pk,digest);
EVP_PKEY_free(pk); EVP_PKEY_free(pk);
@@ -1023,108 +1040,47 @@ end:
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);
apps_shutdown(); apps_shutdown();
EXIT(ret); OPENSSL_EXIT(ret);
} }
static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create) static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile, int create)
{ {
char *buf = NULL, *p; char *buf = NULL, *p;
MS_STATIC char buf2[1024]; ASN1_INTEGER *bs = NULL;
ASN1_INTEGER *bs = NULL, *bs2 = NULL;
BIO *io = NULL;
BIGNUM *serial = NULL; BIGNUM *serial = NULL;
size_t len;
buf=OPENSSL_malloc( ((serialfile == NULL) len = ((serialfile == NULL)
?(strlen(CAfile)+strlen(POSTFIX)+1) ?(strlen(CAfile)+strlen(POSTFIX)+1)
:(strlen(serialfile)))+1); :(strlen(serialfile)))+1;
buf=OPENSSL_malloc(len);
if (buf == NULL) { BIO_printf(bio_err,"out of mem\n"); goto end; } if (buf == NULL) { BIO_printf(bio_err,"out of mem\n"); goto end; }
if (serialfile == NULL) if (serialfile == NULL)
{ {
strcpy(buf,CAfile); BUF_strlcpy(buf,CAfile,len);
for (p=buf; *p; p++) for (p=buf; *p; p++)
if (*p == '.') if (*p == '.')
{ {
*p='\0'; *p='\0';
break; break;
} }
strcat(buf,POSTFIX); BUF_strlcat(buf,POSTFIX,len);
} }
else else
strcpy(buf,serialfile); BUF_strlcpy(buf,serialfile,len);
serial=BN_new();
bs=ASN1_INTEGER_new();
if ((serial == NULL) || (bs == NULL))
{
ERR_print_errors(bio_err);
goto end;
}
io=BIO_new(BIO_s_file()); serial = load_serial(buf, create, NULL);
if (io == NULL) if (serial == NULL) goto end;
{
ERR_print_errors(bio_err);
goto end;
}
if (BIO_read_filename(io,buf) <= 0)
{
if (!create)
{
perror(buf);
goto end;
}
else
{
ASN1_INTEGER_set(bs,1);
BN_one(serial);
}
}
else
{
if (!a2i_ASN1_INTEGER(io,bs,buf2,1024))
{
BIO_printf(bio_err,"unable to load serial number from %s\n",buf);
ERR_print_errors(bio_err);
goto end;
}
else
{
serial=BN_bin2bn(bs->data,bs->length,serial);
if (serial == NULL)
{
BIO_printf(bio_err,"error converting bin 2 bn");
goto end;
}
}
}
if (!BN_add_word(serial,1)) if (!BN_add_word(serial,1))
{ BIO_printf(bio_err,"add_word failure\n"); goto end; } { BIO_printf(bio_err,"add_word failure\n"); goto end; }
if (!(bs2 = BN_to_ASN1_INTEGER(serial, NULL)))
{ BIO_printf(bio_err,"error converting bn 2 asn1_integer\n"); goto end; }
if (BIO_write_filename(io,buf) <= 0)
{
BIO_printf(bio_err,"error attempting to write serial number file\n");
perror(buf);
goto end;
}
i2a_ASN1_INTEGER(io,bs2);
BIO_puts(io,"\n");
BIO_free(io); if (!save_serial(buf, NULL, serial, &bs)) goto end;
end:
if (buf) OPENSSL_free(buf); if (buf) OPENSSL_free(buf);
ASN1_INTEGER_free(bs2);
BN_free(serial); BN_free(serial);
io=NULL;
return bs; return bs;
end:
if (buf) OPENSSL_free(buf);
BIO_free(io);
ASN1_INTEGER_free(bs);
BN_free(serial);
return NULL;
} }
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,
@@ -1146,10 +1102,10 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
goto end; goto end;
} }
if (sno) bs = sno; if (sno) bs = sno;
else if (!(bs = load_serial(CAfile, serialfile, create))) else if (!(bs = x509_load_serial(CAfile, serialfile, create)))
goto end; goto end;
if (!X509_STORE_add_cert(ctx,x)) goto end; /* if (!X509_STORE_add_cert(ctx,x)) goto end;*/
/* NOTE: this certificate can/should be self signed, unless it was /* NOTE: this certificate can/should be self signed, unless it was
* a certificate request in which case it is not. */ * a certificate request in which case it is not. */

View File

@@ -29,7 +29,7 @@ RC4-MD5, but a re-connect tries to use DES-CBC-SHA. So netscape, when
doing a re-connect, always takes the first cipher in the cipher list. doing a re-connect, always takes the first cipher in the cipher list.
If we accept a netscape connection, demand a client cert, have a If we accept a netscape connection, demand a client cert, have a
non-self-sighed CA which does not have it's CA in netscape, and the non-self-signed CA which does not have it's CA in netscape, and the
browser has a cert, it will crash/hang. Works for 3.x and 4.xbeta browser has a cert, it will crash/hang. Works for 3.x and 4.xbeta
Netscape browsers do not really notice the server sending a Netscape browsers do not really notice the server sending a

18
certs/expired/vsign3.pem Normal file
View File

@@ -0,0 +1,18 @@
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
notBefore=Jan 29 00:00:00 1996 GMT
notAfter=Jan 7 23:59:59 2004 GMT
-----BEGIN CERTIFICATE-----
MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ
BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh
c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05
NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD
VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp
bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB
jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo
RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4
rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN
BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp
STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH
ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ
pA==
-----END CERTIFICATE-----

View File

@@ -1,18 +1,17 @@
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
notBefore=Jan 29 00:00:00 1996 GMT notBefore=Jan 29 00:00:00 1996 GMT
notAfter=Jan 7 23:59:59 2004 GMT notAfter=Aug 1 23:59:59 2028 GMT
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
pA==
-----END CERTIFICATE----- -----END CERTIFICATE-----

116
config
View File

@@ -74,34 +74,27 @@ if [ "x$XREL" != "x" ]; then
echo "whatever-whatever-sco5"; exit 0 echo "whatever-whatever-sco5"; exit 0
;; ;;
4.2MP) 4.2MP)
if [ "x$VERSION" = "x2.01" ]; then case "x${VERSION}" in
echo "${MACHINE}-whatever-unixware201"; exit 0 x2.0*) echo "whatever-whatever-unixware20"; exit 0 ;;
elif [ "x$VERSION" = "x2.02" ]; then x2.1*) echo "whatever-whatever-unixware21"; exit 0 ;;
echo "${MACHINE}-whatever-unixware202"; exit 0 x2*) echo "whatever-whatever-unixware2"; exit 0 ;;
elif [ "x$VERSION" = "x2.03" ]; then esac
echo "${MACHINE}-whatever-unixware203"; exit 0
elif [ "x$VERSION" = "x2.1.1" ]; then
echo "${MACHINE}-whatever-unixware211"; exit 0
elif [ "x$VERSION" = "x2.1.2" ]; then
echo "${MACHINE}-whatever-unixware212"; exit 0
elif [ "x$VERSION" = "x2.1.3" ]; then
echo "${MACHINE}-whatever-unixware213"; exit 0
else
echo "${MACHINE}-whatever-unixware2"; exit 0
fi
;; ;;
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 case "x${VERSION}" in
echo "${MACHINE}-sco-unixware7"; exit 0 # We hardcode i586 in place of ${MACHINE} for the
fi # following reason. The catch is that even though Pentium
# is minimum requirement for platforms in question,
# ${MACHINE} gets always assigned to i386. Now, problem
# with i386 is that it makes ./config pass 386 to
# ./Configure, which in turn makes make generate
# inefficient SHA-1 (for this moment) code.
x7*) echo "i586-sco-unixware7"; exit 0 ;;
x8*) echo "i586-unkn-OpenUNIX${VERSION}"; exit 0 ;;
esac
;; ;;
esac esac
fi fi
@@ -141,7 +134,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "$HPUXVER" in case "$HPUXVER" in
1[0-9].*) # HPUX 10 and 11 targets are unified 1[0-9].*) # HPUX 10 and 11 targets are unified
echo "${MACHINE}-hp-hpux10"; exit 0 echo "${MACHINE}-hp-hpux1x"; exit 0
;; ;;
*) *)
echo "${MACHINE}-hp-hpux"; exit 0 echo "${MACHINE}-hp-hpux"; exit 0
@@ -196,7 +189,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "${MACHINE}-whatever-bsdi"; exit 0 echo "${MACHINE}-whatever-bsdi"; exit 0
;; ;;
FreeBSD:*) FreeBSD:*:*:*386*)
VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
MACH=`sysctl -n hw.model` MACH=`sysctl -n hw.model`
ARCH='whatever' ARCH='whatever'
@@ -205,7 +198,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
*486* ) MACH="i486" ;; *486* ) MACH="i486" ;;
Pentium\ II*) MACH="i686" ;; Pentium\ II*) MACH="i686" ;;
Pentium* ) MACH="i586" ;; Pentium* ) MACH="i586" ;;
Alpha* ) MACH="alpha" ;;
* ) MACH="$MACHINE" ;; * ) MACH="$MACHINE" ;;
esac esac
case ${MACH} in case ${MACH} in
@@ -214,6 +206,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
;; ;;
FreeBSD:*)
echo "${MACHINE}-whatever-freebsd"; exit 0
;;
NetBSD:*:*:*386*) NetBSD:*:*:*386*)
echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0 echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
;; ;;
@@ -351,6 +347,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
*CRAY*) *CRAY*)
echo "j90-cray-unicos"; exit 0; echo "j90-cray-unicos"; exit 0;
;; ;;
NONSTOP_KERNEL*)
echo "nsr-tandem-nsk"; exit 0;
;;
esac esac
# #
@@ -393,6 +393,9 @@ exit 0
GCCVER=`(gcc -dumpversion) 2>/dev/null` GCCVER=`(gcc -dumpversion) 2>/dev/null`
if [ "$GCCVER" != "" ]; then if [ "$GCCVER" != "" ]; then
CC=gcc CC=gcc
# then strip off whatever prefix egcs prepends the number with...
# Hopefully, this will work for any future prefixes as well.
GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z]*\-//'`
# Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion # 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 # does give us what we want though, so we use that. We just just the
# major and minor version numbers. # major and minor version numbers.
@@ -407,9 +410,10 @@ if [ "$SYSTEM" = "HP-UX" ];then
GCC_BITS="32" GCC_BITS="32"
if [ $GCCVER -ge 30 ]; then if [ $GCCVER -ge 30 ]; then
# PA64 support only came in with gcc 3.0.x. # PA64 support only came in with gcc 3.0.x.
# We look for the preprocessor symbol __LP64__ indicating # We check if the preprocessor symbol __LP64__ is defined...
# 64bit bit long and pointer. sizeof(int) == 32 on HPUX64. if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then
if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then : # __LP64__ has slipped through, it therefore is not defined
else
GCC_BITS="64" GCC_BITS="64"
fi fi
fi fi
@@ -454,6 +458,10 @@ if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
fi fi
fi fi
if [ "${SYSTEM}" = "AIX" ]; then # favor vendor cc over gcc
(cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
fi
CCVER=${CCVER:-0} CCVER=${CCVER:-0}
# read the output of the embedded GuessOS # read the output of the embedded GuessOS
@@ -466,7 +474,7 @@ echo Operating system: $GUESSOS
# more time that I want to waste at the moment # more time that I want to waste at the moment
case "$GUESSOS" in case "$GUESSOS" in
mips2-sgi-irix) mips2-sgi-irix)
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
CPU=${CPU:-0} CPU=${CPU:-0}
if [ $CPU -ge 4000 ]; then if [ $CPU -ge 4000 ]; then
options="$options -mips2" options="$options -mips2"
@@ -474,7 +482,7 @@ case "$GUESSOS" in
OUT="irix-$CC" OUT="irix-$CC"
;; ;;
mips3-sgi-irix) mips3-sgi-irix)
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
CPU=${CPU:-0} CPU=${CPU:-0}
if [ $CPU -ge 5000 ]; then if [ $CPU -ge 5000 ]; then
options="$options -mips4" options="$options -mips4"
@@ -490,7 +498,7 @@ case "$GUESSOS" in
echo " You have about 5 seconds to press Ctrl-C to abort." echo " You have about 5 seconds to press Ctrl-C to abort."
(stty -icanon min 0 time 50; read waste) < /dev/tty (stty -icanon min 0 time 50; read waste) < /dev/tty
fi fi
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
CPU=${CPU:-0} CPU=${CPU:-0}
if [ $CPU -ge 5000 ]; then if [ $CPU -ge 5000 ]; then
options="$options -mips4" options="$options -mips4"
@@ -540,12 +548,13 @@ EOF
ppc-apple-darwin*) OUT="darwin-ppc-cc" ;; ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
i386-apple-darwin*) OUT="darwin-i386-cc" ;; i386-apple-darwin*) OUT="darwin-i386-cc" ;;
sparc64-*-linux2) sparc64-*-linux2)
#Before we can uncomment following lines we have to wait at least echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
#till 64-bit glibc for SPARC is operational:-( echo " and 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*." if [ "$TEST" = "false" ]; then
#echo " Type return if you want to continue, Ctrl-C to abort." echo " You have about 5 seconds to press Ctrl-C to abort."
#read waste < /dev/tty (stty -icanon min 0 time 50; read waste) < /dev/tty
fi
OUT="linux-sparcv9" ;; OUT="linux-sparcv9" ;;
sparc-*-linux2) sparc-*-linux2)
KARCH=`awk '/^type/{print$3}' /proc/cpuinfo` KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
@@ -578,6 +587,7 @@ EOF
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" ;; s390x-*-linux?) OUT="linux-s390x" ;;
x86_64-*-linux?) OUT="linux-x86_64" ;;
*-*-linux2) OUT="linux-elf" *-*-linux2) OUT="linux-elf"
if [ "$GCCVER" -gt 28 ]; then if [ "$GCCVER" -gt 28 ]; then
if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
@@ -631,6 +641,8 @@ EOF
*86*-*-solaris2) OUT="solaris-x86-$CC" ;; *86*-*-solaris2) OUT="solaris-x86-$CC" ;;
*-*-sunos4) OUT="sunos-$CC" ;; *-*-sunos4) OUT="sunos-$CC" ;;
alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;; alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
sparc64-*-freebsd*) OUT="FreeBSD-sparc64" ;;
ia64-*-freebsd*) OUT="FreeBSD-ia64" ;;
*-freebsd[3-9]*) OUT="FreeBSD-elf" ;; *-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
*-freebsd[1-2]*) OUT="FreeBSD" ;; *-freebsd[1-2]*) OUT="FreeBSD" ;;
*86*-*-netbsd) OUT="NetBSD-x86" ;; *86*-*-netbsd) OUT="NetBSD-x86" ;;
@@ -671,15 +683,8 @@ EOF
RM*-siemens-sysv4) OUT="ReliantUNIX" ;; RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
*-siemens-sysv4) OUT="SINIX" ;; *-siemens-sysv4) OUT="SINIX" ;;
*-hpux1*) *-hpux1*)
if [ $CC = "gcc" ]; if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
then OUT="hpux64-parisc2-gcc"
if [ $GCC_BITS = "64" ]; then
OUT="hpux64-parisc-gcc"
else
OUT="hpux-parisc-gcc"
fi
else
OUT="hpux-parisc-$CC"
fi fi
KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null` KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
KERNEL_BITS=${KERNEL_BITS:-32} KERNEL_BITS=${KERNEL_BITS:-32}
@@ -687,16 +692,16 @@ EOF
CPU_VERSION=${CPU_VERSION:-0} CPU_VERSION=${CPU_VERSION:-0}
# See <sys/unistd.h> for further info on CPU_VERSION. # See <sys/unistd.h> for further info on CPU_VERSION.
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
echo "NOTICE! 64-bit is the only ABI currently operational on HP-UXi." echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
echo " Post request to openssl-dev@openssl.org for 32-bit support." echo " If you wish to build 32-bit library, the you have to"
echo " invoke './Configure hpux-ia64-cc' *manually*."
if [ "$TEST" = "false" ]; then if [ "$TEST" = "false" ]; then
echo " You have about 5 seconds to press Ctrl-C to abort."
(stty -icanon min 0 time 50; read waste) < /dev/tty (stty -icanon min 0 time 50; read waste) < /dev/tty
fi fi
OUT="hpux64-ia64-cc" OUT="hpux64-ia64-cc"
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
if [ "$CC" = "cc" ]; then OUT=${OUT:-"hpux-parisc2-${CC}"}
OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
fi
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
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 hpux64-parisc2-cc' *manually*." echo " invoke './Configure hpux64-parisc2-cc' *manually*."
@@ -706,9 +711,9 @@ EOF
fi fi
fi fi
elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
: OUT="hpux-parisc-${CC}
elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
: OUT="hpux-parisc-${CC}
else # Motorola(?) CPU else # Motorola(?) CPU
OUT="hpux-$CC" OUT="hpux-$CC"
fi fi
@@ -722,6 +727,7 @@ EOF
*-*-cygwin) OUT="Cygwin" ;; *-*-cygwin) OUT="Cygwin" ;;
t3e-cray-unicosmk) OUT="cray-t3e" ;; t3e-cray-unicosmk) OUT="cray-t3e" ;;
j90-cray-unicos) OUT="cray-j90" ;; 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
@@ -756,7 +762,7 @@ case "$GUESSOS" in
i386-*) options="$options 386" ;; i386-*) options="$options 386" ;;
esac esac
for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 rijndael ripemd rsa sha for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 aes ripemd rsa sha
do do
if [ ! -d crypto/$i ] if [ ! -d crypto/$i ]
then then

View File

@@ -26,31 +26,33 @@ CFLAGS= $(INCLUDE) $(CFLAG)
LIBS= LIBS=
SDIRS= md2 md5 sha mdc2 hmac ripemd \ SDIRS= objects \
md2 md4 md5 sha mdc2 hmac ripemd \
des rc2 rc4 rc5 idea bf cast \ des rc2 rc4 rc5 idea bf cast \
bn ec rsa dsa ecdsa dh dso engine aes \ bn ec rsa dsa ecdsa ecdh dh dso engine aes \
buffer bio stack lhash rand err objects \ buffer bio stack lhash rand err \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
store
GENERAL=Makefile README crypto-lib.com install.com GENERAL=Makefile README crypto-lib.com install.com
LIB= $(TOP)/libcrypto.a LIB= $(TOP)/libcrypto.a
SHARED_LIB= libcrypto$(SHLIB_EXT) SHARED_LIB= libcrypto$(SHLIB_EXT)
LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c 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 o_time.c o_str.c
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o 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 o_time.o o_str.o
SRC= $(LIBSRC) SRC= $(LIBSRC)
EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
ossl_typ.h ossl_typ.h
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h $(EXHEADER) HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER) ALL= $(GENERAL) $(SRC) $(HEADER)
top: top:
@(cd ..; $(MAKE) DIRS=$(DIR) all) @(cd ..; $(MAKE) DIRS=$(DIR) all)
all: buildinf.h lib subdirs shared all: shared
buildinf.h: ../Makefile.ssl buildinf.h: ../Makefile.ssl
( echo "#ifndef MK1MF_BUILD"; \ ( echo "#ifndef MK1MF_BUILD"; \
@@ -81,11 +83,11 @@ files:
done; done;
links: links:
@$(TOP)/util/point.sh Makefile.ssl Makefile @sh $(TOP)/util/point.sh Makefile.ssl Makefile
@$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER) @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST) @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS) @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
@$(TOP)/util/point.sh Makefile.ssl Makefile @sh $(TOP)/util/point.sh Makefile.ssl Makefile
@for i in $(SDIRS); do \ @for i in $(SDIRS); do \
(cd $$i && echo "making links in crypto/$$i..." && \ (cd $$i && echo "making links in crypto/$$i..." && \
$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \ $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
@@ -96,9 +98,9 @@ lib: $(LIBOBJ)
$(RANLIB) $(LIB) || echo Never mind. $(RANLIB) $(LIB) || echo Never mind.
@touch lib @touch lib
shared: shared: buildinf.h lib subdirs
if [ -n "$(SHARED_LIBS)" ]; then \ if [ -n "$(SHARED_LIBS)" ]; then \
(cd ..; make $(SHARED_LIB)); \ (cd ..; $(MAKE) $(SHARED_LIB)); \
fi fi
libs: libs:
@@ -136,12 +138,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) $(CFLAG) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC) $(MAKEDEPEND) -- $(CFLAG) $(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}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ); \ $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ); \
done; done;
clean: clean:
@@ -180,7 +182,7 @@ cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h
cversion.o: ../include/openssl/symhacks.h buildinf.h cryptlib.h cversion.c cversion.o: ../include/openssl/symhacks.h buildinf.h cryptlib.h cversion.c
ebcdic.o: ../include/openssl/opensslconf.h ebcdic.c ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
@@ -193,12 +195,18 @@ mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h
mem.o: ../include/openssl/symhacks.h cryptlib.h mem.c mem.o: ../include/openssl/symhacks.h cryptlib.h mem.c
mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
mem_clr.o: ../include/openssl/safestack.h ../include/openssl/stack.h
mem_clr.o: ../include/openssl/symhacks.h mem_clr.c
mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
mem_dbg.o: ../include/openssl/safestack.h ../include/openssl/stack.h mem_dbg.o: ../include/openssl/safestack.h ../include/openssl/stack.h
mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c
o_str.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_str.c
o_str.o: o_str.h
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
o_time.o: o_time.h o_time.o: o_time.h
tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h

View File

@@ -52,7 +52,7 @@ files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
links: links:
@$(TOP)/util/point.sh Makefile.ssl Makefile @sh $(TOP)/util/point.sh Makefile.ssl Makefile
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
@@ -75,7 +75,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(CFLAG) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) $(MAKEDEPEND) -- $(CFLAG) $(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

@@ -52,12 +52,15 @@
#ifndef HEADER_AES_H #ifndef HEADER_AES_H
#define HEADER_AES_H #define HEADER_AES_H
#include <openssl/opensslconf.h>
#ifdef OPENSSL_NO_AES #ifdef OPENSSL_NO_AES
#error AES is disabled. #error AES is disabled.
#endif #endif
static const int AES_DECRYPT = 0; #define AES_ENCRYPT 1
static const int AES_ENCRYPT = 1; #define AES_DECRYPT 0
/* Because array size can't be a const in C, the following two are macros. /* Because array size can't be a const in C, the following two are macros.
Both sizes are in bytes. */ Both sizes are in bytes. */
#define AES_MAXNR 14 #define AES_MAXNR 14
@@ -94,12 +97,23 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key, const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc); unsigned char *ivec, int *num, const int enc);
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc);
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc);
void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
const int nbits,const AES_KEY *key,
unsigned char *ivec,const int enc);
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key, const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num); unsigned char *ivec, int *num);
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key, const unsigned long length, const AES_KEY *key,
unsigned char *counter, unsigned int *num); unsigned char ivec[AES_BLOCK_SIZE],
unsigned char ecount_buf[AES_BLOCK_SIZE],
unsigned int *num);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -49,7 +49,13 @@
* *
*/ */
#ifndef AES_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h> #include <assert.h>
#include <openssl/aes.h> #include <openssl/aes.h>
#include "aes_locl.h" #include "aes_locl.h"
@@ -57,33 +63,49 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key, const unsigned long length, const AES_KEY *key,
unsigned char *ivec, const int enc) { unsigned char *ivec, const int enc) {
int n; unsigned long n;
unsigned long len = length; unsigned long len = length;
unsigned char tmp[16]; unsigned char tmp[AES_BLOCK_SIZE];
assert(in && out && key && ivec); assert(in && out && key && ivec);
assert(length % AES_BLOCK_SIZE == 0);
assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc)); assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
if (AES_ENCRYPT == enc) if (AES_ENCRYPT == enc) {
while (len > 0) { while (len >= AES_BLOCK_SIZE) {
for(n=0; n < 16; ++n) for(n=0; n < AES_BLOCK_SIZE; ++n)
tmp[n] = in[n] ^ ivec[n]; tmp[n] = in[n] ^ ivec[n];
AES_encrypt(tmp, out, key); AES_encrypt(tmp, out, key);
memcpy(ivec, out, 16); memcpy(ivec, out, AES_BLOCK_SIZE);
len -= 16; len -= AES_BLOCK_SIZE;
in += 16; in += AES_BLOCK_SIZE;
out += 16; out += AES_BLOCK_SIZE;
} }
else if (len) {
while (len > 0) { for(n=0; n < len; ++n)
memcpy(tmp, in, 16); tmp[n] = in[n] ^ ivec[n];
for(n=len; n < AES_BLOCK_SIZE; ++n)
tmp[n] = ivec[n];
AES_encrypt(tmp, tmp, key);
memcpy(out, tmp, AES_BLOCK_SIZE);
memcpy(ivec, tmp, AES_BLOCK_SIZE);
}
} else {
while (len >= AES_BLOCK_SIZE) {
memcpy(tmp, in, AES_BLOCK_SIZE);
AES_decrypt(in, out, key); AES_decrypt(in, out, key);
for(n=0; n < 16; ++n) for(n=0; n < AES_BLOCK_SIZE; ++n)
out[n] ^= ivec[n]; out[n] ^= ivec[n];
memcpy(ivec, tmp, 16); memcpy(ivec, tmp, AES_BLOCK_SIZE);
len -= 16; len -= AES_BLOCK_SIZE;
in += 16; in += AES_BLOCK_SIZE;
out += 16; out += AES_BLOCK_SIZE;
} }
if (len) {
memcpy(tmp, in, AES_BLOCK_SIZE);
AES_decrypt(tmp, tmp, key);
for(n=0; n < len; ++n)
out[n] = tmp[n] ^ ivec[n];
memcpy(ivec, tmp, AES_BLOCK_SIZE);
}
}
} }

View File

@@ -105,7 +105,13 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef AES_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h> #include <assert.h>
#include <openssl/aes.h> #include <openssl/aes.h>
#include "aes_locl.h" #include "aes_locl.h"
@@ -149,3 +155,96 @@ void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
*num=n; *num=n;
} }
/* This expects a single block of size nbits for both in and out. Note that
it corrupts any extra bits in the last byte of out */
/* Untested, once it is working, it will be optimised */
void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
const int nbits,const AES_KEY *key,
unsigned char *ivec,const int enc)
{
int n;
unsigned char ovec[AES_BLOCK_SIZE*2];
assert(in && out && key && ivec);
if(enc)
{
/* construct the new IV */
AES_encrypt(ivec,ovec,key);
/* encrypt the input */
for(n=0 ; n < (nbits+7)/8 ; ++n)
out[n]=in[n]^ovec[n];
/* fill in the first half of the new IV with the current IV */
memcpy(ovec,ivec,AES_BLOCK_SIZE);
/* and put the ciphertext in the second half */
memcpy(ovec+AES_BLOCK_SIZE,out,(nbits+7)/8);
/* shift ovec left most of the bits... */
memmove(ovec,ovec+nbits/8,AES_BLOCK_SIZE+(nbits%8 ? 1 : 0));
/* now the remaining bits */
if(nbits%8 != 0)
for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
{
ovec[n]<<=nbits%8;
ovec[n]|=ovec[n+1]>>(8-nbits%8);
}
/* finally, move it back into place */
memcpy(ivec,ovec,AES_BLOCK_SIZE);
}
else
{
/* construct the new IV in the first half of ovec */
AES_encrypt(ivec,ovec,key);
/* decrypt the input */
for(n=0 ; n < (nbits+7)/8 ; ++n)
out[n]=in[n]^ovec[n];
/* fill in the first half of the new IV with the current IV */
memcpy(ovec,ivec,AES_BLOCK_SIZE);
/* append the ciphertext */
memcpy(ovec+AES_BLOCK_SIZE,in,(nbits+7)/8);
/* shift ovec left most of the bits... */
memmove(ovec,ovec+nbits/8,AES_BLOCK_SIZE+(nbits%8 ? 1 : 0));
/* now the remaining bits */
if(nbits%8 != 0)
for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
{
ovec[n]<<=nbits%8;
ovec[n]|=ovec[n+1]>>(8-nbits%8);
}
/* finally, move it back into place */
memcpy(ivec,ovec,AES_BLOCK_SIZE);
}
/* it is not necessary to cleanse ovec, since the IV is not secret */
}
/* N.B. This expects the input to be packed, MS bit first */
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc)
{
unsigned int n;
unsigned char c[1],d[1];
assert(in && out && key && ivec && num);
assert(*num == 0);
memset(out,0,(length+7)/8);
for(n=0 ; n < length ; ++n)
{
c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
AES_cfbr_encrypt_block(c,d,1,key,ivec,enc);
out[n/8]=(out[n/8]&~(1 << (7-n%8)))|((d[0]&0x80) >> (n%8));
}
}
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc)
{
unsigned int n;
assert(in && out && key && ivec && num);
assert(*num == 0);
for(n=0 ; n < length ; ++n)
AES_cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc);
}

View File

@@ -28,7 +28,13 @@
/* Note: rewritten a little bit to provide error control and an OpenSSL- /* Note: rewritten a little bit to provide error control and an OpenSSL-
compatible API */ compatible API */
#ifndef AES_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <openssl/aes.h> #include <openssl/aes.h>
#include "aes_locl.h" #include "aes_locl.h"
@@ -744,7 +750,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
rk[2] = GETU32(userKey + 8); rk[2] = GETU32(userKey + 8);
rk[3] = GETU32(userKey + 12); rk[3] = GETU32(userKey + 12);
if (bits == 128) { if (bits == 128) {
for (;;) { while (1) {
temp = rk[3]; temp = rk[3];
rk[4] = rk[0] ^ rk[4] = rk[0] ^
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
@@ -764,7 +770,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
rk[4] = GETU32(userKey + 16); rk[4] = GETU32(userKey + 16);
rk[5] = GETU32(userKey + 20); rk[5] = GETU32(userKey + 20);
if (bits == 192) { if (bits == 192) {
for (;;) { while (1) {
temp = rk[ 5]; temp = rk[ 5];
rk[ 6] = rk[ 0] ^ rk[ 6] = rk[ 0] ^
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
@@ -786,7 +792,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
rk[6] = GETU32(userKey + 24); rk[6] = GETU32(userKey + 24);
rk[7] = GETU32(userKey + 28); rk[7] = GETU32(userKey + 28);
if (bits == 256) { if (bits == 256) {
for (;;) { while (1) {
temp = rk[ 7]; temp = rk[ 7];
rk[ 8] = rk[ 0] ^ rk[ 8] = rk[ 0] ^
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^

View File

@@ -49,67 +49,89 @@
* *
*/ */
#ifndef AES_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h> #include <assert.h>
#include <openssl/aes.h> #include <openssl/aes.h>
#include "aes_locl.h" #include "aes_locl.h"
/* NOTE: CTR mode is big-endian. The rest of the AES code /* NOTE: the IV/counter CTR mode is big-endian. The rest of the AES code
* is endian-neutral. */ * is endian-neutral. */
/* increment counter (128-bit int) by 2^64 */ /* increment counter (128-bit int) by 1 */
static void AES_ctr128_inc(unsigned char *counter) { static void AES_ctr128_inc(unsigned char *counter) {
unsigned long c; unsigned long c;
/* Grab 3rd dword of counter and increment */ /* Grab bottom dword of counter and increment */
#ifdef L_ENDIAN c = GETU32(counter + 12);
c = GETU32(counter + 8);
c++; c++;
PUTU32(counter + 8, c); PUTU32(counter + 12, c);
#else
c = GETU32(counter + 4); /* if no overflow, we're done */
if (c)
return;
/* Grab 1st dword of counter and increment */
c = GETU32(counter + 8);
c++; c++;
PUTU32(counter + 4, c); PUTU32(counter + 8, c);
#endif
/* if no overflow, we're done */
if (c)
return;
/* Grab 2nd dword of counter and increment */
c = GETU32(counter + 4);
c++;
PUTU32(counter + 4, c);
/* if no overflow, we're done */ /* if no overflow, we're done */
if (c) if (c)
return; return;
/* Grab top dword of counter and increment */ /* Grab top dword of counter and increment */
#ifdef L_ENDIAN
c = GETU32(counter + 12);
c++;
PUTU32(counter + 12, c);
#else
c = GETU32(counter + 0); c = GETU32(counter + 0);
c++; c++;
PUTU32(counter + 0, c); PUTU32(counter + 0, c);
#endif
} }
/* The input encrypted as though 128bit counter mode is being /* The input encrypted as though 128bit counter mode is being
* used. The extra state information to record how much of the * used. The extra state information to record how much of the
* 128bit block we have used is contained in *num; * 128bit block we have used is contained in *num, and the
* encrypted counter is kept in ecount_buf. Both *num and
* ecount_buf must be initialised with zeros before the first
* call to AES_ctr128_encrypt().
*
* This algorithm assumes that the counter is in the x lower bits
* of the IV (ivec), and that the application has full control over
* overflow and the rest of the IV. This implementation takes NO
* responsability for checking that the counter doesn't overflow
* into the rest of the IV when incremented.
*/ */
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key, const unsigned long length, const AES_KEY *key,
unsigned char *counter, unsigned int *num) { unsigned char ivec[AES_BLOCK_SIZE],
unsigned char ecount_buf[AES_BLOCK_SIZE],
unsigned int *num) {
unsigned int n; unsigned int n;
unsigned long l=length; unsigned long l=length;
unsigned char tmp[AES_BLOCK_SIZE];
assert(in && out && key && counter && num); assert(in && out && key && counter && num);
assert(*num < AES_BLOCK_SIZE);
n = *num; n = *num;
while (l--) { while (l--) {
if (n == 0) { if (n == 0) {
AES_encrypt(counter, tmp, key); AES_encrypt(ivec, ecount_buf, key);
AES_ctr128_inc(counter); AES_ctr128_inc(ivec);
} }
*(out++) = *(in++) ^ tmp[n]; *(out++) = *(in++) ^ ecount_buf[n];
n = (n+1) % AES_BLOCK_SIZE; n = (n+1) % AES_BLOCK_SIZE;
} }

View File

@@ -49,7 +49,13 @@
* *
*/ */
#ifndef AES_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h> #include <assert.h>
#include <openssl/aes.h> #include <openssl/aes.h>
#include "aes_locl.h" #include "aes_locl.h"

View File

@@ -62,7 +62,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(OPENSSL_SYS_WINCE)
# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) # define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
# define GETU32(p) SWAP(*((u32 *)(p))) # define GETU32(p) SWAP(*((u32 *)(p)))
# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); } # define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }

View File

@@ -105,7 +105,13 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef AES_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h> #include <assert.h>
#include <openssl/aes.h> #include <openssl/aes.h>
#include "aes_locl.h" #include "aes_locl.h"

File diff suppressed because it is too large Load Diff

View File

@@ -120,6 +120,12 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
unsigned char *p,*s; unsigned char *p,*s;
int i; int i;
if (len < 1)
{
i=ASN1_R_STRING_TOO_SHORT;
goto err;
}
if ((a == NULL) || ((*a) == NULL)) if ((a == NULL) || ((*a) == NULL))
{ {
if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL); if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL);
@@ -185,7 +191,9 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
if (a->data == NULL) if (a->data == NULL)
c=(unsigned char *)OPENSSL_malloc(w+1); c=(unsigned char *)OPENSSL_malloc(w+1);
else else
c=(unsigned char *)OPENSSL_realloc(a->data,w+1); c=(unsigned char *)OPENSSL_realloc_clean(a->data,
a->length,
w+1);
if (c == NULL) return(0); if (c == NULL) return(0);
if (w+1-a->length > 0) memset(c+a->length, 0, w+1-a->length); if (w+1-a->length > 0) memset(c+a->length, 0, w+1-a->length);
a->data=c; a->data=c;

View File

@@ -285,7 +285,7 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
goto err; goto err;
} }
if (!BUF_MEM_grow(&b,num+os->length)) if (!BUF_MEM_grow_clean(&b,num+os->length))
{ {
c->error=ERR_R_BUF_LIB; c->error=ERR_R_BUF_LIB;
goto err; goto err;

View File

@@ -149,7 +149,12 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
ASN1_CTX c; ASN1_CTX c;
int want=HEADER_SIZE; int want=HEADER_SIZE;
int eos=0; int eos=0;
#if defined(__GNUC__) && defined(__ia64)
/* pathetic compiler bug in all known versions as of Nov. 2002 */
long off=0;
#else
int off=0; int off=0;
#endif
int len=0; int len=0;
b=BUF_MEM_new(); b=BUF_MEM_new();
@@ -166,7 +171,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
{ {
want-=(len-off); want-=(len-off);
if (!BUF_MEM_grow(b,len+want)) if (!BUF_MEM_grow_clean(b,len+want))
{ {
ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE);
goto err; goto err;
@@ -221,18 +226,23 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
if (want > (len-off)) if (want > (len-off))
{ {
want-=(len-off); want-=(len-off);
if (!BUF_MEM_grow(b,len+want)) if (!BUF_MEM_grow_clean(b,len+want))
{ {
ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE);
goto err; goto err;
} }
i=BIO_read(in,&(b->data[len]),want); while (want > 0)
if (i <= 0)
{ {
ASN1err(ASN1_F_ASN1_D2I_BIO,ASN1_R_NOT_ENOUGH_DATA); i=BIO_read(in,&(b->data[len]),want);
goto err; if (i <= 0)
{
ASN1err(ASN1_F_ASN1_D2I_BIO,
ASN1_R_NOT_ENOUGH_DATA);
goto err;
}
len+=i;
want -= i;
} }
len+=i;
} }
off+=(int)c.slen; off+=(int)c.slen;
if (eos <= 0) if (eos <= 0)

View File

@@ -67,12 +67,13 @@
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
{ {
int i,j,k; int j,k;
unsigned int i;
unsigned char buf[sizeof(long)+1]; unsigned char buf[sizeof(long)+1];
long d; long d;
a->type=V_ASN1_ENUMERATED; a->type=V_ASN1_ENUMERATED;
if (a->length < (sizeof(long)+1)) if (a->length < (int)(sizeof(long)+1))
{ {
if (a->data != NULL) if (a->data != NULL)
OPENSSL_free(a->data); OPENSSL_free(a->data);
@@ -116,7 +117,7 @@ long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)
else if (i != V_ASN1_ENUMERATED) else if (i != V_ASN1_ENUMERATED)
return -1; return -1;
if (a->length > sizeof(long)) if (a->length > (int)sizeof(long))
{ {
/* hmm... a bit ugly */ /* hmm... a bit ugly */
return(0xffffffffL); return(0xffffffffL);
@@ -147,7 +148,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
ASN1err(ASN1_F_BN_TO_ASN1_ENUMERATED,ERR_R_NESTED_ASN1_ERROR); ASN1err(ASN1_F_BN_TO_ASN1_ENUMERATED,ERR_R_NESTED_ASN1_ERROR);
goto err; goto err;
} }
if(bn->neg) ret->type = V_ASN1_NEG_ENUMERATED; if(BN_get_sign(bn)) ret->type = V_ASN1_NEG_ENUMERATED;
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));
@@ -175,6 +176,6 @@ BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn)
if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL)
ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB); ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB);
else if(ai->type == V_ASN1_NEG_ENUMERATED) ret->neg = 1; else if(ai->type == V_ASN1_NEG_ENUMERATED) BN_set_sign(ret,1);
return(ret); return(ret);
} }

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