Compare commits

...

1028 Commits

Author SHA1 Message Date
cvs2svn
02a473eeb9 This commit was manufactured by cvs2svn to create tag 'OpenSSL-engine-
0_9_6c'.
2002-02-15 07:41:44 +00:00
cvs2svn
5ec27eacf0 This commit was manufactured by cvs2svn to create branch 'OpenSSL-engine-
0_9_6-stable'.
2002-02-15 07:41:43 +00:00
Lutz Jänicke
f0d6ee6be8 Even though it is not really practical people should know about it. 2002-02-15 07:41:42 +00:00
Bodo Möller
e65991f977 fix indentation 2002-02-14 16:08:55 +00:00
Richard Levitte
3e83e686ba Add the configuration target VxWorks. 2002-02-14 15:37:38 +00:00
Bodo Möller
8f06b00373 make it possible to disable memory checking for timings 2002-02-14 14:41:13 +00:00
Bodo Möller
1dea1f4509 '-C' is still quite broken 2002-02-14 14:30:20 +00:00
Bodo Möller
44411db8e0 fix '-C' 2002-02-14 14:25:33 +00:00
Bodo Möller
23ac7a1407 fix memory leak 2002-02-14 14:21:49 +00:00
Richard Levitte
30b5ce14d8 Merge in recent changes from 0.9.6-stable. 2002-02-14 14:15:45 +00:00
Bodo Möller
dda640835f move ECDSA test right after EC test 2002-02-14 14:03:32 +00:00
Bodo Möller
6cc3700314 don't call OPENSSL_config(), this does not make any sense during "make test" 2002-02-14 13:51:20 +00:00
Richard Levitte
cc1489d2f2 Make sure memset() is defined by including string.h
Notified by Oscar Jacobsson <oscar@jacobsson.org>
2002-02-14 13:51:04 +00:00
Richard Levitte
016029c69f For some reason, getting the topmost error was done the same way as
getting the bottommost one.  I hope I understood correctly how this
should be done.  It seems to work when running evp_test in an
environment where it can't find openssl.cnf.
2002-02-14 13:45:26 +00:00
Richard Levitte
516b848286 make update, with libeay.num remade to match the 0.9.7-stable one. 2002-02-14 13:43:30 +00:00
Richard Levitte
c4202285ef The Cygwin shared extension was shifted. 2002-02-14 13:36:28 +00:00
Richard Levitte
49e045482a At Corinna Vinschen's request, change CygWin32 to Cygwin 2002-02-14 12:28:24 +00:00
Bodo Möller
d8309efc72 EC_GROUP_get_group_by_name() is now called EC_GROUP_new_by_name() 2002-02-14 10:23:20 +00:00
Ben Laurie
f43acc8a50 Fix warnings. 2002-02-14 09:59:35 +00:00
Richard Levitte
ba47f5c9b0 Correct sh, please 2002-02-14 02:20:34 +00:00
Bodo Möller
4d94ae00d5 ECDSA support
Submitted by: Nils Larsch <nla@trustcenter.de>
2002-02-13 18:21:51 +00:00
Bodo Möller
60d8bae30d some modifications to named curve support 2002-02-13 17:57:52 +00:00
Richard Levitte
0caec9e8f8 Modify the main trunk version to 0.9.8-dev.
0.9.7 now lives in the branch OpenSSL_0_9_7-stable.
2002-02-13 17:46:38 +00:00
Bodo Möller
4f85a2e21e new locks 2002-02-13 17:25:27 +00:00
Bodo Möller
945e15a253 add support for named curves
Submitted by: Nils Larsch <nla@trustcenter.de>
2002-02-13 17:22:59 +00:00
Richard Levitte
1fe198b6f9 Update the configuration of CygWin32 to use the new capabilities of
CygWin 1.3.x, which includes thread and shared library support.

Submitted by Corinna Vinschen <vinschen@redhat.com> and modified a
little bit.
2002-02-13 14:44:33 +00:00
Bodo Möller
78d6603aad We should implement a countermeasure against the predictable-IV CBC
weakness in SSL/TLS
2002-02-13 10:21:25 +00:00
Richard Levitte
7241ae1a0a Move teh silencer to the right place. 2002-02-13 10:16:37 +00:00
Richard Levitte
5f58d6a5e0 Make link-shard a little bit more efficient. If there are no
extensions to link together, there's no point looping at all.
2002-02-13 10:15:05 +00:00
Lutz Jänicke
acfe628b6e Make removal from session cache more robust. 2002-02-10 12:46:41 +00:00
Bodo Möller
182d8435f0 add a wish 2002-02-09 01:49:53 +00:00
Lutz Jänicke
4de920c91d Do not store unneeded data. 2002-02-08 15:15:04 +00:00
Richard Levitte
3cd039dd8f Add notes on the added support for aep and sureware crypto cards in
0.9.7.
2002-02-07 22:15:53 +00:00
Richard Levitte
ed2f196afe A number of corrections of the aep engine implementation:
1. rnd_reference was a duplication of the work the the engine
   framework does, and wasn't ever checked.  Removed.
2. use the NO_ macros to disable appropriate algorithms.
3. Only implement the RNG stuff if AEPRAND is defined (default: not
   defined, because the AEP people plan on having boards without it.
   I'll see if I can device a more dynamic way of disabling this).
4. aep_finish() now closes all connections, and if that worked, does a
   proper finalize.
5. proper AEP types are used to conform to the AEP definitions of
   their own functions.
6. remake the use of thread locks.  The use of CRYPTO_LOCK_DYNLOCK was
   definitely inappropriate, and for random generator stuff, it's
   better to use CRYPTO_LOCK_RAND.

Also, I applied certain changes that were provided by the AEP people.
Among others, BN_CTX_new() is not used to initialise a BN context
(this was never done before, and may have made things slower or not
working at all.
2002-02-07 22:04:30 +00:00
Richard Levitte
81269a81ee Remove an unused variable. 2002-02-07 21:55:22 +00:00
Richard Levitte
3537525e00 Oops, do not unlock CRYPTO_LOCK_DYNLOCK when we locked
CRYPTO_LOCK_RAND...
2002-02-07 21:49:21 +00:00
Richard Levitte
d38f3ad1ee I forgot to include the aep and sureware vendor header files. 2002-02-07 21:43:05 +00:00
Richard Levitte
e083f91497 Because AEP and we used the same AEP_R_ prefix for error reasons,
lets change our prefix to AEPHK_R_.  Otherwise, we get very mysterious
errors because we happen to redefine AEP_R_OK and AEP_R_GENERAL_ERROR.
2002-02-07 21:12:08 +00:00
Richard Levitte
ba2cad19cf Add aep and sureware implementations and clean up some error reasons
that were never part of the engine framework.

The aep and sureware implementations are taken directly from 0.9.6c
[engine] and have been modified to fit the newer engine framework and
to be possible to build shared libraries of.

The aep implementation has gone through quite a bunch of tests and is
cleaned up (there were some misunderstandings in it about how to use
locks).

The sureware hasn't been tested at all in this incarnation and is
basically a quick hack to get it to compile properly.
2002-02-07 20:44:14 +00:00
Richard Levitte
db0a1efcc9 Certain reasons aren't really part of the engine framework, so let's
make them ubsec-specific in the ubsec implementation.
2002-02-07 20:37:55 +00:00
Richard Levitte
9074521458 Generate the individual engines' error strings and macros
automatically.
2002-02-07 20:02:49 +00:00
Richard Levitte
f924200e1b If the intended header file doesn't exist, create it. 2002-02-07 19:23:35 +00:00
Richard Levitte
de2f6e4dae 'make update' 2002-02-05 17:34:58 +00:00
Richard Levitte
44bdb056d4 With the changed des_old API, let's complete the work by renaming the
functions in ui_compat.  This gave reason to rework that part more
thoroughly, so here are the changes made:

1. Add DES_read_password() and DES_read_2passwords() with the same
   functionality as the corresponding old des_ functions, as a
   convenience to the users.
2. Add UI_UTIL_read_pw_string() and UI_UTIL_read_pw() with the
   functionality from des_read_pw_string() and des_read_pw(), again as
   a concenience to the users.
3. Rename des_read_password(), des_read_2passwords(),
   des_read_pw_string() and des_read_pw() by changing des_ to
   _ossl_old_des_, and add the usual mapping macros.
4. Move the implementation of des_read_password() and
   des_read_2passwords() to the des directory, since they are tightly
   tied to DES anyway.

This change was inspired by a patch from Assar Westerlund <assar@sics.se>:

There are some functions that didn't get the kick-away-old-des-and-
replace-des-with-DES action.  Here's a patch that adds DES_ and des_
(in des_old.h) versions of des_read_pw_string et al.  This patch
includes some of the first des_old.h semi-colon macro fixes that I've
already sent.
2002-02-05 17:15:18 +00:00
Richard Levitte
c31bbf1e68 Apply one patch from Assar Westerlund <assar@sics.se>:
The following patch makes sure that string2key does not use weak DES
keys (then making them non-weak by xor:ing with 0xF0).
2002-02-05 15:05:42 +00:00
Richard Levitte
5e68f8ce15 Apply three patches from Assar Westerlund <assar@kth.se>:
This patch makes the macros in des_old.h actually pretend to be
functions.

There's no reason not to define _ossl_old_crypt when using
PERL5/FreeBSD/darwin/Next, since it makes using crypt and including
des.h break.  Here's a trivial patch.

This patch fixes some of the typos used in macro names in des_old.h
and the number of arguments for some of them.
2002-02-05 06:02:58 +00:00
Richard Levitte
b9a3ef4c6e ASN1_BIT_STRING_set_bit() didn't clear previously set bits 2002-02-03 21:31:41 +00:00
Dr. Stephen Henson
1955b87423 #undef some things that cause a conflict under Win32 when
wincrypt.h is included.
2002-02-02 13:19:27 +00:00
Richard Levitte
b860878edc Add missing declaration of ERR_load_SSL_strings(). 2002-01-30 16:45:22 +00:00
Richard Levitte
362771f880 Merge in the latest changes from 0.9.6-stable. 2002-01-30 15:48:01 +00:00
Lutz Jänicke
866eedb936 Shut up compiler warnings for inconsistent declarations. 2002-01-29 17:14:50 +00:00
Lutz Jänicke
f701551f36 HP-UX 32bit:
* When linking against shared libraries, the absolute path is remembered.
  - When linking against -L.., '..' is remembered inside the executable,
    so it will fail after "make install" or when not called from inside the
    "apps/" subdirectory of the build tree.
  - When using the "+cdp" option of "ld", the ".." information can be
    exchanged against $(INSTALL_TOP)/lib. In this case the executable
    will however refuse to work before "make install" has been called.
    This makes testing the 'openssl' executable a problem.
* Solution 1:
  Relink the "openssl" executable, when "make install" is called.
  This would however require significant changes to the toplevel Makefile
  and the apps/ Makefile.
* Solution 2:
  Statically link against libssl and libcrypto, so that the "openssl"
  executable is no longer dependant on the openssl shared libraries.

Select option 2 for HP-UX 32bit, as this requires the smallest change.
2002-01-29 16:32:40 +00:00
Lutz Jänicke
adc4df3616 Make SHLIB_TARGET available in subdirs (here: apps/) 2002-01-29 16:20:08 +00:00
Richard Levitte
1199e2d8cf Apply patch from Toomas Kiisk <vix@cyber.ee> and complete it. 2002-01-29 12:36:01 +00:00
Lutz Jänicke
0f180d1d1d Superflous '\' messes up with HP-UX make. 2002-01-28 16:30:06 +00:00
Bodo Möller
072569e0f1 Undo previous change, X509_check_issued() was correct.
[See
     Message-ID: <3BB07999.30432AD2@celocom.com>
     Date: Tue, 25 Sep 2001 13:33:29 +0100
     From: Dr S N Henson <drh@celocom.com>
     To: openssl-dev@openssl.org
     Subject: Re: Error in v3_purp.c
]
2002-01-27 17:41:12 +00:00
Richard Levitte
88e89f9022 For the sake of DOS and Windows, provide a different way to get a
pid_t.
2002-01-27 17:13:35 +00:00
Richard Levitte
ba9786e4b8 Spelling correction. 2002-01-27 16:12:27 +00:00
Richard Levitte
613599ffff Correct the number of colons for the targets aix43-cc, aix43-gcc,
alpha-cc, alpha-cc-rpath, alpha-gcc, alpha164-cc and alphaold-cc.
2002-01-27 16:03:40 +00:00
Richard Levitte
c9c21d3b89 Detect one-step shifts of the dso_scheme. 2002-01-27 15:58:34 +00:00
Richard Levitte
d0d046eca2 I got some reports that some targets have weird dso_schemes.
Therefore, I've added a sanity checker.

Note that it can be combined with almost any other argument (the other
arguments will be completely ignored), with "reconf" as the blatant
exception, since it also has the behavior of ignoring all following
command line arguments.  If --test-sanity and reconf are both used on
the command line, the first one wins.
2002-01-27 15:52:37 +00:00
Lutz Jänicke
2a81428489 Remove blanks at begin of empty lines irritating epv_test.c 2002-01-26 15:24:38 +00:00
Richard Levitte
7073e9e2a0 Update SCO5 targets. 2002-01-26 05:24:05 +00:00
Richard Levitte
d866df33a1 Apply a small patch from Dan Lanz <lanz@zolera.com> to get shared
libraries with debug-linux-elf.
2002-01-26 05:08:31 +00:00
Richard Levitte
b77fcddb6b Apply a small patch from Oscar Jacobsson <oscar@jacobsson.org> that
makes things more compilable with VC++.
2002-01-26 04:50:41 +00:00
Richard Levitte
f6fbd470e3 It looks like I didn't remove everything that has to do with the
non-existant aestest.c.
2002-01-26 04:45:37 +00:00
Richard Levitte
63810d8566 Apply a small patch from Diego R. Lopez <diego.lopez@rediris.es>,
making X509_check_issued() properly match an issuer that's found in a
Authority Key Identifier.
2002-01-26 04:25:16 +00:00
Richard Levitte
123c401967 GCC uses __i386__. 2002-01-26 03:57:41 +00:00
Richard Levitte
a3fffd648b Add old patch from Robert Dahlem <Robert.Dahlem@ffm2.siemens.de> to
make it possible to produce shared libraries on ReliantUNIX.
2002-01-26 03:17:27 +00:00
Richard Levitte
41aad62a78 Merge in the latest changes from the 0.9.6-stable branch. 2002-01-26 01:18:50 +00:00
Richard Levitte
2d57b73a50 I got a request to make the "old des" symbols more closely tied to
OpenSSL.  Adding '_ossl' in the name seems to be a good way to do
this.
2002-01-26 01:14:09 +00:00
Richard Levitte
f14845d999 Apply Neale Ferguson's patch to add a configuration target for linux-s390x 2002-01-25 22:06:59 +00:00
Richard Levitte
80bb905d3d Apply the following changes by Toomas Kiisk <vix@cyber.ee>:
* make openssl rsa work with -engine chil
* misc changes, including debug-linux-ppro Configure target
  and FORMAT_NETSCAPE-aware load_{,pub}key()

This completes the application of his changes.
2002-01-25 19:43:52 +00:00
Richard Levitte
3964db29c4 Apply a change by Toomas Kiisk <vix@cyber.ee>:
* Fix a crashbug and a logic bug in hwcrhk_load_pubkey()
2002-01-25 19:28:32 +00:00
Richard Levitte
e4f165e71e Apply a change by Toomas Kiisk <vix@cyber.ee>:
* Fix a crashbug and a logic bug in hwcrhk_load_pubkey()
2002-01-25 17:46:34 +00:00
Richard Levitte
a297985f42 Apply a change by Toomas Kiisk <vix@cyber.ee>:
* Fix a crashbug and a logic bug in hwcrhk_load_pubkey()
2002-01-25 17:45:30 +00:00
Richard Levitte
404dcc5e8e I must learn to compile before I commit... 2002-01-25 17:35:19 +00:00
Richard Levitte
8242a6a9fc Document the change in rsautl. 2002-01-25 17:00:56 +00:00
Richard Levitte
17bcb8d465 Add -keyform. Document -engine. 2002-01-25 16:51:46 +00:00
Richard Levitte
72165799a8 There is no aestest currently. The EVP tester is used to check the
AES algorithm.
2002-01-25 07:52:25 +00:00
Geoff Thorpe
f1c2a9de45 The 'type' parameter, an EVP_MD pointer, represents the type of digest
required as well as a default implementation (when no ENGINE provides a
replacement implementation). This change makes sure the correct
implementation's "init()" handler is used rather than assuming 'type'.
2002-01-25 03:13:50 +00:00
Richard Levitte
52b66a622d Keep the NIST AES vectors that were there previously. 2002-01-24 18:09:50 +00:00
Bodo Möller
273db408a8 sort functions ... 2002-01-24 17:17:33 +00:00
Bodo Möller
957b6db3b1 fix formatting of automatically generated error section 2002-01-24 16:20:42 +00:00
Bodo Möller
a14e2d9dfe New functions
ERR_peek_last_error
    ERR_peek_last_error_line
    ERR_peek_last_error_line_data
(supersedes ERR_peek_top_error).

Rename OPENSSL_NO_OLD_DES_SUPPORT into OPENSSL_DISABLE_OLD_DES_SUPPORT
because OPENSSL_NO_... indicates disabled algorithms (according to
mkdef.pl).
2002-01-24 16:16:43 +00:00
Bodo Möller
a8b94d6409 Reword CHANGES entry for _old_des_..., as it was a little complicated
syntactically.
2002-01-24 14:05:55 +00:00
Richard Levitte
fe19c448f0 make update
libeay.num got tweaked so the old des symbols would retain their
positions.
2002-01-24 12:31:54 +00:00
Richard Levitte
fcf6473199 Because of recent changes, there's no need to hack the des symbols any
more.
2002-01-24 12:30:15 +00:00
Richard Levitte
1285221370 To avoid all kinds of link-level clashes, rename all old des_*
functions to _old_des_*.
2002-01-24 12:26:50 +00:00
Richard Levitte
5dcf517d84 To avoid all kinds of link-level clashes, rename all old des_*
functions to _old_des_*.
2002-01-24 12:19:13 +00:00
Lutz Jänicke
9b2f486c9e Document the current behaviour of the DES interface. 2002-01-23 10:12:45 +00:00
Ben Laurie
24995f3a10 Support old DES APIs by default. 2002-01-22 23:19:01 +00:00
Ben Laurie
0fc5cf0870 Make no config file not an error. Move /dev/crypto config to ctrl. 2002-01-22 22:29:58 +00:00
Dr. Stephen Henson
f78d4a35f8 Constification. 2002-01-22 02:06:33 +00:00
Dr. Stephen Henson
df5eaa8a52 default_algorithms option in ENGINE config. 2002-01-22 01:40:18 +00:00
Lutz Jänicke
6ce46d69f5 Typos (jsyn <jsyn@openbsd.org>). 2002-01-21 18:01:46 +00:00
Lutz Jänicke
575e664a7c Fix incorrect BIO_*_ctrl() macros (Shay Harding <sharding@ccbill.com>). 2002-01-21 17:59:37 +00:00
Richard Levitte
7389c848d4 Use FIPS-197 vectors for AES. The NIST vectors were constructed by
reencrypting or redecrypting the ciphertext 10000 times, which of
course gives higly different results.
2002-01-21 17:55:38 +00:00
Richard Levitte
4d393410f3 Add more of the NIST test vectors for AES.
For some reason, they give incorrect results with the OpenSSL
implementation.  I wonder why...
2002-01-21 16:09:45 +00:00
Richard Levitte
bd69750360 Bring VMS up to date with development. 2002-01-21 15:37:53 +00:00
Dr. Stephen Henson
c9501c223f Initial ENGINE config module, docs to follow.
Fix buffer overrun errors in OPENSSL_conf().
2002-01-21 03:02:36 +00:00
Ben Laurie
9dd5ae6553 Constification, add config to /dev/crypto. 2002-01-18 16:51:05 +00:00
Bodo Möller
e1e876072d disable broken code 2002-01-18 12:28:05 +00:00
Ben Laurie
dd2589494f Other errors are possible. 2002-01-18 12:19:24 +00:00
Ben Laurie
1cfa8a397f Stupid apps should die, not fail silently. 2002-01-18 11:46:39 +00:00
Ben Laurie
bdae099862 Fix memory leak. 2002-01-18 11:32:30 +00:00
Ben Laurie
cca28b291c Constification, missing declaration, update dependencies. 2002-01-18 10:59:43 +00:00
Geoff Thorpe
062d3e39e7 Correct for the recent prototype changes. 2002-01-17 01:51:37 +00:00
Ulf Möller
e29f478a7a *** empty log message *** 2002-01-16 19:22:13 +00:00
Geoff Thorpe
1b58b616e3 Produce less confusing statistics when "-out_totals" is used. 2002-01-16 05:31:02 +00:00
Geoff Thorpe
c70d381775 The sample certs had expired, so these are newer ones that should last
quite a bit longer.
2002-01-16 05:29:11 +00:00
Bodo Möller
508d8b1617 run test_evp before test_ssl 2002-01-15 11:43:51 +00:00
Bodo Möller
8c74b5e56c Bugfix: In ssl3_accept, don't use a local variable 'got_new_session'
to indicate that a real handshake is taking place (the value will be
lost during multiple invocations). Set s->new_session to 2 instead.
2002-01-14 23:40:26 +00:00
Bodo Möller
c59ba5b528 Return -1 from ssl3_get_server_done (ssl3/s3_clnt.c) if
the SSL_R_LENGTH_MISMATCH error is detected.
2002-01-14 12:37:59 +00:00
Ben Laurie
45d87a1ffe Prototype info function. 2002-01-12 15:56:13 +00:00
Ben Laurie
a3feb21bbe Add client_cert_cb prototype. 2002-01-12 13:15:40 +00:00
Ben Laurie
37530362fa Return value could be undefined. 2002-01-12 13:13:22 +00:00
Geoff Thorpe
fd69886aed - Network errors could pollute the buffers because -1 isn't noticed in an
"unsigned int".
- Remove redundant processing with machine->ssl is NULL.
- Remove compiler warnings about uninitialised 'ctx' (it's not used
  uninitialised, but gcc can't see that).
2002-01-10 06:03:12 +00:00
Richard Levitte
fd795679bb Patches to make OpenSSL compilable on MacOS/X.
Submitted by Pier Fumagalli <pier@betaversion.org>
2002-01-08 09:19:31 +00:00
Geoff Thorpe
e523f5f389 - libtool finally annoyed me too much, so I'm nuking it,
- tidy up some output,
- print a warning when running an SSL server with no cert,
- only log each connect/disconnect if the new "-out_conns" switch is used.
2002-01-08 02:58:55 +00:00
Geoff Thorpe
e4dd79bbc8 - Add the same header stuff to aes_locl.h as is in des_locl.h to avoid
undefined functions (memset, etc).
- Put a .cvsignore in the aes directory too.
2002-01-05 12:55:08 +00:00
Dr. Stephen Henson
bc37d996fc Experimental configuration code.
Incomplete, largely untested and subject to change/deletion.
2002-01-05 01:37:16 +00:00
Bodo Möller
31cafe53c9 add a sentence previously deleted by accident 2002-01-04 15:22:40 +00:00
Bodo Möller
dc4ddcd2bb add documentation for SSLeay_version(SSLEAY_DIR) and
'openssl version -d'

use some descriptions from Lutz' redundant manual page
instead of the previous ones
2002-01-04 15:17:09 +00:00
Lutz Jänicke
5256b021f3 Tsss, SSLeay_version() was already documented, it just was not linked in. 2002-01-04 15:05:51 +00:00
Bodo Möller
1bb68d62ab synchronize with engine-0.9.6 tree 2002-01-04 15:03:25 +00:00
Lutz Jänicke
4ab1e7ceaf Add information as provided by Richard Levitte on openssl-users :-) 2002-01-04 14:55:38 +00:00
Dr. Stephen Henson
06623ff028 Update PEM docs 2002-01-04 13:35:37 +00:00
Bodo Möller
67d48c8cc8 fix 'Configure TABLE' output 2002-01-04 13:30:05 +00:00
Bodo Möller
d59fb0dd2f Changes that break something should be included in CHANGES
to make it easier to fix things.
2002-01-04 13:27:52 +00:00
Bodo Möller
245f44e2ab add automatically generated ERR_load_... prototype 2002-01-04 13:12:08 +00:00
Bodo Möller
e5d6528a12 fix EVP_CIPHER_mode macro
Submitted by: "Dan S. Camper" <dan@bti.net>
2002-01-04 13:04:45 +00:00
Geoff Thorpe
980afccf98 Constify. 2002-01-04 07:01:35 +00:00
Richard Levitte
9bd2cd745f Better clarification on perl 2002-01-03 18:53:47 +00:00
Richard Levitte
015fbde807 make update 2002-01-02 17:31:23 +00:00
Richard Levitte
ba1b888384 Implement speed measurement for AES.
Submitted by Stephen Sprunk <stephen@sprunk.org> as part of his AES
integration patch.
2002-01-02 16:57:57 +00:00
Richard Levitte
6f9079fd50 Because Rijndael is more known as AES, use crypto/aes instead of
crypto/rijndael.  Additionally, I applied the AES integration patch
from Stephen Sprunk <stephen@sprunk.org> and fiddled it to work
properly with the normal EVP constructs (and incidently work the same
way as all other symmetric cipher implementations).

This results in an API that looks a lot like the rest of the OpenSSL
cipher suite.
2002-01-02 16:55:35 +00:00
Richard Levitte
c938563a81 The block size may be something other than 8! 2002-01-02 16:51:17 +00:00
Richard Levitte
40928698bb When RSA or DSA are disabled, do not include the stuff that's specific
to them.
2002-01-02 12:45:51 +00:00
Richard Levitte
138d8ab0c7 make update 2002-01-02 12:44:54 +00:00
Richard Levitte
47cc5525a2 RSA counter should only be defined of RSA is available. 2002-01-02 12:40:38 +00:00
Richard Levitte
67fec850e1 Allow verification of other types than DATA.
Submitted by Leonard Janke <leonard@votehere.net>
2002-01-02 11:54:38 +00:00
Richard Levitte
82db6e1646 Say that recent CygWin perl versions work as well.
Submitted by Eric Hanchrow <erich@votehere.net>
2002-01-02 11:25:17 +00:00
Richard Levitte
e7227322b3 Allow 8-bit characters. This is not really complete, it only marks
characters with the highest bit set as HIGHBIT.  We need to expand
this to support the UTF-8 character set properly.  However, this
solves the problem that the character 0x80 (which is common in UTF-8)
gets masked to 0x00.
Patch submitted by "Huang Yuzhen" <huangyuzhen@bj.tom.com>
2002-01-02 11:06:02 +00:00
Richard Levitte
a5595fde9a On Solaris64, cc needs the flag -xarch=v9 when linking shared
libraries.  Make a general change to support shared library
linking flags in general.
Noted by Nick Briggs <briggs@parc.xerox.com>
2002-01-02 10:30:07 +00:00
Richard Levitte
95f8c7195c Add support for Linux on HP/PA.
Submitted by "Bryan W. Headley" <bheadley@interaccess.com>
2002-01-02 10:00:22 +00:00
Ulf Möller
dcbbf83dba ssl3_read_bytes bug fix
Submitted by: D P Chang <dpc@qualys.com>
Reviewed by: Bodo
2001-12-28 17:14:35 +00:00
Bodo Möller
3c89d78dba update FAQ and CHANGES file (0.9.6c has been released) 2001-12-21 12:29:52 +00:00
Richard Levitte
60a9cbdf28 Status update 2001-12-21 03:23:29 +00:00
Richard Levitte
84fcd6f83e Status update 2001-12-21 03:23:15 +00:00
Richard Levitte
d3948ca262 The release has been tagged, so let's move on to 0.9.6d, which we hope will never be released. 2001-12-21 02:27:44 +00:00
Richard Levitte
85939d5dd7 Time to release 0.9.6c [engine]. The tag will be OpenSSL-engine-0_9_6c 2001-12-21 01:57:16 +00:00
Richard Levitte
532fd8ee1c And just for the sake of completeness, let's add some standard macros... 2001-12-21 01:13:01 +00:00
Richard Levitte
a92ae07091 And just for the sake of completeness, let's add some standard macros... 2001-12-21 01:12:29 +00:00
Richard Levitte
fb3af5c813 Better use the same number in all branches, to avoid confusion 2001-12-21 01:09:34 +00:00
Richard Levitte
68809d3969 Better use the same number in all branches, to avoid confusion 2001-12-21 01:08:40 +00:00
Richard Levitte
6d6846417f really make update, this time... 2001-12-20 22:59:14 +00:00
Richard Levitte
47892635ad make update 2001-12-20 22:41:45 +00:00
Richard Levitte
d6a89fcf88 Do not forget to compile comp_err.c 2001-12-20 22:12:10 +00:00
Richard Levitte
5b9b38f0c9 Do not forget to compile comp_err.c 2001-12-20 22:11:05 +00:00
Richard Levitte
ef5f6a08ff Synchronise with the 0.9.6 branch. 2001-12-20 16:58:26 +00:00
Richard Levitte
d8e2daf1e0 Another merge from the 0.9.6 branch. 2001-12-20 16:53:55 +00:00
Ben Laurie
7c517a04b1 Security fix. 2001-12-20 12:18:08 +00:00
Richard Levitte
be29c93cf4 Another merge from the 0.9.6 branch. 2001-12-20 10:17:22 +00:00
Richard Levitte
6e19a04080 merge from the 0.9.6 branch. 2001-12-20 09:43:59 +00:00
Ulf Möller
d78e52987e Cygwin patch. Submitted by Michael Kobar <mkobar@lymeware.com> 2001-12-19 19:37:31 +00:00
Bodo Möller
755cc53a6e formatting consistency 2001-12-17 19:28:05 +00:00
Bodo Möller
1226c472b7 oops 2001-12-17 19:26:43 +00:00
Bodo Möller
4d7072f4b5 remove redundant ERR_load_... declarations 2001-12-17 19:22:23 +00:00
Bodo Möller
b5348a095d consistency with 0.9.6 stable "CHANGES" 2001-12-17 19:11:03 +00:00
Bodo Möller
66df02fd98 fix BN_rand_range 2001-12-14 10:09:29 +00:00
Richard Levitte
206eb6a11d Change pkcs12 so the certificates coming from -in do not get tossed if
-certfile is given as well.
2001-12-12 16:49:02 +00:00
Richard Levitte
f11fd3f4e1 Implement failover for ubsec. Submitted by Subramanian Ramamoorthy
<sram@broadcom.com> with the following comment:

[...] We have implemented failover (ie, if for some reason that the
hardware fails, the implementation detects this failure and performs
this operation as if no hardware is present, ie, in software) for
sometime now and have tested it here with our hardware. [...]

This change was cc:ed to exports@crypto.com
2001-12-12 12:53:13 +00:00
Richard Levitte
29b108f939 make update 2001-12-11 10:57:13 +00:00
Richard Levitte
91102def2e Make the type of hConnection consistent. 2001-12-11 07:40:51 +00:00
Richard Levitte
35933d170d Problem:
1. some platforms do not have inttypes.h, and chasing them down
   becomes ridiculous.  Therefore, uint64_t can't be used for 64-bit
   values.
2. some (other) platforms do not support "long long".

Solution: make AEP_U64 a struct with two longs unless long already is
64 bit long.

Also, restore all other types back to use unsigned char, unsigned int
and unsigned long.  Make sure that AEP_U32 actually becomes 32 bits,
even on platforms where long is 64 bits (actually, we're just guessing
that int will stay at 32 bits on those...).
2001-12-11 07:37:40 +00:00
Ulf Möller
31106cc750 name confusion with HP library function prototype (?) 2001-12-10 18:52:06 +00:00
Ben Laurie
ff3fa48fc7 Improve back compatibility. 2001-12-09 21:53:31 +00:00
Bodo Möller
87166e1fb6 fix warnings (one of them was clearly justified) 2001-12-07 17:02:01 +00:00
Dr. Stephen Henson
f3e24baddf Don't overwrite signing time. 2001-12-07 00:36:32 +00:00
Lutz Jänicke
a6977ee73d HPUX 9.X on m68k with gcc
("Anton J. Gamel" <gamel@anna.anatomie.uni-freiburg.de>)
2001-12-06 13:15:51 +00:00
Richard Levitte
d4704d5245 UID was never a lable for uniqueIdentifier. However, LDAP and certain
RFCs concerning X.500 directories use UID as a shorter name for the
attribute type userId, which is defined by CCITT and available through
RFCs 1274 and 2247.

Unfortunately, if some applications have used the name "UID" for the
uniqueIdentifier attribute type, they will produce incorrect results.
However, I found it better to follow the standards that are out there
rather than having our own incompatible one.
2001-12-04 11:01:17 +00:00
Richard Levitte
8f0edcb3d2 I was recently informed that some people wrongly use ssleay.txt as
main documentation, so let's warn them a little more, so the word
"OBSOLETE" really gets understood.
2001-12-04 07:38:17 +00:00
Bodo Möller
35e25255e0 crypto/objects stuff 2001-12-03 14:03:23 +00:00
Bodo Möller
c3fbf5d9a8 Fix: 2.5.29 is "id-ce", not "ld-ce" (sort of a typo in objects.h).
Fix (?): Delete 'ip-pda 6' (id-pda-pseudonym) because it does not exist
in RFC 3039.

Also change Perl scripts to put auto-generation warning in the
first lines of the file.
2001-12-03 13:47:22 +00:00
Dr. Stephen Henson
55e42c93a8 EVP_BytesToKey documentation. 2001-12-03 03:07:37 +00:00
Dr. Stephen Henson
6a0dec9584 Make EVP_SealInit() return the correct value. 2001-12-01 23:09:38 +00:00
Dr. Stephen Henson
21a85f1977 Add -pubkey option to req command. 2001-12-01 23:03:30 +00:00
Dr. Stephen Henson
322de0c8c1 NO_DSA, NO_RSA patches. 2001-12-01 22:41:39 +00:00
Lutz Jänicke
6a9af68b56 Support for QNX (wrat@jump.net (the wharf rat)). 2001-11-30 09:38:57 +00:00
Richard Levitte
270c75c2b1 Merge in latest changes from 0.9.6-stable. 2001-11-28 07:53:13 +00:00
Richard Levitte
b6e4dac217 Certain missing algorithms make some SSL versions or TLS impossible to
build.
2001-11-27 11:48:30 +00:00
Bodo Möller
8a0a9392ab discuss -name and default_ca more correctly (I hope) 2001-11-26 12:13:50 +00:00
Geoff Thorpe
bcbe4e5254 This looks to have been a typo. 2001-11-24 04:02:42 +00:00
Geoff Thorpe
9f44f4a081 This looks to have been a typo. 2001-11-24 03:57:57 +00:00
Bodo Möller
47ff5c6279 For future portability reasons MIT is moving all macros to function
calls.  This patch allows compilation either way.

Submitted by: Jeffrey Altman <jaltman@columbia.edu>
2001-11-23 21:50:50 +00:00
Bodo Möller
37749c8872 merge (new stuff from OpenSSL-0_9_6-stable) 2001-11-23 21:14:00 +00:00
Bodo Möller
898f856c44 info on 0.9.6 engine branch 2001-11-23 21:12:44 +00:00
Bodo Möller
883b0c2274 fix submitted by Andy Schneider <andy.schneider@bjss.co.uk>
(in main branch, hn_ncipher.c is already correct)
2001-11-23 20:58:40 +00:00
Bodo Möller
dae0b520a0 fixes submitted by Andy Schneider <andy.schneider@bjss.co.uk> 2001-11-23 20:56:27 +00:00
Bodo Möller
4f94d1a8b1 check OPENSSL_NO_... before including header files that might be
disabled
2001-11-22 11:13:10 +00:00
Bodo Möller
1d4581c2dd OS/390 support
Submitted by: Richard Shapiro <rshapiro@abinitio.com>
2001-11-22 11:09:42 +00:00
Bodo Möller
c05940edc7 comment 2001-11-22 11:08:38 +00:00
Geoff Thorpe
c507a16e49 Cut "ENGINE_ID" to the more concise "ID". 2001-11-22 10:08:49 +00:00
Geoff Thorpe
308f028e28 In this particular error condition, the structural reference wasn't being
released.
2001-11-22 09:20:08 +00:00
Geoff Thorpe
e4a6cf421a When the "dynamic" ENGINE loads another ENGINE from a shared-library, it
essentially overwrites itself with the new ENGINE, with the exception of
reference counts, ex_data structures, and other 'admin' elements. However
if the new ENGINE doesn't populate certain elements, there's the risk of
the "dynamic" ENGINE's elements showing through - the "cmd_defns" were just
one of the possibilities. This implements a more comprehensive cleanup.
2001-11-22 09:13:18 +00:00
Geoff Thorpe
329636d6e3 The "openssl" ENGINE is no longer used except as a testing/debugging
device. This change enables it for building as a self-contained "dynamic"
ENGINE, to help testing such mechanisms.
2001-11-22 09:01:11 +00:00
Geoff Thorpe
9163b8fb23 'flags' should only be set inside DSO_load() if constructing a new DSO
object - otherwise we overwrite any flags that had been previously set in
the DSO before calling DSO_load().
2001-11-22 08:48:09 +00:00
Richard Levitte
f1a185a04a Fix unexpected difference between the 0.9.6 and the 0.9.6 [engine]
branches.
2001-11-21 14:05:30 +00:00
Richard Levitte
60f3f6ac2e merge changes from the 0.9.6 branch. 2001-11-21 14:02:49 +00:00
Richard Levitte
595241e17f inttypes.h apparently doesn't exist with VC++. Therefore, use the
built-in types __int8, __int16 and so on on that platform.
2001-11-21 13:26:57 +00:00
Geoff Thorpe
c6d14d26fd Squash a VC++ warning. 2001-11-21 03:49:51 +00:00
Geoff Thorpe
832e09cd23 Testing on WIN32 turned up a faulty default value. 2001-11-20 05:19:20 +00:00
Richard Levitte
879d789a42 Extentions of the explanations to the linking problem on Win32. Provided by Andrew Gray <agray@iconsinc.com> 2001-11-19 20:47:02 +00:00
Richard Levitte
a542db90c6 Extentions of the explanations to the linking problem on Win32. Provided by Andrew Gray <agray@iconsinc.com> 2001-11-19 20:46:35 +00:00
Lutz Jänicke
a7ce69dbd7 Clarify reference count handling/removal of session
(shinagawa@star.zko.dec.com).
2001-11-19 11:11:23 +00:00
Richard Levitte
07ad3257fc unsigned long long is not accepted anywhere, especially on certain
32-bit platforms.  Instead, make use of inttypes.h and use the types
defined there to get 8-, 16-, 32- an 64-bit values.

There might be some operating systems where one should use int_types.h
instead of inttypes.h.  Unfortunately, I don't recall which one(s).
2001-11-17 23:01:25 +00:00
Geoff Thorpe
c02efd954d Note the new engine 2001-11-17 05:45:20 +00:00
Geoff Thorpe
b26f6ee5f2 Another ENGINE that's been working in 0.9.6-engine for a while that will
be included for 0.9.6c-engine.
2001-11-17 05:29:25 +00:00
Richard Levitte
b5719e9673 Use memset() instead of bzero(). 2001-11-16 23:31:07 +00:00
Richard Levitte
f56412e895 unsigned char * vs. char * 2001-11-16 23:28:45 +00:00
Richard Levitte
26e922fc7f Let's not forget the latest engines on VMS (at least see if they
compile properly).
2001-11-16 17:57:27 +00:00
Richard Levitte
9d93ce246c On VMS, the norm is still that symbols are uppercased, so for now it's better
to trust that norm.  I might implement a control for this later on
2001-11-16 13:12:19 +00:00
Bodo Möller
76c4336c43 wNAFs use does not bring that much performance on Sparcs (where
elliptic curves are are relatively faster than on PCs anyway)
2001-11-16 12:02:01 +00:00
Bodo Möller
e71adb85c5 avoid stupid compiler warning 2001-11-16 11:37:36 +00:00
Richard Levitte
033c51f0a3 Build dynamic rsaref engine on VMS. Tested on VAX so far. 2001-11-16 09:14:06 +00:00
Richard Levitte
452d1595a6 End assembler macro correctly.
On VAX, all global variables are accessed through functions, so skip
doing transfer entries for variables.

Forgot the looping gotos.
2001-11-16 09:09:15 +00:00
Richard Levitte
0d197a833c On systems that don't do too well including headers from a different
directory, trust the building scripts to handle it properly.
2001-11-16 08:54:34 +00:00
Richard Levitte
e0031b80ee Make sure evp_locl.h can be included (hw_openbsd_dev_crypto.c needs that). 2001-11-16 08:52:56 +00:00
Bodo Möller
b19941ab05 comment 2001-11-16 06:22:21 +00:00
Bodo Möller
752938daab use a more interesting test case 2001-11-16 06:22:05 +00:00
Bodo Möller
c78515f55e comments etc. 2001-11-15 22:35:41 +00:00
Bodo Möller
3ba1f11147 Improve EC efficiency. 2001-11-15 22:32:11 +00:00
Richard Levitte
bbc206fdf7 A missing comma added. 2001-11-15 22:29:02 +00:00
Richard Levitte
2bd065dfbe make update 2001-11-15 20:24:00 +00:00
Richard Levitte
6d7dbc12f2 Add MD digests.
And this finishes this engine, it now offers all ciphers and digests
that RSAref 2.0 has.
2001-11-15 20:23:29 +00:00
Richard Levitte
83c40e7fc0 Make it possible to give digest names as -evp arguments. 2001-11-15 20:19:40 +00:00
Richard Levitte
b5fe234588 Add DES functions.
Restructure the code and comment it a bit.
Prepare for the presence of digests.
2001-11-15 18:52:28 +00:00
Richard Levitte
e1a00d7d1d If an engine isn't built in, try loading it as a shareable library
instead.  This also makes it possible for users to simply give said
shareable library as argument for the -engine option.
2001-11-15 18:48:42 +00:00
Richard Levitte
acf60ef707 At least for the two common Unixly DSO loading methods, include the
system error in the error text.
2001-11-15 18:24:42 +00:00
Richard Levitte
c85a157854 Use the generated error code files. 2001-11-15 16:57:36 +00:00
Richard Levitte
0c5d16e4f5 'make update' + some touches. 2001-11-15 16:57:00 +00:00
Richard Levitte
bd2af5e707 Add targets to update the error code files. 2001-11-15 16:56:17 +00:00
Richard Levitte
58d55afa6f Add a local error code configuration file for the rsaref dynamic
engine.
2001-11-15 16:53:50 +00:00
Richard Levitte
6343e2fac3 Make it possible to build completely static, independent error C
files.
2001-11-15 16:52:10 +00:00
Richard Levitte
edcace97a8 Merge in latest changes from 0.9.6-stable.
make update
perl util/mkerr.pl -recurse -write -rebuild

(now, just look at the effect that last thing had on the ENGINE error
strings!  How did that unbalance between macros and strings happen?)
2001-11-15 13:33:08 +00:00
Richard Levitte
b476df64a1 make update
perl util/mkerr.pl -recurse -write -rebuild
2001-11-15 12:25:14 +00:00
Richard Levitte
8d5c834b34 Merg in latest changes from 0.9.6-stable. 2001-11-15 08:15:05 +00:00
Geoff Thorpe
b0eda65f1c "sureware" should not be "hwcrhk".
Also, the "to" variable used in cleanup is never non-NULL and is entirely
unused. As such, the cleanup might have been missed under genuine error
conditions and caused leaks and/or returned invalid pointers.
2001-11-15 02:51:01 +00:00
Geoff Thorpe
2395368e7f ENGINE support has not been put into dsaparam, so these declarations seem
to be pointless.
2001-11-15 01:58:32 +00:00
Richard Levitte
1d46b6b3b9 Make use of RSAref's header files instead of EAY's crafted rsaref.h. 2001-11-14 23:39:01 +00:00
Richard Levitte
bbb35447c4 In a Debian Linux environment, it's not a good idea, apparently, to
manually declare the include directory /usr/include at the same time
as the macro PROTOTYPES is defined with the value 1.  Besides,
/usr/include is the standard include directory anyway, so there's no
need to specify it explicitely.
2001-11-14 23:25:46 +00:00
Richard Levitte
6276f1e100 Add a demo that reimplements the RSAref glue in form of a dynamically
loadable engine.
2001-11-14 22:42:35 +00:00
Richard Levitte
5b8a57ecae After loading a dynamic engine, reset the command definitions to the
empty set.  This prevents engines that do not set the command
definitions themselves to inherit the ones from "dynamic", which would
otherwise be very confusing.
2001-11-14 22:32:19 +00:00
Richard Levitte
817dfc18a3 Change the order of events so the capabilities of loaded engines can
get listed as well.
2001-11-14 22:30:17 +00:00
Bodo Möller
0b0b2a8087 remove obsolete entry 2001-11-14 21:21:47 +00:00
Bodo Möller
c23d16ac19 cast to unsigned int, not to int to avoid the warning -- all these
values really are unsigned
2001-11-14 21:18:35 +00:00
Bodo Möller
1b28ed575b consistency between main branch and stable branch 2001-11-14 21:17:39 +00:00
Richard Levitte
135c0af1bb Implement STARTTLS for certain protocols, currently only supporting SMTP. 2001-11-14 13:57:52 +00:00
Richard Levitte
475918410b Remove temporary files 2001-11-14 10:58:37 +00:00
Richard Levitte
3102792161 unsigned int vs. int. 2001-11-14 10:55:29 +00:00
Richard Levitte
a291182757 Exclude .out files 2001-11-14 10:53:47 +00:00
Bodo Möller
95c0f198a7 fix warning (due to an error during manual conflict resolution) 2001-11-13 10:19:54 +00:00
Bodo Möller
947a85d022 Merge from OpenSSL_0_9_6-stable 2001-11-13 10:12:25 +00:00
Bodo Möller
b26ca3408c synchronise with 0.9.6 stable branch 2001-11-12 23:22:29 +00:00
Bodo Möller
da904c9cef synchronise with main 0.9.6 stable branch 2001-11-12 22:42:40 +00:00
Bodo Möller
83978bd37a information on 0.9.6c-engine 2001-11-12 22:10:15 +00:00
Mark J. Cox
a3790c0d01 Phew, finished
Submitted by:
Reviewed by:
PR:
2001-11-12 20:30:01 +00:00
Mark J. Cox
c3970428ac Back-port of Broadcom engine code from 0.9.7 to 0.9.6, but with a few
patches taken from Red Hat Linux 7.2.  Original code from Broadcom with
patches and backport by Nalin, more backport to fix warnings and const
changes by Mark
Submitted by: Mark Cox
Reviewed by:
PR:
2001-11-12 20:28:09 +00:00
Mark J. Cox
63b6090f7c I've still got one left; the backport of the Broadcom UBSEC driver to
0.9.6 that we've got - just waiting for clearance on that one
Submitted by:
Reviewed by:
PR:
2001-11-12 15:32:11 +00:00
Bodo Möller
c5571db0c2 Add unixware-7-gcc as in 0.9.6 branch (except that we need a 'sys_id'
field here, which is left empty).

Various configurations are *only* in the 0.9.6 branch at the moment:
  OpenUNIX
  OpenUNIX-8-gcc-shared
  OpenUNIX-8-shared
Either Configure or CHANGES must be changed to rectify the situation.
2001-11-12 15:31:39 +00:00
Mark J. Cox
b1d9279a41 Add initial support for Baltimore SureWare accelerator cards; this works
for acceleration only at the moment, but full key management is being
worked on for the future.  This code has been compiled cross-platform but
not extensively tested
Submitted by: Mark Cox, Baltimore Technologies
Reviewed by: Mark Cox
PR:
2001-11-12 15:21:55 +00:00
Mark J. Cox
c7d827fc90 Commit missing AEP files (oops)
Submitted by:
Reviewed by:
PR:
2001-11-12 12:11:06 +00:00
Bodo Möller
e0457d5f7c the PRNG race conditions were mostly a theoretical issue, remove from NEWS 2001-11-12 11:33:38 +00:00
Bodo Möller
ae52ec9869 add changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c 2001-11-12 11:28:15 +00:00
Mark J. Cox
37fe697597 Add support for AEP crypto cards to 0.9.6c. This patch is in Red Hat Linux
7.2 and been given extensive testing; it also compiles okay on our selection
of random machines (including 64-bit)
Submitted by: AEP, Mark Cox
Reviewed by: Mark Cox
PR:
2001-11-12 11:17:19 +00:00
Dr. Stephen Henson
0b33bc6b72 Add an FAQ. 2001-11-12 01:58:50 +00:00
Bodo Möller
7aa983c6db Order chronologically: move entry for recent s2_clnt.c/s2_srvr.c fixes
(nearly) to the top.

Move msg_callback entry to the top as the implementation for SSL 2.0
is based on the s2_clnt.c/s2_srvr.c changes.
2001-11-10 15:14:00 +00:00
Bodo Möller
2b90b1f344 make code a little more similar to what it looked like before the fixes,
call ssl2_part_read again to parse error message
2001-11-10 10:44:15 +00:00
cvs2svn
d8616888ee This commit was manufactured by cvs2svn to create branch 'OpenSSL-engine-
0_9_6-stable'.
2001-11-10 02:12:57 +00:00
Bodo Möller
65123f8064 remove incorrect 'callback' prototype 2001-11-10 02:12:56 +00:00
Bodo Möller
1d8634b110 msg_callback documentation 2001-11-10 02:12:09 +00:00
Bodo Möller
29e0c30c2a more output for SSL 2.0 in our msg_callback 2001-11-10 01:17:02 +00:00
Bodo Möller
cf82191d77 Implement msg_callback for SSL 2.0.
Important SSL 2.0 bugfixes (bugs found while implementing msg_callback).
2001-11-10 01:16:28 +00:00
Bodo Möller
3a8a0a3945 2001, not 2000 2001-11-09 13:15:05 +00:00
Bodo Möller
c5d4ab7e35 adjust to OpenSSL_0_9_6-stable version 2001-11-09 13:09:11 +00:00
Bodo Möller
b955dbd325 cast to 'unsigned long' before using ~ if we need an unsigned long result
Submitted by: "Stefan Marxen" <stefan.marxen@gmx.net>
2001-11-09 12:58:05 +00:00
Bodo Möller
45582d1e2b clarify 2001-11-08 14:54:21 +00:00
Bodo Möller
60c50cbf9c Don't define _REENTRANT here in e_os.h. On systems where we need
_REENTRANT if threads support is enabled, the ./Configure entry must
define it so that it ends up in CFLAG.
2001-11-08 14:32:06 +00:00
Dr. Stephen Henson
3a3619b46a PKCS#12 code fixes: initialize and cleanup digests and ciphers
properly.
2001-11-06 13:54:48 +00:00
Dr. Stephen Henson
b83eddc578 Win32 fixes. 2001-11-06 13:40:27 +00:00
Richard Levitte
7f558334ad des_old.h doesn't really need to include des.h, so don't. That will
avoid clashes with other code that have their own DES_ functions but
really only use OpenSSL's old des_ functions.
2001-11-06 11:37:14 +00:00
Dr. Stephen Henson
6229a5607c Fix email address delete code. 2001-11-06 01:44:21 +00:00
Richard Levitte
6acc3b9689 Place the OpenSSL-specific headers back so they always get included,
or we get a dependency war in Makefile.ssl
2001-11-05 18:18:12 +00:00
Richard Levitte
66aa856698 No need to include anything on systems that do not have /dev/crypt 2001-11-05 12:44:14 +00:00
Richard Levitte
f559f31bef DOS and Windows do not like unistd.h 2001-11-05 12:43:17 +00:00
Ben Laurie
3210b4fd14 If verify fails, say why. 2001-11-02 13:29:14 +00:00
Richard Levitte
a7b42009c4 Change the shared library support so the shared libraries get built
sooner and the programs get built against the shared libraries.

This requires a bit more work.  Things like -rpath and the possibility
to still link the programs statically should be included.  Some
cleanup is also needed.  This will be worked on.
2001-10-30 08:00:59 +00:00
Richard Levitte
7b5ffd6834 Addapt VMS scripts to the newer disk layout system ODS-5, which allows more than one period and mixed size characters in file names 2001-10-29 13:05:28 +00:00
Dr. Stephen Henson
9b55da73ca Another noemailDN fix. 2001-10-27 17:53:06 +00:00
Dr. Stephen Henson
e7156ff2e8 Allow ca to certify requests containing BMPStrings and UTF8Strings. 2001-10-27 17:04:47 +00:00
Dr. Stephen Henson
437db75b94 Bugfixes for noemailDN option. Make it use the
correct name (instead of NULL) if nomailDN is
not set, fix memory leaks and retain DN structure
when deleting emailAddress.
2001-10-27 17:03:20 +00:00
Dr. Stephen Henson
1586365835 Stop compiler warnings. 2001-10-27 00:18:04 +00:00
Dr. Stephen Henson
7d5b04db4e Add support for Subject Info Acess extension. 2001-10-27 00:16:53 +00:00
Bodo Möller
48b0cf8b10 Note BUF_MEM_grow() consistency fix. 2001-10-26 14:06:33 +00:00
Bodo Möller
b693f941fd Consistency fix in BUF_MEM_grow: Initialise to zero when new memory
had to be allocated, not just when reusing the existing buffer.
2001-10-26 13:12:25 +00:00
Bodo Möller
c602e7f4e8 disable caching in BIO_gethostbyname 2001-10-26 13:04:23 +00:00
Dr. Stephen Henson
1fc6d41bf6 New options to allow req to accept UTF8 strings as input. 2001-10-26 12:40:38 +00:00
Ulf Möller
a41477f92e remove compatibility notes that no longer apply 2001-10-25 17:45:25 +00:00
Richard Levitte
5f68c5feef Correct some links... 2001-10-25 16:56:06 +00:00
Richard Levitte
ee84a5a7fb Change the DES documentation to reflect the current status. Note that
some password reading functions are really part of the UI
compatibility library...
2001-10-25 16:55:17 +00:00
Richard Levitte
66d3e7481e Make sure openssl speed is compilable on systems where fork() doesn't
exist.  For now, that's all the ones we "support" except Unix.
2001-10-25 16:08:17 +00:00
Ben Laurie
0e21156333 Add paralellism to speed - note that this currently causes a weird memory leak. 2001-10-25 14:27:17 +00:00
Ben Laurie
f533b7780e Fix warning. 2001-10-25 14:24:59 +00:00
Bodo Möller
cc2f5a8022 Like MD_Init, MD now must include a NULL engine pointer in its definition. 2001-10-25 08:53:54 +00:00
Bodo Möller
b441bf9226 remove redundant definitions that are also in des.h 2001-10-25 08:46:10 +00:00
Bodo Möller
2a9aca32dc mention des_old.h 2001-10-25 08:44:10 +00:00
Bodo Möller
89da653fa6 Add '-noemailDN' option to 'openssl ca'. This prevents inclusion of
the e-mail address in the DN (i.e., it will go into a certificate
extension only).  The new configuration file option 'email_in_dn = no'
has the same effect.

Submitted by: Massimiliano Pala madwolf@openca.org
2001-10-25 08:25:19 +00:00
Bodo Möller
af50b58c3f filenames are des_old.[ch], not des.comp* 2001-10-25 08:23:13 +00:00
Bodo Möller
4d635a7001 Consistency with s2_... and s23_... variants (no real functional
change)
2001-10-25 08:17:53 +00:00
Richard Levitte
ce15d5a9dc Remove DES_random_seed() but retain des_random_seed() for now. Change
the docs to reflect this change and correct libeay.num.
2001-10-25 06:46:22 +00:00
Bodo Möller
ba1c602281 Assume TLS 1.0 when ClientHello fragment is too short. 2001-10-25 06:09:51 +00:00
Richard Levitte
cfc781be6e Have the removal warnings very high up in the source. 2001-10-25 05:37:10 +00:00
Richard Levitte
84acc3c2bc A C file is a C file is a C file! 2001-10-24 21:31:14 +00:00
Richard Levitte
c2e4f17c1a Due to an increasing number of clashes between modern OpenSSL and
libdes (which is still used out there) or other des implementations,
the OpenSSL DES functions are renamed to begin with DES_ instead of
des_.  Compatibility routines are provided and declared by including
openssl/des_old.h.  Those declarations are the same as were in des.h
when the OpenSSL project started, which is exactly how libdes looked
at that time, and hopefully still looks today.

The compatibility functions will be removed in some future release, at
the latest in version 1.0.
2001-10-24 21:21:12 +00:00
Bodo Möller
979689aa5c Fix SSL handshake functions and SSL_clear() such that SSL_clear()
never resets s->method to s->ctx->method when called from within
one of the SSL handshake functions.
2001-10-24 19:03:22 +00:00
Richard Levitte
a3faebd104 Deprecate the macro MAC_OS_pre_X. 2001-10-24 15:32:53 +00:00
Richard Levitte
025c7737b2 make update 2001-10-24 15:32:14 +00:00
Richard Levitte
513d4b4c16 make update 2001-10-24 08:27:22 +00:00
Richard Levitte
7ef701519b Correction of the id-pda OID's.
Submitted by Frederic.Giudicelli@INTRINsec.com
2001-10-23 14:30:57 +00:00
Dr. Stephen Henson
50d194af4d Sanitize CHANGES entry. 2001-10-23 00:54:58 +00:00
Bodo Möller
287973746e Fix memory leak. 2001-10-22 13:59:36 +00:00
Dr. Stephen Henson
f1558bb424 Reject certificates with unhandled critical extensions. 2001-10-21 02:09:15 +00:00
Dr. Stephen Henson
6ca487992b Stop spurious "unable to load config info" errors in req 2001-10-21 01:05:53 +00:00
Bodo Möller
cf3a5cebd7 Call msg_callback with correct length parameter if ssl3_write_bytes had to
be called multiple times
2001-10-20 18:56:01 +00:00
Bodo Möller
a661b65357 New functions SSL[_CTX]_set_msg_callback().
New macros SSL[_CTX]_set_msg_callback_arg().

Message callback imlementation for SSL 3.0/TLS 1.0 (no SSL 2.0 yet).

New '-msg' option for 'openssl s_client' and 'openssl s_server'
that enable a message callback that displays all protocol messages.


In ssl3_get_client_hello (ssl/s3_srvr.c), generate a fatal alert if
client_version is smaller than the protocol version in use.
Also change ssl23_get_client_hello (ssl/s23_srvr.c) to select TLS 1.0
if the client demanded SSL 3.0 but only TLS 1.0 is enabled; then the
client will at least see that alert.

Fix SSL[_CTX]_ctrl prototype (void * instead of char * for generic
pointer).

Add/update some OpenSSL copyright notices.
2001-10-20 17:56:36 +00:00
Dr. Stephen Henson
98e6654938 Typo. 2001-10-20 16:22:28 +00:00
Dr. Stephen Henson
cecd263878 Add missing EVP_CIPHER_CTX_{init,cleanup} 2001-10-20 16:18:03 +00:00
Bodo Möller
31fe950d2b gcc complained about "write" being shadowed even though the "write"
variable name occured just in a function *prototype* -- so rename it
2001-10-17 20:44:25 +00:00
Richard Levitte
db6a87d8cc Wrong place... 2001-10-17 17:54:17 +00:00
Richard Levitte
7beb408771 The EVP_*Init_ex() functions take one extra argument. Let's default
it to NULL.
2001-10-17 16:03:42 +00:00
Bodo Möller
51008ffce1 document SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 2001-10-17 11:56:26 +00:00
Dr. Stephen Henson
3811eed8d5 Update docs. 2001-10-17 01:50:32 +00:00
Dr. Stephen Henson
581f1c8494 Modify EVP cipher behaviour in a similar way
to digests to retain compatibility.
2001-10-17 00:37:12 +00:00
Lutz Jänicke
41ebed27fa Flush buffers to prevent mixed output (Adam Back <adam@cypherspace.org>). 2001-10-16 14:24:46 +00:00
Bodo Möller
bf21446a2a Add per-SSL 'msg_callback' with 'msg_callback_arg'.
Both have per-SSL_CTX defaults.
These new values can be set by calling SSL[_CTX]_[callback_]ctrl
with codes SSL_CTRL_SET_MSG_CALLBACK and SSL_CTRL_SET_MSG_CALLBACK_ARG.

So far, the callback is never actually called.


Also rearrange some SSL_CTX struct members (some exist just in
SSL_CTXs, others are defaults for SSLs and are either copied
during SSL_new, or used if the value in the SSL is not set;
these three classes of members were not in a logical order),
and add some missing assignments to SSL_dup.
2001-10-16 13:09:24 +00:00
Dr. Stephen Henson
e72d734d5f Update docs. 2001-10-16 02:22:59 +00:00
Dr. Stephen Henson
20d2186c87 Retain compatibility of EVP_DigestInit() and EVP_DigestFinal()
with existing code.

Modify library to use digest *_ex() functions.
2001-10-16 01:24:29 +00:00
Bodo Möller
9ba3ec9176 The message header for fake SSL 3.0/TLS 1.0 client hellos created from
SSL 2.0 client hellos added with the previous commit was totally wrong --
it must start with the message type, not the protocol version.
(Not that this particular header is actually used anywhere ...)
2001-10-16 00:56:04 +00:00
Bodo Möller
8f71fb8d98 For consistency, set s->init_num in the 'reuse_message' case
(if s23_srvr.c faked the message, s->init_num is 0).
2001-10-15 20:16:36 +00:00
Bodo Möller
48948d53b6 Change ssl3_get_message and the functions using it so that complete
'Handshake' protocol structures are kept in memory, including
'msg_type' and 'length'.

(This is in preparation of future support for callbacks that get to
peek at handshake messages and the like.)
2001-10-15 19:49:25 +00:00
Bodo Möller
dbec19622e make sure .rnd exists 2001-10-15 17:58:00 +00:00
Bodo Möller
2ce15df528 Fix ssl3_get_message handle message fragmentation correctly. 2001-10-15 17:41:41 +00:00
Bodo Möller
681bfae499 the previous commit accidentily removed 'ret = 1' from the SSL_ST_OK
case of ssl3_accept
2001-10-15 17:40:42 +00:00
Ulf Möller
5dd955dcd2 openbsd-x86 macros
Submitted by: Toomas Kiisk <vix@cyber.ee>
2001-10-14 00:57:30 +00:00
Lutz Jänicke
56fa8e69cf Update information as a partial response to the post
From: "Chris D. Peterson" <cpeterson@aventail.com>
  Subject: Implementation Issues with OpenSSL
  To: openssl-users@openssl.org
  Date: Wed, 22 Aug 2001 16:13:17 -0700
The patch included in the original post may improve the internal session
list handling (and is therefore worth a seperate investigation).
No change to the list handling will however solve the problems of incorrect
SSL_SESSION_free() calls. The session list is only one possible point of
failure, dangling pointers would also occur for SSL object currently
using the session. The correct solution is to only use SSL_SESSION_free()
when applicable!
2001-10-12 12:29:16 +00:00
Richard Levitte
67d0738aba In certain cases, no encoding has been set up for the b64 filter. In
such cases, a flush should *not* attempt to finalise the encoding, as
the EVP_ENCODE_CTX structure will only be filled with garbage.  For
the same reason, do the same check when a wpending is performed.
2001-10-11 19:38:40 +00:00
Richard Levitte
b8a61e7362 'make update' 2001-10-10 21:52:06 +00:00
Richard Levitte
dd5e774664 Add support for md4WithRSAEncryption. 2001-10-10 21:37:45 +00:00
Richard Levitte
6b86bad5ef For systems where gcc is used and where we don't know if GNU ld is
used or not, let's ask collect2 which ld it uses and choose to use the
target do-gnu_shared if GNU ld is used.

This solves the reported problems on Solaris systems where GNU cc is
used but GNU ld isn't, and probably on other systems with similar
setups.
2001-10-10 14:46:41 +00:00
Richard Levitte
712557128b 'make update' 2001-10-10 08:27:52 +00:00
Richard Levitte
3009e9f9ef It seems like gcc does canonicalisation of file names. More
specifically, a starting './' is removed.  makedepend doesn't do this,
resulting in another possible commit war, so let's fix that by doing a
poor mans canonicalisation of file names that gives the same effect as
doing dependencies through gcc.
2001-10-10 08:27:28 +00:00
Richard Levitte
b30245dae0 'make update' 2001-10-10 07:56:20 +00:00
Richard Levitte
116daf4c2f To avoid commit wars over dependencies, let's make it so things that
depend on the environment, like the presence of the OpenBSD crypto
device or of Kerberos, do not change the dependencies within OpenSSL.
2001-10-10 07:55:02 +00:00
Richard Levitte
cb40bdaf57 makedepend sometimes produces duplicates. Remove them. 2001-10-10 07:44:54 +00:00
Richard Levitte
4b12506891 A few more OIDs, contributed by Peter Sylvester <Peter.Sylvester@EdelWeb.fr> 2001-10-09 15:32:23 +00:00
Geoff Thorpe
cf98440178 evp_test.c and evptests.txt both need to be linked in the test/ directory
however for different reasons. This separation should prevent the win32
build from interpreting evptests.txt as source code.
2001-10-09 01:38:31 +00:00
Geoff Thorpe
c500d44735 Change some EVP prototypes to use "cipher" rather than "type" as a variable
name. The implementations already use this anyway.
2001-10-08 17:25:42 +00:00
Geoff Thorpe
18eda73234 EVP_EncryptInit_ex() and EVP_DecryptInit_ex() had been defined in evp.h but
not implemented. (Bug reported by Martin Szotkowski)

This also changes the non-"_ex" versions to defer directly to
EVP_CipherInit_ex() rather than EVP_CipherInit() to avoid an unecessary
level of indirection.
2001-10-08 17:24:10 +00:00
Geoff Thorpe
7526e2c043 As ENGINE_load_openbsd_dev_crypto() is an API function, it makes sense for
it to be defined on all platforms whether or not it is of any practical
use on them. This also resolves linker problems on "special" platforms,
such as win32.
2001-10-08 17:08:17 +00:00
Geoff Thorpe
6d52f260bf Make sure the "ENGINE_TABLE" cleanup callbacks have correct prototypes. 2001-10-08 17:06:52 +00:00
Geoff Thorpe
752f2b6785 Missing pointer in the eng_table_register function. Reported by
Martin Szotkowski.
2001-10-08 14:44:38 +00:00
Lutz Jänicke
e1c279b63d Small documentation fixes (Howard Lum <howard@pumpkin.canada.sun.com>) 2001-10-08 08:37:24 +00:00
Richard Levitte
467889703a Copy evptests.txt to the right place. 2001-10-04 21:15:03 +00:00
Richard Levitte
3a457cca86 Typo... 2001-10-04 19:25:12 +00:00
Richard Levitte
285046ec51 SSL_add_dir_cert_subjects_to_stack for Win32 finally implemented.
Submitted by Massimo Santin <msantin@santineassociati.com>.
2001-10-04 12:27:39 +00:00
Richard Levitte
f8000b9345 'make update' 2001-10-04 07:49:09 +00:00
Richard Levitte
77a8eb352f Since ossl_typ.h is an exported header, we sure need to export it on
VMS as well :-).
2001-10-04 07:46:30 +00:00
Richard Levitte
114697bef3 Because there's chances we clash with the system's types.h, rename our
types.h to ossl_typ.h.
Also, it seems like krb5 was forgotten in some places.
2001-10-04 07:34:45 +00:00
Richard Levitte
2aa9043ad3 Because there's chances we clash with the system's types.h, rename our
types.h to ossl_typ.h.
2001-10-04 07:32:46 +00:00
Dr. Stephen Henson
1a095560f7 Use the maximum block length for the extra size in the encrypt
BIO buffer instead of hard coding it as 8.
2001-10-03 12:47:03 +00:00
Dr. Stephen Henson
f329b8d73b Make EVP_DecryptUpdate work again. 2001-10-02 16:19:49 +00:00
Richard Levitte
3d90a32429 sch isn't an array, how did this pass through gcc? 2001-10-02 11:49:55 +00:00
Richard Levitte
e3a7463c5d A lot of things are undeclared unless x509.h is included. 2001-10-02 11:06:42 +00:00
Richard Levitte
796c6eadcb Hmm, everything "open" isn't necessarely "openssl" :-).
*sigh* habit...
2001-10-02 10:03:15 +00:00
Richard Levitte
b485e5b7e3 Woopsie... 2001-10-01 17:20:28 +00:00
Richard Levitte
d1cc7b8f22 'make update' 2001-10-01 17:16:24 +00:00
Richard Levitte
1cf9d58cb4 sk_ENGINE_CLEANUP_ITEM_pop_free() is duplicated in ENGINE_cleanup().
Let's use sk_ENGINE_CLEANUP_ITEM_pop_free() instead.
2001-10-01 17:15:28 +00:00
Richard Levitte
0cff933416 Addapt seldom compiled code to new semantics of the key schedule (not
a pointer any more).
2001-10-01 17:10:10 +00:00
Richard Levitte
c41b29e5db Some new symbols have very long names... 2001-10-01 17:09:17 +00:00
Richard Levitte
65fb3fa630 o_time.c contains symbols with dollar signs in them, so we must tell
the compiler not to warn about that.
2001-10-01 17:08:18 +00:00
Geoff Thorpe
0b0f08dbc7 The cleanup stack in ENGINE changed slightly, so this "make update" is
needed.
2001-10-01 16:39:58 +00:00
Geoff Thorpe
5c32657c80 The STACK macros take care of casting to and from the designated item type
of the stack, and the (void *) type used in the underlying sk_***
functions.  However, declaring a STACK_OF(type) where type is a *function*
type implicitly involves casts between function pointers and data pointers.
That's a no-no. This changes the ENGINE_CLEANUP handling to use a regular
data type in the stack.
2001-10-01 16:26:00 +00:00
Geoff Thorpe
07cee70258 Make an (overdue) note about the recent ENGINE restructuring. Apart from
a few items however, most of the details are deferred to the
crypto/engine/README file.
2001-10-01 15:56:25 +00:00
Geoff Thorpe
4ba163cbf9 Make "openssl engine -c" list any supported digests as well as supported
ciphers.
2001-10-01 15:41:31 +00:00
Lutz Jänicke
2bfb2398e3 Typos (Chris Pepper <pepper@mail.reppep.com>) 2001-10-01 14:43:47 +00:00
Richard Levitte
a4a8f7b3ef Change HZ in speed to rely on sysconf() if the clock tick is available
that way.  Synchronise s_time with these changes.
2001-09-28 10:34:48 +00:00
Geoff Thorpe
34c66925aa ENGINE_register_all_complete() will register all implementations of all
algorithms present in all loaded ENGINEs. The result is that if any of
those ENGINEs successfully initialises, and the ENGINE_TABLE_FLAG_NOINIT
flag isn't set, then they will always be used (and cached as defaults) in
preference to software implementations. Ie. accidental auto-detection of
acceleration hardware :-)

This change stops all implementations being automatically registered in
"openssl" sub-commands, so that the "setup_engine()" handler in apps.c
controls which ENGINEs are registered for use. A special case has been
added that will revert to this "auto-detect" logic, ie. if the "-engine"
switch is used as;
   -engine auto
2001-09-28 02:25:14 +00:00
Dr. Stephen Henson
cb7fd76f57 Modernise and fix (ancient) "maurice" demos. 2001-09-28 01:48:34 +00:00
Dr. Stephen Henson
de822715b2 Constify EVP_SealInit, EVP_OpenInit 2001-09-28 01:47:36 +00:00
Dr. Stephen Henson
89f534e1d3 Make (ancient) sign.c demo compile again. 2001-09-28 00:47:36 +00:00
Dr. Stephen Henson
d46c1a8126 Support fractional seconds in GeneralizedTime 2001-09-28 00:44:44 +00:00
Richard Levitte
e32587d5a6 Synchronise with Unixly build. 2001-09-27 16:07:36 +00:00
Richard Levitte
7876e4488f Stop thinking arguments starting with - are algorithm identifiers.
Show timing parameters and timing functions used.
It looks like some Linuxen have very weird settings for CLK_TCK.  I'm
very unsure about this change and will investigate further.
2001-09-27 15:43:55 +00:00
Richard Levitte
1a19f83d4c Apparently, Linux is identified with __linux__ as well. 2001-09-27 15:41:34 +00:00
Richard Levitte
db8c838c6a 'make update' 2001-09-26 15:23:14 +00:00
Richard Levitte
37da54b10e The #error message must match a very specific regexp (see mkdef.pl,
currently line 470).
2001-09-26 15:18:32 +00:00
Ben Laurie
0fea7ed4a4 Don't clean up stuff twice. 2001-09-26 15:15:03 +00:00
Ben Laurie
dbeac560aa Fixes. 2001-09-26 15:14:10 +00:00
Richard Levitte
89eeccacde Two changes:
1. if there are several symbols with the same entry number, sort those
   symbols in ASCII order.
2. Do not stop reading the header files when "BEGIN ERROR CODES" is
   found, since mkerr.pl will add a function declaration after that
   comment.  Instead, trigger on "Error codes for the \w+ function",
   which is the actual start of the error code macros.

Additionally, a few more debugging printouts that helped.
2001-09-26 15:06:45 +00:00
Ben Laurie
c9fc143972 Fix warning. 2001-09-26 11:38:57 +00:00
Geoff Thorpe
004aa803a9 "FALLBACK" handling was a hack that was thrown out long ago in the
ENGINE redevelopment. The idea had been that "-1" could be used as a
special "ask me later" 'nid' rather than specifying supported cipher and
digest 'nid's up front. However the idea turned out to be pretty broken.
2001-09-25 21:52:39 +00:00
Geoff Thorpe
c921a5e1d4 Make update to bring in all the cipher/digest-related ENGINE changes.
NB: It looks like mkdef.pl is causing certain cvs wars by continually
flipping the order of some definitions ...
2001-09-25 21:47:27 +00:00
Geoff Thorpe
0b4b9a11f5 Put the cipher info back into the "openssl engine" command. 2001-09-25 21:45:03 +00:00
Geoff Thorpe
d7e0299792 Fiddling. 2001-09-25 21:44:12 +00:00
Geoff Thorpe
9dfdf0ad1d This change puts the original OpenBSD /dev/crypto support that was in
crypto/evp/ into the corresponding ENGINE. This code is currently untested.
2001-09-25 21:43:08 +00:00
Geoff Thorpe
3b04cdd706 This change adds dummy RC4 and SHA1 support to the "openssl" ENGINE for
testing. Because of the recent changes (see crypto/engine/README), the
"openssl" ENGINE is no longer needed nor is it loaded automatically or by
ENGINE_load_builtin_engines(). So a explicit ENGINE_load_openssl() call is
required by applications or a modification to eng_all.c before this ENGINE
will be used. This change will send output to stderr as/when its
implementations are used.
2001-09-25 21:41:20 +00:00
Geoff Thorpe
11a57c7be5 This changes EVP's cipher and digest code to hook via the ENGINE support.
See crypto/engine/README for details.

- it also removes openbsd_hw.c from the build (that functionality is
  going to be available in the openbsd ENGINE in a upcoming commit)

- evp_test has had the extra initialisation added so it will use (if
  possible) any ENGINEs supporting the algorithms required.
2001-09-25 21:37:02 +00:00
Geoff Thorpe
b370230b78 This change adds cipher and digest support into ENGINE using the
ENGING_TABLE mechanism. The necessary hooks from crypto/evp/ to use this
will be committed shortly.
2001-09-25 21:28:40 +00:00
Geoff Thorpe
50a381b789 indentation. 2001-09-25 21:22:32 +00:00
Geoff Thorpe
534aaf3731 "make update". 2001-09-25 20:39:59 +00:00
Geoff Thorpe
6dc5d570d0 Make necessary tweaks to apps/ files due to recent ENGINE surgery. See
crypto/engine/README for details.
2001-09-25 20:35:01 +00:00
Geoff Thorpe
cb78486d97 This commits changes to various parts of libcrypto required by the recent
ENGINE surgery. DH, DSA, RAND, and RSA now use *both* "method" and ENGINE
pointers to manage their hooking with ENGINE. Previously their use of
"method" pointers was replaced by use of ENGINE references. See
crypto/engine/README for details.

Also, remove the ENGINE iterations from evp_test - even when the
cipher/digest code is committed in, this functionality would require a
different set of API calls.
2001-09-25 20:23:40 +00:00
Geoff Thorpe
9c9aa4f145 This commits the changes to STACK macros forced by recent ENGINE surgery. 2001-09-25 20:17:15 +00:00
Geoff Thorpe
b6d1e52d45 This change replaces the ENGINE's underlying mechanics with the new
ENGINE_TABLE-based stuff - as described in crypto/engine/README.

Associated miscellaneous changes;
 - the previous cipher/digest hooks that hardwired directly to EVP's
   OBJ_NAME-based storage have been backed out. New cipher/digest support
   has been constructed and will be committed shortly.
 - each implementation defines its own ENGINE_load_<name> function now.
 - the "openssl" ENGINE isn't needed or loaded any more.
 - core (not algorithm or class specific) ENGINE code has been split into
   multiple files to increase readability and decrease linker bloat.
 - ENGINE_cpy() has been removed as it wasn't really a good idea in the
   first place and now, because of registration issues, can't be
   meaningfully defined any more.
 - BN_MOD_EXP[_CRT] support is removed as per the README.
 - a bug in enginetest.c has been fixed.

NB: This commit almost certainly breaks compilation until subsequent
changes are committed.
2001-09-25 20:00:51 +00:00
Geoff Thorpe
f185e725a0 Some major restructuring changes to ENGINE, including integrated cipher and
digest support, are on their way. Rather than having gigantic commit log
messages and/or CHANGES entries, this change to the README will serve as an
outline of what it all is and how it all works.
2001-09-25 19:31:30 +00:00
Dr. Stephen Henson
591ccf586d Fix AES CBC mode EVP_CIPHER structures: the IV length is always
16.
2001-09-25 13:49:58 +00:00
Bodo Möller
b7061c61b0 'openssl rsa' etc. should include AES support in addition to DES 2001-09-25 11:01:14 +00:00
Bodo Möller
8a428200a6 'openssl speed' does not include AES support yet 2001-09-25 10:30:15 +00:00
Geoff Thorpe
10b2328fea "make update" 2001-09-24 17:42:35 +00:00
Richard Levitte
98c2a26ea6 In case of memory problems, the va_start() wasn't cleaned with a va_end().
Noticed by Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>.
2001-09-24 13:39:48 +00:00
Bodo Möller
965b6dad44 comment 2001-09-24 07:56:45 +00:00
Bodo Möller
a3d8c0fc5d ignore binary 2001-09-24 07:56:02 +00:00
Bodo Möller
a32d795aae avoid everything resembling a magic trigraph 2001-09-24 07:54:11 +00:00
Bodo Möller
ef3dc028ef The 'no-rijndael' option must define OPENSSL_NO_AES because that is
what we look for in crypto/evp.
2001-09-22 01:40:47 +00:00
Bodo Möller
2413a3975f crypto/idea and crypto/rijndael were missing in the list of
directories that may have been deleted
2001-09-22 01:39:51 +00:00
Bodo Möller
3b0b5abae3 bugfix: handle HelloRequest received during handshake correctly 2001-09-21 11:18:40 +00:00
Bodo Möller
b49124f6d9 Disable session related stuff in SSL_ST_OK case of ssl3_accept if we
just sent a HelloRequest.
2001-09-21 07:01:25 +00:00
Bodo Möller
2260ad21fb Bugfix: correct cleanup after sending a HelloRequest 2001-09-21 00:04:15 +00:00
Bodo Möller
6b0e9facf4 New function SSL_renegotiate_pending().
New option SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION.
2001-09-20 22:54:09 +00:00
Bodo Möller
c404ff7955 make update 2001-09-20 22:52:19 +00:00
Bodo Möller
8e2f6b79ea fix ssl3_accept: don't call ssl_init_wbio_buffer() in HelloRequest case 2001-09-20 21:37:13 +00:00
Bodo Möller
ee60d9fb28 Fix ssl/s3_enc.c, ssl/t1_enc.c and ssl/s3_pkt.c so that we don't
reveal whether illegal block cipher padding was found or a MAC
verification error occured.

In ssl/s2_pkt.c, verify that the purported number of padding bytes is in
the legal range.
2001-09-20 18:35:52 +00:00
Bodo Möller
be6d77005f comments 2001-09-20 15:41:34 +00:00
Bodo Möller
b263b66746 Change Makefile so that it works without any additional changes
at least on Solaris
2001-09-18 09:15:40 +00:00
Bodo Möller
5294dd705d Another demo. 2001-09-17 19:07:00 +00:00
Geoff Thorpe
2b67158673 Some of the ENGINE file names were changed for 8.3 filename uniqueness
recently. So comments including file names have been fixed, and copyright
notices brought up to "2001" at the same time.
2001-09-14 18:31:57 +00:00
Geoff Thorpe
db744f8950 Fix a typo in the preprocessor logic in eng_list.c that had left RSA, DSA,
and DH all conditional upon OPENSSL_NO_RSA.
2001-09-14 18:23:31 +00:00
Geoff Thorpe
e059b19ddb Add a SHA1 test to evptests.txt - only the MD5 hash algorithm was being
tested previously.
2001-09-14 18:21:36 +00:00
Geoff Thorpe
997a54c981 'evp_test' needs to initialise and cleanup EVP_CIPHER_CTX structures. Also,
fix a typo and add cleanup operations. This also switches on memory leak
checking (which is how the rest was found).
2001-09-14 18:20:44 +00:00
Bodo Möller
b78e502104 add comment 2001-09-14 13:47:25 +00:00
Bodo Möller
b6d0054a52 Get rid of junk (deleted/renamed function) by rebuilding
based on 0.9.6 tree.
2001-09-14 09:31:07 +00:00
Bodo Möller
117df10db4 add details 2001-09-14 08:45:43 +00:00
Lutz Jänicke
d300bcca7f Typo. 2001-09-13 15:18:51 +00:00
Lutz Jänicke
d59c3e5046 One more manual page. 2001-09-13 15:05:42 +00:00
Lutz Jänicke
6d8566f2eb Rework section about return values another time (based on hints from
Bodo Moeller).
2001-09-13 13:21:38 +00:00
Bodo Möller
4e1b0d8904 avoid "statement not reached" warning 2001-09-13 13:02:59 +00:00
Geoff Thorpe
8ce2912fbc Updated dependencies from "make update" 2001-09-12 02:43:22 +00:00
Geoff Thorpe
1372965e2e Reduce the header dependencies on engine.h in apps/. 2001-09-12 02:39:06 +00:00
Geoff Thorpe
1a1422643b ENGINE uses a very opaque design, so we can predeclare the structure type
in "types.h" so that very few headers will need to include engine.h,
generally only C files using API functions will need it (reducing
the header dependencies quite a lot).
2001-09-12 02:34:20 +00:00
Geoff Thorpe
409960491d ENGINE files were renamed, and error strings are now in eng_err.c 2001-09-12 01:54:17 +00:00
Dr. Stephen Henson
96bd6f730a Add certificate and request demos.
Fix X509V3 macro so they compile.
2001-09-12 00:19:20 +00:00
Lutz Jänicke
c0f5dd070b Make maximum certifcate chain size accepted from the peer application
settable (proposed by "Douglas E. Engert" <deengert@anl.gov>).
2001-09-11 13:08:51 +00:00
Bodo Möller
9d7a8d3578 add 'release showstopper' entry 2001-09-11 12:46:50 +00:00
Bodo Möller
4dec4f646d update 2001-09-11 12:26:56 +00:00
Bodo Möller
2cb924b052 ex_data situation is no longer that bad 2001-09-11 12:20:20 +00:00
Geoff Thorpe
51ac0cfe44 make update 2001-09-10 21:18:11 +00:00
Geoff Thorpe
16e819e1d8 Put all "common" initialisation in the apps_startup() and apps_shutdown()
macros in apps.h.
2001-09-10 21:04:14 +00:00
Geoff Thorpe
1023cfe70d enginetest needs 'memset' defined. 2001-09-10 21:02:06 +00:00
Ulf Möller
8e0a2d8461 missed one file 2001-09-10 20:16:31 +00:00
Bodo Möller
e13ae96d7c While ispell may not like it, "cancelling" may be spelt with two "l"s 2001-09-10 18:59:53 +00:00
Bodo Möller
9f29ec4721 fix memory leak (I think) 2001-09-10 18:50:09 +00:00
Bodo Möller
b9a20b5057 remove an old comment 2001-09-10 18:49:25 +00:00
Bodo Möller
c2222c2ea2 restore previous revision -- memory leak should be fixed in mem.c 2001-09-10 18:47:33 +00:00
Bodo Möller
336da5642d fix memory leak 2001-09-10 18:13:16 +00:00
Bodo Möller
8573fa1806 avoid warning ('const' discarded) 2001-09-10 17:46:54 +00:00
Bodo Möller
a52c2fb296 exclude disabled message digests 2001-09-10 17:18:56 +00:00
Bodo Möller
41450b27f2 add AES ciphers 2001-09-10 17:12:31 +00:00
Bodo Möller
e72d5983f2 Update so that progs.h can indeed be automatically generated
(Working file: progs.h
     revision 1.24

     date: 2001/02/19 16:06:03;  author: levitte;  state: Exp;  lines: +59 -59
     Make all configuration macros available for application by making
     sure they are available in opensslconf.h, by giving them names starting
     with "OPENSSL_" to avoid conflicts with other packages and by making
     sure e_os2.h will cover all platform-specific cases together with
     opensslconf.h.

     [...])
2001-09-10 17:00:28 +00:00
Bodo Möller
5a85385387 typo 2001-09-10 16:57:06 +00:00
Bodo Möller
5e54b4f364 Get rid of hazardous EVP_DigestInit_dbg/EVP_DigestInit case
distinction (which does not work well because if CRYPTO_MDEBUG is
defined at library compile time, it is not necessarily defined at
application compile time; and memory debugging now can be reconfigured
at run-time anyway).  To get the intended semantics, we could just use
the EVP_DigestInit_dbg unconditionally (which uses the caller's
__FILE__ and __LINE__ for memory leak debugging), but this would make
memory debugging inconsistent.  Instead, callers can use
CRYPTO_push_info() to track down memory leaks.
2001-09-10 15:00:30 +00:00
Bodo Möller
5ba372b17c Get rid of hazardous EVP_DigestInit_dbg/EVP_DigestInit case
distinction (which does not work well because if CRYPTO_MDEBUG is
defined at library compile time, it is not necessarily defined at
application compile time; and memory debugging now can be reconfigured
at run-time anyway).  To get the intended semantics, we could just use
the EVP_DigestInit_dbg unconditionally (which uses the caller's
__FILE__ and __LINE__ for memory leak debugging), but this would make
memory debugging inconsistent.  Instead, callers can use
CRYPTO_push_info() to track down memory leaks.

Also fix indentation, and add OpenSSL copyright.
2001-09-10 14:59:17 +00:00
Bodo Möller
f9b0f47c0c copyright 2001-09-10 14:51:19 +00:00
Bodo Möller
4deeadf7dc Delete pointless casts 2001-09-10 14:10:10 +00:00
Bodo Möller
384eff877c Fix apps/openssl.c and ssl/ssltest.c so that they use
CRYPTO_set_mem_debug_options() instead of CRYPTO_dbg_set_options(),
which is the default implementation of the former and should usually
not be directly used by applications (at least if we assume that the
options accepted by the default implementation will also be meaningful
to any other implementations).

Also fix apps/openssl.c and ssl/ssltest such that environment variable
setting 'OPENSSL_DEBUG_MEMORY=off' actively disables the compiled-in
library defaults (i.e. such that CRYPTO_MDEBUG is ignored in this
case).
2001-09-10 09:50:30 +00:00
Dr. Stephen Henson
68dbba9817 Replace old (and invalid) copyright notice. 2001-09-08 12:15:09 +00:00
Bodo Möller
ea7150b070 The various hash #includes in rand_lcl.h *are* needed despite
<openssl/evp.h> is now used (MD_DIGEST_LENGTH definitions!).
No need to include such headers directly in md_rand.c.
2001-09-07 23:55:15 +00:00
Lutz Jänicke
cb42ce0b67 Recognize OpenUNIX-8 with compiler 2001-09-07 12:13:10 +00:00
Ben Laurie
e8330cf5ac Add a cleanup function for MDs. 2001-09-07 12:03:24 +00:00
Ben Laurie
7d34470458 Look up MD5 by name. 2001-09-07 11:45:42 +00:00
Ben Laurie
f1047cebea Remove duplication. 2001-09-07 11:44:59 +00:00
Ben Laurie
da8a2e6f90 Now need sha.h for some reason. 2001-09-07 11:44:17 +00:00
Ben Laurie
546ec5a9b3 Redo type-safety fix. 2001-09-07 11:43:30 +00:00
Ulf Möller
e3fefbfd56 ispell 2001-09-07 06:39:38 +00:00
Ulf Möller
3b80e3aa9e ispell 2001-09-07 06:13:40 +00:00
Ulf Möller
14cfde9c83 make engine file names unique in 8.3 2001-09-07 04:14:48 +00:00
Lutz Jänicke
9cabef963c Completely reworked SVR5 shared library support. 2001-09-06 19:25:56 +00:00
Ulf Möller
ce9eab79a7 unused function 2001-09-06 17:02:33 +00:00
Ulf Möller
e9e202cfa8 include the proper header file 2001-09-06 16:25:34 +00:00
Ulf Möller
d83ae69455 double definition 2001-09-06 16:24:29 +00:00
Lutz Jänicke
bb4f7a8d52 Even more corrections for OpenUNIX 8 2001-09-06 14:28:35 +00:00
Bodo Möller
619b2c03dc Avoid strdup.
(Some platforms need _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED to get
the declaration, but on other platforms _XOPEN_SOURCE disables
the strdup declaration in <string.h>.)
2001-09-06 13:09:00 +00:00
Lutz Jänicke
aa4c2de10e Sort out mess of colons... 2001-09-06 12:48:16 +00:00
Lutz Jänicke
6c36f7a9f2 Support for shared libraries on Unixware-7 and OpenUNIX-8
(Boyd Lynn Gerber <gerberb@zenez.com>).
2001-09-06 12:39:00 +00:00
Bodo Möller
78f7923580 Totally get rid of CRYPTO_LOCK_ERR_HASH.
In err.c, flags int_error_hash_set and int_thread_hash_set
appear superfluous since we can just as well initialize
int_error_hash and int_thread_hash to NULL.

Change some of the err.c formatting to conform with the rest of
OpenSSL.
2001-09-06 12:37:36 +00:00
Lutz Jänicke
978ebf0141 Build shared libaries for Unixware-7 and OpenUNIX-8 in old (pre 0.9.7)
style (Boyd Lynn Gerber <gerberb@zenez.com>).
2001-09-06 12:28:05 +00:00
Bodo Möller
a9ed4da8eb improve OAEP check 2001-09-06 10:42:56 +00:00
Bodo Möller
e1a4814cd4 fix formatting so that the file can be view with any tab-width 2001-09-06 09:30:16 +00:00
Bodo Möller
3cad81f6fe Mention DSO_up => DSO_up_ref renaming 2001-09-05 21:39:39 +00:00
Bodo Möller
4450107afb Renaming DH_up to DH_up_ref does not warrant a CHANGES entry of its own
as the functions were only introduced a couple of days ago.

Some '*)' apparently should be '+)' as the changes do not apply
to the 0.9.6 bugfix branch.
2001-09-05 19:14:53 +00:00
Geoff Thorpe
908efd3b73 ENGINEs can now perform structural cleanup. 2001-09-05 19:07:01 +00:00
Geoff Thorpe
1a7691c059 This adds "destroy" handlers to the existing ENGINEs that load their own
error strings - the destroy handler functions unload the error strings so
any pending error state referring to them will not attempt to reference
them after the ENGINE has been destroyed.
2001-09-05 19:00:33 +00:00
Geoff Thorpe
f524ddbe04 ENGINE's init() and finish() handler functions are used when the ENGINE is
being enabled or disabled (respectively) for operation. Additionally, each
ENGINE has a constructor function where it can do more 'structural' level
intialisations such as loading error strings, creating "ex_data" indices,
etc. This change introduces a handler function that gives an ENGINE a
corresponding opportunity to cleanup when the ENGINE is being destroyed. It
also adds the "get/set" API functions that control this "destroy" handler
function in an ENGINE.
2001-09-05 18:32:23 +00:00
Geoff Thorpe
541814c403 Add some missing CHANGES items. 2001-09-05 17:50:24 +00:00
Bodo Möller
5013540224 Oops^2: It was the correct line, but an incorrect change. 2001-09-05 17:28:50 +00:00
Bodo Möller
94cb5ee63c Oops, wrong line 2001-09-05 17:22:40 +00:00
Bodo Möller
fc9c61bc3b -mcpu=i486 vs. -m486 ... 2001-09-05 17:18:14 +00:00
Geoff Thorpe
e815d3015e Change DH_up() -> DH_up_ref() 2001-09-05 17:02:35 +00:00
Geoff Thorpe
dc2a33d680 "DH_up" had been changed to "DH_up_ref" in libeay.num but the function
declaration and implementation had not. So a recent update recreated the
original definition in libeay.num ... this corrects it and changes the "dh"
code to the "up_ref" variant.
2001-09-05 16:54:32 +00:00
Bodo Möller
7ba45bf133 Solaris <string.h> does not declare 'strdup' if _XOPEN_SOURCE is
defined.

(Preprocessor symbols such as _POSIX_C_SOURCE or _XOPEN_SOURCE are
supposed to disable anything not allowed by the respective
specification; I'm not sure why 'strdup' would be considered
an outlaw though.)
2001-09-05 14:40:05 +00:00
Ulf Möller
d98a4b7366 bug fix: bn_sqr_recursive output is twice its input size. 2001-09-05 04:43:43 +00:00
Ulf Möller
889a54c467 Eric Hanchrow points out that Cygwin perl works. 2001-09-05 02:27:07 +00:00
Ulf Möller
9d07fd03e3 Use GCC 2.95/3.0 optimization 2001-09-05 02:18:40 +00:00
Geoff Thorpe
a8a1878256 Update the ENGINE README, and stock it up with extra verbeage for good
measure (including info and instructions on "dynamic" ENGINEs).
2001-09-04 23:18:36 +00:00
Ulf Möller
5b46eee0f5 strsep implementation to allow the file to compile on non-BSD systems
Submitted by: "Brian Havard" <brianh@kheldar.apana.org.au>
2001-09-04 22:19:06 +00:00
Geoff Thorpe
e5e6a94fbf Make the 'dynamic' ENGINE bundle up the loading application/library's
locking callbacks to pass to the loaded library (in addition to the
existing mem, ex_data, and err callbacks). Also change the default
implementation of the "bind_engine" function to apply those callbacks, ie.
the IMPLEMENT_DYNAMIC_BIND_FN macro.
2001-09-04 21:25:17 +00:00
Geoff Thorpe
d9ff889073 Add a "_up" -> "_up_ref" change to libeay.num that was missing from the
recent changes. Also, do the same change to the DSO_up() function.
2001-09-04 20:40:41 +00:00
Bodo Möller
e4decc418a typo 2001-09-04 11:57:17 +00:00
Bodo Möller
cf5bfbfc21 Now that we have ERR_unload_strings(), ERR_load_ERR_strings() must
always load its strings because they might have been unloaded
since the 'init' flag was deleted.

But build_SYS_str_reasons() can use an 'init' flag.
2001-09-04 11:49:14 +00:00
Bodo Möller
567fef894e changing something requires a write lock, not a read lock 2001-09-04 11:15:55 +00:00
Bodo Möller
6ee2a1365e CHANGES should list all API changes relevant for applications
(here: X509_STORE_CTX_init())
2001-09-04 11:13:01 +00:00
Bodo Möller
435037d4e4 OpenSSL copyright notices ... 2001-09-04 11:02:23 +00:00
Bodo Möller
c5de8996cc delete redundant ERR_load_CRYPTO_strings() prototype 2001-09-04 10:45:01 +00:00
Geoff Thorpe
2dc5383a20 This changes the existing hardware ENGINE implementations to dynamically
declare their own error strings so that they can be more easily compiled as
external shared-libraries if desired. Also, each implementation has been
given canonical "dynamic" support at the base of each file and is only
built if the ENGINE_DYNAMIC_SUPPORT symbol is defined.

Also, use "void" prototypes rather than empty prototypes in engine_int.h.

This does not yet;
  (i) remove error strings when unloading,
 (ii) remove the redundant ENGINE_R_*** codes (though ENGINE_F_*** codes
      have gone), or
(iii) provide any instructions on how to build shared-library ENGINEs or
      use them.

All are on their way.
2001-09-03 21:33:00 +00:00
Geoff Thorpe
9391f97715 This change adds a new ENGINE called "dynamic" that allows new ENGINE
implementations to be loaded from self-contained shared-libraries. It also
provides (in engine.h) definitions and macros to help implement a
self-contained ENGINE. Version control is handled in a way whereby the
loader or loadee can veto the load depending on any objections it has with
each other's declared interface level. The way this is currently
implemented assumes a veto will only take place when one side notices the
other's interface level is too *old*. If the other side is newer, it should
be assumed the newer version knows better whether to veto the load or not.
Version checking (like other "dynamic" settings) can be controlled using
the "dynamic" ENGINE's control commands. Also, the semantics for the
loading allow a shared-library ENGINE implementation to handle differing
interface levels on the fly (eg. loading secondary shared-libraries
depending on the versions required).

Code will be added soon to the existing ENGINEs to illustrate how they can
be built as external libraries rather than building statically into
libcrypto.

NB: Applications wanting to support "dynamic"-loadable ENGINEs will need to
add support for ENGINE "control commands". See apps/engine.c for an example
of this, and use "apps/openssl engine -vvvv" to test or experiment.
2001-09-03 19:15:29 +00:00
Geoff Thorpe
5b16639538 Note the "ERR_unload_strings" function. 2001-09-03 18:27:22 +00:00
Geoff Thorpe
1738bb61e1 Add a new ERR function, "ERR_unload_strings", to complement the existing
"ERR_load_strings" function.
2001-09-03 18:24:56 +00:00
Geoff Thorpe
91b3f0e691 Correct a typo. 2001-09-03 17:24:27 +00:00
Bodo Möller
6ac4e8bd6e Rename recently introduced functions for improved code clarity:
[DR]SA_up  =>  [DR]SA_up_ref
2001-09-03 13:40:07 +00:00
Bodo Möller
983495c4b2 Use uniformly chosen witnesses for Miller-Rabin test
(by using new BN_pseudo_rand_range function)
2001-09-03 12:58:16 +00:00
Bodo Möller
931a23a5a5 rearrange #includes because trying to include <crypto/cryptodev.h>
is a bad idea if OPENSSL_OPENBSD_DEV_CRYPTO is not defined
2001-09-03 12:37:13 +00:00
Geoff Thorpe
72849dce81 Convert "max" to "mx" for variable names (brought to my attention by Steve
Henson). Also, reverse a previous change that used an implicit function
pointer cast rather than an explicit data pointer cast in the STACK cleanup
code.
2001-09-02 20:41:34 +00:00
Ben Laurie
2618893114 Make MD functions take EVP_MD_CTX * instead of void *, add copy() function. 2001-09-02 20:05:27 +00:00
Geoff Thorpe
36026dfc01 Note the "ex_data" changes. 2001-09-01 20:20:16 +00:00
Geoff Thorpe
79aa04ef27 Make the necessary changes to work with the recent "ex_data" overhaul.
See the commit log message for that for more information.

NB: X509_STORE_CTX's use of "ex_data" support was actually misimplemented
(initialisation by "memset" won't/can't/doesn't work). This fixes that but
requires that X509_STORE_CTX_init() be able to handle errors - so its
prototype has been changed to return 'int' rather than 'void'. All uses of
that function throughout the source code have been tracked down and
adjusted.
2001-09-01 20:02:13 +00:00
Geoff Thorpe
3a0799977b First step in fixing "ex_data" support. Warning: big commit log ...
Currently, this change merely addresses where ex_data indexes are stored
and managed, and thus fixes the thread-safety issues that existed at that
level. "Class" code (eg. RSA, DSA, etc) no longer store their own STACKS
and per-class index counters - all such data is stored inside ex_data.c. So
rather than passing both STACK+counter to index-management ex_data
functions, a 'class_index' is instead passed to indicate the class (eg.
CRYPTO_EX_INDEX_RSA). New classes can be dynamically registered on-the-fly
and this is also thread-safe inside ex_data.c (though whether the caller
manages the return value in a thread-safe way is not addressed).

This does not change the "get/set" functions on individual "ex_data"
structures, and so thread-safety at that level isn't (yet) assured.
Likewise, the method of getting and storing per-class indexes has not
changed, so locking may still be required at the "caller" end but is
nonetheless thread-safe inside "ex_data"'s internal implementation.
Typically this occurs when code implements a new method of some kind and
stores its own per-class index in a global variable without locking the
setting and usage of that variable. If the code in question is likely to be
used in multiple threads, locking the setting and use of that index is
still up to the code in question. Possible fixes to this are being
sketched, but definitely require more major changes to the API itself than
this change undertakes.

The underlying implementation in ex_data.c has also been modularised so
that alternative "ex_data" implementations (that control all access to
state) can be plugged in. Eg. a loaded module can have its implementation
set to that of the application loaded it - the result being that
thread-safety and consistency of "ex_data" classes and indexes can be
maintained in the same place rather than the loaded module using its own
copy of ex_data support code and state.

Due to the centralisation of "state" with this change, cleanup of all
"ex_data" state can now be performed properly. Previously all allocation of
ex_data state was guaranteed to leak - and MemCheck_off() had been used to
avoid it flagging up the memory debugging. A new function has been added to
perfrom all this cleanup, CRYPTO_cleanup_all_ex_data(). The "openssl"
command(s) have been changed to use this cleanup, as have the relevant test
programs. External application code may want to do so too - failure to
cleanup will not induce more memory leaking than was the case before, but
the memory debugging is not tricked into hiding it any more so it may
"appear" where it previously did not.
2001-09-01 19:56:46 +00:00
Geoff Thorpe
e19ea55783 Only OPENSSL_free() non-NULL pointers. 2001-09-01 18:37:17 +00:00
Ulf Möller
8716dbea40 undo, didn't work 2001-09-01 05:59:27 +00:00
Ulf Möller
e9bc66c84f *** empty log message *** 2001-09-01 05:30:45 +00:00
Ulf Möller
c078798c60 strsep implementation to allow the file to compile on non-BSD systems
Submitted by: "Brian Havard" <brianh@kheldar.apana.org.au>
2001-09-01 05:05:32 +00:00
Ulf Möller
de73cca923 make update 2001-09-01 04:25:50 +00:00
Ulf Möller
b1051789d6 zlib default was broken on most platforms.
-mcpu=i486 is new as of gcc 2.95, and if you have that, you wouldn't
want to optimize for 486 anyway.
2001-09-01 04:18:00 +00:00
Geoff Thorpe
4db73c1bb8 (A version of) gcc had been giving somewhat odd "trigraph" warnings about
this construct, and Ulf provided the following insight as to why;

> ANSI C compliant compilers must substitute "??)" for "]" because your
> terminal might not have a "]" key if you bought it in the early 1970s.

So we escape the final '?' to avoid this pathological case.
2001-08-28 19:32:16 +00:00
Geoff Thorpe
3ae34e3a8c Ensure that failure to create the BIO in 'CRYPTO_mem_leaks_fp' doesn't
leave memory debugging turned off.
[Spotted by Götz Babin-Ebell]
2001-08-28 15:54:57 +00:00
Ben Laurie
1f3b65801b Fix SSL memory leak. 2001-08-28 13:45:41 +00:00
Geoff Thorpe
5e2c4e23f4 Make sure "CRYPTO_mem_leaks_fp" doesn't itself create a reportable memory
leak.
2001-08-27 22:12:56 +00:00
Geoff Thorpe
35780c2139 "make update" 2001-08-26 21:06:22 +00:00
Geoff Thorpe
ceff5fec5a gcc can't spot that 'derlst' is not used uninitialised, so appease it. 2001-08-26 21:04:21 +00:00
Ben Laurie
4897dc4056 Test digests. 2001-08-26 17:09:31 +00:00
Ben Laurie
35e33f0e52 Add digests. 2001-08-26 17:09:00 +00:00
Geoff Thorpe
a844e27baa Tidy up some code formatting. 2001-08-25 18:01:36 +00:00
Geoff Thorpe
0783bf151c Note the "ERR" changes. 2001-08-25 17:59:13 +00:00
Geoff Thorpe
566bdf2bda This changes the "ERR" code to have all access to state (a hash table of
error strings and a hash table storing per-thread error state) go via an
ERR_FNS function table. The first time an ERR operation occurs, the
implementation that will be used (from then on) is set to the internal
"defaults" implementation if it has not already been set. The actual LHASH
tables are only accessed by this implementation.

This is primarily for modules that can be loaded at run-time and bound into
an application (or a shared-library version of OpenSSL). If the module has
its own statically-linked copy of OpenSSL code - this mechanism allows it
to *not* create and use ERR information in its own linked "ERR" code, but
instead to use and interact with the state stored in the loader
(application or shared library). The loader calls ERR_get_implementation()
and the return value is what the module should use when calling its own
copy of ERR_set_implementation().
2001-08-25 17:51:59 +00:00
Geoff Thorpe
eb6dc02b23 Make a note of the "up" functions. 2001-08-25 17:37:46 +00:00
Geoff Thorpe
78435364ec Changes crypto/evp/ and ssl/ code from directly incrementing reference
counts in DH, DSA, and RSA structures. Instead they use the new "***_up()"
functions that handle this.
2001-08-25 17:28:23 +00:00
Geoff Thorpe
5cbc2e8bc1 Give DH, DSA, and RSA functions to "up" their reference counts. Otherwise,
dependant code has to directly increment the "references" value of each
such structure using the corresponding lock. Apart from code duplication,
this provided no "REF_CHECK/REF_PRINT" checking and violated
encapsulation.
2001-08-25 17:24:21 +00:00
Lutz Jänicke
e7cf7fcd21 Allow client certificate lists > 16kB ("Douglas E. Engert" <deengert@anl.gov>.) 2001-08-25 11:49:24 +00:00
Lutz Jänicke
bb8aab0211 Wording of comment... 2001-08-25 11:33:34 +00:00
Lutz Jänicke
0fbf5f7102 Needed for build on SunOS 4.1.x with gcc (Jeffrey Hutzelman <jhutz@cmu.edu>). 2001-08-25 11:31:19 +00:00
Lutz Jänicke
f1b2807478 More docs. 2001-08-24 14:29:48 +00:00
Lutz Jänicke
faacb092f8 -passin argument not used when actually loading the key
(found by Massimiliano Pala <madwolf@hackmasters.net>).
2001-08-24 13:33:15 +00:00
Dr. Stephen Henson
b439a74620 Load OCSP responder key before waiting for an incoming
connection so it can prompt for pass phrase on startup
instead of after the first connection.

Add -port switch to usage message.
2001-08-23 23:54:11 +00:00
Dr. Stephen Henson
3132ab8ce6 Add #ifdefs to some devcrypto code 2001-08-23 23:52:38 +00:00
Lutz Jänicke
bfd7bb3eb6 Typo. 2001-08-23 17:41:20 +00:00
Lutz Jänicke
11c8f0b79d More manual pages. Constify. 2001-08-23 17:22:43 +00:00
Lutz Jänicke
c4068186ac As discussed recently on openssl-users. 2001-08-23 15:00:11 +00:00
Lutz Jänicke
0a93a68020 Make clear, that using the compression layer is currently not recommended. 2001-08-23 09:42:12 +00:00
Ulf Möller
f2ab7d1392 typo. 2001-08-22 18:35:17 +00:00
Ben Laurie
c41ab9ade5 More tests. 2001-08-22 16:09:57 +00:00
Lutz Jänicke
141e584998 One more manual page... 2001-08-21 14:54:54 +00:00
Lutz Jänicke
336736ef35 Documentation on how to handle compression methods.
Hopefully it is clear enough, that it is currently not recommended.
2001-08-21 13:02:58 +00:00
Lutz Jänicke
df7cb13525 Checked in from the wrong !@#$%&*() copy... 2001-08-21 07:27:02 +00:00
Lutz Jänicke
d93eb21c7c More interdependencies with respect to shutdown behaviour. 2001-08-20 14:34:16 +00:00
Lutz Jänicke
a403188f92 Alert description strings for TLSv1 and documentation. 2001-08-19 16:20:42 +00:00
Ben Laurie
82b2230527 Add RC4 support to OpenBSD. 2001-08-18 16:04:36 +00:00
Ben Laurie
a8a004987c Add AES tests. 2001-08-18 16:02:52 +00:00
Ben Laurie
0e36019977 Add EVP test program. 2001-08-18 13:53:01 +00:00
Ben Laurie
354c3ace73 Add first cut symmetric crypto support. 2001-08-18 10:22:54 +00:00
Lutz Jänicke
52129c0b0b More details about session timeout settings. 2001-08-17 16:36:51 +00:00
Lutz Jänicke
a52877a2f1 One more function documented. 2001-08-17 15:54:50 +00:00
Lutz Jänicke
cdd7c3ce92 SSL_shutdown() has even more properties... 2001-08-17 15:09:31 +00:00
Lutz Jänicke
c1497b4d19 One more step on the way for complete documentation... 2001-08-17 14:32:38 +00:00
Lutz Jänicke
b2ed462934 Unidirectional shutdown is allowed according to the RFC. 2001-08-17 09:08:32 +00:00
Richard Levitte
bb766a0ad6 Make sure evil file name characters, like spaces or ampersands (!),
don't disturb the rehashing process.
Spotted and suggested patch from Rudo Thomas <rudo@internet.sk>
2001-08-17 04:35:58 +00:00
Dr. Stephen Henson
b65f851318 Make -passin -passout etc work again.
Fix leak in ca.c when using -passin.
2001-08-17 01:09:54 +00:00
Dr. Stephen Henson
35bf35411c Add CRL utility functions to allow CRLs to be
built up without accessing structures directly.

Update ca.c to use new functions.

Fix ca.c so it now build CRLs correctly again.
2001-08-17 00:33:43 +00:00
Lutz Jänicke
54fbc77dc8 Bugfixes provided by "Stephen Hinton" <shinton@netopia.com>. 2001-08-16 15:28:00 +00:00
Lutz Jänicke
9e09eebf94 Better description of the behaviour of SSL_shutdown() as it is now, broken
or not.
2001-08-16 14:27:55 +00:00
Richard Levitte
45a2f93906 gcc 3.0 tells me that -m486 is deprecated. The gcc 2.95 manual tells
me the same and that the correct option is -mcpu=i486.  I'm assuming
-mcpu has been around for some time, and that it's therefore safe to
change all occurences of -m486 to -mcpu=i486.
2001-08-13 14:09:31 +00:00
Geoff Thorpe
6982c0da4e The indexes returned by ***_get_ex_new_index() functions are used when
setting stack (actually, array) values in ex_data. So only increment the
global counters if the underlying CRYPTO_get_ex_new_index() call succeeds.
This change doesn't make "ex_data" right (see the comment at the head of
ex_data.c to know why), but at least makes the source code marginally less
frustrating.
2001-08-12 17:14:35 +00:00
Geoff Thorpe
b7727ee616 The indexes returned by ***_get_ex_new_index() functions are used when
setting stack (actually, array) values in ex_data. So only increment the
global counters if the underlying CRYPTO_get_ex_new_index() call succeeds.
This change doesn't make "ex_data" right (see the comment at the head of
ex_data.c to know why), but at least makes the source code marginally less
frustrating.
2001-08-12 16:52:00 +00:00
Ben Laurie
f0446ca8d7 Move CIPHER_CTX cleanups to _Final routines instead of _Init, which avoids
problems with leaks and uninitialised structures.
2001-08-11 11:32:54 +00:00
Richard Levitte
6bc847e49e Apply the Tru64 patch from Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
His comments are:

1) Changes all references for `True64' to be `Tru64', which is the correct
spelling for the OS name.

2) Makes `alpha-cc' be the same as `alpha164-cc', and adds an `alphaold-cc'
entry that is the same as the previous `alpha-cc'.  The reason is that most
people these days are using the newer compiler, so it should be the default.

3) Adds a bit of commentary to Configure, regarding the name changes of
the OS over the years, so it's not so confusing to people that haven't been
with the OS for a while.

4) Adds an `alpha-cc-rpath' target (which is *not* selected automatically
by Configure under any circumstance) that builds an RPATH into the
shared libraries.  This is explained in the comment in Configure.  It's
very very useful for people that want it, and people that don't want it
just shouldn't choose that target.

5) Adds the `-pthread' flag as the best way to get POSIX thread support
from the newer compiler.

6) Updates the Makefile targets, so that when the `alpha164-cc', `alpha-cc',
or `alpha-cc-rpath' target is what Configure is set to use, it uses a Makefile
target that includes the `-msym' option when building the shared library.
This is a performance enhancement.

7) Updates `config' so that if it detects you're running version 4 or 5
of the OS, it automatically selects `alpha-cc', but uses `alphaold-cc'
for versions 1-3 of the OS.

8) Updates the comment in opensslv.h, fixing both the OS name typo and
adding a reference to IRIX 6.x, since the shared library semantics are
virtually identical there.
2001-08-10 15:26:21 +00:00
Bodo Möller
3f1c4e49a3 add missing link 2001-08-08 15:09:06 +00:00
Bodo Möller
37a7cd1a11 Bugfix: larger message size in ssl3_get_key_exchange() because
ServerKeyExchange message may be skipped.

Submitted by:  Petr Lampa <lampa@fee.vutbr.cz>
2001-08-07 09:30:18 +00:00
Lutz Jänicke
3a2d9c4dd0 Fix typos (shinagawa@star.zko.dec.com) 2001-08-07 07:52:53 +00:00
Bodo Möller
e51d1321fc More typedef'd struct names as search targets 2001-08-06 11:57:08 +00:00
Bodo Möller
b9fdb3eb99 Reinsert typedef'ed names for structs to help those trying to read the
sourcecode (including fgrep)
2001-08-06 11:49:31 +00:00
Ben Laurie
d66ace9da5 Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
Ben Laurie
db75357110 Fix memory leak. 2001-08-05 16:13:49 +00:00
Ben Laurie
0713f8abe6 Parameter correction for CIOFSESSION. 2001-08-04 12:16:56 +00:00
Ben Laurie
93d9121a77 Remove extra whitespace. Sorry. 2001-08-03 21:09:21 +00:00
Ben Laurie
92dad6cc84 Reinstate accidentally deleted code. 2001-08-03 19:00:43 +00:00
Ben Laurie
61454a9f8c Get rid of the stuff we, err, got rid of. 2001-08-03 18:52:50 +00:00
Ben Laurie
bb2297a41d Header bloat reduction for EVP_PKEY. 2001-08-03 18:48:35 +00:00
Ben Laurie
75e98d0563 This ghastly hack prevents CVS wars over Kerberos (which is disabled by default). 2001-08-03 18:45:35 +00:00
Lutz Jänicke
e9eb000c53 Oops, one SSL_OP_NON_EXPORT_FIRST was left. 2001-08-03 13:05:44 +00:00
Ben Laurie
1ba01caaa3 Make /dev/crypto work with new EVP structures. 2001-08-03 11:54:37 +00:00
Richard Levitte
5cd6571fae Make sure memcpy() gets properly declared by including string.h. 2001-08-03 10:54:00 +00:00
Bodo Möller
6383bbe525 remove a comma 2001-08-03 09:28:02 +00:00
Lutz Jänicke
06da6e4977 Don't disable rollback attack detection as a recommended bug workaround. 2001-08-03 08:45:13 +00:00
Lutz Jänicke
b72faddc47 Mention removed option. 2001-08-01 10:07:55 +00:00
Lutz Jänicke
d92f0bb6e9 Remove SSL_OP_NON_EXPORT_FIRST:
It did not work, it was deactivated by #if 0/#endif anyway _and_ we now have
the working SSL_OP_CIPHER_SERVER_PREFERENCE.
2001-08-01 10:06:32 +00:00
Richard Levitte
710e5d5639 make update 2001-07-31 17:07:24 +00:00
Richard Levitte
6da980e2b5 Make sure the source file is included among the dependencies. This is
the norm for 'gcc -M' but not for 'makedepend', and is merely
introduced here to avoid commit wars.
2001-07-31 17:02:44 +00:00
Lutz Jänicke
37f599bcec Reworked manual pages with a lot of input from Bodo Moeller. 2001-07-31 15:04:50 +00:00
Ben Laurie
8408f4fbc7 Document DES changes better. 2001-07-31 13:33:58 +00:00
Ben Laurie
534164ef90 Remove old unused stuff. 2001-07-31 12:03:26 +00:00
Lutz Jänicke
e32c852e1e Indent. 2001-07-31 10:19:20 +00:00
Richard Levitte
dbfc0f8c2b Vade retro C++ comments!
(Latin for "comments", anyone?)
2001-07-31 09:15:52 +00:00
Richard Levitte
3728974460 Make as sure as possible that gethostname() will be properly declared. 2001-07-31 08:50:20 +00:00
Richard Levitte
fdc2bbcacb Correct most of the unsigned vs. signed warnings (or int vs. size_t),
and rename some local variables to avoid name shadowing.
2001-07-31 08:45:40 +00:00
Richard Levitte
c2a3358b60 Whoops, my fault, a backslash got converted to a slash... 2001-07-31 08:44:28 +00:00
Richard Levitte
882e891284 More Kerberos SSL changes from Jeffrey Altman <jaltman@columbia.edu>
His comments are:

First, it corrects a problem introduced in the last patch where the
kssl_map_enc() would intentionally return NULL for valid ENCTYPE
values.  This was done to prevent verification of the kerberos 5
authenticator from being performed when Derived Key ciphers were
in use.  Unfortunately, the authenticator verification routine was
not the only place that function was used.  And it caused core dumps.

Second, it attempt to add to SSL_SESSION the Kerberos 5 Client
Principal Name.
2001-07-31 07:21:06 +00:00
Ben Laurie
05bbf78afd Remove //. 2001-07-31 06:47:23 +00:00
Richard Levitte
99ecb90a99 make update 2001-07-31 06:40:10 +00:00
Ben Laurie
dbad169019 Really add the EVP and all of the DES changes. 2001-07-30 23:57:25 +00:00
Ben Laurie
3ba5d1cf2e Make EVPs allocate context memory, thus making them extensible. Rationalise
DES's keyschedules.

I know these two should be separate, and I'll back out the DES changes if they
are deemed to be an error.

Note that there is a memory leak lurking in SSL somewhere in this version.
2001-07-30 17:46:22 +00:00
Ben Laurie
be2e2c3297 Only set the verify callback if there's one to set! 2001-07-30 17:17:26 +00:00
Andy Polyakov
ed0015284b Just a "get to know your system" bit. 2001-07-30 16:46:37 +00:00
Andy Polyakov
6d03b73e35 Enhanced support for IA-64 Linux and HP-UX (as well as better support for
HP-UX in common in ./config). Note that for the moment of this writing
none of 64-bit platforms pass bntest. I'm committing this anyway as it's
too frustrating to patch snapshots over and over while 0.9.6 is known to
work.
2001-07-30 16:42:15 +00:00
Andy Polyakov
622d3d3592 Support for Intel and HP-UXi assemblers. 2001-07-30 15:54:13 +00:00
Ben Laurie
0e06354402 ANSIfication. 2001-07-30 15:33:46 +00:00
Andy Polyakov
62c271610b Typo in stty command lines. 2001-07-30 14:33:58 +00:00
Lutz Jänicke
db089ad60d Don't miss files... 2001-07-30 11:50:37 +00:00
Lutz Jänicke
1f0c9ad7e1 Fix inconsistent behaviour with respect to verify_callback handling. 2001-07-30 11:45:34 +00:00
Lutz Jänicke
06efc222f9 Forgot to mention second fix. 2001-07-30 11:33:53 +00:00
Bodo Möller
de3333bae4 length of secret exponent is needed only when we create one 2001-07-27 22:45:35 +00:00
Bodo Möller
924875e53b Undo DH_generate_key() change: s3_srvr.c was using it correctly 2001-07-27 22:34:25 +00:00
Lutz Jänicke
3a64458217 Another uninitialized static that may lead to problems on Solaris under some
circumstances.
2001-07-27 12:35:27 +00:00
Richard Levitte
ea71c22731 Addapt VMS script to the latest changes in the makefiles. 2001-07-27 07:47:51 +00:00
Dr. Stephen Henson
dc706cd35f Make sure *outl is always initialized in EVP_EncryptUpdate(). 2001-07-27 02:24:47 +00:00
Dr. Stephen Henson
1241126adf More linker bloat reorganisation:
Split private key PEM and normal PEM handling. Private key
handling needs to link in stuff like PKCS#8.

Relocate the ASN1 *_dup() functions, to the relevant ASN1
modules using new macro IMPLEMENT_ASN1_DUP_FUNCTION. Previously
these were all in crypto/x509/x_all.c along with every ASN1
BIO/fp function which linked in *every* ASN1 function if
a single dup was used.

Move the authority key id ASN1 structure to a separate file.
This is used in the X509 routines and its previous location
linked in all the v3 extension code.

Also move ASN1_tag2bit to avoid linking in a_bytes.c which
is now largely obsolete.

So far under Linux stripped binary with single PEM_read_X509
is now 238K compared to 380K before these changes.
2001-07-27 02:22:42 +00:00
Dr. Stephen Henson
19da130053 First of several reorganisations to
reduce linker bloat. For example the
single line:

PEM_read_X509()

results in a binary of around 400K in Linux!

This first step separates some of the PEM functions and
avoids linking in some PKCS#7 and PKCS#12 code.
2001-07-26 22:34:45 +00:00
Lutz Jänicke
a75b191502 Fix problem occuring when used from OpenSSH on Solaris 8. 2001-07-26 09:02:44 +00:00
Bodo Möller
e5cb260365 DH key generation should not use a do ... while loop,
or bogus DH parameters can be used for launching DOS attacks
2001-07-25 17:48:51 +00:00
Bodo Möller
6aecef815c Don't preserve existing keys in DH_generate_key. 2001-07-25 17:20:34 +00:00
Bodo Möller
daba492c3a md_rand.c thread safety 2001-07-25 17:17:24 +00:00
Bodo Möller
24cff6ced5 always reject data >= n 2001-07-25 17:02:58 +00:00
Andy Polyakov
ac7b42610f Support for 64-bit Solaris build with GCC 3.0 and later. It should be
explicitely noted that 64-bit SPARCv9 ABI is not officially supported
by GCC 3.0 (support is scheduled for 3.1 release), but it appears to
work, at the very least 'make test' passes...
2001-07-25 15:58:57 +00:00
Lutz Jänicke
7abe76e1bd Fix wrong information about SSL_set_connect_state()... 2001-07-25 12:12:51 +00:00
Bodo Möller
7bc03ded12 add a comment 2001-07-25 10:04:14 +00:00
Bodo Möller
ea3b8af50a avoid warnings 2001-07-24 14:20:36 +00:00
Bodo Möller
badb910f3c Avoid race condition.
Submitted by: Travis Vitek <vitek@roguewave.com>
2001-07-24 12:31:14 +00:00
Geoff Thorpe
3866752e7e - New INSTALL document describing different ways to build "tunala" and
possible problems.
- New file breakage.c handles (so far) missing functions.
- Get rid of some signed/unsigned/const warnings thanks to solaris-cc
- Add autoconf/automake input files, and helper scripts to populate missing
  (but auto-generated) files.

This change adds a configure.in and Makefile.am to build everything using
autoconf, automake, and libtool - and adds "gunk" scripts to generate the
various files those things need (and clean then up again after). This means
that "autogunk.sh" needs to be run first on a system with the autotools,
but the resulting directory should be "configure"able and compilable on
systems without those tools.
2001-07-23 19:03:48 +00:00
Lutz Jänicke
3e3dac9f97 Additional inline reference. 2001-07-23 12:57:37 +00:00
Lutz Jänicke
397ba0f08a Add missing reference. 2001-07-23 12:52:05 +00:00
Geoff Thorpe
07ad8f5d17 Tidy up "cvs update" output a bit. 2001-07-22 23:21:33 +00:00
Richard Levitte
47c3448a97 Not all platforms have the OpenBSD crypto device. 2001-07-21 11:54:24 +00:00
Lutz Jänicke
4db48ec0bd Documentation about ephemeral key exchange 2001-07-21 11:02:17 +00:00
Ben Laurie
c518ade1fd Clean up EVP macros, rename DES EDE3 modes correctly, temporary support for
OpenBSD /dev/crypto (this will be revamped later when the appropriate machinery
is available).
2001-07-21 10:24:07 +00:00
Richard Levitte
acdf4afb91 More Kerberos SSL patches from Vern Staats <staatsvr@asc.hpc.mil>.
His comments are:

This patch fixes the problem of modern Kerberos using "derived keys"
to encrypt the authenticator by disabling the authenticator check
for all derived keys enctypes.

I think I've got all the bugfixes that Jeffrey and I discussed rolled
into this.  There were some problems with Jeffrey's code to convert
the authenticator's Kerberos timestring into struct tm (e.g. Z, -1900;
it helps to have an actual decryptable authenticator to play with).
So I've shamelessly pushed in my code, while stealing some bits from
Jeffrey.
2001-07-21 09:43:43 +00:00
Lutz Jänicke
6d3dec92fb Updated explanation. 2001-07-20 19:23:43 +00:00
Lutz Jänicke
2d3b6a5be7 Some more documentation bits. 2001-07-20 18:57:15 +00:00
Geoff Thorpe
81d1998e09 Currently, RSA code, when using no padding scheme, simply checks that input
does not contain more bytes than the RSA modulus 'n' - it does not check
that the input is strictly *less* than 'n'. Whether this should be the
case or not is open to debate - however, due to security problems with
returning miscalculated CRT results, the 'rsa_mod_exp' implementation in
rsa_eay.c now performs a public-key exponentiation to verify the CRT result
and in the event of an error will instead recalculate and return a non-CRT
(more expensive) mod_exp calculation. As the mod_exp of 'I' is equivalent
to the mod_exp of 'I mod n', and the verify result is automatically between
0 and n-1 inclusive, the verify only matches the input if 'I' was less than
'n', otherwise even a correct CRT calculation is only congruent to 'I' (ie.
they differ by a multiple of 'n'). Rather than rejecting correct
calculations and doing redundant and slower ones instead, this changes the
equality check in the verification code to a congruence check.
2001-07-20 15:16:10 +00:00
Andy Polyakov
6b46ca135a Missing line 0.9.6b release and IA-64 patch advertisement:-) 2001-07-17 14:39:26 +00:00
Richard Levitte
fa293e4e4b SSL_get_rfc were documented but not implemented. 2001-07-16 10:50:29 +00:00
Richard Levitte
24cbf3efc6 SSL_get_[rw]fd were documented but not implemented. 2001-07-15 20:11:57 +00:00
Dr. Stephen Henson
534a1ed0cb Allow OCSP server to handle multiple requests.
Document new OCSP options.
2001-07-13 13:13:44 +00:00
Dr. Stephen Henson
ee306a1332 Initial OCSP server support, using index.txt format.
This can process internal requests or behave like a
mini responder.

Todo: documentation, update usage info.
2001-07-12 20:41:51 +00:00
Richard Levitte
45442167b0 Prevent KSSL server from requesting a client certificate.
Submitted by Jeffrey Altman <jaltman@columbia.edu>
2001-07-12 16:17:33 +00:00
Richard Levitte
131645ecce paddr may be NULL. Do not crash if it is. 2001-07-12 15:54:10 +00:00
Richard Levitte
f1ca5f5b89 Clarify that zlib-dynamic is the default choice. 2001-07-12 09:19:34 +00:00
Richard Levitte
e452de9d87 Add the possibility to specify the use of zlib compression and
decompression.  It can be set up to link at link time or to load the
zlib library at run-time.
2001-07-12 09:11:14 +00:00
Lutz Jänicke
a0256f462a Clarify actual state. 2001-07-12 08:53:50 +00:00
Richard Levitte
82d5d46c14 Some of the Kerberos code had dissapeared. Reapply. 2001-07-12 08:51:47 +00:00
Richard Levitte
0665dd6852 Document the recent Kerberos SSL changes. 2001-07-12 04:23:57 +00:00
Dr. Stephen Henson
98fc09b18a Delete extra ; 2001-07-11 22:54:24 +00:00
Dr. Stephen Henson
192ebef8cf In ocsp_match_issuerid() we are passed the CA that signed the responder
certificate so need to match its subject with the certificate IDs in the
response.
2001-07-11 22:42:20 +00:00
Richard Levitte
b01ab14338 make update
Note that since some private kssl functions were exported, the
simplest way to rebuild the number table was to toss everything that
was new since OpenSSL 0.9.6b.  This is safe, since those functions
have not yet been exported in an OpenSSL release.  Beware, people who
trust intermediary snapshots!
2001-07-11 21:15:03 +00:00
Richard Levitte
2a96235bf7 Include kssl_lcl.h where needed. 2001-07-11 21:11:40 +00:00
Richard Levitte
1cf9bf00f4 Private functions do not belong in an exported header file, so move
them to one that won't get exported.
2001-07-11 21:09:30 +00:00
Richard Levitte
a5224c3420 Changes to the Kerberos SSL code by Jeffrey Altman <jaltman@columbia.edu>
His comments are:

 . adds use of replay cache to protect against replay attacks

 . adds functions kssl_tgt_is_available() and
   kssl_keytab_is_available() which are used within s3_lib.c
   and ssl_lib.c to determine at runtime whether or not
   KRB5 ciphers can be supported during the current session.
2001-07-11 19:03:58 +00:00
Geoff Thorpe
af436bc158 openssl speed is quite useful for testing hardware support (among other
things), especially as the RSA keys are fixed. However, DSA only fixes the
DSA parameters and then generates the public and private components on the
fly each time - this commit hard-codes some sampled key values so that this
is no longer the case.
2001-07-11 18:59:25 +00:00
Richard Levitte
ab603c6987 Code to avoid the use of non-standard strptime(). By
Jeffrey Altman <jaltman@columbia.edu>

(Really, the time that's being parsed is a GeneralizedTime, so if
ASN1_GENERALIZEDTIME_get() ever gets implemented, it should be used
instead)
2001-07-11 16:13:36 +00:00
Lutz Jänicke
9c11a0e541 Typo... 2001-07-11 15:49:35 +00:00
Richard Levitte
8de83bf876 Changes to the Kerberos SSL code by Jeffrey Altman <jaltman@columbia.edu>
His comments are:

 . Fixed all of the Windows dynamic loading functions, prototypes, etc.

 . Corrected all of the unsigned/signed comparison warnings

 . Replaced the references to krb5_cksumarray[] for two reasons.
   First, it was an internal variable that should not have been
   referenced outside the library; nor could it have been with
   a shared library with restricted exports.  Second, the
   variable is no longer used in current Kerberos implementations.
   I replaced the code with equivalent functionality using functions
   that are exported from the library.
2001-07-11 15:31:45 +00:00
Lutz Jänicke
679df234b7 What is an '-engine' version? 2001-07-11 15:31:21 +00:00
Richard Levitte
26eaab0990 The implementation of the TKTBODY ASN.1 functions was missing. 2001-07-11 15:29:33 +00:00
Richard Levitte
7be96d7c9f make update 2001-07-11 15:16:15 +00:00
Richard Levitte
d11493934c Make sure crypto/krb5/krb5_asn.h is copied to the directory of
exported header files.
2001-07-11 15:15:31 +00:00
Richard Levitte
c62da732a4 Make sure crypto/krb5/krb5_asn.h becomes part of libeay.num. 2001-07-11 15:14:22 +00:00
Lutz Jänicke
a1a63a4239 Clarify! (based on recent mailing-list discussions) 2001-07-11 15:10:28 +00:00
Richard Levitte
103a434386 One forgotten function. 2001-07-11 07:10:43 +00:00
Richard Levitte
567671e291 make update 2001-07-10 21:00:37 +00:00
Richard Levitte
d8a750ee7f EVP_Digest() takes one more parameter. 2001-07-10 20:58:13 +00:00
Bodo Möller
9c10b2c8d3 For consistency with the terminology used in my SAC2001 paper, avoid
the term "simultaneous multiplication" (which -- acording to the
paper, at least -- applies only to certain methods which we don't use
here)
2001-07-10 11:41:29 +00:00
Bodo Möller
56a106115f comment change 2001-07-10 11:28:53 +00:00
Bodo Möller
e9ad0d2c31 Fix PRNG. 2001-07-10 10:49:34 +00:00
Bodo Möller
97639f0d73 In version numbers, there is just one "M" nybble. 2001-07-10 10:04:26 +00:00
Bodo Möller
e3a4f8b84c Precomputation will not necessarily be LIm-Lee precomputation. 2001-07-10 10:04:05 +00:00
Richard Levitte
7e99812432 If I define _XOPEN_SOURCE before including *any* system header file,
things will work much more smoothly.
2001-07-09 21:51:03 +00:00
Richard Levitte
2a1ef75435 Patches from Vern Staats <staatsvr@asc.hpc.mil> to get Kerberos 5 in
SSL according to RFC 2712.  His comment is:

This is a patch to openssl-SNAP-20010702 to support Kerberized SSL
authentication.  I'm expecting to have the full kssl-0.5 kit up on
sourceforge by the end of the week.  The full kit includes patches
for mod-ssl, apache, and a few text clients.  The sourceforge URL
is http://sourceforge.net/projects/kssl/ .

Thanks to a note from Simon Wilkinson I've replaced my KRB5 AP_REQ
message with a real KerberosWrapper struct.  I think this is fully
RFC 2712 compliant now, including support for the optional
authenticator field.  I also added openssl-style ASN.1 macros for
a few Kerberos structs; see crypto/krb5/ if you're interested.
2001-07-09 21:46:58 +00:00
Ben Laurie
c148d70978 A better compromise between encrypt and decrypt (but why isn't it as fast
for encrypt?).
2001-07-09 21:00:36 +00:00
Richard Levitte
5aa14f636f Tagging has been done, move on to 0.9.6c-dev [engine]. 2001-07-09 15:12:27 +00:00
Ben Laurie
7b6055d1af Handle the common case first (where input size is a multiple of block size).
Worth around 5% for encrypt. Slows down decrypt slightly, but I expect to
regain that later.
2001-07-08 19:42:10 +00:00
Ben Laurie
f31b12503e Use & instead of % - worth about 4% for 8 byte blocks. 2001-07-08 17:27:32 +00:00
Ben Laurie
f82197ad75 Don't update argc, argv for decrypt flag! 2001-07-08 12:58:10 +00:00
Ben Laurie
3f37e73bae Speed test decrypt EVP operations. 2001-07-08 12:14:41 +00:00
Ben Laurie
0774f470d9 Correct const-ness. 2001-07-08 11:42:38 +00:00
Ben Laurie
d7a9e91688 Remove unnecessary casts. 2001-07-06 22:06:08 +00:00
Ben Laurie
601cb9be20 Constification. 2001-07-06 21:35:00 +00:00
Richard Levitte
f3229ee19a Use one address consistently. 2001-07-05 10:20:07 +00:00
Richard Levitte
219a3580b7 Change info to correct values. 2001-07-05 10:19:13 +00:00
Bodo Möller
d63c6bd397 Align with 0.9.6-stable CHANGES file, and make some corrections. 2001-07-04 20:56:47 +00:00
Bodo Möller
fdb61e583a Engine memory leaks have been fixed by now. 2001-07-04 20:56:08 +00:00
Bodo Möller
b8e2f83ae6 Call ENGINE_cleanup() to avoid memory leak. 2001-07-04 20:55:36 +00:00
Bodo Möller
93dbd83570 Entry for Andy's mips3.s fix. 2001-07-04 20:17:27 +00:00
Ben Laurie
5be022712a Update nCipher header with more liberal licence. 2001-07-04 12:26:39 +00:00
Lutz Jänicke
43f9391bcc When only the key is given to "enc", the IV is undefined
(found by Andy Brown <logic@warthog.com>).
2001-07-03 10:31:11 +00:00
Richard Levitte
c1c971654b Make an extra note about shared libraries and backward compatibility. 2001-07-03 01:43:11 +00:00
Richard Levitte
72b1072fbd Let's include cryptlib.h *before* things like NO_SYSLOG are tested or
used.
2001-07-02 20:43:01 +00:00
Richard Levitte
3bfd99bfbb [Forgotten commits?]
Changes to have OpenSSL compile on OS/2.
Contributed by "Brian Havard" <brianh@kheldar.apana.org.au>
2001-07-02 20:41:05 +00:00
Ben Laurie
a169e82065 Fix warning. 2001-07-02 12:50:30 +00:00
Richard Levitte
c80410c50c Insuline shot 2001-07-01 23:15:43 +00:00
Richard Levitte
dc01b6b1f2 Changes to have OpenSSL compile on OS/2.
Contributed by "Brian Havard" <brianh@kheldar.apana.org.au>
2001-07-01 22:39:46 +00:00
Dr. Stephen Henson
b7a26e6daf Modify apps to use NCONF code instead of old CONF code.
Add new extension functions which work with NCONF.

Tidy up extension config routines and remove redundant code.

Fix NCONF_get_number().

Todo: more testing of apps to see they still work...
2001-06-28 11:41:50 +00:00
Richard Levitte
ce16450a89 Make better use of load_cert, load_certs and load_key. 2001-06-27 09:12:43 +00:00
Dr. Stephen Henson
9d2e51c199 Another empty X509_NAME fix. 2001-06-26 12:39:22 +00:00
Dr. Stephen Henson
1e325f6149 Handle empty X509_NAME in printing routines. 2001-06-26 12:04:35 +00:00
Bodo Möller
c458a33196 DSA verification should insist that r and s are in the allowed range. 2001-06-26 09:48:17 +00:00
Richard Levitte
7953b8ff1b Make better use of load_cert, load_certs and load_key. 2001-06-25 14:23:36 +00:00
Richard Levitte
b1460627f3 Make get_ip() a bit more strict in it's parsing of IP addresses, and
at the same time a bit more accepting with host names.
2001-06-25 14:12:45 +00:00
Richard Levitte
5abc8ae6f9 Make better use of load_cert, load_certs and load_key. 2001-06-25 14:00:47 +00:00
Bodo Möller
6a184a6098 Translate into valid C (don't call functions with wrong prototypes). 2001-06-25 10:09:55 +00:00
Richard Levitte
3d5e97f560 Call apps_shutdown() to take down what apps_startup() set up. 2001-06-25 08:35:59 +00:00
Richard Levitte
54c7559a7e Make sure we don't return 0 on error. 2001-06-24 07:00:41 +00:00
Dr. Stephen Henson
0c9de428ae In {RSA,DSA,DH}_new_method(x) need to increase the reference
count of the ENGINE is x is not NULL since it will be freed
in {RSA,DSA,DH}_free().
2001-06-23 23:07:34 +00:00
Richard Levitte
f13def508c Use the new UI features, among others the new boolean input.
NOTE: Boolean input hasn't been very well tested yet, so this part may
fail miserably.
2001-06-23 16:46:14 +00:00
Richard Levitte
1ae6ddac91 Including stdio.h before setting _XOPEN_SOURCE and
_XOPEN_SOURCE_EXTENDED wasn't very smart...
2001-06-23 16:44:15 +00:00
Richard Levitte
55dcfa421c make update 2001-06-23 16:43:03 +00:00
Richard Levitte
c04f8cf44a Use apps_shutdown() in all applications, in case someone decides not
to go the monolith way (does anyone do that these days?).

NOTE: a few applications are missing in this commit.  I've a few more
changes in them that I haven't tested yet.
2001-06-23 16:37:32 +00:00
Richard Levitte
870d986131 apps_startup() needs a corresponding apps_shutdown(). 2001-06-23 16:31:41 +00:00
Richard Levitte
4f272c17f5 Make use of new features in UI's. Among others, the application
password callbak doesn't need to check for sizes any more.
2001-06-23 16:30:14 +00:00
Richard Levitte
fd3e027faa Oops, applies to 0.9.7 only. 2001-06-23 16:28:21 +00:00
Richard Levitte
235dd0a22a Document recent changes. 2001-06-23 16:27:37 +00:00
Richard Levitte
b589977b9e Do not loop i the OpenSSL UI method any more. Instead, letthe
application do that.

NOTE: there's no requirement for other UI_METHODs to avoid this kind
of loop.  For example, a GUI UI_METHOD would probably check the
lengths of the answers from within instead of being constantly
redisplayed for everything that is wrong.
2001-06-23 16:25:56 +00:00
Richard Levitte
291e4a6ebe make update 2001-06-23 16:23:17 +00:00
Richard Levitte
2d2ed9dffd Implement boolean (yes/no or OK/Cancel, ...) input.
Implement UI controls.  Current controls are the possibility to output
the OpenSSL error stack on the same channel from within UI_process()
and to check if the same user interface can be redone without being
rebuilt (this is often more a question of philosophy than
technicalities).
2001-06-23 16:22:48 +00:00
Richard Levitte
8ada6e7705 New error printing function that gives the possibility to print the
errors through an arbitrary function.
2001-06-23 15:06:17 +00:00
Richard Levitte
7f657f342a Include the UI error strings. 2001-06-23 15:04:51 +00:00
Richard Levitte
20e8f0ee27 For the UI functions that return an int, 0 or any positive number is a
success return, any negative number is a failure.  Make sure we check
the return value with that in mind.
2001-06-23 14:51:53 +00:00
Dr. Stephen Henson
429266b7e4 Fix hwcrhk_insert_card. 2001-06-23 12:50:06 +00:00
Dr. Stephen Henson
2c7bc88d78 Fix UI leak in apps. 2001-06-23 12:48:46 +00:00
Dr. Stephen Henson
54f7ebe789 In UI_dup_*() function, use the duped string, not the original. 2001-06-23 11:51:16 +00:00
Dr. Stephen Henson
dd499e74de Update my config entry to allow use of DSOs. 2001-06-23 11:49:33 +00:00
Andy Polyakov
19a6e8b32c This fixes "Spurious test failures on IRIX?" reported in April. Apparently
I was wrong in conclusions about when addition starts overflowing in combaX
routines.
2001-06-22 19:17:42 +00:00
Dr. Stephen Henson
ed5538dc2b Fix memory leak when RAND is used: need to cleanup
RANDs ENGINE reference in ENGINE_cleanup().
2001-06-21 12:19:10 +00:00
Richard Levitte
b8ffcf49ed Update my status. 2001-06-20 15:11:15 +00:00
Richard Levitte
eb929eef14 Since there is a way to create UI_METHODs, implement a destructor as
well.

This probably requires reference counters and locks as well.  To be
implemented later.
2001-06-20 15:00:08 +00:00
Richard Levitte
2cd3ad9bdd Modify "openssl engine" to handle and display internal control
commands appropriately.
2001-06-20 06:35:46 +00:00
Dr. Stephen Henson
323f289c48 Change all calls to low level digest routines in the library and
applications to use EVP. Add missing calls to HMAC_cleanup() and
don't assume HMAC_CTX can be copied using memcpy().

Note: this is almost identical to the patch submitted to openssl-dev
by Verdon Walker <VWalker@novell.com> except some redundant
EVP_add_digest_()/EVP_cleanup() calls were removed and some changes
made to avoid compiler warnings.
2001-06-19 22:30:40 +00:00
Dr. Stephen Henson
a45e4a5537 Fix memory leaks. 2001-06-19 17:13:48 +00:00
Richard Levitte
b7fe2f9675 cp is only used when DSA is built. 2001-06-19 16:40:36 +00:00
Richard Levitte
6dcd1c9109 Do a proof of concept. "openssl genrsa" will make the name of the
file part of the password prompt unless it's standard input...

More will be added...
2001-06-19 16:34:53 +00:00
Richard Levitte
2fe5adc36c Change the common application routines to use a UI_METHOD for password
prompting, even when done through the callback.
2001-06-19 16:26:30 +00:00
Richard Levitte
839590f576 - Add the possibility to control engines through control names but
with arbitrary arguments instead of just a string.
- Change the key loaders to take a UI_METHOD instead of a callback
  function pointer.  NOTE: this breaks binary compatibility with
  earlier versions of OpenSSL [engine].
- Addapt the nCipher code for these new conditions and add a card
  insertion callback.
2001-06-19 16:12:18 +00:00
Richard Levitte
e0a8d1f94e The default flag should be for default passwords only. Otherwise,
someone having a default that is not a password will be confused.
2001-06-19 15:54:47 +00:00
Richard Levitte
9ad0f6812f Enhance the user interface with better support for dialog box
prompting, application-defined prompts, the possibility to use
defaults (for example default passwords from somewhere else) and
interrupts/cancelations.
2001-06-19 15:52:00 +00:00
Dr. Stephen Henson
a3376fe8fc make apps compile again 2001-06-19 00:23:47 +00:00
Dr. Stephen Henson
3cc1f498a1 Don't set pointer if add_lock_callback used. 2001-06-19 00:04:57 +00:00
Richard Levitte
c6c0035ea5 One feature wasn't quite commited yet 2001-06-18 06:30:12 +00:00
Richard Levitte
531d630b5c Provide an application-common setup function for engines and use it
everywhere.
2001-06-18 06:22:33 +00:00
Ben Laurie
853b1eb424 Fix a memory leak (there's another around here somewhere, though).
PR:
2001-06-17 14:42:57 +00:00
Ben Laurie
09a2615fb2 Delete a redundant line. 2001-06-16 21:51:26 +00:00
Bodo Möller
285b42756a pay attention to blocksize before attempting decryption 2001-06-15 18:05:09 +00:00
Bodo Möller
508f15cdab For MSDOS, the tty filename still is "con", not "/dev/tty" ... 2001-06-11 15:21:33 +00:00
Andy Polyakov
52c0d30078 Get rid of "possible WAW dependency" warnings.
Submitted by:
Reviewed by:
PR:
2001-06-11 12:47:52 +00:00
Bodo Möller
10997ee8ab even use of default engines leaks memory 2001-06-11 09:55:54 +00:00
Bodo Möller
8a774dc9a6 Add directory name to the entry on /crypto/ui/. 2001-06-11 09:55:20 +00:00
Bodo Möller
200bc9e3e8 Earlier OpenSSL versions printed prompts to stderr.
In the new crypto/ui/, this was changed into tty (which is usually
/dev/tty), i.e. the FILE * used for reading passwords from the user.
However stdio buffering for read/write streams is not without pitfalls
(passwords would be echoed on some systems).
To avoid problems, split tty into tty_in and tty_out (which are
opened separately).
2001-06-11 09:54:28 +00:00
Dr. Stephen Henson
7dd0ee0495 Make update 2001-06-11 00:48:09 +00:00
Dr. Stephen Henson
76569fc662 Initialize UI ex_data. 2001-06-11 00:45:33 +00:00
Dr. Stephen Henson
f2a253e0dd Add support for MS CSP Name PKCS#12 attribute. 2001-06-11 00:43:20 +00:00
Ulf Möller
0ad0eaf61c more error codes fixed 2001-06-08 14:16:39 +00:00
Lutz Jänicke
47b0f48dd9 ERR_peek_error() returns "unsigned long". 2001-06-07 17:20:50 +00:00
Richard Levitte
44e48abc44 Use memmove() instead of memcpy() on areas that may overlap.
Spotted by Nalin Dahyabhai <nalin@redhat.com>
2001-06-07 04:42:34 +00:00
Richard Levitte
f420de027f Don't forget to initialise. 2001-06-06 23:12:41 +00:00
Bodo Möller
ecf186065c OAEP fix 2001-06-06 21:44:28 +00:00
Bodo Möller
20e021bf41 when checking OAEP, signal just a single kind of 'decoding error' 2001-06-06 18:48:49 +00:00
Ulf Möller
8ca2ae775d move check to avoid memory leak. 2001-06-06 17:23:23 +00:00
Ulf Möller
ee8aa8217a make sure we don't write to seed[-1] 2001-06-06 17:17:53 +00:00
Richard Levitte
2b49dd1e8f 'make update' 2001-06-05 20:32:36 +00:00
Richard Levitte
30a54b9085 Defining __USE_XOPEN_EXTENDED was the wrong thing. Instead, define
_XOPEN_SOURCE.
2001-06-05 20:29:26 +00:00
Richard Levitte
1e7e62f8cd A good use of the UI interface is as a password callback replacement
(for new functions...).  One might still want to be able to pass down
a user-data pointer to be used by the UI.  However, ex_data doesn't
quite cut it, since that means the appropriate index to it might need
to be shared between parts that aren't really related in that sense,
and would require the currently hidden (static) index holders to be
uncovered.  Not a good thing.  Therefore, add the possibility to add a
user-data pointer to a UI.
2001-06-05 19:05:52 +00:00
Richard Levitte
5352823fbf Small detail about AIX forgotten... 2001-06-05 04:41:57 +00:00
Richard Levitte
20251f01ea Accept digits in symbol names. Spotted by Brian Havard <brianh@kheldar.apana.org.au> 2001-06-04 16:34:31 +00:00
Richard Levitte
528f6b81db More info on SRP. 2001-06-04 16:23:15 +00:00
Richard Levitte
27bfba299e Added more info in SRP. 2001-06-04 06:51:43 +00:00
Richard Levitte
1690863acc Confusion between algorithms resolved. 2001-06-01 15:30:13 +00:00
Richard Levitte
397211323c nCipher callbacks shall return 0 on success, something else otherwise. 2001-06-01 15:29:32 +00:00
Richard Levitte
a87f50fb5a Stop mishandling the type number in dynlock locking 2001-06-01 15:21:01 +00:00
Bodo Möller
31bc51c8cf Fix Bleichenbacher PKCS #1 1.5 countermeasure.
(The attack against SSL 3.1 and TLS 1.0 is impractical anyway,
otherwise this would be a security relevant patch.)
2001-06-01 09:41:25 +00:00
Bodo Möller
be487c429e increase DEFAULT_BUFFER_SIZE (4K instead of just 1K) 2001-06-01 08:38:29 +00:00
Richard Levitte
80340f1fe9 Don't decrement the reference counter twice when destroying dynamic
links.
2001-05-31 22:25:30 +00:00
Geoff Thorpe
d918f85146 Fix a memory leak in 'sk_dup' in the case a realloc() fails. Also, tidy up
a bit of weird code in sk_new.
2001-05-31 19:01:08 +00:00
Andy Polyakov
a95541d61e Get rid of RAW dependency warnings.
Submitted by:
Reviewed by:
PR:
2001-05-30 22:01:33 +00:00
Richard Levitte
30b4c2724e Extend all the loading functions to take an engine pointer, a pass
string (some engines may have certificates protected by a PIN!) and
a description to put into error messages.

Also, have our own password callback that we can send both a password
and some prompt info to.  The default password callback in EVP assumes
that the passed parameter is a password, which isn't always the right
thing, and the ENGINE code (at least the nCipher one) makes other
assumptions...

Also, in spite of having the functions to load keys, some utilities
did the loading all by themselves...  That's changed too.
2001-05-30 15:29:28 +00:00
Richard Levitte
2adc929367 A wish was expressed. 2001-05-30 14:59:14 +00:00
Lutz Jänicke
7e97837274 Don't forget responsible person so that its clear who is to blame. 2001-05-29 13:52:21 +00:00
Andy Polyakov
4cb73bf8e4 Assembler support for IA-64. See the source code commentary for further
details (performance numbers and accompanying discussions:-). Note that
the code is not engaged in ./Configure yet. I'll add it later this week
along with updates for .spec file.

Submitted by:
Reviewed by:
PR:
2001-05-28 20:02:51 +00:00
Richard Levitte
79bb8d0077 Document the latest change in ENGINEs. 2001-05-26 16:58:34 +00:00
Richard Levitte
6c1a3e4f58 We had the password callback for ENGINEs pretty much wrong. And
passwords that were given to the key loading functions were completely
ignored, at least in the ncipher code, and then we made the assumption
that the callback wanted a prompt as user argument.

All that is now changed, and the application author is forced to give
a callback function of type pem_callback_cb and possibly an argument
for it, just as for all other functions that want to generate password
prompting.

NOTE: this change creates binary and source incompatibilities with
previous versions of OpenSSL [engine].  It's worth it this time, to
get it right (or at least better and with a chance that it'll work).
2001-05-25 21:08:56 +00:00
Dr. Stephen Henson
76c919c1a3 Add missing variable length cipher flag for Blowfish.
Only use trust settings if either trust or reject settings
are present, otherwise use compatibility mode. This stops
root CAs being rejected if they have alias of keyid set.
2001-05-24 22:58:35 +00:00
Richard Levitte
98405f240b VMS doesn't support more than on period in a file name 2001-05-22 12:47:38 +00:00
Dr. Stephen Henson
181355616e Add examples to EVP_EncryptInit manual page. 2001-05-17 13:03:20 +00:00
Dr. Stephen Henson
b49a5b2dc0 Fix for new UI functions under Win32.
For some unknown reason fopen("con", "w") is the
only way to make this work. Using "r+" and "w+"
causes the fopen call to fail and the fallback
(using stdin) doesn't work because writing to stdin
fails.
2001-05-17 11:47:08 +00:00
Richard Levitte
713f226114 Add a requirements section for OpenVMS. 2001-05-17 04:21:00 +00:00
Richard Levitte
d57d85ff35 Add a few more details on what one might need. make and a development
environment were a part of a Unix operating systems, but these days
you see an increasing number of installations that do not necessarely
have these crucial parts by default, so it's needs mentioning.
2001-05-17 04:16:19 +00:00
Lutz Jänicke
74daa124c2 Add missing item(s) SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT. 2001-05-16 09:43:51 +00:00
Richard Levitte
b8e35bd66e New internal function OPENSSL_gmtime, which is intended to do the same
as gmtime_r() on the systems where that is defined.
2001-05-16 08:44:09 +00:00
Lutz Jänicke
e8734731d3 Increase ENTROPY_NEEDED to support Rijndael's larger key size. 2001-05-15 16:02:35 +00:00
Richard Levitte
9e0fcabeca Do not forget to increment the pointers... 2001-05-15 15:49:54 +00:00
Richard Levitte
6482dec1bb Low-case the names of the system routines, since some versions of
DEC C only have them declared that way (it doesn't really matter,
since the linker is case-insensitive by default)
2001-05-15 05:15:47 +00:00
Richard Levitte
81b5eeed6a branch on equal is beql, not beq... 2001-05-14 22:10:09 +00:00
Richard Levitte
365359dd79 Make sure strdup() is properly declared. 2001-05-14 12:23:28 +00:00
Richard Levitte
2757be06de Make sure memset() is properly declared. 2001-05-14 12:22:58 +00:00
Richard Levitte
d0afe49d3e ui was forgotten when installing libcrypto and it's headers. 2001-05-14 12:22:27 +00:00
Richard Levitte
81b31b7087 ui_compat.h was forgotten in the "symlinking" routine. 2001-05-14 12:21:16 +00:00
Richard Levitte
2643b122fc Remove the password reading objects from LIB_DES. 2001-05-14 11:59:02 +00:00
Richard Levitte
88db657ac2 Make more short aliases for symbols that are longer than 31
characters.
2001-05-14 11:58:08 +00:00
Richard Levitte
1f0af2c073 len is a size_t, which is an unsigned integer. Therefore, some
compilers will complain against the check for less than zero.
2001-05-14 11:56:47 +00:00
Richard Levitte
2ed2d1515e Use ui_compat.h to get the password reading functions. 2001-05-14 11:54:36 +00:00
Richard Levitte
bb5b16a36c Make it so the compiler doesn't inform me about the dollars in some
symbols.
2001-05-14 11:53:37 +00:00
Lutz Jänicke
5892855c5f Typos. 2001-05-14 09:52:44 +00:00
Lutz Jänicke
a6e859e9ec One more point to clarify, pointed out by "Greg Stark" <ghstark@pobox.com> 2001-05-14 09:02:38 +00:00
Richard Levitte
99c65cef0f It seems like the removal of "extern" before "static" wasn't a
mistake.
2001-05-13 17:55:30 +00:00
Richard Levitte
496da8b918 Document the addition. 2001-05-13 10:37:02 +00:00
Richard Levitte
739862384c A randomizer for OpenVMS, using the statistics that are easily
reachable.

It's completely untested for now.  To be done in the next few days.
2001-05-13 10:34:18 +00:00
Richard Levitte
0a647c2b8b Define `ok' and better error detection. 2001-05-13 05:34:39 +00:00
Richard Levitte
429e4f0de8 make update 2001-05-13 05:16:58 +00:00
Richard Levitte
2d10c7156c Win16 too :-). 2001-05-13 05:01:58 +00:00
Richard Levitte
299053becd des_read_password() and des_read_2passwords() can only appear if DES
is compiled.
2001-05-13 04:59:09 +00:00
Richard Levitte
1449bda052 When doing rewrites on ssleay.num, the file was prematurely closed.
Make rewrites the default, since it works, and people get confused if
changed information doesn't get rewritten automagically.
2001-05-13 04:48:07 +00:00
Richard Levitte
56bb1a7c83 Move the password reading functions completely away from the DES
section.

Add ui_compat.h for inclusion by those who want the old functions and
provide all of them, not just the higher-level ones, in ui_compat.c.
2001-05-13 04:40:44 +00:00
Richard Levitte
96aaf806d8 Put back a removed "extern", or many compilers will complain about
redefined variables.
2001-05-13 04:34:57 +00:00
Dr. Stephen Henson
d70e5100c0 #if 0 out deleted (?) functions to stop Win32 DLL
build falling over.
2001-05-13 00:33:55 +00:00
Dr. Stephen Henson
4831e626aa Change Win32 to use EXPORT_VAR_AS_FN.
Fix OPENSSL_IMPLEMENT_GLOBAL.

Allow Win32 to use EXPORT_VAR_AS_FN in mkdef.pl

make update.
2001-05-12 23:57:41 +00:00
Lutz Jänicke
33ab4699ba Clarify behaviour with respect to SSL/TLS records. 2001-05-12 09:49:02 +00:00
Dr. Stephen Henson
595cc5b4b8 Under VC++ _DLL is set to indicate that the application
will be linked against the DLL runtime library. It is
automatically set when /MD is used.

As a result OpenSSL shouldn't use _DLL to determine if
it should set OPENSSL_OPT_WINDLL because this will
cause linkage conflicts with static builds which do
include the /MD compiler switch.
2001-05-12 00:16:56 +00:00
Dr. Stephen Henson
29fb08c2de Typo. 2001-05-12 00:09:04 +00:00
Richard Levitte
7babdf2029 e_os2.h defines things like OPENSSL_SYS_MSDOS, not opensslconf.h...
(basically: whooops :-))
2001-05-11 11:20:26 +00:00
Lutz Jänicke
4b3270f78e Clarify behaviour of SSL_write() by mentioning SSL_MODE_ENABLE_PARTIAL_WRITE
flag as discussed on the mailing list.
2001-05-11 09:53:10 +00:00
Lutz Jänicke
3351b8d007 Update changelog to reflect additional changes made to the egd-locations. 2001-05-10 09:45:31 +00:00
Bodo Möller
4b49bf6a93 restore change undone in 1.831 (apparently by accident) 2001-05-10 09:33:18 +00:00
Dr. Stephen Henson
926a56bfe3 Purpose and trust setting functions for X509_STORE.
Tidy existing code.
2001-05-10 00:13:59 +00:00
Dr. Stephen Henson
d6f188be71 Fix warning with DEBUG_SAFESTACK 2001-05-10 00:09:43 +00:00
Dr. Stephen Henson
016cadfb54 Fix to allow multiple NONE libraries in mkerr.pl . 2001-05-10 00:07:45 +00:00
Dr. Stephen Henson
bdee69f718 Allow various X509_STORE_CTX properties to be
inherited from X509_STORE.

Add CRL checking options to other applications.
2001-05-09 00:30:39 +00:00
Bodo Möller
ff43e2e155 fix an old entry 2001-05-08 12:45:55 +00:00
Richard Levitte
f53948856e There is no uitest 2001-05-08 04:23:25 +00:00
Richard Levitte
14056ee2ee Don't forget crypto/ui... 2001-05-08 04:09:19 +00:00
Dr. Stephen Henson
b545dc6775 Initial CRL based revocation checking. 2001-05-07 22:52:50 +00:00
Richard Levitte
027902999e Clarify the license and copyright, make preprocessor dirctives a
little bit clearer and use the new OPENSSL_SYS_* macros.
2001-05-07 06:33:35 +00:00
Richard Levitte
9a310a5d4e make update 2001-05-06 23:51:37 +00:00
Richard Levitte
a63d5eaab2 Add a general user interface API. This is designed to replace things
like des_read_password and friends (backward compatibility functions
using this new API are provided).  The purpose is to remove prompting
functions from the DES code section as well as provide for prompting
through dialog boxes in a window system and the like.
2001-05-06 23:19:37 +00:00
Ulf Möller
6af59bc095 the backslash is significant... 2001-05-04 15:03:59 +00:00
Bodo Möller
24cc290b85 .rnd issues 2001-05-03 09:27:43 +00:00
Bodo Möller
8e264a933f bctest changes for Ultrix (don't return 1 from bctest, otherwise make aborts) 2001-05-03 08:50:27 +00:00
Richard Levitte
f0b54fefe9 Some platforms (most notably Windows) do not have a $HOME by default.
For those, unless the environment variables RANDFILE or HOME are
defined (the default case!), RAND_file_name() will return NULL.
This change adds a default HOME for those platforms.

To add a default HOME for any platform, just define DEFAULT_HOME in
the proper place, wrapped in appropriate #ifdef..#endif, in e_os.h.
2001-05-03 07:50:11 +00:00
Richard Levitte
cf2d9e09b3 Add support for Sun C on Solaris x86. Contributed by Ben <mouring@etoh.eviladmin.org> 2001-05-03 06:14:47 +00:00
Richard Levitte
d02408ad8a Remove part conflict indicator... 2001-05-02 07:15:03 +00:00
Geoff Thorpe
7ae551fd03 In RSA, DSA, DH, and RAND - if the "***_new()" function fails because the
ENGINE code does not return a default, set an error.
2001-04-30 15:24:41 +00:00
Dr. Stephen Henson
c2e45f6ddf Win32 fixes:
define LLONG properly for VC++.

stop compiler complaining about signed/unsigned mismatch in apps/engine.c
2001-04-29 16:30:59 +00:00
Richard Levitte
f9a4ad4fa6 A method to create shared libraries on AIX, and according to
"Howard Chu" <hyc@highlandsun.com>, it may be general enough
to work on any Unixly system.
2001-04-27 21:33:44 +00:00
Richard Levitte
10645a4f13 make update 2001-04-27 08:59:00 +00:00
Geoff Thorpe
06cb0353e5 For some inexplicable reason, I'd (a) left the debugging irreversibly
turned on, and (b) left a somewhat curious debugging string in the output.
2001-04-27 00:31:21 +00:00
Geoff Thorpe
b41f836e5f Some fixes to the reference-counting in ENGINE code. First, there were a
few statements equivalent to "ENGINE_add(ENGINE_openssl())" etc. The inner
call to ENGINE_openssl() (as with other functions like it) orphans a
structural reference count. Second, the ENGINE_cleanup() function also
needs to clean up the functional reference counts held internally as the
list of "defaults" (ie. as used when RSA_new() requires an appropriate
ENGINE reference). So ENGINE_clear_defaults() was created and is called
from within ENGINE_cleanup(). Third, some of the existing code was
logically broken in its treatment of reference counts and locking (my
fault), so the necessary bits have been restructured and tidied up.

To test this stuff, compiling with ENGINE_REF_COUNT_DEBUG will cause every
reference count change (both structural and functional) to log a message to
'stderr'. Using with "openssl engine" for example shows this in action
quite well as the 'engine' sub-command cleans up after itself properly.

Also replaced some spaces with tabs.
2001-04-26 23:04:30 +00:00
Richard Levitte
26a81abffc Make proper use of all disabling variables. 2001-04-26 21:02:57 +00:00
Geoff Thorpe
ab03b0df4c "make update" 2001-04-26 20:56:30 +00:00
Geoff Thorpe
e5a77633cf Make notes about ENGINE changes. 2001-04-26 20:42:12 +00:00
Richard Levitte
6f8a82c7af Linux shared libraries can be linked with debug symbols.
Tru64 shared libraries can be linked with static libraries.
2001-04-26 20:17:59 +00:00
Richard Levitte
7a7f47ea80 make update 2001-04-26 19:45:31 +00:00
Geoff Thorpe
0ce5f3e4f5 This adds 2 things to the ENGINE code.
* "ex_data" - a CRYPTO_EX_DATA structure in the ENGINE structure itself
   that allows an ENGINE to store its own information there rather than in
   global variables. It follows the declarations and implementations used
   in RSA code, for better or worse. However there's a problem when storing
   state with ENGINEs because, unlike related structure types in OpenSSL,
   there is no ENGINE-vs-ENGINE_METHOD separation. Because of what ENGINE
   is, it has method pointers as its structure elements ...  which leads
   to;

 * ENGINE_FLAGS_BY_ID_COPY - if an ENGINE should not be used just as a
   reference to an "implementation" (eg. to get to a hardware device), but
   should also be able to maintain state, then this flag can be set by the
   ENGINE implementation. The result is that any call to ENGINE_by_id()
   will not result in the existing ENGINE being returned (with its
   structural reference count incremented) but instead a new copy of the
   ENGINE will be returned that can maintain its own state independantly of
   any other copies returned in the past or future. Eg. key-generation
   might involve a series of ENGINE-specific control commands to set
   algorithms, sizes, module-keys, ids, ACLs, etc. A final command could
   generate the key. An ENGINE doing this would *have* to declare
   ENGINE_FLAGS_BY_ID_COPY so that the state of that process can be
   maintained "per-handle" and unaffected by other code having a reference
   to the same ENGINE structure.
2001-04-26 19:35:44 +00:00
Richard Levitte
21023745e2 Clean up ENGINE before exiting. 2001-04-26 16:08:10 +00:00
Richard Levitte
a679116f6f Provide the possibility to clean up internal ENGINE structures. This
takes care of what would otherwise be seen as a memory leak.
2001-04-26 16:07:08 +00:00
Richard Levitte
3988bb34aa gcc warns when certain values of an enumeration aren't taken care of,
unless there's a default clause.
2001-04-26 15:53:42 +00:00
Richard Levitte
9e78e6c3f8 Check for OPENSSL_NO_RSA, OPENSSL_NO_DSA and OPENSSL_NO_DH and disable
appropriate code if any of them is defined.
2001-04-26 15:45:12 +00:00
Richard Levitte
3caff6092a engine.h includes all the needed header files, so don't do it again
here.
2001-04-26 15:04:22 +00:00
Richard Levitte
0d96bf8950 We shouldn't skip over header files to avoid functions of disabled algorithms. The selection is done in a different way 2001-04-26 12:01:12 +00:00
Richard Levitte
91dc71f98d User OPENSSL_UNISTD instead of <unistd.h>.
Spotted by Mark Crispin <MRC@Panda.COM>
2001-04-26 08:26:18 +00:00
Geoff Thorpe
b7b6c047ca This change to the "dl", "dlfcn", and "win32" DSO_METHODs adds the filename
or symbol name to the error stack in the event a load or bind operation
failed.
2001-04-25 22:40:55 +00:00
Lutz Jänicke
0ea659475c Typo (reported by Petr Lancaric <Petr.Lancaric@ips-ag.cz>) 2001-04-25 15:24:47 +00:00
Geoff Thorpe
1e20bb0648 Make update. 2001-04-22 17:21:19 +00:00
Dr. Stephen Henson
c962479bdf Fix ASN1 bug when decoding OTHER type.
Various S/MIME DSA related fixes.
2001-04-21 12:06:01 +00:00
Richard Levitte
b31ccc362c Script to create shareable images (shared libraries in Unixly terms)
on VMS.
2001-04-20 13:09:10 +00:00
Richard Levitte
0cd5866726 VMS was behind when it comes to OCSP. 2001-04-20 12:37:14 +00:00
Geoff Thorpe
2a8a10eda6 Add notes about the new ENGINE functionality. 2001-04-19 23:06:00 +00:00
Geoff Thorpe
f11bc84080 Changes to "openssl engine" to support the new control command code in
ENGINE.

 * Extra verbosity can be added with more "v"'s, eg. '-vvv' gives
   information about input flags and descriptions for each control command
   in each ENGINE. Check the output of "openssl engine -vvv" for example.

 * '-pre <cmd>' and '-post <cmd>' can be used to invoke control commands on
   the specified ENGINE (or on all of them if no engine id is specified,
   although that usually gets pretty ugly). '-post' commands are only
   attempted if '-t' is specified and the engine successfully initialises.
   '-pre' commands are always attempted whether or not '-t' causes an
   initialisation to be tried afterwards. Multiple '-pre' and/or '-post'
   commands can be specified and they will be called in the order they
   occur on the command line.

Parameterised commands (the normal case, there are currently no
unparameterised ones) are split into command and argument via a separating
colon. Eg. "openssl engine -pre SO_PATH:/lib/libdriver.so <id>" results in
the call;
    ENGINE_ctrl_cmd_string(e, "SO_PATH", "/lib/libdriver.so", 0);

Application code should similarly allow arbitrary name-value string pairs
to be passed into ENGINEs in a manner matching that in apps/engine.c,
either using the same colon-separated format, or entered as two distinct
strings. Eg. as stored in a registry. The last parameter of
ENGINE_ctrl_cmd_string can be changed from 0 to 1 if the command should
only be attempted if it's supported by the specified ENGINE (eg. for
commands like "FORK_CHECK:1" that may or may not apply to the run-time
ENGINE).
2001-04-19 02:08:26 +00:00
Geoff Thorpe
e2f3ae1252 Some more tweaks to ENGINE code.
This change adds some basic control commands to the existing ENGINEs
(except the software 'openssl' engine). All these engines currently load
shared-libraries for hardware APIs, so they've all been given "SO_PATH"
commands that will configure the chosen ENGINE to load its shared library
from the given path. Eg. by calling;
    ENGINE_ctrl_cmd_string(e, "SO_PATH", <path>, 0).

The nCipher 'chil' ENGINE has also had "FORK_CHECK" and "THREAD_LOCKING"
commands added so these settings could be handled via application-level
configuration rather than in application source code.

Changes to "openssl engine" to test and examine these control commands will
be made shortly. It will also provide the necessary tips to application
programs wanting to support these dynamic control commands.
2001-04-19 01:45:40 +00:00
Geoff Thorpe
40fcda292f Some BIG tweaks to ENGINE code.
This change adds some new functionality to the ENGINE code and API to
make it possible for ENGINEs to describe and implement their own control
commands that can be interrogated and used by calling applications at
run-time. The source code includes numerous comments explaining how it all
works and some of the finer details. But basically, an ENGINE will normally
declare an array of ENGINE_CMD_DEFN entries in its ENGINE - and the various
new ENGINE_CTRL_*** command types take care of iterating through this list
of definitions, converting command numbers to names, command names to
numbers, getting descriptions, getting input flags, etc. These
administrative commands are handled directly in the base ENGINE code rather
than in each ENGINE's ctrl() handler, unless they specify the
ENGINE_FLAGS_MANUAL_CMD_CTRL flag (ie. if they're doing something clever or
dynamic with the command definitions).

There is also a new function, ENGINE_cmd_is_executable(), that will
determine if an ENGINE control command is of an "executable" type that
can be used in another new function, ENGINE_ctrl_cmd_string(). If not, the
control command is not supposed to be exposed out to user/config level
access - eg. it could involve the exchange of binary data, returning
results to calling code, etc etc. If the command is executable then
ENGINE_ctrl_cmd_string() can be called using a name/arg string pair. The
control command's input flags will be used to determine necessary
conversions before the control command is called, and commands of this
form will always return zero or one (failure or success, respectively).
This is set up so that arbitrary applications can support control commands
in a consistent way so that tweaking particular ENGINE behaviour is
specific to the ENGINE and the host environment, and independant of the
application or OpenSSL.

Some code demonstrating this stuff in action will applied shortly to the
various ENGINE implementations, as well as "openssl engine" support for
executing arbitrary control commands before and/or after initialising
various ENGINEs.
2001-04-19 00:41:55 +00:00
Geoff Thorpe
59bc3126c5 Some more tweaks to ENGINE code.
The existing ENGINEs (including the default 'openssl' software engine) were
static, declared inside the source file for each engine implementation. The
reason this was not going boom was that all the ENGINEs had reference
counts that never hit zero (once linked into the internal list, each would
always have at least 1 lasting structural reference).

To fix this so it will stay standing when an "unload" function is added to
match ENGINE_load_builtin_engines(), the "constructor" functions for each
ENGINE implementation have been changed to dynamically allocate and
construct their own ENGINEs using API functions. The other benefit of this
is that no ENGINE implementation has to include the internal "engine_int.h"
header file any more.
2001-04-18 21:46:00 +00:00
Geoff Thorpe
4d6115a5cc Make a note of the recent ENGINE developments. 2001-04-18 21:12:02 +00:00
Bodo Möller
3a25b96caf typo 2001-04-18 15:11:42 +00:00
Bodo Möller
6e6d04e29a fix md_rand.c locking bugs 2001-04-18 15:07:35 +00:00
Geoff Thorpe
48ff225300 Make the shared library name and function symbol for the "nuron" ENGINE
static data where they could be parameterised by ctrl() commands.
2001-04-18 04:47:01 +00:00
Geoff Thorpe
a4a9d97a3e Some more tweaks from ENGINE code.
Previously RAND_get_rand_method was returning a non-const pointer, but it
should be const. As with all other such cases, METHOD pointers are stored and
returned as "const". The only methods one should be able to alter are methods
"local" to the relevant code, in which case a non-const handle to the methods
should already exist.

This change has been forced by the constifying of the ENGINE code (before
which RAND_METHOD was the only method pointer in an ENGINE structure that was
not constant).
2001-04-18 04:18:16 +00:00
Geoff Thorpe
404f952aa3 Some more tweaks to ENGINE code.
ENGINE handler functions should take the ENGINE structure as a parameter -
this is because ENGINE structures can be copied, and like other
structure/method setups in OpenSSL, it should be possible for init(),
finish(), ctrl(), etc to adjust state inside the ENGINE structures rather
than globally. This commit includes the dependant changes in the ENGINE
implementations.
2001-04-18 03:57:05 +00:00
Geoff Thorpe
dcd87618ab Some more tweaks to ENGINE code.
Previous changes permanently removed the commented-out old code for where
it was possible to create and use an ENGINE statically, and this code gets
rid of the ENGINE_FLAGS_MALLOCED flag that supported the distinction with
dynamically allocated ENGINEs. It also moves the area for ENGINE_FLAGS_***
values from engine_int.h to engine.h - because it should be possible to
declare ENGINEs just from declarations in exported headers.
2001-04-18 03:03:16 +00:00
Geoff Thorpe
d54bf14559 Some more tweaks to ENGINE code.
* Constify the get/set functions, and add some that functions were missing.

* Add a new 'ENGINE_cpy()' function that will produce a new ENGINE based
  copied from an original (except for the references, ie. the new copy will
  be like an ENGINE returned from 'ENGINE_new()' - a structural reference).

* Removed the "null parameter" checking in the get/set functions - it is
  legitimate to set NULL values as a way of *changing* an ENGINE (ie.
  removing a handler that previously existed). Also, passing a NULL pointer
  for an ENGINE is obviously wrong for these functions, so don't bother
  checking for it. The result is a number of error codes and strings could
  be removed.
2001-04-18 02:01:36 +00:00
Geoff Thorpe
ea3a429efe Structural references should never be decremented directly - so leave that
to ENGINE_free(). Also, remove "#if 0" code that has no useful future.
2001-04-18 01:07:28 +00:00
Geoff Thorpe
e3f1223fe4 This moves string constants out of vendor headers and into C files. 2001-04-18 00:43:23 +00:00
Geoff Thorpe
7ef6e3fe2f 'make update' 2001-04-17 23:53:58 +00:00
Lutz Jänicke
197322455d Clarify request of client certificates. This is a FAQ. 2001-04-17 13:18:56 +00:00
Ben Laurie
4f19a0672b Fix warning. 2001-04-16 03:00:57 +00:00
Lutz Jänicke
854e076df8 Constify (Jason Molenda <jason@molenda.com>) 2001-04-14 14:50:02 +00:00
Lutz Jänicke
cb2a0e1319 Missing link ("Greg Stark" <gstark@ethentica.com>) 2001-04-12 21:11:31 +00:00
Lutz Jänicke
638b0d4277 Fix wrong information with respect to CAs listed to the client
(follows from technical discussion with Amit Chopra <amitc@pspl.co.in>).
2001-04-12 16:02:34 +00:00
Bodo Möller
f2346808de update so that changes going into the 0.9.6 tree can be logged 2001-04-12 12:42:20 +00:00
Bodo Möller
d7818facb9 undo previous change ... 2001-04-12 12:03:41 +00:00
Bodo Möller
bcf95a2183 update from 0.9.6a 2001-04-12 12:01:47 +00:00
Lutz Jänicke
f7181a9179 Typo (Jun-ichiro itojun Hagino <itojun@iijlab.net>) 2001-04-12 11:45:42 +00:00
Richard Levitte
9237ba8b66 Correct typo. 2001-04-11 14:14:54 +00:00
Richard Levitte
95874603b0 Add -keyform. 2001-04-11 14:11:55 +00:00
Richard Levitte
ed2e24d564 Show an example of moving the emailAddress object from the subkect DN
to subjectAltName when signing a certificate.
2001-04-11 13:04:20 +00:00
Richard Levitte
c9fd77e9dd Make it possible to move the emailAddress object to the subjectAltName
extension instead of just copying it.  That makes a certificate comply
even more with PKIX recommendations according to RFC 2459.
2001-04-11 12:55:06 +00:00
Bodo Möller
a9d2bc4902 Add information on 0.9.6a (in a form such that the list can be
verified by looking at 'diff -u ../openssl-0.9.6a/CHANGES CHANGES')
2001-04-11 10:35:38 +00:00
Richard Levitte
c3bdbcf639 NetBSD and OpenBSD use TOD as well 2001-04-11 10:06:02 +00:00
Bodo Möller
d9a770e6ea Mention automatically queried EGD sockets (OpenSSL 0.9.7).
0.9.5 is obsolete, so we don't have to discuss its 'openssl rsa'
seeding bug.
2001-04-10 07:59:43 +00:00
Lutz Jänicke
35feed50f0 Some clarifications about $RANDFILE usage. 2001-04-09 16:01:38 +00:00
Lutz Jänicke
a116afa42e OpenSSH 1.2.2p1 is dead and gone. Errors detecting the OpenSSL library
are however still common and are solved by checking config.log.
2001-04-09 15:55:58 +00:00
Richard Levitte
b4542fb307 Correct info in the FAQ. 2001-04-09 14:17:26 +00:00
Bodo Möller
1f224bf029 Adjust BN_mod_inverse algorithm selection according to experiments on
Ultra-Sparcs (both 32-bit and 64-bit compilations)
2001-04-09 09:28:24 +00:00
Bodo Möller
4d231b4359 update (0.9.6a) 2001-04-09 07:15:16 +00:00
Bodo Möller
ac0f1d0b14 comment 2001-04-08 18:47:23 +00:00
Bodo Möller
124d8cf701 code documentation 2001-04-08 18:41:35 +00:00
Bodo Möller
7d0d0996aa binary algorithm for modular inversion 2001-04-08 18:23:44 +00:00
Bodo Möller
9cddbf14db avoid '||' since Ultrix apparently doesn't understand it 2001-04-08 18:22:53 +00:00
Bodo Möller
5f1fddbbe7 '||', '&&' and 'test -x' apparently don't work on Ultrix;
also 'test' appears to be available as '[' only in 'if' conditions.
2001-04-08 13:49:45 +00:00
Bodo Möller
027e257b1d Avoid assert() in the library. 2001-04-08 13:47:51 +00:00
Lutz Jänicke
93f117003e Add forgotten "-passin" option to smime.c usage help. 2001-04-08 10:51:14 +00:00
Richard Levitte
42748c084e Resize a local buffer to accomodate the size requirements of AES.
Protect against future mistakes with an assert().
2001-04-08 05:41:42 +00:00
Richard Levitte
77dd9c1850 Add the possibility to have AES removed in Windows as well.
Spotted by Harald Koch <chk@pobox.com>
2001-04-08 04:35:58 +00:00
Bodo Möller
83d968df60 Don't use 'tt' uninitialized when reporting an error
(we don't have an ASN1_TEMPLATE to complain about at this stage,
so  errtt == NULL  should be OK)
2001-04-05 11:40:16 +00:00
Richard Levitte
4ac881ede3 Fix couple of memory leaks in PKCS7_dataDecode().
(provided by Stephen)
2001-04-05 10:19:12 +00:00
Richard Levitte
ccd2cd3e64 Unixware config. 2001-04-05 10:09:53 +00:00
Bodo Möller
6186ef9338 don't use shell functions 2001-04-04 16:26:31 +00:00
Richard Levitte
6bcac6e578 Correct a typo. linux != linus. 2001-04-04 16:03:00 +00:00
Richard Levitte
967d95f096 Incorporate some changes that make OpenSSL compilable in CygWin. 2001-04-04 15:50:30 +00:00
Richard Levitte
26c7750827 Since vms.mar handles 32-bit integers, do not use it on Alpha, that's
just a slowdown.
2001-04-04 13:52:56 +00:00
Richard Levitte
5a16d270ab OpenVMS/Alpha should use 64 bits. If nothing else, there's
performance to gain.
2001-04-04 13:51:35 +00:00
Richard Levitte
3a465d5ec9 Make do_bsd-gcc-shared depend on do_gnu-shared instead of the non-existent linux-shared 2001-04-04 04:24:24 +00:00
Bodo Möller
413a4a0461 Fix warnings. 2001-04-03 14:03:47 +00:00
Bodo Möller
a95d2c5133 Make sure OPENSSL_SYS_... is defined when we need it. 2001-04-03 14:03:19 +00:00
Bodo Möller
1876cc32ae This change should be suitable as a workaround for the Solaris x86
compiler bug reported in <01032110293775.22278@weba3.iname.net>
(the '++seq[i]' condition is evaluated as 256 rather than 0
when the previous value is 255).
2001-04-03 13:50:30 +00:00
Richard Levitte
4e2a08ddd4 Plug a memory leak. Spotted by "Shijin" <shijin@comex.com> 2001-04-03 09:42:36 +00:00
Richard Levitte
61e2c34a10 Reports on Windows, DG-UX and older OpenVMS. 2001-04-03 09:02:07 +00:00
Richard Levitte
e56b54a376 libfisdef.h and LIB do not exist on older VMS versions 2001-04-03 08:31:39 +00:00
Richard Levitte
0da945bb20 Remove a typo in dgux-R4-gcc. 2001-04-03 08:05:03 +00:00
Geoff Thorpe
69443d0da0 ENGINE_load_[private|public]_key had error handling that could return
without releasing a lock. This is the same fix as applied to
OpenSSL-engine-0_9_6-stable, minus the ENGINE_ctrl() change - the HEAD
already had that fixed.
2001-04-02 17:47:16 +00:00
Geoff Thorpe
e4dc18d7e5 Actually there were two error cases that could return without releasing the
lock - stupidly, my last change addressed only one of them.
2001-04-02 17:21:36 +00:00
Geoff Thorpe
3f86a2b147 Don't return an error until the global lock is released. 2001-04-02 17:06:36 +00:00
Richard Levitte
fd664b9fc6 Reports on VMS. 2001-04-02 14:39:20 +00:00
Dr. Stephen Henson
722ca2781c Rewrite CHOICE field setting code to properly handle
combine in CHOICE options.

This was causing d2i_DSAPublicKey() to misbehave.
2001-04-02 00:59:19 +00:00
Richard Levitte
1c72eebf89 A few more reports. 2001-04-01 15:18:35 +00:00
Richard Levitte
69ce8bb952 Note reports. 2001-03-31 14:03:09 +00:00
Bodo Möller
50b8ba0201 avoid buffer overflow 2001-03-31 07:48:07 +00:00
Ulf Möller
c9fd9152bd Note the Alpha asm change 2001-03-31 01:23:10 +00:00
Richard Levitte
f891abccf2 linux-elf verified. 2001-03-30 21:43:06 +00:00
Richard Levitte
e2effdbc6b Beta 3 has been released and announced. 2001-03-30 20:54:12 +00:00
Bodo Möller
b10ae320f7 this time *really* fix the /../ check ... 2001-03-30 14:55:50 +00:00
Bodo Möller
5d3ab9b096 For -WWW, fix test for ".." directory references (and avoid warning for
index -1).
2001-03-30 10:47:21 +00:00
Bodo Möller
4fea8145e2 News for 0.9.6a. 2001-03-30 10:46:15 +00:00
Bodo Möller
884e26080f Fix bctest, and add a workaround that should solve the problem with
FreeBSD's /bin/sh.
2001-03-30 09:19:18 +00:00
Richard Levitte
9946491fcc Complete the des_encrypt to des_encrypt1 rename in the main
development line as well.
2001-03-30 07:26:54 +00:00
Richard Levitte
ae6dfff5bf One des_encrypt to des_encrypt1 I forgot to commit... 2001-03-29 20:30:23 +00:00
Richard Levitte
307bf4dae2 Stress the news about the name change. 2001-03-29 15:15:10 +00:00
Richard Levitte
96d65fc022 I forgot to rename des_encrypt to des_encrypt1 in libeay.num. 2001-03-29 10:49:27 +00:00
Richard Levitte
080b8cadfa Since there has been reports of clashes between OpenSSL's
des_encrypt() and des_encrypt() defined on some systems (Solaris and
Unixware and maybe others), we rename des_encrypt() to des_encrypt1().
This should have very little impact on external software unless
someone has written a mode of DES, since that's all des_encrypt() is
meant for.
2001-03-29 07:45:37 +00:00
Richard Levitte
7cdd2aa128 Add news section for OpenSSL 0.9.6a. Please add what's missing 2001-03-28 13:36:13 +00:00
Ulf Möller
7d7672f119 check CRT 2001-03-28 05:10:38 +00:00
Ulf Möller
6a5b52efa0 check CRT 2001-03-28 04:56:58 +00:00
Ulf Möller
6d864b7030 mips 2001-03-28 02:41:02 +00:00
Richard Levitte
71a39dd4be Restore asm/mips3.s to be compiled and linked in, since the bug has
(at least hopefully :-)) been fixed.
2001-03-27 23:42:36 +00:00
Andy Polyakov
500230ee94 The IRIX fix. Asm recap and corresponding declation.
Submitted by:
Reviewed by:
PR:
2001-03-27 22:30:46 +00:00
Richard Levitte
347177e052 Include bn.h so we get BN_LLONG properly defined. Otherwise, we can forget things like %lld 2001-03-27 18:34:04 +00:00
Richard Levitte
b7883fbb6e Reports seem to show that asm/mips3.s has faults. To be investigated, but let's avoid using it in the mean time 2001-03-27 09:13:03 +00:00
Richard Levitte
a77e023ab4 For mips3 and alpha, put the assembler file directives in separate
variables and disable the Alpha assembler for now, since it has been
shown to fail.

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

FFFFFFFFFFFFFF0000FF2E00000000EBFFFFFF0000D1
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46FFE0FFFF0000

The result is:

1FFFFFFFFFFFEFF0000FF2E0000000032FFE0FEFF00D1

The result should really be:

1FFFFFFFFFFFFFF0000FF2E0000000032FFE0FEFF00D1
2001-03-26 16:16:12 +00:00
Richard Levitte
812cb5638c make update 2001-03-24 12:39:59 +00:00
Richard Levitte
77a0f1d727 When using the native tools on Solaris, make damn sure the native ld
is used, even if the user has GNU ld earlier in his $PATH.
2001-03-24 12:31:11 +00:00
Richard Levitte
b9a18f3b8d gcc uses collect2, not ld, to link things. Therefore, when using gcc
there's no need fooling ourselves, it's the gnu-shared method that we
should use.  Do it for Solaris to begin with.
2001-03-24 12:29:21 +00:00
Richard Levitte
73aeb61c3f ln on Solaris expects -f to come before -s.
The linux-shared method is actually gcc-specific, so call it
gnu-shared as well.
2001-03-24 11:45:57 +00:00
Richard Levitte
3041903844 Small AIX problems solved. 2001-03-22 22:13:16 +00:00
Richard Levitte
ad8ee98617 A lot of reports. 2001-03-22 21:32:26 +00:00
Richard Levitte
bc29d0e5d4 We really have no need for PEX_LIBS, so empty it. 2001-03-22 21:20:54 +00:00
Bodo Möller
f89aebb1c4 Add missing '#ifndef OPENSSL_NO_DSA'. 2001-03-22 15:06:19 +00:00
Richard Levitte
1d7fb4f0c5 Remove redundant operations and update version info. 2001-03-22 12:14:37 +00:00
Bodo Möller
81a6c7817f Harmonize CHANGES and STATUS files between the 0.9.6a branch and
the trunk to keep diffs small.
2001-03-22 10:59:41 +00:00
Richard Levitte
5238fccc15 Use stdlib.h to get size_t. 2001-03-21 18:43:12 +00:00
Bodo Möller
fba9046490 Update docs. 2001-03-21 15:25:56 +00:00
Richard Levitte
8a2908a24a Since they aren't implemented yet, EC_GFp_{recp,nist}_method() need to
be "#if 0"'d, or they will (re)appear as existing functions in
util/libeay.num.
2001-03-21 12:34:34 +00:00
Bodo Möller
e8b12f7a6f Tag EC_GFp_{nist,recp}_method as "NOEXIST" because they have
not yet been implemented.
2001-03-21 09:58:57 +00:00
Richard Levitte
271da5a2e0 avoid linking problems when OpenSSL is built with no-dsa. Spotted by Hellan,Kim KHE <khe@kmd.dk> 2001-03-20 15:36:59 +00:00
Bodo Möller
26fbabf3d1 Increase boundaries in EC_window_bits_for_scalar_size table. 2001-03-20 11:16:12 +00:00
Bodo Möller
37cdcb4d8a Table for window sizes. 2001-03-19 22:38:24 +00:00
Bodo Möller
57b6534e53 Update. 2001-03-19 22:38:01 +00:00
Richard Levitte
8bf49ea170 New cofiguration for Unixwre and SCO,with slightly better granularity. Contributed by Tim Rice <tim@multitalents.net> 2001-03-18 14:25:01 +00:00
Dr. Stephen Henson
02ee8626fb Fix PKCS#12 key generation bug. 2001-03-18 02:11:42 +00:00
Bodo Möller
6276e5b41b Explicitly ignore the exit code of ./bctest. Usually the shell
ignores it anyway in command substitution, but Ultrix reportedly
aborted the test when bctest returned 1.
2001-03-17 09:51:25 +00:00
Richard Levitte
51740b12ae Correct a typo which might have lead to a dump.
Noted by Martin Kraemer <Martin.Kraemer@Fujitsu-Siemens.com>
2001-03-16 10:30:10 +00:00
Richard Levitte
6e6783056e An enhanced bctest submitted by Tim Rice <tim@multitalents.net>.
It now looks along $PATH for a working bc and returns the absolute
path to one that does work.
2001-03-16 09:13:11 +00:00
Dr. Stephen Henson
791bd0cd2b Add copy_extensions option to 'ca' utility. 2001-03-16 02:04:17 +00:00
Dr. Stephen Henson
e890dcdb19 Add 'align' option to nameopt.
Add default values for display by the 'ca' utility
to openssl.cnf

Update docs.
2001-03-15 22:45:20 +00:00
Richard Levitte
5ddcb8664a Minimise the amount of -L. when linking the shared libraries. It
seems like some Unixen (SCO) have opinions about too many -L.
2001-03-15 22:10:07 +00:00
Richard Levitte
09c4b4e0b7 bsdi-elf needs to link with -ldl. 2001-03-15 20:48:27 +00:00
Richard Levitte
368101778e For AIX 4.3 or above, allow the use of dlfcn. 2001-03-15 20:23:22 +00:00
Dr. Stephen Henson
535d79da63 Overhaul the display of certificate details in
the 'ca' utility. This can now be extensively
customised in the configuration file and handles
multibyte strings and extensions properly.

This is required when extensions copying from
certificate requests is supported: the user
must be able to view the extensions before
allowing a certificate to be issued.
2001-03-15 19:13:40 +00:00
Bodo Möller
4f69172d25 Completely remove mont2 stuff.
It does not appear to be faster than the current Montgomery code
except for very small moduli (somewhere between 192 and 224 bits
in a 64-bit Sun environment, and even less than 192 bits
on 32 bit systems).
2001-03-15 18:17:40 +00:00
179 changed files with 10622 additions and 1032 deletions

246
CHANGES
View File

@@ -2,6 +2,246 @@
OpenSSL CHANGES
_______________
Changes between 0.9.6b and 0.9.6c [21 dec 2001]
*) Fix BN_rand_range bug pointed out by Dominikus Scherkl
<Dominikus.Scherkl@biodata.com>. (The previous implementation
worked incorrectly for those cases where range = 10..._2 and
3*range is two bits longer than range.)
[Bodo Moeller]
*) Only add signing time to PKCS7 structures if it is not already
present.
[Steve Henson]
*) Fix crypto/objects/objects.h: "ld-ce" should be "id-ce",
OBJ_ld_ce should be OBJ_id_ce.
Also some ip-pda OIDs in crypto/objects/objects.txt were
incorrect (cf. RFC 3039).
[Matt Cooper, Frederic Giudicelli, Bodo Moeller]
*) Release CRYPTO_LOCK_DYNLOCK when CRYPTO_destroy_dynlockid()
returns early because it has nothing to do.
[Andy Schneider <andy.schneider@bjss.co.uk>]
*) [In 0.9.6c-engine release:]
Fix mutex callback return values in crypto/engine/hw_ncipher.c.
[Andy Schneider <andy.schneider@bjss.co.uk>]
*) [In 0.9.6c-engine release:]
Add support for Cryptographic Appliance's keyserver technology.
(Use engine 'keyclient')
[Cryptographic Appliances and Geoff Thorpe]
*) Add a configuration entry for OS/390 Unix. The C compiler 'c89'
is called via tools/c89.sh because arguments have to be
rearranged (all '-L' options must appear before the first object
modules).
[Richard Shapiro <rshapiro@abinitio.com>]
*) [In 0.9.6c-engine release:]
Add support for Broadcom crypto accelerator cards, backported
from 0.9.7.
[Broadcom, Nalin Dahyabhai <nalin@redhat.com>, Mark Cox]
*) [In 0.9.6c-engine release:]
Add support for SureWare crypto accelerator cards from
Baltimore Technologies. (Use engine 'sureware')
[Baltimore Technologies and Mark Cox]
*) [In 0.9.6c-engine release:]
Add support for crypto accelerator cards from Accelerated
Encryption Processing, www.aep.ie. (Use engine 'aep')
[AEP Inc. and Mark Cox]
*) Add a configuration entry for gcc on UnixWare.
[Gary Benson <gbenson@redhat.com>]
*) Change ssl/s2_clnt.c and ssl/s2_srvr.c so that received handshake
messages are stored in a single piece (fixed-length part and
variable-length part combined) and fix various bugs found on the way.
[Bodo Moeller]
*) Disable caching in BIO_gethostbyname(), directly use gethostbyname()
instead. BIO_gethostbyname() does not know what timeouts are
appropriate, so entries would stay in cache even when they have
become invalid.
[Bodo Moeller; problem pointed out by Rich Salz <rsalz@zolera.com>
*) Change ssl23_get_client_hello (ssl/s23_srvr.c) behaviour when
faced with a pathologically small ClientHello fragment that does
not contain client_version: Instead of aborting with an error,
simply choose the highest available protocol version (i.e.,
TLS 1.0 unless it is disabled). In practice, ClientHello
messages are never sent like this, but this change gives us
strictly correct behaviour at least for TLS.
[Bodo Moeller]
*) Fix SSL handshake functions and SSL_clear() such that SSL_clear()
never resets s->method to s->ctx->method when called from within
one of the SSL handshake functions.
[Bodo Moeller; problem pointed out by Niko Baric]
*) In ssl3_get_client_hello (ssl/s3_srvr.c), generate a fatal alert
(sent using the client's version number) if client_version is
smaller than the protocol version in use. Also change
ssl23_get_client_hello (ssl/s23_srvr.c) to select TLS 1.0 if
the client demanded SSL 3.0 but only TLS 1.0 is enabled; then
the client will at least see that alert.
[Bodo Moeller]
*) Fix ssl3_get_message (ssl/s3_both.c) to handle message fragmentation
correctly.
[Bodo Moeller]
*) Avoid infinite loop in ssl3_get_message (ssl/s3_both.c) if a
client receives HelloRequest while in a handshake.
[Bodo Moeller; bug noticed by Andy Schneider <andy.schneider@bjss.co.uk>]
*) Bugfix in ssl3_accept (ssl/s3_srvr.c): Case SSL3_ST_SW_HELLO_REQ_C
should end in 'break', not 'goto end' which circuments various
cleanups done in state SSL_ST_OK. But session related stuff
must be disabled for SSL_ST_OK in the case that we just sent a
HelloRequest.
Also avoid some overhead by not calling ssl_init_wbio_buffer()
before just sending a HelloRequest.
[Bodo Moeller, Eric Rescorla <ekr@rtfm.com>]
*) Fix ssl/s3_enc.c, ssl/t1_enc.c and ssl/s3_pkt.c so that we don't
reveal whether illegal block cipher padding was found or a MAC
verification error occured. (Neither SSLerr() codes nor alerts
are directly visible to potential attackers, but the information
may leak via logfiles.)
Similar changes are not required for the SSL 2.0 implementation
because the number of padding bytes is sent in clear for SSL 2.0,
and the extra bytes are just ignored. However ssl/s2_pkt.c
failed to verify that the purported number of padding bytes is in
the legal range.
[Bodo Moeller]
*) Add OpenUNIX-8 support including shared libraries
(Boyd Lynn Gerber <gerberb@zenez.com>).
[Lutz Jaenicke]
*) Improve RSA_padding_check_PKCS1_OAEP() check again to avoid
'wristwatch attack' using huge encoding parameters (cf.
James H. Manger's CRYPTO 2001 paper). Note that the
RSA_PKCS1_OAEP_PADDING case of RSA_private_decrypt() does not use
encoding parameters and hence was not vulnerable.
[Bodo Moeller]
*) BN_sqr() bug fix.
[Ulf M<>ller, reported by Jim Ellis <jim.ellis@cavium.com>]
*) Rabin-Miller test analyses assume uniformly distributed witnesses,
so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
followed by modular reduction.
[Bodo Moeller; pointed out by Adam Young <AYoung1@NCSUS.JNJ.COM>]
*) Add BN_pseudo_rand_range() with obvious functionality: BN_rand_range()
equivalent based on BN_pseudo_rand() instead of BN_rand().
[Bodo Moeller]
*) s3_srvr.c: allow sending of large client certificate lists (> 16 kB).
This function was broken, as the check for a new client hello message
to handle SGC did not allow these large messages.
(Tracked down by "Douglas E. Engert" <deengert@anl.gov>.)
[Lutz Jaenicke]
*) Add alert descriptions for TLSv1 to SSL_alert_desc_string[_long]().
[Lutz Jaenicke]
*) Fix buggy behaviour of BIO_get_num_renegotiates() and BIO_ctrl()
for BIO_C_GET_WRITE_BUF_SIZE ("Stephen Hinton" <shinton@netopia.com>).
[Lutz Jaenicke]
*) Rework the configuration and shared library support for Tru64 Unix.
The configuration part makes use of modern compiler features and
still retains old compiler behavior for those that run older versions
of the OS. The shared library support part includes a variant that
uses the RPATH feature, and is available through the special
configuration target "alpha-cc-rpath", which will never be selected
automatically.
[Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> via Richard Levitte]
*) In ssl3_get_key_exchange (ssl/s3_clnt.c), call ssl3_get_message()
with the same message size as in ssl3_get_certificate_request().
Otherwise, if no ServerKeyExchange message occurs, CertificateRequest
messages might inadvertently be reject as too long.
[Petr Lampa <lampa@fee.vutbr.cz>]
*) Enhanced support for IA-64 Unix platforms (well, Linux and HP-UX).
[Andy Polyakov]
*) Modified SSL library such that the verify_callback that has been set
specificly for an SSL object with SSL_set_verify() is actually being
used. Before the change, a verify_callback set with this function was
ignored and the verify_callback() set in the SSL_CTX at the time of
the call was used. New function X509_STORE_CTX_set_verify_cb() introduced
to allow the necessary settings.
[Lutz Jaenicke]
*) Initialize static variable in crypto/dsa/dsa_lib.c and crypto/dh/dh_lib.c
explicitly to NULL, as at least on Solaris 8 this seems not always to be
done automatically (in contradiction to the requirements of the C
standard). This made problems when used from OpenSSH.
[Lutz Jaenicke]
*) In OpenSSL 0.9.6a and 0.9.6b, crypto/dh/dh_key.c ignored
dh->length and always used
BN_rand_range(priv_key, dh->p).
BN_rand_range() is not necessary for Diffie-Hellman, and this
specific range makes Diffie-Hellman unnecessarily inefficient if
dh->length (recommended exponent length) is much smaller than the
length of dh->p. We could use BN_rand_range() if the order of
the subgroup was stored in the DH structure, but we only have
dh->length.
So switch back to
BN_rand(priv_key, l, ...)
where 'l' is dh->length if this is defined, or BN_num_bits(dh->p)-1
otherwise.
[Bodo Moeller]
*) In
RSA_eay_public_encrypt
RSA_eay_private_decrypt
RSA_eay_private_encrypt (signing)
RSA_eay_public_decrypt (signature verification)
(default implementations for RSA_public_encrypt,
RSA_private_decrypt, RSA_private_encrypt, RSA_public_decrypt),
always reject numbers >= n.
[Bodo Moeller]
*) In crypto/rand/md_rand.c, use a new short-time lock CRYPTO_LOCK_RAND2
to synchronize access to 'locking_thread'. This is necessary on
systems where access to 'locking_thread' (an 'unsigned long'
variable) is not atomic.
[Bodo Moeller]
*) In crypto/rand/md_rand.c, set 'locking_thread' to current thread's ID
*before* setting the 'crypto_lock_rand' flag. The previous code had
a race condition if 0 is a valid thread ID.
[Travis Vitek <vitek@roguewave.com>]
*) Add support for shared libraries under Irix.
[Albert Chin-A-Young <china@thewrittenword.com>]
*) Add configuration option to build on Linux on both big-endian and
little-endian MIPS.
[Ralf Baechle <ralf@uni-koblenz.de>]
*) Add the possibility to create shared libraries on HP-UX.
[Richard Levitte]
Changes between 0.9.6a and 0.9.6b [9 Jul 2001]
*) Change ssleay_rand_bytes (crypto/rand/md_rand.c)
@@ -56,7 +296,7 @@
[Ulf M<>ller, Bodo M<>ller]
*) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
RSA encryption was accidentily removed in s3_srvr.c in OpenSSL 0.9.5
RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
when fixing the server behaviour for backwards-compatible 'client
hello' messages. (Note that the attack is impractical against
SSL 3.0 and TLS 1.0 anyway because length and version checking
@@ -106,7 +346,7 @@
combination of a flag and a thread ID variable.
Otherwise while one thread is in ssleay_rand_bytes (which sets the
flag), *other* threads can enter ssleay_add_bytes without obeying
the CRYPTO_LOCK_RAND lock (and may even illegaly release the lock
the CRYPTO_LOCK_RAND lock (and may even illegally release the lock
that they do not hold after the first thread unsets add_do_not_lock).
[Bodo Moeller]
@@ -748,7 +988,7 @@
default is static libraries only, and the OpenSSL programs
are always statically linked for now, but there are
preparations for dynamic linking in place.
This has been tested on Linux and True64.
This has been tested on Linux and Tru64.
[Richard Levitte]
*) Randomness polling function for Win9x, as described in:

143
Configure
View File

@@ -125,10 +125,10 @@ my %table=(
"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown):::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn",
"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn",
"dist", "cc:-O::(unknown):::::",
# Basic configs that should work on any (32 and less bit) box
@@ -141,21 +141,21 @@ my %table=(
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
# error message.
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### Solaris x86 with Sun C setups
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### 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:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
# but keep the assembler modules.
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
####
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### 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
@@ -189,17 +189,17 @@ my %table=(
#### IRIX 5.x configs
# -mips2 flag is added by ./config when appropriate.
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::",
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:::",
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR::::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### IRIX 6.x configs
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
# './Configure irix-[g]cc' manually.
# -mips4 flag is added by ./config when appropriate.
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}",
"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}",
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# 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}",
"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}",
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### Unified HP-UX ANSI C configs.
# Special notes:
@@ -231,41 +231,44 @@ my %table=(
#
#!#"hpux-parisc-cc","cc:-Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
# Since there is mention of this in shlib/hpux10-cc.sh
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn",
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# More attempts at unified 10.X and 11.X targets for HP C compiler.
#
# Chris Ruemmler <ruemmler@cup.hp.com>
# Kevin Steves <ks@hp.se>
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl",
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn",
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# HPUX 9.X config.
# Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or
# egcs. gcc 2.8.1 is also broken.
"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# If hpux-cc fails (e.g. during "make test"), try the next one; otherwise,
# please report your OS and compiler version to the openssl-bugs@openssl.org
# mailing list.
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# If hpux-gcc fails, try this one:
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# HPUX 9.X on Motorola 68k platforms with gcc
"hpux-m68k-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::BN_LLONG DES_PTR DES_UNROLL:::",
# HPUX 10.X config. Supports threads.
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# If hpux10-cc fails, try this one (if still fails, try deleting BN_LLONG):
"hpux10-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux10-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"hpux10-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux10-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# If hpux10-gcc fails, try this one:
"hpux10-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
"hpux10-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# HPUX 11.X from www.globus.org.
# Only works on PA-RISC 2.0 cpus, and not optimized. Why?
@@ -276,12 +279,39 @@ my %table=(
#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
"MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
# Dec Alpha, OSF/1 - the alpha164-cc is the flags for a 21164A with
# the new compiler
# Dec Alpha, OSF/1 - the alpha164-cc is historical, for the conversion
# from the older DEC C Compiler to the newer compiler. It's now the
# same as the preferred entry, alpha-cc. If you are still using the
# older compiler (you're at 3.x or earlier, or perhaps very early 4.x)
# you should use `alphaold-cc'.
#
# "What's in a name? That which we call a rose
# By any other word would smell as sweet."
#
# - William Shakespeare, "Romeo & Juliet", Act II, scene II.
#
# For OSF/1 3.2b and earlier, and Digital UNIX 3.2c - 3.2g, with the
# vendor compiler, use alphaold-cc.
# For Digital UNIX 4.0 - 4.0e, with the vendor compiler, use alpha-cc.
# For Tru64 UNIX 4.f - current, with the vendor compiler, use alpha-cc.
#
# There's also an alternate target available (which `config' will never
# select) called alpha-cc-rpath. This target builds an RPATH into the
# shared libraries, which is very convenient on Tru64 since binaries
# linked against that shared library will automatically inherit that RPATH,
# and hence know where to look for the openssl libraries, even if they're in
# an odd place.
#
# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:tru64-shared::.so",
"alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
#
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:alpha-osf1-shared::.so",
"alphaold-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared::.so",
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
"alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
"alpha-cc-rpath", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared-rpath::.so",
#
# This probably belongs in a different section.
#
"FreeBSD-alpha","gcc:-DTERMIOS -O -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### Alpha Linux with GNU C and Compaq C setups
@@ -311,15 +341,16 @@ 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",
"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-mips", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
"linux-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
"linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-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-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::SIXTY_FOUR_BIT_LONG::",
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"FreeBSD", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
"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)",
@@ -331,6 +362,9 @@ my %table=(
# QNX 4
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown)::${x86_gcc_des} ${x86_gcc_opts}:",
# QNX 6
"qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown):-lsocket:${x86_gcc_des} ${x86_gcc_opts}:",
# Linux on ARM
"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -347,6 +381,15 @@ my %table=(
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
"unixware-7-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
"unixware-7-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT:-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# OpenUNIX 8
"OpenUNIX-8","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
"OpenUNIX-8-gcc","gcc:-O -DFILIO_H -fomit-frame-pointer::-pthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
"OpenUNIX-8-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
"OpenUNIX-8-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
"OpenUNIX-8-shared","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic",
"OpenUNIX-8-gcc-shared","gcc:-O3 -DFILIO_H -fomit-frame-pointer::-pthread:-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr5-shared:-fPIC",
# IBM's AIX.
"aix-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR:::",
@@ -400,6 +443,12 @@ my %table=(
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown):-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
# You need to compile using the c89.sh wrapper in the tools directory, because the
# IBM compiler does not like the -L switch after any object modules.
#
"OS390-Unix","c89.sh:-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE::(unknown)::THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
# Windows NT, Microsoft Visual C++ 4.0
"VC-NT","cl:::::BN_LLONG RC4_INDEX ${x86_gcc_opts}::::::::::win32",
@@ -433,8 +482,9 @@ my %table=(
"OpenBSD", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-mips","gcc:-O2 -DL_ENDIAN::(unknown):BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
##### MacOS X (a.k.a. Rhapsody) setup
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
"darwin-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
##### Sony NEWS-OS 4.x
"newsos4-gcc","gcc:-O -DB_ENDIAN -DNEWS4::(unknown):-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
@@ -882,7 +932,16 @@ while (<IN>)
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.so.\$(SHLIB_MAJOR) .so/ if ($shared_extension ne "" && $shared_extension !~ /^\.s[ol]$/);
if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/)
{
my $sotmp = $1;
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/
}
elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
{
my $sotmp = $1;
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
}
print OUT $_."\n";
}
close(IN);

131
FAQ
View File

@@ -8,6 +8,7 @@ OpenSSL - Frequently Asked Questions
* How can I contact the OpenSSL developers?
* Where can I get a compiled version of OpenSSL?
* Why aren't tools like 'autoconf' and 'libtool' used?
* What is an 'engine' version?
[LEGAL] Legal questions
@@ -27,13 +28,14 @@ OpenSSL - Frequently Asked Questions
* How can I remove the passphrase on a private key?
* Why can't I use OpenSSL certificates with SSL client authentication?
* Why does my browser give a warning about a mismatched hostname?
* How do I install a CA certificate into a browser?
[BUILD] Questions about building and testing OpenSSL
* Why does the linker complain about undefined symbols?
* Why does the OpenSSL test fail with "bc: command not found"?
* Why does the OpenSSL test fail with "bc: 1 no implemented"?
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
* Why does the OpenSSL compilation fail with "ar: command not found"?
* Why does the OpenSSL compilation fail on Win32 with VC++?
@@ -57,7 +59,7 @@ OpenSSL - Frequently Asked Questions
* Which is the current version of OpenSSL?
The current version is available from <URL: http://www.openssl.org>.
OpenSSL 0.9.6b was released on July 9th, 2001.
OpenSSL 0.9.6c was released on December 21st, 2001.
In addition to the current stable release, you can also access daily
snapshots of the OpenSSL development version at <URL:
@@ -121,6 +123,12 @@ A number of Linux and *BSD distributions include OpenSSL.
autoconf will probably be used in future OpenSSL versions. If it was
less Unix-centric, it might have been used much earlier.
* What is an 'engine' version?
With version 0.9.6 OpenSSL was extended to interface to external crypto
hardware. This was realized in a special release '0.9.6-engine'. With
version 0.9.7 (not yet released) the changes were merged into the main
development line, so that the special release is no longer necessary.
[LEGAL] =======================================================================
@@ -146,7 +154,7 @@ holders claim that you infringe on their rights if you use OpenSSL with
their software on operating systems that don't normally include OpenSSL.
If you develop open source software that uses OpenSSL, you may find it
useful to choose an other license than the GPL, or state explicitely that
useful to choose an other license than the GPL, or state explicitly that
"This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed." If you are using
GPL software developed by others, you may want to ask the copyright holder
@@ -186,7 +194,7 @@ environment variable HOME is set, then the seeding file is $HOME/.rnd.
If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
use file .rnd in the current directory while OpenSSL 0.9.6a uses no
default seeding file at all. OpenSSL 0.9.6b and later will behave
similarly to 0.9.6a, but will use a default of "C:" for HOME on
similarly to 0.9.6a, but will use a default of "C:\" for HOME on
Windows systems if the environment variable has not been set.
If the default seeding file does not exist or is too short, the "PRNG
@@ -297,7 +305,7 @@ there is little point presenting a certificate which the server will
reject.
The solution is to add the relevant CA certificate to your servers "trusted
CA list". How you do this depends on the server sofware in uses. You can
CA list". How you do this depends on the server software in uses. You can
print out the servers list of acceptable CAs using the OpenSSL s_client tool:
openssl s_client -connect www.some.host:443 -prexit
@@ -316,6 +324,26 @@ Browsers expect the server's hostname to match the value in the commonName
(CN) field of the certificate. If it does not then you get a warning.
* How do I install a CA certificate into a browser?
The usual way is to send the DER encoded certificate to the browser as
MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
link. On MSIE certain extensions such as .der or .cacert may also work, or you
can import the certificate using the certificate import wizard.
You can convert a certificate to DER form using the command:
openssl x509 -in ca.pem -outform DER -out ca.der
Occasionally someone suggests using a command such as:
openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
DO NOT DO THIS! This command will give away your CAs private key and
reduces its security to zero: allowing anyone to forge certificates in
whatever name they choose.
[BUILD] =======================================================================
* Why does the linker complain about undefined symbols?
@@ -359,9 +387,9 @@ and compile/install it. GNU bc (see http://www.gnu.org/software/software.html
for download instructions) can be safely used, for example.
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
On some Alpha installations running True64 Unix and Compaq C, the compilation
On some Alpha installations running Tru64 Unix and Compaq C, the compilation
of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual
memory to continue compilation.' As far as the tests have shown, this may be
a compiler bug. What happens is that it eats up a lot of resident memory
@@ -439,10 +467,43 @@ OpenSSL. This is described in the threads(3) manpage.
* I've compiled a program under Windows and it crashes: why?
This is usually because you've missed the comment in INSTALL.W32. You
must link with the multithreaded DLL version of the VC++ runtime library
otherwise the conflict will cause a program to crash: typically on the
first BIO related read or write operation.
This is usually because you've missed the comment in INSTALL.W32.
Your application must link against the same version of the Win32
C-Runtime against which your openssl libraries were linked. The
default version for OpenSSL is /MD - "Multithreaded DLL".
If you are using Microsoft Visual C++'s IDE (Visual Studio), in
many cases, your new project most likely defaulted to "Debug
Singlethreaded" - /ML. This is NOT interchangeable with /MD and your
program will crash, typically on the first BIO related read or write
operation.
For each of the six possible link stage configurations within Win32,
your application must link against the same by which OpenSSL was
built. If you are using MS Visual C++ (Studio) this can be changed
by:
1. Select Settings... from the Project Menu.
2. Select the C/C++ Tab.
3. Select "Code Generation from the "Category" drop down list box
4. Select the Appropriate library (see table below) from the "Use
run-time library" drop down list box. Perform this step for both
your debug and release versions of your application (look at the
top left of the settings panel to change between the two)
Single Threaded /ML - MS VC++ often defaults to
this for the release
version of a new project.
Debug Single Threaded /MLd - MS VC++ often defaults to
this for the debug version
of a new project.
Multithreaded /MT
Debug Multithreaded /MTd
Multithreaded DLL /MD - OpenSSL defaults to this.
Debug Multithreaded DLL /MDd
Note that debug and release libraries are NOT interchangeable. If you
built OpenSSL with /MD your application must use /MD and cannot use /MDd.
* How do I read or write a DER encoded buffer using the ASN1 functions?
@@ -523,44 +584,16 @@ OpenSSL_add_all_algorithms(). See the manual page for more information.
* Why can't the OpenSSH configure script detect OpenSSL?
There is a problem with OpenSSH 1.2.2p1, in that the configure script
can't find the installed OpenSSL libraries. The problem is actually
a small glitch that is easily solved with the following patch to be
applied to the OpenSSH distribution:
----- snip:start -----
--- openssh-1.2.2p1/configure.in.orig Thu Mar 23 18:56:58 2000
+++ openssh-1.2.2p1/configure.in Thu Mar 23 18:55:05 2000
@@ -152,10 +152,10 @@
AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
if test ! -z "$ssldir" ; then
- LIBS="$saved_LIBS -L$ssldir"
+ LIBS="$saved_LIBS -L$ssldir/lib"
CFLAGS="$CFLAGS -I$ssldir/include"
if test "x$need_dash_r" = "x1" ; then
- LIBS="$LIBS -R$ssldir"
+ LIBS="$LIBS -R$ssldir/lib"
fi
fi
LIBS="$LIBS -lcrypto"
--- openssh-1.2.2p1/configure.orig Thu Mar 23 18:55:02 2000
+++ openssh-1.2.2p1/configure Thu Mar 23 18:57:08 2000
@@ -1890,10 +1890,10 @@
echo "configure:1891: checking for OpenSSL/SSLeay directory" >&5
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
if test ! -z "$ssldir" ; then
- LIBS="$saved_LIBS -L$ssldir"
+ LIBS="$saved_LIBS -L$ssldir/lib"
CFLAGS="$CFLAGS -I$ssldir/include"
if test "x$need_dash_r" = "x1" ; then
- LIBS="$LIBS -R$ssldir"
+ LIBS="$LIBS -R$ssldir/lib"
fi
fi
LIBS="$LIBS -lcrypto"
----- snip:end -----
Several reasons for problems with the automatic detection exist.
OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
Sometimes the distribution has installed an older version in the system
locations that is detected instead of a new one installed. The OpenSSL
library might have been compiled for another CPU or another mode (32/64 bits).
Permissions might be wrong.
The general answer is to check the config.log file generated when running
the OpenSSH configure script. It should contain the detailed information
on why the OpenSSL library was not detected or considered incompatible.
* Can I use OpenSSL's SSL library with non-blocking I/O?
@@ -579,7 +612,7 @@ SSL_write() will try to continue any pending handshake.
* Why doesn't my server application receive a client certificate?
Due to the TLS protocol definition, a client will only send a certificate,
if explicitely asked by the server. Use the SSL_VERIFY_PEER flag of the
if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
SSL_CTX_set_verify() function to enable the use of client certificates.

View File

@@ -1,7 +1,7 @@
OpenSSL - Port To The Macintosh
===============================
OpenSSL - Port To The Macintosh OS 9 or Earlier
===============================================
Thanks to Roy Wood <roy@centricsystems.ca> initial support for MacOS (pre
Thanks to Roy Wood <roy@centricsystems.ca> initial support for Mac OS (pre
X) is now provided. "Initial" means that unlike other platforms where you
get an SDK and a "swiss army" openssl application, on Macintosh you only
get one sample application which fetches a page over HTTPS(*) and dumps it
@@ -42,7 +42,7 @@ Installation procedure:
BSD sockets and some other POSIX APIs. The GUSI distribution is
expected to be found in the same directory as openssl source tree,
i.e. in the parent directory to the one where this very file,
namely INSTALL.MacOS. For more informations about GUSI, see
namely INSTALL.MacOS. For more information about GUSI, see
http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
Finally some essential comments from our generous contributor:-)

View File

@@ -256,28 +256,169 @@ do_linux-shared: do_gnu-shared
do_gnu-shared:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-S,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,--whole-archive lib$$i.a \
-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \
done
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
collect2=`gcc -print-prog-name=collect2 2>&1` && \
[ -n "$$collect2" ] && \
my_ld=`$$collect2 --help 2>&1 | grep Usage: | sed 's/^Usage: *\([^ ][^ ]*\).*/\1/'` && \
[ -n "$$my_ld" ] && \
$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
# This assumes that GNU utilities are *not* used
do_alpha-osf1-shared:
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} -shared -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:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} -shared -no_archive -o lib$$i.so \
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -l$$i"; \
done
if ${DETECT_GNU_LD}; then \
$(MAKE) do_gnu-shared; \
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; ${CC} -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 -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} -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
# 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} -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 -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
libs="$$libs -l$$i"; \
done; \
fi
# This assumes that GNU utilities are *not* used
do_hpux-shared:
libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; /usr/ccs/bin/ld +vnocompatwarnings \
-b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-Fl lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -L. -l$$i"; \
done
# This assumes that GNU utilities are *not* used
do_hpux64-shared:
libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( set -x; /usr/ccs/bin/ld -b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+forceload lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
libs="$$libs -L. -l$$i"; \
done
# The following method is said to work on all platforms. Tests will
# determine if that's how it's gong to be used.
# This assumes that for all but GNU systems, GNU utilities are *not* used.
# ALLSYMSFLAGS would be:
# GNU systems: --whole-archive
# Tru64 Unix: -all
# Solaris: -z allextract
# Irix: -all
# HP/UX-32bit: -Fl
# HP/UX-64bit: +forceload
# AIX: -bnogc
# SHAREDFLAGS would be:
# GNU systems: -shared -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
# Tru64 Unix: -shared \
# -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}"
# Solaris: -G -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
# Irix: -shared -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
# HP/UX-32bit: +vnocompatwarnings -b -z +s \
# +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
# HP/UX-64bit: -b -z +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
# AIX: -G -bE:lib$$i.exp -bM:SRE
# SHAREDCMD would be:
# GNU systems: $(CC)
# Tru64 Unix: $(CC)
# Solaris: $(CC)
# Irix: $(CC)
# HP/UX-32bit: /usr/ccs/bin/ld
# HP/UX-64bit: /usr/ccs/bin/ld
# AIX: $(CC)
ALLSYMSFLAG=-bnogc
SHAREDFLAGS=-G -bE:lib$$i.exp -bM:SRE
SHAREDCMD=$(CC)
do_aix-shared:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
( 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
@@ -350,7 +491,7 @@ test: tests
tests: rehash
@(cd test && echo "testing..." && \
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' EXE_EXT='${EXE_EXT}' tests );
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' EXE_EXT='${EXE_EXT}' tests );
@apps/openssl version -a
report:
@@ -384,25 +525,25 @@ tags:
done;
errors:
perl util/mkerr.pl -recurse -write
$(PERL) util/mkerr.pl -recurse -write
stacks:
perl util/mkstack.pl -write
$(PERL) util/mkstack.pl -write
util/libeay.num::
perl util/mkdef.pl crypto update
$(PERL) util/mkdef.pl crypto update
util/ssleay.num::
perl util/mkdef.pl ssl update
$(PERL) util/mkdef.pl ssl update
crypto/objects/obj_dat.h: crypto/objects/obj_mac.h crypto/objects/obj_dat.pl
perl crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt
perl crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
TABLE: Configure
(echo 'Output of `Configure TABLE'"':"; \
perl Configure TABLE) > TABLE
$(PERL) Configure TABLE) > TABLE
update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
@@ -459,8 +600,8 @@ install: all install_docs
do \
if [ -f "$$i" ]; then \
( echo installing $$i; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
cp -f $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
fi \
done; \
( here="`pwd`"; \

13
NEWS
View File

@@ -5,6 +5,19 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
Changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
o Various SSL/TLS library bugfixes.
o BIGNUM library fixes.
o RSA OAEP and random number generation fixes.
o Object identifiers corrected and added.
o Add assembler BN routines for IA64.
o Add support for OS/390 Unix, UnixWare with gcc, OpenUNIX 8,
MIPS Linux; shared library support for Irix, HP-UX.
o Add crypto accelerator support for AEP, Baltimore SureWare,
Broadcom and Cryptographic Appliance's keyserver
[in 0.9.6c-engine release].
Changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
o Security fix: PRNG improvements.

14
README
View File

@@ -1,5 +1,5 @@
OpenSSL 0.9.6b [engine] 9 Jul 2001
OpenSSL 0.9.6c [engine] 21 dec 2001
Copyright (c) 1998-2001 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
@@ -62,7 +62,7 @@
X.509v3 certificates
X509 encoding/decoding into/from binary ASN1 and a PEM
based ascii-binary encoding which supports encryption with a
based ASCII-binary encoding which supports encryption with a
private key. Program to generate RSA and DSA certificate
requests and to generate RSA and DSA certificates.
@@ -97,7 +97,7 @@
locations around the world. _YOU_ are responsible for ensuring that your use
of any algorithms is legal by checking if there are any patents in your
country. The file contains some of the patents that we know about or are
rumoured to exist. This is not a definitive list.
rumored to exist. This is not a definitive list.
RSA Security holds software patents on the RC5 algorithm. If you
intend to use this cipher, you must contact RSA Security for
@@ -107,8 +107,8 @@
only be used with RSA Security's permission.
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
Japan, Netherlands, Spain, Sweden, Switzerland, UK and the USA. They should
be contacted if that algorithm is to be used, their web page is
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They
should be contacted if that algorithm is to be used; their web page is
http://www.ascom.ch/.
INSTALLATION
@@ -119,8 +119,8 @@
INSTALL.VMS.
Read the documentation in the doc/ directory. It is quite rough, but it
lists the functions, you will probably have to look at the code to work out
how to used them. Look at the example programs.
lists the functions; you will probably have to look at the code to work out
how to use them. Look at the example programs.
SUPPORT
-------

View File

@@ -5,7 +5,7 @@
With OpenSSL 0.9.6, a new component has been added to support external
crypto devices, for example accelerator cards. The component is called
ENGINE, and has still a pretty experimental status and almost no
documentation. It's designed to be faily easily extensible by the
documentation. It's designed to be fairly easily extensible by the
calling programs.
There's currently built-in support for the following crypto devices:
@@ -48,7 +48,7 @@
No external crypto device is chosen unless you say so. You have actively
tell the openssl utility commands to use it through a new command line
switch called "-engine". And if you want to use the ENGINE library to
do something similar, you must also explicitely choose an external crypto
do something similar, you must also explicitly choose an external crypto
device, or the built-in crypto routines will be used, just as in the
default OpenSSL distribution.
@@ -56,7 +56,7 @@
PROBLEMS
========
It seems like the ENGINE part doesn't work too well with Cryptoswift on
It seems like the ENGINE part doesn't work too well with CryptoSwift on
Win32. A quick test done right before the release showed that trying
"openssl speed -engine cswift" generated errors. If the DSO gets enabled,
an attempt is made to write at memory address 0x00000002.

29
STATUS
View File

@@ -1,9 +1,11 @@
OpenSSL STATUS Last modified at
______________ $Date: 2001/04/05 17:48:02 $
______________ $Date: 2001/11/15 08:15:00 $
DEVELOPMENT STATE
o OpenSSL 0.9.7: Under development...
o OpenSSL 0.9.6b: Released on July 9th, 2001
o OpenSSL 0.9.6a: Released on April 5th, 2001
o OpenSSL 0.9.6: Released on September 24th, 2000
o OpenSSL 0.9.5a: Released on April 1st, 2000
@@ -18,6 +20,8 @@
AVAILABLE PATCHES
o
IN PROGRESS
o Steve is currently working on (in no particular order):
@@ -31,12 +35,13 @@
o Geoff and Richard are currently working on:
ENGINE (the new code that gives hardware support among others).
o Richard is currently working on:
UI (User Interface)
UTIL (a new set of library functions to support some higher level
functionality that is currently missing).
Shared library support for VMS.
OCSP
Kerberos 5 authentication
Constification
OCSP
NEEDS PATCH
@@ -49,13 +54,9 @@
o Whenever strncpy is used, make sure the resulting string is NULL-terminated
or an error is reported
OPEN ISSUES
o "OpenSSL STATUS" is never up-to-date.
o crypto/ex_data.c is not really thread-safe and so must be used
with care (e.g., extra locking where necessary, or don't call
CRYPTO_get_ex_new_index once multiple threads exist).
The current API is not suitable for everything that it pretends
to offer.
OPEN ISSUES
o The Makefile hierarchy and build mechanism is still not a round thing:
@@ -99,4 +100,14 @@
WISHES
o
o SRP in TLS.
[wished by:
Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
Tom Holroyd <tomh@po.crl.go.jp>]
See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
as well as http://www-cs-students.stanford.edu/~tjw/srp/.
Tom Holroyd tells us there is a SRP patch for OpenSSH at
http://members.tripod.com/professor_tom/archives/, that could
be useful.

487
TABLE
View File

@@ -1,4 +1,3 @@
Output of `Configure TABLE':
*** BC-16
$cc = bcc
@@ -136,7 +135,7 @@ $ranlib =
$cc = gcc
$cflags = -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall
$unistd =
$thread_cflag = (unknown)
$thread_cflag = -pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE
$lflags =
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$bn_obj = asm/bn86-elf.o asm/co86-elf.o
@@ -264,6 +263,28 @@ $shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** OS390-Unix
$cc = c89.sh
$cflags = -O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE
$unistd =
$thread_cflag = (unknown)
$lflags =
$bn_ops = THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR
$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_extension =
$ranlib =
*** OpenBSD
$cc = gcc
$cflags = -DTERMIOS -O3 -fomit-frame-pointer
@@ -352,6 +373,138 @@ $shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** OpenUNIX-8
$cc = cc
$cflags = -O -DFILIO_H -Kalloca
$unistd =
$thread_cflag = -Kthread
$lflags = -lsocket -lnsl
$bn_ops = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
$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_extension =
$ranlib =
*** OpenUNIX-8-gcc
$cc = gcc
$cflags = -O -DFILIO_H -fomit-frame-pointer
$unistd =
$thread_cflag = -pthread
$lflags = -lsocket -lnsl
$bn_ops = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
$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_extension =
$ranlib =
*** OpenUNIX-8-gcc-shared
$cc = gcc
$cflags = -O3 -DFILIO_H -fomit-frame-pointer
$unistd =
$thread_cflag = -pthread
$lflags = -lsocket -lnsl
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$bn_obj = asm/bn86-elf.o asm/co86-elf.o
$des_obj = asm/dx86-elf.o asm/yx86-elf.o
$bf_obj = asm/bx86-elf.o
$md5_obj = asm/mx86-elf.o
$sha1_obj = asm/sx86-elf.o
$cast_obj = asm/cx86-elf.o
$rc4_obj = asm/rx86-elf.o
$rmd160_obj = asm/rm86-elf.o
$rc5_obj = asm/r586-elf.o
$dso_scheme = dlfcn
$shared_target= svr5-shared
$shared_cflag = -fPIC
$shared_extension =
$ranlib =
*** OpenUNIX-8-pentium
$cc = cc
$cflags = -O -DFILIO_H -Kalloca -Kpentium
$unistd =
$thread_cflag = -Kthread
$lflags = -lsocket -lnsl
$bn_ops = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
$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_extension =
$ranlib =
*** OpenUNIX-8-pentium_pro
$cc = cc
$cflags = -O -DFILIO_H -Kalloca -Kpentium_pro
$unistd =
$thread_cflag = -Kthread
$lflags = -lsocket -lnsl
$bn_ops = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
$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_extension =
$ranlib =
*** OpenUNIX-8-shared
$cc = cc
$cflags = -O -DFILIO_H -Kalloca
$unistd =
$thread_cflag = -Kthread
$lflags = -lsocket -lnsl
$bn_ops = MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
$bn_obj =
$des_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= svr5-shared
$shared_cflag = -Kpic
$shared_extension =
$ranlib =
*** ReliantUNIX
$cc = cc
$cflags = -KPIC -g -DSNI -DTERMIOS -DB_ENDIAN
@@ -640,9 +793,9 @@ $ranlib =
*** alpha-cc
$cc = cc
$cflags = -std1 -tune host -O4 -readonly_strings
$cflags = -std1 -tune host -fast -readonly_strings
$unistd =
$thread_cflag = (unknown)
$thread_cflag = -pthread
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
$bn_obj =
@@ -660,6 +813,28 @@ $shared_cflag =
$shared_extension = .so
$ranlib =
*** alpha-cc-rpath
$cc = cc
$cflags = -std1 -tune host -fast -readonly_strings
$unistd =
$thread_cflag = -pthread
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
$bn_obj =
$des_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= tru64-shared-rpath
$shared_cflag =
$shared_extension = .so
$ranlib =
*** alpha-gcc
$cc = gcc
$cflags = -O3
@@ -677,7 +852,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= tru64-shared
$shared_target= alpha-osf1-shared
$shared_cflag =
$shared_extension = .so
$ranlib =
@@ -686,6 +861,28 @@ $ranlib =
$cc = cc
$cflags = -std1 -tune host -fast -readonly_strings
$unistd =
$thread_cflag = -pthread
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
$bn_obj =
$des_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= tru64-shared
$shared_cflag =
$shared_extension = .so
$ranlib =
*** alphaold-cc
$cc = cc
$cflags = -std1 -tune host -O4 -readonly_strings
$unistd =
$thread_cflag = (unknown)
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
@@ -699,7 +896,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= tru64-shared
$shared_target= alpha-osf1-shared
$shared_cflag =
$shared_extension = .so
$ranlib =
@@ -814,6 +1011,28 @@ $shared_cflag =
$shared_extension =
$ranlib =
*** darwin-ppc-cc
$cc = cc
$cflags = -O3 -DB_ENDIAN
$unistd =
$thread_cflag = (unknown)
$lflags =
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
$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_extension =
$ranlib =
*** debug
$cc = gcc
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror
@@ -904,7 +1123,7 @@ $ranlib =
*** debug-bodo
$cc = gcc
$cflags = -DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall
$cflags = -DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$lflags =
@@ -926,7 +1145,7 @@ $ranlib =
*** debug-levitte-linux-elf
$cc = gcc
$cflags = -DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe
$cflags = -DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe
$unistd =
$thread_cflag = -D_REENTRANT
$lflags = -ldl
@@ -1051,7 +1270,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_target= solaris-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
@@ -1095,7 +1314,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_target= solaris-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
@@ -1124,7 +1343,7 @@ $ranlib =
*** debug-ulf
$cc = gcc
$cflags = -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe
$cflags = -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -Wall -Werror -Wshadow -pipe
$unistd =
$thread_cflag = -D_REENTRANT
$lflags =
@@ -1271,9 +1490,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-brokengcc
@@ -1293,9 +1512,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = -fPIC
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-cc
@@ -1315,9 +1534,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-gcc
@@ -1337,6 +1556,28 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target= hpux-shared
$shared_cflag = -fPIC
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-m68k-gcc
$cc = gcc
$cflags = -DB_ENDIAN -DBN_DIV2W -O3
$unistd =
$thread_cflag = (unknown)
$lflags =
$bn_ops = BN_LLONG DES_PTR DES_UNROLL
$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_extension =
@@ -1359,9 +1600,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-parisc-cc-o4
@@ -1381,9 +1622,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-parisc-gcc
@@ -1403,9 +1644,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = -fPIC
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-parisc1_1-cc
@@ -1425,9 +1666,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux-parisc2-cc
@@ -1447,9 +1688,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux10-brokencc
@@ -1469,9 +1710,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux10-brokengcc
@@ -1491,9 +1732,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = -fPIC
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux10-cc
@@ -1513,9 +1754,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux10-gcc
@@ -1535,9 +1776,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dl
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux-shared
$shared_cflag = -fPIC
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux64-parisc-cc
@@ -1557,9 +1798,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux64-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** hpux64-parisc2-cc
@@ -1579,9 +1820,9 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target=
$shared_cflag =
$shared_extension =
$shared_target= hpux64-shared
$shared_cflag = +Z
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** irix-cc
@@ -1600,10 +1841,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$dso_scheme = dlfcn
$shared_target= irix-shared
$shared_cflag =
$shared_extension =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** irix-gcc
@@ -1622,10 +1863,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$dso_scheme = dlfcn
$shared_target= irix-shared
$shared_cflag =
$shared_extension =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** irix-mips3-cc
@@ -1644,10 +1885,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$dso_scheme = dlfcn
$shared_target= irix-shared
$shared_cflag =
$shared_extension =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** irix-mips3-gcc
@@ -1666,10 +1907,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$dso_scheme = dlfcn
$shared_target= irix-shared
$shared_cflag =
$shared_extension =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** irix64-mips4-cc
@@ -1688,10 +1929,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$dso_scheme = dlfcn
$shared_target= irix-shared
$shared_cflag =
$shared_extension =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** irix64-mips4-gcc
@@ -1710,10 +1951,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$dso_scheme = dlfcn
$shared_target= irix-shared
$shared_cflag =
$shared_extension =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** linux-alpha+bwx-ccc
@@ -1874,10 +2115,10 @@ $ranlib =
$cc = gcc
$cflags = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
$unistd =
$thread_cflag = (unknown)
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG
$bn_obj =
$thread_cflag = -D_REENTRANT
$lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR
$bn_obj = asm/ia64.o
$des_obj =
$bf_obj =
$md5_obj =
@@ -1886,10 +2127,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$shared_cflag =
$shared_extension =
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** linux-m68k
@@ -1916,6 +2157,28 @@ $ranlib =
*** linux-mips
$cc = gcc
$cflags = -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
$unistd =
$thread_cflag = (unknown)
$lflags =
$bn_ops = BN_LLONG
$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_extension =
$ranlib =
*** linux-mipsel
$cc = gcc
$cflags = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
$unistd =
$thread_cflag = (unknown)
@@ -1941,8 +2204,8 @@ $cc = gcc
$cflags = -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$lflags =
$bn_ops = BN_LLONG
$lflags = -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL
$bn_obj =
$des_obj =
$bf_obj =
@@ -1952,10 +2215,10 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$shared_cflag =
$shared_extension =
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** linux-s390
@@ -2178,6 +2441,28 @@ $shared_cflag =
$shared_extension =
$ranlib =
*** qnx6
$cc = cc
$cflags = -DL_ENDIAN -DTERMIOS
$unistd =
$thread_cflag = (unknown)
$lflags = -lsocket
$bn_ops = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$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_extension =
$ranlib =
*** rhapsody-ppc-cc
$cc = cc
$cflags = -O3 -DB_ENDIAN
@@ -2349,7 +2634,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_target= solaris-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
@@ -2393,7 +2678,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_target= solaris-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
@@ -2437,7 +2722,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_target= solaris-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
@@ -2459,7 +2744,7 @@ $rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_target= solaris-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
@@ -2503,7 +2788,7 @@ $rc4_obj = asm/rx86-sol.o
$rmd160_obj = asm/rm86-sol.o
$rc5_obj = asm/r586-sol.o
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_target= solaris-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
@@ -2728,6 +3013,28 @@ $shared_cflag =
$shared_extension =
$ranlib =
*** unixware-7-gcc
$cc = gcc
$cflags = -DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -m486 -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$lflags = -lsocket -lnsl
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$bn_obj =
$des_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= gnu-shared
$shared_cflag = -fPIC
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
*** unixware-7-pentium
$cc = cc
$cflags = -O -DFILIO_H -Kalloca -Kpentium

View File

@@ -360,15 +360,14 @@ dsaparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h
dsaparam.o: ../include/openssl/des.h ../include/openssl/dh.h
dsaparam.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
dsaparam.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
dsaparam.o: ../include/openssl/engine.h ../include/openssl/err.h
dsaparam.o: ../include/openssl/evp.h ../include/openssl/idea.h
dsaparam.o: ../include/openssl/lhash.h ../include/openssl/md2.h
dsaparam.o: ../include/openssl/md4.h ../include/openssl/md5.h
dsaparam.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
dsaparam.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
dsaparam.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
dsaparam.o: ../include/openssl/rand.h ../include/openssl/rc2.h
dsaparam.o: ../include/openssl/err.h ../include/openssl/evp.h
dsaparam.o: ../include/openssl/idea.h ../include/openssl/lhash.h
dsaparam.o: ../include/openssl/md2.h ../include/openssl/md4.h
dsaparam.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
dsaparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
dsaparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
dsaparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h
dsaparam.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
dsaparam.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
dsaparam.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h

View File

@@ -69,7 +69,6 @@
#include <openssl/dsa.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG dsaparam_main
@@ -91,12 +90,11 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
DSA *dsa=NULL;
int i,badops=0,text=0;
BIO *in=NULL,*out=NULL;
int informat,outformat,noout=0,C=0,ret=1;
char *infile,*outfile,*prog,*inrand=NULL,*engine=NULL;
char *infile,*outfile,*prog,*inrand=NULL;
int numbits= -1,num,genkey=0;
int need_rand=0;

View File

@@ -1133,6 +1133,7 @@ $!
$! Save directory information
$!
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
$ __HERE = F$EDIT(__HERE,"UPCASE")
$ __TOP = __HERE - "APPS]"
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
$!

View File

@@ -392,8 +392,7 @@ bad:
BIO_printf(bio_err," the random number generator\n");
BIO_printf(bio_err," -newkey rsa:bits generate a new RSA key of 'bits' in size\n");
BIO_printf(bio_err," -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n");
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2)\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," -new new request.\n");
BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n");

View File

@@ -928,5 +928,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
BIO_printf(bio,"---\n");
if (peer != NULL)
X509_free(peer);
/* flush, or debugging output gets mixed with http response */
BIO_flush(bio);
}

67
config
View File

@@ -68,6 +68,11 @@ if [ "x$XREL" != "x" ]; then
4.2)
echo "whatever-whatever-unixware1"; exit 0
;;
OpenUNIX)
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
fi
;;
5)
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
echo "${MACHINE}-sco-unixware7"; exit 0
@@ -195,15 +200,33 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "${MACHINE}-whatever-openbsd"; exit 0
;;
OpenUNIX:*)
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
;;
OSF1:*:*:*alpha*)
echo "${MACHINE}-dec-osf"; exit 0
OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
case "$OSFMAJOR" in
4|5)
echo "${MACHINE}-dec-tru64"; exit 0
;;
1|2|3)
echo "${MACHINE}-dec-osf"; exit 0
;;
*)
echo "${MACHINE}-dec-osf"; exit 0
;;
esac
;;
QNX:*)
case "$VERSION" in
case "$RELEASE" in
4*)
echo "${MACHINE}-whatever-qnx4"
;;
6*)
echo "${MACHINE}-whatever-qnx6"
;;
*)
echo "${MACHINE}-whatever-qnx"
;;
@@ -219,6 +242,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "ppc-apple-rhapsody"; exit 0
;;
Darwin:*)
echo "ppc-apple-darwin"; exit 0
;;
SunOS:5.*)
echo "${MACHINE}-whatever-solaris2"; exit 0
;;
@@ -271,6 +298,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "mips-sony-newsos4"; exit 0;
;;
CYGWIN*)
echo "${MACHINE}-whatever-cygwin32"; exit 0
;;
esac
#
@@ -435,11 +466,27 @@ case "$GUESSOS" in
esac
fi
;;
mips-*-linux?) OUT="linux-mips" ;;
mips-*-linux?)
cat >dummy.c <<EOF
#include <stdio.h> /* for printf() prototype */
int main (argc, argv) int argc; char *argv[]; {
#ifdef __MIPSEB__
printf ("linux-%s\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("linux-%sel\n", argv[1]);
#endif
return 0;
}
EOF
${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
rm dummy dummy.c
;;
ppc-*-linux2) OUT="linux-ppc" ;;
m68k-*-linux*) OUT="linux-m68k" ;;
ia64-*-linux?) OUT="linux-ia64" ;;
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
sparc64-*-linux2)
#Before we can uncomment following lines we have to wait at least
#till 64-bit glibc for SPARC is operational:-(
@@ -485,7 +532,15 @@ case "$GUESSOS" in
pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
*-*-openbsd) OUT="OpenBSD" ;;
*86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
*-*-osf) OUT="alpha-cc" ;;
*-*-osf) OUT="alphaold-cc" ;;
*-*-tru64) OUT="alpha-cc" ;;
*-*-OpenUNIX*)
if [ "$CC" = "gcc" ]; then
OUT="OpenUNIX-8-gcc"
else
OUT="OpenUNIX-8"
fi
;;
*-*-unixware7) OUT="unixware-7" ;;
*-*-UnixWare7) OUT="unixware-7" ;;
*-*-Unixware7) OUT="unixware-7" ;;
@@ -505,6 +560,8 @@ case "$GUESSOS" in
# *-aix) OUT="aix-$CC" ;;
# *-dgux) OUT="dgux" ;;
mips-sony-newsos4) OUT="newsos4-gcc" ;;
*-*-cygwin32) OUT="CygWin32"
options="$options no-threads no-asm" ;;
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
esac
@@ -549,7 +606,7 @@ case "$GUESSOS" in
i386-*) options="$options 386" ;;
esac
for i in bf cast des dh dsa hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
do
if [ ! -d crypto/$i ]
then

View File

@@ -105,9 +105,9 @@ int ASN1_STRING_set_default_mask_asc(char *p)
mask = strtoul(p + 5, &end, 0);
if(*end) return 0;
} else if(!strcmp(p, "nombstr"))
mask = ~(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING);
mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING));
else if(!strcmp(p, "pkix"))
mask = ~B_ASN1_T61STRING;
mask = ~((unsigned long)B_ASN1_T61STRING);
else if(!strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING;
else if(!strcmp(p, "default"))
mask = 0xFFFFFFFFL;

View File

@@ -834,8 +834,6 @@ void ASN1_HEADER_free(ASN1_HEADER *a);
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
void ERR_load_ASN1_strings(void);
/* Not used that much at this point, except for the first two */
ASN1_METHOD *X509_asn1_meth(void);
ASN1_METHOD *RSAPrivateKey_asn1_meth(void);
@@ -877,6 +875,7 @@ void ASN1_STRING_TABLE_cleanup(void);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_ASN1_strings(void);
/* Error codes for the ASN1 functions. */
@@ -1148,4 +1147,3 @@ void ASN1_STRING_TABLE_cleanup(void);
}
#endif
#endif

View File

@@ -569,7 +569,7 @@ pow10(int exp)
}
static long
round(LDOUBLE value)
roundv(LDOUBLE value)
{
long intpart;
intpart = (long) value;
@@ -621,7 +621,7 @@ fmtfp(
/* we "cheat" by converting the fractional part to integer by
multiplying by a factor of 10 */
fracpart = round((pow10(max)) * (ufvalue - intpart));
fracpart = roundv((pow10(max)) * (ufvalue - intpart));
if (fracpart >= pow10(max)) {
intpart++;

View File

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

View File

@@ -431,7 +431,7 @@ int BIO_read_filename(BIO *b,const char *name);
#define BIO_set_ssl_renegotiate_bytes(b,num) \
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
#define BIO_get_num_renegotiates(b) \
BIO_ctrl(b,BIO_C_SET_SSL_NUM_RENEGOTIATES,0,NULL);
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
#define BIO_set_ssl_renegotiate_timeout(b,seconds) \
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
@@ -588,8 +588,6 @@ int BIO_sock_init(void );
void BIO_sock_cleanup(void);
int BIO_set_tcp_ndelay(int sock,int turn_on);
void ERR_load_BIO_strings(void );
BIO *BIO_new_socket(int sock, int close_flag);
BIO *BIO_new_fd(int fd, int close_flag);
BIO *BIO_new_connect(char *host_port);
@@ -615,6 +613,7 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_BIO_strings(void);
/* Error codes for the BIO functions. */
@@ -684,4 +683,3 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
}
#endif
#endif

View File

@@ -474,7 +474,8 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
break;
case BIO_C_GET_WRITE_BUF_SIZE:
num = (long) b->size;
ret = (long) b->size;
break;
case BIO_C_MAKE_BIO_PAIR:
{

View File

@@ -124,6 +124,8 @@ asm/sparcv8plus-gcc27.o: asm/sparcv8plus.S
$(CC) $(ASFLAGS) -E asm/sparcv8plus.S | \
/usr/ccs/bin/as -xarch=v8plus - -o asm/sparcv8plus-gcc27.o
asm/ia64.o: asm/ia64.S
files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO

1498
crypto/bn/asm/ia64.S Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -90,7 +90,9 @@ extern "C" {
* be on. Again this in only really a problem on machines
* using "long long's", are 32bit, and are not using my assembler code. */
#if defined(MSDOS) || defined(WINDOWS) || defined(WIN32) || defined(linux)
#define BN_DIV2W
# ifndef BN_DIV2W
# define BN_DIV2W
# endif
#endif
/* assuming long is 64bit - this is the DEC Alpha
@@ -329,6 +331,7 @@ void BN_CTX_end(BN_CTX *ctx);
int BN_rand(BIGNUM *rnd, int bits, int top,int bottom);
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_num_bits(const BIGNUM *a);
int BN_num_bits_word(BN_ULONG);
BIGNUM *BN_new(void);
@@ -403,7 +406,6 @@ int BN_is_prime(const BIGNUM *p,int nchecks,
int BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
int do_trial_division);
void ERR_load_BN_strings(void );
BN_MONT_CTX *BN_MONT_CTX_new(void );
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
@@ -474,6 +476,7 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_BN_strings(void);
/* Error codes for the BN functions. */
@@ -517,4 +520,3 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom);
}
#endif
#endif

View File

@@ -128,7 +128,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
#if !defined(NO_ASM) && !defined(NO_INLINE_ASM) && !defined(PEDANTIC) && !defined(BN_DIV3W)
# if defined(__GNUC__) && __GNUC__>=2
# if defined(__i386)
# if defined(__i386) || defined (__i386__)
/*
* There were two reasons for implementing this template:
* - GNU C generates a call to a function (__udivdi3 to be exact)

View File

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

View File

@@ -55,6 +55,59 @@
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
/* ====================================================================
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include <time.h>
@@ -172,8 +225,9 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
#endif
/* random number r: 0 <= r < range */
int BN_rand_range(BIGNUM *r, BIGNUM *range)
static int bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
{
int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand;
int n;
if (range->neg || BN_is_zero(range))
@@ -184,26 +238,19 @@ int BN_rand_range(BIGNUM *r, BIGNUM *range)
n = BN_num_bits(range); /* n > 0 */
/* BN_is_bit_set(range, n - 1) always holds */
if (n == 1)
{
if (!BN_zero(r)) return 0;
}
else if (BN_is_bit_set(range, n - 2))
else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3))
{
do
{
/* range = 11..._2, so each iteration succeeds with probability >= .75 */
if (!BN_rand(r, n, -1, 0)) return 0;
}
while (BN_cmp(r, range) >= 0);
}
else
{
/* range = 10..._2,
/* range = 100..._2,
* so 3*range (= 11..._2) is exactly one bit longer than range */
do
{
if (!BN_rand(r, n + 1, -1, 0)) return 0;
if (!bn_rand(r, n + 1, -1, 0)) return 0;
/* If r < 3*range, use r := r MOD range
* (which is either r, r - range, or r - 2*range).
* Otherwise, iterate once more.
@@ -218,6 +265,26 @@ int BN_rand_range(BIGNUM *r, BIGNUM *range)
}
while (BN_cmp(r, range) >= 0);
}
else
{
do
{
/* range = 11..._2 or range = 101..._2 */
if (!bn_rand(r, n, -1, 0)) return 0;
}
while (BN_cmp(r, range) >= 0);
}
return 1;
}
int BN_rand_range(BIGNUM *r, BIGNUM *range)
{
return bn_rand_range(0, r, range);
}
int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range)
{
return bn_rand_range(1, r, range);
}

View File

@@ -245,7 +245,7 @@ printf(" bn_sqr_recursive %d * %d\n",n2,n2);
if (!zero)
bn_sqr_recursive(&(t[n2]),t,n,p);
else
memset(&(t[n2]),0,n*sizeof(BN_ULONG));
memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
bn_sqr_recursive(r,a,n,p);
bn_sqr_recursive(&(r[n2]),&(a[n]),n,p);

View File

@@ -75,12 +75,11 @@ void BUF_MEM_free(BUF_MEM *a);
int BUF_MEM_grow(BUF_MEM *str, int len);
char * BUF_strdup(const char *str);
void ERR_load_BUF_strings(void );
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_BUF_strings(void);
/* Error codes for the BUF functions. */
@@ -95,4 +94,3 @@ void ERR_load_BUF_strings(void );
}
#endif
#endif

View File

@@ -22,10 +22,10 @@ TEST=
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= comp_lib.c \
LIBSRC= comp_lib.c comp_err.c \
c_rle.c c_zlib.c
LIBOBJ= comp_lib.o \
LIBOBJ= comp_lib.o comp_err.o \
c_rle.o c_zlib.o
SRC= $(LIBSRC)
@@ -94,6 +94,11 @@ c_zlib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
c_zlib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
c_zlib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
c_zlib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
comp_err.o: ../../include/openssl/bio.h ../../include/openssl/comp.h
comp_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
comp_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
comp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
comp_err.o: ../../include/openssl/symhacks.h
comp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
comp_lib.o: ../../include/openssl/bn.h ../../include/openssl/comp.h
comp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h

View File

@@ -47,6 +47,7 @@ COMP_METHOD *COMP_zlib(void );
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_COMP_strings(void);
/* Error codes for the COMP functions. */
@@ -58,4 +59,3 @@ COMP_METHOD *COMP_zlib(void );
}
#endif
#endif

View File

@@ -108,7 +108,6 @@ long CONF_get_number(LHASH *conf,char *group,char *name);
void CONF_free(LHASH *conf);
int CONF_dump_fp(LHASH *conf, FILE *out);
int CONF_dump_bio(LHASH *conf, BIO *out);
void ERR_load_CONF_strings(void );
/* New conf code. The semantics are different from the functions above.
If that wasn't the case, the above functions would have been replaced */
@@ -145,6 +144,7 @@ int NCONF_dump_bio(CONF *conf, BIO *out);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_CONF_strings(void);
/* Error codes for the CONF functions. */
@@ -176,4 +176,3 @@ int NCONF_dump_bio(CONF *conf, BIO *out);
}
#endif
#endif

View File

@@ -90,6 +90,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
"ssl_sess_cert",
"ssl",
"rand",
"rand2",
"debug_malloc",
"BIO",
"gethostbyname",
@@ -101,7 +102,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
"dso",
"dynlock",
"engine",
#if CRYPTO_NUM_LOCKS != 29
#if CRYPTO_NUM_LOCKS != 30
# error "Inconsistency between crypto.h and cryptlib.c"
#endif
};
@@ -228,7 +229,10 @@ void CRYPTO_destroy_dynlockid(int i)
CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
return;
{
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
return;
}
pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
if (pointer != NULL)
{

View File

@@ -207,7 +207,8 @@ $ LIB_DH = "dh_gen,dh_key,dh_lib,dh_check,dh_err"
$ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
"dso_openssl,dso_win32,dso_vms"
$ LIB_ENGINE = "engine_err,engine_lib,engine_list,engine_openssl,"+ -
"hw_atalla,hw_cswift,hw_ncipher"
"hw_atalla,hw_cswift,hw_ncipher,hw_aep,hw_sureware,"+ -
"hw_ubsec"
$ LIB_BUFFER = "buffer,buf_err"
$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
"bss_mem,bss_null,bss_fd,"+ -
@@ -1462,6 +1463,7 @@ $!
$! Save directory information
$!
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
$ __HERE = F$EDIT(__HERE,"UPCASE")
$ __TOP = __HERE - "CRYPTO]"
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
$!

View File

@@ -112,18 +112,19 @@ extern "C" {
#define CRYPTO_LOCK_SSL_SESS_CERT 15
#define CRYPTO_LOCK_SSL 16
#define CRYPTO_LOCK_RAND 17
#define CRYPTO_LOCK_MALLOC 18
#define CRYPTO_LOCK_BIO 19
#define CRYPTO_LOCK_GETHOSTBYNAME 20
#define CRYPTO_LOCK_GETSERVBYNAME 21
#define CRYPTO_LOCK_READDIR 22
#define CRYPTO_LOCK_RSA_BLINDING 23
#define CRYPTO_LOCK_DH 24
#define CRYPTO_LOCK_MALLOC2 25
#define CRYPTO_LOCK_DSO 26
#define CRYPTO_LOCK_DYNLOCK 27
#define CRYPTO_LOCK_ENGINE 28
#define CRYPTO_NUM_LOCKS 29
#define CRYPTO_LOCK_RAND2 18
#define CRYPTO_LOCK_MALLOC 19
#define CRYPTO_LOCK_BIO 20
#define CRYPTO_LOCK_GETHOSTBYNAME 21
#define CRYPTO_LOCK_GETSERVBYNAME 22
#define CRYPTO_LOCK_READDIR 23
#define CRYPTO_LOCK_RSA_BLINDING 24
#define CRYPTO_LOCK_DH 25
#define CRYPTO_LOCK_MALLOC2 26
#define CRYPTO_LOCK_DSO 27
#define CRYPTO_LOCK_DYNLOCK 28
#define CRYPTO_LOCK_ENGINE 29
#define CRYPTO_NUM_LOCKS 30
#define CRYPTO_LOCK 1
#define CRYPTO_UNLOCK 2
@@ -351,6 +352,9 @@ int CRYPTO_push_info_(const char *info, const char *file, int line);
int CRYPTO_pop_info(void);
int CRYPTO_remove_all_info(void);
/* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro;
* used as default in CRYPTO_MDEBUG compilations): */
/* The last argument has the following significance:
*
* 0: called before the actual memory allocation has taken place
@@ -359,18 +363,18 @@ int CRYPTO_remove_all_info(void);
void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p);
void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p);
void CRYPTO_dbg_free(void *addr,int before_p);
/* Tell the debugging code about options. By default, the following values
* apply:
*
* 0: Clear all options.
* 1: Set the "Show Time" option.
* 2: Set the "Show Thread Number" option.
* 3: 1 + 2
* 0: Clear all options.
* V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option.
* V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option.
* V_CRYPTO_MDEBUG_ALL (3): 1 + 2
*/
void CRYPTO_dbg_set_options(long bits);
long CRYPTO_dbg_get_options(void);
#ifndef NO_FP_API
void CRYPTO_mem_leaks_fp(FILE *);
#endif
@@ -378,12 +382,11 @@ void CRYPTO_mem_leaks(struct bio_st *bio);
/* unsigned long order, char *file, int line, int num_bytes, char *addr */
void CRYPTO_mem_leaks_cb(void (*cb)(unsigned long, const char *, int, int, void *));
void ERR_load_CRYPTO_strings(void);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_CRYPTO_strings(void);
/* Error codes for the CRYPTO functions. */
@@ -400,4 +403,3 @@ void ERR_load_CRYPTO_strings(void);
}
#endif
#endif

View File

@@ -186,12 +186,12 @@ int DHparams_print(BIO *bp, DH *x);
#else
int DHparams_print(char *bp, DH *x);
#endif
void ERR_load_DH_strings(void );
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_DH_strings(void);
/* Error codes for the DH functions. */
@@ -210,4 +210,3 @@ void ERR_load_DH_strings(void );
}
#endif
#endif

View File

@@ -100,6 +100,8 @@ DH_METHOD *DH_OpenSSL(void)
static int generate_key(DH *dh)
{
int ok=0;
int generate_new_key=0;
unsigned l;
BN_CTX ctx;
BN_MONT_CTX *mont;
BIGNUM *pub_key=NULL,*priv_key=NULL;
@@ -110,9 +112,7 @@ static int generate_key(DH *dh)
{
priv_key=BN_new();
if (priv_key == NULL) goto err;
do
if (!BN_rand_range(priv_key, dh->p)) goto err;
while (BN_is_zero(priv_key));
generate_new_key=1;
}
else
priv_key=dh->priv_key;
@@ -133,6 +133,11 @@ static int generate_key(DH *dh)
}
mont=(BN_MONT_CTX *)dh->method_mont_p;
if (generate_new_key)
{
l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
if (!BN_rand(priv_key, l, 0, 0)) goto err;
}
if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, pub_key, dh->g,
priv_key,dh->p,&ctx,mont))
goto err;

View File

@@ -64,7 +64,7 @@
const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
static DH_METHOD *default_DH_method;
static DH_METHOD *default_DH_method = NULL;
static int dh_meth_num = 0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;

View File

@@ -190,8 +190,6 @@ int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
int DSA_set_ex_data(DSA *d, int idx, void *arg);
void *DSA_get_ex_data(DSA *d, int idx);
void ERR_load_DSA_strings(void );
DSA * d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length);
DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length);
@@ -228,6 +226,7 @@ DH *DSA_dup_DH(DSA *r);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_DSA_strings(void);
/* Error codes for the DSA functions. */
@@ -254,4 +253,3 @@ DH *DSA_dup_DH(DSA *r);
}
#endif
#endif

View File

@@ -67,7 +67,7 @@
const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
static DSA_METHOD *default_DSA_method;
static DSA_METHOD *default_DSA_method = NULL;
static int dsa_meth_num = 0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;

View File

@@ -194,12 +194,11 @@ DSO_METHOD *DSO_METHOD_win32(void);
/* If VMS is defined, use shared images. If not, return NULL. */
DSO_METHOD *DSO_METHOD_vms(void);
void ERR_load_DSO_strings(void);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_DSO_strings(void);
/* Error codes for the DSO functions. */
@@ -247,4 +246,3 @@ void ERR_load_DSO_strings(void);
}
#endif
#endif

View File

@@ -259,8 +259,12 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym)
{
DSO_VMS_INTERNAL *ptr;
int status;
#if 0
int flags = (1<<4); /* LIB$M_FIS_MIXEDCASE, but this symbol isn't
defined in VMS older than 7.0 or so */
#else
int flags = 0;
#endif
struct dsc$descriptor_s symname_dsc;
*sym = NULL;

View File

@@ -23,9 +23,11 @@ APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= engine_err.c engine_lib.c engine_list.c engine_openssl.c \
hw_atalla.c hw_cswift.c hw_ncipher.c
hw_atalla.c hw_cswift.c hw_ncipher.c hw_aep.c hw_sureware.c \
hw_ubsec.c hw_keyclient.c
LIBOBJ= engine_err.o engine_lib.o engine_list.o engine_openssl.o \
hw_atalla.o hw_cswift.o hw_ncipher.o
hw_atalla.o hw_cswift.o hw_ncipher.o hw_aep.o hw_sureware.o \
hw_ubsec.o hw_keyclient.o
SRC= $(LIBSRC)
@@ -156,6 +158,25 @@ engine_openssl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
engine_openssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
engine_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
engine_openssl.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_aep.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_aep.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_aep.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
hw_aep.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_aep.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_aep.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
hw_aep.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_aep.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_aep.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_aep.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_aep.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_aep.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_aep.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
hw_aep.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
hw_aep.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
hw_aep.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
hw_aep.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
hw_aep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
hw_aep.o: ../cryptlib.h engine_int.h vendor_defns/aep.h
hw_atalla.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_atalla.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_atalla.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -196,6 +217,26 @@ hw_cswift.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
hw_cswift.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
hw_cswift.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_cswift.o: vendor_defns/cswift.h
hw_keyclient.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_keyclient.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_keyclient.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
hw_keyclient.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_keyclient.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_keyclient.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
hw_keyclient.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_keyclient.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_keyclient.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_keyclient.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_keyclient.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_keyclient.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_keyclient.o: ../../include/openssl/opensslconf.h
hw_keyclient.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
hw_keyclient.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
hw_keyclient.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
hw_keyclient.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
hw_keyclient.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
hw_keyclient.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_keyclient.o: vendor_defns/keyclient.h
hw_ncipher.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_ncipher.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_ncipher.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -218,3 +259,45 @@ hw_ncipher.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
hw_ncipher.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
hw_ncipher.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
hw_ncipher.o: ../cryptlib.h engine_int.h vendor_defns/hwcryptohook.h
hw_sureware.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_sureware.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_sureware.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
hw_sureware.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_sureware.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_sureware.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
hw_sureware.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_sureware.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_sureware.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_sureware.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_sureware.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_sureware.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_sureware.o: ../../include/openssl/opensslconf.h
hw_sureware.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
hw_sureware.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
hw_sureware.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
hw_sureware.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
hw_sureware.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
hw_sureware.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
hw_sureware.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
hw_sureware.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
hw_sureware.o: ../cryptlib.h engine.h engine_int.h vendor_defns/sureware.h
hw_ubsec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_ubsec.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_ubsec.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
hw_ubsec.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_ubsec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_ubsec.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
hw_ubsec.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_ubsec.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_ubsec.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_ubsec.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_ubsec.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_ubsec.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_ubsec.o: ../../include/openssl/opensslconf.h
hw_ubsec.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
hw_ubsec.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
hw_ubsec.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
hw_ubsec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
hw_ubsec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
hw_ubsec.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_ubsec.o: vendor_defns/hw_ubsec.h

View File

@@ -276,9 +276,6 @@ int ENGINE_set_default_BN_mod_exp_crt(ENGINE *e);
* ENGINE_METHOD_*** defines above. */
int ENGINE_set_default(ENGINE *e, unsigned int flags);
/* Obligatory error function. */
void ERR_load_ENGINE_strings(void);
/*
* Error codes for all engine functions. NB: We use "generic"
* function names instead of per-implementation ones because this
@@ -293,10 +290,17 @@ void ERR_load_ENGINE_strings(void);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_ENGINE_strings(void);
/* Error codes for the ENGINE functions. */
/* Function codes. */
#define ENGINE_F_AEP_FINISH 156
#define ENGINE_F_AEP_INIT 157
#define ENGINE_F_AEP_MOD_EXP 158
#define ENGINE_F_AEP_MOD_EXP_CRT 160
#define ENGINE_F_AEP_RAND 161
#define ENGINE_F_AEP_RSA_MOD_EXP 159
#define ENGINE_F_ATALLA_FINISH 135
#define ENGINE_F_ATALLA_INIT 136
#define ENGINE_F_ATALLA_MOD_EXP 137
@@ -356,9 +360,55 @@ void ERR_load_ENGINE_strings(void);
#define ENGINE_F_HWCRHK_MOD_EXP_CRT 138
#define ENGINE_F_HWCRHK_RAND_BYTES 139
#define ENGINE_F_HWCRHK_RSA_MOD_EXP 140
#define ENGINE_F_KC_INT_DSA_PRIV 213
#define ENGINE_F_KC_INT_DSA_VERIFY 214
#define ENGINE_F_KC_INT_RSA_PRIV 215
#define ENGINE_F_KC_INT_RSA_PUB 216
#define ENGINE_F_KEYCLIENT_CHECK_GLOBAL 217
#define ENGINE_F_KEYCLIENT_DSA_FINISH 218
#define ENGINE_F_KEYCLIENT_DSA_INIT 219
#define ENGINE_F_KEYCLIENT_DSA_SIGN 220
#define ENGINE_F_KEYCLIENT_DSA_VERIFY 221
#define ENGINE_F_KEYCLIENT_FINISH 222
#define ENGINE_F_KEYCLIENT_GET_DSA_CTX 223
#define ENGINE_F_KEYCLIENT_GET_RSA_CTX 224
#define ENGINE_F_KEYCLIENT_INIT 225
#define ENGINE_F_KEYCLIENT_PADDING 226
#define ENGINE_F_KEYCLIENT_RSA_FINISH 227
#define ENGINE_F_KEYCLIENT_RSA_INIT 228
#define ENGINE_F_KEYCLIENT_RSA_PRIV_DEC 229
#define ENGINE_F_KEYCLIENT_RSA_PRIV_ENC 230
#define ENGINE_F_KEYCLIENT_RSA_PUB_DEC 231
#define ENGINE_F_KEYCLIENT_RSA_PUB_ENC 232
#define ENGINE_F_KEYCLIENT_SET_DSA_CTX 233
#define ENGINE_F_KEYCLIENT_SET_RSA_CTX 234
#define ENGINE_F_LOG_MESSAGE 141
#define ENGINE_F_SUREWAREHK_CTRL 209
#define ENGINE_F_SUREWAREHK_DH_GEN_KEY 210
#define ENGINE_F_SUREWAREHK_DSA_DO_SIGN 211
#define ENGINE_F_SUREWAREHK_EX_FREE 206
#define ENGINE_F_SUREWAREHK_FINISH 201
#define ENGINE_F_SUREWAREHK_INIT 200
#define ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY 204
#define ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY 205
#define ENGINE_F_SUREWAREHK_MOD_EXP 212
#define ENGINE_F_SUREWAREHK_RAND_BYTES 202
#define ENGINE_F_SUREWAREHK_RAND_SEED 203
#define ENGINE_F_SUREWAREHK_RSA_PRIV_DEC 207
#define ENGINE_F_SUREWAREHK_RSA_PRIV_ENC 208
#define ENGINE_F_UBSEC_CTRL 176
#define ENGINE_F_UBSEC_DH_COMPUTE_KEY 171
#define ENGINE_F_UBSEC_DSA_SIGN 163
#define ENGINE_F_UBSEC_DSA_VERIFY 164
#define ENGINE_F_UBSEC_FINISH 165
#define ENGINE_F_UBSEC_INIT 166
#define ENGINE_F_UBSEC_MOD_EXP 167
#define ENGINE_F_UBSEC_RNG_BYTES 172
#define ENGINE_F_UBSEC_RSA_MOD_EXP 168
#define ENGINE_F_UBSEC_RSA_MOD_EXP_CRT 169
/* Reason codes. */
#define ENGINE_R_AEP_INIT_FAILURE 132
#define ENGINE_R_ALREADY_LOADED 100
#define ENGINE_R_BIO_WAS_FREED 121
#define ENGINE_R_BN_CTX_FULL 101
@@ -372,14 +422,20 @@ void ERR_load_ENGINE_strings(void);
#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
#define ENGINE_R_FINISH_FAILED 106
#define ENGINE_R_GET_HANDLE_FAILED 107
#define ENGINE_R_GET_RANDOM_FAILED 133
#define ENGINE_R_ID_OR_NAME_MISSING 108
#define ENGINE_R_INIT_FAILED 109
#define ENGINE_R_INTERNAL_LIST_ERROR 110
#define ENGINE_R_INVALID_PADDING 137
#define ENGINE_R_KEY_TOO_LARGE 138
#define ENGINE_R_MISSING_KEY_COMPONENTS 111
#define ENGINE_R_MOD_EXP_CRT_FAILED 134
#define ENGINE_R_MOD_EXP_FAILED 131
#define ENGINE_R_NOT_INITIALISED 117
#define ENGINE_R_NOT_LOADED 112
#define ENGINE_R_NO_CALLBACK 127
#define ENGINE_R_NO_CONTROL_FUNCTION 120
#define ENGINE_R_NO_INDEX 139
#define ENGINE_R_NO_KEY 124
#define ENGINE_R_NO_LOAD_FUNCTION 125
#define ENGINE_R_NO_REFERENCE 130
@@ -388,6 +444,8 @@ void ERR_load_ENGINE_strings(void);
#define ENGINE_R_PROVIDE_PARAMETERS 113
#define ENGINE_R_REQUEST_FAILED 114
#define ENGINE_R_REQUEST_FALLBACK 118
#define ENGINE_R_RETURN_CONNECTION_FAILED 135
#define ENGINE_R_SETBNCALLBACK_FAILURE 136
#define ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL 122
#define ENGINE_R_UNIT_FAILURE 115
@@ -395,4 +453,3 @@ void ERR_load_ENGINE_strings(void);
}
#endif
#endif

View File

@@ -66,6 +66,12 @@
#ifndef NO_ERR
static ERR_STRING_DATA ENGINE_str_functs[]=
{
{ERR_PACK(0,ENGINE_F_AEP_FINISH,0), "AEP_FINISH"},
{ERR_PACK(0,ENGINE_F_AEP_INIT,0), "AEP_INIT"},
{ERR_PACK(0,ENGINE_F_AEP_MOD_EXP,0), "AEP_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_AEP_MOD_EXP_CRT,0), "AEP_MOD_EXP_CRT"},
{ERR_PACK(0,ENGINE_F_AEP_RAND,0), "AEP_RAND"},
{ERR_PACK(0,ENGINE_F_AEP_RSA_MOD_EXP,0), "AEP_RSA_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_ATALLA_FINISH,0), "ATALLA_FINISH"},
{ERR_PACK(0,ENGINE_F_ATALLA_INIT,0), "ATALLA_INIT"},
{ERR_PACK(0,ENGINE_F_ATALLA_MOD_EXP,0), "ATALLA_MOD_EXP"},
@@ -125,12 +131,58 @@ static ERR_STRING_DATA ENGINE_str_functs[]=
{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP_CRT,0), "HWCRHK_MOD_EXP_CRT"},
{ERR_PACK(0,ENGINE_F_HWCRHK_RAND_BYTES,0), "HWCRHK_RAND_BYTES"},
{ERR_PACK(0,ENGINE_F_HWCRHK_RSA_MOD_EXP,0), "HWCRHK_RSA_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_KC_INT_DSA_PRIV,0), "KC_INT_DSA_PRIV"},
{ERR_PACK(0,ENGINE_F_KC_INT_DSA_VERIFY,0), "KC_INT_DSA_VERIFY"},
{ERR_PACK(0,ENGINE_F_KC_INT_RSA_PRIV,0), "KC_INT_RSA_PRIV"},
{ERR_PACK(0,ENGINE_F_KC_INT_RSA_PUB,0), "KC_INT_RSA_PUB"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_CHECK_GLOBAL,0), "KEYCLIENT_CHECK_GLOBAL"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_FINISH,0), "KEYCLIENT_DSA_FINISH"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_INIT,0), "KEYCLIENT_DSA_INIT"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_SIGN,0), "KEYCLIENT_DSA_SIGN"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_VERIFY,0), "KEYCLIENT_DSA_VERIFY"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_FINISH,0), "KEYCLIENT_FINISH"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_GET_DSA_CTX,0), "KEYCLIENT_GET_DSA_CTX"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_GET_RSA_CTX,0), "KEYCLIENT_GET_RSA_CTX"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_INIT,0), "KEYCLIENT_INIT"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_PADDING,0), "KEYCLIENT_PADDING"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_FINISH,0), "KEYCLIENT_RSA_FINISH"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_INIT,0), "KEYCLIENT_RSA_INIT"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PRIV_DEC,0), "KEYCLIENT_RSA_PRIV_DEC"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PRIV_ENC,0), "KEYCLIENT_RSA_PRIV_ENC"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PUB_DEC,0), "KEYCLIENT_RSA_PUB_DEC"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PUB_ENC,0), "KEYCLIENT_RSA_PUB_ENC"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_SET_DSA_CTX,0), "KEYCLIENT_SET_DSA_CTX"},
{ERR_PACK(0,ENGINE_F_KEYCLIENT_SET_RSA_CTX,0), "KEYCLIENT_SET_RSA_CTX"},
{ERR_PACK(0,ENGINE_F_LOG_MESSAGE,0), "LOG_MESSAGE"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_CTRL,0), "SUREWAREHK_CTRL"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_DH_GEN_KEY,0), "SUREWAREHK_DH_GEN_KEY"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_DSA_DO_SIGN,0), "SUREWAREHK_DSA_DO_SIGN"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_EX_FREE,0), "SUREWAREHK_EX_FREE"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_FINISH,0), "SUREWAREHK_FINISH"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_INIT,0), "SUREWAREHK_INIT"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,0), "SUREWAREHK_LOAD_PRIVATE_KEY"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,0), "SUREWAREHK_LOAD_PUBLIC_KEY"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_MOD_EXP,0), "SUREWAREHK_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RAND_BYTES,0), "SUREWAREHK_RAND_BYTES"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RAND_SEED,0), "SUREWAREHK_RAND_SEED"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,0), "SUREWAREHK_RSA_PRIV_DEC"},
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,0), "SUREWAREHK_RSA_PRIV_ENC"},
{ERR_PACK(0,ENGINE_F_UBSEC_CTRL,0), "UBSEC_CTRL"},
{ERR_PACK(0,ENGINE_F_UBSEC_DH_COMPUTE_KEY,0), "UBSEC_DH_COMPUTE_KEY"},
{ERR_PACK(0,ENGINE_F_UBSEC_DSA_SIGN,0), "UBSEC_DSA_SIGN"},
{ERR_PACK(0,ENGINE_F_UBSEC_DSA_VERIFY,0), "UBSEC_DSA_VERIFY"},
{ERR_PACK(0,ENGINE_F_UBSEC_FINISH,0), "UBSEC_FINISH"},
{ERR_PACK(0,ENGINE_F_UBSEC_INIT,0), "UBSEC_INIT"},
{ERR_PACK(0,ENGINE_F_UBSEC_MOD_EXP,0), "UBSEC_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_UBSEC_RNG_BYTES,0), "UBSEC_RNG_BYTES"},
{ERR_PACK(0,ENGINE_F_UBSEC_RSA_MOD_EXP,0), "UBSEC_RSA_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_UBSEC_RSA_MOD_EXP_CRT,0), "UBSEC_RSA_MOD_EXP_CRT"},
{0,NULL}
};
static ERR_STRING_DATA ENGINE_str_reasons[]=
{
{ENGINE_R_AEP_INIT_FAILURE ,"aep init failure"},
{ENGINE_R_ALREADY_LOADED ,"already loaded"},
{ENGINE_R_BIO_WAS_FREED ,"bio was freed"},
{ENGINE_R_BN_CTX_FULL ,"BN_CTX full"},
@@ -144,22 +196,30 @@ static ERR_STRING_DATA ENGINE_str_reasons[]=
{ENGINE_R_FAILED_LOADING_PUBLIC_KEY ,"failed loading public key"},
{ENGINE_R_FINISH_FAILED ,"finish failed"},
{ENGINE_R_GET_HANDLE_FAILED ,"could not obtain hardware handle"},
{ENGINE_R_GET_RANDOM_FAILED ,"get random failed"},
{ENGINE_R_ID_OR_NAME_MISSING ,"'id' or 'name' missing"},
{ENGINE_R_INIT_FAILED ,"init failed"},
{ENGINE_R_INTERNAL_LIST_ERROR ,"internal list error"},
{ENGINE_R_INVALID_PADDING ,"invalid padding"},
{ENGINE_R_KEY_TOO_LARGE ,"key too large"},
{ENGINE_R_MISSING_KEY_COMPONENTS ,"missing key components"},
{ENGINE_R_MOD_EXP_CRT_FAILED ,"mod exp crt failed"},
{ENGINE_R_MOD_EXP_FAILED ,"mod exp failed"},
{ENGINE_R_NOT_INITIALISED ,"not initialised"},
{ENGINE_R_NOT_LOADED ,"not loaded"},
{ENGINE_R_NO_CALLBACK ,"no callback"},
{ENGINE_R_NO_CONTROL_FUNCTION ,"no control function"},
{ENGINE_R_NO_INDEX ,"no index"},
{ENGINE_R_NO_KEY ,"no key"},
{ENGINE_R_NO_LOAD_FUNCTION ,"no load function"},
{ENGINE_R_NO_REFERENCE ,"no reference"},
{ENGINE_R_NO_REFERENCE ,"no reference"},
{ENGINE_R_NO_SUCH_ENGINE ,"no such engine"},
{ENGINE_R_NO_UNLOAD_FUNCTION ,"no unload function"},
{ENGINE_R_PROVIDE_PARAMETERS ,"provide parameters"},
{ENGINE_R_REQUEST_FAILED ,"request failed"},
{ENGINE_R_REQUEST_FALLBACK ,"request fallback"},
{ENGINE_R_RETURN_CONNECTION_FAILED ,"return connection failed"},
{ENGINE_R_SETBNCALLBACK_FAILURE ,"setbncallback failure"},
{ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"},
{ENGINE_R_UNIT_FAILURE ,"unit failure"},
{0,NULL}

View File

@@ -151,6 +151,25 @@ ENGINE *ENGINE_ncipher();
ENGINE *ENGINE_atalla();
#endif /* !NO_HW_ATALLA */
#ifndef NO_HW_AEP
/* Returns a structure of AEP methods. */
ENGINE *ENGINE_aep();
#endif /* !NO_HW_AEP */
#ifndef NO_HW_SUREWARE
/* Returns a structure of atalla methods. */
ENGINE *ENGINE_sureware();
#endif /* !NO_HW_SUREWARE */
#ifndef NO_HW_UBSEC
/* Returns a structure of ubsec methods. */
ENGINE *ENGINE_ubsec();
#endif /* !NO_HW_UBSEC */
#ifndef NO_HW_KEYCLIENT
/* Returns a structure of keyclient methods. */
ENGINE *ENGINE_keyclient();
#endif /* !NO_HW_KEYCLIENT */
#endif /* !NO_HW */
#ifdef __cplusplus

View File

@@ -198,6 +198,22 @@ static int engine_internal_check(void)
if(!engine_list_add(ENGINE_atalla()))
return 0;
#endif /* !NO_HW_ATALLA */
#ifndef NO_HW_AEP
if(!engine_list_add(ENGINE_aep()))
return 0;
#endif /* !NO_HW_AEP */
#ifndef NO_HW_SUREWARE
if(!engine_list_add(ENGINE_sureware()))
return 0;
#endif /* !NO_HW_SUREWARE */
#ifndef NO_HW_UBSEC
if(!engine_list_add(ENGINE_ubsec()))
return 0;
#endif /* !NO_HW_UBSEC */
#ifndef NO_HW_KEYCLIENT
if(!engine_list_add(ENGINE_keyclient()))
return 0;
#endif /* !NO_HW_KEYCLIENT */
#endif /* !NO_HW */
engine_list_flag = 1;
return 1;

840
crypto/engine/hw_aep.c Normal file
View File

@@ -0,0 +1,840 @@
/* crypto/engine/hw_aep.c */
/*
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include <openssl/bn.h>
#include <string.h>
#include <unistd.h>
#include <openssl/crypto.h>
#include "cryptlib.h"
#include <openssl/dso.h>
#include "engine_int.h"
#include <openssl/engine.h>
#ifndef NO_HW
#ifndef NO_HW_AEP
#ifdef FLAT_INC
#include "aep.h"
#else
#include "vendor_defns/aep.h"
#endif
static int aep_init(void);
static int aep_finish(void);
static int aep_get_connection(unsigned int *hConnection);
static int aep_return_connection(unsigned int hConnection);
/* BIGNUM stuff */
static int aep_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
/* RSA stuff */
static int aep_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa);
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int aep_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
/* DSA stuff */
static int aep_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
BN_CTX *ctx, BN_MONT_CTX *in_mont);
static int aep_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *m_ctx);
/* DH stuff */
/* This function is aliased to mod_exp (with the DH and mont dropped). */
static int aep_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
/* rand stuff */
static int aep_rand(unsigned char *buf, int num);
/* Our internal RSA_METHOD that we provide pointers to */
static RSA_METHOD aep_rsa =
{
"Aep RSA method",
NULL, /*rsa_pub_encrypt*/
NULL, /*rsa_pub_decrypt*/
NULL, /*rsa_priv_encrypt*/
NULL, /*rsa_priv_encrypt*/
aep_rsa_mod_exp, /*rsa_mod_exp*/
aep_mod_exp_mont, /*bn_mod_exp*/
NULL, /*init*/
NULL, /*finish*/
0, /*flags*/
NULL, /*app_data*/
NULL, /*rsa_sign*/
NULL /*rsa_verify*/
};
/* Our internal DSA_METHOD that we provide pointers to */
static DSA_METHOD aep_dsa =
{
"Aep DSA method",
NULL, /* dsa_do_sign */
NULL, /* dsa_sign_setup */
NULL, /* dsa_do_verify */
aep_dsa_mod_exp, /* dsa_mod_exp */
aep_mod_exp_dsa, /* bn_mod_exp */
NULL, /* init */
NULL, /* finish */
0, /* flags */
NULL /* app_data */
};
/* Our internal DH_METHOD that we provide pointers to */
static DH_METHOD aep_dh =
{
"Aep DH method",
NULL,
NULL,
aep_mod_exp_dh,
NULL,
NULL,
0,
NULL
};
/* our internal RAND_method that we provide pointers to */
static RAND_METHOD aep_random =
{
/*"AEP RAND method", */
NULL,
aep_rand,
NULL,
NULL,
aep_rand,
NULL,
};
/* Our ENGINE structure. */
static ENGINE engine_aep =
{
"aep",
"Aep hardware engine support",
&aep_rsa,
&aep_dsa,
&aep_dh,
&aep_random,
aep_mod_exp,
NULL,
aep_init,
aep_finish,
NULL, /* no ctrl() */
NULL, /* no load_privkey() */
NULL, /* no load_pubkey() */
0, /* no flags */
0, 0, /* no references */
NULL, NULL /* unlinked */
};
/*Define an array of structures to hold connections*/
static AEP_CONNECTION_ENTRY aep_app_conn_table[MAX_PROCESS_CONNECTIONS];
/*Used to determine if this is a new process*/
static pid_t recorded_pid = 0;
static int rnd_reference;
static AEP_U8 rand_block[RAND_BLK_SIZE];
static AEP_U32 rand_block_bytes = 0;
/* As this is only ever called once, there's no need for locking
* (indeed - the lock will already be held by our caller!!!) */
ENGINE *ENGINE_aep()
{
RSA_METHOD *meth1;
DSA_METHOD *meth2;
DH_METHOD *meth3;
/* We know that the "PKCS1_SSLeay()" functions hook properly
* to the aep-specific mod_exp and mod_exp_crt so we use
* those functions. NB: We don't use ENGINE_openssl() or
* anything "more generic" because something like the RSAref
* code may not hook properly, and if you own one of these
* cards then you have the right to do RSA operations on it
* anyway! */
meth1 = RSA_PKCS1_SSLeay();
aep_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
aep_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
aep_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
aep_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
/* Use the DSA_OpenSSL() method and just hook the mod_exp-ish
* bits. */
meth2 = DSA_OpenSSL();
aep_dsa.dsa_do_sign = meth2->dsa_do_sign;
aep_dsa.dsa_sign_setup = meth2->dsa_sign_setup;
aep_dsa.dsa_do_verify = meth2->dsa_do_verify;
aep_dsa = *DSA_get_default_openssl_method();
aep_dsa.dsa_mod_exp = aep_dsa_mod_exp;
aep_dsa.bn_mod_exp = aep_mod_exp_dsa;
/* Much the same for Diffie-Hellman */
meth3 = DH_OpenSSL();
aep_dh.generate_key = meth3->generate_key;
aep_dh.compute_key = meth3->compute_key;
aep_dh.bn_mod_exp = meth3->bn_mod_exp;
return &engine_aep;
}
/* This is a process-global DSO handle used for loading and unloading
* the Aep library. NB: This is only set (or unset) during an
* init() or finish() call (reference counts permitting) and they're
* operating with global locks, so this should be thread-safe
* implicitly. */
static DSO *aep_dso = NULL;
/* These are the function pointers that are (un)set when the library has
* successfully (un)loaded. */
static t_AEP_OpenConnection *p_AEP_OpenConnection = NULL;
static t_AEP_ModExp *p_AEP_ModExp = NULL;
static t_AEP_ModExpCrt *p_AEP_ModExpCrt = NULL;
static t_AEP_GenRandom *p_AEP_GenRandom = NULL;
static t_AEP_Initialize *p_AEP_Initialize = NULL;
static t_AEP_Finalize *p_AEP_Finalize = NULL;
static t_AEP_SetBNCallBacks *p_AEP_SetBNCallBacks = NULL;
/* (de)initialisation functions. */
static int aep_init()
{
t_AEP_ModExp *p1;
t_AEP_ModExpCrt *p2;
t_AEP_GenRandom *p3;
t_AEP_Finalize *p4;
t_AEP_Initialize *p5;
t_AEP_OpenConnection *p6;
t_AEP_SetBNCallBacks *p7;
unsigned int hConnection,rv;
int to_return = 0;
if(aep_dso != NULL)
{
ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_ALREADY_LOADED);
goto err;
}
/* Attempt to load libaep.so. */
aep_dso = DSO_load(NULL, AEP_LIBNAME, NULL,
DSO_FLAG_NAME_TRANSLATION);
if(aep_dso == NULL)
{
ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
if(!(p1 = (t_AEP_ModExp *) DSO_bind_func( aep_dso,AEP_F1)) ||
!(p2 = (t_AEP_ModExpCrt*) DSO_bind_func( aep_dso,AEP_F2)) ||
!(p3 = (t_AEP_GenRandom*) DSO_bind_func( aep_dso,AEP_F3)) ||
!(p4 = (t_AEP_Finalize*) DSO_bind_func( aep_dso,AEP_F4)) ||
!(p5 = (t_AEP_Initialize*) DSO_bind_func( aep_dso,AEP_F5)) ||
!(p6 = (t_AEP_OpenConnection*) DSO_bind_func( aep_dso,AEP_F6)) ||
!(p7 = (t_AEP_SetBNCallBacks*) DSO_bind_func( aep_dso,AEP_F7)))
{
ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
/* Copy the pointers */
p_AEP_ModExp = p1;
p_AEP_ModExpCrt = p2;
p_AEP_GenRandom = p3;
p_AEP_Finalize = p4;
p_AEP_Initialize = p5;
p_AEP_OpenConnection = p6;
p_AEP_SetBNCallBacks = p7;
/* Perform a basic test to see if there's actually any unit
* running. */
CRYPTO_add(&rnd_reference, 1, CRYPTO_LOCK_DYNLOCK);
rv = aep_get_connection(&hConnection);
if (rv != AEP_R_OK)
goto err;
/* Everything's fine. */
rv = aep_return_connection(hConnection);
to_return = 1;
return to_return;
err:
if(aep_dso)
DSO_free(aep_dso);
p_AEP_OpenConnection = NULL;
p_AEP_ModExp = NULL;
p_AEP_ModExpCrt = NULL;
p_AEP_GenRandom = NULL;
p_AEP_Initialize = NULL;
p_AEP_Finalize = NULL;
p_AEP_SetBNCallBacks = NULL;
return to_return;
}
static int aep_finish()
{
int to_return = 0;
if(aep_dso == NULL)
{
ENGINEerr(ENGINE_F_AEP_FINISH,ENGINE_R_NOT_LOADED);
goto err;
}
if(!DSO_free(aep_dso))
{
ENGINEerr(ENGINE_F_AEP_FINISH,ENGINE_R_DSO_FAILURE);
goto err;
}
aep_dso = NULL;
p_AEP_OpenConnection = NULL;
p_AEP_ModExp = NULL;
p_AEP_ModExpCrt = NULL;
p_AEP_GenRandom = NULL;
p_AEP_Initialize = NULL;
p_AEP_Finalize = NULL;
p_AEP_SetBNCallBacks = NULL;
CRYPTO_add(&rnd_reference, -1, CRYPTO_LOCK_DYNLOCK);
to_return = 1;
err:
return to_return;
}
static int aep_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx)
{
int to_return = 0;
unsigned int hConnection, rv;
/*Grab a connection from the pool*/
rv = aep_get_connection(&hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_MOD_EXP,ENGINE_R_GET_HANDLE_FAILED);
goto err;
}
/*To the card with the mod exp*/
rv = p_AEP_ModExp(hConnection,(void*)a, (void*)p,(void*)m, (void*)r,NULL);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_MOD_EXP,ENGINE_R_MOD_EXP_FAILED);
rv = aep_return_connection(hConnection);
goto err;
}
/*Return the connection to the pool*/
rv = aep_return_connection(hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_RETURN_CONNECTION_FAILED);
goto err;
}
to_return = 1;
err:
return to_return;
}
static int aep_mod_exp_crt(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *q ,
const BIGNUM *dmp1,const BIGNUM *dmq1,const BIGNUM *iqmp, BN_CTX *ctx)
{
AEP_RV rv = AEP_R_OK;
unsigned int hConnection;
/*Grab a connection from the pool*/
rv = aep_get_connection(&hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_MOD_EXP_CRT,ENGINE_R_GET_HANDLE_FAILED);
goto err;
}
/*To the card with the mod exp*/
rv = p_AEP_ModExpCrt(hConnection,(void*)a, (void*)p, (void*)q, (void*)dmp1,(void*)dmq1,
(void*)iqmp,(void*)r,NULL);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_MOD_EXP_CRT,ENGINE_R_MOD_EXP_CRT_FAILED);
rv = aep_return_connection(hConnection);
goto err;
}
/*Return the connection to the pool*/
rv = aep_return_connection(hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_RETURN_CONNECTION_FAILED);
goto err;
}
err:
return rv;
}
static int aep_rand(unsigned char *buf,int len )
{
AEP_RV rv = AEP_R_OK;
unsigned int hConnection;
int to_return = 0;
CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
/*Can the request be serviced with what's already in the buffer?*/
if (len <= rand_block_bytes)
{
memcpy(buf, &rand_block[RAND_BLK_SIZE - rand_block_bytes], len);
rand_block_bytes -= len;
}
else
/*If not the get another block of random bytes*/
{
rv = aep_get_connection(&hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_GET_HANDLE_FAILED);
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
goto err;
}
if (len > RAND_BLK_SIZE)
{
rv = p_AEP_GenRandom(hConnection, len, 2, buf, NULL);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_GET_RANDOM_FAILED);
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
goto err;
}
}
else
{
rv = p_AEP_GenRandom(hConnection, RAND_BLK_SIZE, 2, &rand_block[0], NULL);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_GET_RANDOM_FAILED);
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
goto err;
}
rand_block_bytes = RAND_BLK_SIZE;
memcpy(buf, &rand_block[RAND_BLK_SIZE - rand_block_bytes], len);
rand_block_bytes -= len;
}
rv = aep_return_connection(hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_RETURN_CONNECTION_FAILED);
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
goto err;
}
}
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
to_return = 1;
err:
return to_return;
}
static int aep_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
{
BN_CTX *ctx = NULL;
int to_return = 0;
AEP_RV rv = AEP_R_OK;
if (!aep_dso)
{
ENGINEerr(ENGINE_F_AEP_RSA_MOD_EXP,ENGINE_R_NOT_LOADED);
goto err;
}
/*See if we have all the necessary bits for a crt*/
if (rsa->q && rsa->dmp1 && rsa->dmq1 && rsa->iqmp)
{
rv = aep_mod_exp_crt(r0,I,rsa->p,rsa->q, rsa->dmp1,rsa->dmq1,rsa->iqmp,ctx);
if (rv != AEP_R_OK)
goto err;
}
else
{
if (!rsa->d || !rsa->n)
{
ENGINEerr(ENGINE_F_AEP_RSA_MOD_EXP,ENGINE_R_MISSING_KEY_COMPONENTS);
goto err;
}
rv = aep_mod_exp(r0,I,rsa->d,rsa->n,ctx);
if (rv != AEP_R_OK)
goto err;
}
to_return = 1;
err:
if(ctx)
BN_CTX_free(ctx);
return to_return;
}
static int aep_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
BN_CTX *ctx, BN_MONT_CTX *in_mont)
{
BIGNUM t;
int to_return = 0;
BN_init(&t);
/* let rr = a1 ^ p1 mod m */
if (!aep_mod_exp(rr,a1,p1,m,ctx)) goto end;
/* let t = a2 ^ p2 mod m */
if (!aep_mod_exp(&t,a2,p2,m,ctx)) goto end;
/* let rr = rr * t mod m */
if (!BN_mod_mul(rr,rr,&t,m,ctx)) goto end;
to_return = 1;
end:
BN_free(&t);
return to_return;
}
static int aep_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *m_ctx)
{
return aep_mod_exp(r, a, p, m, ctx);
}
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int aep_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return aep_mod_exp(r, a, p, m, ctx);
}
/* This function is aliased to mod_exp (with the dh and mont dropped). */
static int aep_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return aep_mod_exp(r, a, p, m, ctx);
}
static int aep_get_connection(unsigned int *hConnection)
{
int count;
AEP_RV rv = AEP_R_OK;
/*Get the current process id*/
pid_t curr_pid;
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
curr_pid = getpid();
/*Check if this is the first time this is being called from the current
process*/
if (recorded_pid != curr_pid)
{
recorded_pid = curr_pid;
/*Call Finalize to make sure we have not inherited some data from a parent
process*/
p_AEP_Finalize();
/*Initialise the AEP API*/
rv = p_AEP_Initialize(NULL);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_AEP_INIT_FAILURE);
recorded_pid = 0;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return rv;
}
/*Set the AEP big num call back functions*/
rv = p_AEP_SetBNCallBacks(&GetBigNumSize, &MakeAEPBigNum, &ConvertAEPBigNum);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_SETBNCALLBACK_FAILURE);
recorded_pid = 0;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return rv;
}
/*Reset the rand byte count*/
rand_block_bytes = 0;
/*Init the structures*/
for (count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
{
aep_app_conn_table[count].conn_state = NotConnected;
aep_app_conn_table[count].conn_hndl = 0;
}
/*Open a connection*/
rv = p_AEP_OpenConnection(hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_UNIT_FAILURE);
recorded_pid = 0;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return rv;
}
aep_app_conn_table[0].conn_state = InUse;
aep_app_conn_table[0].conn_hndl = *hConnection;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return (rv);
}
/*Check the existing connections to see if we can find a free one*/
for (count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
{
if (aep_app_conn_table[count].conn_state == Connected)
{
aep_app_conn_table[count].conn_state = InUse;
*hConnection = aep_app_conn_table[count].conn_hndl;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return rv;
}
}
/*If no connections available, we're going to have to try to open a new one*/
for (count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
{
if (aep_app_conn_table[count].conn_state == NotConnected)
{
/*Open a connection*/
rv = p_AEP_OpenConnection(hConnection);
if (rv != AEP_R_OK)
{
ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_UNIT_FAILURE);
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return rv;
}
aep_app_conn_table[count].conn_state = InUse;
aep_app_conn_table[count].conn_hndl = *hConnection;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return rv;
}
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return AEP_R_GENERAL_ERROR;
}
static int aep_return_connection(unsigned int hConnection)
{
int count;
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
/*Find the connection item that matches this connection handle*/
for(count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
{
if (aep_app_conn_table[count].conn_hndl == hConnection)
{
aep_app_conn_table[count].conn_state = Connected;
break;
}
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return AEP_R_OK;
}
/*BigNum call back functions, used to convert OpenSSL bignums into AEP bignums.
Note only 32bit Openssl build support*/
AEP_RV GetBigNumSize(void* ArbBigNum, AEP_U32* BigNumSize)
{
BIGNUM* bn;
/*Cast the ArbBigNum pointer to our BIGNUM struct*/
bn = (BIGNUM*) ArbBigNum;
#ifdef SIXTY_FOUR_BIT_LONG
*BigNumSize = bn->top << 3;
#else
/*Size of the bignum in bytes is equal to the bn->top (no of 32 bit words) multiplies by 4*/
*BigNumSize = bn->top << 2;
#endif
return AEP_R_OK;
}
AEP_RV MakeAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum)
{
BIGNUM* bn;
#ifndef SIXTY_FOUR_BIT_LONG
unsigned char* buf;
int i;
#endif
/*Cast the ArbBigNum pointer to our BIGNUM struct*/
bn = (BIGNUM*) ArbBigNum;
#ifdef SIXTY_FOUR_BIT_LONG
memcpy(AEP_BigNum, bn->d, BigNumSize);
#else
/*Must copy data into a (monotone) least significant byte first format
performing endian conversion if necessary*/
for(i=0;i<bn->top;i++)
{
buf = (unsigned char*)&bn->d[i];
*((AEP_U32*)AEP_BigNum) = (AEP_U32) ((unsigned) buf[1] << 8 | buf[0]) |
((unsigned) buf[3] << 8 | buf[2]) << 16;
AEP_BigNum += 4;
}
#endif
return AEP_R_OK;
}
/*Turn an AEP Big Num back to a user big num*/
AEP_RV ConvertAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum)
{
BIGNUM* bn;
#ifndef SIXTY_FOUR_BIT_LONG
int i;
#endif
bn = (BIGNUM*)ArbBigNum;
/*Expand the result bn so that it can hold our big num. Size is in bits*/
bn_expand(bn, (int)(BigNumSize << 3));
#ifdef SIXTY_FOUR_BIT_LONG
bn->top = BigNumSize >> 3;
if((BigNumSize & 7) != 0)
bn->top++;
memset(bn->d, 0, bn->top << 3);
memcpy(bn->d, AEP_BigNum, BigNumSize);
#else
bn->top = BigNumSize >> 2;
for(i=0;i<bn->top;i++)
{
bn->d[i] = (AEP_U32) ((unsigned) AEP_BigNum[3] << 8 | AEP_BigNum[2]) << 16 |
((unsigned) AEP_BigNum[1] << 8 | AEP_BigNum[0]);
AEP_BigNum += 4;
}
#endif
return AEP_R_OK;
}
#endif /* !NO_HW_AEP */
#endif /* !NO_HW */

1014
crypto/engine/hw_keyclient.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -939,14 +939,14 @@ static int hwcrhk_mutex_init(HWCryptoHook_Mutex* mt,
{
mt->lockid = CRYPTO_get_new_dynlockid();
if (mt->lockid == 0)
return 0;
return 1;
return 1; /* failure */
return 0; /* success */
}
static int hwcrhk_mutex_lock(HWCryptoHook_Mutex *mt)
{
CRYPTO_w_lock(mt->lockid);
return 1;
return 0;
}
void hwcrhk_mutex_unlock(HWCryptoHook_Mutex * mt)

908
crypto/engine/hw_sureware.c Normal file
View File

@@ -0,0 +1,908 @@
/* Written by Corinne Dive-Reclus(cdive@baltimore.com)
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* Written by Corinne Dive-Reclus(cdive@baltimore.com)
*
* Copyright@2001 Baltimore Technologies Ltd.
* All right Reserved.
* *
* THIS FILE IS PROVIDED BY BALTIMORE TECHNOLOGIES ``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 BALTIMORE TECHNOLOGIES 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. *
====================================================================*/
#include <stdio.h>
#include <openssl/crypto.h>
#include <openssl/pem.h>
#include "cryptlib.h"
#include <openssl/dso.h>
#include "engine_int.h"
#include "engine.h"
#include <openssl/engine.h>
#ifndef NO_HW
#ifndef NO_HW_SUREWARE
#ifdef FLAT_INC
#include "sureware.h"
#else
#include "vendor_defns/sureware.h"
#endif
static int surewarehk_ctrl(int cmd, long i, void *p, void (*f)());
static int surewarehk_init(void);
static int surewarehk_finish(void);
static int surewarehk_modexp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
/* RSA stuff */
static int surewarehk_rsa_priv_dec(int flen,unsigned char *from,unsigned char *to,
RSA *rsa,int padding);
static int surewarehk_rsa_sign(int flen,unsigned char *from,unsigned char *to,
RSA *rsa,int padding);
/* RAND stuff */
static int surewarehk_rand_bytes(unsigned char *buf, int num);
static void surewarehk_rand_seed(const void *buf, int num);
static void surewarehk_rand_add(const void *buf, int num, double entropy);
/* KM stuff */
static EVP_PKEY *surewarehk_load_privkey(const char *key_id,
const char *passphrase);
static EVP_PKEY *surewarehk_load_pubkey(const char *key_id,
const char *passphrase);
static void surewarehk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
int index,long argl, void *argp);
static void surewarehk_dh_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
int index,long argl, void *argp);
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int surewarehk_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return surewarehk_modexp(r, a, p, m, ctx);
}
/* Our internal RSA_METHOD that we provide pointers to */
static RSA_METHOD surewarehk_rsa =
{
"SureWare RSA method",
NULL, /* pub_enc*/
NULL, /* pub_dec*/
surewarehk_rsa_sign, /* our rsa_sign is OpenSSL priv_enc*/
surewarehk_rsa_priv_dec, /* priv_dec*/
NULL, /*mod_exp*/
surewarehk_mod_exp_mont, /*mod_exp_mongomery*/
NULL, /* init*/
NULL, /* finish*/
0, /* RSA flag*/
NULL,
NULL, /* OpenSSL sign*/
NULL /* OpenSSL verify*/
};
/* Our internal DH_METHOD that we provide pointers to */
/* This function is aliased to mod_exp (with the dh and mont dropped). */
static int surewarehk_modexp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return surewarehk_modexp(r, a, p, m, ctx);
}
static DH_METHOD surewarehk_dh =
{
"SureWare DH method",
NULL,/*gen_key*/
NULL,/*agree,*/
surewarehk_modexp_dh, /*dh mod exp*/
NULL, /* init*/
NULL, /* finish*/
0, /* flags*/
NULL
};
static RAND_METHOD surewarehk_rand =
{
/* "SureWare RAND method", */
surewarehk_rand_seed,
surewarehk_rand_bytes,
NULL,/*cleanup*/
surewarehk_rand_add,
surewarehk_rand_bytes,
NULL,/*rand_status*/
};
/* DSA stuff */
static DSA_SIG * surewarehk_dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
static int surewarehk_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
BN_CTX *ctx, BN_MONT_CTX *in_mont)
{
BIGNUM t;
int to_return = 0;
BN_init(&t);
/* let rr = a1 ^ p1 mod m */
if (!surewarehk_modexp(rr,a1,p1,m,ctx)) goto end;
/* let t = a2 ^ p2 mod m */
if (!surewarehk_modexp(&t,a2,p2,m,ctx)) goto end;
/* let rr = rr * t mod m */
if (!BN_mod_mul(rr,rr,&t,m,ctx)) goto end;
to_return = 1;
end:
BN_free(&t);
return to_return;
}
static DSA_METHOD surewarehk_dsa =
{
"SureWare DSA method",
surewarehk_dsa_do_sign,
NULL,/*sign setup*/
NULL,/*verify,*/
surewarehk_dsa_mod_exp,/*mod exp*/
NULL,/*bn mod exp*/
NULL, /*init*/
NULL,/*finish*/
0,
NULL,
};
/* Our ENGINE structure. */
static ENGINE engine_surewarehk =
{
"sureware",
"SureWare hardware engine support",
&surewarehk_rsa,
&surewarehk_dsa,
&surewarehk_dh,
&surewarehk_rand,
&surewarehk_modexp,
NULL,/* mod exp CRT*/
surewarehk_init,
surewarehk_finish,
surewarehk_ctrl, /* crtl*/
surewarehk_load_privkey,
surewarehk_load_pubkey,
0, /* no flags */
0, 0, /* no references */
NULL, /*unlinked */
};
/* Now, to our own code */
/* As this is only ever called once, there's no need for locking
* (indeed - the lock will already be held by our caller!!!) */
ENGINE *ENGINE_sureware()
{
RSA_METHOD *meth1;
DSA_METHOD *meth2;
DH_METHOD *meth3;
/* We know that the "PKCS1_SSLeay()" functions hook properly
* to the cswift-specific mod_exp and mod_exp_crt so we use
* those functions. NB: We don't use ENGINE_openssl() or
* anything "more generic" because something like the RSAref
* code may not hook properly, and if you own one of these
* cards then you have the right to do RSA operations on it
* anyway! */
meth1 = RSA_PKCS1_SSLeay();
if (meth1)
{
surewarehk_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
surewarehk_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
}
/* Use the DSA_OpenSSL() method and just hook the mod_exp-ish
* bits. */
meth2 = DSA_OpenSSL();
if (meth2)
{
surewarehk_dsa.dsa_do_verify = meth2->dsa_do_verify;
}
/* Much the same for Diffie-Hellman */
meth3 = DH_OpenSSL();
if (meth3)
{
surewarehk_dh.generate_key = meth3->generate_key;
surewarehk_dh.compute_key = meth3->compute_key;
}
return &engine_surewarehk;
}
/* This is a process-global DSO handle used for loading and unloading
* the SureWareHook library. NB: This is only set (or unset) during an
* init() or finish() call (reference counts permitting) and they're
* operating with global locks, so this should be thread-safe
* implicitly. */
static DSO *surewarehk_dso = NULL;
static int rsaHndidx = -1; /* Index for KM handle. Not really used yet. */
static int dsaHndidx = -1; /* Index for KM handle. Not really used yet. */
/* These are the function pointers that are (un)set when the library has
* successfully (un)loaded. */
static SureWareHook_Init_t *p_surewarehk_Init = NULL;
static SureWareHook_Finish_t *p_surewarehk_Finish = NULL;
static SureWareHook_Rand_Bytes_t *p_surewarehk_Rand_Bytes = NULL;
static SureWareHook_Rand_Seed_t *p_surewarehk_Rand_Seed = NULL;
static SureWareHook_Load_Privkey_t *p_surewarehk_Load_Privkey = NULL;
static SureWareHook_Info_Pubkey_t *p_surewarehk_Info_Pubkey = NULL;
static SureWareHook_Load_Rsa_Pubkey_t *p_surewarehk_Load_Rsa_Pubkey = NULL;
static SureWareHook_Load_Dsa_Pubkey_t *p_surewarehk_Load_Dsa_Pubkey = NULL;
static SureWareHook_Free_t *p_surewarehk_Free=NULL;
static SureWareHook_Rsa_Priv_Dec_t *p_surewarehk_Rsa_Priv_Dec=NULL;
static SureWareHook_Rsa_Sign_t *p_surewarehk_Rsa_Sign=NULL;
static SureWareHook_Dsa_Sign_t *p_surewarehk_Dsa_Sign=NULL;
static SureWareHook_Mod_Exp_t *p_surewarehk_Mod_Exp=NULL;
/* Used in the DSO operations. */
static const char *surewarehk_LIBNAME = "SureWareHook";
static const char *n_surewarehk_Init = "SureWareHook_Init";
static const char *n_surewarehk_Finish = "SureWareHook_Finish";
static const char *n_surewarehk_Rand_Bytes="SureWareHook_Rand_Bytes";
static const char *n_surewarehk_Rand_Seed="SureWareHook_Rand_Seed";
static const char *n_surewarehk_Load_Privkey="SureWareHook_Load_Privkey";
static const char *n_surewarehk_Info_Pubkey="SureWareHook_Info_Pubkey";
static const char *n_surewarehk_Load_Rsa_Pubkey="SureWareHook_Load_Rsa_Pubkey";
static const char *n_surewarehk_Load_Dsa_Pubkey="SureWareHook_Load_Dsa_Pubkey";
static const char *n_surewarehk_Free="SureWareHook_Free";
static const char *n_surewarehk_Rsa_Priv_Dec="SureWareHook_Rsa_Priv_Dec";
static const char *n_surewarehk_Rsa_Sign="SureWareHook_Rsa_Sign";
static const char *n_surewarehk_Dsa_Sign="SureWareHook_Dsa_Sign";
static const char *n_surewarehk_Mod_Exp="SureWareHook_Mod_Exp";
static BIO *logstream = NULL;
/* SureWareHook library functions and mechanics - these are used by the
* higher-level functions further down. NB: As and where there's no
* error checking, take a look lower down where these functions are
* called, the checking and error handling is probably down there.
*/
static int threadsafe=1;
static int surewarehk_ctrl(int cmd, long i, void *p, void (*f)())
{
int to_return = 1;
switch(cmd)
{
case ENGINE_CTRL_SET_LOGSTREAM:
{
BIO *bio = (BIO *)p;
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if (logstream)
{
BIO_free(logstream);
logstream = NULL;
}
if (CRYPTO_add(&bio->references,1,CRYPTO_LOCK_BIO) > 1)
logstream = bio;
else
ENGINEerr(ENGINE_F_SUREWAREHK_CTRL,ENGINE_R_BIO_WAS_FREED);
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
break;
/* This will prevent the initialisation function from "installing"
* the mutex-handling callbacks, even if they are available from
* within the library (or were provided to the library from the
* calling application). This is to remove any baggage for
* applications not using multithreading. */
case ENGINE_CTRL_CHIL_NO_LOCKING:
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
threadsafe = 0;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
break;
/* The command isn't understood by this engine */
default:
ENGINEerr(ENGINE_F_SUREWAREHK_CTRL,
ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED);
to_return = 0;
break;
}
return to_return;
}
/* (de)initialisation functions. */
static int surewarehk_init()
{
char msg[64]="ENGINE_init";
SureWareHook_Init_t *p1=NULL;
SureWareHook_Finish_t *p2=NULL;
SureWareHook_Rand_Bytes_t *p3=NULL;
SureWareHook_Rand_Seed_t *p4=NULL;
SureWareHook_Load_Privkey_t *p5=NULL;
SureWareHook_Load_Rsa_Pubkey_t *p6=NULL;
SureWareHook_Free_t *p7=NULL;
SureWareHook_Rsa_Priv_Dec_t *p8=NULL;
SureWareHook_Rsa_Sign_t *p9=NULL;
SureWareHook_Dsa_Sign_t *p12=NULL;
SureWareHook_Info_Pubkey_t *p13=NULL;
SureWareHook_Load_Dsa_Pubkey_t *p14=NULL;
SureWareHook_Mod_Exp_t *p15=NULL;
if(surewarehk_dso != NULL)
{
ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_ALREADY_LOADED);
goto err;
}
/* Attempt to load libsurewarehk.so/surewarehk.dll/whatever. */
surewarehk_dso = DSO_load(NULL, surewarehk_LIBNAME, NULL,
DSO_FLAG_NAME_TRANSLATION);
if(surewarehk_dso == NULL)
{
ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
if(!(p1=(SureWareHook_Init_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Init)) ||
!(p2=(SureWareHook_Finish_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Finish)) ||
!(p3=(SureWareHook_Rand_Bytes_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rand_Bytes)) ||
!(p4=(SureWareHook_Rand_Seed_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rand_Seed)) ||
!(p5=(SureWareHook_Load_Privkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Load_Privkey)) ||
!(p6=(SureWareHook_Load_Rsa_Pubkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Load_Rsa_Pubkey)) ||
!(p7=(SureWareHook_Free_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Free)) ||
!(p8=(SureWareHook_Rsa_Priv_Dec_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rsa_Priv_Dec)) ||
!(p9=(SureWareHook_Rsa_Sign_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rsa_Sign)) ||
!(p12=(SureWareHook_Dsa_Sign_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Dsa_Sign)) ||
!(p13=(SureWareHook_Info_Pubkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Info_Pubkey)) ||
!(p14=(SureWareHook_Load_Dsa_Pubkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Load_Dsa_Pubkey)) ||
!(p15=(SureWareHook_Mod_Exp_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Mod_Exp)))
{
ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
/* Copy the pointers */
p_surewarehk_Init = p1;
p_surewarehk_Finish = p2;
p_surewarehk_Rand_Bytes = p3;
p_surewarehk_Rand_Seed = p4;
p_surewarehk_Load_Privkey = p5;
p_surewarehk_Load_Rsa_Pubkey = p6;
p_surewarehk_Free = p7;
p_surewarehk_Rsa_Priv_Dec = p8;
p_surewarehk_Rsa_Sign = p9;
p_surewarehk_Dsa_Sign = p12;
p_surewarehk_Info_Pubkey = p13;
p_surewarehk_Load_Dsa_Pubkey = p14;
p_surewarehk_Mod_Exp = p15;
/* Contact the hardware and initialises it. */
if(p_surewarehk_Init(msg,threadsafe)==SUREWAREHOOK_ERROR_UNIT_FAILURE)
{
ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_UNIT_FAILURE);
goto err;
}
if(p_surewarehk_Init(msg,threadsafe)==SUREWAREHOOK_ERROR_UNIT_FAILURE)
{
ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_UNIT_FAILURE);
goto err;
}
/* try to load the default private key, if failed does not return a failure but
wait for an explicit ENGINE_load_privakey */
surewarehk_load_privkey(NULL,NULL);
/* Everything's fine. */
if (rsaHndidx == -1)
rsaHndidx = RSA_get_ex_new_index(0,
"SureWareHook RSA key handle",
NULL, NULL, surewarehk_ex_free);
if (dsaHndidx == -1)
dsaHndidx = DSA_get_ex_new_index(0,
"SureWareHook DSA key handle",
NULL, NULL, surewarehk_ex_free);
return 1;
err:
if(surewarehk_dso)
DSO_free(surewarehk_dso);
surewarehk_dso = NULL;
p_surewarehk_Init = NULL;
p_surewarehk_Finish = NULL;
p_surewarehk_Rand_Bytes = NULL;
p_surewarehk_Rand_Seed = NULL;
p_surewarehk_Load_Privkey = NULL;
p_surewarehk_Load_Rsa_Pubkey = NULL;
p_surewarehk_Free = NULL;
p_surewarehk_Rsa_Priv_Dec = NULL;
p_surewarehk_Rsa_Sign = NULL;
p_surewarehk_Dsa_Sign = NULL;
p_surewarehk_Info_Pubkey = NULL;
p_surewarehk_Load_Dsa_Pubkey = NULL;
p_surewarehk_Mod_Exp = NULL;
return 0;
}
static int surewarehk_finish()
{
int to_return = 1;
if(surewarehk_dso == NULL)
{
ENGINEerr(ENGINE_F_SUREWAREHK_FINISH,ENGINE_R_NOT_LOADED);
to_return = 0;
goto err;
}
p_surewarehk_Finish();
if(!DSO_free(surewarehk_dso))
{
ENGINEerr(ENGINE_F_SUREWAREHK_FINISH,ENGINE_R_DSO_FAILURE);
to_return = 0;
goto err;
}
err:
if (logstream)
BIO_free(logstream);
surewarehk_dso = NULL;
p_surewarehk_Init = NULL;
p_surewarehk_Finish = NULL;
p_surewarehk_Rand_Bytes = NULL;
p_surewarehk_Rand_Seed = NULL;
p_surewarehk_Load_Privkey = NULL;
p_surewarehk_Load_Rsa_Pubkey = NULL;
p_surewarehk_Free = NULL;
p_surewarehk_Rsa_Priv_Dec = NULL;
p_surewarehk_Rsa_Sign = NULL;
p_surewarehk_Dsa_Sign = NULL;
p_surewarehk_Info_Pubkey = NULL;
p_surewarehk_Load_Dsa_Pubkey = NULL;
p_surewarehk_Mod_Exp = NULL;
return to_return;
}
static void surewarehk_error_handling(char *const msg,int func,int ret)
{
switch (ret)
{
case SUREWAREHOOK_ERROR_UNIT_FAILURE:
ENGINEerr(func,ENGINE_R_UNIT_FAILURE);
break;
case SUREWAREHOOK_ERROR_FALLBACK:
ENGINEerr(func,ENGINE_R_REQUEST_FALLBACK);
break;
case SUREWAREHOOK_ERROR_DATA_SIZE:
ENGINEerr(func,ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
break;
case SUREWAREHOOK_ERROR_INVALID_PAD:
ENGINEerr(func,RSA_R_PADDING_CHECK_FAILED);
break;
default:
ENGINEerr(func,ENGINE_R_REQUEST_FAILED);
break;
case 1:/*nothing*/
msg[0]='\0';
}
if (*msg)
{
ERR_add_error_data(1,msg);
if (logstream)
{
CRYPTO_w_lock(CRYPTO_LOCK_BIO);
BIO_write(logstream, msg, strlen(msg));
CRYPTO_w_unlock(CRYPTO_LOCK_BIO);
}
}
}
static int surewarehk_rand_bytes(unsigned char *buf, int num)
{
int ret=0;
char msg[64]="ENGINE_rand_bytes";
if(!p_surewarehk_Rand_Bytes)
{
ENGINEerr(ENGINE_F_SUREWAREHK_RAND_BYTES,ENGINE_R_NOT_INITIALISED);
}
else
{
ret = p_surewarehk_Rand_Bytes(msg,buf, num);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RAND_BYTES,ret);
}
return ret==1 ? 1 : 0;
}
static void surewarehk_rand_seed(const void *buf, int num)
{
int ret=0;
char msg[64]="ENGINE_rand_seed";
if(!p_surewarehk_Rand_Seed)
{
ENGINEerr(ENGINE_F_SUREWAREHK_RAND_SEED,ENGINE_R_NOT_INITIALISED);
}
else
{
ret = p_surewarehk_Rand_Seed(msg,buf, num);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RAND_SEED,ret);
}
}
static void surewarehk_rand_add(const void *buf, int num, double entropy)
{
surewarehk_rand_seed(buf,num);
}
static EVP_PKEY* sureware_load_public(const char *key_id,char *hptr,unsigned long el,char keytype)
{
EVP_PKEY *res = NULL;
RSA *rsatmp = NULL;
DSA *dsatmp=NULL;
char msg[64]="sureware_load_public";
int ret=0;
if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
{
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);
goto err;
}
switch (keytype)
{
case 1: /*RSA*/
/* set private external reference */
rsatmp = RSA_new_method(&engine_surewarehk);
RSA_set_ex_data(rsatmp,rsaHndidx,hptr);
rsatmp->flags |= RSA_FLAG_EXT_PKEY;
/* set public big nums*/
rsatmp->e = BN_new();
rsatmp->n = BN_new();
bn_expand2(rsatmp->e, el/sizeof(BN_ULONG));
bn_expand2(rsatmp->n, el/sizeof(BN_ULONG));
if (!rsatmp->e || rsatmp->e->dmax!=(int)(el/sizeof(BN_ULONG))||
!rsatmp->n || rsatmp->n->dmax!=(int)(el/sizeof(BN_ULONG)))
goto err;
ret=p_surewarehk_Load_Rsa_Pubkey(msg,key_id,el,rsatmp->n->d, rsatmp->e->d);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);
if (ret!=1)
{
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
goto err;
}
/* normalise pub e and pub n */
rsatmp->e->top=el/sizeof(BN_ULONG);
bn_fix_top(rsatmp->e);
rsatmp->n->top=el/sizeof(BN_ULONG);
bn_fix_top(rsatmp->n);
/* create an EVP object: engine + rsa key */
res = EVP_PKEY_new();
EVP_PKEY_assign_RSA(res, rsatmp);
break;
case 2:/*DSA*/
/* set private/public external reference */
dsatmp = DSA_new_method(&engine_surewarehk);
DSA_set_ex_data(dsatmp,dsaHndidx,hptr);
/*dsatmp->flags |= DSA_FLAG_EXT_PKEY;*/
/* set public key*/
dsatmp->pub_key = BN_new();
dsatmp->p = BN_new();
dsatmp->q = BN_new();
dsatmp->g = BN_new();
bn_expand2(dsatmp->pub_key, el/sizeof(BN_ULONG));
bn_expand2(dsatmp->p, el/sizeof(BN_ULONG));
bn_expand2(dsatmp->q, 20/sizeof(BN_ULONG));
bn_expand2(dsatmp->g, el/sizeof(BN_ULONG));
if (!dsatmp->pub_key || dsatmp->pub_key->dmax!=(int)(el/sizeof(BN_ULONG))||
!dsatmp->p || dsatmp->p->dmax!=(int)(el/sizeof(BN_ULONG)) ||
!dsatmp->q || dsatmp->q->dmax!=20/sizeof(BN_ULONG) ||
!dsatmp->g || dsatmp->g->dmax!=(int)(el/sizeof(BN_ULONG)))
goto err;
ret=p_surewarehk_Load_Dsa_Pubkey(msg,key_id,el,
dsatmp->pub_key->d,
dsatmp->p->d,
dsatmp->q->d,
dsatmp->g->d);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);
if (ret!=1)
{
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
goto err;
}
/* set parameters */
/* normalise pubkey and parameters in case of */
dsatmp->pub_key->top=el/sizeof(BN_ULONG);
bn_fix_top(dsatmp->pub_key);
dsatmp->p->top=el/sizeof(BN_ULONG);
bn_fix_top(dsatmp->p);
dsatmp->q->top=20/sizeof(BN_ULONG);
bn_fix_top(dsatmp->q);
dsatmp->g->top=el/sizeof(BN_ULONG);
bn_fix_top(dsatmp->g);
/* create an EVP object: engine + rsa key */
res = EVP_PKEY_new();
EVP_PKEY_assign_DSA(res, dsatmp);
break;
default:
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
goto err;
}
return res;
err:
if (res)
EVP_PKEY_free(res);
if (rsatmp)
RSA_free(rsatmp);
if (dsatmp)
DSA_free(dsatmp);
return NULL;
}
static EVP_PKEY *surewarehk_load_privkey(const char *key_id,
const char *passphrase)
{
EVP_PKEY *res = NULL;
int ret=0;
unsigned long el=0;
char *hptr=NULL;
char keytype=0;
char msg[64]="ENGINE_load_privkey";
if(!p_surewarehk_Load_Privkey)
{
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_NOT_INITIALISED);
}
else
{
ret=p_surewarehk_Load_Privkey(msg,key_id,&hptr,&el,&keytype);
if (ret!=1)
{
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
ERR_add_error_data(1,msg);
}
else
res=sureware_load_public(key_id,hptr,el,keytype);
}
return res;
}
static EVP_PKEY *surewarehk_load_pubkey(const char *key_id,
const char *passphrase)
{
EVP_PKEY *res = NULL;
int ret=0;
unsigned long el=0;
char *hptr=NULL;
char keytype=0;
char msg[64]="ENGINE_load_pubkey";
if(!p_surewarehk_Info_Pubkey)
{
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);
}
else
{
/* call once to identify if DSA or RSA */
ret=p_surewarehk_Info_Pubkey(msg,key_id,&el,&keytype);
if (ret!=1)
{
ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
ERR_add_error_data(1,msg);
}
else
res=sureware_load_public(key_id,hptr,el,keytype);
}
return res;
}
/* This cleans up an RSA/DSA KM key(do not destroy the key into the hardware)
, called when ex_data is freed */
static void surewarehk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
int index,long argl, void *argp)
{
if(!p_surewarehk_Free)
{
ENGINEerr(ENGINE_F_SUREWAREHK_EX_FREE,ENGINE_R_NOT_INITIALISED);
}
else
p_surewarehk_Free((char *)item,0);
}
/* This cleans up an DH KM key (destroys the key into hardware),
called when ex_data is freed */
static void surewarehk_dh_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
int index,long argl, void *argp)
{
if(!p_surewarehk_Free)
{
ENGINEerr(ENGINE_F_SUREWAREHK_EX_FREE,ENGINE_R_NOT_INITIALISED);
}
else
p_surewarehk_Free((char *)item,1);
}
/*
* return number of decrypted bytes
*/
static int surewarehk_rsa_priv_dec(int flen,unsigned char *from,unsigned char *to,
RSA *rsa,int padding)
{
int ret=0,tlen;
char *buf=NULL,*hptr=NULL;
char msg[64]="ENGINE_rsa_priv_dec";
if (!p_surewarehk_Rsa_Priv_Dec)
{
ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ENGINE_R_NOT_INITIALISED);
}
/* extract ref to private key */
else if (!(hptr=RSA_get_ex_data(rsa, rsaHndidx)))
{
ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ENGINE_R_MISSING_KEY_COMPONENTS);
goto err;
}
/* analyse what padding we can do into the hardware */
if (padding==RSA_PKCS1_PADDING)
{
/* do it one shot */
ret=p_surewarehk_Rsa_Priv_Dec(msg,flen,from,&tlen,to,hptr,SUREWARE_PKCS1_PAD);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ret);
if (ret!=1)
goto err;
ret=tlen;
}
else /* do with no padding into hardware */
{
ret=p_surewarehk_Rsa_Priv_Dec(msg,flen,from,&tlen,to,hptr,SUREWARE_NO_PAD);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ret);
if (ret!=1)
goto err;
/* intermediate buffer for padding */
if ((buf=OPENSSL_malloc(tlen)) == NULL)
{
RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ERR_R_MALLOC_FAILURE);
goto err;
}
memcpy(buf,to,tlen);/* transfert to into buf */
switch (padding) /* check padding in software */
{
#ifndef NO_SHA
case RSA_PKCS1_OAEP_PADDING:
ret=RSA_padding_check_PKCS1_OAEP(to,tlen,(unsigned char *)buf,tlen,tlen,NULL,0);
break;
#endif
case RSA_SSLV23_PADDING:
ret=RSA_padding_check_SSLv23(to,tlen,(unsigned char *)buf,flen,tlen);
break;
case RSA_NO_PADDING:
ret=RSA_padding_check_none(to,tlen,(unsigned char *)buf,flen,tlen);
break;
default:
RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,RSA_R_UNKNOWN_PADDING_TYPE);
goto err;
}
if (ret < 0)
RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,RSA_R_PADDING_CHECK_FAILED);
}
err:
if (buf)
{
memset(buf,0,tlen);
OPENSSL_free(buf);
}
return ret;
}
/*
* Does what OpenSSL rsa_priv_enc does.
*/
static int surewarehk_rsa_sign(int flen,unsigned char *from,unsigned char *to,
RSA *rsa,int padding)
{
int ret=0,tlen;
char *hptr=NULL;
char msg[64]="ENGINE_rsa_sign";
if (!p_surewarehk_Rsa_Sign)
{
ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,ENGINE_R_NOT_INITIALISED);
}
/* extract ref to private key */
else if (!(hptr=RSA_get_ex_data(rsa, rsaHndidx)))
{
ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,ENGINE_R_MISSING_KEY_COMPONENTS);
}
else
{
switch (padding)
{
case RSA_PKCS1_PADDING: /* do it in one shot */
ret=p_surewarehk_Rsa_Sign(msg,flen,from,&tlen,to,hptr,SUREWARE_PKCS1_PAD);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,ret);
break;
case RSA_NO_PADDING:
default:
RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,RSA_R_UNKNOWN_PADDING_TYPE);
}
}
return ret==1 ? tlen : ret;
}
/* DSA sign and verify */
static DSA_SIG * surewarehk_dsa_do_sign(const unsigned char *from, int flen, DSA *dsa)
{
int ret=0;
char *hptr=NULL;
DSA_SIG *psign=NULL;
char msg[64]="ENGINE_dsa_do_sign";
if (!p_surewarehk_Dsa_Sign)
{
ENGINEerr(ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ENGINE_R_NOT_INITIALISED);
}
/* extract ref to private key */
else if (!(hptr=DSA_get_ex_data(dsa, dsaHndidx)))
{
ENGINEerr(ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ENGINE_R_MISSING_KEY_COMPONENTS);
}
else
{
if((psign = DSA_SIG_new()) == NULL)
{
ENGINEerr(ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ERR_R_MALLOC_FAILURE);
goto err;
}
psign->r=BN_new();
psign->s=BN_new();
bn_expand2(psign->r, 20/sizeof(BN_ULONG));
bn_expand2(psign->s, 20/sizeof(BN_ULONG));
if (!psign->r || psign->r->dmax!=20/sizeof(BN_ULONG) ||
!psign->s || psign->s->dmax!=20/sizeof(BN_ULONG))
goto err;
ret=p_surewarehk_Dsa_Sign(msg,flen,from,psign->r->d,psign->s->d,hptr);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ret);
}
psign->r->top=20/sizeof(BN_ULONG);
bn_fix_top(psign->r);
psign->s->top=20/sizeof(BN_ULONG);
bn_fix_top(psign->s);
err:
if (psign)
{
DSA_SIG_free(psign);
psign=NULL;
}
return psign;
}
static int surewarehk_modexp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx)
{
int ret=0;
char msg[64]="ENGINE_modexp";
if (!p_surewarehk_Mod_Exp)
{
ENGINEerr(ENGINE_F_SUREWAREHK_MOD_EXP,ENGINE_R_NOT_INITIALISED);
}
else
{
bn_expand2(r,m->top);
if (r && r->dmax==m->top)
{
/* do it*/
ret=p_surewarehk_Mod_Exp(msg,m->top*sizeof(BN_ULONG),m->d,p->top*sizeof(BN_ULONG),
p->d,a->top*sizeof(BN_ULONG),a->d,r->d);
surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_MOD_EXP,ret);
if (ret==1)
{
/* normalise result */
r->top=m->top;
bn_fix_top(r);
}
}
}
return ret;
}
#endif /* !NO_HW_SureWare */
#endif /* !NO_HW */

1057
crypto/engine/hw_ubsec.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,191 @@
/* This header declares the necessary definitions for using the exponentiation
* acceleration capabilities, and rnd number generation of the AEP card.
*
*/
/*
*
* Some AEP defines
*
*/
/*Successful return value*/
#define AEP_R_OK 0x00000000
/*Miscelleanous unsuccessful return value*/
#define AEP_R_GENERAL_ERROR 0x10000001
/*Insufficient host memory*/
#define AEP_R_HOST_MEMORY 0x10000002
#define AEP_R_FUNCTION_FAILED 0x10000006
/*Invalid arguments in function call*/
#define AEP_R_ARGUMENTS_BAD 0x10020000
#define AEP_R_NO_TARGET_RESOURCES 0x10030000
/*Error occuring on socket operation*/
#define AEP_R_SOCKERROR 0x10000010
/*Socket has been closed from the other end*/
#define AEP_R_SOCKEOF 0x10000011
/*Invalid handles*/
#define AEP_R_CONNECTION_HANDLE_INVALID 0x100000B3
#define AEP_R_TRANSACTION_HANDLE_INVALID 0x10040000
/*Transaction has not yet returned from accelerator*/
#define AEP_R_TRANSACTION_NOT_READY 0x00010000
/*There is already a thread waiting on this transaction*/
#define AEP_R_TRANSACTION_CLAIMED 0x10050000
/*The transaction timed out*/
#define AEP_R_TIMED_OUT 0x10060000
#define AEP_R_FXN_NOT_IMPLEMENTED 0x10070000
#define AEP_R_TARGET_ERROR 0x10080000
/*Error in the AEP daemon process*/
#define AEP_R_DAEMON_ERROR 0x10090000
/*Invalid ctx id*/
#define AEP_R_INVALID_CTX_ID 0x10009000
#define AEP_R_NO_KEY_MANAGER 0x1000a000
/*Error obtaining a mutex*/
#define AEP_R_MUTEX_BAD 0x000001A0
/*Fxn call before AEP_Initialise ot after AEP_Finialise*/
#define AEP_R_AEPAPI_NOT_INITIALIZED 0x10000190
/*AEP_Initialise has already been called*/
#define AEP_R_AEPAPI_ALREADY_INITIALIZED 0x10000191
/*Maximum number of connections to daemon reached*/
#define AEP_R_NO_MORE_CONNECTION_HNDLS 0x10000200
/*
*
* Some AEP Type definitions
*
*/
/* an unsigned 8-bit value */
typedef unsigned char AEP_U8;
/* an unsigned 8-bit character */
typedef char AEP_CHAR;
/* a BYTE-sized Boolean flag */
typedef AEP_U8 AEP_BBOOL;
/*Unsigned value, at least 16 bits long*/
typedef unsigned short AEP_U16;
/* an unsigned value, at least 32 bits long */
#ifdef SIXTY_FOUR_BIT_LONG
typedef unsigned int AEP_U32;
#else
typedef unsigned long AEP_U32;
#endif
#ifdef SIXTY_FOUR_BIT_LONG
typedef unsigned long AEP_U64;
#else
typedef struct { unsigned long l1, l2; } AEP_U64;
#endif
/* at least 32 bits; each bit is a Boolean flag */
typedef AEP_U32 AEP_FLAGS;
typedef AEP_U8 *AEP_U8_PTR;
typedef AEP_CHAR *AEP_CHAR_PTR;
typedef AEP_U32 *AEP_U32_PTR;
typedef AEP_U64 *AEP_U64_PTR;
typedef void *AEP_VOID_PTR;
/* Pointer to a AEP_VOID_PTR-- i.e., pointer to pointer to void */
typedef AEP_VOID_PTR *AEP_VOID_PTR_PTR;
/*Used to identify an AEP connection handle*/
typedef AEP_U32 AEP_CONNECTION_HNDL;
/*Pointer to an AEP connection handle*/
typedef AEP_CONNECTION_HNDL *AEP_CONNECTION_HNDL_PTR;
/*Used by an application (in conjunction with the apps process id) to
identify an individual transaction*/
typedef AEP_U32 AEP_TRANSACTION_ID;
/*Pointer to an applications transaction identifier*/
typedef AEP_TRANSACTION_ID *AEP_TRANSACTION_ID_PTR;
/*Return value type*/
typedef AEP_U32 AEP_RV;
#define MAX_PROCESS_CONNECTIONS 5
#define RAND_BLK_SIZE 1024
typedef enum{
NotConnected= 0,
Connected= 1,
InUse= 2
} AEP_CONNECTION_STATE;
typedef struct AEP_CONNECTION_ENTRY{
AEP_CONNECTION_STATE conn_state;
AEP_CONNECTION_HNDL conn_hndl;
} AEP_CONNECTION_ENTRY;
AEP_RV GetBigNumSize(void* ArbBigNum, AEP_U32* BigNumSize);
AEP_RV MakeAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum);
AEP_RV ConvertAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum);
typedef unsigned int t_AEP_OpenConnection(unsigned int *phConnection);
typedef unsigned int t_AEP_ModExp(unsigned int hConnection, void *a, void *p,
void *n, void *r,AEP_U64 *tranid);
typedef unsigned int t_AEP_ModExpCrt(unsigned int hConnection,void *a, void *p,
void *q, void *dmp1, void *dmq1,void *iqmp,
void *r,AEP_U64 *tranid);
typedef unsigned int t_AEP_GenRandom(AEP_CONNECTION_HNDL hConnection,
AEP_U32 Len,
AEP_U32 Type,
AEP_VOID_PTR pResult,
AEP_TRANSACTION_ID* pidTransID
);
typedef unsigned int t_AEP_Initialize(AEP_VOID_PTR pInitArgs);
typedef unsigned int t_AEP_Finalize();
typedef unsigned int t_AEP_SetBNCallBacks(
AEP_RV (*GetBigNumSizeFunc)(),
AEP_RV (*MakeAEPBigNumFunc)(),
AEP_RV (*ConverAEPBigNumFunc)()
);
/* These are the static string constants for the DSO file name and the function
* symbol names to bind to.
*/
static const char *AEP_LIBNAME = "aep";
static const char *AEP_F1 = "AEP_ModExp";
static const char *AEP_F2 = "AEP_ModExpCrt";
static const char *AEP_F3 = "AEP_GenRandom";
static const char *AEP_F4 = "AEP_Finalize";
static const char *AEP_F5 = "AEP_Initialize";
static const char *AEP_F6 = "AEP_OpenConnection";
static const char *AEP_F7 = "AEP_SetBNCallBacks";

View File

@@ -0,0 +1,105 @@
/******************************************************************************
*
* Copyright 2000
* Broadcom Corporation
* 16215 Alton Parkway
* PO Box 57013
* Irvine CA 92619-7013
*
*****************************************************************************/
/*
* Broadcom Corporation uBSec SDK
*/
/*
* Character device header file.
*/
/*
* Revision History:
*
* October 2000 JTT Created.
*/
#define MAX_PUBLIC_KEY_BITS (1024)
#define MAX_PUBLIC_KEY_BYTES (1024/8)
#define SHA_BIT_SIZE (160)
#define MAX_CRYPTO_KEY_LENGTH 24
#define MAX_MAC_KEY_LENGTH 64
#define UBSEC_CRYPTO_DEVICE_NAME ((unsigned char *)"/dev/ubscrypt")
#define UBSEC_KEY_DEVICE_NAME ((unsigned char *)"/dev/ubskey")
/* Math command types. */
#define UBSEC_MATH_MODADD 0x0001
#define UBSEC_MATH_MODSUB 0x0002
#define UBSEC_MATH_MODMUL 0x0004
#define UBSEC_MATH_MODEXP 0x0008
#define UBSEC_MATH_MODREM 0x0010
#define UBSEC_MATH_MODINV 0x0020
/* RNG command types. */
#define UBSEC_RNG_DIRECT 0x0001
#define UBSEC_RNG_SHA1 0x0002
typedef long ubsec_MathCommand_t;
typedef long ubsec_RNGCommand_t;
typedef struct ubsec_crypto_context_s {
unsigned int flags;
unsigned char crypto[MAX_CRYPTO_KEY_LENGTH];
unsigned char auth[MAX_MAC_KEY_LENGTH];
} ubsec_crypto_context_t, *ubsec_crypto_context_p;
/*
* Predeclare the function pointer types that we dynamically load from the DSO.
*/
typedef int t_UBSEC_ubsec_bytes_to_bits(unsigned char *n, int bytes);
typedef int t_UBSEC_ubsec_bits_to_bytes(int bits);
typedef int t_UBSEC_ubsec_open(unsigned char *device);
typedef int t_UBSEC_ubsec_close(int fd);
typedef int t_UBSEC_diffie_hellman_generate_ioctl (int fd,
unsigned char *x, int *x_len, unsigned char *y, int *y_len,
unsigned char *g, int g_len, unsigned char *m, int m_len,
unsigned char *userX, int userX_len, int random_bits);
typedef int t_UBSEC_diffie_hellman_agree_ioctl (int fd,
unsigned char *x, int x_len, unsigned char *y, int y_len,
unsigned char *m, int m_len, unsigned char *k, int *k_len);
typedef int t_UBSEC_rsa_mod_exp_ioctl (int fd,
unsigned char *x, int x_len, unsigned char *m, int m_len,
unsigned char *e, int e_len, unsigned char *y, int *y_len);
typedef int t_UBSEC_rsa_mod_exp_crt_ioctl (int fd,
unsigned char *x, int x_len, unsigned char *qinv, int qinv_len,
unsigned char *edq, int edq_len, unsigned char *q, int q_len,
unsigned char *edp, int edp_len, unsigned char *p, int p_len,
unsigned char *y, int *y_len);
typedef int t_UBSEC_dsa_sign_ioctl (int fd,
int hash, unsigned char *data, int data_len,
unsigned char *rndom, int random_len,
unsigned char *p, int p_len, unsigned char *q, int q_len,
unsigned char *g, int g_len, unsigned char *key, int key_len,
unsigned char *r, int *r_len, unsigned char *s, int *s_len);
typedef int t_UBSEC_dsa_verify_ioctl (int fd,
int hash, unsigned char *data, int data_len,
unsigned char *p, int p_len, unsigned char *q, int q_len,
unsigned char *g, int g_len, unsigned char *key, int key_len,
unsigned char *r, int r_len, unsigned char *s, int s_len,
unsigned char *v, int *v_len);
typedef int t_UBSEC_math_accelerate_ioctl(int fd, ubsec_MathCommand_t command,
unsigned char *ModN, int *ModN_len, unsigned char *ExpE, int *ExpE_len,
unsigned char *ParamA, int *ParamA_len, unsigned char *ParamB, int *ParamB_len,
unsigned char *Result, int *Result_len);
typedef int t_UBSEC_rng_ioctl(int fd, ubsec_RNGCommand_t command,
unsigned char *Result, int *Result_len);
typedef int t_UBSEC_max_key_len_ioctl(int fd, int *max_key_len);

View File

@@ -0,0 +1,214 @@
#ifndef HEADER_KEYCLIENT_H
#define HEADER_KEYCLIENT_H
/* Stop name-munging before it begins */
#ifdef __cplusplus
extern "C" {
#endif
/* This header is consistent with the "libclient" header but has been modified
* and pruned (esp. virtually all explanations and comments have gone) for
* inclusion in openssl. */
#if 0 /* Not used in openssl */
/* The obligatory nonsense associated with porting shared libraries to win32 */
#if defined(KSCLIENT_BUILD)
#define KC_INTERFACE __declspec(dllexport)
#elif defined(KSCLIENT_USE)
#define KC_INTERFACE __declspec(dllimport)
#else
#define KC_INTERFACE
#endif
#else
#define KC_INTERFACE
#endif
/*
* TYPES
*/
typedef struct _keyclient_ctx keyclient_ctx;
typedef struct _ctx_locking_table {
/* These functions return zero for failure. */
int (*ctx_lock)(const void *, unsigned int);
int (*ctx_unlock)(const void *, unsigned int);
} ctx_locking_table;
typedef struct _global_locking_table {
void (*lock)(void);
void (*unlock)(void);
} global_locking_table;
#define KC_MAX_PUBKEY_ASN 512 /* If the key doesn't fit, don't try */
typedef struct _keyclient_key_t {
enum {
KC_KEY_RSA = 0,
KC_KEY_DSA = 1
} key_type;
unsigned int der_len;
unsigned char der[KC_MAX_PUBKEY_ASN];
} keyclient_key_t;
/*
* ENUMS
*/
/* Different "operation" types */
typedef enum {
KC_FIRST_OP_INDEX = 0,
/* RSA operations */
KC_RSA_FIRST_OP = KC_FIRST_OP_INDEX,
KC_RSA_PUB_ENCRYPT = KC_RSA_FIRST_OP,
KC_RSA_PUB_DECRYPT,
KC_RSA_PRIV_ENCRYPT,
KC_RSA_PRIV_DECRYPT,
KC_RSA_SIGN,
KC_RSA_VERIFY,
KC_RSA_LAST_OP = KC_RSA_VERIFY,
/* DSA operations */
KC_DSA_FIRST_OP,
KC_DSA_SIGN = KC_DSA_FIRST_OP,
KC_DSA_VERIFY,
KC_DSA_LAST_OP = KC_DSA_VERIFY,
/* Round it out */
KC_LAST_OP_INDEX = KC_DSA_LAST_OP
} keyclient_op_t;
/* Different "padding" types */
typedef enum {
KC_FIRST_PAD_INDEX = 0,
/* No padding (works for RSA and DSA) */
KC_PADDING_NONE = KC_FIRST_PAD_INDEX,
KC_PADDING_DSA = KC_PADDING_NONE,
/* RSA padding schemes */
KC_PADDING_RSA_PKCS1,
KC_PADDING_RSA_SSLV23,
KC_PADDING_RSA_PKCS1_OAEP,
/* Round it out */
KC_LAST_PAD_INDEX = KC_PADDING_RSA_PKCS1_OAEP
} keyclient_pad_t;
/* Different "return" types */
typedef enum {
KC_RET_OK = 0,
KC_RET_ERR_INTERNAL, /* Bug */
KC_RET_ERR_BAD_ADDRESS, /* Bad address string */
KC_RET_ERR_NO_CONNECT, /* Can not connect to the address */
KC_RET_ERR_MEM, /* Memory error, insufficient space or some such */
KC_RET_ERR_REF_MISUSE, /* Reference count corruption */
KC_RET_ERR_INVALID_LOCKS, /* Caller provided inconsistent callbacks */
KC_RET_ERR_REQUEST_ENCODING, /* Error encoding the request */
KC_RET_ERR_RESPONSE_DECODING, /* Error decoding the response */
KC_RET_ERR_SELECT, /* Error in underlying select() call */
KC_RET_ERR_NETWORK_IO, /* Error in network I/O calls */
KC_RET_ERR_CTX_LOCK, /* lock() callback returned failure! */
KC_RET_ERR_CTX_UNLOCK, /* unlock() callback returned failure! */
KC_RET_ERR_REQUEST_SPACE, /* The request can not fit in the provided space */
KC_RET_ERR_RESULT_SPACE, /* The response can not fit in the provided space */
KC_RET_ERR_RESPONSE_MISMATCH, /* We received someone else's response? */
KC_RET_ERR_PRIVATE_EMBED, /* Cannot embed private keys in requests */
KC_RET_ERR_FLAG_COMBO, /* A bad combination of bitwise flags was used */
KC_RET_ERR_NULL1, /* Parameter 1 was NULL */
KC_RET_ERR_NULL2, /* Parameter 2 was NULL */
KC_RET_ERR_NULL3, /* Parameter 3 was NULL */
KC_RET_ERR_NULL4, /* Parameter 4 was NULL */
KC_RET_ERR_NULL5, /* Parameter 5 was NULL */
KC_RET_ERR_NULL6, /* Parameter 6 was NULL */
KC_RET_ERR_NULL7, /* Parameter 7 was NULL */
KC_RET_ERR_NULL8, /* Parameter 8 was NULL */
KC_RET_ERR_NON_NULL1, /* Parameter 1 was *not* NULL */
KC_RET_ERR_NON_NULL2, /* Parameter 2 was *not* NULL */
KC_RET_ERR_NON_NULL3, /* Parameter 3 was *not* NULL */
KC_RET_ERR_NON_NULL4, /* Parameter 4 was *not* NULL */
KC_RET_ERR_NON_NULL5, /* Parameter 5 was *not* NULL */
KC_RET_ERR_NON_NULL6, /* Parameter 6 was *not* NULL */
KC_RET_ERR_NON_NULL7, /* Parameter 7 was *not* NULL */
KC_RET_ERR_NON_NULL8, /* Parameter 8 was *not* NULL */
KC_RET_ERR_BAD_RANGE1, /* Parameter 1 was out of range */
KC_RET_ERR_BAD_RANGE2, /* Parameter 2 was out of range */
KC_RET_ERR_BAD_RANGE3, /* Parameter 3 was out of range */
KC_RET_ERR_BAD_RANGE4, /* Parameter 4 was out of range */
KC_RET_ERR_BAD_RANGE5, /* Parameter 5 was out of range */
KC_RET_ERR_BAD_RANGE6, /* Parameter 6 was out of range */
KC_RET_ERR_BAD_RANGE7, /* Parameter 7 was out of range */
KC_RET_ERR_BAD_RANGE8, /* Parameter 8 was out of range */
/* These errors are all "soft" - if keyclient_keyop() returns one of
* these values, then the operation completed successfully but the
* underlying payload of the response had its internal "error" value set
* to something other than KS_OP_ERR_OK. */
KC_RET_SOFT_UNKNOWN_OPERATION = 200, /* The keyserver doesn't support that */
KC_RET_SOFT_NO_SUCH_KEY, /* The keyserver doesn't have that key */
KC_RET_SOFT_NO_DATA, /* Data was required but was not supplied */
KC_RET_SOFT_OP_FAILED, /* The key operation on the server did not work */
KC_RET_SOFT_MISC /* An error that is not currently aliased was received */
} KC_RET;
/* Context flags (used in keyclient_create) */
#define KC_FLAG_USE_LOCKING 0x01
#define KC_FLAG_NO_LOCKING 0x02
#define KC_FLAG_PERSISTENT_CONN 0x04
#define KC_FLAG_PID_CHECK 0x08
#define KC_FLAG_PERSISTENT_RETRY 0x10
#define KC_FLAG_PERSISTENT_LATE 0x20
/*
* FUNCTIONS
*/
KC_INTERFACE KC_RET keyclient_set_global_locks(const global_locking_table *locking);
typedef KC_RET t_keyclient_set_global_locks(const global_locking_table *locking);
KC_INTERFACE KC_RET keyclient_create(keyclient_ctx **ctx, const char *target_string,
unsigned int flags, const ctx_locking_table *locking);
typedef KC_RET t_keyclient_create(keyclient_ctx **ctx, const char *target_string,
unsigned int flags, const ctx_locking_table *locking);
KC_INTERFACE KC_RET keyclient_release(keyclient_ctx *ctx);
typedef KC_RET t_keyclient_release(keyclient_ctx *ctx);
KC_INTERFACE KC_RET keyclient_dup(keyclient_ctx *ctx);
typedef KC_RET t_keyclient_dup(keyclient_ctx *ctx);
KC_INTERFACE KC_RET keyclient_get_uid(const keyclient_ctx *ctx, unsigned int *uid);
typedef KC_RET t_keyclient_get_uid(const keyclient_ctx *ctx, unsigned int *uid);
KC_INTERFACE KC_RET keyclient_keyop(keyclient_ctx *ctx, keyclient_op_t operation,
const unsigned char *data, unsigned int data_len,
unsigned char *result, unsigned int *result_len,
keyclient_pad_t padding, const unsigned char *keyhash);
typedef KC_RET t_keyclient_keyop(keyclient_ctx *ctx, keyclient_op_t operation,
const unsigned char *data, unsigned int data_len,
unsigned char *result, unsigned int *result_len,
keyclient_pad_t padding, const unsigned char *keyhash);
KC_INTERFACE KC_RET keyclient_pubkeyop(keyclient_ctx *ctx, keyclient_op_t operation,
const unsigned char *data, unsigned int data_len,
unsigned char *result, unsigned int *result_len,
keyclient_pad_t padding, const keyclient_key_t *pubkey);
typedef KC_RET t_keyclient_pubkeyop(keyclient_ctx *ctx, keyclient_op_t operation,
const unsigned char *data, unsigned int data_len,
unsigned char *result, unsigned int *result_len,
keyclient_pad_t padding, const keyclient_key_t *pubkey);
typedef struct _keyclient_symbol_table {
t_keyclient_set_global_locks *keyclient_set_global_locks;
t_keyclient_create *keyclient_create;
t_keyclient_release *keyclient_release;
t_keyclient_dup *keyclient_dup;
t_keyclient_get_uid *keyclient_get_uid;
t_keyclient_keyop *keyclient_keyop;
t_keyclient_pubkeyop *keyclient_pubkeyop;
} keyclient_symbol_table;
KC_INTERFACE void keyclient_bind_symbols(keyclient_symbol_table *funcs);
typedef void t_keyclient_bind_symbols(keyclient_symbol_table *funcs);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,239 @@
/*
* Written by Corinne Dive-Reclus(cdive@baltimore.com)
*
* Copyright@2001 Baltimore Technologies Ltd.
* *
* THIS FILE IS PROVIDED BY BALTIMORE TECHNOLOGIES ``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 BALTIMORE TECHNOLOGIES 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. *
*
*
*/
#ifdef WIN32
#define SW_EXPORT __declspec ( dllexport )
#else
#define SW_EXPORT
#endif
/*
* List of exposed SureWare errors
*/
#define SUREWAREHOOK_ERROR_FAILED -1
#define SUREWAREHOOK_ERROR_FALLBACK -2
#define SUREWAREHOOK_ERROR_UNIT_FAILURE -3
#define SUREWAREHOOK_ERROR_DATA_SIZE -4
#define SUREWAREHOOK_ERROR_INVALID_PAD -5
/*
* -----------------WARNING-----------------------------------
* In all the following functions:
* msg is a string with at least 24 bytes free.
* A 24 bytes string will be concatenated to the existing content of msg.
*/
/*
* SureWare Initialisation function
* in param threadsafe, if !=0, thread safe enabled
* return SureWareHOOK_ERROR_UNIT_FAILURE if failure, 1 if success
*/
typedef int SureWareHook_Init_t(char*const msg,int threadsafe);
extern SW_EXPORT SureWareHook_Init_t SureWareHook_Init;
/*
* SureWare Finish function
*/
typedef void SureWareHook_Finish_t();
extern SW_EXPORT SureWareHook_Finish_t SureWareHook_Finish;
/*
* PRE_CONDITION:
* DO NOT CALL ANY OF THE FOLLOWING FUNCTIONS IN CASE OF INIT FAILURE
*/
/*
* SureWare RAND Bytes function
* In case of failure, the content of buf is unpredictable.
* return 1 if success
* SureWareHOOK_ERROR_FALLBACK if function not available in hardware
* SureWareHOOK_ERROR_FAILED if error while processing
* SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
* SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
*
* in/out param buf : a num bytes long buffer where random bytes will be put
* in param num : the number of bytes into buf
*/
typedef int SureWareHook_Rand_Bytes_t(char*const msg,unsigned char *buf, int num);
extern SW_EXPORT SureWareHook_Rand_Bytes_t SureWareHook_Rand_Bytes;
/*
* SureWare RAND Seed function
* Adds some seed to the Hardware Random Number Generator
* return 1 if success
* SureWareHOOK_ERROR_FALLBACK if function not available in hardware
* SureWareHOOK_ERROR_FAILED if error while processing
* SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
* SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
*
* in param buf : the seed to add into the HRNG
* in param num : the number of bytes into buf
*/
typedef int SureWareHook_Rand_Seed_t(char*const msg,const void *buf, int num);
extern SW_EXPORT SureWareHook_Rand_Seed_t SureWareHook_Rand_Seed;
/*
* SureWare Load Private Key function
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* No hardware is contact for this function.
*
* in param key_id :the name of the private protected key file without the extension
".sws"
* out param hptr : a pointer to a buffer allocated by SureWare_Hook
* out param num: the effective key length in bytes
* out param keytype: 1 if RSA 2 if DSA
*/
typedef int SureWareHook_Load_Privkey_t(char*const msg,const char *key_id,char **hptr,unsigned long *num,char *keytype);
extern SW_EXPORT SureWareHook_Load_Privkey_t SureWareHook_Load_Privkey;
/*
* SureWare Info Public Key function
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* No hardware is contact for this function.
*
* in param key_id :the name of the private protected key file without the extension
".swp"
* out param hptr : a pointer to a buffer allocated by SureWare_Hook
* out param num: the effective key length in bytes
* out param keytype: 1 if RSA 2 if DSA
*/
typedef int SureWareHook_Info_Pubkey_t(char*const msg,const char *key_id,unsigned long *num,
char *keytype);
extern SW_EXPORT SureWareHook_Info_Pubkey_t SureWareHook_Info_Pubkey;
/*
* SureWare Load Public Key function
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* No hardware is contact for this function.
*
* in param key_id :the name of the public protected key file without the extension
".swp"
* in param num : the bytes size of n and e
* out param n: where to write modulus in bn format
* out param e: where to write exponent in bn format
*/
typedef int SureWareHook_Load_Rsa_Pubkey_t(char*const msg,const char *key_id,unsigned long num,
unsigned long *n, unsigned long *e);
extern SW_EXPORT SureWareHook_Load_Rsa_Pubkey_t SureWareHook_Load_Rsa_Pubkey;
/*
* SureWare Load DSA Public Key function
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* No hardware is contact for this function.
*
* in param key_id :the name of the public protected key file without the extension
".swp"
* in param num : the bytes size of n and e
* out param pub: where to write pub key in bn format
* out param p: where to write prime in bn format
* out param q: where to write sunprime (length 20 bytes) in bn format
* out param g: where to write base in bn format
*/
typedef int SureWareHook_Load_Dsa_Pubkey_t(char*const msg,const char *key_id,unsigned long num,
unsigned long *pub, unsigned long *p,unsigned long*q,
unsigned long *g);
extern SW_EXPORT SureWareHook_Load_Dsa_Pubkey_t SureWareHook_Load_Dsa_Pubkey;
/*
* SureWare Free function
* Destroy the key into the hardware if destroy==1
*/
typedef void SureWareHook_Free_t(char *p,int destroy);
extern SW_EXPORT SureWareHook_Free_t SureWareHook_Free;
#define SUREWARE_PKCS1_PAD 1
#define SUREWARE_ISO9796_PAD 2
#define SUREWARE_NO_PAD 0
/*
* SureWare RSA Private Decryption
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
* SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
*
* in param flen : byte size of from and to
* in param from : encrypted data buffer, should be a not-null valid pointer
* out param tlen: byte size of decrypted data, if error, unexpected value
* out param to : decrypted data buffer, should be a not-null valid pointer
* in param prsa: a protected key pointer, should be a not-null valid pointer
* int padding: padding id as follow
* SUREWARE_PKCS1_PAD
* SUREWARE_NO_PAD
*
*/
typedef int SureWareHook_Rsa_Priv_Dec_t(char*const msg,int flen,unsigned char *from,
int *tlen,unsigned char *to,
char *prsa,int padding);
extern SW_EXPORT SureWareHook_Rsa_Priv_Dec_t SureWareHook_Rsa_Priv_Dec;
/*
* SureWare RSA Signature
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
* SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
*
* in param flen : byte size of from and to
* in param from : encrypted data buffer, should be a not-null valid pointer
* out param tlen: byte size of decrypted data, if error, unexpected value
* out param to : decrypted data buffer, should be a not-null valid pointer
* in param prsa: a protected key pointer, should be a not-null valid pointer
* int padding: padding id as follow
* SUREWARE_PKCS1_PAD
* SUREWARE_ISO9796_PAD
*
*/
typedef int SureWareHook_Rsa_Sign_t(char*const msg,int flen,unsigned char *from,
int *tlen,unsigned char *to,
char *prsa,int padding);
extern SW_EXPORT SureWareHook_Rsa_Sign_t SureWareHook_Rsa_Sign;
/*
* SureWare DSA Signature
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
* SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
*
* in param flen : byte size of from and to
* in param from : encrypted data buffer, should be a not-null valid pointer
* out param to : decrypted data buffer, should be a 40bytes valid pointer
* in param pdsa: a protected key pointer, should be a not-null valid pointer
*
*/
typedef int SureWareHook_Dsa_Sign_t(char*const msg,int flen,const unsigned char *from,
unsigned long *r,unsigned long *s,char *pdsa);
extern SW_EXPORT SureWareHook_Dsa_Sign_t SureWareHook_Dsa_Sign;
/*
* SureWare Mod Exp
* return 1 if success
* SureWareHOOK_ERROR_FAILED if error while processing
* SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
* SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
*
* mod and res are mlen bytes long.
* exp is elen bytes long
* data is dlen bytes long
* mlen,elen and dlen are all multiple of sizeof(unsigned long)
*/
typedef int SureWareHook_Mod_Exp_t(char*const msg,int mlen,const unsigned long *mod,
int elen,const unsigned long *exp,
int dlen,unsigned long *data,
unsigned long *res);
extern SW_EXPORT SureWareHook_Mod_Exp_t SureWareHook_Mod_Exp;

View File

@@ -786,7 +786,7 @@ void ERR_add_error_data(int num, ...)
if (p == NULL)
{
OPENSSL_free(str);
return;
goto err;
}
else
str=p;
@@ -796,6 +796,7 @@ void ERR_add_error_data(int num, ...)
}
ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
err:
va_end(args);
}

View File

@@ -133,6 +133,7 @@ typedef struct err_state_st
#define ERR_LIB_RAND 36
#define ERR_LIB_DSO 37
#define ERR_LIB_ENGINE 38
#define ERR_LIB_COMP 41
#define ERR_LIB_USER 128
@@ -163,6 +164,7 @@ typedef struct err_state_st
#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),ERR_file_name,__LINE__)
#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),ERR_file_name,__LINE__)
#define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),ERR_file_name,__LINE__)
#define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),ERR_file_name,__LINE__)
/* Borland C seems too stupid to be able to shift and do longs in
* the pre-processor :-( */
@@ -213,6 +215,7 @@ typedef struct err_state_st
#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12
#define ERR_R_DSO_LIB ERR_LIB_DSO
#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE
#define ERR_R_COMP_LIB ERR_LIB_COMP
/* fatal error */
#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)

View File

@@ -465,7 +465,8 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
break;
case BIO_CTRL_WPENDING: /* More to write in buffer */
ret=ctx->buf_len-ctx->buf_off;
if ((ret == 0) && (ctx->base64.num != 0))
if ((ret == 0) && (ctx->encode != B64_NONE)
&& (ctx->base64.num != 0))
ret=1;
else if (ret <= 0)
ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
@@ -500,7 +501,7 @@ again:
goto again;
}
}
else if (ctx->base64.num != 0)
else if (ctx->encode != B64_NONE && ctx->base64.num != 0)
{
ctx->buf_off=0;
EVP_EncodeFinal(&(ctx->base64),

View File

@@ -603,8 +603,6 @@ int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
char *out, int *outl);
int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
void ERR_load_EVP_strings(void );
void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
@@ -777,6 +775,7 @@ void EVP_PBE_cleanup(void);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_EVP_strings(void);
/* Error codes for the EVP functions. */
@@ -849,4 +848,3 @@ void EVP_PBE_cleanup(void);
}
#endif
#endif

View File

@@ -66,7 +66,7 @@
static EVP_MD md4_md=
{
NID_md4,
0,
NID_md4WithRSAEncryption,
MD4_DIGEST_LENGTH,
MD4_Init,
MD4_Update,

View File

@@ -198,7 +198,7 @@
*
* <appro@fy.chalmers.se>
*/
# if defined(__i386)
# if defined(__i386) || defined(__i386__)
# define ROTATE(a,n) ({ register unsigned int ret; \
asm ( \
"roll %1,%0" \
@@ -224,7 +224,7 @@
*/
# if defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM) && !defined(NO_INLINE_ASM)
/* some GNU C inline assembler templates by <appro@fy.chalmers.se> */
# if defined(__i386) && !defined(I386_ONLY)
# if (defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)
# define BE_FETCH32(a) ({ register unsigned int l=(a);\
asm ( \
"bswapl %0" \

View File

@@ -68,7 +68,7 @@
void md4_block_host_order (MD4_CTX *c, const void *p,int num);
void md4_block_data_order (MD4_CTX *c, const void *p,int num);
#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
/*
* *_block_host_order is expected to handle aligned data while
* *_block_data_order - unaligned. As algorithm and host (x86)

View File

@@ -66,7 +66,7 @@
#endif
#ifdef MD5_ASM
# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
# define md5_block_host_order md5_block_asm_host_order
# elif defined(__sparc) && defined(ULTRASPARC)
void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,int num);
@@ -77,7 +77,7 @@
void md5_block_host_order (MD5_CTX *c, const void *p,int num);
void md5_block_data_order (MD5_CTX *c, const void *p,int num);
#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
/*
* *_block_host_order is expected to handle aligned data while
* *_block_data_order - unaligned. As algorithm and host (x86)

View File

@@ -43,6 +43,13 @@ lib: $(LIBOBJ)
- $(RANLIB) $(LIB)
@touch lib
obj_dat.h: obj_dat.pl obj_mac.h
perl obj_dat.pl obj_mac.h obj_dat.h
# objects.pl both reads and writes obj_mac.num
obj_mac.h: objects.pl objects.txt obj_mac.num
perl objects.pl objects.txt obj_mac.num obj_mac.h
files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO

View File

@@ -1,4 +1,10 @@
/* lib/obj/obj_dat.h */
/* crypto/objects/obj_dat.h */
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
* following command:
* perl obj_dat.pl objects.h obj_dat.h
*/
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -56,17 +62,12 @@
* [including the GNU Public Licence.]
*/
/* THIS FILE IS GENERATED FROM Objects.h by obj_dat.pl via the
* following command:
* perl obj_dat.pl objects.h obj_dat.h
*/
#define NUM_NID 404
#define NUM_SN 403
#define NUM_LN 403
#define NUM_OBJ 377
#define NUM_NID 393
#define NUM_SN 392
#define NUM_LN 392
#define NUM_OBJ 366
static unsigned char lvalues[2896]={
static unsigned char lvalues[2949]={
0x00, /* [ 0] OBJ_undef */
0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 1] OBJ_rsadsi */
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 7] OBJ_pkcs */
@@ -433,6 +434,17 @@ static unsigned char lvalues[2896]={
0xBA,0x82,0x58, /* [2872] OBJ_dcObject */
0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x19,/* [2875] OBJ_domainComponent */
0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0D,/* [2885] OBJ_Domain */
0x50, /* [2895] OBJ_joint_iso_ccitt */
0x55,0x01,0x05, /* [2896] OBJ_selected_attribute_types */
0x55,0x01,0x05,0x37, /* [2899] OBJ_clearance */
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x03,/* [2903] OBJ_md4WithRSAEncryption */
0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0A, /* [2912] OBJ_ac_proxying */
0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0B, /* [2920] OBJ_sinfo_access */
0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x06, /* [2928] OBJ_id_aca_encAttrs */
0x55,0x04,0x48, /* [2936] OBJ_role */
0x55,0x1D,0x24, /* [2939] OBJ_policy_constraints */
0x55,0x1D,0x37, /* [2942] OBJ_target_information */
0x55,0x1D,0x38, /* [2945] OBJ_no_rev_avail */
};
static ASN1_OBJECT nid_objs[NUM_NID]={
@@ -576,7 +588,8 @@ static ASN1_OBJECT nid_objs[NUM_NID]={
{"G","givenName",NID_givenName,3,&(lvalues[535]),0},
{"S","surname",NID_surname,3,&(lvalues[538]),0},
{"I","initials",NID_initials,3,&(lvalues[541]),0},
{"UID","uniqueIdentifier",NID_uniqueIdentifier,3,&(lvalues[544]),0},
{"uniqueIdentifier","uniqueIdentifier",NID_uniqueIdentifier,3,
&(lvalues[544]),0},
{"crlDistributionPoints","X509v3 CRL Distribution Points",
NID_crl_distribution_points,3,&(lvalues[547]),0},
{"RSA-NP-MD5","md5WithRSA",NID_md5WithRSA,5,&(lvalues[550]),0},
@@ -1045,6 +1058,25 @@ static ASN1_OBJECT nid_objs[NUM_NID]={
{"dcobject","dcObject",NID_dcObject,3,&(lvalues[2872]),0},
{"DC","domainComponent",NID_domainComponent,10,&(lvalues[2875]),0},
{"domain","Domain",NID_Domain,10,&(lvalues[2885]),0},
{"JOINT-ISO-CCITT","joint-iso-ccitt",NID_joint_iso_ccitt,1,
&(lvalues[2895]),0},
{"selected-attribute-types","Selected Attribute Types",
NID_selected_attribute_types,3,&(lvalues[2896]),0},
{"clearance","clearance",NID_clearance,4,&(lvalues[2899]),0},
{"RSA-MD4","md4WithRSAEncryption",NID_md4WithRSAEncryption,9,
&(lvalues[2903]),0},
{"ac-proxying","ac-proxying",NID_ac_proxying,8,&(lvalues[2912]),0},
{"subjectInfoAccess","Subject Information Access",NID_sinfo_access,8,
&(lvalues[2920]),0},
{"id-aca-encAttrs","id-aca-encAttrs",NID_id_aca_encAttrs,8,
&(lvalues[2928]),0},
{"role","role",NID_role,3,&(lvalues[2936]),0},
{"policyConstraints","X509v3 Policy Constraints",
NID_policy_constraints,3,&(lvalues[2939]),0},
{"targetInformation","X509v3 AC Targeting",NID_target_information,3,
&(lvalues[2942]),0},
{"noRevAvail","X509v3 No Revocation Available",NID_no_rev_avail,3,
&(lvalues[2945]),0},
};
static ASN1_OBJECT *sn_objs[NUM_SN]={
@@ -1093,6 +1125,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[46]),/* "IDEA-OFB" */
&(nid_objs[181]),/* "ISO" */
&(nid_objs[183]),/* "ISO-US" */
&(nid_objs[393]),/* "JOINT-ISO-CCITT" */
&(nid_objs[15]),/* "L" */
&(nid_objs[ 3]),/* "MD2" */
&(nid_objs[257]),/* "MD4" */
@@ -1138,6 +1171,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[124]),/* "RLE" */
&(nid_objs[19]),/* "RSA" */
&(nid_objs[ 7]),/* "RSA-MD2" */
&(nid_objs[396]),/* "RSA-MD4" */
&(nid_objs[ 8]),/* "RSA-MD5" */
&(nid_objs[96]),/* "RSA-MDC2" */
&(nid_objs[104]),/* "RSA-NP-MD5" */
@@ -1154,7 +1188,6 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[16]),/* "ST" */
&(nid_objs[143]),/* "SXNetID" */
&(nid_objs[106]),/* "T" */
&(nid_objs[102]),/* "UID" */
&(nid_objs[ 0]),/* "UNDEF" */
&(nid_objs[11]),/* "X500" */
&(nid_objs[378]),/* "X500algorithms" */
@@ -1164,6 +1197,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[125]),/* "ZLIB" */
&(nid_objs[289]),/* "aaControls" */
&(nid_objs[287]),/* "ac-auditEntity" */
&(nid_objs[397]),/* "ac-proxying" */
&(nid_objs[288]),/* "ac-targeting" */
&(nid_objs[368]),/* "acceptableResponses" */
&(nid_objs[363]),/* "ad_timestamping" */
@@ -1178,6 +1212,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[152]),/* "certBag" */
&(nid_objs[89]),/* "certificatePolicies" */
&(nid_objs[54]),/* "challengePassword" */
&(nid_objs[395]),/* "clearance" */
&(nid_objs[130]),/* "clientAuth" */
&(nid_objs[131]),/* "codeSigning" */
&(nid_objs[50]),/* "contentType" */
@@ -1204,6 +1239,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[355]),/* "id-aca-accessIdentity" */
&(nid_objs[354]),/* "id-aca-authenticationInfo" */
&(nid_objs[356]),/* "id-aca-chargingIdentity" */
&(nid_objs[399]),/* "id-aca-encAttrs" */
&(nid_objs[357]),/* "id-aca-group" */
&(nid_objs[358]),/* "id-aca-role" */
&(nid_objs[176]),/* "id-ad" */
@@ -1386,6 +1422,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[137]),/* "msSGC" */
&(nid_objs[173]),/* "name" */
&(nid_objs[369]),/* "noCheck" */
&(nid_objs[403]),/* "noRevAvail" */
&(nid_objs[72]),/* "nsBaseUrl" */
&(nid_objs[76]),/* "nsCaPolicyUrl" */
&(nid_objs[74]),/* "nsCaRevocationUrl" */
@@ -1413,9 +1450,11 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[22]),/* "pkcs7-signedData" */
&(nid_objs[151]),/* "pkcs8ShroudedKeyBag" */
&(nid_objs[47]),/* "pkcs9" */
&(nid_objs[401]),/* "policyConstraints" */
&(nid_objs[385]),/* "private" */
&(nid_objs[84]),/* "privateKeyUsagePeriod" */
&(nid_objs[286]),/* "qcStatements" */
&(nid_objs[400]),/* "role" */
&(nid_objs[ 6]),/* "rsaEncryption" */
&(nid_objs[377]),/* "rsaSignature" */
&(nid_objs[ 1]),/* "rsadsi" */
@@ -1426,15 +1465,19 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
&(nid_objs[159]),/* "sdsiCertificate" */
&(nid_objs[154]),/* "secretBag" */
&(nid_objs[386]),/* "security" */
&(nid_objs[394]),/* "selected-attribute-types" */
&(nid_objs[129]),/* "serverAuth" */
&(nid_objs[371]),/* "serviceLocator" */
&(nid_objs[52]),/* "signingTime" */
&(nid_objs[387]),/* "snmpv2" */
&(nid_objs[85]),/* "subjectAltName" */
&(nid_objs[398]),/* "subjectInfoAccess" */
&(nid_objs[82]),/* "subjectKeyIdentifier" */
&(nid_objs[402]),/* "targetInformation" */
&(nid_objs[293]),/* "textNotice" */
&(nid_objs[133]),/* "timeStamping" */
&(nid_objs[375]),/* "trustRoot" */
&(nid_objs[102]),/* "uniqueIdentifier" */
&(nid_objs[55]),/* "unstructuredAddress" */
&(nid_objs[49]),/* "unstructuredName" */
&(nid_objs[373]),/* "valid" */
@@ -1503,12 +1546,15 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
&(nid_objs[167]),/* "S/MIME Capabilities" */
&(nid_objs[387]),/* "SNMPv2" */
&(nid_objs[386]),/* "Security" */
&(nid_objs[394]),/* "Selected Attribute Types" */
&(nid_objs[143]),/* "Strong Extranet ID" */
&(nid_objs[398]),/* "Subject Information Access" */
&(nid_objs[130]),/* "TLS Web Client Authentication" */
&(nid_objs[129]),/* "TLS Web Server Authentication" */
&(nid_objs[133]),/* "Time Stamping" */
&(nid_objs[375]),/* "Trust Root" */
&(nid_objs[12]),/* "X509" */
&(nid_objs[402]),/* "X509v3 AC Targeting" */
&(nid_objs[90]),/* "X509v3 Authority Key Identifier" */
&(nid_objs[87]),/* "X509v3 Basic Constraints" */
&(nid_objs[103]),/* "X509v3 CRL Distribution Points" */
@@ -1519,6 +1565,8 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
&(nid_objs[126]),/* "X509v3 Extended Key Usage" */
&(nid_objs[86]),/* "X509v3 Issuer Alternative Name" */
&(nid_objs[83]),/* "X509v3 Key Usage" */
&(nid_objs[403]),/* "X509v3 No Revocation Available" */
&(nid_objs[401]),/* "X509v3 Policy Constraints" */
&(nid_objs[84]),/* "X509v3 Private Key Usage Period" */
&(nid_objs[85]),/* "X509v3 Subject Alternative Name" */
&(nid_objs[82]),/* "X509v3 Subject Key Identifier" */
@@ -1526,6 +1574,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
&(nid_objs[185]),/* "X9.57 CM ?" */
&(nid_objs[289]),/* "aaControls" */
&(nid_objs[287]),/* "ac-auditEntity" */
&(nid_objs[397]),/* "ac-proxying" */
&(nid_objs[288]),/* "ac-targeting" */
&(nid_objs[364]),/* "ad dvcs" */
&(nid_objs[376]),/* "algorithm" */
@@ -1539,6 +1588,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
&(nid_objs[111]),/* "cast5-ofb" */
&(nid_objs[152]),/* "certBag" */
&(nid_objs[54]),/* "challengePassword" */
&(nid_objs[395]),/* "clearance" */
&(nid_objs[13]),/* "commonName" */
&(nid_objs[50]),/* "contentType" */
&(nid_objs[53]),/* "countersignature" */
@@ -1581,6 +1631,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
&(nid_objs[355]),/* "id-aca-accessIdentity" */
&(nid_objs[354]),/* "id-aca-authenticationInfo" */
&(nid_objs[356]),/* "id-aca-chargingIdentity" */
&(nid_objs[399]),/* "id-aca-encAttrs" */
&(nid_objs[357]),/* "id-aca-group" */
&(nid_objs[358]),/* "id-aca-role" */
&(nid_objs[176]),/* "id-ad" */
@@ -1747,12 +1798,14 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
&(nid_objs[46]),/* "idea-ofb" */
&(nid_objs[101]),/* "initials" */
&(nid_objs[181]),/* "iso" */
&(nid_objs[393]),/* "joint-iso-ccitt" */
&(nid_objs[150]),/* "keyBag" */
&(nid_objs[157]),/* "localKeyID" */
&(nid_objs[15]),/* "localityName" */
&(nid_objs[ 3]),/* "md2" */
&(nid_objs[ 7]),/* "md2WithRSAEncryption" */
&(nid_objs[257]),/* "md4" */
&(nid_objs[396]),/* "md4WithRSAEncryption" */
&(nid_objs[ 4]),/* "md5" */
&(nid_objs[114]),/* "md5-sha1" */
&(nid_objs[104]),/* "md5WithRSA" */
@@ -1806,6 +1859,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
&(nid_objs[123]),/* "rc5-ofb" */
&(nid_objs[117]),/* "ripemd160" */
&(nid_objs[119]),/* "ripemd160WithRSA" */
&(nid_objs[400]),/* "role" */
&(nid_objs[19]),/* "rsa" */
&(nid_objs[ 6]),/* "rsaEncryption" */
&(nid_objs[377]),/* "rsaSignature" */
@@ -1843,6 +1897,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[181]),/* OBJ_iso 1 */
&(nid_objs[182]),/* OBJ_member_body 1 2 */
&(nid_objs[379]),/* OBJ_org 1 3 */
&(nid_objs[393]),/* OBJ_joint_iso_ccitt 2 */
&(nid_objs[11]),/* OBJ_X500 2 5 */
&(nid_objs[380]),/* OBJ_dod 1 3 6 */
&(nid_objs[12]),/* OBJ_X509 2 5 4 */
@@ -1850,6 +1905,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[81]),/* OBJ_id_ce 2 5 29 */
&(nid_objs[183]),/* OBJ_ISO_US 1 2 840 */
&(nid_objs[381]),/* OBJ_iana 1 3 6 1 */
&(nid_objs[394]),/* OBJ_selected_attribute_types 2 5 1 5 */
&(nid_objs[13]),/* OBJ_commonName 2 5 4 3 */
&(nid_objs[100]),/* OBJ_surname 2 5 4 4 */
&(nid_objs[105]),/* OBJ_serialNumber 2 5 4 5 */
@@ -1865,6 +1921,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[101]),/* OBJ_initials 2 5 4 43 */
&(nid_objs[102]),/* OBJ_uniqueIdentifier 2 5 4 45 */
&(nid_objs[174]),/* OBJ_dnQualifier 2 5 4 46 */
&(nid_objs[400]),/* OBJ_role 2 5 4 72 */
&(nid_objs[82]),/* OBJ_subject_key_identifier 2 5 29 14 */
&(nid_objs[83]),/* OBJ_key_usage 2 5 29 15 */
&(nid_objs[84]),/* OBJ_private_key_usage_period 2 5 29 16 */
@@ -1878,7 +1935,10 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[103]),/* OBJ_crl_distribution_points 2 5 29 31 */
&(nid_objs[89]),/* OBJ_certificate_policies 2 5 29 32 */
&(nid_objs[90]),/* OBJ_authority_key_identifier 2 5 29 35 */
&(nid_objs[401]),/* OBJ_policy_constraints 2 5 29 36 */
&(nid_objs[126]),/* OBJ_ext_key_usage 2 5 29 37 */
&(nid_objs[402]),/* OBJ_target_information 2 5 29 55 */
&(nid_objs[403]),/* OBJ_no_rev_avail 2 5 29 56 */
&(nid_objs[390]),/* OBJ_dcObject 1466 344 */
&(nid_objs[382]),/* OBJ_Directory 1 3 6 1 1 */
&(nid_objs[383]),/* OBJ_Management 1 3 6 1 2 */
@@ -1888,6 +1948,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[387]),/* OBJ_SNMPv2 1 3 6 1 6 */
&(nid_objs[388]),/* OBJ_Mail 1 3 6 1 7 */
&(nid_objs[376]),/* OBJ_algorithm 1 3 14 3 2 */
&(nid_objs[395]),/* OBJ_clearance 2 5 1 5 55 */
&(nid_objs[19]),/* OBJ_rsa 2 5 8 1 1 */
&(nid_objs[96]),/* OBJ_mdc2WithRSA 2 5 8 3 100 */
&(nid_objs[95]),/* OBJ_mdc2 2 5 8 3 101 */
@@ -1970,6 +2031,8 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[290]),/* OBJ_sbqp_ipAddrBlock 1 3 6 1 5 5 7 1 7 */
&(nid_objs[291]),/* OBJ_sbqp_autonomousSysNum 1 3 6 1 5 5 7 1 8 */
&(nid_objs[292]),/* OBJ_sbqp_routerIdentifier 1 3 6 1 5 5 7 1 9 */
&(nid_objs[397]),/* OBJ_ac_proxying 1 3 6 1 5 5 7 1 10 */
&(nid_objs[398]),/* OBJ_sinfo_access 1 3 6 1 5 5 7 1 11 */
&(nid_objs[164]),/* OBJ_id_qt_cps 1 3 6 1 5 5 7 2 1 */
&(nid_objs[165]),/* OBJ_id_qt_unotice 1 3 6 1 5 5 7 2 2 */
&(nid_objs[293]),/* OBJ_textNotice 1 3 6 1 5 5 7 2 3 */
@@ -2036,6 +2099,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[356]),/* OBJ_id_aca_chargingIdentity 1 3 6 1 5 5 7 10 3 */
&(nid_objs[357]),/* OBJ_id_aca_group 1 3 6 1 5 5 7 10 4 */
&(nid_objs[358]),/* OBJ_id_aca_role 1 3 6 1 5 5 7 10 5 */
&(nid_objs[399]),/* OBJ_id_aca_encAttrs 1 3 6 1 5 5 7 10 6 */
&(nid_objs[359]),/* OBJ_id_qcs_pkixQCSyntax_v1 1 3 6 1 5 5 7 11 1 */
&(nid_objs[360]),/* OBJ_id_cct_crs 1 3 6 1 5 5 7 12 1 */
&(nid_objs[361]),/* OBJ_id_cct_PKIData 1 3 6 1 5 5 7 12 2 */
@@ -2050,6 +2114,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[112]),/* OBJ_pbeWithMD5AndCast5_CBC 1 2 840 113533 7 66 12 */
&(nid_objs[ 6]),/* OBJ_rsaEncryption 1 2 840 113549 1 1 1 */
&(nid_objs[ 7]),/* OBJ_md2WithRSAEncryption 1 2 840 113549 1 1 2 */
&(nid_objs[396]),/* OBJ_md4WithRSAEncryption 1 2 840 113549 1 1 3 */
&(nid_objs[ 8]),/* OBJ_md5WithRSAEncryption 1 2 840 113549 1 1 4 */
&(nid_objs[65]),/* OBJ_sha1WithRSAEncryption 1 2 840 113549 1 1 5 */
&(nid_objs[28]),/* OBJ_dhKeyAgreement 1 2 840 113549 1 3 1 */

View File

@@ -164,7 +164,13 @@ foreach (sort obj_cmp @a)
}
print OUT <<'EOF';
/* lib/obj/obj_dat.h */
/* crypto/objects/obj_dat.h */
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
* following command:
* perl obj_dat.pl objects.h obj_dat.h
*/
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -222,11 +228,6 @@ print OUT <<'EOF';
* [including the GNU Public Licence.]
*/
/* THIS FILE IS GENERATED FROM Objects.h by obj_dat.pl via the
* following command:
* perl obj_dat.pl objects.h obj_dat.h
*/
EOF
printf OUT "#define NUM_NID %d\n",$n;

View File

@@ -1,4 +1,10 @@
/* lib/obj/obj_mac.h */
/* crypto/objects/obj_mac.h */
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
* following command:
* perl objects.pl objects.txt obj_mac.num obj_mac.h
*/
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -56,11 +62,6 @@
* [including the GNU Public Licence.]
*/
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
* following command:
* perl objects.pl objects.txt obj_mac.num obj_mac.h
*/
#define SN_undef "UNDEF"
#define LN_undef "undefined"
#define NID_undef 0
@@ -71,11 +72,25 @@
#define NID_iso 181
#define OBJ_iso 1L
#define SN_joint_iso_ccitt "JOINT-ISO-CCITT"
#define LN_joint_iso_ccitt "joint-iso-ccitt"
#define NID_joint_iso_ccitt 393
#define OBJ_joint_iso_ccitt 2L
#define SN_member_body "member-body"
#define LN_member_body "ISO Member Body"
#define NID_member_body 182
#define OBJ_member_body OBJ_iso,2L
#define SN_selected_attribute_types "selected-attribute-types"
#define LN_selected_attribute_types "Selected Attribute Types"
#define NID_selected_attribute_types 394
#define OBJ_selected_attribute_types OBJ_joint_iso_ccitt,5L,1L,5L
#define SN_clearance "clearance"
#define NID_clearance 395
#define OBJ_clearance OBJ_selected_attribute_types,55L
#define SN_ISO_US "ISO-US"
#define LN_ISO_US "ISO US Member Body"
#define NID_ISO_US 183
@@ -145,6 +160,11 @@
#define NID_md2WithRSAEncryption 7
#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L
#define SN_md4WithRSAEncryption "RSA-MD4"
#define LN_md4WithRSAEncryption "md4WithRSAEncryption"
#define NID_md4WithRSAEncryption 396
#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L
#define SN_md5WithRSAEncryption "RSA-MD5"
#define LN_md5WithRSAEncryption "md5WithRSAEncryption"
#define NID_md5WithRSAEncryption 8
@@ -956,6 +976,15 @@
#define NID_sbqp_routerIdentifier 292
#define OBJ_sbqp_routerIdentifier OBJ_id_pe,9L
#define SN_ac_proxying "ac-proxying"
#define NID_ac_proxying 397
#define OBJ_ac_proxying OBJ_id_pe,10L
#define SN_sinfo_access "subjectInfoAccess"
#define LN_sinfo_access "Subject Information Access"
#define NID_sinfo_access 398
#define OBJ_sinfo_access OBJ_id_pe,11L
#define SN_id_qt_cps "id-qt-cps"
#define LN_id_qt_cps "Policy Qualifier CPS"
#define NID_id_qt_cps 164
@@ -1264,6 +1293,10 @@
#define NID_id_aca_role 358
#define OBJ_id_aca_role OBJ_id_aca,5L
#define SN_id_aca_encAttrs "id-aca-encAttrs"
#define NID_id_aca_encAttrs 399
#define OBJ_id_aca_encAttrs OBJ_id_aca,6L
#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1"
#define NID_id_qcs_pkixQCSyntax_v1 359
#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L
@@ -1545,7 +1578,6 @@
#define NID_initials 101
#define OBJ_initials OBJ_X509,43L
#define SN_uniqueIdentifier "UID"
#define LN_uniqueIdentifier "uniqueIdentifier"
#define NID_uniqueIdentifier 102
#define OBJ_uniqueIdentifier OBJ_X509,45L
@@ -1555,6 +1587,11 @@
#define NID_dnQualifier 174
#define OBJ_dnQualifier OBJ_X509,46L
#define SN_role "role"
#define LN_role "role"
#define NID_role 400
#define OBJ_role OBJ_X509,72L
#define SN_X500algorithms "X500algorithms"
#define LN_X500algorithms "directory services - algorithms"
#define NID_X500algorithms 378
@@ -1644,11 +1681,26 @@
#define NID_authority_key_identifier 90
#define OBJ_authority_key_identifier OBJ_id_ce,35L
#define SN_policy_constraints "policyConstraints"
#define LN_policy_constraints "X509v3 Policy Constraints"
#define NID_policy_constraints 401
#define OBJ_policy_constraints OBJ_id_ce,36L
#define SN_ext_key_usage "extendedKeyUsage"
#define LN_ext_key_usage "X509v3 Extended Key Usage"
#define NID_ext_key_usage 126
#define OBJ_ext_key_usage OBJ_id_ce,37L
#define SN_target_information "targetInformation"
#define LN_target_information "X509v3 AC Targeting"
#define NID_target_information 402
#define OBJ_target_information OBJ_id_ce,55L
#define SN_no_rev_avail "noRevAvail"
#define LN_no_rev_avail "X509v3 No Revocation Available"
#define NID_no_rev_avail 403
#define OBJ_no_rev_avail OBJ_id_ce,56L
#define SN_netscape "Netscape"
#define LN_netscape "Netscape Communications Corp."
#define NID_netscape 57

View File

@@ -390,3 +390,14 @@ Enterprises 389
dcObject 390
domainComponent 391
Domain 392
joint_iso_ccitt 393
selected_attribute_types 394
clearance 395
md4WithRSAEncryption 396
ac_proxying 397
sinfo_access 398
id_aca_encAttrs 399
role 400
policy_constraints 401
target_information 402
no_rev_avail 403

View File

@@ -452,54 +452,54 @@
#define LN_desx_cbc "desx-cbc"
#define NID_desx_cbc 80
#define SN_ld_ce "ld-ce"
#define NID_ld_ce 81
#define OBJ_ld_ce 2L,5L,29L
#define SN_id_ce "id-ce"
#define NID_id_ce 81
#define OBJ_id_ce 2L,5L,29L
#define SN_subject_key_identifier "subjectKeyIdentifier"
#define LN_subject_key_identifier "X509v3 Subject Key Identifier"
#define NID_subject_key_identifier 82
#define OBJ_subject_key_identifier OBJ_ld_ce,14L
#define OBJ_subject_key_identifier OBJ_id_ce,14L
#define SN_key_usage "keyUsage"
#define LN_key_usage "X509v3 Key Usage"
#define NID_key_usage 83
#define OBJ_key_usage OBJ_ld_ce,15L
#define OBJ_key_usage OBJ_id_ce,15L
#define SN_private_key_usage_period "privateKeyUsagePeriod"
#define LN_private_key_usage_period "X509v3 Private Key Usage Period"
#define NID_private_key_usage_period 84
#define OBJ_private_key_usage_period OBJ_ld_ce,16L
#define OBJ_private_key_usage_period OBJ_id_ce,16L
#define SN_subject_alt_name "subjectAltName"
#define LN_subject_alt_name "X509v3 Subject Alternative Name"
#define NID_subject_alt_name 85
#define OBJ_subject_alt_name OBJ_ld_ce,17L
#define OBJ_subject_alt_name OBJ_id_ce,17L
#define SN_issuer_alt_name "issuerAltName"
#define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
#define NID_issuer_alt_name 86
#define OBJ_issuer_alt_name OBJ_ld_ce,18L
#define OBJ_issuer_alt_name OBJ_id_ce,18L
#define SN_basic_constraints "basicConstraints"
#define LN_basic_constraints "X509v3 Basic Constraints"
#define NID_basic_constraints 87
#define OBJ_basic_constraints OBJ_ld_ce,19L
#define OBJ_basic_constraints OBJ_id_ce,19L
#define SN_crl_number "crlNumber"
#define LN_crl_number "X509v3 CRL Number"
#define NID_crl_number 88
#define OBJ_crl_number OBJ_ld_ce,20L
#define OBJ_crl_number OBJ_id_ce,20L
#define SN_certificate_policies "certificatePolicies"
#define LN_certificate_policies "X509v3 Certificate Policies"
#define NID_certificate_policies 89
#define OBJ_certificate_policies OBJ_ld_ce,32L
#define OBJ_certificate_policies OBJ_id_ce,32L
#define SN_authority_key_identifier "authorityKeyIdentifier"
#define LN_authority_key_identifier "X509v3 Authority Key Identifier"
#define NID_authority_key_identifier 90
#define OBJ_authority_key_identifier OBJ_ld_ce,35L
#define OBJ_authority_key_identifier OBJ_id_ce,35L
#define SN_bf_cbc "BF-CBC"
#define LN_bf_cbc "bf-cbc"
@@ -560,7 +560,7 @@
#define SN_crl_distribution_points "crlDistributionPoints"
#define LN_crl_distribution_points "X509v3 CRL Distribution Points"
#define NID_crl_distribution_points 103
#define OBJ_crl_distribution_points OBJ_ld_ce,31L
#define OBJ_crl_distribution_points OBJ_id_ce,31L
#define SN_md5WithRSA "RSA-NP-MD5"
#define LN_md5WithRSA "md5WithRSA"
@@ -677,7 +677,7 @@
#define SN_ext_key_usage "extendedKeyUsage"
#define LN_ext_key_usage "X509v3 Extended Key Usage"
#define NID_ext_key_usage 126
#define OBJ_ext_key_usage OBJ_ld_ce,37
#define OBJ_ext_key_usage OBJ_id_ce,37
#define SN_id_pkix "PKIX"
#define NID_id_pkix 127
@@ -751,17 +751,17 @@
#define SN_delta_crl "deltaCRL"
#define LN_delta_crl "X509v3 Delta CRL Indicator"
#define NID_delta_crl 140
#define OBJ_delta_crl OBJ_ld_ce,27L
#define OBJ_delta_crl OBJ_id_ce,27L
#define SN_crl_reason "CRLReason"
#define LN_crl_reason "CRL Reason Code"
#define NID_crl_reason 141
#define OBJ_crl_reason OBJ_ld_ce,21L
#define OBJ_crl_reason OBJ_id_ce,21L
#define SN_invalidity_date "invalidityDate"
#define LN_invalidity_date "Invalidity Date"
#define NID_invalidity_date 142
#define OBJ_invalidity_date OBJ_ld_ce,24L
#define OBJ_invalidity_date OBJ_id_ce,24L
#define SN_sxnet "SXNetID"
#define LN_sxnet "Strong Extranet ID"
@@ -1005,8 +1005,6 @@ int OBJ_sn2nid(const char *s);
int OBJ_cmp(ASN1_OBJECT *a,ASN1_OBJECT *b);
char * OBJ_bsearch(char *key,char *base,int num,int size,int (*cmp)(const void *, const void *));
void ERR_load_OBJ_strings(void );
int OBJ_new_nid(int num);
int OBJ_add_object(ASN1_OBJECT *obj);
int OBJ_create(char *oid,char *sn,char *ln);
@@ -1017,6 +1015,7 @@ int OBJ_create_objects(BIO *in);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_OBJ_strings(void);
/* Error codes for the OBJ functions. */
@@ -1035,4 +1034,3 @@ int OBJ_create_objects(BIO *in);
}
#endif
#endif

View File

@@ -114,7 +114,13 @@ close NUMOUT;
open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
print OUT <<'EOF';
/* lib/obj/obj_mac.h */
/* crypto/objects/obj_mac.h */
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
* following command:
* perl objects.pl objects.txt obj_mac.num obj_mac.h
*/
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -172,11 +178,6 @@ print OUT <<'EOF';
* [including the GNU Public Licence.]
*/
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
* following command:
* perl objects.pl objects.txt obj_mac.num obj_mac.h
*/
#define SN_undef "UNDEF"
#define LN_undef "undefined"
#define NID_undef 0

View File

@@ -1,7 +1,13 @@
1 : ISO : iso
2 : JOINT-ISO-CCITT : joint-iso-ccitt
iso 2 : member-body : ISO Member Body
joint-iso-ccitt 5 1 5 : selected-attribute-types : Selected Attribute Types
selected-attribute-types 55 : clearance
member-body 840 : ISO-US : ISO US Member Body
ISO-US 10040 : X9-57 : X9.57
X9-57 4 : X9cm : X9.57 CM ?
@@ -26,6 +32,7 @@ rsadsi 1 : pkcs : RSA Data Security, Inc. PKCS
pkcs 1 : pkcs1
pkcs1 1 : : rsaEncryption
pkcs1 2 : RSA-MD2 : md2WithRSAEncryption
pkcs1 3 : RSA-MD4 : md4WithRSAEncryption
pkcs1 4 : RSA-MD5 : md5WithRSAEncryption
pkcs1 5 : RSA-SHA1 : sha1WithRSAEncryption
@@ -302,6 +309,9 @@ id-pe 6 : aaControls
id-pe 7 : sbqp-ipAddrBlock
id-pe 8 : sbqp-autonomousSysNum
id-pe 9 : sbqp-routerIdentifier
id-pe 10 : ac-proxying
!Cname sinfo-access
id-pe 11 : subjectInfoAccess : Subject Information Access
# PKIX policyQualifiers for Internet policy qualifiers
id-qt 1 : id-qt-cps : Policy Qualifier CPS
@@ -406,7 +416,9 @@ id-aca 1 : id-aca-authenticationInfo
id-aca 2 : id-aca-accessIdentity
id-aca 3 : id-aca-chargingIdentity
id-aca 4 : id-aca-group
# attention : the following seems to be obsolete, replace by 'role'
id-aca 5 : id-aca-role
id-aca 6 : id-aca-encAttrs
# qualified certificate statements
id-qcs 1 : id-qcs-pkixQCSyntax-v1
@@ -496,8 +508,9 @@ X509 13 : D : description
X509 41 : name : name
X509 42 : G : givenName
X509 43 : I : initials
X509 45 : UID : uniqueIdentifier
X509 45 : : uniqueIdentifier
X509 46 : dnQualifier : dnQualifier
X509 72 : role : role
X500 8 : X500algorithms : directory services - algorithms
X500algorithms 1 1 : RSA : rsa
@@ -531,8 +544,14 @@ id-ce 31 : crlDistributionPoints : X509v3 CRL Distribution Points
id-ce 32 : certificatePolicies : X509v3 Certificate Policies
!Cname authority-key-identifier
id-ce 35 : authorityKeyIdentifier : X509v3 Authority Key Identifier
!Cname policy-constraints
id-ce 36 : policyConstraints : X509v3 Policy Constraints
!Cname ext-key-usage
id-ce 37 : extendedKeyUsage : X509v3 Extended Key Usage
!Cname target-information
id-ce 55 : targetInformation : X509v3 AC Targeting
!Cname no-rev-avail
id-ce 56 : noRevAvail : X509v3 No Revocation Available
!Cname netscape
2 16 840 1 113730 : Netscape : Netscape Communications Corp.

View File

@@ -25,8 +25,8 @@
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
#define OPENSSL_VERSION_NUMBER 0x0090602fL
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.6b [engine] 9 Jul 2001"
#define OPENSSL_VERSION_NUMBER 0x0090603fL
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.6c [engine] 21 dec 2001"
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
@@ -44,13 +44,13 @@
*
* libcrypto.so.0
*
* On True64 it works a little bit differently. There, the shared library
* version is stored in the file, and is actually a series of versions,
* separated by colons. The rightmost version present in the library when
* linking an application is stored in the application to be matched at
* run time. When the application is run, a check is done to see if the
* library version stored in the application matches any of the versions
* in the version string of the library itself.
* On Tru64 and IRIX 6.x it works a little bit differently. There, the
* shared library version is stored in the file, and is actually a series
* of versions, separated by colons. The rightmost version present in the
* library when linking an application is stored in the application to be
* matched at run time. When the application is run, a check is done to
* see if the library version stored in the application matches any of the
* versions in the version string of the library itself.
* This version string can be constructed in any way, depending on what
* kind of matching is desired. However, to implement the same scheme as
* the one used in the other unixen, all compatible versions, from lowest
@@ -73,7 +73,7 @@
* However, it's nice and more understandable if it actually does.
* The current library version is stored in the macro SHLIB_VERSION_NUMBER,
* which is just a piece of text in the format "M.m.e" (Major, minor, edit).
* For the sake of True64 and any other OS that behaves in similar ways,
* For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
* we need to keep a history of version numbers, which is done in the
* macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and
* should only keep the versions that are binary compatible with the current.

View File

@@ -524,8 +524,6 @@ void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt);
int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
unsigned int *siglen, EVP_PKEY *pkey);
void ERR_load_PEM_strings(void);
void PEM_proc_type(char *buf, int type);
void PEM_dek_info(char *buf, const char *type, int len, char *str);
@@ -614,6 +612,7 @@ int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_PEM_strings(void);
/* Error codes for the PEM functions. */
@@ -664,4 +663,3 @@ int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
}
#endif
#endif

View File

@@ -267,7 +267,6 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void);
PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp,
long length);
void PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a);
void ERR_load_PKCS12_strings(void);
void PKCS12_PBE_add(void);
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
STACK_OF(X509) **ca);
@@ -284,6 +283,7 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_PKCS12_strings(void);
/* Error codes for the PKCS12 functions. */
@@ -342,4 +342,3 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
}
#endif
#endif

View File

@@ -1,9 +1,59 @@
/* pk7_attr.c */
/* S/MIME code.
* Copyright (C) 1997-8 Dr S N Henson (shenson@bigfoot.com)
* All Rights Reserved.
* Redistribution of this code without the authors permission is expressly
* prohibited.
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 2001.
*/
/* ====================================================================
* Copyright (c) 2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>

View File

@@ -558,11 +558,15 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
ASN1_UTCTIME *sign_time;
const EVP_MD *md_tmp;
/* Add signing time */
sign_time=X509_gmtime_adj(NULL,0);
PKCS7_add_signed_attribute(si,
NID_pkcs9_signingTime,
V_ASN1_UTCTIME,sign_time);
/* Add signing time if not already present */
if (!PKCS7_get_signed_attribute(si,
NID_pkcs9_signingTime))
{
sign_time=X509_gmtime_adj(NULL,0);
PKCS7_add_signed_attribute(si,
NID_pkcs9_signingTime,
V_ASN1_UTCTIME,sign_time);
}
/* Add digest */
md_tmp=EVP_MD_CTX_md(&ctx_tmp);

View File

@@ -353,8 +353,6 @@ int i2d_PKCS7(PKCS7 *a,
PKCS7 *d2i_PKCS7(PKCS7 **a,
unsigned char **pp,long length);
void ERR_load_PKCS7_strings(void);
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
@@ -422,6 +420,7 @@ int SMIME_text(BIO *in, BIO *out);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_PKCS7_strings(void);
/* Error codes for the PKCS7 functions. */
@@ -502,4 +501,3 @@ int SMIME_text(BIO *in, BIO *out);
}
#endif
#endif

View File

@@ -56,7 +56,7 @@
* [including the GNU Public Licence.]
*/
/* ====================================================================
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -144,6 +144,7 @@ static int initialized=0;
static unsigned int crypto_lock_rand = 0; /* may be set only when a thread
* holds CRYPTO_LOCK_RAND
* (to prevent double locking) */
/* access to lockin_thread is synchronized by CRYPTO_LOCK_RAND2 */
static unsigned long locking_thread = 0; /* valid iff crypto_lock_rand is set */
@@ -210,7 +211,14 @@ static void ssleay_rand_add(const void *buf, int num, double add)
*/
/* check if we already have the lock */
do_not_lock = crypto_lock_rand && (locking_thread == CRYPTO_thread_id());
if (crypto_lock_rand)
{
CRYPTO_r_lock(CRYPTO_LOCK_RAND2);
do_not_lock = (locking_thread == CRYPTO_thread_id());
CRYPTO_r_unlock(CRYPTO_LOCK_RAND2);
}
else
do_not_lock = 0;
if (!do_not_lock) CRYPTO_w_lock(CRYPTO_LOCK_RAND);
st_idx=state_index;
@@ -361,8 +369,10 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
crypto_lock_rand = 1;
CRYPTO_w_lock(CRYPTO_LOCK_RAND2);
locking_thread = CRYPTO_thread_id();
CRYPTO_w_unlock(CRYPTO_LOCK_RAND2);
crypto_lock_rand = 1;
if (!initialized)
{
@@ -435,7 +445,6 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
/* before unlocking, we must clear 'crypto_lock_rand' */
crypto_lock_rand = 0;
locking_thread = 0;
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
while (num > 0)
@@ -521,15 +530,24 @@ static int ssleay_rand_status(void)
/* check if we already have the lock
* (could happen if a RAND_poll() implementation calls RAND_status()) */
do_not_lock = crypto_lock_rand && (locking_thread == CRYPTO_thread_id());
if (crypto_lock_rand)
{
CRYPTO_r_lock(CRYPTO_LOCK_RAND2);
do_not_lock = (locking_thread == CRYPTO_thread_id());
CRYPTO_r_unlock(CRYPTO_LOCK_RAND2);
}
else
do_not_lock = 0;
if (!do_not_lock)
{
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
crypto_lock_rand = 1;
CRYPTO_w_lock(CRYPTO_LOCK_RAND2);
locking_thread = CRYPTO_thread_id();
CRYPTO_w_unlock(CRYPTO_LOCK_RAND2);
crypto_lock_rand = 1;
}
if (!initialized)
@@ -544,7 +562,6 @@ static int ssleay_rand_status(void)
{
/* before unlocking, we must clear 'crypto_lock_rand' */
crypto_lock_rand = 0;
locking_thread = 0;
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
}

View File

@@ -95,7 +95,6 @@ const char *RAND_file_name(char *file,size_t num);
int RAND_status(void);
int RAND_egd(const char *path);
int RAND_egd_bytes(const char *path,int bytes);
void ERR_load_RAND_strings(void);
int RAND_poll(void);
#ifdef __cplusplus
@@ -117,10 +116,15 @@ int RAND_event(UINT, WPARAM, LPARAM);
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_RAND_strings(void);
/* Error codes for the RAND functions. */
@@ -130,5 +134,7 @@ int RAND_event(UINT, WPARAM, LPARAM);
/* Reason codes. */
#define RAND_R_PRNG_NOT_SEEDED 100
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -71,7 +71,7 @@
* <appro@fy.chalmers.se>
*/
#ifdef RMD160_ASM
# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
# define ripemd160_block_host_order ripemd160_block_asm_host_order
# endif
#endif
@@ -79,7 +79,7 @@
void ripemd160_block_host_order (RIPEMD160_CTX *c, const void *p,int num);
void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,int num);
#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
#define ripemd160_block_data_order ripemd160_block_host_order
#endif

View File

@@ -214,8 +214,6 @@ RSA_METHOD *RSA_PKCS1_SSLeay(void);
RSA_METHOD *RSA_null_method(void);
void ERR_load_RSA_strings(void );
RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length);
int i2d_RSAPublicKey(RSA *a, unsigned char **pp);
RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length);
@@ -287,6 +285,7 @@ void *RSA_get_ex_data(RSA *r, int idx);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_RSA_strings(void);
/* Error codes for the RSA functions. */
@@ -328,6 +327,7 @@ void *RSA_get_ex_data(RSA *r, int idx);
#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
#define RSA_R_DATA_TOO_LARGE 109
#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
#define RSA_R_DATA_TOO_SMALL 111
#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
@@ -354,4 +354,3 @@ void *RSA_get_ex_data(RSA *r, int idx);
}
#endif
#endif

View File

@@ -79,8 +79,8 @@ static int RSA_eay_finish(RSA *rsa);
static RSA_METHOD rsa_pkcs1_eay_meth={
"Eric Young's PKCS#1 RSA",
RSA_eay_public_encrypt,
RSA_eay_public_decrypt,
RSA_eay_private_encrypt,
RSA_eay_public_decrypt, /* signature verification */
RSA_eay_private_encrypt, /* signing */
RSA_eay_private_decrypt,
RSA_eay_mod_exp,
BN_mod_exp_mont,
@@ -139,6 +139,13 @@ static int RSA_eay_public_encrypt(int flen, unsigned char *from,
if (BN_bin2bn(buf,num,&f) == NULL) goto err;
if (BN_ucmp(&f, rsa->n) >= 0)
{
/* usually the padding functions would catch this */
RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,RSA_R_DATA_TOO_LARGE_FOR_MODULUS);
goto err;
}
if ((rsa->_method_mod_n == NULL) && (rsa->flags & RSA_FLAG_CACHE_PUBLIC))
{
BN_MONT_CTX* bn_mont_ctx;
@@ -186,6 +193,7 @@ err:
return(r);
}
/* signing */
static int RSA_eay_private_encrypt(int flen, unsigned char *from,
unsigned char *to, RSA *rsa, int padding)
{
@@ -224,6 +232,13 @@ static int RSA_eay_private_encrypt(int flen, unsigned char *from,
if (BN_bin2bn(buf,num,&f) == NULL) goto err;
if (BN_ucmp(&f, rsa->n) >= 0)
{
/* usually the padding functions would catch this */
RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,RSA_R_DATA_TOO_LARGE_FOR_MODULUS);
goto err;
}
if ((rsa->flags & RSA_FLAG_BLINDING) && (rsa->blinding == NULL))
RSA_blinding_on(rsa,ctx);
if (rsa->flags & RSA_FLAG_BLINDING)
@@ -299,6 +314,12 @@ static int RSA_eay_private_decrypt(int flen, unsigned char *from,
/* make data into a big number */
if (BN_bin2bn(from,(int)flen,&f) == NULL) goto err;
if (BN_ucmp(&f, rsa->n) >= 0)
{
RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,RSA_R_DATA_TOO_LARGE_FOR_MODULUS);
goto err;
}
if ((rsa->flags & RSA_FLAG_BLINDING) && (rsa->blinding == NULL))
RSA_blinding_on(rsa,ctx);
if (rsa->flags & RSA_FLAG_BLINDING)
@@ -359,6 +380,7 @@ err:
return(r);
}
/* signature verification */
static int RSA_eay_public_decrypt(int flen, unsigned char *from,
unsigned char *to, RSA *rsa, int padding)
{
@@ -392,6 +414,13 @@ static int RSA_eay_public_decrypt(int flen, unsigned char *from,
}
if (BN_bin2bn(from,flen,&f) == NULL) goto err;
if (BN_ucmp(&f, rsa->n) >= 0)
{
RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_DATA_TOO_LARGE_FOR_MODULUS);
goto err;
}
/* do the decrypt */
if ((rsa->_method_mod_n == NULL) && (rsa->flags & RSA_FLAG_CACHE_PUBLIC))
{

View File

@@ -106,6 +106,7 @@ static ERR_STRING_DATA RSA_str_reasons[]=
{RSA_R_DATA_GREATER_THAN_MOD_LEN ,"data greater than mod len"},
{RSA_R_DATA_TOO_LARGE ,"data too large"},
{RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE ,"data too large for key size"},
{RSA_R_DATA_TOO_LARGE_FOR_MODULUS ,"data too large for modulus"},
{RSA_R_DATA_TOO_SMALL ,"data too small"},
{RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE ,"data too small for key size"},
{RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY ,"digest too big for rsa key"},

View File

@@ -2,7 +2,22 @@
/* Written by Ulf Moeller. This software is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */
/* EME_OAEP as defined in RFC 2437 (PKCS #1 v2.0) */
/* EME-OAEP as defined in RFC 2437 (PKCS #1 v2.0) */
/* See Victor Shoup, "OAEP reconsidered," Nov. 2000,
* <URL: http://www.shoup.net/papers/oaep.ps.Z>
* for problems with the security proof for the
* original OAEP scheme, which EME-OAEP is based on.
*
* A new proof can be found in E. Fujisaki, T. Okamoto,
* D. Pointcheval, J. Stern, "RSA-OEAP is Still Alive!",
* Dec. 2000, <URL: http://eprint.iacr.org/2000/061/>.
* The new proof has stronger requirements for the
* underlying permutation: "partial-one-wayness" instead
* of one-wayness. For the RSA function, this is
* an equivalent notion.
*/
#if !defined(NO_SHA) && !defined(NO_SHA1)
#include <stdio.h>
@@ -12,157 +27,174 @@
#include <openssl/sha.h>
#include <openssl/rand.h>
int MGF1(unsigned char *mask, long len, unsigned char *seed, long seedlen);
int MGF1(unsigned char *mask, long len,
unsigned char *seed, long seedlen);
int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
unsigned char *from, int flen, unsigned char *param, int plen)
{
int i, emlen = tlen - 1;
unsigned char *db, *seed;
unsigned char *dbmask, seedmask[SHA_DIGEST_LENGTH];
if (flen > emlen - 2 * SHA_DIGEST_LENGTH - 1)
unsigned char *from, int flen,
unsigned char *param, int plen)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP,
RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE);
return (0);
}
int i, emlen = tlen - 1;
unsigned char *db, *seed;
unsigned char *dbmask, seedmask[SHA_DIGEST_LENGTH];
if (emlen < 2 * SHA_DIGEST_LENGTH + 1)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, RSA_R_KEY_SIZE_TOO_SMALL);
return (0);
}
if (flen > emlen - 2 * SHA_DIGEST_LENGTH - 1)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP,
RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE);
return 0;
}
dbmask = OPENSSL_malloc(emlen - SHA_DIGEST_LENGTH);
if (dbmask == NULL)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
return (0);
}
if (emlen < 2 * SHA_DIGEST_LENGTH + 1)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, RSA_R_KEY_SIZE_TOO_SMALL);
return 0;
}
to[0] = 0;
seed = to + 1;
db = to + SHA_DIGEST_LENGTH + 1;
dbmask = OPENSSL_malloc(emlen - SHA_DIGEST_LENGTH);
if (dbmask == NULL)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
return 0;
}
SHA1(param, plen, db);
memset(db + SHA_DIGEST_LENGTH, 0,
emlen - flen - 2 * SHA_DIGEST_LENGTH - 1);
db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01;
memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, (unsigned int) flen);
if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0)
return (0);
to[0] = 0;
seed = to + 1;
db = to + SHA_DIGEST_LENGTH + 1;
SHA1(param, plen, db);
memset(db + SHA_DIGEST_LENGTH, 0,
emlen - flen - 2 * SHA_DIGEST_LENGTH - 1);
db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01;
memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, (unsigned int) flen);
if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0)
return 0;
#ifdef PKCS_TESTVECT
memcpy(seed,
memcpy(seed,
"\xaa\xfd\x12\xf6\x59\xca\xe6\x34\x89\xb4\x79\xe5\x07\x6d\xde\xc2\xf0\x6c\xb5\x8f",
20);
#endif
MGF1(dbmask, emlen - SHA_DIGEST_LENGTH, seed, SHA_DIGEST_LENGTH);
for (i = 0; i < emlen - SHA_DIGEST_LENGTH; i++)
db[i] ^= dbmask[i];
MGF1(dbmask, emlen - SHA_DIGEST_LENGTH, seed, SHA_DIGEST_LENGTH);
for (i = 0; i < emlen - SHA_DIGEST_LENGTH; i++)
db[i] ^= dbmask[i];
MGF1(seedmask, SHA_DIGEST_LENGTH, db, emlen - SHA_DIGEST_LENGTH);
for (i = 0; i < SHA_DIGEST_LENGTH; i++)
seed[i] ^= seedmask[i];
MGF1(seedmask, SHA_DIGEST_LENGTH, db, emlen - SHA_DIGEST_LENGTH);
for (i = 0; i < SHA_DIGEST_LENGTH; i++)
seed[i] ^= seedmask[i];
OPENSSL_free(dbmask);
return (1);
}
OPENSSL_free(dbmask);
return 1;
}
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
unsigned char *from, int flen, int num, unsigned char *param,
int plen)
{
int i, dblen, mlen = -1;
unsigned char *maskeddb;
int lzero;
unsigned char *db = NULL, seed[SHA_DIGEST_LENGTH], phash[SHA_DIGEST_LENGTH];
if (--num < 2 * SHA_DIGEST_LENGTH + 1)
goto decoding_err;
lzero = num - flen;
if (lzero < 0)
goto decoding_err;
maskeddb = from - lzero + SHA_DIGEST_LENGTH;
dblen = num - SHA_DIGEST_LENGTH;
db = OPENSSL_malloc(dblen);
if (db == NULL)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
return (-1);
}
int i, dblen, mlen = -1;
unsigned char *maskeddb;
int lzero;
unsigned char *db = NULL, seed[SHA_DIGEST_LENGTH], phash[SHA_DIGEST_LENGTH];
int bad = 0;
MGF1(seed, SHA_DIGEST_LENGTH, maskeddb, dblen);
for (i = lzero; i < SHA_DIGEST_LENGTH; i++)
seed[i] ^= from[i - lzero];
if (--num < 2 * SHA_DIGEST_LENGTH + 1)
/* 'num' is the length of the modulus, i.e. does not depend on the
* particular ciphertext. */
goto decoding_err;
MGF1(db, dblen, seed, SHA_DIGEST_LENGTH);
for (i = 0; i < dblen; i++)
db[i] ^= maskeddb[i];
SHA1(param, plen, phash);
if (memcmp(db, phash, SHA_DIGEST_LENGTH) != 0)
goto decoding_err;
else
{
for (i = SHA_DIGEST_LENGTH; i < dblen; i++)
if (db[i] != 0x00)
break;
if (db[i] != 0x01 || i++ >= dblen)
goto decoding_err;
else
{
mlen = dblen - i;
if (tlen < mlen)
lzero = num - flen;
if (lzero < 0)
{
RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_DATA_TOO_LARGE);
mlen = -1;
/* lzero == -1 */
/* signalling this error immediately after detection might allow
* for side-channel attacks (e.g. timing if 'plen' is huge
* -- cf. James H. Manger, "A Chosen Ciphertext Attack on RSA Optimal
* Asymmetric Encryption Padding (OAEP) [...]", CRYPTO 2001),
* so we use a 'bad' flag */
bad = 1;
lzero = 0;
}
else
memcpy(to, db + i, mlen);
}
}
OPENSSL_free(db);
return (mlen);
maskeddb = from - lzero + SHA_DIGEST_LENGTH;
dblen = num - SHA_DIGEST_LENGTH;
db = OPENSSL_malloc(dblen);
if (db == NULL)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
return -1;
}
MGF1(seed, SHA_DIGEST_LENGTH, maskeddb, dblen);
for (i = lzero; i < SHA_DIGEST_LENGTH; i++)
seed[i] ^= from[i - lzero];
MGF1(db, dblen, seed, SHA_DIGEST_LENGTH);
for (i = 0; i < dblen; i++)
db[i] ^= maskeddb[i];
SHA1(param, plen, phash);
if (memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad)
goto decoding_err;
else
{
for (i = SHA_DIGEST_LENGTH; i < dblen; i++)
if (db[i] != 0x00)
break;
if (db[i] != 0x01 || i++ >= dblen)
goto decoding_err;
else
{
/* everything looks OK */
mlen = dblen - i;
if (tlen < mlen)
{
RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_DATA_TOO_LARGE);
mlen = -1;
}
else
memcpy(to, db + i, mlen);
}
}
OPENSSL_free(db);
return mlen;
decoding_err:
/* to avoid chosen ciphertext attacks, the error message should not reveal
* which kind of decoding error happened */
RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_OAEP_DECODING_ERROR);
if (db != NULL) OPENSSL_free(db);
return -1;
}
/* to avoid chosen ciphertext attacks, the error message should not reveal
* which kind of decoding error happened */
RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_OAEP_DECODING_ERROR);
if (db != NULL) OPENSSL_free(db);
return -1;
}
int MGF1(unsigned char *mask, long len, unsigned char *seed, long seedlen)
{
long i, outlen = 0;
unsigned char cnt[4];
SHA_CTX c;
unsigned char md[SHA_DIGEST_LENGTH];
for (i = 0; outlen < len; i++)
{
cnt[0] = (i >> 24) & 255, cnt[1] = (i >> 16) & 255,
cnt[2] = (i >> 8) & 255, cnt[3] = i & 255;
SHA1_Init(&c);
SHA1_Update(&c, seed, seedlen);
SHA1_Update(&c, cnt, 4);
if (outlen + SHA_DIGEST_LENGTH <= len)
{
SHA1_Final(mask + outlen, &c);
outlen += SHA_DIGEST_LENGTH;
}
else
{
SHA1_Final(md, &c);
memcpy(mask + outlen, md, len - outlen);
outlen = len;
}
long i, outlen = 0;
unsigned char cnt[4];
SHA_CTX c;
unsigned char md[SHA_DIGEST_LENGTH];
for (i = 0; outlen < len; i++)
{
cnt[0] = (i >> 24) & 255, cnt[1] = (i >> 16) & 255,
cnt[2] = (i >> 8) & 255, cnt[3] = i & 255;
SHA1_Init(&c);
SHA1_Update(&c, seed, seedlen);
SHA1_Update(&c, cnt, 4);
if (outlen + SHA_DIGEST_LENGTH <= len)
{
SHA1_Final(mask + outlen, &c);
outlen += SHA_DIGEST_LENGTH;
}
else
{
SHA1_Final(md, &c);
memcpy(mask + outlen, md, len - outlen);
outlen = len;
}
}
return 0;
}
return (0);
}
#endif

View File

@@ -115,7 +115,7 @@
# endif
# ifdef SHA1_ASM
# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
# define sha1_block_host_order sha1_block_asm_host_order
# define DONT_IMPLEMENT_BLOCK_HOST_ORDER
# define sha1_block_data_order sha1_block_asm_data_order

View File

@@ -810,7 +810,6 @@ const char * X509_get_default_private_dir(void );
X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
void ERR_load_X509_strings(void );
X509_ALGOR * X509_ALGOR_new(void );
void X509_ALGOR_free(X509_ALGOR *a);
@@ -1220,6 +1219,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_X509_strings(void);
/* Error codes for the X509 functions. */
@@ -1291,4 +1291,3 @@ int X509_TRUST_get_trust(X509_TRUST *xp);
}
#endif
#endif

View File

@@ -79,7 +79,7 @@ static int (*default_trust)(int id, X509 *x, int flags) = obj_trust;
static X509_TRUST trstandard[] = {
{X509_TRUST_COMPAT, 0, trust_compat, "compatible", 0, NULL},
{X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL},
{X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Client", NID_server_auth, NULL},
{X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Server", NID_server_auth, NULL},
{X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL},
};

View File

@@ -95,7 +95,7 @@ const char *X509_verify_cert_error_string(long n)
case X509_V_ERR_CRL_NOT_YET_VALID:
return("CRL is not yet valid");
case X509_V_ERR_CERT_HAS_EXPIRED:
return("Certificate has expired");
return("certificate has expired");
case X509_V_ERR_CRL_HAS_EXPIRED:
return("CRL has expired");
case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:

View File

@@ -911,6 +911,12 @@ void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, long flags, time_t t)
ctx->flags |= X509_V_FLAG_USE_CHECK_TIME;
}
void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
int (*verify_cb)(int, X509_STORE_CTX *))
{
ctx->verify_cb=verify_cb;
}
IMPLEMENT_STACK_OF(X509)
IMPLEMENT_ASN1_SET_OF(X509)

View File

@@ -382,6 +382,8 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
int purpose, int trust);
void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, long flags);
void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, long flags, time_t t);
void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
int (*verify_cb)(int, X509_STORE_CTX *));
#ifdef __cplusplus
}

View File

@@ -354,7 +354,6 @@ typedef struct x509_purpose_st {
DECLARE_STACK_OF(X509_PURPOSE)
void ERR_load_X509V3_strings(void);
int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **pp);
BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a, unsigned char **pp, long length);
BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new(void);
@@ -555,6 +554,7 @@ void X509_email_free(STACK *sk);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_X509V3_strings(void);
/* Error codes for the X509V3 functions. */
@@ -650,4 +650,3 @@ void X509_email_free(STACK *sk);
}
#endif
#endif

View File

@@ -54,6 +54,11 @@ The options descriptions will be divided into each purpose.
specifies the configuration file to use.
=item B<-name section>
specifies the configuration file section to use (overrides
B<default_ca> in the B<ca> section).
=item B<-in filename>
an input filename containing a single certificate request to be
@@ -202,8 +207,20 @@ that some software (for example Netscape) can't handle V2 CRLs.
=head1 CONFIGURATION FILE OPTIONS
The options for B<ca> are contained in the B<ca> section of the
configuration file. Many of these are identical to command line
The section of the configuration file containing options for B<ca>
is found as follows: If the B<-name> command line option is used,
then it names the section to be used. Otherwise the section to
be used must be named in the B<default_ca> option of the B<ca> section
of the configuration file (or in the default section of the
configuration file). Besides B<default_ca>, the following options are
read directly from the B<ca> section:
RANDFILE
preserve
msie_hack
With the exception of B<RANDFILE>, this is probably a bug and may
change in future releases.
Many of the configuration file options are identical to command line
options. Where the option is present in the configuration file
and the command line the command line value is used. Where an
option is described as mandatory then it must be present in

View File

@@ -125,6 +125,10 @@ Generation of RSA Parameters.
Generation of hashed passwords.
=item L<B<pkcs12>|pkcs12(1)>
PKCS#12 Data Management.
=item L<B<pkcs7>|pkcs7(1)>
PKCS#7 Data Management.

View File

@@ -200,14 +200,14 @@ the signature of the certificate is invalid. Unused.
the certificate is not yet valid: the notBefore date is after the current time.
=item B<10 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid>
the CRL is not yet valid. Unused.
=item B<11 X509_V_ERR_CERT_HAS_EXPIRED: Certificate has expired>
=item B<10 X509_V_ERR_CERT_HAS_EXPIRED: certificate has expired>
the certificate has expired: that is the notAfter date is before the current time.
=item B<11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid>
the CRL is not yet valid. Unused.
=item B<12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired>
the CRL has expired. Unused.

View File

@@ -14,6 +14,8 @@ BN_rand, BN_pseudo_rand - generate pseudo-random number
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_pseudo_rand_range(BIGNUM *rnd, int bits, int top, int bottom);
=head1 DESCRIPTION
BN_rand() generates a cryptographically strong pseudo-random number of
@@ -31,6 +33,8 @@ protocols, but usually not for key generation etc.
BN_rand_range() generates a cryptographically strong pseudo-random
number B<rnd> in the range 0 <lt>= B<rnd> E<lt> B<range>.
BN_pseudo_rand_range() does the same, but is based on BN_pseudo_rand(),
and hence numbers generated by it are not necessarily unpredictable.
The PRNG must be seeded prior to calling BN_rand() or BN_rand_range().
@@ -49,5 +53,6 @@ L<RAND_add(3)|RAND_add(3)>, L<RAND_bytes(3)|RAND_bytes(3)>
BN_rand() is available in all versions of SSLeay and OpenSSL.
BN_pseudo_rand() was added in OpenSSL 0.9.5. The B<top> == -1 case
and the function BN_rand_range() were added in OpenSSL 0.9.6a.
BN_pseudo_rand_range() was added in OpenSSL 0.9.6c.
=cut

View File

@@ -61,6 +61,7 @@ bn - multiprecision integer arithmetics
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits,int safe, BIGNUM *add,
BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg);

View File

@@ -53,8 +53,10 @@ OpenSSL can safely be used in multi-threaded applications provided
that at least two callback functions are set.
locking_function(int mode, int n, const char *file, int line) is
needed to perform locking on shared data structures. Multi-threaded
applications will crash at random if it is not set.
needed to perform locking on shared data structures.
(Note that OpenSSL uses a number of global data structures that
will be implicitly shared whenever multiple threads use OpenSSL.)
Multi-threaded applications will crash at random if it is not set.
locking_function() must be able to handle up to CRYPTO_num_locks()
different mutex locks. It sets the B<n>-th lock if B<mode> &

View File

@@ -0,0 +1,70 @@
=pod
=head1 NAME
SSL_COMP_add_compression_method - handle SSL/TLS integrated compression methods
=head1 SYNOPSIS
#include <openssl/ssl.h>
int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
=head1 DESCRIPTION
SSL_COMP_add_compression_method() adds the compression method B<cm> with
the identifier B<id> to the list of available compression methods. This
list is globally maintained for all SSL operations within this application.
It cannot be set for specific SSL_CTX or SSL objects.
=head1 NOTES
The TLS standard (or SSLv3) allows the integration of compression methods
into the communication. The TLS RFC does however not specify compression
methods or their corresponding identifiers, so there is currently no compatible
way to integrate compression with unknown peers. It is therefore currently not
recommended to integrate compression into applications. Applications for
non-public use may agree on certain compression methods. Using different
compression methods with the same identifier will lead to connection failure.
An OpenSSL client speaking a protocol that allows compression (SSLv3, TLSv1)
will unconditionally send the list of all compression methods enabled with
SSL_COMP_add_compression_method() to the server during the handshake.
Unlike the mechanisms to set a cipher list, there is no method available to
restrict the list of compression method on a per connection basis.
An OpenSSL server will match the identifiers listed by a client against
its own compression methods and will unconditionally activate compression
when a matching identifier is found. There is no way to restrict the list
of compression methods supported on a per connection basis.
The OpenSSL library has the compression methods B<COMP_rle()> and (when
especially enabled during compilation) B<COMP_zlib()> available.
=head1 WARNINGS
Once the identities of the compression methods for the TLS protocol have
been standardized, the compression API will most likely be changed. Using
it in the current state is not recommended.
=head1 RETURN VALUES
SSL_COMP_add_compression_method() may return the following values:
=over 4
=item 1
The operation succeeded.
=item 0
The operation failed. Check the error queue to find out the reason.
=back
=head1 SEE ALSO
L<ssl(3)|ssl(3)>
=cut

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