Compare commits

..

845 Commits

Author SHA1 Message Date
Richard Levitte
631cdb9f69 Small fault corrected 2002-12-05 22:44:12 +00:00
Richard Levitte
e98b0d6883 make update 2002-12-05 21:51:02 +00:00
Richard Levitte
f94e1dd2d0 Time to release OpenSSL 0.9.6h.
The tag will be OpenSSL_0_9_6h.
2002-12-05 21:40:48 +00:00
Richard Levitte
3124dd9c13 Make sure using SSL_CERT_FILE actually works, and has priority over system defaults.
PR: 376
2002-12-05 01:20:53 +00:00
Richard Levitte
e5040378df Fixes for VxWorks. Are these needed for 0.9.7 and up as well?
PR: 374
2002-12-04 23:13:07 +00:00
Dr. Stephen Henson
0b7497310d Include crypto.h to pull in definition of OPENSSL_cleanse in various
places.
2002-12-04 23:08:08 +00:00
Lutz Jänicke
98c3eccc83 Missing ")"
Submitted by: Christian Hohnstaedt <chohnstaedt@innominate.com>
Reviewed by:
PR:
2002-12-04 13:30:16 +00:00
Richard Levitte
7000fd8418 A gcc 3.0 bug is triggered by our code. Add a section about it in PROBLEMS.
PR: 375
2002-12-04 08:24:23 +00:00
Richard Levitte
811cd997ae EXIT() may mean return(). That's confusing, so let's have it really mean
exit() in whatever way works for the intended platform, and define
OPENSSL_EXIT() to have the old meaning (the name is of course because
it's only used in the openssl program)
2002-12-03 16:51:51 +00:00
Richard Levitte
29a0f955b8 Make CRYPTO_cleanse() independent of endianness. 2002-12-03 16:06:52 +00:00
Richard Levitte
5a6a8963ad EXIT() needs to be in a function that returns int. 2002-12-01 01:23:13 +00:00
Richard Levitte
b760880094 Correct some names. 2002-11-29 14:21:58 +00:00
Richard Levitte
6bad9d0522 A few more memset()s converted to OPENSSL_cleanse().
I *think* I got them all covered by now, bu please, if you find any more,
tell me and I'll correct it.
PR: 343
2002-11-29 11:31:18 +00:00
Richard Levitte
dd54633339 Have all tests use EXIT() to exit rather than exit(), since the latter doesn't
always give the expected result on some platforms.
2002-11-28 18:56:18 +00:00
Richard Levitte
6a99f54418 Make sure EXIT() can always be used as one statement. 2002-11-28 18:52:18 +00:00
Richard Levitte
920b700d4a Cleanse memory using the new OPENSSL_cleanse() function.
I've covered all the memset()s I felt safe modifying, but may have missed some.
2002-11-28 08:06:36 +00:00
Richard Levitte
615ee04098 make update 2002-11-27 13:45:38 +00:00
Richard Levitte
9a7a36db08 Add OPENSSL_cleanse() to help cleanse memory and avoid certain compiler
and linker optimizations.
PR: 343
2002-11-27 12:24:54 +00:00
cvs2svn
60b5a28877 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-11-27 12:24:09 +00:00
Richard Levitte
1c4d82a776 The logic in the main signing and verifying functions to check lengths was
incorrect.  Fortunately, there is a second check that's correct, when adding
the pads.
PR: 355
2002-11-26 11:14:38 +00:00
Richard Levitte
54f70a1ce0 Mention a current showstopper 2002-11-21 22:39:16 +00:00
Lutz Jänicke
e824df317a Fix bug introduced by the attempt to fix client side external session
caching (#288): now internal caching failed (#351):
Make sure, that cipher_id is set before comparing.
Submitted by:
Reviewed by:
PR: 288 (and 351)
2002-11-20 10:48:05 +00:00
Bodo Möller
3d2fd99573 allocate bio_err before memory debugging is enabled to avoid memory leaks
(we can't release it before the CRYPTO_mem_leaks() call!)

Submitted by: Nils Larsch
2002-11-19 12:10:08 +00:00
Richard Levitte
adee13d244 Add news items for 0.9.6h 2002-11-18 23:57:31 +00:00
Bodo Möller
9e69a30716 fix memory leak in memory debuggin code ...
Submitted by: Nils Larsch
2002-11-18 14:02:20 +00:00
Richard Levitte
0f277581ef A variable of type time_t is supposed to be a time measurement starting at
Epoch.  offset isn't such a measurement, so let's stop pretend it is.
2002-11-18 13:04:54 +00:00
Lutz Jänicke
9989dd6171 Fix buggy #! magic and update ssleay->openssl
Submitted by:
Reviewed by:
PR: 305
2002-11-15 21:25:16 +00:00
Richard Levitte
7149d5c140 Document the change to remove the 'done' flag variable in the
OpenSSL_add_all_*() routines
2002-11-15 13:58:58 +00:00
Richard Levitte
4ad0d4da1b make update 2002-11-15 11:21:33 +00:00
Richard Levitte
f6b70eac0c A few more Microsoft OIDs added 2002-11-15 11:18:05 +00:00
Lutz Jänicke
8e71d1b561 The pointer to the cipher object is not yet set, when session was reloaded
from external cache (using d2i_SSL_SESSION). Perform comparison based on
the cipher's id instead.
Submitted by: Steve Haslam <araqnid@innocent.com>
Reviewed by:
PR: 288
2002-11-15 10:52:53 +00:00
Richard Levitte
8b5cd8a965 The architecture name is i486, not just 486 2002-11-15 10:28:38 +00:00
Richard Levitte
0e3ee398f6 -Wid-clash-n isn't support in gcc 3, and I get better result from continuously
rebuilding on a VMS box.
2002-11-15 10:19:35 +00:00
Richard Levitte
f9d12d1a50 Spell prototypes correctly :-) 2002-11-15 09:56:59 +00:00
Richard Levitte
7c5305bc54 Add -Wstrict-prototype and -Wmissing-prototype to my debugging targets 2002-11-15 09:53:53 +00:00
Richard Levitte
3aefe06f0f We need to read one more byte of the REQUEST-CERTIFICATE message.
PR: 300
2002-11-15 09:16:56 +00:00
Richard Levitte
fa015977de make update 2002-11-14 23:56:29 +00:00
Richard Levitte
cc68d20f8e Add A/UX target.
PR: 271
2002-11-14 23:38:59 +00:00
Richard Levitte
5a6250fb06 Close the implicitely opened registry key.
PR: 264
2002-11-14 23:33:48 +00:00
Richard Levitte
dd40b2002b Remove the flag variable in OpenSSL_add_all_ciphers() and
OpenSSL_add_all_digests(), as it doesn't really serve any
sensible purpose.
PR: 261
2002-11-14 23:24:39 +00:00
Lutz Jänicke
74766c6e5d No such reference to link to (found running pod2latex).
Submitted by:
Reviewed by:
PR:
2002-11-14 21:42:50 +00:00
Richard Levitte
367916e11f Add Tandem OSS target.
PR: 192
2002-11-14 16:30:29 +00:00
Richard Levitte
1dfdd763a3 It seems like gcc 2.9aix5.1 doesn't do will with optimization level 3.
PR: 115
2002-11-14 14:07:59 +00:00
Richard Levitte
a0fd85aa25 Add a FAQ on how to check the authenticity of the openSSL distribution.
PR: 292
2002-11-14 13:01:12 +00:00
Richard Levitte
38ab79ce75 Cygwin fixes (the dummytest method to make all tests work was copied
from 0.9.7-stable)
2002-11-14 12:40:52 +00:00
Richard Levitte
06a40694d4 Make the Windows test scripts consistent in their echoing 2002-11-14 08:09:00 +00:00
Richard Levitte
8df1de4e89 Handle last lines that aren't properly terminated.
PR: 308
2002-11-14 06:49:45 +00:00
Richard Levitte
ff749aea44 Constification needed.
PR: 241
2002-11-13 23:47:41 +00:00
Richard Levitte
a5c8ac1498 Reorder inclusion, or NO_SYS_TYPES_H will not be detected.
PR: 241
2002-11-13 23:45:41 +00:00
Richard Levitte
2fb453829b Some part of the Windows random seed code could hang on NT4.0 (SP6).
The same was recently reported for ODBC applications.  Therefore,
merge in this change from 0.9.7-stable.
PR: 230
2002-11-13 23:21:12 +00:00
Richard Levitte
d671684561 I think I'd like to be able to debug shared stuff as well... 2002-11-13 13:46:37 +00:00
Dr. Stephen Henson
97ff54177c include ctype.h 2002-11-13 00:44:47 +00:00
Richard Levitte
3baca7eedd Variables on the stack must be initialized or we can't depend on any
initial value.  For errline/errorline, we did depend on that, erroneously
2002-11-11 21:34:37 +00:00
Lutz Jänicke
1dc179b4f4 Make sure permissions are friendly when building release tar file.
Submitted by:
Reviewed by:
PR: 171
2002-11-11 08:55:43 +00:00
Lutz Jänicke
fa45971484 More information to the important issue of seeding the PRNG
Submitted by:
Reviewed by:
PR: 285
2002-11-11 08:33:47 +00:00
Richard Levitte
82833c523b X509_NAME_cmp() now compares PrintableString and emailAddress with a value of type
ia5String correctly.
PR: 244
2002-11-09 21:53:48 +00:00
Dr. Stephen Henson
3bfac1c21b Typo 2002-11-09 18:09:38 +00:00
Richard Levitte
cba9cbaf31 -CAserial does take a filename argument.
PR: 332
2002-11-08 21:54:07 +00:00
Richard Levitte
6cd58c0c35 -CAcreateserial doesn't take a filename argument.
PR: 332
2002-11-08 21:51:20 +00:00
Lutz Jänicke
93aed90c6a Allow building noninteractively.
Submitted by: Petter Reinholdtsen <pere@hungry.com>
Reviewed by:
PR: 315
2002-11-08 20:20:11 +00:00
Lutz Jänicke
71fbcb67b3 Next version will be 0.9.6h
Submitted by: Tapani Tarvainen <tt@it.jyu.fi>
Reviewed by:
PR: 281
2002-11-08 19:51:04 +00:00
Richard Levitte
b26728b350 Keep on using ${CC}, since gcc may act in disguise.
PR: 329
2002-11-06 23:47:25 +00:00
Richard Levitte
8c237ffb7c some people just can't read the instructions 2002-11-06 06:02:17 +00:00
Bodo Möller
33c3f72792 avoid Purify warnings
Submitted by: Nils Larsch
2002-11-05 12:24:41 +00:00
Richard Levitte
f2d8dddd46 Off-by-one-error corrected.
PR: 235
2002-11-04 11:30:30 +00:00
Richard Levitte
7dde4eb91e nasm can compile for Borland C 2002-11-04 06:25:38 +00:00
Geoff Thorpe
69c8c5611c The recent session caching modifications (including docs, and CHANGES) were
applied to the "engine" 0.9.6 branch rather than the non-engine one. This
merges all the changes back across so they are in-sync w.r.t. these
changes.
2002-10-29 18:36:51 +00:00
Bodo Möller
96eef150d6 increase permissible message length so that we can handle
CertificateVerify for 4096 bit RSA signatures
2002-10-28 15:40:47 +00:00
Richard Levitte
3dae1904a0 Signal an error if the entered output password didn't match itself.
PR: 314
2002-10-23 15:07:13 +00:00
Bodo Möller
be8b7fe38c I don't like c-tab-always-indent ... 2002-10-23 13:09:50 +00:00
Dr. Stephen Henson
473048587d Typo. 2002-10-21 00:12:43 +00:00
Bodo Möller
e76dd4cba8 change Emacs indentation style to make it easier to insert
tabs manually

Submitted by: Pierre Bacquet <pbacquet@delta.fr>
2002-10-17 09:15:46 +00:00
Richard Levitte
495ac8e429 When BN_add_word() reaches top, it shouldn't try to add the the corresponding
word, since that word may not be zero.
2002-10-14 11:27:11 +00:00
Richard Levitte
0bde80f932 Merge string protection from main trunk 2002-10-11 20:35:37 +00:00
Bodo Möller
c30ab16396 fix some entries for 0.9.6d and 0.9.6e (should look as in the
0.9.7-stable branch)
2002-10-11 17:51:25 +00:00
Richard Levitte
ad1b6d0df3 There may be more than one single quote to fix.
PR: 256
2002-10-11 11:34:24 +00:00
Richard Levitte
6a0168e842 Make sure $fname will not give us any surprises with any funny characters.
PR: 256
2002-10-11 11:07:32 +00:00
Richard Levitte
cd9a79eae1 BN_bn2hex() returns "0" instead of "00" for zero. This disrputs the
requirement that the serial number always be an even amount of characters.
PR: 248
2002-10-11 09:39:06 +00:00
Richard Levitte
b61cd4fff2 Make sure that the 'config' variable is correctly defined and declared
for monolithic as well as non-monolithic biuld.
More work is probably needed in this area.
PR: 144
2002-10-09 15:36:35 +00:00
Richard Levitte
dd2b7b5c12 Remove redundancy and use the main makefile better 2002-10-09 15:13:14 +00:00
Richard Levitte
7eead40213 Don't fuss with the demo binaries 2002-10-09 13:58:11 +00:00
cvs2svn
50ef42424b This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-10-09 13:57:57 +00:00
Richard Levitte
9952cfcf62 Use double dashes so makedepend doesn't misunderstand the flags we
give it.
For 0.9.7 and up, that means util/domd needs to remove those double
dashes from the argument list when gcc is used to find the
dependencies.
2002-10-09 13:16:31 +00:00
Richard Levitte
7821c0c40b Add missing LF 2002-10-09 06:35:58 +00:00
Richard Levitte
cc9e060ad5 Installed libraries should not be overwritten, especially shared ones.
Use mv to make sure the old copy is unlinked instead of overwritten.
PR: 273, and probably others...
2002-10-04 13:43:51 +00:00
Richard Levitte
08d9c08012 Add a small note saying the 'debug' option should come before the platform in
the arguments to mk1mf.pl.
PR: 298
2002-10-04 12:32:33 +00:00
Richard Levitte
8177986361 Document should match reality :-).
PR: 255
2002-10-04 00:03:29 +00:00
Bodo Möller
b49d33defd fix more race conditions
Submitted by: "Patrick McCormick" <patrick@tellme.com>
PR: 262
2002-09-26 15:55:46 +00:00
Lutz Jänicke
db7749b8ac Add missing brackets.
Submitted by: "Chris Brook" <cbrook@v-one.com>
Submitted by:
Reviewed by:
PR:
2002-09-25 20:20:55 +00:00
Bodo Möller
af4396e589 really fix race conditions
Submitted by: "Patrick McCormick" <patrick@tellme.com>

PR: 262
PR: 291
2002-09-25 15:36:21 +00:00
Richard Levitte
9c4d0c68bd It makes more sense to refer to specific function manuals than the concept
manual when the specific function is refered to in the current manual text.
This correction was originally introduced in OpenBSD's tracking of OpenSSL.
2002-09-25 13:33:58 +00:00
Richard Levitte
d836e3679a It makes more sense to refer to specific function manuals than the concept
manual when the specific function is refered to in the current manual text.
This correction was originally introduced in OpenBSD's tracking of OpenSSL.
2002-09-25 13:11:20 +00:00
Richard Levitte
927e75f60a -elapsed is also useful when using gettimeofday 2002-09-25 12:42:12 +00:00
Bodo Möller
8a7480eaa3 I meant CRYPTO_LOCK_SSL_METHOD to be the same as CRYPTO_LOCK_SSL_CTX
in 0.9.6-stable (that one is a close relative anyway)
2002-09-23 14:35:16 +00:00
Bodo Möller
924b6006d7 really fix race condition
PR: 262
2002-09-23 14:30:59 +00:00
Ulf Möller
85789cd2a0 don't compile egd support on MSDOS 2002-09-22 08:52:43 +00:00
Ulf Möller
cc843e3f9f as in head 2002-09-22 08:44:47 +00:00
cvs2svn
085ec0da60 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-09-22 08:44:05 +00:00
Bodo Möller
caf97dbad0 there is no minimum length for session IDs
PR: 274
[previous commit did not include all the changes]
2002-09-20 08:27:44 +00:00
Bodo Möller
5fef7d56ce there is no minimum length for session IDs
PR: 274
2002-09-19 11:43:13 +00:00
Bodo Möller
30c37c52c5 fix race condition
PR: 262
2002-09-19 11:27:37 +00:00
Lutz Jänicke
170d47b1ba Consequently use term URI instead of URL
Submitted by: TJ Saunders <tj@castaglia.org>
Reviewed by:
PR: 268
2002-09-05 07:52:45 +00:00
Dr. Stephen Henson
e474aacd58 Fix ASN1_STRING_to_UTF8: remove non sensical !*out test. 2002-08-30 17:16:56 +00:00
Bodo Möller
145a2794da don't memset(data,0,...) if data is NULL
Submitted by: anonymous
PR: 254
2002-08-29 11:33:43 +00:00
Dr. Stephen Henson
9370c84361 Fix crahses and leaks in pkcs12 utility -chain option 2002-08-22 21:53:49 +00:00
Richard Levitte
846b8fddc4 Typo, I assigned the variable ld instead of my_ld... 2002-08-18 21:32:39 +00:00
Richard Levitte
9b0defd1bb So, I discovered that if you have your $PATH set so a ld different from
GNU ld comes first, checking the usage of collect2 gives that instead of
GNU ld, even if GNU ld would be the one that would get used if we link using
gcc.  It's much better, apparently, to ask gcc directly what the path to
GNU ld is (provided it's there at all and gcc knows about it), and ask
the result if it's a GNU or not.  The bonus is that our GNU ld detection
mechanism got shorter and easier to understand...
2002-08-17 13:46:46 +00:00
Lutz Jänicke
06076d9d31 Reorder cleanup sequence in SSL_CTX_free() to leave ex_data for remove_cb().
Submitted by:
Reviewed by:
PR: 212
2002-08-16 17:09:31 +00:00
Richard Levitte
f0a4a3bc0e If gmtime() returned NULL (and we couldn't fix it à la VMS), let's
return NULL.
PR: 228
2002-08-16 11:55:54 +00:00
Richard Levitte
317521eebd isalist was less trustable than I thought (or rather, one can trust it to
come up with all kinds of names we don't have in our targets).
Besides, our sparcv9 targets currently generate sparcv8 code, I'm told.
2002-08-16 09:41:23 +00:00
Bodo Möller
b411e2724f use correct function code in error message 2002-08-15 16:16:36 +00:00
Richard Levitte
fa68d294fc It seems like sun4u doesn't always have a sparcv9 inside. Trust isalist.
PR: 220
2002-08-15 15:20:55 +00:00
Bodo Möller
bf6a0c5631 fix warnings (CHARSET_EBCDIC)
Submitted by: Lorinczy Zsigmond <lzsiga@mail.ahiv.hu>
2002-08-15 14:54:16 +00:00
Bodo Möller
8d9450deb0 fix manpage
Submitted by: thomas poindessous <poinde_t@epita.fr>
2002-08-15 14:22:27 +00:00
Richard Levitte
0a2a5fc988 Add a FAQ entry for yet another bc failure.
PR: 199
2002-08-15 10:50:36 +00:00
Richard Levitte
ffcbf991b1 Sometimes, the value of the variable containing the compiler call can
become rather large.  This becomes a problem when the default 1024
character large buffer that WRITE uses isn't enough.  WRITE/SYMBOL
uses a 2048 byte large buffer instead.
2002-08-15 08:29:58 +00:00
Bodo Möller
1a87374ed2 change how pod2man is handled: explicitly invoke '$PERL' only when
needed, call 'pod2man' directly if this works

PR: 217
2002-08-14 14:10:25 +00:00
Richard Levitte
425d06d178 Instead of returning errors when certain flags are unusable, just ignore them.
That will make the test go through even if DH (or in some cases ECDH) aren't
built into OpenSSL.
PR: 216, part 2
2002-08-14 12:18:29 +00:00
Richard Levitte
7ee5c0a0a2 Do not use the word 'modulus', which is a class template name in VC++ 6.0/SP5.
PR: 216, point 3
2002-08-14 12:08:44 +00:00
Richard Levitte
bf6635038f Small syntax error corrected. Fortunately, this one only issues a
warning, and is thereby ignored by the rest of the command procedure.
The only problem would be if SSL_TASK.C failed to compile, which
hasn't happened in ages...
2002-08-14 11:27:25 +00:00
Richard Levitte
d3b59c8dcf Make sure that the test input file comes in the same record format as the
typical output from a program in C.
PR: 222
2002-08-14 11:08:52 +00:00
Dr. Stephen Henson
1318510f8c Fix typo in OBJ_txt2obj which incorrectly passed the content
length, instead of the encoding length to d2i_ASN1_OBJECT.

This wasn't visible before becuse ASN1_get_object() used
to read past the length of the supplied buffer.
2002-08-14 00:36:44 +00:00
Richard Levitte
532441a93a Time to go on... 2002-08-09 12:08:23 +00:00
Richard Levitte
4c68b3239b Time to release 0.9.6g.
The tag will be OpenSSL_0_9_6g.
2002-08-09 11:37:15 +00:00
Richard Levitte
b91734063f When we want to give a -f argument to $(MAKE), we'd better make sure the
variable doesn't already contain a -f argument.
PR: 203, part 4
2002-08-09 08:49:53 +00:00
Bodo Möller
ca2b12feec entry for change in 'engine' branch 2002-08-09 08:13:13 +00:00
Richard Levitte
67df1b6139 Since we moved the pod2man check to be outside the loop, the path to it is different.
PR: 203, part 3
2002-08-09 07:39:57 +00:00
Richard Levitte
d4e122b36c Remove an extra @, since that line is now a continuation of the previous one.
PR: 203, part 2
2002-08-09 07:37:28 +00:00
Richard Levitte
262e9b70d7 Parse version numbers prefixed with text (egcs does that, even with
-dumpversion).
PR: 203, part 1
2002-08-09 07:32:38 +00:00
Richard Levitte
18794c6a83 Tagging has been done, update to next development version. 2002-08-08 21:23:51 +00:00
Richard Levitte
df75a709c9 Time to release version 0.9.6f.
The tag will be OpenSSL_0_9_6f.
2002-08-08 20:51:52 +00:00
Richard Levitte
27b115938b make update 2002-08-08 20:41:20 +00:00
Dr. Stephen Henson
20515fe7df Fix typo 2002-08-02 19:00:21 +00:00
Dr. Stephen Henson
24f55d7675 Fix the ASN1 sanity check: correct header length
calculation and check overflow against LONG_MAX.
2002-08-02 18:41:08 +00:00
Richard Levitte
3e34aaafad Certain flag macros were tested with #if instead if #ifdef... 2002-08-02 11:14:06 +00:00
Bodo Möller
517a0e7fa0 get rid of OpenSSLDie 2002-08-02 10:51:59 +00:00
Richard Levitte
0e0ddc43cf We don't need to find out which pod2man to use more than once 2002-08-01 21:53:24 +00:00
Richard Levitte
c2b365cbcc Don't try testing with parallell make, that will just fail.
PR: 175
2002-08-01 21:34:56 +00:00
Richard Levitte
21925f8435 Linux on s390 really knows about loading dynamically.
PR: 183
2002-08-01 13:50:41 +00:00
Richard Levitte
a946c18d8f Make sure it's possible to check GCCVER even if it wasn't set.
PR: 179
2002-08-01 10:17:05 +00:00
Richard Levitte
6de41cf0d9 If CRYPTO_realloc() is called with a NULL pointer, have it call
OPENSSL_malloc().
PR: 187
2002-08-01 10:08:53 +00:00
Richard Levitte
f8acaa92ec Make sure to use $(MAKE) everywhere instead of make.
Part of PR 181
2002-07-31 13:49:22 +00:00
Richard Levitte
d5f71f40a5 ln -f -s doesn't always work, so do a rm -f followed by a ln -s.
Part of PR 181
2002-07-31 13:38:50 +00:00
Lutz Jänicke
2c3bd4778e Next version of 0.9.6 would be 0.9.6f.
Submitted by:
Reviewed by:
PR:
2002-07-30 10:52:36 +00:00
Lutz Jänicke
05ebb1e7cf Release 0.9.6e.
Submitted by:
Reviewed by:
PR:
2002-07-30 10:34:35 +00:00
Lutz Jänicke
bb41724483 OpenSSL Security Advisory [30 July 2002]
Changes marked "(CHATS)" were sponsored by the Defense Advanced
Research Projects Agency (DARPA) and Air Force Research Laboratory,
Air Force Materiel Command, USAF, under agreement number
F30602-01-2-0537.
Submitted by:
Reviewed by:
PR:
2002-07-30 10:19:01 +00:00
Lutz Jänicke
d12eb7b024 "make update"
Submitted by:
Reviewed by:
PR:
2002-07-30 09:32:45 +00:00
Bodo Möller
693dc88fc6 mention SSL_do_handshake() 2002-07-29 12:34:47 +00:00
Bodo Möller
c3fa44cb17 typo etc. 2002-07-25 11:17:01 +00:00
Bodo Möller
fc288e5740 more detailed instructions for export from US 2002-07-25 11:16:05 +00:00
Bodo Möller
e6db99a4ab BIS URL really spells 'Notify' as 'Nofify' 2002-07-25 11:01:22 +00:00
Bodo Möller
99078a3e6f bxa => bis 2002-07-25 11:00:19 +00:00
Richard Levitte
8792704cf2 Don't clobber loop variable.
PR: 159
2002-07-24 14:42:05 +00:00
Lutz Jänicke
5787727f5d HP-UX shared libraries must be +x and should be -w. It doesn't hurt on
other platforms.
Submitted by:
Reviewed by:
PR: 134
2002-07-19 16:33:26 +00:00
Bodo Möller
b5b19ae0bd 'SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION' does not belong here,
it's 0.9.7 only
2002-07-19 12:37:30 +00:00
Bodo Möller
1802b96a42 update 2002-07-19 12:33:41 +00:00
Lutz Jänicke
165d5907c8 The behaviour is undefined when calling SSL_write() with num=0.
Submitted by:
Reviewed by:
PR: 141
2002-07-19 11:54:37 +00:00
Lutz Jänicke
61bed53665 Manual page for SSL_do_handshake().
Submitted by: Martin Sjögren <martin@strakt.com>
PR: 137
2002-07-19 11:07:53 +00:00
cvs2svn
124da0e580 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-07-19 11:05:52 +00:00
Geoff Thorpe
abcce97a97 this is a non-ENGINE version of the clarifications made to the other CVS
branches.

PR: 86
2002-07-18 22:24:25 +00:00
Richard Levitte
0ff3250f05 Allow subjects with more than 255 characters to be properly printed.
PR: 147
2002-07-18 17:59:27 +00:00
Bodo Möller
f0a3f16691 typo 2002-07-18 11:15:52 +00:00
Richard Levitte
c34a865f98 Reverse the change with the following log, it needs further investigation:
Make S/MIME output conform with the mail and MIME standards.
PR: 151
2002-07-18 10:39:34 +00:00
Richard Levitte
4f27f6be73 Make S/MIME output conform with the mail and MIME standards.
PR: 151
2002-07-18 08:47:47 +00:00
Richard Levitte
4d088fcede Make mkdir failsafe in case the directories are already present 2002-07-17 13:33:06 +00:00
Richard Levitte
5fe5996867 Add a few FAQ entries for the various ways building OpenSSL on MacOS X
can fail, and point at the text in the PROBLEMS file
2002-07-17 11:29:26 +00:00
Richard Levitte
8f56fcdfb0 On MacOS X, you're not allowed to have common objects in shared libraries 2002-07-17 08:20:40 +00:00
Richard Levitte
4d4d588fa1 Add the usually recommended solution to the linking problem entry for MacOS X 2002-07-17 07:48:44 +00:00
Richard Levitte
156e746981 The default C compiler on MacOS X doesn't like empty object files 2002-07-16 10:46:04 +00:00
Richard Levitte
79587521ae Add the new PROBLEMS section from HEAD 2002-07-16 10:39:37 +00:00
cvs2svn
aa131804c5 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-07-16 10:20:07 +00:00
Lutz Jänicke
9a55e8263c Rewording: some algorithms are also patented in Europe, so choose more
defensive phrases...
2002-07-12 15:27:35 +00:00
Lutz Jänicke
dfa098012f Discussion about Redhat's specialties for the FAQ.
Submitted by: John.Airey@rnib.org.uk
Reviewed by:
PR: 128
2002-07-10 19:49:47 +00:00
Lutz Jänicke
b3994e15d6 Typos in links between manual pages
Submitted by: Richard.Koenning@fujitsu-siemens.com
Reviewed by:
PR: 129
2002-07-10 19:37:08 +00:00
Lutz Jänicke
3406fae673 Sun's official statement with respect to /dev/random support.
Submitted by: Garrett Anderson garrett@dirsec.com
Reviewed by:
PR: 120
2002-07-10 17:53:04 +00:00
Lutz Jänicke
e0299ff63b Minor typos
Submitted by: jufi@nerdnet.de
Reviewed by:
PR: 138
2002-07-10 17:35:18 +00:00
Lutz Jänicke
d2cbe66ee1 Ciphers with NULL encryption were not properly handled because they were
not covered by the strength bit mask.
Submitted by:
Reviewed by:
PR: 130
2002-07-10 06:41:29 +00:00
Bodo Möller
7d0e1c1188 fix synopsis
Submitted by: Nils Larsch
2002-07-09 10:51:57 +00:00
Bodo Möller
0ac51fcf0b emtpy fragments are not necessary for SSL_eNULL
(but noone uses it anyway)
2002-07-09 08:48:03 +00:00
Lutz Jänicke
01a9310b75 README and INSTALL should contain information about the request tracker
(noted by Jonathan Louie <jlouie@recourse.com>).
2002-06-30 19:39:41 +00:00
Richard Levitte
e17af60f15 Try to avoid double declaration of ERR_load_PEM_strings().
PR 71
2002-06-27 17:06:52 +00:00
Richard Levitte
b2d4cea305 Apply the Borland Builder 5 changes that I forgot... 2002-06-27 15:55:44 +00:00
Richard Levitte
9b25ef8b2e The new stuff is for Borland Bulider 5, so document it appropriately 2002-06-27 15:11:32 +00:00
Richard Levitte
e2c07bce12 Use 32-bit sections instead of the default, 16-bit ones.
Part of PR 123
2002-06-27 14:54:48 +00:00
Richard Levitte
c678763f7d have 'openssl pkcs7' exit with code 1 on error instead of 0.
PR: 119
2002-06-27 10:27:11 +00:00
Richard Levitte
5a52e7ecad gcc requires -m64 to link 64-bit shared libraries on Solaris.
PR: 117
2002-06-27 10:20:39 +00:00
Richard Levitte
d466e8eb5a Use bg instead of bag as argument to macros, to avoid clashes with
structure field names.
PR: 112
2002-06-27 09:54:23 +00:00
Bodo Möller
2edfbc53d8 Make sure buffers are large enough even for weird parameters
Submitted by: Nils Larsch
2002-06-26 14:29:45 +00:00
Richard Levitte
ef42bf2a7e For some reason, we need to return the full path to perl 2002-06-25 11:42:05 +00:00
Lutz Jänicke
c6c12d6301 HP-UX: shared libraries MUST be +x and SHOULD be -w. 2002-06-20 19:54:13 +00:00
Lutz Jänicke
180a8f8e2c Fix path to find util/pod2man.pl from the execution directory.
Make sure to use the predefined PERL.
Submitted by: Bernhard Simon <bs@bsws.zid.tuwien.ac.at>
Reviewed by:
PR:
2002-06-20 19:51:40 +00:00
Lutz Jänicke
06d4c6b176 Use -dumpversion to obtain gcc's version.
Submitted by: ross.alexander@uk.neceur.com, allenh@eecs.berkeley.edu
Reviewed by:
PR: 96
2002-06-16 10:32:14 +00:00
Lutz Jänicke
132702460b Initial support for hpux64-parisc-gcc
Submitted by: ross.alexander@uk.neceur.com
Reviewed by:
PR: 96
2002-06-14 20:28:17 +00:00
Bodo Möller
32a76f2c75 New option SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS for disabling CBC
vulnerability workaround (included in SSL_OP_ALL).

PR: #90
2002-06-14 12:19:34 +00:00
Richard Levitte
578c1cdefa make update 2002-06-13 21:57:57 +00:00
Richard Levitte
c3347d0561 Add support for UWIN, a Unix-like environment on top of Windows.
PR: 62
2002-06-13 21:41:46 +00:00
Richard Levitte
1f5a2a4dde Make sure that any dash in the prefix before the version number is removed.
PR: 96
2002-06-13 21:12:20 +00:00
Lutz Jänicke
2994181b1b Correct wrong usage information.
PR: 95
2002-06-12 20:16:17 +00:00
Lutz Jänicke
d993f3af33 Support building the distribution .tar file on platforms with limited
argument list length. This requires Gnu-tar. As we use the non-standard
"tardy" software anyway, it doesn't hurt too much to require Gnu-tar.
"make dist" will probably only be used by team-members anyway.
2002-06-12 12:28:06 +00:00
Bodo Möller
1ffa78ec6c fix for 'make update' 2002-06-10 11:42:04 +00:00
Lutz Jänicke
64e3974013 Make sure that flags are passed to "make" subprocesses. 2002-06-10 08:12:12 +00:00
Lutz Jänicke
c6f0c60427 Make sure that settings are passed back and forth when walking around
in the tree during build.
Reinstall default PERL settings in Makefiles, as the real reason for the
failure was that the settings were not passed.
2002-06-06 11:14:40 +00:00
Richard Levitte
d23a74f71c Make perl replacement for dirname, for system that lack the latter.
PR: 81
2002-06-05 14:09:53 +00:00
Richard Levitte
12c853701e It's not good to have a pointer point at something in an inner block.
PR: 66
2002-06-05 13:47:06 +00:00
Richard Levitte
d5353b5ffb Unneeded cast removed 2002-06-05 13:12:55 +00:00
Richard Levitte
549ce02729 Check errors when parsing a PKCS8INF PEM FILE, or there will be a core dump on error.
PR: 77
2002-06-05 11:58:16 +00:00
Richard Levitte
ea2a6251b9 signedness warning corrected 2002-06-05 11:23:19 +00:00
Richard Levitte
89cac82066 Documentation bug corrected.
PR: 70
2002-06-05 09:29:33 +00:00
Lutz Jänicke
fa7688a5b1 On some systems the default "perl" may still be perl4, use the correct
version determined by "config" instead.
2002-06-05 07:25:49 +00:00
Lutz Jänicke
094ed2dd19 The correct PERL interpreter is passed via commandline. 2002-06-05 07:07:50 +00:00
Richard Levitte
d0f07ceeee Addapt loadkeys.c to API changes
PR: 64
2002-06-05 05:21:19 +00:00
Richard Levitte
68927d3670 Update the recognision of GCC version numbers to handle the prefix text
that GCC 3.1 adds to the --version output
2002-06-05 05:00:30 +00:00
Richard Levitte
ba6c905c93 make update 2002-06-04 22:33:28 +00:00
Lutz Jänicke
fa54157a11 Typo. 2002-06-04 20:44:58 +00:00
Richard Levitte
ea4df8ad62 Reformat the CFLAG string so it can be made part of a C string.
Incidently, this works pretty well on the command line as well.
PR: 52
2002-05-30 18:07:30 +00:00
Richard Levitte
dbf50f36c4 Support the newly release gcc 3.1 on 64-bit Solaris. Not automatic.
PR: 57
2002-05-30 17:28:34 +00:00
Richard Levitte
d49ceb3328 Support shared libraries properly on linux-sparcv[89].
PR: 60
2002-05-30 17:08:47 +00:00
Richard Levitte
d66c022a1f Check the return values where memory allocation failures may happen.
PR: 49
2002-05-30 16:49:00 +00:00
Richard Levitte
04c8e99b39 CAformat should not be used for CA key format. 2002-05-30 16:24:33 +00:00
Richard Levitte
09402efb93 pod2man.pl would only remove the first LF from the name. 2002-05-30 15:30:27 +00:00
Richard Levitte
2619064e09 Apparently, there are still chances we have to deal with buggy pod2man versions.
Deal with that by testing any available pod2man and using it if appropriate,
and falling back to util/pod2man.pl if none was found.
2002-05-30 15:18:19 +00:00
Richard Levitte
3cda197ee3 Avoid freeing certain things twice.
PR: 43
2002-05-30 12:51:16 +00:00
Richard Levitte
c019099cb6 Correct darwin shared library support.
PR: 39
2002-05-30 12:17:03 +00:00
Richard Levitte
043e8ec568 Some shlib extensions were in the wrong field 2002-05-30 10:47:36 +00:00
Richard Levitte
e57a8c732b Our copy of pod2man.pl is old and comparatively broken, so lets remove it.
PR: 30
2002-05-30 10:18:32 +00:00
Richard Levitte
da0bab4c0c Remove the duplicate description of -out.
PR: 28
2002-05-30 06:24:41 +00:00
Dr. Stephen Henson
9b652e84a8 Make i2c_ASN1_BIT_STRING return the correct length. 2002-05-29 23:13:16 +00:00
Richard Levitte
b91c29147b Set DLOPEN_FLAG the same way on NetBSD as on OpenBSD.
PR: 58, submitted by andrew@cis.uoguelph.ca
2002-05-29 20:55:25 +00:00
Richard Levitte
1af4d83565 There is a chance that the input string is larger than size, and on VMS,
this wasn't checked and could possibly be exploitable (slim chance, but still)
2002-05-29 08:31:30 +00:00
Lutz Jänicke
c1febe86d1 Remove item listed twice <kromJx@crosswinds.net>. 2002-05-28 17:47:17 +00:00
Richard Levitte
6c53759a50 Recover from errors 2002-05-23 23:33:22 +00:00
Richard Levitte
8c20ab7994 Avoid loops when linking doesn't work 2002-05-23 15:27:29 +00:00
Bodo Möller
a9950dfb67 fix EVP_dsa_sha macro
Submitted by: Nils Larsch
2002-05-16 12:55:56 +00:00
Bodo Möller
a385a1aef0 make b_print.c consistent with the rest of OpenSSL:
disable assert() except for debug builds
2002-05-14 19:04:54 +00:00
Lutz Jänicke
1126740ddd Fix targets sco5 and svr5 (shared). Boyd Gerber <gerberb@zenez.com>. 2002-05-12 20:36:19 +00:00
Lutz Jänicke
fa9647d62f Recognize PPC64 target.
Submitted by:
Reviewed by:
PR: 26
2002-05-12 19:45:02 +00:00
Richard Levitte
5981eee041 Updating status for 0.9.6d 2002-05-09 23:53:01 +00:00
Richard Levitte
be730546c8 Add space for changes in 0.9.6e. 2002-05-09 23:02:13 +00:00
Richard Levitte
daab6e86f4 Now that tagging has been done, let the version go on to 0.9.6e-dev. 2002-05-09 22:59:00 +00:00
Richard Levitte
5317543ada About to release 0.9.6d, so set all versoin numbers right.
The tag will be OpenSSL_0_9_6d.
2002-05-09 22:40:31 +00:00
Richard Levitte
38d3544867 make update 2002-05-09 21:16:19 +00:00
Richard Levitte
9811a7406c Make the huge buffer smaller, so the size becomes reasonable for small-stack environments.
Notified by Verdon Walker <VWalker@novell.com>
2002-05-09 20:14:17 +00:00
Richard Levitte
2d4ce88b11 Move an assert() to avoid core dumps when a static buffer hasn't been given.
Notified by Verdon Walker <VWalker@novell.com>
2002-05-09 18:19:35 +00:00
Richard Levitte
2cbe7e26c0 Backport the semicolon fix from the 0.9.7 and 0.9.8-dev branches 2002-05-08 15:50:48 +00:00
Richard Levitte
a6c4ee6d79 Small documentation fix for EVP_CipherFinal or EVP_CipherFinal_ex.
Notified by Stella Power <snpower@maths.tcd.ie>.
PR: 24
2002-05-08 15:20:12 +00:00
Richard Levitte
3f8c72ce77 Generate an error if rewinding wasn't possible.
Notified by Ken Hirsch <kenhirsch@myself.com>.
PR: 23
2002-05-08 15:13:35 +00:00
Bodo Möller
35fbadb322 fix warning 2002-05-06 10:42:56 +00:00
Bodo Möller
42e453201d update 2002-05-05 23:48:29 +00:00
Bodo Möller
ea9e248cde fix casts 2002-05-05 23:01:42 +00:00
Richard Levitte
3d24c18200 Make sure that date is run under the C locale, so dates are given in the
default format.
PR: 16
2002-05-02 08:06:03 +00:00
Dr. Stephen Henson
64f1ae3868 Win32 VC++ warning fixes. 2002-05-02 01:52:18 +00:00
Richard Levitte
9cf94f9ed3 Fix unsigned vs. signed clash 2002-04-29 10:30:05 +00:00
Bodo Möller
c15bf8f609 Fix crypto/asn1/a_sign.c so that 'parameters' is omitted (not
encoded as NULL) with id-dsa-with-sha1.

Submitted by: Nils Larsch
2002-04-26 08:30:31 +00:00
Richard Levitte
6b42cad215 Potential memory leak removed. Notified by <threaded@totalise.co.uk> 2002-04-25 10:10:51 +00:00
Bodo Möller
4a34577ec8 oops 2002-04-25 07:46:45 +00:00
Bodo Möller
6e7af77268 AlgorithmIdentifier bugs 2002-04-25 06:29:38 +00:00
Bodo Möller
5c5a2cd273 fix usage (no 'key') 2002-04-23 13:54:54 +00:00
Richard Levitte
1c4dc1517d Uhmmm, if we use && after having tested for the presence of the certificate,
we just *might* stand a certain chance of actually getting it written
to file...
2002-04-23 13:15:22 +00:00
Lutz Jänicke
07a0226c28 Add cygwin build script (Corinna Vinschen <vinschen@redhat.com>). 2002-04-21 17:55:55 +00:00
cvs2svn
2ced9dc822 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-04-21 17:54:05 +00:00
Lutz Jänicke
9a12193611 Leave out problematic assembler part for sco5-gcc-shared target
(Tim Rice <tim@multitalents.net>).
2002-04-21 17:42:02 +00:00
Richard Levitte
ea599390c6 Make sure the opened directory is closed on exit.
Notified by Lorinczy Zsigmond <lzsiga@mail.ahiv.hu>
2002-04-18 16:20:32 +00:00
Lutz Jänicke
0a0102b0fd Optimize: better shortcut evaluation ("Howard Chu" <hyc@highlandsun.com>). 2002-04-18 11:52:28 +00:00
Bodo Möller
1532a839fc synchronize with engine branch (some changes were done only
there for no particular reason)
2002-04-18 09:27:14 +00:00
Lutz Jänicke
d77ee3b75c Handle headings uniformly to allow automatic processing. 2002-04-18 08:18:41 +00:00
Richard Levitte
c387a61fdd 0.9.6d-beta1 is about to be built. Change version numbers and strings
accordingly.
2002-04-17 12:28:37 +00:00
Bodo Möller
5d2175eddb check return values
Submitted by: Nils Larsch
2002-04-17 09:29:54 +00:00
Lutz Jänicke
7680669c33 Fix CRLF problem in BASE64 decode. 2002-04-15 09:51:10 +00:00
Bodo Möller
a6ec2d58ba improve binary compatibility 2002-04-14 08:25:41 +00:00
Bodo Möller
82c77c1b32 Implement known-IV countermeasure.
Fix length checks in ssl3_get_client_hello().

Use s->s3->in_read_app_data differently to fix ssl3_read_internal().
2002-04-13 22:49:28 +00:00
Ulf Möller
ea72ff2df7 error reported by Karsten Braaten 2002-04-13 10:00:01 +00:00
Bodo Möller
4e5b835c6a synchronize with OpenSSL-engine-0_9_6-stable 2002-04-12 13:44:04 +00:00
Richard Levitte
1171f28f97 Check error code from a2d_ASN1_OBJECT(). 2002-04-11 22:14:51 +00:00
Lutz Jänicke
5c04e56285 Synchronize with 0.9.7-stable 2002-04-11 18:45:15 +00:00
Lutz Jänicke
9bac8d91d9 Keep my own specially optimized HP-UX shared library building up to date. 2002-04-10 12:37:59 +00:00
Bodo Möller
875e8fca2d harmonize capitalization 2002-04-09 12:43:18 +00:00
Ulf Möller
39ee29b02c error reported by Karsten Braaten 2002-04-07 13:33:26 +00:00
Richard Levitte
847b76dd0e Allow longer program names (VMS allows up to 39 characters).
Submitted by Compaq.
2002-04-06 20:22:32 +00:00
Richard Levitte
c901a0538b make update 2002-04-06 19:08:51 +00:00
Richard Levitte
a5ee2b5232 Allow longer program names (VMS allows up to 39 characters).
Submitted by Compaq.
2002-04-06 18:59:43 +00:00
Richard Levitte
f520a2a8c2 Recognise DEC C++ as equivalent to DEC C for the definitions of OPENSSL_EXTERN and OPENSSL_GLOBAL.
Submitted by Compaq.
2002-04-06 11:37:07 +00:00
Richard Levitte
78e7617324 Use recv() and send() for socket communication on VMS instead of read()
and write().  The reason is that read() and write() make additional record
level locking which causes hangs of Compaq Secure Web Server (Apache) with
SSL.
Submitted by Compaq.
2002-04-06 11:35:40 +00:00
Richard Levitte
56d490cd40 Don't define RSA-specifici variables when RSA isn't used. 2002-04-06 09:57:52 +00:00
Richard Levitte
9bd313b83d Make shared libraries resolve global symbols within themselves first.
Currently only on GNUish linkers...
Submitted by Steven Bade <sbade@austin.ibm.com>
2002-04-06 09:42:31 +00:00
Lutz Jänicke
50e4d01fa0 Fix buggy object definitions (Svenning Sorensen <sss@sss.dnsalias.net>). 2002-04-04 17:56:57 +00:00
Richard Levitte
4a579233b4 Fix of mixup bwtween SOMAXCONN and SO_MAXCONN.
Furthermore, make SO_MAXCONN the first choice, since that's the standard
(as far as I know).
2002-03-29 23:48:29 +00:00
Lutz Jänicke
ca3bba36c4 Fix typo (Craig Davison <cd@securityfocus.com>). 2002-03-25 17:10:20 +00:00
Ben Laurie
a37d05fa56 Fix warning. 2002-03-25 12:53:25 +00:00
Lutz Jänicke
b111c5b8ce Fix buggy if-condition (thomas poindessous <poinde_t@epita.fr>). 2002-03-21 19:14:56 +00:00
Lutz Jänicke
7228bfb439 Remove superflous (and buggy) statement <justin.fletcher@ntlworld.com>. 2002-03-21 19:11:19 +00:00
Bodo Möller
687f9d2b94 fix DH_generate_parameters for general 'generator' 2002-03-20 16:01:29 +00:00
Lutz Jänicke
6bcba344b5 Map new X509 verification errors to alert codes (Tom Wu <tom@arcot.com>). 2002-03-19 16:47:09 +00:00
Bodo Möller
6cebd2dd00 in INCLUDES, use '-I../..' so that we find "e_os.h" 2002-03-18 10:54:56 +00:00
Bodo Möller
b82a94ee26 use '-I../..' so that we find "e_os.h" 2002-03-18 10:53:01 +00:00
Bodo Möller
ba5541e1ad Rename 'cray-t90-cc' into 'cray-j90'.
Add to 'config'.
2002-03-15 16:47:23 +00:00
Bodo Möller
84b45fda86 oops -- undo previous commit, I'm still waiting for confirmation
from Weny Palm
2002-03-15 11:09:31 +00:00
Bodo Möller
7aacd4c458 fix ssl3_pending 2002-03-15 10:53:34 +00:00
Lutz Jänicke
e18ed57afd Add missing strength entries. 2002-03-14 18:56:59 +00:00
Bodo Möller
ff9722c7f1 use BIO_nwrite() more properly to demonstrate the general idea of
BIO_nwrite0/BIO_nwrite (the previous code was OK for BIO pairs but not
in general)
2002-03-14 09:49:10 +00:00
Bodo Möller
08f38d887e we need e_os.h 2002-03-14 09:45:37 +00:00
Bodo Möller
5798378a22 add a paragraph from 0.9.7-dev/0.9.8-dev 2002-03-12 12:22:08 +00:00
Richard Levitte
e1fefe8124 Typo. 2002-03-06 06:13:44 +00:00
Bodo Möller
b8b09625dc Rephrase statement on the security of two-key 3DES.
[Chosen plaintext attack: R. Merkle, M. Hellman: "On the Security of
  Multiple Encryption", CACM 24 (1981) pp. 465-467, p. 776.

  Known plaintext angriff: P.C. van Oorschot, M. Wiener: "A
  known-plaintext attack on two-key triple encryption", EUROCRYPT '90.]
2002-03-05 15:30:41 +00:00
Richard Levitte
54d78c4778 Make it so one can select tests from within the test directory 2002-03-04 15:58:49 +00:00
Bodo Möller
354d263e44 _INT_MAX should read INT_MAX (this is correct in the 0.9.7-dev and
main branches)
2002-03-01 14:05:30 +00:00
Bodo Möller
f85b14c4ba add missing '#endif'
Submitted by:  Oscar Jacobsson <oscar@jacobsson.org>
2002-03-01 14:01:27 +00:00
Lutz Jänicke
ec20856622 Fix the fix (Yoram Zahavi)... 2002-02-27 11:26:20 +00:00
Lutz Jänicke
e463138be9 SSL_clear != SSL_free/SSL_new 2002-02-27 08:11:18 +00:00
Lutz Jänicke
ce1e801013 Make sure to remove bad sessions in SSL_clear() (found by Yoram Zahavi). 2002-02-26 21:50:28 +00:00
Richard Levitte
03a6dcdf31 make update 2002-02-26 14:18:23 +00:00
Richard Levitte
bfb863b8b5 As in 0.9.7 and on, let's remove the use of MS_FAR, and thereby the
need for e_os.h.
2002-02-21 16:38:09 +00:00
Bodo Möller
f261295d9c disable '#ifdef DEBUG' sections 2002-02-21 14:07:55 +00:00
Bodo Möller
f4702b467e disable '#ifdef DEBUG' sections 2002-02-21 12:56:50 +00:00
Richard Levitte
2aa5dac48f Stop assuming the IV is 8 bytes long, use the real size instead.
This is especially important for AES that has a 16 bytes IV.
2002-02-20 17:55:34 +00:00
Richard Levitte
fae0ff419a Including openssl/e_os.h in the OpenSSL 0.9.6 branch is legal, since
it's exported.  Changing that is a BIG step, which has been done in
0.9.7-dev.
2002-02-20 17:39:25 +00:00
Richard Levitte
74e6916996 Merge in Cygwin-related changes from main trunk. 2002-02-16 22:45:06 +00:00
Richard Levitte
99738e6393 Give the linux-sparv9 target shared capability.
Submitted by Ian Marsh <mushypea@dominion.net.uk>
2002-02-15 16:22:58 +00:00
Lutz Jänicke
0df2a19b10 Even though it is not really practical people should know about it. 2002-02-15 09:36:08 +00:00
cvs2svn
1c8f840653 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-02-15 07:41:45 +00:00
Bodo Möller
e2d39e421d fix indentation 2002-02-14 16:06:19 +00:00
Richard Levitte
2ff622cf9d Add the configuration target VxWorks. 2002-02-14 15:36:50 +00:00
Richard Levitte
b92fb90de5 make update 2002-02-14 13:37:29 +00:00
Richard Levitte
8481a0905b The Cygwin shared extension was shifted. 2002-02-14 13:36:38 +00:00
Richard Levitte
44bbfcddaf At Corinna Vinschen's request, change CygWin32 to Cygwin 2002-02-14 12:29:02 +00:00
Richard Levitte
6b7b277900 Correct sh, please 2002-02-14 02:20:41 +00:00
Bodo Möller
5e99ec6c7c it's year 2002 now 2002-02-13 18:22:18 +00:00
Richard Levitte
52f3038667 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:45:19 +00:00
Richard Levitte
1827be43ab Merge in the slightly more efficient variant of link-shared from the
main trunk.
2002-02-13 10:32:07 +00:00
Ulf Möller
8935c03618 add casts as in head (required for VC++) 2002-02-11 17:44:30 +00:00
Lutz Jänicke
76dca45720 Backport from 0.9.7:
Make removal from internal session cache more robust and do not store
into internal session cache when it won't be looked up anyway.
2002-02-10 12:52:57 +00:00
Richard Levitte
a5f158fa0b ASN1_BIT_STRING_set_bit() didn't clear previously set bits 2002-02-03 21:27:04 +00:00
Richard Levitte
1a11273bc3 Merge in the sanity checker from 0.9.7-dev. 2002-01-27 17:05:39 +00:00
Richard Levitte
babc4d0e7a Make sure libssl.sl will depend on the local libcrypto.sl, not on
another (that possibly doesn't even exist!).
2002-01-26 16:50:40 +00:00
Richard Levitte
c9c111468c Update SCO5 targets. 2002-01-26 05:21:08 +00:00
Richard Levitte
73feb5418d Apply a small patch from Dan Lanz <lanz@zolera.com> to get shared
libraries with debug-linux-elf.
2002-01-26 05:07:56 +00:00
Richard Levitte
b3467218f8 According to the main trunk, Darwin should get USE_TOD defined. 2002-01-26 05:02:45 +00:00
Richard Levitte
f760c5d80b From reports I've seen, it looks like TIMES is wrong for Darwin. 2002-01-26 04:44:39 +00:00
Richard Levitte
4fd350e8f5 Apply Neale Ferguson's patch to add a configuration target for linux-s390x 2002-01-25 22:13:26 +00:00
Lutz Jänicke
bc52146aee Typos (jsyn <jsyn@openbsd.org>). 2002-01-21 18:02:27 +00:00
Lutz Jänicke
348c9e5985 Fix incorrect BIO_*_ctrl() macros (Shay Harding <sharding@ccbill.com>). 2002-01-21 17:58:53 +00:00
Ulf Möller
06e6478d6f *** empty log message *** 2002-01-16 19:22:36 +00:00
Bodo Möller
19fa8cfe5a 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:42:47 +00:00
Bodo Möller
5f18fe493e Return -1 from ssl3_get_server_done (ssl3/s3_clnt.c) if
the SSL_R_LENGTH_MISMATCH error is detected.
2002-01-14 12:42:38 +00:00
Richard Levitte
d16e3759a8 Patches to make OpenSSL compilable on MacOS/X.
Submitted by Pier Fumagalli <pier@betaversion.org>
2002-01-08 09:19:55 +00:00
Bodo Möller
31961f7308 use some descriptions from Lutz' redundant manual page
instead of the previous ones
2002-01-04 15:21:26 +00:00
Lutz Jänicke
2e1b411f23 Tsss, SSLeay_version() was already documented, it just was not linked in. 2002-01-04 15:08:34 +00:00
Bodo Möller
4d77825557 add symbols reserved in 'engine' tree (tagged as NOEXIST) 2002-01-04 15:02:40 +00:00
Lutz Jänicke
439c7ba540 Add information as provided by Richard Levitte on openssl-users :-) 2002-01-04 14:57:31 +00:00
cvs2svn
edbbf22a0e This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2002-01-04 14:55:39 +00:00
Bodo Möller
1cb8923507 fix 'Configure TABLE' output 2002-01-04 13:29:20 +00:00
Bodo Möller
83f1147664 Changes that break something should be included in CHANGES
to make it easier to fix things.
2002-01-04 13:28:04 +00:00
Bodo Möller
4d4744ef48 fix EVP_CIPHER_mode macro
Submitted by: "Dan S. Camper" <dan@bti.net>
2002-01-04 13:04:15 +00:00
Richard Levitte
0242564c17 Better clarification on perl 2002-01-03 18:53:55 +00:00
Richard Levitte
e8d2e6cac2 Use the variable $(PERL) to invoke perl.
Noted by Joe Orton <jorton@redhat.com>
2002-01-03 14:08:02 +00:00
Richard Levitte
651fa63e2b Allow verification of other types than DATA.
Submitted by Leonard Janke <leonard@votehere.net>
2002-01-02 11:54:32 +00:00
Richard Levitte
6a40c26308 Say that recent CygWin perl versions work as well.
Submitted by Eric Hanchrow <erich@votehere.net>
2002-01-02 11:25:11 +00:00
Richard Levitte
b7342e116b 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:17 +00:00
Richard Levitte
9d7bb313e3 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:40 +00:00
Richard Levitte
00b6ab09fc Add support for Linux on HP/PA.
Submitted by "Bryan W. Headley" <bheadley@interaccess.com>
2002-01-02 10:00:52 +00:00
Ulf Möller
c99b94be3e ssl3_read_bytes bug fix
Submitted by: D P Chang <dpc@qualys.com>
Reviewed by: Bodo
2001-12-28 17:13:10 +00:00
Bodo Möller
b9bb1c5f77 This should be in 0.9.6c, but somehow escaped from the commit ...
But note that 0.9.6c has correct versions of the files autogenerated
from objects.txt (obj_mac.h, obj_dat.h), so libraries built from
the source distribution will not be buggy.
2001-12-21 12:23:05 +00:00
Bodo Möller
87af0e5e19 Fix FAQ, although in case there is another release from this tree,
it won't be correct anymore anyway: current version is 0.9.6c.
not 0.9.6b.
(The engine version does not have this typo.)
2001-12-21 12:15:36 +00:00
Richard Levitte
76b5524d3d Status update 2001-12-21 03:23:20 +00:00
Richard Levitte
0b421d35fb 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:26:39 +00:00
Richard Levitte
b2f570ecbb Time to release 0.9.6c. The tag will be OpenSSL_0_9_6c 2001-12-21 01:21:23 +00:00
Richard Levitte
988988807f And just for the sake of completeness, let's add some standard macros... 2001-12-21 01:12:43 +00:00
Richard Levitte
b1b62e7976 Better use the same number in all branches, to avoid confusion 2001-12-21 01:09:07 +00:00
Dr. Stephen Henson
069eb94607 Add missing ERR_LIB_COMP #define 2001-12-21 00:48:45 +00:00
Richard Levitte
5dfaf1c437 make update 2001-12-20 22:25:41 +00:00
Richard Levitte
c6c5cf1754 Do not forget to compile comp_err.c 2001-12-20 22:15:42 +00:00
Ulf Möller
3d7b414c55 remove some useless information (change log is in CHANGES) 2001-12-20 12:36:39 +00:00
Richard Levitte
863b1279f7 Summarize the news. 2001-12-20 11:04:46 +00:00
Bodo Möller
24ceef033a make sure mklink.pl looks at ERR_load_... 2001-12-19 19:48:51 +00:00
Ulf Möller
fe165e465b Cygwin patch. Submitted by Michael Kobar <mkobar@lymeware.com> 2001-12-19 19:37:41 +00:00
Bodo Möller
3ece3605ac remove redundant ERR_load_... declarations 2001-12-17 19:24:39 +00:00
Bodo Möller
b35ef576f4 correction: certain changes have been done *after* 0.9.6b was released 2001-12-17 19:08:39 +00:00
Bodo Möller
865ce8abcb fix BN_rand_range 2001-12-14 10:09:01 +00:00
Ulf Möller
a69b3e94f3 name confusion with HP library function prototype (?) 2001-12-10 18:52:42 +00:00
Dr. Stephen Henson
7f0f3f17b3 Don't overwrite signing time. 2001-12-07 00:40:53 +00:00
Lutz Jänicke
0bc2e28295 HPUX 9.X on m68k with gcc
("Anton J. Gamel" <gamel@anna.anatomie.uni-freiburg.de>)
2001-12-06 13:11:42 +00:00
Richard Levitte
4b16376d51 "UID" is an incorrect lable for the attribute type uniqueIdentifier.
Furthermore, it create conflicts with LDAP and some RFCs that define
"UID" as a lable for the attribute type userId (which we haven't even
defined here).

The next question is if we should update objects.txt with the added
stuff from the main trunk.
2001-12-04 11:10:54 +00:00
Richard Levitte
fe094cdfe3 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:50:52 +00:00
Bodo Möller
276753772e crypto/objects stuff 2001-12-03 13:54:58 +00:00
Bodo Möller
16712ec35e Fix: 2.5.29 is "id-ce", not "ld-ce" (sort of a typo in objects.h).
Fix: Some ip-pda OIDs were incorrect (cf. RFC 3039).

Also change Perl scripts to put auto-generation warning in the
first lines of the file.
2001-12-03 13:44:24 +00:00
Lutz Jänicke
4e6c537141 Support for QNX 6 (wrat@jump.net (the wharf rat)). 2001-11-30 09:36:15 +00:00
Bodo Möller
1b0613e313 discuss -name and default_ca more correctly (I hope) 2001-11-26 12:14:22 +00:00
Bodo Möller
75140e8bc9 update with info on engine branch 2001-11-23 21:11:46 +00:00
Bodo Möller
f717e5460f fix submitted by Andy Schneider <andy.schneider@bjss.co.uk> 2001-11-23 20:57:59 +00:00
Bodo Möller
65129e1d57 OS/390 support
Submitted by: Richard Shapiro <rshapiro@abinitio.com>
2001-11-22 11:26:54 +00:00
Bodo Möller
2a6db68797 OS/390 support
Submitted by: Richard Shapiro <rshapiro@abinitio.com>
2001-11-22 11:15:00 +00:00
cvs2svn
2b98d1ccb7 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-11-22 11:09:43 +00:00
Richard Levitte
ce8ac3dc00 Extentions of the explanations to the linking problem on Win32. Provided by Andrew Gray <agray@iconsinc.com> 2001-11-19 20:46:47 +00:00
Lutz Jänicke
c156d5c9bd Clarify reference count handling/removal of session
(shinagawa@star.zko.dec.com).
2001-11-19 11:12:30 +00:00
Richard Levitte
54b293ec3c 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:13:09 +00:00
Richard Levitte
5a8e7c5bec Restore extern "C" balance. 2001-11-15 14:33:49 +00:00
Richard Levitte
75df0bb231 perl util/mkerr.pl -recurse -write -rebuild 2001-11-15 12:44:57 +00:00
Richard Levitte
22b540f5c2 make update
perl util/mkdef.pl crypto update rewrite
2001-11-15 12:41:39 +00:00
Richard Levitte
479275ef18 make update
perl util/mkdef.pl crypto update rewrite
2001-11-15 12:36:30 +00:00
Richard Levitte
6f3fa4b71d Apply the following changes from the main trunk:
2001-03-08 13:14  bodo

	* util/mkerr.pl (1.14): Change mkerr.pl so that it puts the
	ERR_load_..._strings() prototype in header files that it writes.

2001-05-10 02:07  steve

	* util/mkerr.pl (1.15): Fix to allow multiple NONE libraries in
	mkerr.pl .
2001-11-15 12:18:01 +00:00
Geoff Thorpe
2f4dca7052 The change in the HEAD to not cache gethostbyname() values made two
functions redundant - which were later commented out. This does the same
for the merge of the gethostbyname() change to 0.9.6-stable.
2001-11-15 01:56:10 +00:00
Bodo Möller
7b78aa0e8d remove obsolete entry 2001-11-14 21:21:04 +00:00
Bodo Möller
c37e7bf580 fix warning 2001-11-14 21:19:47 +00:00
Bodo Möller
926606deab consistency between main branch and stable branch 2001-11-14 21:18:30 +00:00
Richard Levitte
f98c9972a7 Remove temporary files 2001-11-14 10:59:35 +00:00
Richard Levitte
df7cae352d Apply the following changes from the main trunk:
2001-10-10 16:46  levitte

	* Configure (1.294), Makefile.org (1.142): 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-11-14 10:44:13 +00:00
Richard Levitte
eda75c31e3 Apply the following changes from the main trunk:
2001-06-05 06:41  levitte

	* Makefile.org (1.137): Small detail about AIX forgotten...
2001-11-14 10:08:55 +00:00
Richard Levitte
2e689f6040 Apply the following changes from the main trunk:
2001-02-13 14:08  levitte

	* Configure (1.251): Update of linux-ppc.  Contributed by MATSUURA
	Takanori <t-matsuu@protein.osaka-u.ac.jp>
2001-11-14 09:45:30 +00:00
Richard Levitte
ea494f7b88 Apply the following changes from the main trunk:
2001-04-27 23:33  levitte

	* Makefile.org (1.135): 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-11-14 09:44:37 +00:00
Richard Levitte
8250f6f1fc Apply the following changes from the main trunk:
2001-04-26 22:17  levitte

	* Makefile.org (1.134): Linux shared libraries can be linked with
	debug symbols.	Tru64 shared libraries can be linked with static
	libraries.
2001-11-14 09:38:55 +00:00
Richard Levitte
eb0c85dec3 Apply the following changes from the main trunk:
2001-01-10 17:43  bodo

	* Makefile.org (1.118): Pass ${PERL} down to the Makefile in
	sub-directory "test" in "make tests"

2001-01-10 17:40  bodo

	* Makefile.org (1.117): Use $(PERL) in place of hard-coded perl
2001-11-14 08:26:55 +00:00
Richard Levitte
9332b8c1c4 Apply the following change from the main trunk:
2000-12-01 02:11  levitte

	* Configure (1.243), config (1.71): Recognise Darwin as well.  For
	now, have it do exactly the same thing as for Rhapsody
2001-11-14 08:18:07 +00:00
Richard Levitte
7be09992c6 Apply the following change from the main trunk:
2000-11-14 12:05  jaenicke

	* Makefile.org (1.115): Some platforms (namely HP-UX) require the
	'x' bit set for shared libraries.  For performance reasons, it is
	also recommended to make the (mmap'ed) shared library 'read-only'.
	-> New permissions for installed shared libraries = 555

	This doesn't hurt anybody, provided the installation is performed
	with 'cp -f' :-)
2001-11-14 08:08:04 +00:00
Richard Levitte
ceea4c85b4 Apply the following change from the main trunk:
2000-11-01 01:05  levitte

	* Configure (1.236), Makefile.org (1.110), CHANGES (1.640): Add
	support for shared libraries under Irix.  Submitted by Albert
	Chin-A-Young <china@thewrittenword.com>
2001-11-14 08:06:42 +00:00
Richard Levitte
d1ec197e49 Apply the following change from the main trunk:
2000-11-01 01:05  levitte

	* Configure (1.236), Makefile.org (1.110), CHANGES (1.640): Add
	support for shared libraries under Irix.  Submitted by Albert
	Chin-A-Young <china@thewrittenword.com>
2001-11-14 07:52:33 +00:00
Richard Levitte
f4d9cdc531 Make default attributes consistent in all sub-packages (and thereby
closer to the main trunk).
2001-11-14 07:42:39 +00:00
Richard Levitte
e3f47ba87f Correct the order of the changes. 2001-11-14 07:23:45 +00:00
Richard Levitte
ab665f4a7e Apply the following change from the main trunk:
2000-11-01 00:14  levitte

	* Configure (1.234), config (1.68), CHANGES (1.638): Add
	configuration option to build on Linux on both big-endian and
	little-endian MIPS.  Submitted by Ralf Baechle
	<ralf@uni-koblenz.de>
2001-11-14 07:18:47 +00:00
Richard Levitte
35ff595e19 Apply the following change from the main trunk:
2000-10-22 23:37  levitte

	* Makefile.org (1.106): When building shared libraries on HP-UX
	10.20 and HP-UX 11.00 (32bit), ld warns that -Fl "may not be
	supported in future releases".	We know that, and are doing things
	in HP-UX 11 (64bit), so turn off that warning with
	+vnocompatwarnings.
2001-11-14 07:08:10 +00:00
Richard Levitte
be2c37ef73 Apply the following change from the main trunk:
2000-10-22 00:05  levitte

	* Configure (1.232): FreeBSD-elf can do threads.  However, there
	seems to be confusion if you should defined _THREAD_SAFE (I found
	that in an include file, and that's what everybody tells me) or
	_THREADSAFE (that's what the gcc manual says in the
	FreeBSD-specific section), so I defined both, just to be safe.
2001-11-14 07:01:34 +00:00
Richard Levitte
888b8f32d7 Apply the following change from the main trunk:
2000-10-21 23:24  levitte

	* CHANGES (1.631), Configure (1.231), Makefile.org (1.104):
	Add what's needed to get shared libraries on HP-UX.
2001-11-14 06:59:15 +00:00
Richard Levitte
962c53c0cd That was incorrect. Revert. 2001-11-13 11:21:23 +00:00
Richard Levitte
ce6f656e1b Apply change from revision 1.101 (2000-10-09 02:50 levitte):
Make sure ranlib is only used on .a libraries.
2001-11-13 11:10:29 +00:00
Bodo Möller
9cb12c9d76 update FAQ from main branch 2001-11-13 08:57:58 +00:00
Bodo Möller
f089efdfab synchronise with HEAD branch,
remove redundant name OpenUNIX for OpenUNIX-8 configuration
2001-11-12 23:29:23 +00:00
Bodo Möller
a236373435 information on 0.9.6c-engine 2001-11-12 22:13:28 +00:00
Bodo Möller
7d555c8615 order entries as in main branch 2001-11-12 15:25:17 +00:00
Bodo Möller
d63b1678b5 'make update' 2001-11-12 15:15:46 +00:00
Mark J. Cox
beaa89def7 Sync ia64.S in 0.9.6c-dev with ia64.S in 0.9.7 (some fixes had been
applied since the initial patch was created)

Submitted by:
Reviewed by:
PR:
2001-11-12 14:08:49 +00:00
Mark J. Cox
b4bf34ce39 Add an entry for gcc on UnixWare
Submitted by: Gary Benson
Reviewed by: Mark Cox
PR:
2001-11-12 13:22:14 +00:00
Mark J. Cox
f99ac98efb Add assembler implementation for IA-64
Submitted by: Andy Polyakov
Reviewed by: Mark Cox
PR:
2001-11-12 12:49:25 +00:00
Bodo Möller
c615cdd7cb the PRNG race conditions were mostly a theoretical issue, remove from NEWS 2001-11-12 11:33:07 +00:00
Bodo Möller
e7d339b678 add changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c 2001-11-12 11:27:34 +00:00
Bodo Möller
3f64d0bf3b synchronize with HEAD branch 2001-11-12 11:22:45 +00:00
Bodo Möller
fab972b914 order chronologically: move entry for recent s2_clnt.c/s2_srvr.c fixes to the top 2001-11-10 15:09:47 +00:00
Bodo Möller
a10b85d9e6 make code a little more similar to what it looked like before the fixes 2001-11-10 10:43:51 +00:00
Bodo Möller
44cc9715ec remove incorrect 'callback' prototype 2001-11-10 02:14:43 +00:00
Bodo Möller
a807f6460e important SSL 2.0 bugfixes 2001-11-10 01:15:29 +00:00
Bodo Möller
19c3f1c40d typo 2001-11-09 13:10:47 +00:00
Bodo Möller
b30504c61c fix warning 2001-11-09 13:03:12 +00:00
Bodo Möller
cbb5f1f025 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:59:15 +00:00
Bodo Möller
b8556ab14b clarify 2001-11-08 14:52:40 +00:00
Bodo Möller
48c269ad7f 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:36:49 +00:00
Richard Levitte
d6945e10b5 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:06:29 +00:00
Bodo Möller
70bed0ca2d typo 2001-10-26 14:03:51 +00:00
Bodo Möller
e20788700c disable caching in BIO_gethostbyname 2001-10-26 13:03:28 +00:00
Bodo Möller
b60806a097 'make update' 2001-10-25 08:36:22 +00:00
Bodo Möller
0b9925be4f Consistency with s2_... and s23_... variants (no real functional
change)
2001-10-25 08:18:56 +00:00
Bodo Möller
3e9ae0c462 Oops 2001-10-25 08:18:36 +00:00
Bodo Möller
96ec4ce0d2 Assume TLS 1.0 if ClientHello fragment is too short. 2001-10-25 06:06:50 +00:00
Bodo Möller
38b3e9edde 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:05:26 +00:00
Bodo Möller
9ccadf1c6f 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.
2001-10-20 17:52:40 +00:00
Dr. Stephen Henson
1e55e768c3 Typo. 2001-10-20 16:23:18 +00:00
Lutz Jänicke
b914a547e1 Flush buffers to prevent mixed output (Adam Back <adam@cypherspace.org>). 2001-10-16 14:25:27 +00:00
Bodo Möller
03b148f4a9 make sure .rnd exists 2001-10-15 17:57:27 +00:00
Bodo Möller
2dbdcd9734 Fix ssl3_get_message to handle message fragmentation correctly. 2001-10-15 17:42:43 +00:00
Bodo Möller
1147fa5a5f the previous commit accidentily removed 'ret = 1' from the SSL_ST_OK
case of ssl3_accept
2001-10-15 17:40:22 +00:00
Ulf Möller
a9eba3f3f5 openbsd-x86 macros
Submitted by: Toomas Kiisk <vix@cyber.ee>
2001-10-14 00:58:32 +00:00
Lutz Jänicke
aa8a33c230 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:57 +00:00
Richard Levitte
46ff8e0d0a 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:43:45 +00:00
Richard Levitte
3f9077278a Make sure the macro PEDANTIC is defined when we compile with
-pedantic, or some parts of the source will raise complaints from the
compiler.
2001-10-11 07:59:25 +00:00
Richard Levitte
accb6063f3 'make update' 2001-10-10 21:52:27 +00:00
Richard Levitte
744301ccd8 Add support for md4WithRSAEncryption. 2001-10-10 21:51:00 +00:00
Richard Levitte
a295ca8cf9 A few more OIDs, contributed by Peter Sylvester <Peter.Sylvester@EdelWeb.fr> 2001-10-10 06:15:42 +00:00
Lutz Jänicke
293c4d747c Small documentation fixes (Howard Lum <howard@pumpkin.canada.sun.com>) 2001-10-08 08:38:12 +00:00
Lutz Jänicke
09389cbef5 Typos (Chris Pepper <pepper@mail.reppep.com>) 2001-10-01 14:39:23 +00:00
Richard Levitte
594a3e5bd5 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 15:06:44 +00:00
Bodo Möller
ae9010abd5 comment 2001-09-24 07:57:20 +00:00
Bodo Möller
ae3a6640b7 crypto/idea was missing in the list of directories that may have been deleted 2001-09-22 01:37:36 +00:00
Bodo Möller
029dfa64d4 bugfix: handle HelloRequest received during handshake correctly 2001-09-21 11:19:26 +00:00
Bodo Möller
f8845509b6 Disable session related stuff in SSL_ST_OK case of ssl3_accept if we
just sent a HelloRequest.
2001-09-21 07:01:04 +00:00
Bodo Möller
3f98e1dd11 Bugfix: correct cleanup after sending a HelloRequest 2001-09-21 00:03:00 +00:00
Bodo Möller
e53afa9e9b fix ssl3_accept: don't call ssl_init_wbio_buffer() in HelloRequest case 2001-09-20 21:36:39 +00:00
Bodo Möller
e41c5bd730 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:34:36 +00:00
Bodo Möller
10981a5c84 add comment 2001-09-14 13:48:37 +00:00
Bodo Möller
9cf8888149 Increase permissible ClientKeyExchange message length as in main
branch (revision 1.50, 2000-11-17)
2001-09-14 13:32:03 +00:00
Lutz Jänicke
491d390ec9 Synchronize typo corrections with 0.9.7-dev 2001-09-13 15:19:39 +00:00
Lutz Jänicke
87301baec9 One more manual page. 2001-09-13 15:07:21 +00:00
cvs2svn
0cf4df488b This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-09-13 15:05:43 +00:00
Bodo Möller
fde9626cff update from main branch 2001-09-11 12:26:35 +00:00
Bodo Möller
fb9520c12d comments 2001-09-10 15:03:08 +00:00
Bodo Möller
62b0502750 copyright 2001-09-10 14:51:45 +00:00
Lutz Jänicke
c77c4c9f1c Fix typo. 2001-09-09 07:43:12 +00:00
Dr. Stephen Henson
c5220abc6a Replace old (and invalid) copyright notice. 2001-09-08 12:16:24 +00:00
Lutz Jänicke
b90f36d240 Support for OpenUNIX-8 (Boyd Lynn Gerber <gerberb@zenez.com>) 2001-09-07 13:22:41 +00:00
Lutz Jänicke
2712fe80be Recognize OpenUNIX 2001-09-07 12:16:52 +00:00
Ulf Möller
13aab9cca4 make update 2001-09-07 04:32:11 +00:00
Lutz Jänicke
33c0e6f547 Build shared libraries on Unixware-7 and OpenUNIX-8 in old (pre-0.9.7)
style (Boyd Lynn Gerber <gerberb@zenez.com>.
2001-09-06 12:30:17 +00:00
cvs2svn
d84f543ea6 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-09-06 12:28:06 +00:00
Bodo Möller
a7113d645f improve OAEP check 2001-09-06 10:43:42 +00:00
Ulf Möller
3f345dc653 bn_sqr bug fix as in main 2001-09-05 04:45:45 +00:00
Ulf Möller
0dd892848e WTF? 2001-09-04 22:21:36 +00:00
Bodo Möller
f4681b0864 Use uniformly chosen witnesses for Miller-Rabin test
(by using new BN_pseudo_rand_range function)
2001-09-03 13:01:28 +00:00
Lutz Jänicke
a04baf9b5c Allow client certificate lists > 16kB ("Douglas E. Engert" <deengert@anl.gov>.) 2001-08-25 11:48:35 +00:00
Lutz Jänicke
029fb8aa26 Needed for build on SunOS 4.1.x with gcc (Jeffrey Hutzelman <jhutz@cmu.edu>). 2001-08-25 11:34:53 +00:00
Lutz Jänicke
2cb95a153e More docs. 2001-08-24 14:31:36 +00:00
cvs2svn
20d57547e6 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-24 14:29:49 +00:00
Lutz Jänicke
ea5b10a177 More manual pages, no constification. 2001-08-23 18:50:16 +00:00
cvs2svn
dca598b911 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-23 17:22:44 +00:00
Lutz Jänicke
187ebb98ad As discussed recently on openssl-users. 2001-08-23 15:01:36 +00:00
cvs2svn
84712f4f9d This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-23 15:00:12 +00:00
Lutz Jänicke
44366c3713 Make clear, that using the compression layer is currently not recommended. 2001-08-23 09:42:56 +00:00
Lutz Jänicke
feef7d2dc6 Missed the page... 2001-08-21 14:57:25 +00:00
Lutz Jänicke
7ac19add8f One more manual page... 2001-08-21 14:55:58 +00:00
cvs2svn
e1c82386d1 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-21 14:54:55 +00:00
Lutz Jänicke
d9164abe69 Documentation on how to handle compression methods.
Hopefully it is clear enough, that it is currently not recommended.
2001-08-21 13:04:26 +00:00
cvs2svn
9347774449 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-21 13:02:59 +00:00
Lutz Jänicke
51db1db082 Checked in from the wrong !@#$%^&*() copy... 2001-08-21 07:27:47 +00:00
Lutz Jänicke
3d11230259 More interdependencies with respect to shutdown behaviour. 2001-08-20 14:35:17 +00:00
Lutz Jänicke
653cc07b51 Alert description strings for TLSv1 and documentation. 2001-08-19 16:23:57 +00:00
cvs2svn
7a5b2bea86 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-19 16:20:43 +00:00
Lutz Jänicke
3eba9b0ebc More details about session timeout settings. 2001-08-17 16:38:06 +00:00
cvs2svn
544346a6c8 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-17 16:36:52 +00:00
Lutz Jänicke
5f18f1b4c5 One more function documented. 2001-08-17 15:56:30 +00:00
cvs2svn
1b061845d7 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-17 15:54:51 +00:00
Lutz Jänicke
3ad82e4707 SSL_shutdown() has even more properties... 2001-08-17 15:10:47 +00:00
cvs2svn
71cbb0f128 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-17 15:09:32 +00:00
Lutz Jänicke
b82030e90a One more step on the way for complete documentation... 2001-08-17 14:34:44 +00:00
cvs2svn
ce59bb8bd0 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-08-17 14:32:39 +00:00
Lutz Jänicke
deecc4bede Unidirectional shutdown is allowed according to the RFC. 2001-08-17 09:09:17 +00:00
Lutz Jänicke
86cd2530db Bugfixes provided by "Stephen Hinton" <shinton@netopia.com>. 2001-08-16 15:30:37 +00:00
Lutz Jänicke
3d85776a09 Better description of the behaviour of SSL_shutdown() as it is now, broken
or not.
2001-08-16 14:29:50 +00:00
Richard Levitte
ec578380c9 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:25:50 +00:00
Bodo Möller
8dccbdfc5b add missing link 2001-08-08 15:08:54 +00:00
Bodo Möller
904de6e4f5 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:31:03 +00:00
Lutz Jänicke
65ce21da9a Fix typos (shinagawa@star.zko.dec.com). 2001-08-07 07:53:53 +00:00
Lutz Jänicke
7ea0acc3ef Reworked manual pages with a lot of input from Bodo Moeller. 2001-07-31 15:06:43 +00:00
Lutz Jänicke
dd186f600d Only set the verify callback if there's one to set! 2001-07-31 10:20:53 +00:00
Lutz Jänicke
01fc70323f Don't miss files... 2001-07-30 11:51:06 +00:00
Lutz Jänicke
03a70bad4f Fix inconsistent behaviour with respect to verify_callback handling. 2001-07-30 11:48:20 +00:00
Lutz Jänicke
7146221bbe Forgot to mention second fix. 2001-07-30 11:44:14 +00:00
Bodo Möller
80a8d1406b length of secret exponent is needed only when we create one 2001-07-27 22:45:19 +00:00
Bodo Möller
1a76a85c93 Undo DH_generate_key() change: s3_srvr.c was using it correctly 2001-07-27 22:34:00 +00:00
Lutz Jänicke
cf1b34ad34 Another uninitialized static that may lead to problems on Solaris under some
circumstances.
2001-07-27 12:36:16 +00:00
Lutz Jänicke
44d4b684f9 Fix problem occuring when used from OpenSSH on Solaris 8. 2001-07-26 09:03:42 +00:00
Bodo Möller
746142d672 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:40 +00:00
Bodo Möller
475e21bc7b Don't preserve existing keys in DH_generate_key. 2001-07-25 17:20:16 +00:00
Bodo Möller
5204726bfe md_rand.c thread safety 2001-07-25 17:18:02 +00:00
Bodo Möller
27f3a1bd9c always reject data >= n 2001-07-25 17:03:22 +00:00
Lutz Jänicke
b1a810571c Fix wrong information about SSL_set_connect_state(). 2001-07-25 12:13:46 +00:00
Bodo Möller
c6719ffb77 Avoid race condition.
Submitted by: Travis Vitek <vitek@roguewave.com>
2001-07-24 12:33:41 +00:00
Lutz Jänicke
16fdf5b904 Additional inline reference 2001-07-23 12:56:37 +00:00
Lutz Jänicke
d2cfefc892 Add missing reference. 2001-07-23 12:52:51 +00:00
Lutz Jänicke
71ff177754 Documentation about ephemeral key exchange 2001-07-21 11:04:35 +00:00
cvs2svn
5b6051067a This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-07-21 11:02:18 +00:00
Lutz Jänicke
c0bee3c8d6 Updated explanation. 2001-07-20 19:24:26 +00:00
Lutz Jänicke
79e29dca65 Some more documentation bits. 2001-07-20 18:58:25 +00:00
cvs2svn
04bdca29d7 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_6-stable'.
2001-07-20 18:57:16 +00:00
Richard Levitte
7ca6deef3f SSL_get_rfc were documented but not implemented. 2001-07-16 10:50:49 +00:00
Richard Levitte
026dad0f3b SSL_get_[rw]fd were documented but not implemented. 2001-07-15 20:12:45 +00:00
Lutz Jänicke
6b99c692d0 Clarify actual state. 2001-07-12 08:54:17 +00:00
Lutz Jänicke
04d9784d17 What is an '-engine' version? 2001-07-11 15:51:13 +00:00
Lutz Jänicke
bcfca923d4 Clarify! (based on recent mailing-list discussions) 2001-07-11 15:11:26 +00:00
Richard Levitte
0410b6c50b Tagging has been done, move on to 0.9.6c-dev. 2001-07-09 15:10:56 +00:00
Richard Levitte
483c4e0682 Add security patch and create release.
Tags will be OpenSSL_0_9_6b and OpenSSL-engine-0_9_6b
2001-07-09 14:36:30 +00:00
Richard Levitte
de61328615 make update 2001-07-05 12:28:13 +00:00
Bodo Möller
731e14031c Andy's mips3.s fix (as in main branch). 2001-07-04 20:17:52 +00:00
Lutz Jänicke
93074b2509 When only the key is given to "enc", the IV is undefined
(found by Andy Brown <logic@warthog.com>).
2001-07-03 10:32:30 +00:00
Dr. Stephen Henson
1498ad74bb Another empty X509_NAME fix. 2001-06-26 12:38:33 +00:00
Dr. Stephen Henson
e319a89f84 Handle empty X509_NAME in printing routines. 2001-06-26 12:04:12 +00:00
Bodo Möller
9fa5786340 DSA verification should insist that r and s are in the allowed range. 2001-06-26 09:48:56 +00:00
Dr. Stephen Henson
1b822decb8 Don't set *pointer if add_lock_callback used. 2001-06-19 00:09:20 +00:00
Bodo Möller
dab4c2824f pay attention to blocksize before attempting decryption 2001-06-15 18:06:06 +00:00
Ulf Möller
19352b794d as in head 2001-06-08 14:17:12 +00:00
Lutz Jänicke
8746ee311e ERR_peek_error() returns "unsigned long". 2001-06-07 17:22:01 +00:00
Richard Levitte
e90323844f Use memmove() instead of memcpy() on areas that may overlap.
Spotted by Nalin Dahyabhai <nalin@redhat.com>
2001-06-07 04:45:55 +00:00
Bodo Möller
630c1aedd2 OAEP fix 2001-06-06 21:44:48 +00:00
Bodo Möller
a650df440b when checking OAEP, signal just a single kind of 'decoding error' 2001-06-06 18:48:57 +00:00
Ulf Möller
afd7b5affe as in head 2001-06-06 17:24:03 +00:00
Ulf Möller
38c3436577 make sure we don't write to seed[-1] 2001-06-06 17:15:47 +00:00
Richard Levitte
7e9547e126 Accept digits in symbol names. Spotted by Brian Havard <brianh@kheldar.apana.org.au> 2001-06-04 16:34:39 +00:00
Bodo Möller
83583e9479 Fix Bleichenbacher PKCS #1 1.5 countermeasure.
(The attack against SSL 3.1 and TLS 1.0 is impractical anyway,
otherwise this would be a security relevant patch.)
2001-06-01 09:43:23 +00:00
Bodo Möller
41d208db79 increase DEFAULT_BUFFER_SIZE (4K instead of just 1K) 2001-06-01 08:39:02 +00:00
Richard Levitte
9a1c40049e From revision 1.25, 2001/05/31 22:25:30 by levitte
Don't decrement the reference counter twice when destroying dynamic
links.
2001-06-01 05:36:44 +00:00
Dr. Stephen Henson
39bed15e53 Add missing variable length cipher flag for Blowfish.
Only use trust settings if either trust or reject settings
are present, otherwise use compatibility mode. This stops
root CAs being rejected if they have alias of keyid set.
2001-05-24 23:00:46 +00:00
Dr. Stephen Henson
4b04466f14 Fix for missing DSA parameters. 2001-05-24 22:33:16 +00:00
Richard Levitte
2474b596ad VMS doesn't support more than on period in a file name 2001-05-22 12:48:14 +00:00
Richard Levitte
a890c4e9bb Add development tools to the requirements 2001-05-17 05:03:47 +00:00
Lutz Jänicke
c62ddfbb6e Add missing item SSL_ERROR_WANT_CONNECT. 2001-05-16 09:46:47 +00:00
Lutz Jänicke
8b9351cf61 Typos. 2001-05-14 09:57:03 +00:00
Lutz Jänicke
b23f1df65f One more point to clarify, pointed out by "Greg Stark" <ghstark@pobox.com> 2001-05-14 09:03:35 +00:00
Lutz Jänicke
f05735c8c9 Clarify behaviour with respect to SSL/TLS records. 2001-05-12 09:49:46 +00:00
Lutz Jänicke
42f310f596 Clarify behaviour of SSL_write() by mentioning SSL_MODE_ENABLE_PARTIAL_WRITE
flag as discussed on the mailing list.
2001-05-11 09:54:20 +00:00
Bodo Möller
77c6edc1d1 fix an old entry 2001-05-08 12:46:33 +00:00
Bodo Möller
99bd4baa54 .rnd issues 2001-05-03 09:28:19 +00:00
Bodo Möller
c8913d8e8a bctest changes for Ultrix (don't return 1 from bctest, otherwise make aborts) 2001-05-03 08:50:32 +00:00
Richard Levitte
3c836ff0f8 Some platforms (most notably Windows) do not have a $HOME by default.
For those, unless the environment variables RANDFILE or HOME are
defined (the default case!), RAND_file_name() will return NULL.
This change adds a default HOME for those platforms.

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

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

FFFFFFFFFFFFFF0000FF2E00000000EBFFFFFF0000D1
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46FFE0FFFF0000

The result is:

1FFFFFFFFFFFEFF0000FF2E0000000032FFE0FEFF00D1

The result should really be:

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

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

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

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

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

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

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

The old code was breaking CRL signatures.

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

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

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

Move expired CA certificate.

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

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

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

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

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

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

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

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

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

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

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

79
CHANGES
View File

@@ -2,84 +2,7 @@
OpenSSL CHANGES
_______________
Changes between 0.9.6l and 0.9.6m [17 Mar 2004]
*) Fix null-pointer assignment in do_change_cipher_spec() revealed
by using the Codenomicon TLS Test Tool (CAN-2004-0079)
[Joe Orton, Steve Henson]
Changes between 0.9.6k and 0.9.6l [04 Nov 2003]
*) Fix additional bug revealed by the NISCC test suite:
Stop bug triggering large recursion when presented with
certain ASN.1 tags (CAN-2003-0851)
[Steve Henson]
Changes between 0.9.6j and 0.9.6k [30 Sep 2003]
*) Fix various bugs revealed by running the NISCC test suite:
Stop out of bounds reads in the ASN1 code when presented with
invalid tags (CAN-2003-0543 and CAN-2003-0544).
If verify callback ignores invalid public key errors don't try to check
certificate signature with the NULL public key.
[Steve Henson]
*) In ssl3_accept() (ssl/s3_srvr.c) only accept a client certificate
if the server requested one: as stated in TLS 1.0 and SSL 3.0
specifications.
[Steve Henson]
*) In ssl3_get_client_hello() (ssl/s3_srvr.c), tolerate additional
extra data after the compression methods not only for TLS 1.0
but also for SSL 3.0 (as required by the specification).
[Bodo Moeller; problem pointed out by Matthias Loepfe]
*) Change X509_certificate_type() to mark the key as exported/exportable
when it's 512 *bits* long, not 512 bytes.
[Richard Levitte]
Changes between 0.9.6i and 0.9.6j [10 Apr 2003]
*) Countermeasure against the Klima-Pokorny-Rosa extension of
Bleichbacher's attack on PKCS #1 v1.5 padding: treat
a protocol version number mismatch like a decryption error
in ssl3_get_client_key_exchange (ssl/s3_srvr.c).
[Bodo Moeller]
*) Turn on RSA blinding by default in the default implementation
to avoid a timing attack. Applications that don't want it can call
RSA_blinding_off() or use the new flag RSA_FLAG_NO_BLINDING.
They would be ill-advised to do so in most cases.
[Ben Laurie, Steve Henson, Geoff Thorpe, Bodo Moeller]
*) Change RSA blinding code so that it works when the PRNG is not
seeded (in this case, the secret RSA exponent is abused as
an unpredictable seed -- if it is not unpredictable, there
is no point in blinding anyway). Make RSA blinding thread-safe
by remembering the creator's thread ID in rsa->blinding and
having all other threads use local one-time blinding factors
(this requires more computation than sharing rsa->blinding, but
avoids excessive locking; and if an RSA object is not shared
between threads, blinding will still be very fast).
[Bodo Moeller]
Changes between 0.9.6h and 0.9.6i [19 Feb 2003]
*) In ssl3_get_record (ssl/s3_pkt.c), minimize information leaked
via timing by performing a MAC computation even if incorrrect
block cipher padding has been found. This is a countermeasure
against active attacks where the attacker has to distinguish
between bad padding and a MAC verification error. (CAN-2003-0078)
[Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
Martin Vuagnoux (EPFL, Ilion)]
Changes between 0.9.6g and 0.9.6h [5 Dec 2002]
Changes between 0.9.6g and 0.9.6h [21 Dec 2002]
*) New function OPENSSL_cleanse(), which is used to cleanse a section of
memory from it's contents. This is done with a counter that will

View File

@@ -10,7 +10,7 @@ use strict;
# see INSTALL for instructions.
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--test-sanity] os/compiler[:flags]\n";
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--test-sanity] os/compiler[:flags]\n";
# Options:
#
@@ -23,12 +23,6 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
# default). This needn't be set in advance, you can
# just as well use "make INSTALL_PREFIX=/whatever install".
#
# no-hw-xxx do not compile support for specific crypto hardware.
# Generic OpenSSL-style methods relating to this support
# are always compiled but return NULL if the hardware
# support isn't compiled.
# no-hw do not compile support for any crypto hardware.
#
# --test-sanity Make a number of sanity checks on the data in this file.
# This is a debugging tool for OpenSSL developers.
#
@@ -37,10 +31,6 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
# multithreaded applications (default is "threads" if we
# know how to do it)
# [no-]shared [don't] try to create shared libraries when supported.
# IT IS NOT RECOMMENDED TO USE "shared"! Since this is a
# development branch, the positions of the ENGINE symbols
# in the transfer vector are constantly moving, so binary
# backward compatibility can't be guaranteed in any way.
# no-asm do not use assembler
# no-dso do not compile in any native shared-library methods. This
# will ensure that all methods just return NULL.
@@ -132,7 +122,7 @@ my %table=(
"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 -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wmissing-declarations -Wno-long-long -pipe::-D_REENTRANT:-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wstrict-prototypes -Wmissing-prototypes -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"dist", "cc:-O::(unknown):::::",
# Basic configs that should work on any (32 and less bit) box
@@ -354,7 +344,7 @@ my %table=(
"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 -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR),\$(SHLIB_MINOR)",
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK 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)",
@@ -628,18 +618,6 @@ PROCESS_ARGS:
$flags .= "-DNO_ASM ";
$openssl_other_defines .= "#define NO_ASM\n";
}
elsif (/^no-hw-(.+)$/)
{
my $hw=$1;
$hw =~ tr/[a-z]/[A-Z]/;
$flags .= "-DNO_HW_$hw ";
$openssl_other_defines .= "#define NO_HW_$hw\n";
}
elsif (/^no-hw$/)
{
$flags .= "-DNO_HW ";
$openssl_other_defines .= "#define NO_HW\n";
}
elsif (/^no-dso$/)
{ $no_dso=1; }
elsif (/^no-threads$/)

54
FAQ
View File

@@ -63,7 +63,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.7d was released on March 17, 2004.
OpenSSL 0.9.6h was released on 5 December 2002.
In addition to the current stable release, you can also access daily
snapshots of the OpenSSL development version at <URL:
@@ -111,14 +111,11 @@ OpenSSL. Information on the OpenSSL mailing lists is available from
* Where can I get a compiled version of OpenSSL?
You can finder pointers to binary distributions in
http://www.openssl.org/related/binaries.html .
Some applications that use OpenSSL are distributed in binary form.
When using such an application, you don't need to install OpenSSL
yourself; the application will include the required parts (e.g. DLLs).
If you want to build OpenSSL on a Windows system and you don't have
If you want to install OpenSSL on a Windows system and you don't have
a C compiler, read the "Mingw32" section of INSTALL.W32 for information
on how to obtain and install the free GNU C compiler.
@@ -187,30 +184,18 @@ for permission to use their software with OpenSSL.
Cryptographic software needs a source of unpredictable data to work
correctly. Many open source operating systems provide a "randomness
device" (/dev/urandom or /dev/random) that serves this purpose.
All OpenSSL versions try to use /dev/urandom by default; starting with
version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not
available.
device" that serves this purpose. On other systems, applications have
to call the RAND_add() or RAND_seed() function with appropriate data
before generating keys or performing public key encryption.
(These functions initialize the pseudo-random number generator, PRNG.)
On other systems, applications have to call the RAND_add() or
RAND_seed() function with appropriate data before generating keys or
performing public key encryption. (These functions initialize the
pseudo-random number generator, PRNG.) Some broken applications do
not do this. As of version 0.9.5, the OpenSSL functions that need
randomness report an error if the random number generator has not been
seeded with at least 128 bits of randomness. If this error occurs and
is not discussed in the documentation of the application you are
using, please contact the author of that application; it is likely
that it never worked correctly. OpenSSL 0.9.5 and later make the
error visible by refusing to perform potentially insecure encryption.
If you are using Solaris 8, you can add /dev/urandom and /dev/random
devices by installing patch 112438 (Sparc) or 112439 (x86), which are
available via the Patchfinder at <URL: http://sunsolve.sun.com>
(Solaris 9 includes these devices by default). For /dev/random support
for earlier Solaris versions, see Sun's statement at
<URL: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski>
(the SUNWski package is available in patch 105710).
Some broken applications do not do this. As of version 0.9.5, the
OpenSSL functions that need randomness report an error if the random
number generator has not been seeded with at least 128 bits of
randomness. If this error occurs, please contact the author of the
application you are using. It is likely that it never worked
correctly. OpenSSL 0.9.5 and later make the error visible by refusing
to perform potentially insecure encryption.
On systems without /dev/urandom and /dev/random, it is a good idea to
use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
@@ -243,6 +228,18 @@ OpenSSL command line tools. Applications using the OpenSSL library
provide their own configuration options to specify the entropy source,
please check out the documentation coming the with application.
For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
installing the SUNski package from Sun patch 105710-01 (Sparc) which
adds a /dev/random device and make sure it gets used, usually through
$RANDFILE. There are probably similar patches for the other Solaris
versions. An official statement from Sun with respect to /dev/random
support can be found at
http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski
However, be warned that /dev/random is usually a blocking device, which
may have some effects on OpenSSL.
A third party /dev/random solution for Solaris is available at
http://www.cosy.sbg.ac.at/~andi/
* Why do I get an "unable to write 'random state'" error message?
@@ -677,7 +674,6 @@ 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?
Yes; make sure to read the SSL_get_error(3) manual page!

11
INSTALL
View File

@@ -57,10 +57,7 @@
shared In addition to the usual static libraries, create shared
libraries on platforms where it's supported. See "Note on
shared libraries" below. THIS IS NOT RECOMMENDED! Since
this is a development branch, the positions of the ENGINE
symbols in the transfer vector are constantly moving, so
binary backward compatibility can't be guaranteed in any way.
shared libraries" below.
no-asm Do not use assembler code.
@@ -132,8 +129,8 @@
standard headers). If it is a problem with OpenSSL itself, please
report the problem to <openssl-bugs@openssl.org> (note that your
message will be recorded in the request tracker publicly readable
via http://www.openssl.org/support/rt2.html and will be forwarded to a
public mailing list). Include the output of "make report" in your message.
via http://www.openssl.org/rt2.html and will be forwarded to a public
mailing list). Include the output of "make report" in your message.
Please check out the request tracker. Maybe the bug was already
reported or has already been fixed.
@@ -154,7 +151,7 @@
in Makefile.ssl and run "make clean; make". Please send a bug
report to <openssl-bugs@openssl.org>, including the output of
"make report" in order to be added to the request tracker at
http://www.openssl.org/support/rt2.html.
http://www.openssl.org/rt2.html.
4. If everything tests ok, install OpenSSL with

View File

@@ -216,7 +216,7 @@
$ md c:\openssl\lib
$ md c:\openssl\include
$ md c:\openssl\include\openssl
$ copy /b inc32\openssl\* c:\openssl\include\openssl
$ copy /b inc32\* c:\openssl\include\openssl
$ copy /b out32dll\ssleay32.lib c:\openssl\lib
$ copy /b out32dll\libeay32.lib c:\openssl\lib
$ copy /b out32dll\ssleay32.dll c:\openssl\bin

View File

@@ -12,7 +12,7 @@
---------------
/* ====================================================================
* Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved.
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@@ -162,7 +162,7 @@ SHLIBDIRS= crypto ssl
SDIRS= \
md2 md4 md5 sha mdc2 hmac ripemd \
des rc2 rc4 rc5 idea bf cast \
bn rsa dsa dh dso engine \
bn rsa dsa dh dso \
buffer bio stack lhash rand err objects \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
@@ -368,10 +368,9 @@ do_svr3-shared:
find . -name "*.o" -print > allobjs ; \
OBJS= ; export OBJS ; \
for obj in `ar t lib$$i.a` ; do \
OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
done ; \
set -x; ${CC} ${SHARED_LDFLAGS} \
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
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"; \
@@ -385,15 +384,13 @@ do_svr5-shared:
else \
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
SHARE_FLAG='-G'; \
(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
find . -name "*.o" -print > allobjs ; \
OBJS= ; export OBJS ; \
for obj in `ar t lib$$i.a` ; do \
OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
done ; \
set -x; ${CC} ${SHARED_LDFLAGS} \
$${SHARE_FLAG} -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-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"; \

24
NEWS
View File

@@ -5,30 +5,6 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
Major changes between OpenSSL 0.9.6l and OpenSSL 0.9.6m:
o Security: fix null-pointer bug leading to crash
Major changes between OpenSSL 0.9.6k and OpenSSL 0.9.6l:
o Security: fix ASN1 bug leading to large recursion
Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k:
o Security: fix various ASN1 parsing bugs.
o SSL/TLS protocol fix for unrequested client certificates.
Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j:
o Security: counter the Klima-Pokorny-Rosa extension of
Bleichbacher's attack
o Security: make RSA blinding default.
o Build: shared library support fixes.
Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i:
o Important security related bugfixes.
Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h:
o New configuration targets for Tandem OSS and A/UX.

4
README
View File

@@ -1,7 +1,7 @@
OpenSSL 0.9.6m [engine] 17 Mar 2004
OpenSSL 0.9.6h 5 Dec 2002
Copyright (c) 1998-2004 The OpenSSL Project
Copyright (c) 1998-2002 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
All rights reserved.

14
STATUS
View File

@@ -1,20 +1,10 @@
OpenSSL STATUS Last modified at
______________ $Date: 2004/03/17 11:45:33 $
______________ $Date: 2002/12/05 21:40:43 $
DEVELOPMENT STATE
o OpenSSL 0.9.8: Under development...
o OpenSSL 0.9.7d: Released on March 17th, 2004
o OpenSSL 0.9.7c: Released on September 30th, 2003
o OpenSSL 0.9.7b: Released on April 10th, 2003
o OpenSSL 0.9.7a: Released on February 19th, 2003
o OpenSSL 0.9.7: Released on December 31st, 2002
o OpenSSL 0.9.6m: Released on March 17th, 2004
o OpenSSL 0.9.6l: Released on November 4th, 2003
o OpenSSL 0.9.6k: Released on September 30th, 2003
o OpenSSL 0.9.6j: Released on April 10th, 2003
o OpenSSL 0.9.6i: Released on February 19th, 2003
o OpenSSL 0.9.7: Under development...
o OpenSSL 0.9.6h: Released on December 5th, 2002
o OpenSSL 0.9.6g: Released on August 9th, 2002
o OpenSSL 0.9.6f: Released on August 8th, 2002

View File

@@ -81,7 +81,6 @@ all: exe
exe: $(PROGRAM)
req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \
$(CC) -o req $(CFLAG) sreq.o $(A_OBJ) $(RAND_OBJ) $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
sreq.o: req.c
@@ -136,7 +135,6 @@ $(DLIBCRYPTO):
$(PROGRAM): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
$(RM) $(PROGRAM)
LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \
$(CC) -o $(PROGRAM) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS)
-(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; $(PERL) tools/c_rehash certs)
@@ -211,15 +209,14 @@ ca.o: ../include/openssl/buffer.h ../include/openssl/cast.h
ca.o: ../include/openssl/conf.h ../include/openssl/crypto.h
ca.o: ../include/openssl/des.h ../include/openssl/dh.h ../include/openssl/dsa.h
ca.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
ca.o: ../include/openssl/engine.h ../include/openssl/err.h
ca.o: ../include/openssl/evp.h ../include/openssl/idea.h
ca.o: ../include/openssl/lhash.h ../include/openssl/md2.h
ca.o: ../include/openssl/md4.h ../include/openssl/md5.h
ca.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
ca.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
ca.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
ca.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
ca.o: ../include/openssl/rand.h ../include/openssl/rc2.h
ca.o: ../include/openssl/err.h ../include/openssl/evp.h
ca.o: ../include/openssl/idea.h ../include/openssl/lhash.h
ca.o: ../include/openssl/md2.h ../include/openssl/md4.h
ca.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
ca.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
ca.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
ca.o: ../include/openssl/pem.h ../include/openssl/pem2.h
ca.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
ca.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
ca.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
ca.o: ../include/openssl/safestack.h ../include/openssl/sha.h
@@ -295,15 +292,14 @@ dgst.o: ../include/openssl/buffer.h ../include/openssl/cast.h
dgst.o: ../include/openssl/conf.h ../include/openssl/crypto.h
dgst.o: ../include/openssl/des.h ../include/openssl/dh.h
dgst.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
dgst.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
dgst.o: ../include/openssl/err.h ../include/openssl/evp.h
dgst.o: ../include/openssl/idea.h ../include/openssl/lhash.h
dgst.o: ../include/openssl/md2.h ../include/openssl/md4.h
dgst.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
dgst.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
dgst.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
dgst.o: ../include/openssl/pem.h ../include/openssl/pem2.h
dgst.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
dgst.o: ../include/openssl/e_os2.h ../include/openssl/err.h
dgst.o: ../include/openssl/evp.h ../include/openssl/idea.h
dgst.o: ../include/openssl/lhash.h ../include/openssl/md2.h
dgst.o: ../include/openssl/md4.h ../include/openssl/md5.h
dgst.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
dgst.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
dgst.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
dgst.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
dgst.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
dgst.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
dgst.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -316,15 +312,14 @@ dh.o: ../include/openssl/buffer.h ../include/openssl/cast.h
dh.o: ../include/openssl/conf.h ../include/openssl/crypto.h
dh.o: ../include/openssl/des.h ../include/openssl/dh.h ../include/openssl/dsa.h
dh.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
dh.o: ../include/openssl/engine.h ../include/openssl/err.h
dh.o: ../include/openssl/evp.h ../include/openssl/idea.h
dh.o: ../include/openssl/lhash.h ../include/openssl/md2.h
dh.o: ../include/openssl/md4.h ../include/openssl/md5.h
dh.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
dh.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
dh.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
dh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
dh.o: ../include/openssl/rand.h ../include/openssl/rc2.h
dh.o: ../include/openssl/err.h ../include/openssl/evp.h
dh.o: ../include/openssl/idea.h ../include/openssl/lhash.h
dh.o: ../include/openssl/md2.h ../include/openssl/md4.h
dh.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
dh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
dh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
dh.o: ../include/openssl/pem.h ../include/openssl/pem2.h
dh.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
dh.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
dh.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
dh.o: ../include/openssl/safestack.h ../include/openssl/sha.h
@@ -336,15 +331,14 @@ dsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
dsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
dsa.o: ../include/openssl/des.h ../include/openssl/dh.h
dsa.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
dsa.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
dsa.o: ../include/openssl/err.h ../include/openssl/evp.h
dsa.o: ../include/openssl/idea.h ../include/openssl/lhash.h
dsa.o: ../include/openssl/md2.h ../include/openssl/md4.h
dsa.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
dsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
dsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
dsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
dsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
dsa.o: ../include/openssl/e_os2.h ../include/openssl/err.h
dsa.o: ../include/openssl/evp.h ../include/openssl/idea.h
dsa.o: ../include/openssl/lhash.h ../include/openssl/md2.h
dsa.o: ../include/openssl/md4.h ../include/openssl/md5.h
dsa.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
dsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
dsa.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
dsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
dsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
dsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
dsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -377,21 +371,20 @@ enc.o: ../include/openssl/buffer.h ../include/openssl/cast.h
enc.o: ../include/openssl/conf.h ../include/openssl/crypto.h
enc.o: ../include/openssl/des.h ../include/openssl/dh.h
enc.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
enc.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
enc.o: ../include/openssl/err.h ../include/openssl/evp.h
enc.o: ../include/openssl/idea.h ../include/openssl/lhash.h
enc.o: ../include/openssl/md2.h ../include/openssl/md4.h
enc.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
enc.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
enc.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h
enc.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
enc.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
enc.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
enc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
enc.o: ../include/openssl/sha.h ../include/openssl/stack.h
enc.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
enc.o: ../include/openssl/x509_vfy.h apps.h
enc.o: ../include/openssl/e_os2.h ../include/openssl/err.h
enc.o: ../include/openssl/evp.h ../include/openssl/idea.h
enc.o: ../include/openssl/lhash.h ../include/openssl/md2.h
enc.o: ../include/openssl/md4.h ../include/openssl/md5.h
enc.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
enc.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
enc.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
enc.o: ../include/openssl/rand.h ../include/openssl/rc2.h
enc.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
enc.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h
enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
errstr.o: ../include/openssl/asn1.h ../include/openssl/bio.h
errstr.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
errstr.o: ../include/openssl/buffer.h ../include/openssl/cast.h
@@ -421,36 +414,34 @@ gendh.o: ../include/openssl/buffer.h ../include/openssl/cast.h
gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h
gendh.o: ../include/openssl/des.h ../include/openssl/dh.h
gendh.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
gendh.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
gendh.o: ../include/openssl/err.h ../include/openssl/evp.h
gendh.o: ../include/openssl/idea.h ../include/openssl/lhash.h
gendh.o: ../include/openssl/md2.h ../include/openssl/md4.h
gendh.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
gendh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
gendh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h
gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
gendh.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
gendh.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
gendh.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
gendh.o: ../include/openssl/sha.h ../include/openssl/stack.h
gendh.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
gendh.o: ../include/openssl/x509_vfy.h apps.h
gendh.o: ../include/openssl/e_os2.h ../include/openssl/err.h
gendh.o: ../include/openssl/evp.h ../include/openssl/idea.h
gendh.o: ../include/openssl/lhash.h ../include/openssl/md2.h
gendh.o: ../include/openssl/md4.h ../include/openssl/md5.h
gendh.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
gendh.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
gendh.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
gendh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
gendh.o: ../include/openssl/rand.h ../include/openssl/rc2.h
gendh.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
gendh.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
gendh.o: ../include/openssl/safestack.h ../include/openssl/sha.h
gendh.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
gendh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
gendsa.o: ../include/openssl/asn1.h ../include/openssl/bio.h
gendsa.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
gendsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
gendsa.o: ../include/openssl/des.h ../include/openssl/dh.h
gendsa.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
gendsa.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
gendsa.o: ../include/openssl/err.h ../include/openssl/evp.h
gendsa.o: ../include/openssl/idea.h ../include/openssl/lhash.h
gendsa.o: ../include/openssl/md2.h ../include/openssl/md4.h
gendsa.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
gendsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
gendsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
gendsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
gendsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
gendsa.o: ../include/openssl/e_os2.h ../include/openssl/err.h
gendsa.o: ../include/openssl/evp.h ../include/openssl/idea.h
gendsa.o: ../include/openssl/lhash.h ../include/openssl/md2.h
gendsa.o: ../include/openssl/md4.h ../include/openssl/md5.h
gendsa.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
gendsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
gendsa.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
gendsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
gendsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
gendsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
gendsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -463,15 +454,14 @@ genrsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
genrsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
genrsa.o: ../include/openssl/des.h ../include/openssl/dh.h
genrsa.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
genrsa.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
genrsa.o: ../include/openssl/err.h ../include/openssl/evp.h
genrsa.o: ../include/openssl/idea.h ../include/openssl/lhash.h
genrsa.o: ../include/openssl/md2.h ../include/openssl/md4.h
genrsa.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
genrsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
genrsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
genrsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
genrsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
genrsa.o: ../include/openssl/e_os2.h ../include/openssl/err.h
genrsa.o: ../include/openssl/evp.h ../include/openssl/idea.h
genrsa.o: ../include/openssl/lhash.h ../include/openssl/md2.h
genrsa.o: ../include/openssl/md4.h ../include/openssl/md5.h
genrsa.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
genrsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
genrsa.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
genrsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
genrsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
genrsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
genrsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -546,16 +536,15 @@ pkcs12.o: ../include/openssl/buffer.h ../include/openssl/cast.h
pkcs12.o: ../include/openssl/conf.h ../include/openssl/crypto.h
pkcs12.o: ../include/openssl/des.h ../include/openssl/dh.h
pkcs12.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
pkcs12.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
pkcs12.o: ../include/openssl/err.h ../include/openssl/evp.h
pkcs12.o: ../include/openssl/idea.h ../include/openssl/lhash.h
pkcs12.o: ../include/openssl/md2.h ../include/openssl/md4.h
pkcs12.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
pkcs12.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
pkcs12.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
pkcs12.o: ../include/openssl/pem.h ../include/openssl/pem2.h
pkcs12.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h
pkcs12.o: ../include/openssl/rand.h ../include/openssl/rc2.h
pkcs12.o: ../include/openssl/e_os2.h ../include/openssl/err.h
pkcs12.o: ../include/openssl/evp.h ../include/openssl/idea.h
pkcs12.o: ../include/openssl/lhash.h ../include/openssl/md2.h
pkcs12.o: ../include/openssl/md4.h ../include/openssl/md5.h
pkcs12.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
pkcs12.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
pkcs12.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
pkcs12.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h
pkcs12.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
pkcs12.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
pkcs12.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
pkcs12.o: ../include/openssl/safestack.h ../include/openssl/sha.h
@@ -567,15 +556,14 @@ pkcs7.o: ../include/openssl/buffer.h ../include/openssl/cast.h
pkcs7.o: ../include/openssl/conf.h ../include/openssl/crypto.h
pkcs7.o: ../include/openssl/des.h ../include/openssl/dh.h
pkcs7.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
pkcs7.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
pkcs7.o: ../include/openssl/err.h ../include/openssl/evp.h
pkcs7.o: ../include/openssl/idea.h ../include/openssl/lhash.h
pkcs7.o: ../include/openssl/md2.h ../include/openssl/md4.h
pkcs7.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
pkcs7.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
pkcs7.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
pkcs7.o: ../include/openssl/pem.h ../include/openssl/pem2.h
pkcs7.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
pkcs7.o: ../include/openssl/e_os2.h ../include/openssl/err.h
pkcs7.o: ../include/openssl/evp.h ../include/openssl/idea.h
pkcs7.o: ../include/openssl/lhash.h ../include/openssl/md2.h
pkcs7.o: ../include/openssl/md4.h ../include/openssl/md5.h
pkcs7.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
pkcs7.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
pkcs7.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
pkcs7.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
pkcs7.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
pkcs7.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
pkcs7.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -588,16 +576,15 @@ pkcs8.o: ../include/openssl/buffer.h ../include/openssl/cast.h
pkcs8.o: ../include/openssl/conf.h ../include/openssl/crypto.h
pkcs8.o: ../include/openssl/des.h ../include/openssl/dh.h
pkcs8.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
pkcs8.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
pkcs8.o: ../include/openssl/err.h ../include/openssl/evp.h
pkcs8.o: ../include/openssl/idea.h ../include/openssl/lhash.h
pkcs8.o: ../include/openssl/md2.h ../include/openssl/md4.h
pkcs8.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
pkcs8.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
pkcs8.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
pkcs8.o: ../include/openssl/pem.h ../include/openssl/pem2.h
pkcs8.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h
pkcs8.o: ../include/openssl/rand.h ../include/openssl/rc2.h
pkcs8.o: ../include/openssl/e_os2.h ../include/openssl/err.h
pkcs8.o: ../include/openssl/evp.h ../include/openssl/idea.h
pkcs8.o: ../include/openssl/lhash.h ../include/openssl/md2.h
pkcs8.o: ../include/openssl/md4.h ../include/openssl/md5.h
pkcs8.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
pkcs8.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
pkcs8.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
pkcs8.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h
pkcs8.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
pkcs8.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
pkcs8.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
pkcs8.o: ../include/openssl/safestack.h ../include/openssl/sha.h
@@ -609,35 +596,33 @@ rand.o: ../include/openssl/buffer.h ../include/openssl/cast.h
rand.o: ../include/openssl/conf.h ../include/openssl/crypto.h
rand.o: ../include/openssl/des.h ../include/openssl/dh.h
rand.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
rand.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
rand.o: ../include/openssl/err.h ../include/openssl/evp.h
rand.o: ../include/openssl/idea.h ../include/openssl/lhash.h
rand.o: ../include/openssl/md2.h ../include/openssl/md4.h
rand.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
rand.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
rand.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
rand.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
rand.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
rand.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
rand.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
rand.o: ../include/openssl/sha.h ../include/openssl/stack.h
rand.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
rand.o: ../include/openssl/x509_vfy.h apps.h
rand.o: ../include/openssl/e_os2.h ../include/openssl/err.h
rand.o: ../include/openssl/evp.h ../include/openssl/idea.h
rand.o: ../include/openssl/lhash.h ../include/openssl/md2.h
rand.o: ../include/openssl/md4.h ../include/openssl/md5.h
rand.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
rand.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
rand.o: ../include/openssl/opensslv.h ../include/openssl/pkcs7.h
rand.o: ../include/openssl/rand.h ../include/openssl/rc2.h
rand.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
rand.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
rand.o: ../include/openssl/safestack.h ../include/openssl/sha.h
rand.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
rand.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
req.o: ../include/openssl/asn1.h ../include/openssl/bio.h
req.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
req.o: ../include/openssl/buffer.h ../include/openssl/cast.h
req.o: ../include/openssl/conf.h ../include/openssl/crypto.h
req.o: ../include/openssl/des.h ../include/openssl/dh.h
req.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
req.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
req.o: ../include/openssl/err.h ../include/openssl/evp.h
req.o: ../include/openssl/idea.h ../include/openssl/lhash.h
req.o: ../include/openssl/md2.h ../include/openssl/md4.h
req.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
req.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
req.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
req.o: ../include/openssl/pem.h ../include/openssl/pem2.h
req.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
req.o: ../include/openssl/e_os2.h ../include/openssl/err.h
req.o: ../include/openssl/evp.h ../include/openssl/idea.h
req.o: ../include/openssl/lhash.h ../include/openssl/md2.h
req.o: ../include/openssl/md4.h ../include/openssl/md5.h
req.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
req.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
req.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
req.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
req.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
req.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
req.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -650,15 +635,14 @@ rsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
rsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
rsa.o: ../include/openssl/des.h ../include/openssl/dh.h
rsa.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
rsa.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
rsa.o: ../include/openssl/err.h ../include/openssl/evp.h
rsa.o: ../include/openssl/idea.h ../include/openssl/lhash.h
rsa.o: ../include/openssl/md2.h ../include/openssl/md4.h
rsa.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
rsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
rsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
rsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
rsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
rsa.o: ../include/openssl/e_os2.h ../include/openssl/err.h
rsa.o: ../include/openssl/evp.h ../include/openssl/idea.h
rsa.o: ../include/openssl/lhash.h ../include/openssl/md2.h
rsa.o: ../include/openssl/md4.h ../include/openssl/md5.h
rsa.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
rsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
rsa.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
rsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
rsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
rsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
rsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -671,15 +655,14 @@ rsautl.o: ../include/openssl/buffer.h ../include/openssl/cast.h
rsautl.o: ../include/openssl/conf.h ../include/openssl/crypto.h
rsautl.o: ../include/openssl/des.h ../include/openssl/dh.h
rsautl.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
rsautl.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
rsautl.o: ../include/openssl/err.h ../include/openssl/evp.h
rsautl.o: ../include/openssl/idea.h ../include/openssl/lhash.h
rsautl.o: ../include/openssl/md2.h ../include/openssl/md4.h
rsautl.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
rsautl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
rsautl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
rsautl.o: ../include/openssl/pem.h ../include/openssl/pem2.h
rsautl.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
rsautl.o: ../include/openssl/e_os2.h ../include/openssl/err.h
rsautl.o: ../include/openssl/evp.h ../include/openssl/idea.h
rsautl.o: ../include/openssl/lhash.h ../include/openssl/md2.h
rsautl.o: ../include/openssl/md4.h ../include/openssl/md5.h
rsautl.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
rsautl.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
rsautl.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
rsautl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
rsautl.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
rsautl.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
rsautl.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -716,23 +699,23 @@ s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h
s_client.o: ../include/openssl/crypto.h ../include/openssl/des.h
s_client.o: ../include/openssl/dh.h ../include/openssl/dsa.h
s_client.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
s_client.o: ../include/openssl/engine.h ../include/openssl/err.h
s_client.o: ../include/openssl/evp.h ../include/openssl/idea.h
s_client.o: ../include/openssl/lhash.h ../include/openssl/md2.h
s_client.o: ../include/openssl/md4.h ../include/openssl/md5.h
s_client.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
s_client.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
s_client.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
s_client.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
s_client.o: ../include/openssl/rand.h ../include/openssl/rc2.h
s_client.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
s_client.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
s_client.o: ../include/openssl/safestack.h ../include/openssl/sha.h
s_client.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
s_client.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
s_client.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
s_client.o: ../include/openssl/tls1.h ../include/openssl/x509.h
s_client.o: ../include/openssl/x509_vfy.h apps.h s_apps.h
s_client.o: ../include/openssl/err.h ../include/openssl/evp.h
s_client.o: ../include/openssl/idea.h ../include/openssl/lhash.h
s_client.o: ../include/openssl/md2.h ../include/openssl/md4.h
s_client.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
s_client.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
s_client.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
s_client.o: ../include/openssl/pem.h ../include/openssl/pem2.h
s_client.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
s_client.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
s_client.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
s_client.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
s_client.o: ../include/openssl/sha.h ../include/openssl/ssl.h
s_client.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
s_client.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
s_client.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
s_client.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
s_client.o: s_apps.h
s_server.o: ../include/openssl/asn1.h ../include/openssl/bio.h
s_server.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
s_server.o: ../include/openssl/buffer.h ../include/openssl/cast.h
@@ -740,23 +723,23 @@ s_server.o: ../include/openssl/comp.h ../include/openssl/conf.h
s_server.o: ../include/openssl/crypto.h ../include/openssl/des.h
s_server.o: ../include/openssl/dh.h ../include/openssl/dsa.h
s_server.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
s_server.o: ../include/openssl/engine.h ../include/openssl/err.h
s_server.o: ../include/openssl/evp.h ../include/openssl/idea.h
s_server.o: ../include/openssl/lhash.h ../include/openssl/md2.h
s_server.o: ../include/openssl/md4.h ../include/openssl/md5.h
s_server.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
s_server.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
s_server.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
s_server.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
s_server.o: ../include/openssl/rand.h ../include/openssl/rc2.h
s_server.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
s_server.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h
s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
s_server.o: ../include/openssl/tls1.h ../include/openssl/x509.h
s_server.o: ../include/openssl/x509_vfy.h apps.h s_apps.h
s_server.o: ../include/openssl/err.h ../include/openssl/evp.h
s_server.o: ../include/openssl/idea.h ../include/openssl/lhash.h
s_server.o: ../include/openssl/md2.h ../include/openssl/md4.h
s_server.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
s_server.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
s_server.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
s_server.o: ../include/openssl/pem.h ../include/openssl/pem2.h
s_server.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
s_server.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
s_server.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
s_server.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
s_server.o: ../include/openssl/sha.h ../include/openssl/ssl.h
s_server.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
s_server.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
s_server.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
s_server.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
s_server.o: s_apps.h
s_socket.o: ../include/openssl/asn1.h ../include/openssl/bio.h
s_socket.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
s_socket.o: ../include/openssl/buffer.h ../include/openssl/cast.h
@@ -832,15 +815,14 @@ smime.o: ../include/openssl/buffer.h ../include/openssl/cast.h
smime.o: ../include/openssl/conf.h ../include/openssl/crypto.h
smime.o: ../include/openssl/des.h ../include/openssl/dh.h
smime.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
smime.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
smime.o: ../include/openssl/err.h ../include/openssl/evp.h
smime.o: ../include/openssl/idea.h ../include/openssl/lhash.h
smime.o: ../include/openssl/md2.h ../include/openssl/md4.h
smime.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
smime.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
smime.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
smime.o: ../include/openssl/pem.h ../include/openssl/pem2.h
smime.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
smime.o: ../include/openssl/e_os2.h ../include/openssl/err.h
smime.o: ../include/openssl/evp.h ../include/openssl/idea.h
smime.o: ../include/openssl/lhash.h ../include/openssl/md2.h
smime.o: ../include/openssl/md4.h ../include/openssl/md5.h
smime.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
smime.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
smime.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
smime.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
smime.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
smime.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
smime.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -853,36 +835,34 @@ speed.o: ../include/openssl/buffer.h ../include/openssl/cast.h
speed.o: ../include/openssl/conf.h ../include/openssl/crypto.h
speed.o: ../include/openssl/des.h ../include/openssl/dh.h
speed.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
speed.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
speed.o: ../include/openssl/err.h ../include/openssl/evp.h
speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
speed.o: ../include/openssl/lhash.h ../include/openssl/md2.h
speed.o: ../include/openssl/md4.h ../include/openssl/md5.h
speed.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
speed.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
speed.o: ../include/openssl/opensslv.h ../include/openssl/pkcs7.h
speed.o: ../include/openssl/rand.h ../include/openssl/rc2.h
speed.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
speed.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
speed.o: ../include/openssl/safestack.h ../include/openssl/sha.h
speed.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ./testdsa.h
speed.o: ./testrsa.h apps.h
speed.o: ../include/openssl/e_os2.h ../include/openssl/err.h
speed.o: ../include/openssl/evp.h ../include/openssl/hmac.h
speed.o: ../include/openssl/idea.h ../include/openssl/lhash.h
speed.o: ../include/openssl/md2.h ../include/openssl/md4.h
speed.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
speed.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
speed.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
speed.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
speed.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
speed.o: ../include/openssl/sha.h ../include/openssl/stack.h
speed.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
speed.o: ../include/openssl/x509_vfy.h ./testdsa.h ./testrsa.h apps.h
spkac.o: ../include/openssl/asn1.h ../include/openssl/bio.h
spkac.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
spkac.o: ../include/openssl/buffer.h ../include/openssl/cast.h
spkac.o: ../include/openssl/conf.h ../include/openssl/crypto.h
spkac.o: ../include/openssl/des.h ../include/openssl/dh.h
spkac.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
spkac.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
spkac.o: ../include/openssl/err.h ../include/openssl/evp.h
spkac.o: ../include/openssl/idea.h ../include/openssl/lhash.h
spkac.o: ../include/openssl/md2.h ../include/openssl/md4.h
spkac.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
spkac.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
spkac.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
spkac.o: ../include/openssl/pem.h ../include/openssl/pem2.h
spkac.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
spkac.o: ../include/openssl/e_os2.h ../include/openssl/err.h
spkac.o: ../include/openssl/evp.h ../include/openssl/idea.h
spkac.o: ../include/openssl/lhash.h ../include/openssl/md2.h
spkac.o: ../include/openssl/md4.h ../include/openssl/md5.h
spkac.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
spkac.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
spkac.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
spkac.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
spkac.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
spkac.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
spkac.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -895,15 +875,14 @@ verify.o: ../include/openssl/buffer.h ../include/openssl/cast.h
verify.o: ../include/openssl/conf.h ../include/openssl/crypto.h
verify.o: ../include/openssl/des.h ../include/openssl/dh.h
verify.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
verify.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
verify.o: ../include/openssl/err.h ../include/openssl/evp.h
verify.o: ../include/openssl/idea.h ../include/openssl/lhash.h
verify.o: ../include/openssl/md2.h ../include/openssl/md4.h
verify.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
verify.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
verify.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
verify.o: ../include/openssl/pem.h ../include/openssl/pem2.h
verify.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
verify.o: ../include/openssl/e_os2.h ../include/openssl/err.h
verify.o: ../include/openssl/evp.h ../include/openssl/idea.h
verify.o: ../include/openssl/lhash.h ../include/openssl/md2.h
verify.o: ../include/openssl/md4.h ../include/openssl/md5.h
verify.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
verify.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
verify.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
verify.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
verify.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
verify.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
verify.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
@@ -934,15 +913,14 @@ x509.o: ../include/openssl/buffer.h ../include/openssl/cast.h
x509.o: ../include/openssl/conf.h ../include/openssl/crypto.h
x509.o: ../include/openssl/des.h ../include/openssl/dh.h
x509.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
x509.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
x509.o: ../include/openssl/err.h ../include/openssl/evp.h
x509.o: ../include/openssl/idea.h ../include/openssl/lhash.h
x509.o: ../include/openssl/md2.h ../include/openssl/md4.h
x509.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
x509.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
x509.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
x509.o: ../include/openssl/pem.h ../include/openssl/pem2.h
x509.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
x509.o: ../include/openssl/e_os2.h ../include/openssl/err.h
x509.o: ../include/openssl/evp.h ../include/openssl/idea.h
x509.o: ../include/openssl/lhash.h ../include/openssl/md2.h
x509.o: ../include/openssl/md4.h ../include/openssl/md5.h
x509.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
x509.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
x509.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
x509.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
x509.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
x509.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
x509.o: ../include/openssl/rsa.h ../include/openssl/safestack.h

View File

@@ -170,8 +170,6 @@ int str2fmt(char *s)
|| (strcmp(s,"PKCS12") == 0) || (strcmp(s,"pkcs12") == 0)
|| (strcmp(s,"P12") == 0) || (strcmp(s,"p12") == 0))
return(FORMAT_PKCS12);
else if ((*s == 'E') || (*s == 'e'))
return(FORMAT_ENGINE);
else
return(FORMAT_UNDEF);
}

View File

@@ -59,11 +59,7 @@
#ifndef HEADER_APPS_H
#define HEADER_APPS_H
#ifdef FLAT_INC
#include "e_os.h"
#else
#include "../e_os.h"
#endif
#include "openssl/e_os.h"
#include <openssl/buffer.h>
#include <openssl/bio.h>
@@ -168,8 +164,6 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format);
#define FORMAT_NETSCAPE 4
#define FORMAT_PKCS12 5
#define FORMAT_SMIME 6
/* Since this is currently inofficial, let's give it a high number */
#define FORMAT_ENGINE 127
#define NETSCAPE_CERT_HDR "certificate"

View File

@@ -301,15 +301,7 @@ bad:
num=tmplen;
}
if (offset >= num)
{
BIO_printf(bio_err, "Error: offset too large\n");
goto end;
}
num -= offset;
if ((length == 0) || ((long)length > num)) length=(unsigned int)num;
if (length == 0) length=(unsigned int)num;
if(derout) {
if(BIO_write(derout, str + offset, length) != (int)length) {
BIO_printf(bio_err, "Error writing output\n");

View File

@@ -74,7 +74,6 @@
#include <openssl/x509v3.h>
#include <openssl/objects.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#ifndef W_OK
# ifdef VMS
@@ -168,7 +167,6 @@ static char *ca_usage[]={
" -revoke file - Revoke a certificate (given in file)\n",
" -extensions .. - Extension section (override value in config file)\n",
" -crlexts .. - CRL extension section (override value in config file)\n",
" -engine e - use engine e, possibly a hardware device.\n",
NULL
};
@@ -218,7 +216,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
char *key=NULL,*passargin=NULL;
int total=0;
int total_done=0;
@@ -271,7 +268,6 @@ int MAIN(int argc, char **argv)
#define BSIZE 256
MS_STATIC char buf[3][BSIZE];
char *randfile=NULL;
char *engine = NULL;
#ifdef EFENCE
EF_PROTECT_FREE=1;
@@ -423,11 +419,6 @@ EF_ALIGNMENT=0;
if (--argc < 1) goto bad;
crl_ext= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else
{
bad:
@@ -448,24 +439,6 @@ bad:
ERR_load_crypto_strings();
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto err;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto err;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
/*****************************************************************/
if (configfile == NULL) configfile = getenv("OPENSSL_CONF");
if (configfile == NULL) configfile = getenv("SSLEAY_CONF");

View File

@@ -66,7 +66,6 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef BUFSIZE
#define BUFSIZE 1024*8
@@ -81,7 +80,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
unsigned char *buf=NULL;
int i,err=0;
const EVP_MD *md=NULL,*m;
@@ -99,7 +97,6 @@ int MAIN(int argc, char **argv)
EVP_PKEY *sigkey = NULL;
unsigned char *sigbuf = NULL;
int siglen = 0;
char *engine=NULL;
apps_startup();
@@ -157,11 +154,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) break;
sigfile=*(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) break;
engine= *(++argv);
}
else if (strcmp(*argv,"-hex") == 0)
out_bin = 0;
else if (strcmp(*argv,"-binary") == 0)
@@ -198,7 +190,6 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"-prverify file verify a signature using private key in file\n");
BIO_printf(bio_err,"-signature file signature to verify\n");
BIO_printf(bio_err,"-binary output in binary form\n");
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
LN_md5,LN_md5);
@@ -218,24 +209,6 @@ int MAIN(int argc, char **argv)
goto end;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
in=BIO_new(BIO_s_file());
bmd=BIO_new(BIO_f_md());
if (debug)

View File

@@ -69,7 +69,6 @@
#include <openssl/dh.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG dh_main
@@ -88,12 +87,11 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
DH *dh=NULL;
int i,badops=0,text=0;
BIO *in=NULL,*out=NULL;
int informat,outformat,check=0,noout=0,C=0,ret=1;
char *infile,*outfile,*prog,*engine;
char *infile,*outfile,*prog;
apps_startup();
@@ -101,7 +99,6 @@ int MAIN(int argc, char **argv)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
engine=NULL;
infile=NULL;
outfile=NULL;
informat=FORMAT_PEM;
@@ -132,11 +129,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
outfile= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-check") == 0)
check=1;
else if (strcmp(*argv,"-text") == 0)
@@ -168,30 +160,11 @@ bad:
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
BIO_printf(bio_err," -C Output C code\n");
BIO_printf(bio_err," -noout no output\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
goto end;
}
ERR_load_crypto_strings();
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL))

View File

@@ -121,7 +121,6 @@
#include <openssl/dh.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#ifndef NO_DSA
#include <openssl/dsa.h>
@@ -149,7 +148,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
DH *dh=NULL;
int i,badops=0,text=0;
#ifndef NO_DSA
@@ -158,7 +156,7 @@ int MAIN(int argc, char **argv)
BIO *in=NULL,*out=NULL;
int informat,outformat,check=0,noout=0,C=0,ret=1;
char *infile,*outfile,*prog;
char *inrand=NULL,*engine=NULL;
char *inrand=NULL;
int num = 0, g = 0;
apps_startup();
@@ -197,11 +195,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
outfile= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-check") == 0)
check=1;
else if (strcmp(*argv,"-text") == 0)
@@ -247,7 +240,6 @@ bad:
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n");
@@ -257,24 +249,6 @@ bad:
ERR_load_crypto_strings();
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if (g && !num)
num = DEFBITS;

View File

@@ -68,7 +68,6 @@
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG dsa_main
@@ -88,7 +87,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int ret=1;
DSA *dsa=NULL;
int i,badops=0;
@@ -96,7 +94,7 @@ int MAIN(int argc, char **argv)
BIO *in=NULL,*out=NULL;
int informat,outformat,text=0,noout=0;
int pubin = 0, pubout = 0;
char *infile,*outfile,*prog,*engine;
char *infile,*outfile,*prog;
char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL;
int modulus=0;
@@ -107,7 +105,6 @@ int MAIN(int argc, char **argv)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
engine=NULL;
infile=NULL;
outfile=NULL;
informat=FORMAT_PEM;
@@ -148,11 +145,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
passargout= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-noout") == 0)
noout=1;
else if (strcmp(*argv,"-text") == 0)
@@ -184,7 +176,6 @@ bad:
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
BIO_printf(bio_err," -out arg output file\n");
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
#ifndef NO_IDEA
@@ -198,24 +189,6 @@ bad:
ERR_load_crypto_strings();
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n");
goto end;

View File

@@ -70,7 +70,6 @@
#include <openssl/md5.h>
#endif
#include <openssl/pem.h>
#include <openssl/engine.h>
int set_hex(char *in,unsigned char *out,int size);
#undef SIZE
@@ -85,7 +84,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
static const char magic[]="Salted__";
char mbuf[8]; /* should be 1 smaller than magic */
char *strbuf=NULL;
@@ -103,7 +101,6 @@ int MAIN(int argc, char **argv)
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
#define PROG_NAME_SIZE 39
char pname[PROG_NAME_SIZE+1];
char *engine = NULL;
apps_startup();
@@ -144,11 +141,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
passarg= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-d") == 0)
enc=0;
else if (strcmp(*argv,"-p") == 0)
@@ -249,7 +241,6 @@ bad:
BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv");
BIO_printf(bio_err,"%-14s print the iv/key (then exit if -P)\n","-[pP]");
BIO_printf(bio_err,"%-14s buffer size\n","-bufsize <n>");
BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
BIO_printf(bio_err,"Cipher Types\n");
BIO_printf(bio_err,"des : 56 bit key DES encryption\n");
@@ -323,24 +314,6 @@ bad:
argv++;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if (bufsize != NULL)
{
unsigned long n;

View File

@@ -70,7 +70,6 @@
#include <openssl/dh.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#define DEFBITS 512
#undef PROG
@@ -82,13 +81,11 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
DH *dh=NULL;
int ret=1,num=DEFBITS;
int g=2;
char *outfile=NULL;
char *inrand=NULL;
char *engine=NULL;
BIO *out=NULL;
apps_startup();
@@ -113,11 +110,6 @@ int MAIN(int argc, char **argv)
g=3; */
else if (strcmp(*argv,"-5") == 0)
g=5;
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-rand") == 0)
{
if (--argc < 1) goto bad;
@@ -133,34 +125,15 @@ int MAIN(int argc, char **argv)
bad:
BIO_printf(bio_err,"usage: gendh [args] [numbits]\n");
BIO_printf(bio_err," -out file - output the key to 'file\n");
BIO_printf(bio_err," -2 - use 2 as the generator value\n");
/* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */
BIO_printf(bio_err," -5 - use 5 as the generator value\n");
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
BIO_printf(bio_err," -2 use 2 as the generator value\n");
/* BIO_printf(bio_err," -3 use 3 as the generator value\n"); */
BIO_printf(bio_err," -5 use 5 as the generator value\n");
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n");
goto end;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
out=BIO_new(BIO_s_file());
if (out == NULL)
{

View File

@@ -68,7 +68,6 @@
#include <openssl/dsa.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#define DEFBITS 512
#undef PROG
@@ -78,7 +77,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
DSA *dsa=NULL;
int ret=1;
char *outfile=NULL;
@@ -86,7 +84,6 @@ int MAIN(int argc, char **argv)
char *passargout = NULL, *passout = NULL;
BIO *out=NULL,*in=NULL;
EVP_CIPHER *enc=NULL;
char *engine=NULL;
apps_startup();
@@ -109,11 +106,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
passargout= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-rand") == 0)
{
if (--argc < 1) goto bad;
@@ -153,7 +145,6 @@ bad:
#ifndef NO_IDEA
BIO_printf(bio_err," -idea - encrypt the generated key with IDEA in cbc mode\n");
#endif
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n");
@@ -162,24 +153,6 @@ bad:
goto end;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
BIO_printf(bio_err, "Error getting password\n");
goto end;

View File

@@ -69,7 +69,6 @@
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#define DEFBITS 512
#undef PROG
@@ -81,7 +80,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int ret=1;
RSA *rsa=NULL;
int i,num=DEFBITS;
@@ -90,7 +88,6 @@ int MAIN(int argc, char **argv)
unsigned long f4=RSA_F4;
char *outfile=NULL;
char *passargout = NULL, *passout = NULL;
char *engine=NULL;
char *inrand=NULL;
BIO *out=NULL;
@@ -119,11 +116,6 @@ int MAIN(int argc, char **argv)
f4=3;
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
f4=RSA_F4;
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-rand") == 0)
{
if (--argc < 1) goto bad;
@@ -162,7 +154,6 @@ bad:
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
BIO_printf(bio_err," -3 use 3 for the E value\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err," load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n");
@@ -176,24 +167,6 @@ bad:
goto err;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto err;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto err;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
@@ -213,8 +186,7 @@ bad:
}
}
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
&& !RAND_status())
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
{
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
}

View File

@@ -805,7 +805,7 @@ $ ENDIF
$!
$! Set Up Initial CC Definitions, Possibly With User Ones
$!
$ CCDEFS = "VMS=1,MONOLITH,THREADS"
$ CCDEFS = "VMS=1,MONOLITH"
$ IF F$TRNLNM("OPENSSL_NO_ASM") THEN CCDEFS = CCDEFS + ",NO_ASM"
$ IF F$TRNLNM("OPENSSL_NO_RSA") THEN CCDEFS = CCDEFS + ",NO_RSA"
$ IF F$TRNLNM("OPENSSL_NO_DSA") THEN CCDEFS = CCDEFS + ",NO_DSA"

View File

@@ -66,7 +66,6 @@
#include <openssl/err.h>
#include <openssl/pem.h>
#include <openssl/pkcs12.h>
#include <openssl/engine.h>
#define PROG pkcs12_main
@@ -93,7 +92,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
char *infile=NULL, *outfile=NULL, *keyname = NULL;
char *certfile=NULL;
BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL;
@@ -120,7 +118,6 @@ int MAIN(int argc, char **argv)
char *passin = NULL, *passout = NULL;
char *inrand = NULL;
char *CApath = NULL, *CAfile = NULL;
char *engine=NULL;
apps_startup();
@@ -239,11 +236,6 @@ int MAIN(int argc, char **argv)
args++;
CAfile = *args;
} else badarg = 1;
} else if (!strcmp(*args,"-engine")) {
if (args[1]) {
args++;
engine = *args;
} else badarg = 1;
} else badarg = 1;
} else badarg = 1;
@@ -287,27 +279,12 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-password p set import/export password source\n");
BIO_printf (bio_err, "-passin p input file pass phrase source\n");
BIO_printf (bio_err, "-passout p output file pass phrase source\n");
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
goto end;
}
if (engine != NULL) {
if((e = ENGINE_by_id(engine)) == NULL) {
BIO_printf(bio_err,"invalid engine \"%s\"\n", engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if(passarg) {
if(export_cert) passargout = passarg;
else passargin = passarg;

View File

@@ -67,7 +67,6 @@
#include <openssl/x509.h>
#include <openssl/pkcs7.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG pkcs7_main
@@ -83,7 +82,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
PKCS7 *p7=NULL;
int i,badops=0;
BIO *in=NULL,*out=NULL;
@@ -91,7 +89,6 @@ int MAIN(int argc, char **argv)
char *infile,*outfile,*prog;
int print_certs=0,text=0,noout=0;
int ret=1;
char *engine=NULL;
apps_startup();
@@ -135,11 +132,6 @@ int MAIN(int argc, char **argv)
text=1;
else if (strcmp(*argv,"-print_certs") == 0)
print_certs=1;
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else
{
BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -162,30 +154,11 @@ bad:
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
BIO_printf(bio_err," -text print full details of certificates\n");
BIO_printf(bio_err," -noout don't output encoded data\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
OPENSSL_EXIT(1);
}
ERR_load_crypto_strings();
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL))

View File

@@ -62,7 +62,6 @@
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/pkcs12.h>
#include <openssl/engine.h>
#include "apps.h"
#define PROG pkcs8_main
@@ -71,7 +70,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
char **args, *infile = NULL, *outfile = NULL;
char *passargin = NULL, *passargout = NULL;
BIO *in = NULL, *out = NULL;
@@ -87,13 +85,9 @@ int MAIN(int argc, char **argv)
EVP_PKEY *pkey;
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
int badarg = 0;
char *engine=NULL;
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
informat=FORMAT_PEM;
outformat=FORMAT_PEM;
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
args = argv + 1;
@@ -144,11 +138,6 @@ int MAIN(int argc, char **argv)
if (!args[1]) goto bad;
passargout= *(++args);
}
else if (strcmp(*args,"-engine") == 0)
{
if (!args[1]) goto bad;
engine= *(++args);
}
else if (!strcmp (*args, "-in")) {
if (args[1]) {
args++;
@@ -181,28 +170,9 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
return (1);
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
return (1);
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
return (1);
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n");
return (1);
@@ -249,7 +219,7 @@ int MAIN(int argc, char **argv)
}
BIO_free(in);
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
BIO_printf(bio_err, "Error converting key\n");
BIO_printf(bio_err, "Error converting key\n", outfile);
ERR_print_errors(bio_err);
return (1);
}
@@ -273,7 +243,8 @@ int MAIN(int argc, char **argv)
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
p8pass, strlen(p8pass),
NULL, 0, iter, p8inf))) {
BIO_printf(bio_err, "Error encrypting key\n");
BIO_printf(bio_err, "Error encrypting key\n",
outfile);
ERR_print_errors(bio_err);
return (1);
}
@@ -316,7 +287,7 @@ int MAIN(int argc, char **argv)
}
if (!p8) {
BIO_printf (bio_err, "Error reading key\n");
BIO_printf (bio_err, "Error reading key\n", outfile);
ERR_print_errors(bio_err);
return (1);
}
@@ -330,13 +301,13 @@ int MAIN(int argc, char **argv)
}
if (!p8inf) {
BIO_printf(bio_err, "Error decrypting key\n");
BIO_printf(bio_err, "Error decrypting key\n", outfile);
ERR_print_errors(bio_err);
return (1);
}
if (!(pkey = EVP_PKCS82PKEY(p8inf))) {
BIO_printf(bio_err, "Error converting key\n");
BIO_printf(bio_err, "Error converting key\n", outfile);
ERR_print_errors(bio_err);
return (1);
}

View File

@@ -9,7 +9,6 @@
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/engine.h>
#undef PROG
#define PROG rand_main
@@ -24,7 +23,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int i, r, ret = 1;
int badopt;
char *outfile = NULL;
@@ -32,7 +30,6 @@ int MAIN(int argc, char **argv)
int base64 = 0;
BIO *out = NULL;
int num = -1;
char *engine=NULL;
apps_startup();
@@ -51,13 +48,6 @@ int MAIN(int argc, char **argv)
else
badopt = 1;
}
else if (strcmp(argv[i], "-engine") == 0)
{
if ((argv[i+1] != NULL) && (engine == NULL))
engine = argv[++i];
else
badopt = 1;
}
else if (strcmp(argv[i], "-rand") == 0)
{
if ((argv[i+1] != NULL) && (inrand == NULL))
@@ -94,31 +84,12 @@ int MAIN(int argc, char **argv)
{
BIO_printf(bio_err, "Usage: rand [options] num\n");
BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, "-out file - write to file\n");
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err, "-base64 - encode output\n");
BIO_printf(bio_err, "-out file - write to file\n");
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err, "-base64 - encode output\n");
goto err;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto err;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto err;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
if (inrand != NULL)
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",

View File

@@ -73,7 +73,6 @@
#include <openssl/x509v3.h>
#include <openssl/objects.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#define SECTION "req"
@@ -141,7 +140,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
#ifndef NO_DSA
DSA *dsa_params=NULL;
#endif
@@ -154,7 +152,6 @@ int MAIN(int argc, char **argv)
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
int nodes=0,kludge=0,newhdr=0;
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
char *engine=NULL;
char *extensions = NULL;
char *req_exts = NULL;
EVP_CIPHER *cipher=NULL;
@@ -198,11 +195,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
outformat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-key") == 0)
{
if (--argc < 1) goto bad;
@@ -383,7 +375,6 @@ bad:
BIO_printf(bio_err," -verify verify signature on REQ\n");
BIO_printf(bio_err," -modulus RSA modulus\n");
BIO_printf(bio_err," -nodes don't encrypt the output key\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err," -key file use the private key contained in file\n");
BIO_printf(bio_err," -keyform arg key file format\n");
BIO_printf(bio_err," -keyout arg file to send the key to\n");
@@ -530,55 +521,24 @@ bad:
if ((in == NULL) || (out == NULL))
goto end;
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if (keyfile != NULL)
{
if (keyform == FORMAT_ENGINE)
if (BIO_read_filename(in,keyfile) <= 0)
{
if (!e)
{
BIO_printf(bio_err,"no engine specified\n");
goto end;
}
pkey = ENGINE_load_private_key(e, keyfile, NULL);
perror(keyfile);
goto end;
}
if (keyform == FORMAT_ASN1)
pkey=d2i_PrivateKey_bio(in,NULL);
else if (keyform == FORMAT_PEM)
{
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,passin);
}
else
{
if (BIO_read_filename(in,keyfile) <= 0)
{
perror(keyfile);
goto end;
}
if (keyform == FORMAT_ASN1)
pkey=d2i_PrivateKey_bio(in,NULL);
else if (keyform == FORMAT_PEM)
{
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,
passin);
}
else
{
BIO_printf(bio_err,"bad input format specified for X509 request\n");
goto end;
}
BIO_printf(bio_err,"bad input format specified for X509 request\n");
goto end;
}
if (pkey == NULL)

View File

@@ -68,7 +68,6 @@
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG rsa_main
@@ -91,7 +90,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *eng = NULL;
int ret=1;
RSA *rsa=NULL;
int i,badops=0, sgckey=0;
@@ -102,7 +100,6 @@ int MAIN(int argc, char **argv)
char *infile,*outfile,*prog;
char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL;
char *engine=NULL;
int modulus=0;
apps_startup();
@@ -151,11 +148,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
passargout= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-sgckey") == 0)
sgckey=1;
else if (strcmp(*argv,"-pubin") == 0)
@@ -203,30 +195,11 @@ bad:
BIO_printf(bio_err," -check verify key consistency\n");
BIO_printf(bio_err," -pubin expect a public key in input file\n");
BIO_printf(bio_err," -pubout output a public key\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
goto end;
}
ERR_load_crypto_strings();
if (engine != NULL)
{
if((eng = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(eng, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(eng);
}
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n");
goto end;

View File

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

View File

@@ -80,7 +80,6 @@ typedef unsigned int u_int;
#include <openssl/err.h>
#include <openssl/pem.h>
#include <openssl/rand.h>
#include <openssl/engine.h>
#include "s_apps.h"
#ifdef WINDOWS
@@ -155,7 +154,7 @@ static void sc_usage(void)
BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n");
BIO_printf(bio_err," command to see what is available\n");
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
}
int MAIN(int, char **);
@@ -183,8 +182,6 @@ int MAIN(int argc, char **argv)
SSL_METHOD *meth=NULL;
BIO *sbio;
char *inrand=NULL;
char *engine_id=NULL;
ENGINE *e=NULL;
#ifdef WINDOWS
struct timeval tv;
#endif
@@ -327,11 +324,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
inrand= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine_id = *(++argv);
}
else
{
BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -372,30 +364,6 @@ bad:
OpenSSL_add_ssl_algorithms();
SSL_load_error_strings();
if (engine_id != NULL)
{
if((e = ENGINE_by_id(engine_id)) == NULL)
{
BIO_printf(bio_err,"invalid engine\n");
ERR_print_errors(bio_err);
goto end;
}
if (c_debug)
{
ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
0, bio_err, 0);
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
ERR_print_errors(bio_err);
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine_id);
ENGINE_free(e);
}
ctx=SSL_CTX_new(meth);
if (ctx == NULL)
{

View File

@@ -84,7 +84,6 @@ typedef unsigned int u_int;
#include <openssl/x509.h>
#include <openssl/ssl.h>
#include <openssl/rand.h>
#include <openssl/engine.h>
#include "s_apps.h"
#ifdef WINDOWS
@@ -178,7 +177,6 @@ static int s_debug=0;
static int s_quiet=0;
static int hack=0;
static char *engine_id=NULL;
#ifdef MONOLITH
static void s_server_init(void)
@@ -201,7 +199,6 @@ static void s_server_init(void)
s_debug=0;
s_quiet=0;
hack=0;
engine_id=NULL;
}
#endif
@@ -247,7 +244,6 @@ static void sv_usage(void)
BIO_printf(bio_err," -www - Respond to a 'GET /' with a status page\n");
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
}
static int local_argc=0;
@@ -418,8 +414,6 @@ int MAIN(int argc, char *argv[])
int state=0;
SSL_METHOD *meth=NULL;
char *inrand=NULL;
char *engine=NULL;
ENGINE *e=NULL;
#ifndef NO_DH
DH *dh=NULL;
#endif
@@ -579,11 +573,6 @@ int MAIN(int argc, char *argv[])
if (--argc < 1) goto bad;
inrand= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine = *(++argv);
}
else
{
BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -635,29 +624,6 @@ bad:
SSL_load_error_strings();
OpenSSL_add_ssl_algorithms();
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine\n");
ERR_print_errors(bio_err);
goto end;
}
if (s_debug)
{
ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
0, bio_err, 0);
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
ERR_print_errors(bio_err);
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
ENGINE_free(e);
}
ctx=SSL_CTX_new(meth);
if (ctx == NULL)
{

View File

@@ -64,7 +64,6 @@
#include <openssl/crypto.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/engine.h>
#undef PROG
#define PROG smime_main
@@ -82,7 +81,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int operation = 0;
int ret = 0;
char **args;
@@ -105,9 +103,8 @@ int MAIN(int argc, char **argv)
char *inrand = NULL;
int need_rand = 0;
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
char *engine=NULL;
args = argv + 1;
ret = 1;
while (!badarg && *args && *args[0] == '-') {
@@ -156,11 +153,6 @@ int MAIN(int argc, char **argv)
inrand = *args;
} else badarg = 1;
need_rand = 1;
} else if (!strcmp(*args,"-engine")) {
if (args[1]) {
args++;
engine = *args;
} else badarg = 1;
} else if (!strcmp(*args,"-passin")) {
if (args[1]) {
args++;
@@ -298,7 +290,6 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-text include or delete text MIME headers\n");
BIO_printf (bio_err, "-CApath dir trusted certificates directory\n");
BIO_printf (bio_err, "-CAfile file trusted certificates file\n");
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
BIO_printf (bio_err, "-passin arg input file pass phrase source\n");
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
@@ -307,24 +298,6 @@ int MAIN(int argc, char **argv)
goto end;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
BIO_printf(bio_err, "Error getting password\n");
goto end;

View File

@@ -81,7 +81,6 @@
#include <openssl/crypto.h>
#include <openssl/rand.h>
#include <openssl/err.h>
#include <openssl/engine.h>
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(_DARWIN)
# define USE_TOD
@@ -328,7 +327,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e;
unsigned char *buf=NULL,*buf2=NULL;
int mret=1;
#define ALGOR_NUM 15
@@ -491,37 +489,6 @@ int MAIN(int argc, char **argv)
{
if ((argc > 0) && (strcmp(*argv,"-elapsed") == 0))
usertime = 0;
else
if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
{
argc--;
argv++;
if(argc == 0)
{
BIO_printf(bio_err,"no engine given\n");
goto end;
}
if((e = ENGINE_by_id(*argv)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
*argv);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", *argv);
/* Free our "structural" reference. */
ENGINE_free(e);
/* It will be increased again further down. We just
don't want speed to confuse an engine with an
algorithm, especially when none is given (which
means all of them should be run) */
j--;
}
else
#ifndef NO_MD2
if (strcmp(*argv,"md2") == 0) doit[D_MD2]=1;
else
@@ -569,7 +536,7 @@ int MAIN(int argc, char **argv)
#ifdef RSAref
if (strcmp(*argv,"rsaref") == 0)
{
RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
RSA_set_default_method(RSA_PKCS1_RSAref());
j--;
}
else
@@ -577,7 +544,7 @@ int MAIN(int argc, char **argv)
#ifndef RSA_NULL
if (strcmp(*argv,"openssl") == 0)
{
RSA_set_default_openssl_method(RSA_PKCS1_SSLeay());
RSA_set_default_method(RSA_PKCS1_SSLeay());
j--;
}
else
@@ -722,12 +689,11 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"\n");
#endif
#if defined(TIMES) || defined(USE_TOD)
BIO_printf(bio_err,"\n");
BIO_printf(bio_err,"Available options:\n");
#if defined(TIMES) || defined(USE_TOD)
BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n");
#endif
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
goto end;
}
argc--;
@@ -1434,7 +1400,6 @@ int MAIN(int argc, char **argv)
#endif
mret=0;
end:
ERR_print_errors(bio_err);
if (buf != NULL) OPENSSL_free(buf);
if (buf2 != NULL) OPENSSL_free(buf2);
#ifndef NO_RSA

View File

@@ -69,7 +69,6 @@
#include <openssl/lhash.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG spkac_main
@@ -82,7 +81,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int i,badops=0, ret = 1;
BIO *in = NULL,*out = NULL, *key = NULL;
int verify=0,noout=0,pubkey=0;
@@ -93,7 +91,6 @@ int MAIN(int argc, char **argv)
LHASH *conf = NULL;
NETSCAPE_SPKI *spki = NULL;
EVP_PKEY *pkey = NULL;
char *engine=NULL;
apps_startup();
@@ -139,11 +136,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
spksect= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-noout") == 0)
noout=1;
else if (strcmp(*argv,"-pubkey") == 0)
@@ -169,7 +161,6 @@ bad:
BIO_printf(bio_err," -noout don't print SPKAC\n");
BIO_printf(bio_err," -pubkey output public key\n");
BIO_printf(bio_err," -verify verify SPKAC signature\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
goto end;
}
@@ -179,24 +170,6 @@ bad:
goto end;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if(keyfile) {
if(strcmp(keyfile, "-")) key = BIO_new_file(keyfile, "r");
else key = BIO_new_fp(stdin, BIO_NOCLOSE);

View File

@@ -65,7 +65,6 @@
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG verify_main
@@ -79,7 +78,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int i,ret=1;
int purpose = -1;
char *CApath=NULL,*CAfile=NULL;
@@ -87,7 +85,6 @@ int MAIN(int argc, char **argv)
STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
X509_STORE *cert_ctx=NULL;
X509_LOOKUP *lookup=NULL;
char *engine=NULL;
cert_ctx=X509_STORE_new();
if (cert_ctx == NULL) goto end;
@@ -140,11 +137,6 @@ int MAIN(int argc, char **argv)
if (argc-- < 1) goto end;
trustfile= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto end;
engine= *(++argv);
}
else if (strcmp(*argv,"-help") == 0)
goto end;
else if (strcmp(*argv,"-issuer_checks") == 0)
@@ -162,24 +154,6 @@ int MAIN(int argc, char **argv)
break;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
if (lookup == NULL) abort();
if (CAfile) {
@@ -227,7 +201,7 @@ int MAIN(int argc, char **argv)
ret=0;
end:
if (ret == 1) {
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-engine e] cert1 cert2 ...\n");
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] cert1 cert2 ...\n");
BIO_printf(bio_err,"recognized usages:\n");
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
X509_PURPOSE *ptmp;

View File

@@ -73,7 +73,6 @@
#include <openssl/x509v3.h>
#include <openssl/objects.h>
#include <openssl/pem.h>
#include <openssl/engine.h>
#undef PROG
#define PROG x509_main
@@ -130,7 +129,6 @@ static char *x509_usage[]={
" -extensions - section from config file with X509V3 extensions to add\n",
" -clrext - delete extensions before signing and input certificate\n",
" -nameopt arg - various certificate name options\n",
" -engine e - use engine e, possibly a hardware device.\n",
NULL
};
@@ -147,7 +145,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int ret=1;
X509_REQ *req=NULL;
X509 *x=NULL,*xca=NULL;
@@ -178,7 +175,6 @@ int MAIN(int argc, char **argv)
int need_rand = 0;
int checkend=0,checkoffset=0;
unsigned long nmflag = 0;
char *engine=NULL;
reqfile=0;
@@ -341,11 +337,6 @@ int MAIN(int argc, char **argv)
alias= *(++argv);
trustout = 1;
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-C") == 0)
C= ++num;
else if (strcmp(*argv,"-email") == 0)
@@ -429,24 +420,6 @@ bad:
goto end;
}
if (engine != NULL)
{
if((e = ENGINE_by_id(engine)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
engine);
goto end;
}
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
{
BIO_printf(bio_err,"can't use that engine\n");
goto end;
}
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
/* Free our "structural" reference. */
ENGINE_free(e);
}
if (need_rand)
app_RAND_load_file(NULL, bio_err, 0);
@@ -1090,7 +1063,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
BIO_free(io);
io=NULL;
/*if (!X509_STORE_add_cert(ctx,x)) goto end;*/
if (!X509_STORE_add_cert(ctx,x)) goto end;
/* NOTE: this certificate can/should be self signed, unless it was
* a certificate request in which case it is not. */

View File

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

View File

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

View File

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

24
config
View File

@@ -641,27 +641,11 @@ EOF
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
esac
# NB: This atalla support has been superceded by the ENGINE support
# That contains its own header and definitions anyway. Support can
# be enabled or disabled on any supported platform without external
# headers, eg. by adding the "hw-atalla" switch to ./config or
# perl Configure
#
# See whether we can compile Atalla support
#if [ -f /usr/include/atasi.h ]
#then
# options="$options -DATALLA"
#fi
#get some basic shared lib support (behnke@trustcenter.de)
case "$OUT" in
solaris-*-gcc)
if [ "$SHARED" = "true" ]
then
options="$options -DPIC -fPIC"
fi
;;
esac
if [ -f /usr/include/atasi.h ]
then
options="$options -DATALLA"
fi
# gcc < 2.8 does not support -mcpu=ultrasparc
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]

View File

@@ -27,7 +27,7 @@ LIBS=
SDIRS= md2 md5 sha mdc2 hmac ripemd \
des rc2 rc4 rc5 idea bf cast \
bn rsa dsa dh dso engine \
bn rsa dsa dh dso \
buffer bio stack lhash rand err objects \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp

View File

@@ -201,10 +201,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
c.pp=pp;
c.p=p;
c.inf=inf;
if (inf & 1)
c.slen = length - (p - *pp);
else
c.slen=len;
c.slen=len;
c.tag=Ptag;
c.xclass=Pclass;
c.max=(length == 0)?0:(p+length);
@@ -282,7 +279,8 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
{
if (c->inf & 1)
{
c->eos=ASN1_check_infinite_end(&c->p, c->slen);
c->eos=ASN1_check_infinite_end(&c->p,
(long)(c->max-c->p));
if (c->eos) break;
}
else
@@ -291,7 +289,7 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
}
c->q=c->p;
if (d2i_ASN1_bytes(&os,&c->p,c->slen,c->tag,c->xclass)
if (d2i_ASN1_bytes(&os,&c->p,c->max-c->p,c->tag,c->xclass)
== NULL)
{
c->error=ERR_R_ASN1_LIB;
@@ -304,7 +302,8 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
goto err;
}
memcpy(&(b.data[num]),os->data,os->length);
c->slen-=(c->p-c->q);
if (!(c->inf & 1))
c->slen-=(c->p-c->q);
num+=os->length;
}

View File

@@ -78,8 +78,7 @@
* and a FILE pointer.
*/
#if 0 /* Not used */
static int send_mem_chars(void *arg, const void *buf, int len)
int send_mem_chars(void *arg, const void *buf, int len)
{
unsigned char **out = arg;
if(!out) return 1;
@@ -87,16 +86,15 @@ static int send_mem_chars(void *arg, const void *buf, int len)
*out += len;
return 1;
}
#endif
static int send_bio_chars(void *arg, const void *buf, int len)
int send_bio_chars(void *arg, const void *buf, int len)
{
if(!arg) return 1;
if(BIO_write(arg, buf, len) != len) return 0;
return 1;
}
static int send_fp_chars(void *arg, const void *buf, int len)
int send_fp_chars(void *arg, const void *buf, int len)
{
if(!arg) return 1;
if(fwrite(buf, 1, len, arg) != (unsigned int)len) return 0;
@@ -242,8 +240,7 @@ static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, int buflen
* #01234 format.
*/
static int do_dump(unsigned long lflags, char_io *io_ch, void *arg,
ASN1_STRING *str)
int do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str)
{
/* Placing the ASN1_STRING in a temp ASN1_TYPE allows
* the DER encoding to readily obtained
@@ -277,7 +274,7 @@ static int do_dump(unsigned long lflags, char_io *io_ch, void *arg,
* otherwise it is the number of bytes per character
*/
const static signed char tag2nbyte[] = {
const static char tag2nbyte[] = {
-1, -1, -1, -1, -1, /* 0-4 */
-1, -1, -1, -1, -1, /* 5-9 */
-1, -1, 0, -1, /* 10-13 */

View File

@@ -123,7 +123,7 @@ extern "C" {
#define B_ASN1_NUMERICSTRING 0x0001
#define B_ASN1_PRINTABLESTRING 0x0002
#define B_ASN1_T61STRING 0x0004
#define B_ASN1_TELETEXSTRING 0x0004
#define B_ASN1_TELETEXSTRING 0x0008
#define B_ASN1_VIDEOTEXSTRING 0x0008
#define B_ASN1_IA5STRING 0x0010
#define B_ASN1_GRAPHICSTRING 0x0020

View File

@@ -104,12 +104,10 @@ int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
l<<=7L;
l|= *(p++)&0x7f;
if (--max == 0) goto err;
if (l > (INT_MAX >> 7L)) goto err;
}
l<<=7L;
l|= *(p++)&0x7f;
tag=(int)l;
if (--max == 0) goto err;
}
else
{

View File

@@ -63,11 +63,7 @@
#include <string.h>
#include <stdlib.h>
#ifdef FLAT_INC
#include "e_os.h"
#else
#include "../e_os.h"
#endif
#ifdef NO_BF
int main(int argc, char *argv[])

View File

@@ -565,12 +565,12 @@ abs_val(LDOUBLE value)
}
static LDOUBLE
pow10(int in_exp)
pow10(int exp)
{
LDOUBLE result = 1;
while (in_exp) {
while (exp) {
result *= 10;
in_exp--;
exp--;
}
return result;
}
@@ -825,5 +825,5 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
* had the buffer been large enough.) */
return -1;
else
return (retlen <= INT_MAX) ? (int)retlen : -1;
return (retlen <= INT_MAX) ? retlen : -1;
}

View File

@@ -495,7 +495,6 @@ static int buffer_gets(BIO *b, char *buf, int size)
if (i <= 0)
{
BIO_copy_next_retry(b);
*buf='\0';
if (i < 0) return((num > 0)?num:i);
if (i == 0) return(num);
}

View File

@@ -241,7 +241,7 @@ typedef struct bio_method_st
long (_far *ctrl)();
int (_far *create)();
int (_far *destroy)();
long (_far *callback_ctrl)();
long (_fat *callback_ctrl)();
} BIO_METHOD;
#endif

View File

@@ -1,57 +1,4 @@
/* crypto/bio/bss_bio.c -*- Mode: C; c-file-style: "eay" -*- */
/* ====================================================================
* Copyright (c) 1998-2003 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).
*
*/
/* Special method for a BIO where the other endpoint is also a BIO
* of this kind, handled by the same thread (i.e. the "peer" is actually
@@ -556,7 +503,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
break;
case BIO_C_DESTROY_BIO_PAIR:
/* Affects both BIOs in the pair -- call just once!
/* Effects both BIOs in the pair -- call just once!
* Or let BIO_free(bio1); BIO_free(bio2); do the job. */
bio_destroy_pair(bio);
ret = 1;

View File

@@ -259,8 +259,6 @@ typedef struct bn_blinding_st
BIGNUM *A;
BIGNUM *Ai;
BIGNUM *mod; /* just a reference */
unsigned long thread_id; /* added in OpenSSL 0.9.6j and 0.9.7b;
* used only by crypto/rsa/rsa_eay.c, rsa_lib.c */
} BN_BLINDING;
/* Used for montgomery multiplication */

View File

@@ -113,6 +113,13 @@
#include <stdio.h>
#include "cryptlib.h"
#include "bn_lcl.h"
#ifdef ATALLA
# include <alloca.h>
# include <atasi.h>
# include <assert.h>
# include <dlfcn.h>
#endif
#define TABLE_SIZE 32
@@ -176,6 +183,174 @@ err:
}
#ifdef ATALLA
/*
* This routine will dynamically check for the existance of an Atalla AXL-200
* SSL accelerator module. If one is found, the variable
* asi_accelerator_present is set to 1 and the function pointers
* ptr_ASI_xxxxxx above will be initialized to corresponding ASI API calls.
*/
typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
unsigned int *ret_buf);
typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
unsigned char *output,
unsigned char *input,
unsigned int modulus_len);
static tfnASI_GetHardwareConfig *ptr_ASI_GetHardwareConfig;
static tfnASI_RSAPrivateKeyOpFn *ptr_ASI_RSAPrivateKeyOpFn;
static tfnASI_GetPerformanceStatistics *ptr_ASI_GetPerformanceStatistics;
static int asi_accelerator_present;
static int tried_atalla;
void atalla_initialize_accelerator_handle(void)
{
void *dl_handle;
int status;
unsigned int config_buf[1024];
static int tested;
if(tested)
return;
tested=1;
bzero((void *)config_buf, 1024);
/*
* Check to see if the library is present on the system
*/
dl_handle = dlopen("atasi.so", RTLD_NOW);
if (dl_handle == (void *) NULL)
{
/* printf("atasi.so library is not present on the system\n");
printf("No HW acceleration available\n");*/
return;
}
/*
* The library is present. Now we'll check to insure that the
* LDM is up and running. First we'll get the address of the
* function in the atasi library that we need to see if the
* LDM is operating.
*/
ptr_ASI_GetHardwareConfig =
(tfnASI_GetHardwareConfig *)dlsym(dl_handle,"ASI_GetHardwareConfig");
if (ptr_ASI_GetHardwareConfig)
{
/*
* We found the call, now we'll get our config
* status. If we get a non 0 result, the LDM is not
* running and we cannot use the Atalla ASI *
* library.
*/
status = (*ptr_ASI_GetHardwareConfig)(0L, config_buf);
if (status != 0)
{
printf("atasi.so library is present but not initialized\n");
printf("No HW acceleration available\n");
return;
}
}
else
{
/* printf("We found the library, but not the function. Very Strange!\n");*/
return ;
}
/*
* It looks like we have acceleration capabilities. Load up the
* pointers to our ASI API calls.
*/
ptr_ASI_RSAPrivateKeyOpFn=
(tfnASI_RSAPrivateKeyOpFn *)dlsym(dl_handle, "ASI_RSAPrivateKeyOpFn");
if (ptr_ASI_RSAPrivateKeyOpFn == NULL)
{
/* printf("We found the library, but no RSA function. Very Strange!\n");*/
return;
}
ptr_ASI_GetPerformanceStatistics =
(tfnASI_GetPerformanceStatistics *)dlsym(dl_handle, "ASI_GetPerformanceStatistics");
if (ptr_ASI_GetPerformanceStatistics == NULL)
{
/* printf("We found the library, but no stat function. Very Strange!\n");*/
return;
}
/*
* Indicate that acceleration is available
*/
asi_accelerator_present = 1;
/* printf("This system has acceleration!\n");*/
return;
}
/* make sure this only gets called once when bn_mod_exp calls bn_mod_exp_mont */
int BN_mod_exp_atalla(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m)
{
unsigned char *abin;
unsigned char *pbin;
unsigned char *mbin;
unsigned char *rbin;
int an,pn,mn,ret;
RSAPrivateKey keydata;
atalla_initialize_accelerator_handle();
if(!asi_accelerator_present)
return 0;
/* We should be able to run without size testing */
# define ASIZE 128
an=BN_num_bytes(a);
pn=BN_num_bytes(p);
mn=BN_num_bytes(m);
if(an <= ASIZE && pn <= ASIZE && mn <= ASIZE)
{
int size=mn;
assert(an <= mn);
abin=alloca(size);
memset(abin,'\0',mn);
BN_bn2bin(a,abin+size-an);
pbin=alloca(pn);
BN_bn2bin(p,pbin);
mbin=alloca(size);
memset(mbin,'\0',mn);
BN_bn2bin(m,mbin+size-mn);
rbin=alloca(size);
memset(&keydata,'\0',sizeof keydata);
keydata.privateExponent.data=pbin;
keydata.privateExponent.len=pn;
keydata.modulus.data=mbin;
keydata.modulus.len=size;
ret=(*ptr_ASI_RSAPrivateKeyOpFn)(&keydata,rbin,abin,keydata.modulus.len);
/*fprintf(stderr,"!%s\n",BN_bn2hex(a));*/
if(!ret)
{
BN_bin2bn(rbin,keydata.modulus.len,r);
/*fprintf(stderr,"?%s\n",BN_bn2hex(r));*/
return 1;
}
}
return 0;
}
#endif /* def ATALLA */
int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
BN_CTX *ctx)
{
@@ -185,6 +360,13 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
bn_check_top(p);
bn_check_top(m);
#ifdef ATALLA
if(BN_mod_exp_atalla(r,a,p,m))
return 1;
/* If it fails, try the other methods (but don't try atalla again) */
tried_atalla=1;
#endif
#ifdef MONT_MUL_MOD
/* I have finally been able to take out this pre-condition of
* the top bit being set. It was caused by an error in BN_div
@@ -210,6 +392,10 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
{ ret=BN_mod_exp_simple(r,a,p,m,ctx); }
#endif
#ifdef ATALLA
tried_atalla=0;
#endif
return(ret);
}
@@ -339,6 +525,12 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
bn_check_top(p);
bn_check_top(m);
#ifdef ATALLA
if(!tried_atalla && BN_mod_exp_atalla(rr,a,p,m))
return 1;
/* If it fails, try the other methods */
#endif
if (!(m->d[0] & 1))
{
BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS);
@@ -501,6 +693,19 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
t = BN_CTX_get(ctx);
if (d == NULL || r == NULL || t == NULL) goto err;
#ifdef ATALLA
if (!tried_atalla)
{
BN_set_word(t, a);
if (BN_mod_exp_atalla(rr, t, p, m))
{
BN_CTX_end(ctx);
return 1;
}
}
/* If it fails, try the other methods */
#endif
if (in_mont != NULL)
mont=in_mont;
else

View File

@@ -224,7 +224,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
int n, BN_ULONG *t)
{
int i,j,n2=n*2;
int c1,c2,neg,zero;
unsigned int c1,c2,neg,zero;
BN_ULONG ln,lo,*p;
# ifdef BN_COUNT
@@ -376,7 +376,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
/* The overflow will stop before we over write
* words we should not overwrite */
if (ln < (BN_ULONG)c1)
if (ln < c1)
{
do {
p++;

View File

@@ -58,7 +58,6 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "cryptlib.h"
#include <openssl/crypto.h>
#include <openssl/safestack.h>
@@ -103,8 +102,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
"debug_malloc2",
"dso",
"dynlock",
"engine",
#if CRYPTO_NUM_LOCKS != 30
#if CRYPTO_NUM_LOCKS != 29
# error "Inconsistency between crypto.h and cryptlib.c"
#endif
};
@@ -207,18 +205,10 @@ int CRYPTO_get_new_dynlockid(void)
i=sk_CRYPTO_dynlock_find(dyn_locks,NULL);
/* If there was none, push, thereby creating a new one */
if (i == -1)
/* Since sk_push() returns the number of items on the
stack, not the location of the pushed item, we need
to transform the returned number into a position,
by decreasing it. */
i=sk_CRYPTO_dynlock_push(dyn_locks,pointer) - 1;
else
/* If we found a place with a NULL pointer, put our pointer
in it. */
sk_CRYPTO_dynlock_set(dyn_locks,i,pointer);
i=sk_CRYPTO_dynlock_push(dyn_locks,pointer);
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
if (i == -1)
if (!i)
{
dynlock_destroy_callback(pointer->data,__FILE__,__LINE__);
OPENSSL_free(pointer);
@@ -241,7 +231,7 @@ void CRYPTO_destroy_dynlockid(int i)
if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
{
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
return;
return;
}
pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
if (pointer != NULL)
@@ -410,17 +400,16 @@ void CRYPTO_lock(int mode, int type, const char *file, int line)
#endif
if (type < 0)
{
if (dynlock_lock_callback != NULL)
int i = -type - 1;
struct CRYPTO_dynlock_value *pointer
= CRYPTO_get_dynlock_value(i);
if (pointer && dynlock_lock_callback)
{
struct CRYPTO_dynlock_value *pointer
= CRYPTO_get_dynlock_value(type);
assert(pointer != NULL);
dynlock_lock_callback(mode, pointer, file, line);
CRYPTO_destroy_dynlockid(type);
}
CRYPTO_destroy_dynlockid(i);
}
else
if (locking_callback != NULL)
@@ -503,11 +492,3 @@ BOOL WINAPI DLLEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason,
#endif
#endif
void OpenSSLDie(const char *file,int line,const char *assertion)
{
fprintf(stderr,"%s(%d): OpenSSL internal error, assertion failed: %s\n",
file,line,assertion);
abort();
}

View File

@@ -62,11 +62,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef FLAT_INC
#include "e_os.h"
#else
#include "../e_os.h"
#endif
#include "openssl/e_os.h"
#include <openssl/crypto.h>
#include <openssl/buffer.h>

View File

@@ -88,7 +88,7 @@ $! Define The Different Encryption Types.
$!
$ ENCRYPT_TYPES = "Basic,MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ -
"DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ -
"BN,RSA,DSA,DH,DSO,ENGINE,"+ -
"BN,RSA,DSA,DH,DSO,"+ -
"BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,"+ -
"EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
"CONF,TXT_DB,PKCS7,PKCS12,COMP"
@@ -206,9 +206,6 @@ $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl"
$ LIB_DH = "dh_gen,dh_key,dh_lib,dh_check,dh_err"
$ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
"dso_openssl,dso_win32,dso_vms"
$ LIB_ENGINE = "engine_err,engine_lib,engine_list,engine_openssl,"+ -
"hw_atalla,hw_cswift,hw_ncipher,hw_aep,hw_sureware,"+ -
"hw_ubsec,hw_keyclient"
$ LIB_BUFFER = "buffer,buf_err"
$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
"bss_mem,bss_null,bss_fd,"+ -
@@ -1142,7 +1139,7 @@ $ ENDIF
$!
$! Set Up Initial CC Definitions, Possibly With User Ones
$!
$ CCDEFS = "VMS=1,TCPIP_TYPE_''P5',DSO_VMS,THREADS"
$ CCDEFS = "VMS=1,TCPIP_TYPE_''P5',DSO_VMS"
$ IF F$TRNLNM("OPENSSL_NO_ASM") THEN CCDEFS = CCDEFS + ",NO_ASM"
$ IF F$TRNLNM("OPENSSL_NO_RSA") THEN CCDEFS = CCDEFS + ",NO_RSA"
$ IF F$TRNLNM("OPENSSL_NO_DSA") THEN CCDEFS = CCDEFS + ",NO_DSA"
@@ -1198,9 +1195,7 @@ $ CC = "CC"
$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
THEN CC = "CC/DECC"
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
"/NOLIST/PREFIX=ALL" + -
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
CCEXTRAFLAGS
"/NOLIST/PREFIX=ALL/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS
$!
$! Define The Linker Options File Name.
$!
@@ -1232,8 +1227,7 @@ $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
$ EXIT
$ ENDIF
$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST/INCLUDE=SYS$DISK:[]" + -
CCEXTRAFLAGS
$ CCDEFS = """VAXC""," + CCDEFS
$!
@@ -1265,8 +1259,7 @@ $!
$! Use GNU C...
$!
$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
CCEXTRAFLAGS
"/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS
$!
$! Define The Linker Options File Name.
$!

View File

@@ -126,8 +126,7 @@ extern "C" {
#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_NUM_LOCKS 29
#define CRYPTO_LOCK 1
#define CRYPTO_UNLOCK 2

View File

@@ -56,7 +56,6 @@
* [including the GNU Public Licence.]
*/
#include "openssl/e_os.h"
#include "des_locl.h"
/* The input and output are loaded in multiples of 8 bits.

View File

@@ -86,7 +86,6 @@
#endif
#include <sys/stat.h>
#endif
#include <openssl/crypto.h>
#include <openssl/des.h>
#include <openssl/rand.h>

View File

@@ -101,39 +101,19 @@ dh_gen.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dh_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
dh_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dh_gen.o: ../cryptlib.h
dh_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
dh_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
dh_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
dh_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dh_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
dh_key.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dh_key.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
dh_key.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
dh_key.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
dh_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dh_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dh_key.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
dh_key.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dh_key.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
dh_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
dh_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
dh_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
dh_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
dh_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
dh_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dh_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
dh_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
dh_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
dh_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
dh_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
dh_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
dh_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
dh_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dh_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
dh_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
dh_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
dh_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dh_lib.o: ../cryptlib.h

View File

@@ -115,11 +115,7 @@ struct dh_st
int references;
CRYPTO_EX_DATA ex_data;
#if 0
DH_METHOD *meth;
#else
struct engine_st *engine;
#endif
};
#define DH_GENERATOR_2 2
@@ -154,15 +150,10 @@ struct dh_st
DH_METHOD *DH_OpenSSL(void);
void DH_set_default_openssl_method(DH_METHOD *meth);
DH_METHOD *DH_get_default_openssl_method(void);
#if 0
void DH_set_default_method(DH_METHOD *meth);
DH_METHOD *DH_get_default_method(void);
DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth);
DH *DH_new_method(DH_METHOD *meth);
#else
int DH_set_method(DH *dh, struct engine_st *engine);
DH *DH_new_method(struct engine_st *engine);
#endif
DH * DH_new(void);
void DH_free(DH *dh);

View File

@@ -61,7 +61,6 @@
#include <openssl/bn.h>
#include <openssl/rand.h>
#include <openssl/dh.h>
#include <openssl/engine.h>
static int generate_key(DH *dh);
static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
@@ -73,12 +72,12 @@ static int dh_finish(DH *dh);
int DH_generate_key(DH *dh)
{
return ENGINE_get_DH(dh->engine)->generate_key(dh);
return dh->meth->generate_key(dh);
}
int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
{
return ENGINE_get_DH(dh->engine)->compute_key(key, pub_key, dh);
return dh->meth->compute_key(key, pub_key, dh);
}
static DH_METHOD dh_ossl = {
@@ -133,14 +132,12 @@ 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;
if (generate_new_key)
{
l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
if (!BN_rand(priv_key, l, 0, 0)) goto err;
}
if (!dh->meth->bn_mod_exp(dh, pub_key,dh->g,priv_key,dh->p,&ctx,mont)) goto err;
dh->pub_key=pub_key;
dh->priv_key=priv_key;
@@ -179,8 +176,7 @@ static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
}
mont=(BN_MONT_CTX *)dh->method_mont_p;
if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, tmp, pub_key,
dh->priv_key,dh->p,&ctx,mont))
if (!dh->meth->bn_mod_exp(dh, tmp,pub_key,dh->priv_key,dh->p,&ctx,mont))
{
DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);
goto err;

View File

@@ -60,7 +60,6 @@
#include "cryptlib.h"
#include <openssl/bn.h>
#include <openssl/dh.h>
#include <openssl/engine.h>
const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
@@ -68,32 +67,17 @@ static DH_METHOD *default_DH_method = NULL;
static int dh_meth_num = 0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;
void DH_set_default_openssl_method(DH_METHOD *meth)
void DH_set_default_method(DH_METHOD *meth)
{
ENGINE *e;
/* We'll need to notify the "openssl" ENGINE of this
* change too. We won't bother locking things down at
* our end as there was never any locking in these
* functions! */
if(default_DH_method != meth)
{
default_DH_method = meth;
e = ENGINE_by_id("openssl");
if(e)
{
ENGINE_set_DH(e, meth);
ENGINE_free(e);
}
}
default_DH_method = meth;
}
DH_METHOD *DH_get_default_openssl_method(void)
DH_METHOD *DH_get_default_method(void)
{
if(!default_DH_method) default_DH_method = DH_OpenSSL();
return default_DH_method;
}
#if 0
DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
{
DH_METHOD *mtmp;
@@ -103,37 +87,14 @@ DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
if (meth->init) meth->init(dh);
return mtmp;
}
#else
int DH_set_method(DH *dh, ENGINE *engine)
{
ENGINE *mtmp;
DH_METHOD *meth;
mtmp = dh->engine;
meth = ENGINE_get_DH(mtmp);
if (!ENGINE_init(engine))
return 0;
if (meth->finish) meth->finish(dh);
dh->engine= engine;
meth = ENGINE_get_DH(engine);
if (meth->init) meth->init(dh);
/* SHOULD ERROR CHECK THIS!!! */
ENGINE_finish(mtmp);
return 1;
}
#endif
DH *DH_new(void)
{
return DH_new_method(NULL);
}
#if 0
DH *DH_new_method(DH_METHOD *meth)
#else
DH *DH_new_method(ENGINE *engine)
#endif
{
DH_METHOD *meth;
DH *ret;
ret=(DH *)OPENSSL_malloc(sizeof(DH));
@@ -142,17 +103,8 @@ DH *DH_new_method(ENGINE *engine)
DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);
return(NULL);
}
if(engine)
ret->engine = engine;
else
{
if((ret->engine=ENGINE_get_default_DH()) == NULL)
{
OPENSSL_free(ret);
return NULL;
}
}
meth = ENGINE_get_DH(ret->engine);
if(meth) ret->meth = meth;
else ret->meth = DH_get_default_method();
ret->pad=0;
ret->version=0;
ret->p=NULL;
@@ -167,9 +119,9 @@ DH *DH_new_method(ENGINE *engine)
ret->counter = NULL;
ret->method_mont_p=NULL;
ret->references = 1;
ret->flags=meth->flags;
ret->flags=ret->meth->flags;
CRYPTO_new_ex_data(dh_meth,ret,&ret->ex_data);
if ((meth->init != NULL) && !meth->init(ret))
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
{
CRYPTO_free_ex_data(dh_meth,ret,&ret->ex_data);
OPENSSL_free(ret);
@@ -180,7 +132,6 @@ DH *DH_new_method(ENGINE *engine)
void DH_free(DH *r)
{
DH_METHOD *meth;
int i;
if(r == NULL) return;
i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
@@ -196,9 +147,7 @@ void DH_free(DH *r)
}
#endif
meth = ENGINE_get_DH(r->engine);
if(meth->finish) meth->finish(r);
ENGINE_finish(r->engine);
if(r->meth->finish) r->meth->finish(r);
CRYPTO_free_ex_data(dh_meth, r, &r->ex_data);

View File

@@ -116,75 +116,39 @@ dsa_key.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
dsa_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dsa_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
dsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
dsa_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
dsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
dsa_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
dsa_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
dsa_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
dsa_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
dsa_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
dsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
dsa_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dsa_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
dsa_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dsa_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dsa_lib.o: ../cryptlib.h
dsa_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
dsa_ossl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
dsa_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
dsa_ossl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_ossl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
dsa_ossl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_ossl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
dsa_ossl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
dsa_ossl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
dsa_ossl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dsa_ossl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dsa_ossl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
dsa_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dsa_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
dsa_ossl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
dsa_ossl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
dsa_ossl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
dsa_ossl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dsa_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dsa_ossl.o: ../../include/openssl/symhacks.h ../cryptlib.h
dsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
dsa_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
dsa_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
dsa_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_sign.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
dsa_sign.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
dsa_sign.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
dsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dsa_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
dsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
dsa_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
dsa_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
dsa_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
dsa_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dsa_sign.o: ../../include/openssl/symhacks.h ../cryptlib.h
dsa_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
dsa_vrf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_vrf.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
dsa_vrf.o: ../../include/openssl/des.h ../../include/openssl/dh.h
dsa_vrf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
dsa_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
dsa_vrf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
dsa_vrf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
dsa_vrf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
dsa_vrf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dsa_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dsa_vrf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_vrf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
dsa_vrf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
dsa_vrf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
dsa_vrf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
dsa_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
dsa_vrf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dsa_vrf.o: ../cryptlib.h

View File

@@ -133,11 +133,7 @@ struct dsa_st
char *method_mont_p;
int references;
CRYPTO_EX_DATA ex_data;
#if 0
DSA_METHOD *meth;
#else
struct engine_st *engine;
#endif
};
#define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \
@@ -163,20 +159,12 @@ int DSA_do_verify(const unsigned char *dgst,int dgst_len,
DSA_METHOD *DSA_OpenSSL(void);
void DSA_set_default_openssl_method(DSA_METHOD *);
DSA_METHOD *DSA_get_default_openssl_method(void);
#if 0
void DSA_set_default_method(DSA_METHOD *);
DSA_METHOD *DSA_get_default_method(void);
DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *);
#else
int DSA_set_method(DSA *dsa, struct engine_st *engine);
#endif
DSA * DSA_new(void);
#if 0
DSA * DSA_new_method(DSA_METHOD *meth);
#else
DSA * DSA_new_method(struct engine_st *engine);
#endif
int DSA_size(DSA *);
/* next 4 return -1 on error */
int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp);

View File

@@ -63,7 +63,6 @@
#include <openssl/bn.h>
#include <openssl/dsa.h>
#include <openssl/asn1.h>
#include <openssl/engine.h>
const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
@@ -71,26 +70,12 @@ static DSA_METHOD *default_DSA_method = NULL;
static int dsa_meth_num = 0;
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;
void DSA_set_default_openssl_method(DSA_METHOD *meth)
void DSA_set_default_method(DSA_METHOD *meth)
{
ENGINE *e;
/* We'll need to notify the "openssl" ENGINE of this
* change too. We won't bother locking things down at
* our end as there was never any locking in these
* functions! */
if(default_DSA_method != meth)
{
default_DSA_method = meth;
e = ENGINE_by_id("openssl");
if(e)
{
ENGINE_set_DSA(e, meth);
ENGINE_free(e);
}
}
default_DSA_method = meth;
}
DSA_METHOD *DSA_get_default_openssl_method(void)
DSA_METHOD *DSA_get_default_method(void)
{
if(!default_DSA_method) default_DSA_method = DSA_OpenSSL();
return default_DSA_method;
@@ -101,7 +86,6 @@ DSA *DSA_new(void)
return DSA_new_method(NULL);
}
#if 0
DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
{
DSA_METHOD *mtmp;
@@ -111,33 +95,10 @@ DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
if (meth->init) meth->init(dsa);
return mtmp;
}
#else
int DSA_set_method(DSA *dsa, ENGINE *engine)
{
ENGINE *mtmp;
DSA_METHOD *meth;
mtmp = dsa->engine;
meth = ENGINE_get_DSA(mtmp);
if (!ENGINE_init(engine))
return 0;
if (meth->finish) meth->finish(dsa);
dsa->engine = engine;
meth = ENGINE_get_DSA(engine);
if (meth->init) meth->init(dsa);
/* SHOULD ERROR CHECK THIS!!! */
ENGINE_finish(mtmp);
return 1;
}
#endif
#if 0
DSA *DSA_new_method(DSA_METHOD *meth)
#else
DSA *DSA_new_method(ENGINE *engine)
#endif
{
DSA_METHOD *meth;
DSA *ret;
ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
@@ -146,17 +107,8 @@ DSA *DSA_new_method(ENGINE *engine)
DSAerr(DSA_F_DSA_NEW,ERR_R_MALLOC_FAILURE);
return(NULL);
}
if(engine)
ret->engine = engine;
else
{
if((ret->engine=ENGINE_get_default_DSA()) == NULL)
{
OPENSSL_free(ret);
return NULL;
}
}
meth = ENGINE_get_DSA(ret->engine);
if(meth) ret->meth = meth;
else ret->meth = DSA_get_default_method();
ret->pad=0;
ret->version=0;
ret->write_params=1;
@@ -172,9 +124,9 @@ DSA *DSA_new_method(ENGINE *engine)
ret->method_mont_p=NULL;
ret->references=1;
ret->flags=meth->flags;
ret->flags=ret->meth->flags;
CRYPTO_new_ex_data(dsa_meth,ret,&ret->ex_data);
if ((meth->init != NULL) && !meth->init(ret))
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
{
CRYPTO_free_ex_data(dsa_meth,ret,&ret->ex_data);
OPENSSL_free(ret);
@@ -186,7 +138,6 @@ DSA *DSA_new_method(ENGINE *engine)
void DSA_free(DSA *r)
{
DSA_METHOD *meth;
int i;
if (r == NULL) return;
@@ -204,9 +155,7 @@ void DSA_free(DSA *r)
}
#endif
meth = ENGINE_get_DSA(r->engine);
if(meth->finish) meth->finish(r);
ENGINE_finish(r->engine);
if(r->meth->finish) r->meth->finish(r);
CRYPTO_free_ex_data(dsa_meth, r, &r->ex_data);

View File

@@ -64,7 +64,6 @@
#include <openssl/dsa.h>
#include <openssl/rand.h>
#include <openssl/asn1.h>
#include <openssl/engine.h>
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
@@ -202,7 +201,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
}
/* Compute r = (g^k mod p) mod q */
if (!ENGINE_get_DSA(dsa->engine)->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
(BN_MONT_CTX *)dsa->method_mont_p)) goto err;
if (!BN_mod(r,r,dsa->q,ctx)) goto err;
@@ -291,7 +290,7 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
if (!BN_mod(&u1,&u1,dsa->q,ctx)) goto err;
#else
{
if (!ENGINE_get_DSA(dsa->engine)->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2,
if (!dsa->meth->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2,
dsa->p,ctx,mont)) goto err;
/* BN_copy(&u1,&t1); */
/* let u1 = u1 mod q */

View File

@@ -64,11 +64,10 @@
#include <openssl/dsa.h>
#include <openssl/rand.h>
#include <openssl/asn1.h>
#include <openssl/engine.h>
DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
{
return ENGINE_get_DSA(dsa->engine)->dsa_do_sign(dgst, dlen, dsa);
return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
}
int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
@@ -88,6 +87,6 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
{
return ENGINE_get_DSA(dsa->engine)->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
}

View File

@@ -65,12 +65,11 @@
#include <openssl/rand.h>
#include <openssl/asn1.h>
#include <openssl/asn1_mac.h>
#include <openssl/engine.h>
int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
DSA *dsa)
{
return ENGINE_get_DSA(dsa->engine)->dsa_do_verify(dgst, dgst_len, sig, dsa);
return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
}
/* data has already been hashed (probably with SHA or SHA-1). */

View File

@@ -217,7 +217,6 @@ end:
static int cb_exit(int ec)
{
EXIT(ec);
return(0); /* To keep some compilers quiet */
}
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)

View File

@@ -123,11 +123,7 @@ DSO_METHOD *DSO_METHOD_dlfcn(void)
# endif
# endif
#else
# ifdef OPENSSL_SYS_SUNOS
# define DLOPEN_FLAG 1
# else
# define DLOPEN_FLAG RTLD_NOW /* Hope this works everywhere else */
# endif
# define DLOPEN_FLAG RTLD_NOW /* Hope this works everywhere else */
#endif
/* For this DSO_METHOD, our meth_data STACK will contain;

View File

@@ -1,2 +0,0 @@
lib
Makefile.save

View File

@@ -1,304 +0,0 @@
#
# OpenSSL/crypto/engine/Makefile
#
DIR= engine
TOP= ../..
CC= cc
INCLUDES= -I.. -I../../include
CFLAG=-g
INSTALL_PREFIX=
OPENSSLDIR= /usr/local/ssl
INSTALLTOP=/usr/local/ssl
MAKE= make -f Makefile.ssl
MAKEDEPEND= $(TOP)/util/domd $(TOP)
MAKEFILE= Makefile.ssl
AR= ar r
CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile
TEST= enginetest.c
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= engine_err.c engine_lib.c engine_list.c engine_openssl.c \
hw_atalla.c hw_cswift.c hw_ncipher.c 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_aep.o hw_sureware.o \
hw_ubsec.o hw_keyclient.o
SRC= $(LIBSRC)
EXHEADER= engine.h
HEADER= $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
$(RANLIB) $(LIB)
@touch lib
files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
links:
@$(TOP)/util/point.sh Makefile.ssl Makefile
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
@for i in $(EXHEADER) ; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
ctags $(SRC)
tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
$(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
engine_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
engine_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
engine_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
engine_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h
engine_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
engine_err.o: ../../include/openssl/engine.h ../../include/openssl/err.h
engine_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
engine_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
engine_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
engine_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
engine_err.o: ../../include/openssl/objects.h
engine_err.o: ../../include/openssl/opensslconf.h
engine_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
engine_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
engine_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
engine_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
engine_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
engine_err.o: ../../include/openssl/symhacks.h
engine_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
engine_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
engine_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
engine_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
engine_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
engine_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
engine_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
engine_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
engine_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
engine_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
engine_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
engine_lib.o: ../../include/openssl/objects.h
engine_lib.o: ../../include/openssl/opensslconf.h
engine_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
engine_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
engine_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
engine_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
engine_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
engine_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
engine_list.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
engine_list.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
engine_list.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
engine_list.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
engine_list.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
engine_list.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
engine_list.o: ../../include/openssl/engine.h ../../include/openssl/err.h
engine_list.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
engine_list.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
engine_list.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
engine_list.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
engine_list.o: ../../include/openssl/objects.h
engine_list.o: ../../include/openssl/opensslconf.h
engine_list.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
engine_list.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
engine_list.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
engine_list.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
engine_list.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
engine_list.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
engine_openssl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
engine_openssl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
engine_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
engine_openssl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
engine_openssl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
engine_openssl.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
engine_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
engine_openssl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
engine_openssl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
engine_openssl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
engine_openssl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
engine_openssl.o: ../../include/openssl/obj_mac.h
engine_openssl.o: ../../include/openssl/objects.h
engine_openssl.o: ../../include/openssl/opensslconf.h
engine_openssl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
engine_openssl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
engine_openssl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
engine_openssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
engine_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
engine_openssl.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_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_os.h ../../include/openssl/e_os2.h
hw_aep.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_aep.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
hw_aep.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
hw_aep.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
hw_aep.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
hw_aep.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
hw_aep.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
hw_aep.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
hw_aep.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
hw_aep.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
hw_aep.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
hw_aep.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_aep.o: 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
hw_atalla.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_atalla.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_atalla.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
hw_atalla.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_atalla.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_atalla.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_atalla.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_atalla.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_atalla.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_atalla.o: ../../include/openssl/opensslconf.h
hw_atalla.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
hw_atalla.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
hw_atalla.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
hw_atalla.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
hw_atalla.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
hw_atalla.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_atalla.o: vendor_defns/atalla.h
hw_cswift.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_cswift.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_cswift.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
hw_cswift.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_cswift.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_cswift.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
hw_cswift.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_cswift.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_cswift.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_cswift.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_cswift.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_cswift.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_cswift.o: ../../include/openssl/opensslconf.h
hw_cswift.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
hw_cswift.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
hw_cswift.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
hw_cswift.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
hw_cswift.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
hw_cswift.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
hw_cswift.o: vendor_defns/cswift.h
hw_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
hw_ncipher.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_ncipher.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_ncipher.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
hw_ncipher.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_ncipher.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_ncipher.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_ncipher.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_ncipher.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_ncipher.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_ncipher.o: ../../include/openssl/opensslconf.h
hw_ncipher.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
hw_ncipher.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
hw_ncipher.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
hw_ncipher.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
hw_ncipher.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
hw_ncipher.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
hw_ncipher.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
hw_ncipher.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
hw_ncipher.o: ../cryptlib.h engine_int.h vendor_defns/hwcryptohook.h
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

@@ -1,278 +0,0 @@
NOTES, THOUGHTS, and EVERYTHING
-------------------------------
(1) Concurrency and locking ... I made a change to the ENGINE_free code
because I spotted a potential hold-up in proceedings (doing too
much inside a lock including calling a callback), there may be
other bits like this. What do the speed/optimisation freaks think
of this aspect of the code and design? There's lots of locking for
manipulation functions and I need that to keep things nice and
solid, but this manipulation is mostly (de)initialisation, I would
think that most run-time locking is purely in the ENGINE_init and
ENGINE_finish calls that might be made when getting handles for
RSA (and friends') structures. These would be mostly reference
count operations as the functional references should always be 1
or greater at run-time to prevent init/deinit thrashing.
(2) nCipher support, via the HWCryptoHook API, is now in the code.
Apparently this hasn't been tested too much yet, but it looks
good. :-) Atalla support has been added too, but shares a lot in
common with Ben's original hooks in bn_exp.c (although it has been
ENGINE-ified, and error handling wrapped around it) and it's also
had some low-volume testing, so it should be usable.
(3) Of more concern, we need to work out (a) how to put together usable
RAND_METHODs for units that just have one "get n or less random
bytes" function, (b) we also need to determine how to hook the code
in crypto/rand/ to use the ENGINE defaults in a way similar to what
has been done in crypto/rsa/, crypto/dsa/, etc.
(4) ENGINE should really grow to encompass more than 3 public key
algorithms and randomness gathering. The structure/data level of
the engine code is hidden from code outside the crypto/engine/
directory so change shouldn't be too viral. More important though
is how things should evolve ... this needs thought and discussion.
-----------------------------------==*==-----------------------------------
More notes 2000-08-01
---------------------
Geoff Thorpe, who designed the engine part, wrote a pretty good description
of the thoughts he had when he built it, good enough to include verbatim here
(with his permission) -- Richard Levitte
Date: Tue, 1 Aug 2000 16:54:08 +0100 (BST)
From: Geoff Thorpe
Subject: Re: The thoughts to merge BRANCH_engine into the main trunk are
emerging
Hi there,
I'm going to try and do some justice to this, but I'm a little short on
time and the there is an endless amount that could be discussed on this
subject. sigh ... please bear with me :-)
> The changes in BRANCH_engine dig deep into the core of OpenSSL, for example
> into the RSA and RAND routines, adding a level of indirection which is needed
> to keep the abstraction, as far as I understand. It would be a good thing if
> those who do play with those things took a look at the changes that have been
> done in the branch and say out loud how much (or hopefully little) we've made
> fools of ourselves.
The point here is that the code that has emerged in the BRANCH_engine
branch was based on some initial requirements of mine that I went in and
addressed, and Richard has picked up the ball and run with it too. It
would be really useful to get some review of the approach we've taken, but
first I think I need to describe as best I can the reasons behind what has
been done so far, in particular what issues we have tried to address when
doing this, and what issues we have intentionally (or necessarily) tried
to avoid.
methods, engines, and evps
--------------------------
There has been some dicussion, particularly with Steve, about where this
ENGINE stuff might fit into the conceptual picture as/when we start to
abstract algorithms a little bit to make the library more extensible. In
particular, it would desirable to have algorithms (symmetric, hash, pkc,
etc) abstracted in some way that allows them to be just objects sitting in
a list (or database) ... it'll just happen that the "DSA" object doesn't
support encryption whereas the "RSA" object does. This requires a lot of
consideration to begin to know how to tackle it; in particular how
encapsulated should these things be? If the objects also understand their
own ASN1 encodings and what-not, then it would for example be possible to
add support for elliptic-curve DSA in as a new algorithm and automatically
have ECC-DSA certificates supported in SSL applications. Possible, but not
easy. :-)
Whatever, it seems that the way to go (if I've grok'd Steve's comments on
this in the past) is to amalgamate these things in EVP as is already done
(I think) for ciphers or hashes (Steve, please correct/elaborate). I
certainly think something should be done in this direction because right
now we have different source directories, types, functions, and methods
for each algorithm - even when conceptually they are very much different
feathers of the same bird. (This is certainly all true for the public-key
stuff, and may be partially true for the other parts.)
ENGINE was *not* conceived as a way of solving this, far from it. Nor was
it conceived as a way of replacing the various "***_METHOD"s. It was
conceived as an abstraction of a sort of "virtual crypto device". If we
lived in a world where "EVP_ALGO"s (or something like them) encapsulated
particular algorithms like RSA,DSA,MD5,RC4,etc, and "***_METHOD"s
encapsulated interfaces to algorithms (eg. some algo's might support a
PKC_METHOD, a HASH_METHOD, or a CIPHER_METHOD, who knows?), then I would
think that ENGINE would encapsulate an implementation of arbitrarily many
of those algorithms - perhaps as alternatives to existing algorithms
and/or perhaps as new previously unimplemented algorithms. An ENGINE could
be used to contain an alternative software implementation, a wrapper for a
hardware acceleration and/or key-management unit, a comms-wrapper for
distributing cryptographic operations to remote machines, or any other
"devices" your imagination can dream up.
However, what has been done in the ENGINE branch so far is nothing more
than starting to get our toes wet. I had a couple of self-imposed
requirements when putting the initial abstraction together, and I may have
already posed these in one form or another on the list, but briefly;
(i) only bother with public key algorithms for now, and maybe RAND too
(motivated by the need to get hardware support going and the fact
this was a comparitively easy subset to address to begin with).
(ii) don't change (if at all possible) the existing crypto code, ie. the
implementations, the way the ***_METHODs work, etc.
(iii) ensure that if no function from the ENGINE code is ever called then
things work the way they always did, and there is no memory
allocation (otherwise the failure to cleanup would be a problem -
this is part of the reason no STACKs were used, the other part of
the reason being I found them inappropriate).
(iv) ensure that all the built-in crypto was encapsulated by one of
these "ENGINE"s and that this engine was automatically selected as
the default.
(v) provide the minimum hooking possible in the existing crypto code
so that global functions (eg. RSA_public_encrypt) do not need any
extra parameter, yet will use whatever the current default ENGINE
for that RSA key is, and that the default can be set "per-key"
and globally (new keys will assume the global default, and keys
without their own default will be operated on using the global
default). NB: Try and make (v) conflict as little as possible with
(ii). :-)
(vi) wrap the ENGINE code up in duct tape so you can't even see the
corners. Ie. expose no structures at all, just black-box pointers.
(v) maintain internally a list of ENGINEs on which a calling
application can iterate, interrogate, etc. Allow a calling
application to hook in new ENGINEs, remove ENGINEs from the list,
and enforce uniqueness within the global list of each ENGINE's
"unique id".
(vi) keep reference counts for everything - eg. this includes storing a
reference inside each RSA structure to the ENGINE that it uses.
This is freed when the RSA structure is destroyed, or has its
ENGINE explicitly changed. The net effect needs to be that at any
time, it is deterministic to know whether an ENGINE is in use or
can be safely removed (or unloaded in the case of the other type
of reference) without invalidating function pointers that may or
may not be used indavertently in the future. This was actually
one of the biggest problems to overcome in the existing OpenSSL
code - implementations had always been assumed to be ever-present,
so there was no trivial way to get round this.
(vii) distinguish between structural references and functional
references.
A *little* detail
-----------------
While my mind is on it; I'll illustrate the bit in item (vii). This idea
turned out to be very handy - the ENGINEs themselves need to be operated
on and manipulated simply as objects without necessarily trying to
"enable" them for use. Eg. most host machines will not have the necessary
hardware or software to support all the engines one might compile into
OpenSSL, yet it needs to be possible to iterate across the ENGINEs,
querying their names, properties, etc - all happening in a thread-safe
manner that uses reference counts (if you imagine two threads iterating
through a list and one thread removing the ENGINE the other is currently
looking at - you can see the gotcha waiting to happen). For all of this,
*structural references* are used and operate much like the other reference
counts in OpenSSL.
The other kind of reference count is for *functional* references - these
indicate a reference on which the caller can actually assume the
particular ENGINE to be initialised and usable to perform the operations
it implements. Any increment or decrement of the functional reference
count automatically invokes a corresponding change in the structural
reference count, as it is fairly obvious that a functional reference is a
restricted case of a structural reference. So struct_ref >= funct_ref at
all times. NB: functional references are usually obtained by a call to
ENGINE_init(), but can also be created implicitly by calls that require a
new functional reference to be created, eg. ENGINE_set_default(). Either
way the only time the underlying ENGINE's "init" function is really called
is when the (functional) reference count increases to 1, similarly the
underlying "finish" handler is only called as the count goes down to 0.
The effect of this, for example, is that if you set the default ENGINE for
RSA operations to be "cswift", then its functional reference count will
already be at least 1 so the CryptoSwift shared-library and the card will
stay loaded and initialised until such time as all RSA keys using the
cswift ENGINE are changed or destroyed and the default ENGINE for RSA
operations has been changed. This prevents repeated thrashing of init and
finish handling if the count keeps getting down as far as zero.
Otherwise, the way the ENGINE code has been put together I think pretty
much reflects the above points. The reason for the ENGINE structure having
individual RSA_METHOD, DSA_METHOD, etc pointers is simply that it was the
easiest way to go about things for now, to hook it all into the raw
RSA,DSA,etc code, and I was trying to the keep the structure invisible
anyway so that the way this is internally managed could be easily changed
later on when we start to work out what's to be done about these other
abstractions.
Down the line, if some EVP-based technique emerges for adequately
encapsulating algorithms and all their various bits and pieces, then I can
imagine that "ENGINE" would turn into a reference-counting database of
these EVP things, of which the default "openssl" ENGINE would be the
library's own object database of pre-built software implemented algorithms
(and such). It would also be cool to see the idea of "METHOD"s detached
from the algorithms themselves ... so RSA, DSA, ElGamal, etc can all
expose essentially the same METHOD (aka interface), which would include
any querying/flagging stuff to identify what the algorithm can/can't do,
its name, and other stuff like max/min block sizes, key sizes, etc. This
would result in ENGINE similarly detaching its internal database of
algorithm implementations from the function definitions that return
interfaces to them. I think ...
As for DSOs etc. Well the DSO code is pretty handy (but could be made much
more so) for loading vendor's driver-libraries and talking to them in some
generic way, but right now there's still big problems associated with
actually putting OpenSSL code (ie. new ENGINEs, or anything else for that
matter) in dynamically loadable libraries. These problems won't go away in
a hurry so I don't think we should expect to have any kind of
shared-library extensions any time soon - but solving the problems is a
good thing to aim for, and would as a side-effect probably help make
OpenSSL more usable as a shared-library itself (looking at the things
needed to do this will show you why).
One of the problems is that if you look at any of the ENGINE
implementations, eg. hw_cswift.c or hw_ncipher.c, you'll see how it needs
a variety of functionality and definitions from various areas of OpenSSL,
including crypto/bn/, crypto/err/, crypto/ itself (locking for example),
crypto/dso/, crypto/engine/, crypto/rsa, etc etc etc. So if similar code
were to be suctioned off into shared libraries, the shared libraries would
either have to duplicate all the definitions and code and avoid loader
conflicts, or OpenSSL would have to somehow expose all that functionality
to the shared-library. If this isn't a big enough problem, the issue of
binary compatibility will be - anyone writing Apache modules can tell you
that (Ralf? Ben? :-). However, I don't think OpenSSL would need to be
quite so forgiving as Apache should be, so OpenSSL could simply tell its
version to the DSO and leave the DSO with the problem of deciding whether
to proceed or bail out for fear of binary incompatibilities.
Certainly one thing that would go a long way to addressing this is to
embark on a bit of an opaqueness mission. I've set the ENGINE code up with
this in mind - it's so draconian that even to declare your own ENGINE, you
have to get the engine code to create the underlying ENGINE structure, and
then feed in the new ENGINE's function/method pointers through various
"set" functions. The more of the code that takes on such a black-box
approach, the more of the code that will be (a) easy to expose to shared
libraries that need it, and (b) easy to expose to applications wanting to
use OpenSSL itself as a shared-library. From my own explorations in
OpenSSL, the biggest leviathan I've seen that is a problem in this respect
is the BIGNUM code. Trying to "expose" the bignum code through any kind of
organised "METHODs", let alone do all the necessary bignum operations
solely through functions rather than direct access to the structures and
macros, will be a massive pain in the "r"s.
Anyway, I'm done for now - hope it was readable. Thoughts?
Cheers,
Geoff
-----------------------------------==*==-----------------------------------

View File

@@ -1,459 +0,0 @@
/* openssl/engine.h */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_ENGINE_H
#define HEADER_ENGINE_H
#include <openssl/bn.h>
#include <openssl/rsa.h>
#include <openssl/dsa.h>
#include <openssl/dh.h>
#include <openssl/rand.h>
#include <openssl/evp.h>
#include <openssl/symhacks.h>
#ifdef __cplusplus
extern "C" {
#endif
/* These flags are used to control combinations of algorithm (methods)
* by bitwise "OR"ing. */
#define ENGINE_METHOD_RSA (unsigned int)0x0001
#define ENGINE_METHOD_DSA (unsigned int)0x0002
#define ENGINE_METHOD_DH (unsigned int)0x0004
#define ENGINE_METHOD_RAND (unsigned int)0x0008
#define ENGINE_METHOD_BN_MOD_EXP (unsigned int)0x0010
#define ENGINE_METHOD_BN_MOD_EXP_CRT (unsigned int)0x0020
/* Obvious all-or-nothing cases. */
#define ENGINE_METHOD_ALL (unsigned int)0xFFFF
#define ENGINE_METHOD_NONE (unsigned int)0x0000
/* These flags are used to tell the ctrl function what should be done.
* All command numbers are shared between all engines, even if some don't
* make sense to some engines. In such a case, they do nothing but return
* the error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. */
#define ENGINE_CTRL_SET_LOGSTREAM 1
#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
/* Flags specific to the nCipher "chil" engine */
#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
/* Depending on the value of the (long)i argument, this sets or
* unsets the SimpleForkCheck flag in the CHIL API to enable or
* disable checking and workarounds for applications that fork().
*/
#define ENGINE_CTRL_CHIL_NO_LOCKING 101
/* This prevents the initialisation function from providing mutex
* callbacks to the nCipher library. */
/* As we're missing a BIGNUM_METHOD, we need a couple of locally
* defined function types that engines can implement. */
#ifndef HEADER_ENGINE_INT_H
/* mod_exp operation, calculates; r = a ^ p mod m
* NB: ctx can be NULL, but if supplied, the implementation may use
* it if it wishes. */
typedef int (*BN_MOD_EXP)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
/* private key operation for RSA, provided seperately in case other
* RSA implementations wish to use it. */
typedef int (*BN_MOD_EXP_CRT)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
const BIGNUM *iqmp, BN_CTX *ctx);
/* Generic function pointer */
typedef void (*ENGINE_GEN_FUNC_PTR)();
/* Generic function pointer taking no arguments */
typedef void (*ENGINE_GEN_INT_FUNC_PTR)(void);
/* Specific control function pointer */
typedef int (*ENGINE_CTRL_FUNC_PTR)(int cmd, long i, void *p, void (*f)());
/* The list of "engine" types is a static array of (const ENGINE*)
* pointers (not dynamic because static is fine for now and we otherwise
* have to hook an appropriate load/unload function in to initialise and
* cleanup). */
typedef struct engine_st ENGINE;
#endif
/* STRUCTURE functions ... all of these functions deal with pointers to
* ENGINE structures where the pointers have a "structural reference".
* This means that their reference is to allow access to the structure
* but it does not imply that the structure is functional. To simply
* increment or decrement the structural reference count, use ENGINE_new
* and ENGINE_free. NB: This is not required when iterating using
* ENGINE_get_next as it will automatically decrement the structural
* reference count of the "current" ENGINE and increment the structural
* reference count of the ENGINE it returns (unless it is NULL). */
/* Get the first/last "ENGINE" type available. */
ENGINE *ENGINE_get_first(void);
ENGINE *ENGINE_get_last(void);
/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
ENGINE *ENGINE_get_next(ENGINE *e);
ENGINE *ENGINE_get_prev(ENGINE *e);
/* Add another "ENGINE" type into the array. */
int ENGINE_add(ENGINE *e);
/* Remove an existing "ENGINE" type from the array. */
int ENGINE_remove(ENGINE *e);
/* Retrieve an engine from the list by its unique "id" value. */
ENGINE *ENGINE_by_id(const char *id);
/* These functions are useful for manufacturing new ENGINE
* structures. They don't address reference counting at all -
* one uses them to populate an ENGINE structure with personalised
* implementations of things prior to using it directly or adding
* it to the builtin ENGINE list in OpenSSL. These are also here
* so that the ENGINE structure doesn't have to be exposed and
* break binary compatibility!
*
* NB: I'm changing ENGINE_new to force the ENGINE structure to
* be allocated from within OpenSSL. See the comment for
* ENGINE_get_struct_size().
*/
#if 0
ENGINE *ENGINE_new(ENGINE *e);
#else
ENGINE *ENGINE_new(void);
#endif
int ENGINE_free(ENGINE *e);
int ENGINE_set_id(ENGINE *e, const char *id);
int ENGINE_set_name(ENGINE *e, const char *name);
int ENGINE_set_RSA(ENGINE *e, RSA_METHOD *rsa_meth);
int ENGINE_set_DSA(ENGINE *e, DSA_METHOD *dsa_meth);
int ENGINE_set_DH(ENGINE *e, DH_METHOD *dh_meth);
int ENGINE_set_RAND(ENGINE *e, RAND_METHOD *rand_meth);
int ENGINE_set_BN_mod_exp(ENGINE *e, BN_MOD_EXP bn_mod_exp);
int ENGINE_set_BN_mod_exp_crt(ENGINE *e, BN_MOD_EXP_CRT bn_mod_exp_crt);
int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
/* These return values from within the ENGINE structure. These can
* be useful with functional references as well as structural
* references - it depends which you obtained. Using the result
* for functional purposes if you only obtained a structural
* reference may be problematic! */
const char *ENGINE_get_id(ENGINE *e);
const char *ENGINE_get_name(ENGINE *e);
RSA_METHOD *ENGINE_get_RSA(ENGINE *e);
DSA_METHOD *ENGINE_get_DSA(ENGINE *e);
DH_METHOD *ENGINE_get_DH(ENGINE *e);
RAND_METHOD *ENGINE_get_RAND(ENGINE *e);
BN_MOD_EXP ENGINE_get_BN_mod_exp(ENGINE *e);
BN_MOD_EXP_CRT ENGINE_get_BN_mod_exp_crt(ENGINE *e);
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(ENGINE *e);
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(ENGINE *e);
ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(ENGINE *e);
/* ENGINE_new is normally passed a NULL in the first parameter because
* the calling code doesn't have access to the definition of the ENGINE
* structure (for good reason). However, if the caller wishes to use
* its own memory allocation or use a static array, the following call
* should be used to check the amount of memory the ENGINE structure
* will occupy. This will make the code more future-proof.
*
* NB: I'm "#if 0"-ing this out because it's better to force the use of
* internally allocated memory. See similar change in ENGINE_new().
*/
#if 0
int ENGINE_get_struct_size(void);
#endif
/* FUNCTIONAL functions. These functions deal with ENGINE structures
* that have (or will) be initialised for use. Broadly speaking, the
* structural functions are useful for iterating the list of available
* engine types, creating new engine types, and other "list" operations.
* These functions actually deal with ENGINEs that are to be used. As
* such these functions can fail (if applicable) when particular
* engines are unavailable - eg. if a hardware accelerator is not
* attached or not functioning correctly. Each ENGINE has 2 reference
* counts; structural and functional. Every time a functional reference
* is obtained or released, a corresponding structural reference is
* automatically obtained or released too. */
/* Initialise a engine type for use (or up its reference count if it's
* already in use). This will fail if the engine is not currently
* operational and cannot initialise. */
int ENGINE_init(ENGINE *e);
/* Free a functional reference to a engine type. This does not require
* a corresponding call to ENGINE_free as it also releases a structural
* reference. */
int ENGINE_finish(ENGINE *e);
/* Send control parametrised commands to the engine. The possibilities
* to send down an integer, a pointer to data or a function pointer are
* provided. Any of the parameters may or may not be NULL, depending
* on the command number */
/* WARNING: This is currently experimental and may change radically! */
int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
/* The following functions handle keys that are stored in some secondary
* location, handled by the engine. The storage may be on a card or
* whatever. */
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
const char *passphrase);
EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
const char *passphrase);
/* This returns a pointer for the current ENGINE structure that
* is (by default) performing any RSA operations. The value returned
* is an incremented reference, so it should be free'd (ENGINE_finish)
* before it is discarded. */
ENGINE *ENGINE_get_default_RSA(void);
/* Same for the other "methods" */
ENGINE *ENGINE_get_default_DSA(void);
ENGINE *ENGINE_get_default_DH(void);
ENGINE *ENGINE_get_default_RAND(void);
ENGINE *ENGINE_get_default_BN_mod_exp(void);
ENGINE *ENGINE_get_default_BN_mod_exp_crt(void);
/* This sets a new default ENGINE structure for performing RSA
* operations. If the result is non-zero (success) then the ENGINE
* structure will have had its reference count up'd so the caller
* should still free their own reference 'e'. */
int ENGINE_set_default_RSA(ENGINE *e);
/* Same for the other "methods" */
int ENGINE_set_default_DSA(ENGINE *e);
int ENGINE_set_default_DH(ENGINE *e);
int ENGINE_set_default_RAND(ENGINE *e);
int ENGINE_set_default_BN_mod_exp(ENGINE *e);
int ENGINE_set_default_BN_mod_exp_crt(ENGINE *e);
/* The combination "set" - the flags are bitwise "OR"d from the
* ENGINE_METHOD_*** defines above. */
int ENGINE_set_default(ENGINE *e, unsigned int flags);
/*
* Error codes for all engine functions. NB: We use "generic"
* function names instead of per-implementation ones because this
* levels the playing field for externally implemented bootstrapped
* support code. As the filename and line number is included, it's
* more important to indicate the type of function, so that
* bootstrapped code (that can't easily add its own errors in) can
* use the same error codes too.
*/
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
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
#define ENGINE_F_ATALLA_RSA_MOD_EXP 138
#define ENGINE_F_CSWIFT_DSA_SIGN 133
#define ENGINE_F_CSWIFT_DSA_VERIFY 134
#define ENGINE_F_CSWIFT_FINISH 100
#define ENGINE_F_CSWIFT_INIT 101
#define ENGINE_F_CSWIFT_MOD_EXP 102
#define ENGINE_F_CSWIFT_MOD_EXP_CRT 103
#define ENGINE_F_CSWIFT_RSA_MOD_EXP 104
#define ENGINE_F_ENGINE_ADD 105
#define ENGINE_F_ENGINE_BY_ID 106
#define ENGINE_F_ENGINE_CTRL 142
#define ENGINE_F_ENGINE_FINISH 107
#define ENGINE_F_ENGINE_FREE 108
#define ENGINE_F_ENGINE_GET_BN_MOD_EXP 109
#define ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT 110
#define ENGINE_F_ENGINE_GET_CTRL_FUNCTION 144
#define ENGINE_F_ENGINE_GET_DH 111
#define ENGINE_F_ENGINE_GET_DSA 112
#define ENGINE_F_ENGINE_GET_FINISH_FUNCTION 145
#define ENGINE_F_ENGINE_GET_ID 113
#define ENGINE_F_ENGINE_GET_INIT_FUNCTION 146
#define ENGINE_F_ENGINE_GET_NAME 114
#define ENGINE_F_ENGINE_GET_NEXT 115
#define ENGINE_F_ENGINE_GET_PREV 116
#define ENGINE_F_ENGINE_GET_RAND 117
#define ENGINE_F_ENGINE_GET_RSA 118
#define ENGINE_F_ENGINE_INIT 119
#define ENGINE_F_ENGINE_LIST_ADD 120
#define ENGINE_F_ENGINE_LIST_REMOVE 121
#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
#define ENGINE_F_ENGINE_NEW 122
#define ENGINE_F_ENGINE_REMOVE 123
#define ENGINE_F_ENGINE_SET_BN_MOD_EXP 124
#define ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT 125
#define ENGINE_F_ENGINE_SET_CTRL_FUNCTION 147
#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
#define ENGINE_F_ENGINE_SET_DH 127
#define ENGINE_F_ENGINE_SET_DSA 128
#define ENGINE_F_ENGINE_SET_FINISH_FUNCTION 148
#define ENGINE_F_ENGINE_SET_ID 129
#define ENGINE_F_ENGINE_SET_INIT_FUNCTION 149
#define ENGINE_F_ENGINE_SET_NAME 130
#define ENGINE_F_ENGINE_SET_RAND 131
#define ENGINE_F_ENGINE_SET_RSA 132
#define ENGINE_F_ENGINE_UNLOAD_KEY 152
#define ENGINE_F_HWCRHK_CTRL 143
#define ENGINE_F_HWCRHK_FINISH 135
#define ENGINE_F_HWCRHK_GET_PASS 155
#define ENGINE_F_HWCRHK_INIT 136
#define ENGINE_F_HWCRHK_LOAD_PRIVKEY 153
#define ENGINE_F_HWCRHK_LOAD_PUBKEY 154
#define ENGINE_F_HWCRHK_MOD_EXP 137
#define ENGINE_F_HWCRHK_MOD_EXP_CRT 138
#define ENGINE_F_HWCRHK_RAND_BYTES 139
#define ENGINE_F_HWCRHK_RSA_MOD_EXP 140
#define ENGINE_F_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
#define ENGINE_R_BN_EXPAND_FAIL 102
#define ENGINE_R_CHIL_ERROR 123
#define ENGINE_R_CLOSE_HANDLES_FAILED 140
#define ENGINE_R_CONFLICTING_ENGINE_ID 103
#define ENGINE_R_CONNECTIONS_IN_USE 141
#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
#define ENGINE_R_DSO_FAILURE 104
#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
#define ENGINE_R_FINALIZE_FAILED 142
#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_LOCKING_MISSING 143
#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
#define ENGINE_R_NO_SUCH_ENGINE 116
#define ENGINE_R_NO_UNLOAD_FUNCTION 126
#define ENGINE_R_PROVIDE_PARAMETERS 113
#define ENGINE_R_REQUEST_FAILED 114
#define ENGINE_R_REQUEST_FALLBACK 118
#define ENGINE_R_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
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,247 +0,0 @@
/* crypto/engine/engine_err.c */
/* ====================================================================
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/engine.h>
/* BEGIN ERROR CODES */
#ifndef NO_ERR
static ERR_STRING_DATA ENGINE_str_functs[]=
{
{ERR_PACK(0,ENGINE_F_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"},
{ERR_PACK(0,ENGINE_F_ATALLA_RSA_MOD_EXP,0), "ATALLA_RSA_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_CSWIFT_DSA_SIGN,0), "CSWIFT_DSA_SIGN"},
{ERR_PACK(0,ENGINE_F_CSWIFT_DSA_VERIFY,0), "CSWIFT_DSA_VERIFY"},
{ERR_PACK(0,ENGINE_F_CSWIFT_FINISH,0), "CSWIFT_FINISH"},
{ERR_PACK(0,ENGINE_F_CSWIFT_INIT,0), "CSWIFT_INIT"},
{ERR_PACK(0,ENGINE_F_CSWIFT_MOD_EXP,0), "CSWIFT_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_CSWIFT_MOD_EXP_CRT,0), "CSWIFT_MOD_EXP_CRT"},
{ERR_PACK(0,ENGINE_F_CSWIFT_RSA_MOD_EXP,0), "CSWIFT_RSA_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_ENGINE_ADD,0), "ENGINE_add"},
{ERR_PACK(0,ENGINE_F_ENGINE_BY_ID,0), "ENGINE_by_id"},
{ERR_PACK(0,ENGINE_F_ENGINE_CTRL,0), "ENGINE_ctrl"},
{ERR_PACK(0,ENGINE_F_ENGINE_FINISH,0), "ENGINE_finish"},
{ERR_PACK(0,ENGINE_F_ENGINE_FREE,0), "ENGINE_free"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_BN_MOD_EXP,0), "ENGINE_get_BN_mod_exp"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT,0), "ENGINE_get_BN_mod_exp_crt"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_CTRL_FUNCTION,0), "ENGINE_get_ctrl_function"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_DH,0), "ENGINE_get_DH"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_DSA,0), "ENGINE_get_DSA"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_FINISH_FUNCTION,0), "ENGINE_get_finish_function"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_ID,0), "ENGINE_get_id"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_INIT_FUNCTION,0), "ENGINE_get_init_function"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_NAME,0), "ENGINE_get_name"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_NEXT,0), "ENGINE_get_next"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_PREV,0), "ENGINE_get_prev"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_RAND,0), "ENGINE_get_RAND"},
{ERR_PACK(0,ENGINE_F_ENGINE_GET_RSA,0), "ENGINE_get_RSA"},
{ERR_PACK(0,ENGINE_F_ENGINE_INIT,0), "ENGINE_init"},
{ERR_PACK(0,ENGINE_F_ENGINE_LIST_ADD,0), "ENGINE_LIST_ADD"},
{ERR_PACK(0,ENGINE_F_ENGINE_LIST_REMOVE,0), "ENGINE_LIST_REMOVE"},
{ERR_PACK(0,ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,0), "ENGINE_load_private_key"},
{ERR_PACK(0,ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,0), "ENGINE_load_public_key"},
{ERR_PACK(0,ENGINE_F_ENGINE_NEW,0), "ENGINE_new"},
{ERR_PACK(0,ENGINE_F_ENGINE_REMOVE,0), "ENGINE_remove"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_BN_MOD_EXP,0), "ENGINE_set_BN_mod_exp"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT,0), "ENGINE_set_BN_mod_exp_crt"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_CTRL_FUNCTION,0), "ENGINE_set_ctrl_function"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DEFAULT_TYPE,0), "ENGINE_SET_DEFAULT_TYPE"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DH,0), "ENGINE_set_DH"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_DSA,0), "ENGINE_set_DSA"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_FINISH_FUNCTION,0), "ENGINE_set_finish_function"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_ID,0), "ENGINE_set_id"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_INIT_FUNCTION,0), "ENGINE_set_init_function"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_NAME,0), "ENGINE_set_name"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_RAND,0), "ENGINE_set_RAND"},
{ERR_PACK(0,ENGINE_F_ENGINE_SET_RSA,0), "ENGINE_set_RSA"},
{ERR_PACK(0,ENGINE_F_ENGINE_UNLOAD_KEY,0), "ENGINE_UNLOAD_KEY"},
{ERR_PACK(0,ENGINE_F_HWCRHK_CTRL,0), "HWCRHK_CTRL"},
{ERR_PACK(0,ENGINE_F_HWCRHK_FINISH,0), "HWCRHK_FINISH"},
{ERR_PACK(0,ENGINE_F_HWCRHK_GET_PASS,0), "HWCRHK_GET_PASS"},
{ERR_PACK(0,ENGINE_F_HWCRHK_INIT,0), "HWCRHK_INIT"},
{ERR_PACK(0,ENGINE_F_HWCRHK_LOAD_PRIVKEY,0), "HWCRHK_LOAD_PRIVKEY"},
{ERR_PACK(0,ENGINE_F_HWCRHK_LOAD_PUBKEY,0), "HWCRHK_LOAD_PUBKEY"},
{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP,0), "HWCRHK_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP_CRT,0), "HWCRHK_MOD_EXP_CRT"},
{ERR_PACK(0,ENGINE_F_HWCRHK_RAND_BYTES,0), "HWCRHK_RAND_BYTES"},
{ERR_PACK(0,ENGINE_F_HWCRHK_RSA_MOD_EXP,0), "HWCRHK_RSA_MOD_EXP"},
{ERR_PACK(0,ENGINE_F_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"},
{ENGINE_R_BN_EXPAND_FAIL ,"bn_expand fail"},
{ENGINE_R_CHIL_ERROR ,"chil error"},
{ENGINE_R_CLOSE_HANDLES_FAILED ,"close handles failed"},
{ENGINE_R_CONFLICTING_ENGINE_ID ,"conflicting engine id"},
{ENGINE_R_CONNECTIONS_IN_USE ,"connections in use"},
{ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"},
{ENGINE_R_DSO_FAILURE ,"DSO failure"},
{ENGINE_R_ENGINE_IS_NOT_IN_LIST ,"engine is not in the list"},
{ENGINE_R_FAILED_LOADING_PRIVATE_KEY ,"failed loading private key"},
{ENGINE_R_FAILED_LOADING_PUBLIC_KEY ,"failed loading public key"},
{ENGINE_R_FINALIZE_FAILED ,"finalize failed"},
{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_LOCKING_MISSING ,"locking missing"},
{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_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}
};
#endif
void ERR_load_ENGINE_strings(void)
{
static int init=1;
if (init)
{
init=0;
#ifndef NO_ERR
ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_functs);
ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_reasons);
#endif
}
}

View File

@@ -1,179 +0,0 @@
/* crypto/engine/engine_int.h */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_ENGINE_INT_H
#define HEADER_ENGINE_INT_H
#include <openssl/rsa.h>
#include <openssl/dsa.h>
#include <openssl/dh.h>
#include <openssl/rand.h>
#include <openssl/bn.h>
#include <openssl/evp.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Bitwise OR-able values for the "flags" variable in ENGINE. */
#define ENGINE_FLAGS_MALLOCED 0x0001
#ifndef HEADER_ENGINE_H
/* Regrettably, we need to reproduce the "BN" function types here
* because there is no such "BIGNUM_METHOD" as there is with RSA,
* DSA, etc. We do this so that we don't have a case where engine.h
* and engine_int.h conflict with each other. */
typedef int (*BN_MOD_EXP)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
/* private key operation for RSA, provided seperately in case other
* RSA implementations wish to use it. */
typedef int (*BN_MOD_EXP_CRT)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
const BIGNUM *iqmp, BN_CTX *ctx);
/* Generic function pointer */
typedef int (*ENGINE_GEN_FUNC_PTR)();
/* Generic function pointer taking no arguments */
typedef int (*ENGINE_GEN_INT_FUNC_PTR)(void);
/* Specific control function pointer */
typedef int (*ENGINE_CTRL_FUNC_PTR)(int cmd, long i, void *p, void (*f)());
#endif
/* This is a structure for storing implementations of various crypto
* algorithms and functions. */
typedef struct engine_st
{
const char *id;
const char *name;
RSA_METHOD *rsa_meth;
DSA_METHOD *dsa_meth;
DH_METHOD *dh_meth;
RAND_METHOD *rand_meth;
BN_MOD_EXP bn_mod_exp;
BN_MOD_EXP_CRT bn_mod_exp_crt;
int (*init)(void);
int (*finish)(void);
int (*ctrl)(int cmd, long i, void *p, void (*f)());
EVP_PKEY *(*load_privkey)(const char *key_id, const char *passphrase);
EVP_PKEY *(*load_pubkey)(const char *key_id, const char *passphrase);
int flags;
/* reference count on the structure itself */
int struct_ref;
/* reference count on usability of the engine type. NB: This
* controls the loading and initialisation of any functionlity
* required by this engine, whereas the previous count is
* simply to cope with (de)allocation of this structure. Hence,
* running_ref <= struct_ref at all times. */
int funct_ref;
/* Used to maintain the linked-list of engines. */
struct engine_st *prev;
struct engine_st *next;
} ENGINE;
/* BUILT-IN ENGINES. (these functions are only ever called once and
* do not return references - they are purely for bootstrapping). */
/* Returns a structure of software only methods (the default). */
ENGINE *ENGINE_openssl();
#ifndef NO_HW
#ifndef NO_HW_CSWIFT
/* Returns a structure of cswift methods ... NB: This can exist and be
* "used" even on non-cswift systems because the "init" will fail if the
* card/library are not found. */
ENGINE *ENGINE_cswift();
#endif /* !NO_HW_CSWIFT */
#ifndef NO_HW_NCIPHER
ENGINE *ENGINE_ncipher();
#endif /* !NO_HW_NCIPHER */
#ifndef NO_HW_ATALLA
/* Returns a structure of atalla methods. */
ENGINE *ENGINE_atalla();
#endif /* !NO_HW_ATALLA */
#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
}
#endif
#endif /* HEADER_ENGINE_INT_H */

View File

@@ -1,489 +0,0 @@
/* crypto/engine/engine_lib.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <openssl/crypto.h>
#include "cryptlib.h"
#include "engine_int.h"
#include <openssl/engine.h>
/* These pointers each have their own "functional reference" when they
* are non-NULL. Similarly, when they are retrieved by a call to
* ENGINE_get_default_[RSA|DSA|...] the returned pointer is also a
* reference and the caller is responsible for freeing that when they
* are finished with it (with a call to ENGINE_finish() *NOT* just
* ENGINE_free()!!!!!!). */
static ENGINE *engine_def_rsa = NULL;
static ENGINE *engine_def_dsa = NULL;
static ENGINE *engine_def_dh = NULL;
static ENGINE *engine_def_rand = NULL;
static ENGINE *engine_def_bn_mod_exp = NULL;
static ENGINE *engine_def_bn_mod_exp_crt = NULL;
/* A static "once-only" flag used to control if/when the above were
* initialised to suitable start-up defaults. */
static int engine_def_flag = 0;
/* This is used in certain static utility functions to save code
* repetition for per-algorithm functions. */
typedef enum {
ENGINE_TYPE_RSA,
ENGINE_TYPE_DSA,
ENGINE_TYPE_DH,
ENGINE_TYPE_RAND,
ENGINE_TYPE_BN_MOD_EXP,
ENGINE_TYPE_BN_MOD_EXP_CRT
} ENGINE_TYPE;
static void engine_def_check_util(ENGINE **def, ENGINE *val)
{
*def = val;
val->struct_ref++;
val->funct_ref++;
}
/* In a slight break with convention - this static function must be
* called *outside* any locking of CRYPTO_LOCK_ENGINE. */
static void engine_def_check(void)
{
ENGINE *e;
if(engine_def_flag)
return;
e = ENGINE_get_first();
if(e == NULL)
/* The list is empty ... not much we can do! */
return;
/* We have a structural reference, see if getting a functional
* reference is possible. This is done to cope with init errors
* in the engine - the following locked code does a bunch of
* manual "ENGINE_init"s which do *not* allow such an init
* error so this is worth doing. */
if(ENGINE_init(e))
{
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
/* Doing another check here prevents an obvious race
* condition because the whole function itself cannot
* be locked. */
if(engine_def_flag)
goto skip_set_defaults;
/* OK, we got a functional reference, so we get one each
* for the defaults too. */
engine_def_check_util(&engine_def_rsa, e);
engine_def_check_util(&engine_def_dsa, e);
engine_def_check_util(&engine_def_dh, e);
engine_def_check_util(&engine_def_rand, e);
engine_def_check_util(&engine_def_bn_mod_exp, e);
engine_def_check_util(&engine_def_bn_mod_exp_crt, e);
engine_def_flag = 1;
skip_set_defaults:
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
/* The "if" needs to be balanced out. */
ENGINE_finish(e);
}
/* We need to balance out the fact we obtained a structural
* reference to begin with from ENGINE_get_first(). */
ENGINE_free(e);
}
/* Initialise a engine type for use (or up its functional reference count
* if it's already in use). */
int ENGINE_init(ENGINE *e)
{
int to_return = 1;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_INIT,ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if((e->funct_ref == 0) && e->init)
/* This is the first functional reference and the engine
* requires initialisation so we do it now. */
to_return = e->init();
if(to_return)
{
/* OK, we return a functional reference which is also a
* structural reference. */
e->struct_ref++;
e->funct_ref++;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return to_return;
}
/* Free a functional reference to a engine type */
int ENGINE_finish(ENGINE *e)
{
int to_return = 1;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_FINISH,ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if((e->funct_ref == 1) && e->finish)
#if 0
/* This is the last functional reference and the engine
* requires cleanup so we do it now. */
to_return = e->finish();
if(to_return)
{
/* Cleanup the functional reference which is also a
* structural reference. */
e->struct_ref--;
e->funct_ref--;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
#else
/* I'm going to deliberately do a convoluted version of this
* piece of code because we don't want "finish" functions
* being called inside a locked block of code, if at all
* possible. I'd rather have this call take an extra couple
* of ticks than have throughput serialised on a externally-
* provided callback function that may conceivably never come
* back. :-( */
{
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
/* CODE ALERT: This *IS* supposed to be "=" and NOT "==" :-) */
if((to_return = e->finish()))
{
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
/* Cleanup the functional reference which is also a
* structural reference. */
e->struct_ref--;
e->funct_ref--;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
}
}
else
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
#endif
return to_return;
}
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
const char *passphrase)
{
EVP_PKEY *pkey;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(e->funct_ref == 0)
{
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
ENGINE_R_NOT_INITIALISED);
return 0;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
if (!e->load_privkey)
{
ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
ENGINE_R_NO_LOAD_FUNCTION);
return 0;
}
pkey = e->load_privkey(key_id, passphrase);
if (!pkey)
{
ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
return 0;
}
return pkey;
}
EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
const char *passphrase)
{
EVP_PKEY *pkey;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(e->funct_ref == 0)
{
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
ENGINE_R_NOT_INITIALISED);
return 0;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
if (!e->load_pubkey)
{
ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
ENGINE_R_NO_LOAD_FUNCTION);
return 0;
}
pkey = e->load_pubkey(key_id, passphrase);
if (!pkey)
{
ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
return 0;
}
return pkey;
}
int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_CTRL,ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(e->struct_ref == 0)
{
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
ENGINEerr(ENGINE_F_ENGINE_CTRL,ENGINE_R_NO_REFERENCE);
return 0;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
if (!e->ctrl)
{
ENGINEerr(ENGINE_F_ENGINE_CTRL,ENGINE_R_NO_CONTROL_FUNCTION);
return 0;
}
return e->ctrl(cmd, i, p, f);
}
static ENGINE *engine_get_default_type(ENGINE_TYPE t)
{
ENGINE *ret = NULL;
/* engine_def_check is lean and mean and won't replace any
* prior default engines ... so we must ensure that it is always
* the first function to get to touch the default values. */
engine_def_check();
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
switch(t)
{
case ENGINE_TYPE_RSA:
ret = engine_def_rsa; break;
case ENGINE_TYPE_DSA:
ret = engine_def_dsa; break;
case ENGINE_TYPE_DH:
ret = engine_def_dh; break;
case ENGINE_TYPE_RAND:
ret = engine_def_rand; break;
case ENGINE_TYPE_BN_MOD_EXP:
ret = engine_def_bn_mod_exp; break;
case ENGINE_TYPE_BN_MOD_EXP_CRT:
ret = engine_def_bn_mod_exp_crt; break;
}
/* Unforunately we can't do this work outside the lock with a
* call to ENGINE_init() because that would leave a race
* condition open. */
if(ret)
{
ret->struct_ref++;
ret->funct_ref++;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return ret;
}
ENGINE *ENGINE_get_default_RSA(void)
{
return engine_get_default_type(ENGINE_TYPE_RSA);
}
ENGINE *ENGINE_get_default_DSA(void)
{
return engine_get_default_type(ENGINE_TYPE_DSA);
}
ENGINE *ENGINE_get_default_DH(void)
{
return engine_get_default_type(ENGINE_TYPE_DH);
}
ENGINE *ENGINE_get_default_RAND(void)
{
return engine_get_default_type(ENGINE_TYPE_RAND);
}
ENGINE *ENGINE_get_default_BN_mod_exp(void)
{
return engine_get_default_type(ENGINE_TYPE_BN_MOD_EXP);
}
ENGINE *ENGINE_get_default_BN_mod_exp_crt(void)
{
return engine_get_default_type(ENGINE_TYPE_BN_MOD_EXP_CRT);
}
static int engine_set_default_type(ENGINE_TYPE t, ENGINE *e)
{
ENGINE *old = NULL;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_TYPE,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
/* engine_def_check is lean and mean and won't replace any
* prior default engines ... so we must ensure that it is always
* the first function to get to touch the default values. */
engine_def_check();
/* Attempt to get a functional reference (we need one anyway, but
* also, 'e' may be just a structural reference being passed in so
* this call may actually be the first). */
if(!ENGINE_init(e))
{
ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_TYPE,
ENGINE_R_INIT_FAILED);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
switch(t)
{
case ENGINE_TYPE_RSA:
old = engine_def_rsa;
engine_def_rsa = e; break;
case ENGINE_TYPE_DSA:
old = engine_def_dsa;
engine_def_dsa = e; break;
case ENGINE_TYPE_DH:
old = engine_def_dh;
engine_def_dh = e; break;
case ENGINE_TYPE_RAND:
old = engine_def_rand;
engine_def_rand = e; break;
case ENGINE_TYPE_BN_MOD_EXP:
old = engine_def_bn_mod_exp;
engine_def_bn_mod_exp = e; break;
case ENGINE_TYPE_BN_MOD_EXP_CRT:
old = engine_def_bn_mod_exp_crt;
engine_def_bn_mod_exp_crt = e; break;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
/* If we've replaced a previous value, then we need to remove the
* functional reference we had. */
if(old && !ENGINE_finish(old))
{
ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_TYPE,
ENGINE_R_FINISH_FAILED);
return 0;
}
return 1;
}
int ENGINE_set_default_RSA(ENGINE *e)
{
return engine_set_default_type(ENGINE_TYPE_RSA, e);
}
int ENGINE_set_default_DSA(ENGINE *e)
{
return engine_set_default_type(ENGINE_TYPE_DSA, e);
}
int ENGINE_set_default_DH(ENGINE *e)
{
return engine_set_default_type(ENGINE_TYPE_DH, e);
}
int ENGINE_set_default_RAND(ENGINE *e)
{
return engine_set_default_type(ENGINE_TYPE_RAND, e);
}
int ENGINE_set_default_BN_mod_exp(ENGINE *e)
{
return engine_set_default_type(ENGINE_TYPE_BN_MOD_EXP, e);
}
int ENGINE_set_default_BN_mod_exp_crt(ENGINE *e)
{
return engine_set_default_type(ENGINE_TYPE_BN_MOD_EXP_CRT, e);
}
int ENGINE_set_default(ENGINE *e, unsigned int flags)
{
if((flags & ENGINE_METHOD_RSA) && e->rsa_meth &&
!ENGINE_set_default_RSA(e))
return 0;
if((flags & ENGINE_METHOD_DSA) && e->dsa_meth &&
!ENGINE_set_default_DSA(e))
return 0;
if((flags & ENGINE_METHOD_DH) && e->dh_meth &&
!ENGINE_set_default_DH(e))
return 0;
if((flags & ENGINE_METHOD_RAND) && e->rand_meth &&
!ENGINE_set_default_RAND(e))
return 0;
if((flags & ENGINE_METHOD_BN_MOD_EXP) && e->bn_mod_exp &&
!ENGINE_set_default_BN_mod_exp(e))
return 0;
if((flags & ENGINE_METHOD_BN_MOD_EXP_CRT) && e->bn_mod_exp_crt &&
!ENGINE_set_default_BN_mod_exp_crt(e))
return 0;
return 1;
}

View File

@@ -1,691 +0,0 @@
/* crypto/engine/engine_list.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <openssl/crypto.h>
#include "cryptlib.h"
#include "engine_int.h"
#include <openssl/engine.h>
/* The linked-list of pointers to engine types. engine_list_head
* incorporates an implicit structural reference but engine_list_tail
* does not - the latter is a computational niceity and only points
* to something that is already pointed to by its predecessor in the
* list (or engine_list_head itself). In the same way, the use of the
* "prev" pointer in each ENGINE is to save excessive list iteration,
* it doesn't correspond to an extra structural reference. Hence,
* engine_list_head, and each non-null "next" pointer account for
* the list itself assuming exactly 1 structural reference on each
* list member. */
static ENGINE *engine_list_head = NULL;
static ENGINE *engine_list_tail = NULL;
/* A boolean switch, used to ensure we only initialise once. This
* is needed because the engine list may genuinely become empty during
* use (so we can't use engine_list_head as an indicator for example. */
static int engine_list_flag = 0;
/* These static functions starting with a lower case "engine_" always
* take place when CRYPTO_LOCK_ENGINE has been locked up. */
static int engine_list_add(ENGINE *e)
{
int conflict = 0;
ENGINE *iterator = NULL;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
iterator = engine_list_head;
while(iterator && !conflict)
{
conflict = (strcmp(iterator->id, e->id) == 0);
iterator = iterator->next;
}
if(conflict)
{
ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
ENGINE_R_CONFLICTING_ENGINE_ID);
return 0;
}
if(engine_list_head == NULL)
{
/* We are adding to an empty list. */
if(engine_list_tail)
{
ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
ENGINE_R_INTERNAL_LIST_ERROR);
return 0;
}
engine_list_head = e;
e->prev = NULL;
}
else
{
/* We are adding to the tail of an existing list. */
if((engine_list_tail == NULL) ||
(engine_list_tail->next != NULL))
{
ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
ENGINE_R_INTERNAL_LIST_ERROR);
return 0;
}
engine_list_tail->next = e;
e->prev = engine_list_tail;
}
/* Having the engine in the list assumes a structural
* reference. */
e->struct_ref++;
/* However it came to be, e is the last item in the list. */
engine_list_tail = e;
e->next = NULL;
return 1;
}
static int engine_list_remove(ENGINE *e)
{
ENGINE *iterator;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_LIST_REMOVE,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
/* We need to check that e is in our linked list! */
iterator = engine_list_head;
while(iterator && (iterator != e))
iterator = iterator->next;
if(iterator == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_LIST_REMOVE,
ENGINE_R_ENGINE_IS_NOT_IN_LIST);
return 0;
}
/* un-link e from the chain. */
if(e->next)
e->next->prev = e->prev;
if(e->prev)
e->prev->next = e->next;
/* Correct our head/tail if necessary. */
if(engine_list_head == e)
engine_list_head = e->next;
if(engine_list_tail == e)
engine_list_tail = e->prev;
/* remove our structural reference. */
e->struct_ref--;
return 1;
}
/* This check always takes place with CRYPTO_LOCK_ENGINE locked up
* so we're synchronised, but we can't call anything that tries to
* lock it again! :-) NB: For convenience (and code-clarity) we
* don't output errors for failures of the engine_list_add function
* as it will generate errors itself. */
static int engine_internal_check(void)
{
if(engine_list_flag)
return 1;
/* This is our first time up, we need to populate the list
* with our statically compiled-in engines. */
if(!engine_list_add(ENGINE_openssl()))
return 0;
#ifndef NO_HW
#ifndef NO_HW_CSWIFT
if(!engine_list_add(ENGINE_cswift()))
return 0;
#endif /* !NO_HW_CSWIFT */
#ifndef NO_HW_NCIPHER
if(!engine_list_add(ENGINE_ncipher()))
return 0;
#endif /* !NO_HW_NCIPHER */
#ifndef NO_HW_ATALLA
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;
}
/* Get the first/last "ENGINE" type available. */
ENGINE *ENGINE_get_first(void)
{
ENGINE *ret = NULL;
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(engine_internal_check())
{
ret = engine_list_head;
if(ret)
ret->struct_ref++;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return ret;
}
ENGINE *ENGINE_get_last(void)
{
ENGINE *ret = NULL;
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(engine_internal_check())
{
ret = engine_list_tail;
if(ret)
ret->struct_ref++;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return ret;
}
/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
ENGINE *ENGINE_get_next(ENGINE *e)
{
ENGINE *ret = NULL;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_NEXT,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
ret = e->next;
e->struct_ref--;
if(ret)
ret->struct_ref++;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return ret;
}
ENGINE *ENGINE_get_prev(ENGINE *e)
{
ENGINE *ret = NULL;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_PREV,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
ret = e->prev;
e->struct_ref--;
if(ret)
ret->struct_ref++;
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return ret;
}
/* Add another "ENGINE" type into the list. */
int ENGINE_add(ENGINE *e)
{
int to_return = 1;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_ADD,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
if((e->id == NULL) || (e->name == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_ADD,
ENGINE_R_ID_OR_NAME_MISSING);
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(!engine_internal_check() || !engine_list_add(e))
{
ENGINEerr(ENGINE_F_ENGINE_ADD,
ENGINE_R_INTERNAL_LIST_ERROR);
to_return = 0;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return to_return;
}
/* Remove an existing "ENGINE" type from the array. */
int ENGINE_remove(ENGINE *e)
{
int to_return = 1;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_REMOVE,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(!engine_internal_check() || !engine_list_remove(e))
{
ENGINEerr(ENGINE_F_ENGINE_REMOVE,
ENGINE_R_INTERNAL_LIST_ERROR);
to_return = 0;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
return to_return;
}
ENGINE *ENGINE_by_id(const char *id)
{
ENGINE *iterator = NULL;
if(id == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_BY_ID,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(!engine_internal_check())
ENGINEerr(ENGINE_F_ENGINE_BY_ID,
ENGINE_R_INTERNAL_LIST_ERROR);
else
{
iterator = engine_list_head;
while(iterator && (strcmp(id, iterator->id) != 0))
iterator = iterator->next;
if(iterator)
/* We need to return a structural reference */
iterator->struct_ref++;
}
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
if(iterator == NULL)
ENGINEerr(ENGINE_F_ENGINE_BY_ID,
ENGINE_R_NO_SUCH_ENGINE);
return iterator;
}
/* As per the comments in engine.h, it is generally better all round
* if the ENGINE structure is allocated within this framework. */
#if 0
int ENGINE_get_struct_size(void)
{
return sizeof(ENGINE);
}
ENGINE *ENGINE_new(ENGINE *e)
{
ENGINE *ret;
if(e == NULL)
{
ret = (ENGINE *)(OPENSSL_malloc(sizeof(ENGINE));
if(ret == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_NEW,
ERR_R_MALLOC_FAILURE);
return NULL;
}
}
else
ret = e;
memset(ret, 0, sizeof(ENGINE));
if(e)
ret->flags = ENGINE_FLAGS_MALLOCED;
ret->struct_ref = 1;
return ret;
}
#else
ENGINE *ENGINE_new(void)
{
ENGINE *ret;
ret = (ENGINE *)OPENSSL_malloc(sizeof(ENGINE));
if(ret == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
}
memset(ret, 0, sizeof(ENGINE));
ret->flags = ENGINE_FLAGS_MALLOCED;
ret->struct_ref = 1;
return ret;
}
#endif
int ENGINE_free(ENGINE *e)
{
int i;
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_FREE,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
i = CRYPTO_add(&e->struct_ref,-1,CRYPTO_LOCK_ENGINE);
#ifdef REF_PRINT
REF_PRINT2("ENGINE",e,struct_ref);
#endif
if (i > 0) return 1;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"ENGINE_free, bad reference count\n");
abort();
}
#endif
if(e->flags & ENGINE_FLAGS_MALLOCED)
OPENSSL_free(e);
return 1;
}
int ENGINE_set_id(ENGINE *e, const char *id)
{
if((e == NULL) || (id == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_ID,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->id = id;
return 1;
}
int ENGINE_set_name(ENGINE *e, const char *name)
{
if((e == NULL) || (name == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_NAME,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->name = name;
return 1;
}
int ENGINE_set_RSA(ENGINE *e, RSA_METHOD *rsa_meth)
{
if((e == NULL) || (rsa_meth == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_RSA,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->rsa_meth = rsa_meth;
return 1;
}
int ENGINE_set_DSA(ENGINE *e, DSA_METHOD *dsa_meth)
{
if((e == NULL) || (dsa_meth == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_DSA,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->dsa_meth = dsa_meth;
return 1;
}
int ENGINE_set_DH(ENGINE *e, DH_METHOD *dh_meth)
{
if((e == NULL) || (dh_meth == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_DH,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->dh_meth = dh_meth;
return 1;
}
int ENGINE_set_RAND(ENGINE *e, RAND_METHOD *rand_meth)
{
if((e == NULL) || (rand_meth == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_RAND,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->rand_meth = rand_meth;
return 1;
}
int ENGINE_set_BN_mod_exp(ENGINE *e, BN_MOD_EXP bn_mod_exp)
{
if((e == NULL) || (bn_mod_exp == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_BN_MOD_EXP,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->bn_mod_exp = bn_mod_exp;
return 1;
}
int ENGINE_set_BN_mod_exp_crt(ENGINE *e, BN_MOD_EXP_CRT bn_mod_exp_crt)
{
if((e == NULL) || (bn_mod_exp_crt == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->bn_mod_exp_crt = bn_mod_exp_crt;
return 1;
}
int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f)
{
if((e == NULL) || (init_f == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_INIT_FUNCTION,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->init = init_f;
return 1;
}
int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f)
{
if((e == NULL) || (finish_f == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_FINISH_FUNCTION,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->finish = finish_f;
return 1;
}
int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f)
{
if((e == NULL) || (ctrl_f == NULL))
{
ENGINEerr(ENGINE_F_ENGINE_SET_CTRL_FUNCTION,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
e->ctrl = ctrl_f;
return 1;
}
const char *ENGINE_get_id(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_ID,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
return e->id;
}
const char *ENGINE_get_name(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_NAME,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
return e->name;
}
RSA_METHOD *ENGINE_get_RSA(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_RSA,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->rsa_meth;
}
DSA_METHOD *ENGINE_get_DSA(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_DSA,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->dsa_meth;
}
DH_METHOD *ENGINE_get_DH(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_DH,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->dh_meth;
}
RAND_METHOD *ENGINE_get_RAND(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_RAND,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->rand_meth;
}
BN_MOD_EXP ENGINE_get_BN_mod_exp(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_BN_MOD_EXP,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->bn_mod_exp;
}
BN_MOD_EXP_CRT ENGINE_get_BN_mod_exp_crt(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->bn_mod_exp_crt;
}
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_INIT_FUNCTION,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->init;
}
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_FINISH_FUNCTION,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->finish;
}
ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(ENGINE *e)
{
if(e == NULL)
{
ENGINEerr(ENGINE_F_ENGINE_GET_CTRL_FUNCTION,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return e->ctrl;
}

View File

@@ -1,174 +0,0 @@
/* crypto/engine/engine_openssl.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include <openssl/crypto.h>
#include "cryptlib.h"
#include "engine_int.h"
#include <openssl/engine.h>
#include <openssl/dso.h>
#include <openssl/rsa.h>
#include <openssl/dsa.h>
#include <openssl/dh.h>
#include <openssl/rand.h>
#include <openssl/bn.h>
/* This is the only function we need to implement as OpenSSL
* doesn't have a native CRT mod_exp. Perhaps this should be
* BN_mod_exp_crt and moved into crypto/bn/ ?? ... dunno. */
static int openssl_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);
/* The ENGINE structure that can be pointed to. */
static ENGINE engine_openssl =
{
"openssl",
"Software default engine support",
NULL,
NULL,
NULL, /* these methods are "stolen" in ENGINE_openssl() */
NULL,
NULL,
openssl_mod_exp_crt,
NULL, /* no init() */
NULL, /* no finish() */
NULL, /* no ctrl() */
NULL, /* no load_privkey() */
NULL, /* no load_pubkey() */
0, /* no flags */
0, 0, /* no references. */
NULL, NULL /* unlinked */
};
/* 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_openssl()
{
/* We need to populate our structure with the software pointers
* that we want to steal. */
engine_openssl.rsa_meth = RSA_get_default_openssl_method();
engine_openssl.dsa_meth = DSA_get_default_openssl_method();
engine_openssl.dh_meth = DH_get_default_openssl_method();
engine_openssl.rand_meth = RAND_SSLeay();
engine_openssl.bn_mod_exp = BN_mod_exp;
return &engine_openssl;
}
/* Chinese Remainder Theorem, taken and adapted from rsa_eay.c */
static int openssl_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)
{
BIGNUM r1,m1;
int ret=0;
BN_CTX *bn_ctx;
BIGNUM *temp_bn = NULL;
if (ctx)
bn_ctx = ctx;
else
if ((bn_ctx=BN_CTX_new()) == NULL) goto err;
BN_init(&m1);
BN_init(&r1);
/* BN_mul() cannot accept const BIGNUMs so I use the BN_CTX
* to duplicate what I need. <sigh> */
if ((temp_bn = BN_CTX_get(bn_ctx)) == NULL) goto err;
if (!BN_copy(temp_bn, iqmp)) goto err;
if (!BN_mod(&r1, a, q, bn_ctx)) goto err;
if (!engine_openssl.bn_mod_exp(&m1, &r1, dmq1, q, bn_ctx))
goto err;
if (!BN_mod(&r1, a, p, bn_ctx)) goto err;
if (!engine_openssl.bn_mod_exp(r, &r1, dmp1, p, bn_ctx))
goto err;
if (!BN_sub(r, r, &m1)) goto err;
/* This will help stop the size of r0 increasing, which does
* affect the multiply if it optimised for a power of 2 size */
if (r->neg)
if (!BN_add(r, r, p)) goto err;
if (!BN_mul(&r1, r, temp_bn, bn_ctx)) goto err;
if (!BN_mod(r, &r1, p, bn_ctx)) goto err;
/* If p < q it is occasionally possible for the correction of
* adding 'p' if r is negative above to leave the result still
* negative. This can break the private key operations: the following
* second correction should *always* correct this rare occurrence.
* This will *never* happen with OpenSSL generated keys because
* they ensure p > q [steve]
*/
if (r->neg)
if (!BN_add(r, r, p)) goto err;
/* Again, BN_mul() will need non-const values. */
if (!BN_copy(temp_bn, q)) goto err;
if (!BN_mul(&r1, r, temp_bn, bn_ctx)) goto err;
if (!BN_add(r, &r1, &m1)) goto err;
ret=1;
err:
BN_clear_free(&m1);
BN_clear_free(&r1);
if (temp_bn)
bn_ctx->tos--;
if (!ctx)
BN_CTX_free(bn_ctx);
return(ret);
}

View File

@@ -1,252 +0,0 @@
/* crypto/engine/enginetest.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include <string.h>
#include <openssl/buffer.h>
#include <openssl/engine.h>
#include <openssl/err.h>
static void display_engine_list()
{
ENGINE *h;
int loop;
h = ENGINE_get_first();
loop = 0;
printf("listing available engine types\n");
while(h)
{
printf("engine %i, id = \"%s\", name = \"%s\"\n",
loop++, ENGINE_get_id(h), ENGINE_get_name(h));
h = ENGINE_get_next(h);
}
printf("end of list\n");
}
int main(int argc, char *argv[])
{
ENGINE *block[512];
char buf[256];
const char *id, *name;
ENGINE *ptr;
int loop;
int to_return = 1;
ENGINE *new_h1 = NULL;
ENGINE *new_h2 = NULL;
ENGINE *new_h3 = NULL;
ENGINE *new_h4 = NULL;
ERR_load_crypto_strings();
memset(block, 0, 512 * sizeof(ENGINE *));
if(((new_h1 = ENGINE_new()) == NULL) ||
!ENGINE_set_id(new_h1, "test_id0") ||
!ENGINE_set_name(new_h1, "First test item") ||
((new_h2 = ENGINE_new()) == NULL) ||
!ENGINE_set_id(new_h2, "test_id1") ||
!ENGINE_set_name(new_h2, "Second test item") ||
((new_h3 = ENGINE_new()) == NULL) ||
!ENGINE_set_id(new_h3, "test_id2") ||
!ENGINE_set_name(new_h3, "Third test item") ||
((new_h4 = ENGINE_new()) == NULL) ||
!ENGINE_set_id(new_h4, "test_id3") ||
!ENGINE_set_name(new_h4, "Fourth test item"))
{
printf("Couldn't set up test ENGINE structures\n");
goto end;
}
printf("\nenginetest beginning\n\n");
display_engine_list();
if(!ENGINE_add(new_h1))
{
printf("Add failed!\n");
goto end;
}
display_engine_list();
ptr = ENGINE_get_first();
if(!ENGINE_remove(ptr))
{
printf("Remove failed!\n");
goto end;
}
display_engine_list();
if(!ENGINE_add(new_h3) || !ENGINE_add(new_h2))
{
printf("Add failed!\n");
goto end;
}
display_engine_list();
if(!ENGINE_remove(new_h2))
{
printf("Remove failed!\n");
goto end;
}
display_engine_list();
if(!ENGINE_add(new_h4))
{
printf("Add failed!\n");
goto end;
}
display_engine_list();
if(ENGINE_add(new_h3))
{
printf("Add *should* have failed but didn't!\n");
goto end;
}
else
printf("Add that should fail did.\n");
ERR_clear_error();
if(ENGINE_remove(new_h2))
{
printf("Remove *should* have failed but didn't!\n");
goto end;
}
else
printf("Remove that should fail did.\n");
if(!ENGINE_remove(new_h1))
{
printf("Remove failed!\n");
goto end;
}
display_engine_list();
if(!ENGINE_remove(new_h3))
{
printf("Remove failed!\n");
goto end;
}
display_engine_list();
if(!ENGINE_remove(new_h4))
{
printf("Remove failed!\n");
goto end;
}
display_engine_list();
/* Depending on whether there's any hardware support compiled
* in, this remove may be destined to fail. */
ptr = ENGINE_get_first();
if(ptr)
if(!ENGINE_remove(ptr))
printf("Remove failed!i - probably no hardware "
"support present.\n");
display_engine_list();
if(!ENGINE_add(new_h1) || !ENGINE_remove(new_h1))
{
printf("Couldn't add and remove to an empty list!\n");
goto end;
}
else
printf("Successfully added and removed to an empty list!\n");
printf("About to beef up the engine-type list\n");
for(loop = 0; loop < 512; loop++)
{
sprintf(buf, "id%i", loop);
id = BUF_strdup(buf);
sprintf(buf, "Fake engine type %i", loop);
name = BUF_strdup(buf);
if(((block[loop] = ENGINE_new()) == NULL) ||
!ENGINE_set_id(block[loop], id) ||
!ENGINE_set_name(block[loop], name))
{
printf("Couldn't create block of ENGINE structures.\n"
"I'll probably also core-dump now, damn.\n");
goto end;
}
}
for(loop = 0; loop < 512; loop++)
{
if(!ENGINE_add(block[loop]))
{
printf("\nAdding stopped at %i, (%s,%s)\n",
loop, ENGINE_get_id(block[loop]),
ENGINE_get_name(block[loop]));
goto cleanup_loop;
}
else
printf("."); fflush(stdout);
}
cleanup_loop:
printf("\nAbout to empty the engine-type list\n");
while((ptr = ENGINE_get_first()) != NULL)
{
if(!ENGINE_remove(ptr))
{
printf("\nRemove failed!\n");
goto end;
}
printf("."); fflush(stdout);
}
for(loop = 0; loop < 512; loop++)
{
free((char *)(ENGINE_get_id(block[loop])));
free((char *)(ENGINE_get_name(block[loop])));
}
printf("\nTests completed happily\n");
to_return = 0;
end:
if(to_return)
ERR_print_errors_fp(stderr);
if(new_h1) ENGINE_free(new_h1);
if(new_h2) ENGINE_free(new_h2);
if(new_h3) ENGINE_free(new_h3);
if(new_h4) ENGINE_free(new_h4);
for(loop = 0; loop < 512; loop++)
if(block[loop])
ENGINE_free(block[loop]);
return to_return;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,444 +0,0 @@
/* crypto/engine/hw_atalla.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.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_ATALLA
#ifdef FLAT_INC
#include "atalla.h"
#else
#include "vendor_defns/atalla.h"
#endif
static int atalla_init(void);
static int atalla_finish(void);
/* BIGNUM stuff */
static int atalla_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
/* RSA stuff */
static int atalla_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa);
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int atalla_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 atalla_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 atalla_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 alised to mod_exp (with the DH and mont dropped). */
static int atalla_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
/* Our internal RSA_METHOD that we provide pointers to */
static RSA_METHOD atalla_rsa =
{
"Atalla RSA method",
NULL,
NULL,
NULL,
NULL,
atalla_rsa_mod_exp,
atalla_mod_exp_mont,
NULL,
NULL,
0,
NULL,
NULL,
NULL
};
/* Our internal DSA_METHOD that we provide pointers to */
static DSA_METHOD atalla_dsa =
{
"Atalla DSA method",
NULL, /* dsa_do_sign */
NULL, /* dsa_sign_setup */
NULL, /* dsa_do_verify */
atalla_dsa_mod_exp, /* dsa_mod_exp */
atalla_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 atalla_dh =
{
"Atalla DH method",
NULL,
NULL,
atalla_mod_exp_dh,
NULL,
NULL,
0,
NULL
};
/* Our ENGINE structure. */
static ENGINE engine_atalla =
{
"atalla",
"Atalla hardware engine support",
&atalla_rsa,
&atalla_dsa,
&atalla_dh,
NULL,
atalla_mod_exp,
NULL,
atalla_init,
atalla_finish,
NULL, /* no ctrl() */
NULL, /* no load_privkey() */
NULL, /* no load_pubkey() */
0, /* no flags */
0, 0, /* no references */
NULL, NULL /* unlinked */
};
/* 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_atalla()
{
RSA_METHOD *meth1;
DSA_METHOD *meth2;
DH_METHOD *meth3;
/* We know that the "PKCS1_SSLeay()" functions hook properly
* to the atalla-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();
atalla_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
atalla_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
atalla_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
atalla_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
/* Use the DSA_OpenSSL() method and just hook the mod_exp-ish
* bits. */
meth2 = DSA_OpenSSL();
atalla_dsa.dsa_do_sign = meth2->dsa_do_sign;
atalla_dsa.dsa_sign_setup = meth2->dsa_sign_setup;
atalla_dsa.dsa_do_verify = meth2->dsa_do_verify;
/* Much the same for Diffie-Hellman */
meth3 = DH_OpenSSL();
atalla_dh.generate_key = meth3->generate_key;
atalla_dh.compute_key = meth3->compute_key;
return &engine_atalla;
}
/* This is a process-global DSO handle used for loading and unloading
* the Atalla 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 *atalla_dso = NULL;
/* These are the function pointers that are (un)set when the library has
* successfully (un)loaded. */
static tfnASI_GetHardwareConfig *p_Atalla_GetHardwareConfig = NULL;
static tfnASI_RSAPrivateKeyOpFn *p_Atalla_RSAPrivateKeyOpFn = NULL;
static tfnASI_GetPerformanceStatistics *p_Atalla_GetPerformanceStatistics = NULL;
/* (de)initialisation functions. */
static int atalla_init()
{
tfnASI_GetHardwareConfig *p1;
tfnASI_RSAPrivateKeyOpFn *p2;
tfnASI_GetPerformanceStatistics *p3;
/* Not sure of the origin of this magic value, but Ben's code had it
* and it seemed to have been working for a few people. :-) */
unsigned int config_buf[1024];
if(atalla_dso != NULL)
{
ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_ALREADY_LOADED);
goto err;
}
/* Attempt to load libatasi.so/atasi.dll/whatever. Needs to be
* changed unfortunately because the Atalla drivers don't have
* standard library names that can be platform-translated well. */
/* TODO: Work out how to actually map to the names the Atalla
* drivers really use - for now a symbollic link needs to be
* created on the host system from libatasi.so to atasi.so on
* unix variants. */
atalla_dso = DSO_load(NULL, ATALLA_LIBNAME, NULL,
DSO_FLAG_NAME_TRANSLATION);
if(atalla_dso == NULL)
{
ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
if(!(p1 = (tfnASI_GetHardwareConfig *)DSO_bind_func(
atalla_dso, ATALLA_F1)) ||
!(p2 = (tfnASI_RSAPrivateKeyOpFn *)DSO_bind_func(
atalla_dso, ATALLA_F2)) ||
!(p3 = (tfnASI_GetPerformanceStatistics *)DSO_bind_func(
atalla_dso, ATALLA_F3)))
{
ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
/* Copy the pointers */
p_Atalla_GetHardwareConfig = p1;
p_Atalla_RSAPrivateKeyOpFn = p2;
p_Atalla_GetPerformanceStatistics = p3;
/* Perform a basic test to see if there's actually any unit
* running. */
if(p1(0L, config_buf) != 0)
{
ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_UNIT_FAILURE);
goto err;
}
/* Everything's fine. */
return 1;
err:
if(atalla_dso)
DSO_free(atalla_dso);
p_Atalla_GetHardwareConfig = NULL;
p_Atalla_RSAPrivateKeyOpFn = NULL;
p_Atalla_GetPerformanceStatistics = NULL;
return 0;
}
static int atalla_finish()
{
if(atalla_dso == NULL)
{
ENGINEerr(ENGINE_F_ATALLA_FINISH,ENGINE_R_NOT_LOADED);
return 0;
}
if(!DSO_free(atalla_dso))
{
ENGINEerr(ENGINE_F_ATALLA_FINISH,ENGINE_R_DSO_FAILURE);
return 0;
}
atalla_dso = NULL;
p_Atalla_GetHardwareConfig = NULL;
p_Atalla_RSAPrivateKeyOpFn = NULL;
p_Atalla_GetPerformanceStatistics = NULL;
return 1;
}
static int atalla_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx)
{
/* I need somewhere to store temporary serialised values for
* use with the Atalla API calls. A neat cheat - I'll use
* BIGNUMs from the BN_CTX but access their arrays directly as
* byte arrays <grin>. This way I don't have to clean anything
* up. */
BIGNUM *modulus;
BIGNUM *exponent;
BIGNUM *argument;
BIGNUM *result;
RSAPrivateKey keydata;
int to_return, numbytes;
modulus = exponent = argument = result = NULL;
to_return = 0; /* expect failure */
if(!atalla_dso)
{
ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_NOT_LOADED);
goto err;
}
/* Prepare the params */
modulus = BN_CTX_get(ctx);
exponent = BN_CTX_get(ctx);
argument = BN_CTX_get(ctx);
result = BN_CTX_get(ctx);
if(!modulus || !exponent || !argument || !result)
{
ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(modulus, m->top) || !bn_wexpand(exponent, m->top) ||
!bn_wexpand(argument, m->top) || !bn_wexpand(result, m->top))
{
ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_BN_EXPAND_FAIL);
goto err;
}
/* Prepare the key-data */
memset(&keydata, 0,sizeof keydata);
numbytes = BN_num_bytes(m);
memset(exponent->d, 0, numbytes);
memset(modulus->d, 0, numbytes);
BN_bn2bin(p, (unsigned char *)exponent->d + numbytes - BN_num_bytes(p));
BN_bn2bin(m, (unsigned char *)modulus->d + numbytes - BN_num_bytes(m));
keydata.privateExponent.data = (unsigned char *)exponent->d;
keydata.privateExponent.len = numbytes;
keydata.modulus.data = (unsigned char *)modulus->d;
keydata.modulus.len = numbytes;
/* Prepare the argument */
memset(argument->d, 0, numbytes);
memset(result->d, 0, numbytes);
BN_bn2bin(a, (unsigned char *)argument->d + numbytes - BN_num_bytes(a));
/* Perform the operation */
if(p_Atalla_RSAPrivateKeyOpFn(&keydata, (unsigned char *)result->d,
(unsigned char *)argument->d,
keydata.modulus.len) != 0)
{
ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_REQUEST_FAILED);
goto err;
}
/* Convert the response */
BN_bin2bn((unsigned char *)result->d, numbytes, r);
to_return = 1;
err:
if(modulus) ctx->tos--;
if(exponent) ctx->tos--;
if(argument) ctx->tos--;
if(result) ctx->tos--;
return to_return;
}
static int atalla_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
{
BN_CTX *ctx = NULL;
int to_return = 0;
if(!atalla_dso)
{
ENGINEerr(ENGINE_F_ATALLA_RSA_MOD_EXP,ENGINE_R_NOT_LOADED);
goto err;
}
if((ctx = BN_CTX_new()) == NULL)
goto err;
if(!rsa->d || !rsa->n)
{
ENGINEerr(ENGINE_F_ATALLA_RSA_MOD_EXP,ENGINE_R_MISSING_KEY_COMPONENTS);
goto err;
}
to_return = atalla_mod_exp(r0, I, rsa->d, rsa->n, ctx);
err:
if(ctx)
BN_CTX_free(ctx);
return to_return;
}
/* This code was liberated and adapted from the commented-out code in
* dsa_ossl.c. Because of the unoptimised form of the Atalla acceleration
* (it doesn't have a CRT form for RSA), this function means that an
* Atalla system running with a DSA server certificate can handshake
* around 5 or 6 times faster/more than an equivalent system running with
* RSA. Just check out the "signs" statistics from the RSA and DSA parts
* of "openssl speed -engine atalla dsa1024 rsa1024". */
static int atalla_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 (!atalla_mod_exp(rr,a1,p1,m,ctx)) goto end;
/* let t = a2 ^ p2 mod m */
if (!atalla_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 atalla_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *m_ctx)
{
return atalla_mod_exp(r, a, p, m, ctx);
}
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int atalla_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return atalla_mod_exp(r, a, p, m, ctx);
}
/* This function is aliased to mod_exp (with the dh and mont dropped). */
static int atalla_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return atalla_mod_exp(r, a, p, m, ctx);
}
#endif /* !NO_HW_ATALLA */
#endif /* !NO_HW */

View File

@@ -1,807 +0,0 @@
/* crypto/engine/hw_cswift.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.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_CSWIFT
/* Attribution notice: Rainbow have generously allowed me to reproduce
* the necessary definitions here from their API. This means the support
* can build independently of whether application builders have the
* API or hardware. This will allow developers to easily produce software
* that has latent hardware support for any users that have accelerators
* installed, without the developers themselves needing anything extra.
*
* I have only clipped the parts from the CryptoSwift header files that
* are (or seem) relevant to the CryptoSwift support code. This is
* simply to keep the file sizes reasonable.
* [Geoff]
*/
#ifdef FLAT_INC
#include "cswift.h"
#else
#include "vendor_defns/cswift.h"
#endif
static int cswift_init(void);
static int cswift_finish(void);
/* BIGNUM stuff */
static int cswift_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
static int cswift_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);
/* RSA stuff */
static int cswift_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa);
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int cswift_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
/* DSA stuff */
static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa);
static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
DSA_SIG *sig, DSA *dsa);
/* DH stuff */
/* This function is alised to mod_exp (with the DH and mont dropped). */
static int cswift_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
/* Our internal RSA_METHOD that we provide pointers to */
static RSA_METHOD cswift_rsa =
{
"CryptoSwift RSA method",
NULL,
NULL,
NULL,
NULL,
cswift_rsa_mod_exp,
cswift_mod_exp_mont,
NULL,
NULL,
0,
NULL,
NULL,
NULL
};
/* Our internal DSA_METHOD that we provide pointers to */
static DSA_METHOD cswift_dsa =
{
"CryptoSwift DSA method",
cswift_dsa_sign,
NULL, /* dsa_sign_setup */
cswift_dsa_verify,
NULL, /* dsa_mod_exp */
NULL, /* bn_mod_exp */
NULL, /* init */
NULL, /* finish */
0, /* flags */
NULL /* app_data */
};
/* Our internal DH_METHOD that we provide pointers to */
static DH_METHOD cswift_dh =
{
"CryptoSwift DH method",
NULL,
NULL,
cswift_mod_exp_dh,
NULL,
NULL,
0,
NULL
};
/* Our ENGINE structure. */
static ENGINE engine_cswift =
{
"cswift",
"CryptoSwift hardware engine support",
&cswift_rsa,
&cswift_dsa,
&cswift_dh,
NULL,
cswift_mod_exp,
cswift_mod_exp_crt,
cswift_init,
cswift_finish,
NULL, /* no ctrl() */
NULL, /* no load_privkey() */
NULL, /* no load_pubkey() */
0, /* no flags */
0, 0, /* no references */
NULL, NULL /* unlinked */
};
/* 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_cswift()
{
RSA_METHOD *meth1;
DH_METHOD *meth2;
/* 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();
cswift_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
cswift_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
cswift_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
cswift_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
/* Much the same for Diffie-Hellman */
meth2 = DH_OpenSSL();
cswift_dh.generate_key = meth2->generate_key;
cswift_dh.compute_key = meth2->compute_key;
return &engine_cswift;
}
/* This is a process-global DSO handle used for loading and unloading
* the CryptoSwift 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 *cswift_dso = NULL;
/* These are the function pointers that are (un)set when the library has
* successfully (un)loaded. */
t_swAcquireAccContext *p_CSwift_AcquireAccContext = NULL;
t_swAttachKeyParam *p_CSwift_AttachKeyParam = NULL;
t_swSimpleRequest *p_CSwift_SimpleRequest = NULL;
t_swReleaseAccContext *p_CSwift_ReleaseAccContext = NULL;
/* Used in the DSO operations. */
static const char *CSWIFT_LIBNAME = "swift";
static const char *CSWIFT_F1 = "swAcquireAccContext";
static const char *CSWIFT_F2 = "swAttachKeyParam";
static const char *CSWIFT_F3 = "swSimpleRequest";
static const char *CSWIFT_F4 = "swReleaseAccContext";
/* CryptoSwift 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. */
/* utility function to obtain a context */
static int get_context(SW_CONTEXT_HANDLE *hac)
{
SW_STATUS status;
status = p_CSwift_AcquireAccContext(hac);
if(status != SW_OK)
return 0;
return 1;
}
/* similarly to release one. */
static void release_context(SW_CONTEXT_HANDLE hac)
{
p_CSwift_ReleaseAccContext(hac);
}
/* (de)initialisation functions. */
static int cswift_init()
{
SW_CONTEXT_HANDLE hac;
t_swAcquireAccContext *p1;
t_swAttachKeyParam *p2;
t_swSimpleRequest *p3;
t_swReleaseAccContext *p4;
if(cswift_dso != NULL)
{
ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_ALREADY_LOADED);
goto err;
}
/* Attempt to load libswift.so/swift.dll/whatever. */
cswift_dso = DSO_load(NULL, CSWIFT_LIBNAME, NULL,
DSO_FLAG_NAME_TRANSLATION);
if(cswift_dso == NULL)
{
ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
if(!(p1 = (t_swAcquireAccContext *)
DSO_bind_func(cswift_dso, CSWIFT_F1)) ||
!(p2 = (t_swAttachKeyParam *)
DSO_bind_func(cswift_dso, CSWIFT_F2)) ||
!(p3 = (t_swSimpleRequest *)
DSO_bind_func(cswift_dso, CSWIFT_F3)) ||
!(p4 = (t_swReleaseAccContext *)
DSO_bind_func(cswift_dso, CSWIFT_F4)))
{
ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
goto err;
}
/* Copy the pointers */
p_CSwift_AcquireAccContext = p1;
p_CSwift_AttachKeyParam = p2;
p_CSwift_SimpleRequest = p3;
p_CSwift_ReleaseAccContext = p4;
/* Try and get a context - if not, we may have a DSO but no
* accelerator! */
if(!get_context(&hac))
{
ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_UNIT_FAILURE);
goto err;
}
release_context(hac);
/* Everything's fine. */
return 1;
err:
if(cswift_dso)
DSO_free(cswift_dso);
p_CSwift_AcquireAccContext = NULL;
p_CSwift_AttachKeyParam = NULL;
p_CSwift_SimpleRequest = NULL;
p_CSwift_ReleaseAccContext = NULL;
return 0;
}
static int cswift_finish()
{
if(cswift_dso == NULL)
{
ENGINEerr(ENGINE_F_CSWIFT_FINISH,ENGINE_R_NOT_LOADED);
return 0;
}
if(!DSO_free(cswift_dso))
{
ENGINEerr(ENGINE_F_CSWIFT_FINISH,ENGINE_R_DSO_FAILURE);
return 0;
}
cswift_dso = NULL;
p_CSwift_AcquireAccContext = NULL;
p_CSwift_AttachKeyParam = NULL;
p_CSwift_SimpleRequest = NULL;
p_CSwift_ReleaseAccContext = NULL;
return 1;
}
/* Un petit mod_exp */
static int cswift_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx)
{
/* I need somewhere to store temporary serialised values for
* use with the CryptoSwift API calls. A neat cheat - I'll use
* BIGNUMs from the BN_CTX but access their arrays directly as
* byte arrays <grin>. This way I don't have to clean anything
* up. */
BIGNUM *modulus;
BIGNUM *exponent;
BIGNUM *argument;
BIGNUM *result;
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
SW_PARAM sw_param;
SW_CONTEXT_HANDLE hac;
int to_return, acquired;
modulus = exponent = argument = result = NULL;
to_return = 0; /* expect failure */
acquired = 0;
if(!get_context(&hac))
{
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_GET_HANDLE_FAILED);
goto err;
}
acquired = 1;
/* Prepare the params */
modulus = BN_CTX_get(ctx);
exponent = BN_CTX_get(ctx);
argument = BN_CTX_get(ctx);
result = BN_CTX_get(ctx);
if(!modulus || !exponent || !argument || !result)
{
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(modulus, m->top) || !bn_wexpand(exponent, p->top) ||
!bn_wexpand(argument, a->top) || !bn_wexpand(result, m->top))
{
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_BN_EXPAND_FAIL);
goto err;
}
sw_param.type = SW_ALG_EXP;
sw_param.up.exp.modulus.nbytes = BN_bn2bin(m,
(unsigned char *)modulus->d);
sw_param.up.exp.modulus.value = (unsigned char *)modulus->d;
sw_param.up.exp.exponent.nbytes = BN_bn2bin(p,
(unsigned char *)exponent->d);
sw_param.up.exp.exponent.value = (unsigned char *)exponent->d;
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,
ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
goto err;
default:
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg.nbytes = BN_bn2bin(a, (unsigned char *)argument->d);
arg.value = (unsigned char *)argument->d;
res.nbytes = BN_num_bytes(m);
memset(result->d, 0, res.nbytes);
res.value = (unsigned char *)result->d;
/* Perform the operation */
if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP, &arg, 1,
&res, 1)) != SW_OK)
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
to_return = 1;
err:
if(acquired)
release_context(hac);
if(modulus) ctx->tos--;
if(exponent) ctx->tos--;
if(argument) ctx->tos--;
if(result) ctx->tos--;
return to_return;
}
/* Un petit mod_exp chinois */
static int cswift_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)
{
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
SW_PARAM sw_param;
SW_CONTEXT_HANDLE hac;
BIGNUM *rsa_p = NULL;
BIGNUM *rsa_q = NULL;
BIGNUM *rsa_dmp1 = NULL;
BIGNUM *rsa_dmq1 = NULL;
BIGNUM *rsa_iqmp = NULL;
BIGNUM *argument = NULL;
BIGNUM *result = NULL;
int to_return = 0; /* expect failure */
int acquired = 0;
if(!get_context(&hac))
{
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_GET_HANDLE_FAILED);
goto err;
}
acquired = 1;
/* Prepare the params */
rsa_p = BN_CTX_get(ctx);
rsa_q = BN_CTX_get(ctx);
rsa_dmp1 = BN_CTX_get(ctx);
rsa_dmq1 = BN_CTX_get(ctx);
rsa_iqmp = BN_CTX_get(ctx);
argument = BN_CTX_get(ctx);
result = BN_CTX_get(ctx);
if(!rsa_p || !rsa_q || !rsa_dmp1 || !rsa_dmq1 || !rsa_iqmp ||
!argument || !result)
{
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(rsa_p, p->top) || !bn_wexpand(rsa_q, q->top) ||
!bn_wexpand(rsa_dmp1, dmp1->top) ||
!bn_wexpand(rsa_dmq1, dmq1->top) ||
!bn_wexpand(rsa_iqmp, iqmp->top) ||
!bn_wexpand(argument, a->top) ||
!bn_wexpand(result, p->top + q->top))
{
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_BN_EXPAND_FAIL);
goto err;
}
sw_param.type = SW_ALG_CRT;
sw_param.up.crt.p.nbytes = BN_bn2bin(p, (unsigned char *)rsa_p->d);
sw_param.up.crt.p.value = (unsigned char *)rsa_p->d;
sw_param.up.crt.q.nbytes = BN_bn2bin(q, (unsigned char *)rsa_q->d);
sw_param.up.crt.q.value = (unsigned char *)rsa_q->d;
sw_param.up.crt.dmp1.nbytes = BN_bn2bin(dmp1,
(unsigned char *)rsa_dmp1->d);
sw_param.up.crt.dmp1.value = (unsigned char *)rsa_dmp1->d;
sw_param.up.crt.dmq1.nbytes = BN_bn2bin(dmq1,
(unsigned char *)rsa_dmq1->d);
sw_param.up.crt.dmq1.value = (unsigned char *)rsa_dmq1->d;
sw_param.up.crt.iqmp.nbytes = BN_bn2bin(iqmp,
(unsigned char *)rsa_iqmp->d);
sw_param.up.crt.iqmp.value = (unsigned char *)rsa_iqmp->d;
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,
ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
goto err;
default:
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg.nbytes = BN_bn2bin(a, (unsigned char *)argument->d);
arg.value = (unsigned char *)argument->d;
res.nbytes = 2 * BN_num_bytes(p);
memset(result->d, 0, res.nbytes);
res.value = (unsigned char *)result->d;
/* Perform the operation */
if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP_CRT, &arg, 1,
&res, 1)) != SW_OK)
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
to_return = 1;
err:
if(acquired)
release_context(hac);
if(rsa_p) ctx->tos--;
if(rsa_q) ctx->tos--;
if(rsa_dmp1) ctx->tos--;
if(rsa_dmq1) ctx->tos--;
if(rsa_iqmp) ctx->tos--;
if(argument) ctx->tos--;
if(result) ctx->tos--;
return to_return;
}
static int cswift_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
{
BN_CTX *ctx;
int to_return = 0;
if((ctx = BN_CTX_new()) == NULL)
goto err;
if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
{
ENGINEerr(ENGINE_F_CSWIFT_RSA_MOD_EXP,ENGINE_R_MISSING_KEY_COMPONENTS);
goto err;
}
to_return = cswift_mod_exp_crt(r0, I, rsa->p, rsa->q, rsa->dmp1,
rsa->dmq1, rsa->iqmp, ctx);
err:
if(ctx)
BN_CTX_free(ctx);
return to_return;
}
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int cswift_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return cswift_mod_exp(r, a, p, m, ctx);
}
static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
{
SW_CONTEXT_HANDLE hac;
SW_PARAM sw_param;
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
unsigned char *ptr;
BN_CTX *ctx;
BIGNUM *dsa_p = NULL;
BIGNUM *dsa_q = NULL;
BIGNUM *dsa_g = NULL;
BIGNUM *dsa_key = NULL;
BIGNUM *result = NULL;
DSA_SIG *to_return = NULL;
int acquired = 0;
if((ctx = BN_CTX_new()) == NULL)
goto err;
if(!get_context(&hac))
{
ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_GET_HANDLE_FAILED);
goto err;
}
acquired = 1;
/* Prepare the params */
dsa_p = BN_CTX_get(ctx);
dsa_q = BN_CTX_get(ctx);
dsa_g = BN_CTX_get(ctx);
dsa_key = BN_CTX_get(ctx);
result = BN_CTX_get(ctx);
if(!dsa_p || !dsa_q || !dsa_g || !dsa_key || !result)
{
ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(dsa_p, dsa->p->top) ||
!bn_wexpand(dsa_q, dsa->q->top) ||
!bn_wexpand(dsa_g, dsa->g->top) ||
!bn_wexpand(dsa_key, dsa->priv_key->top) ||
!bn_wexpand(result, dsa->p->top))
{
ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_BN_EXPAND_FAIL);
goto err;
}
sw_param.type = SW_ALG_DSA;
sw_param.up.dsa.p.nbytes = BN_bn2bin(dsa->p,
(unsigned char *)dsa_p->d);
sw_param.up.dsa.p.value = (unsigned char *)dsa_p->d;
sw_param.up.dsa.q.nbytes = BN_bn2bin(dsa->q,
(unsigned char *)dsa_q->d);
sw_param.up.dsa.q.value = (unsigned char *)dsa_q->d;
sw_param.up.dsa.g.nbytes = BN_bn2bin(dsa->g,
(unsigned char *)dsa_g->d);
sw_param.up.dsa.g.value = (unsigned char *)dsa_g->d;
sw_param.up.dsa.key.nbytes = BN_bn2bin(dsa->priv_key,
(unsigned char *)dsa_key->d);
sw_param.up.dsa.key.value = (unsigned char *)dsa_key->d;
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,
ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
goto err;
default:
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg.nbytes = dlen;
arg.value = (unsigned char *)dgst;
res.nbytes = BN_num_bytes(dsa->p);
memset(result->d, 0, res.nbytes);
res.value = (unsigned char *)result->d;
/* Perform the operation */
sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_DSS_SIGN, &arg, 1,
&res, 1);
if(sw_status != SW_OK)
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
ptr = (unsigned char *)result->d;
if((to_return = DSA_SIG_new()) == NULL)
goto err;
to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL);
to_return->s = BN_bin2bn((unsigned char *)result->d + 20, 20, NULL);
err:
if(acquired)
release_context(hac);
if(dsa_p) ctx->tos--;
if(dsa_q) ctx->tos--;
if(dsa_g) ctx->tos--;
if(dsa_key) ctx->tos--;
if(result) ctx->tos--;
if(ctx)
BN_CTX_free(ctx);
return to_return;
}
static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
DSA_SIG *sig, DSA *dsa)
{
SW_CONTEXT_HANDLE hac;
SW_PARAM sw_param;
SW_STATUS sw_status;
SW_LARGENUMBER arg[2], res;
unsigned long sig_result;
BN_CTX *ctx;
BIGNUM *dsa_p = NULL;
BIGNUM *dsa_q = NULL;
BIGNUM *dsa_g = NULL;
BIGNUM *dsa_key = NULL;
BIGNUM *argument = NULL;
int to_return = -1;
int acquired = 0;
if((ctx = BN_CTX_new()) == NULL)
goto err;
if(!get_context(&hac))
{
ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_GET_HANDLE_FAILED);
goto err;
}
acquired = 1;
/* Prepare the params */
dsa_p = BN_CTX_get(ctx);
dsa_q = BN_CTX_get(ctx);
dsa_g = BN_CTX_get(ctx);
dsa_key = BN_CTX_get(ctx);
argument = BN_CTX_get(ctx);
if(!dsa_p || !dsa_q || !dsa_g || !dsa_key || !argument)
{
ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(dsa_p, dsa->p->top) ||
!bn_wexpand(dsa_q, dsa->q->top) ||
!bn_wexpand(dsa_g, dsa->g->top) ||
!bn_wexpand(dsa_key, dsa->pub_key->top) ||
!bn_wexpand(argument, 40))
{
ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_BN_EXPAND_FAIL);
goto err;
}
sw_param.type = SW_ALG_DSA;
sw_param.up.dsa.p.nbytes = BN_bn2bin(dsa->p,
(unsigned char *)dsa_p->d);
sw_param.up.dsa.p.value = (unsigned char *)dsa_p->d;
sw_param.up.dsa.q.nbytes = BN_bn2bin(dsa->q,
(unsigned char *)dsa_q->d);
sw_param.up.dsa.q.value = (unsigned char *)dsa_q->d;
sw_param.up.dsa.g.nbytes = BN_bn2bin(dsa->g,
(unsigned char *)dsa_g->d);
sw_param.up.dsa.g.value = (unsigned char *)dsa_g->d;
sw_param.up.dsa.key.nbytes = BN_bn2bin(dsa->pub_key,
(unsigned char *)dsa_key->d);
sw_param.up.dsa.key.value = (unsigned char *)dsa_key->d;
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,
ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
goto err;
default:
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg[0].nbytes = dgst_len;
arg[0].value = (unsigned char *)dgst;
arg[1].nbytes = 40;
arg[1].value = (unsigned char *)argument->d;
memset(arg[1].value, 0, 40);
BN_bn2bin(sig->r, arg[1].value + 20 - BN_num_bytes(sig->r));
BN_bn2bin(sig->s, arg[1].value + 40 - BN_num_bytes(sig->s));
res.nbytes = 4; /* unsigned long */
res.value = (unsigned char *)(&sig_result);
/* Perform the operation */
sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_DSS_VERIFY, arg, 2,
&res, 1);
if(sw_status != SW_OK)
{
char tmpbuf[20];
ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
to_return = ((sig_result == 0) ? 0 : 1);
err:
if(acquired)
release_context(hac);
if(dsa_p) ctx->tos--;
if(dsa_q) ctx->tos--;
if(dsa_g) ctx->tos--;
if(dsa_key) ctx->tos--;
if(argument) ctx->tos--;
if(ctx)
BN_CTX_free(ctx);
return to_return;
}
/* This function is aliased to mod_exp (with the dh and mont dropped). */
static int cswift_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return cswift_mod_exp(r, a, p, m, ctx);
}
#endif /* !NO_HW_CSWIFT */
#endif /* !NO_HW */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,925 +0,0 @@
/* 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);
#if 0
static void surewarehk_dh_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
int index,long argl, void *argp);
#endif
/* 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,
(unsigned long *)rsatmp->n->d,
(unsigned long *)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,
(unsigned long *)dsatmp->pub_key->d,
(unsigned long *)dsatmp->p->d,
(unsigned long *)dsatmp->q->d,
(unsigned long *)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);
}
#if 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);
}
#endif
/*
* 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)
{
OPENSSL_cleanse(buf,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,
(unsigned long *)psign->r->d,
(unsigned long *)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),
(unsigned long *)m->d,
p->top*sizeof(BN_ULONG),
(unsigned long *)p->d,
a->top*sizeof(BN_ULONG),
(unsigned long *)a->d,
(unsigned long *)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 */

File diff suppressed because it is too large Load Diff

View File

@@ -1,177 +0,0 @@
/* 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 256
#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;
typedef AEP_RV t_AEP_OpenConnection(AEP_CONNECTION_HNDL_PTR phConnection);
typedef AEP_RV t_AEP_CloseConnection(AEP_CONNECTION_HNDL hConnection);
typedef AEP_RV t_AEP_ModExp(AEP_CONNECTION_HNDL hConnection,
AEP_VOID_PTR pA, AEP_VOID_PTR pP,
AEP_VOID_PTR pN,
AEP_VOID_PTR pResult,
AEP_TRANSACTION_ID* pidTransID);
typedef AEP_RV t_AEP_ModExpCrt(AEP_CONNECTION_HNDL hConnection,
AEP_VOID_PTR pA, AEP_VOID_PTR pP,
AEP_VOID_PTR pQ,
AEP_VOID_PTR pDmp1, AEP_VOID_PTR pDmq1,
AEP_VOID_PTR pIqmp,
AEP_VOID_PTR pResult,
AEP_TRANSACTION_ID* pidTransID);
#ifdef AEPRAND
typedef AEP_RV t_AEP_GenRandom(AEP_CONNECTION_HNDL hConnection,
AEP_U32 Len,
AEP_U32 Type,
AEP_VOID_PTR pResult,
AEP_TRANSACTION_ID* pidTransID);
#endif
typedef AEP_RV t_AEP_Initialize(AEP_VOID_PTR pInitArgs);
typedef AEP_RV t_AEP_Finalize();
typedef AEP_RV t_AEP_SetBNCallBacks(AEP_RV (*GetBigNumSizeFunc)(),
AEP_RV (*MakeAEPBigNumFunc)(),
AEP_RV (*ConverAEPBigNumFunc)());

View File

@@ -1,61 +0,0 @@
/* This header declares the necessary definitions for using the exponentiation
* acceleration capabilities of Atalla cards. The only cryptographic operation
* is performed by "ASI_RSAPrivateKeyOpFn" and this takes a structure that
* defines an "RSA private key". However, it is really only performing a
* regular mod_exp using the supplied modulus and exponent - no CRT form is
* being used. Hence, it is a generic mod_exp function in disguise, and we use
* it as such.
*
* Thanks to the people at Atalla for letting me know these definitions are
* fine and that they can be reproduced here.
*
* Geoff.
*/
typedef struct ItemStr
{
unsigned char *data;
int len;
} Item;
typedef struct RSAPrivateKeyStr
{
void *reserved;
Item version;
Item modulus;
Item publicExponent;
Item privateExponent;
Item prime[2];
Item exponent[2];
Item coefficient;
} RSAPrivateKey;
/* Predeclare the function pointer types that we dynamically load from the DSO.
* These use the same names and form that Ben's original support code had (in
* crypto/bn/bn_exp.c) unless of course I've inadvertently changed the style
* somewhere along the way!
*/
typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
unsigned int *ret_buf);
typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
unsigned char *output,
unsigned char *input,
unsigned int modulus_len);
/* These are the static string constants for the DSO file name and the function
* symbol names to bind to. Regrettably, the DSO name on *nix appears to be
* "atasi.so" rather than something more consistent like "libatasi.so". At the
* time of writing, I'm not sure what the file name on win32 is but clearly
* native name translation is not possible (eg libatasi.so on *nix, and
* atasi.dll on win32). For the purposes of testing, I have created a symbollic
* link called "libatasi.so" so that we can use native name-translation - a
* better solution will be needed. */
static const char *ATALLA_LIBNAME = "atasi";
static const char *ATALLA_F1 = "ASI_GetHardwareConfig";
static const char *ATALLA_F2 = "ASI_RSAPrivateKeyOpFn";
static const char *ATALLA_F3 = "ASI_GetPerformanceStatistics";

View File

@@ -1,229 +0,0 @@
/* Attribution notice: Rainbow have generously allowed me to reproduce
* the necessary definitions here from their API. This means the support
* can build independently of whether application builders have the
* API or hardware. This will allow developers to easily produce software
* that has latent hardware support for any users that have accelertors
* installed, without the developers themselves needing anything extra.
*
* I have only clipped the parts from the CryptoSwift header files that
* are (or seem) relevant to the CryptoSwift support code. This is
* simply to keep the file sizes reasonable.
* [Geoff]
*/
/* NB: These type widths do *not* seem right in general, in particular
* they're not terribly friendly to 64-bit architectures (unsigned long)
* will be 64-bit on IA-64 for a start. I'm leaving these alone as they
* agree with Rainbow's API and this will only be called into question
* on platforms with Rainbow support anyway! ;-) */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef long SW_STATUS; /* status */
typedef unsigned char SW_BYTE; /* 8 bit byte */
typedef unsigned short SW_U16; /* 16 bit number */
#if defined(_IRIX)
#include <sgidefs.h>
typedef __uint32_t SW_U32;
#else
typedef unsigned long SW_U32; /* 32 bit integer */
#endif
#if defined(WIN32)
typedef struct _SW_U64 {
SW_U32 low32;
SW_U32 high32;
} SW_U64; /* 64 bit integer */
#elif defined(MAC)
typedef longlong SW_U64
#else /* Unix variants */
typedef struct _SW_U64 {
SW_U32 low32;
SW_U32 high32;
} SW_U64; /* 64 bit integer */
#endif
/* status codes */
#define SW_OK (0L)
#define SW_ERR_BASE (-10000L)
#define SW_ERR_NO_CARD (SW_ERR_BASE-1) /* The Card is not present */
#define SW_ERR_CARD_NOT_READY (SW_ERR_BASE-2) /* The card has not powered */
/* up yet */
#define SW_ERR_TIME_OUT (SW_ERR_BASE-3) /* Execution of a command */
/* time out */
#define SW_ERR_NO_EXECUTE (SW_ERR_BASE-4) /* The Card failed to */
/* execute the command */
#define SW_ERR_INPUT_NULL_PTR (SW_ERR_BASE-5) /* a required pointer is */
/* NULL */
#define SW_ERR_INPUT_SIZE (SW_ERR_BASE-6) /* size is invalid, too */
/* small, too large. */
#define SW_ERR_INVALID_HANDLE (SW_ERR_BASE-7) /* Invalid SW_ACC_CONTEXT */
/* handle */
#define SW_ERR_PENDING (SW_ERR_BASE-8) /* A request is already out- */
/* standing at this */
/* context handle */
#define SW_ERR_AVAILABLE (SW_ERR_BASE-9) /* A result is available. */
#define SW_ERR_NO_PENDING (SW_ERR_BASE-10)/* No request is pending. */
#define SW_ERR_NO_MEMORY (SW_ERR_BASE-11)/* Not enough memory */
#define SW_ERR_BAD_ALGORITHM (SW_ERR_BASE-12)/* Invalid algorithm type */
/* in SW_PARAM structure */
#define SW_ERR_MISSING_KEY (SW_ERR_BASE-13)/* No key is associated with */
/* context. */
/* swAttachKeyParam() is */
/* not called. */
#define SW_ERR_KEY_CMD_MISMATCH \
(SW_ERR_BASE-14)/* Cannot perform requested */
/* SW_COMMAND_CODE since */
/* key attached via */
/* swAttachKeyParam() */
/* cannot be used for this*/
/* SW_COMMAND_CODE. */
#define SW_ERR_NOT_IMPLEMENTED \
(SW_ERR_BASE-15)/* Not implemented */
#define SW_ERR_BAD_COMMAND (SW_ERR_BASE-16)/* Bad command code */
#define SW_ERR_BAD_ITEM_SIZE (SW_ERR_BASE-17)/* too small or too large in */
/* the "initems" or */
/* "outitems". */
#define SW_ERR_BAD_ACCNUM (SW_ERR_BASE-18)/* Bad accelerator number */
#define SW_ERR_SELFTEST_FAIL (SW_ERR_BASE-19)/* At least one of the self */
/* test fail, look at the */
/* selfTestBitmap in */
/* SW_ACCELERATOR_INFO for*/
/* details. */
#define SW_ERR_MISALIGN (SW_ERR_BASE-20)/* Certain alogrithms require*/
/* key materials aligned */
/* in certain order, e.g. */
/* 128 bit for CRT */
#define SW_ERR_OUTPUT_NULL_PTR \
(SW_ERR_BASE-21)/* a required pointer is */
/* NULL */
#define SW_ERR_OUTPUT_SIZE \
(SW_ERR_BASE-22)/* size is invalid, too */
/* small, too large. */
#define SW_ERR_FIRMWARE_CHECKSUM \
(SW_ERR_BASE-23)/* firmware checksum mismatch*/
/* download failed. */
#define SW_ERR_UNKNOWN_FIRMWARE \
(SW_ERR_BASE-24)/* unknown firmware error */
#define SW_ERR_INTERRUPT (SW_ERR_BASE-25)/* request is abort when */
/* it's waiting to be */
/* completed. */
#define SW_ERR_NVWRITE_FAIL (SW_ERR_BASE-26)/* error in writing to Non- */
/* volatile memory */
#define SW_ERR_NVWRITE_RANGE (SW_ERR_BASE-27)/* out of range error in */
/* writing to NV memory */
#define SW_ERR_RNG_ERROR (SW_ERR_BASE-28)/* Random Number Generation */
/* failure */
#define SW_ERR_DSS_FAILURE (SW_ERR_BASE-29)/* DSS Sign or Verify failure*/
#define SW_ERR_MODEXP_FAILURE (SW_ERR_BASE-30)/* Failure in various math */
/* calculations */
#define SW_ERR_ONBOARD_MEMORY (SW_ERR_BASE-31)/* Error in accessing on - */
/* board memory */
#define SW_ERR_FIRMWARE_VERSION \
(SW_ERR_BASE-32)/* Wrong version in firmware */
/* update */
#define SW_ERR_ZERO_WORKING_ACCELERATOR \
(SW_ERR_BASE-44)/* All accelerators are bad */
/* algorithm type */
#define SW_ALG_CRT 1
#define SW_ALG_EXP 2
#define SW_ALG_DSA 3
#define SW_ALG_NVDATA 4
/* command code */
#define SW_CMD_MODEXP_CRT 1 /* perform Modular Exponentiation using */
/* Chinese Remainder Theorem (CRT) */
#define SW_CMD_MODEXP 2 /* perform Modular Exponentiation */
#define SW_CMD_DSS_SIGN 3 /* perform DSS sign */
#define SW_CMD_DSS_VERIFY 4 /* perform DSS verify */
#define SW_CMD_RAND 5 /* perform random number generation */
#define SW_CMD_NVREAD 6 /* perform read to nonvolatile RAM */
#define SW_CMD_NVWRITE 7 /* perform write to nonvolatile RAM */
typedef SW_U32 SW_ALGTYPE; /* alogrithm type */
typedef SW_U32 SW_STATE; /* state */
typedef SW_U32 SW_COMMAND_CODE; /* command code */
typedef SW_U32 SW_COMMAND_BITMAP[4]; /* bitmap */
typedef struct _SW_LARGENUMBER {
SW_U32 nbytes; /* number of bytes in the buffer "value" */
SW_BYTE* value; /* the large integer as a string of */
/* bytes in network (big endian) order */
} SW_LARGENUMBER;
typedef struct _SW_CRT {
SW_LARGENUMBER p; /* prime number p */
SW_LARGENUMBER q; /* prime number q */
SW_LARGENUMBER dmp1; /* exponent1 */
SW_LARGENUMBER dmq1; /* exponent2 */
SW_LARGENUMBER iqmp; /* CRT coefficient */
} SW_CRT;
typedef struct _SW_EXP {
SW_LARGENUMBER modulus; /* modulus */
SW_LARGENUMBER exponent;/* exponent */
} SW_EXP;
typedef struct _SW_DSA {
SW_LARGENUMBER p; /* */
SW_LARGENUMBER q; /* */
SW_LARGENUMBER g; /* */
SW_LARGENUMBER key; /* private/public key */
} SW_DSA;
typedef struct _SW_NVDATA {
SW_U32 accnum; /* accelerator board number */
SW_U32 offset; /* offset in byte */
} SW_NVDATA;
typedef struct _SW_PARAM {
SW_ALGTYPE type; /* type of the alogrithm */
union {
SW_CRT crt;
SW_EXP exp;
SW_DSA dsa;
SW_NVDATA nvdata;
} up;
} SW_PARAM;
typedef SW_U32 SW_CONTEXT_HANDLE; /* opaque context handle */
/* Now the OpenSSL bits, these function types are the for the function
* pointers that will bound into the Rainbow shared libraries. */
/********** Peng's modification begins **********/
#if defined(WIN32) /* For WIN32 platform */
typedef SW_STATUS _stdcall t_swAcquireAccContext(SW_CONTEXT_HANDLE *hac);
typedef SW_STATUS _stdcall t_swAttachKeyParam(SW_CONTEXT_HANDLE hac,
SW_PARAM *key_params);
typedef SW_STATUS _stdcall t_swSimpleRequest(SW_CONTEXT_HANDLE hac,
SW_COMMAND_CODE cmd,
SW_LARGENUMBER pin[],
SW_U32 pin_count,
SW_LARGENUMBER pout[],
SW_U32 pout_count);
typedef SW_STATUS _stdcall t_swReleaseAccContext(SW_CONTEXT_HANDLE hac);
#else /* For other platforms */
typedef SW_STATUS t_swAcquireAccContext(SW_CONTEXT_HANDLE *hac);
typedef SW_STATUS t_swAttachKeyParam(SW_CONTEXT_HANDLE hac,
SW_PARAM *key_params);
typedef SW_STATUS t_swSimpleRequest(SW_CONTEXT_HANDLE hac,
SW_COMMAND_CODE cmd,
SW_LARGENUMBER pin[],
SW_U32 pin_count,
SW_LARGENUMBER pout[],
SW_U32 pout_count);
typedef SW_STATUS t_swReleaseAccContext(SW_CONTEXT_HANDLE hac);
#endif
/********** Peng's modification ends **********/
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -1,105 +0,0 @@
/******************************************************************************
*
* 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

@@ -1,476 +0,0 @@
/*
* ModExp / RSA (with/without KM) plugin API
*
* The application will load a dynamic library which
* exports entrypoint(s) defined in this file.
*
* This set of entrypoints provides only a multithreaded,
* synchronous-within-each-thread, facility.
*
*
* This file is Copyright 1998-1999 nCipher Corporation Limited.
*
* This file is provided for your information and assistance. You are
* permitted to copy it verbatim, to use it to create compatible
* software, and for review and comment. However, you may not
* distribute changed versions or other derivative works. All other
* rights are reserved.
*
* IN NO EVENT SHALL NCIPHER CORPORATION LIMITED (`NCIPHER') AND/OR
* ANY OTHER AUTHORS OR DISTRIBUTORS OF THIS FILE BE LIABLE for any
* damages arising directly or indirectly from this file, its use or
* this licence. Without prejudice to the generality of the
* foregoing: all liability shall be excluded for direct, indirect,
* special, incidental, consequential or other damages or any loss of
* profits, business, revenue goodwill or anticipated savings;
* liability shall be excluded even if nCipher or anyone else has been
* advised of the possibility of damage. In any event, if the
* exclusion of liability is not effective, the liability of nCipher
* or any author or distributor shall be limited to the lesser of the
* price paid and 1,000 pounds sterling. This licence only fails to
* exclude or limit liability for death or personal injury arising out
* of negligence, and only to the extent that such an exclusion or
* limitation is not effective.
*
* NCIPHER AND THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ALL
* AND ANY WARRANTIES (WHETHER EXPRESS OR IMPLIED), including, but not
* limited to, any implied warranties of merchantability, fitness for
* a particular purpose, satisfactory quality, and/or non-infringement
* of any third party rights.
*
* US Government use: This software and documentation is Commercial
* Computer Software and Computer Software Documentation, as defined in
* sub-paragraphs (a)(1) and (a)(5) of DFAR 252.227-7014, "Rights in
* Noncommercial Computer Software and Noncommercial Computer Software
* Documentation." Use, duplication or disclosure by the Government is
* subject to the terms and conditions specified here.
*
* By using or distributing this file you will be accepting these
* terms and conditions, including the limitation of liability and
* lack of warranty. If you do not wish to accept these terms and
* conditions, DO NOT USE THE FILE.
*
*
* The actual dynamically loadable plugin, and the library files for
* static linking, which are also provided in this distribution, are
* not covered by the licence described above. You should have
* received a separate licence with terms and conditions for these
* library files; if you received the library files without a licence,
* please contact nCipher.
*
*
* $Id: hwcryptohook.h,v 1.1.2.1 2000/06/13 16:19:53 levitte Exp $
*/
#ifndef HWCRYPTOHOOK_H
#define HWCRYPTOHOOK_H
#include <sys/types.h>
#include <stdio.h>
#ifndef HWCRYPTOHOOK_DECLARE_APPTYPES
#define HWCRYPTOHOOK_DECLARE_APPTYPES 1
#endif
#define HWCRYPTOHOOK_ERROR_FAILED -1
#define HWCRYPTOHOOK_ERROR_FALLBACK -2
#define HWCRYPTOHOOK_ERROR_MPISIZE -3
#if HWCRYPTOHOOK_DECLARE_APPTYPES
/* These structs are defined by the application and opaque to the
* crypto plugin. The application may define these as it sees fit.
* Default declarations are provided here, but the application may
* #define HWCRYPTOHOOK_DECLARE_APPTYPES 0
* to prevent these declarations, and instead provide its own
* declarations of these types. (Pointers to them must still be
* ordinary pointers to structs or unions, or the resulting combined
* program will have a type inconsistency.)
*/
typedef struct HWCryptoHook_MutexValue HWCryptoHook_Mutex;
typedef struct HWCryptoHook_CondVarValue HWCryptoHook_CondVar;
typedef struct HWCryptoHook_PassphraseContextValue HWCryptoHook_PassphraseContext;
typedef struct HWCryptoHook_CallerContextValue HWCryptoHook_CallerContext;
#endif /* HWCRYPTOHOOK_DECLARE_APPTYPES */
/* These next two structs are opaque to the application. The crypto
* plugin will return pointers to them; the caller simply manipulates
* the pointers.
*/
typedef struct HWCryptoHook_Context *HWCryptoHook_ContextHandle;
typedef struct HWCryptoHook_RSAKey *HWCryptoHook_RSAKeyHandle;
typedef struct {
char *buf;
size_t size;
} HWCryptoHook_ErrMsgBuf;
/* Used for error reporting. When a HWCryptoHook function fails it
* will return a sentinel value (0 for pointer-valued functions, or a
* negative number, usually HWCRYPTOHOOK_ERROR_FAILED, for
* integer-valued ones). It will, if an ErrMsgBuf is passed, also put
* an error message there.
*
* size is the size of the buffer. When the buffer is filled, it will
* always be null-terminated. If you pass 0 buf buf you must pass 0
* for size, and nothing will be recorded (just as if you passed 0 for
* the struct pointer). Size will not be modified when an error is
* recorded. The buffer is always null-terminated even if there is an
* overrun.
*
* The contents of the buffer are not defined if there is no error.
*/
typedef struct HWCryptoHook_MPIStruct {
unsigned char *buf;
size_t size;
} HWCryptoHook_MPI;
/* When one of these is returned, a pointer is passed to the function.
* At call, size is the space available. Afterwards it is updated.
* buf (the pointer) is not updated. size is in bytes and may be
* zero, but must be a multiple of the limb size. Zero limbs at the
* MS end are not permitted.
*/
#define HWCryptoHook_InitFlags_FallbackModExp 0x0002UL
#define HWCryptoHook_InitFlags_FallbackRSAImmed 0x0004UL
/* Enable requesting fallback to software in case of problems with the
* hardware support. This indicates to the crypto provider that the
* application is prepared to fall back to software operation if the
* ModExp* or RSAImmed* functions return HWCRYPTOHOOK_ERROR_FALLBACK.
* Without this flag those calls will never return
* HWCRYPTOHOOK_ERROR_FALLBACK. The flag will also cause the crypto
* provider to avoid repeatedly attempting to contact dead hardware
* within a short interval, if appropriate.
*/
#define HWCryptoHook_InitFlags_SimpleForkCheck 0x0010UL
/* Without _SimpleForkCheck the library is allowed to assume that the
* application will not fork and call the library in the child(ren).
*
* When it is specified, this is allowed. However, after a fork
* neither parent nor child may unload any loaded keys or call
* _Finish. Instead, they should call exit (or die with a signal)
* without calling _Finish. After all the children have died the
* parent may unload keys or call _Finish.
*
* This flag only has any effect on UN*X platforms.
*/
typedef struct {
unsigned long flags;
void *logstream; /* usually a FILE*. See below. */
size_t limbsize; /* bignum format - size of radix type, must be power of 2 */
int mslimbfirst; /* 0 or 1 */
int msbytefirst; /* 0 or 1; -1 = native */
/* All the callback functions should return 0 on success, or a
* nonzero integer (whose value will be visible in the error message
* put in the buffer passed to the call).
*
* If a callback is not available pass a null function pointer.
*
* The callbacks may not call down again into the crypto plugin.
*/
/* For thread-safety. Set everything to 0 if you promise only to be
* singlethreaded. maxsimultaneous is the number of calls to
* ModExp[Crt]/RSAImmed{Priv,Pub}/RSA. If you don't know what to
* put there then say 0 and the hook library will use a default.
*
* maxmutexes is a small limit on the number of simultaneous mutexes
* which will be requested by the library. If there is no small
* limit, set it to 0. If the crypto plugin cannot create the
* advertised number of mutexes the calls to its functions may fail.
* If a low number of mutexes is advertised the plugin will try to
* do the best it can. Making larger numbers of mutexes available
* may improve performance and parallelism by reducing contention
* over critical sections. Unavailability of any mutexes, implying
* single-threaded operation, should be indicated by the setting
* mutex_init et al to 0.
*/
int maxmutexes;
int maxsimultaneous;
size_t mutexsize;
int (*mutex_init)(HWCryptoHook_Mutex*, HWCryptoHook_CallerContext *cactx);
int (*mutex_acquire)(HWCryptoHook_Mutex*);
void (*mutex_release)(HWCryptoHook_Mutex*);
void (*mutex_destroy)(HWCryptoHook_Mutex*);
/* For greater efficiency, can use condition vars internally for
* synchronisation. In this case maxsimultaneous is ignored, but
* the other mutex stuff must be available. In singlethreaded
* programs, set everything to 0.
*/
size_t condvarsize;
int (*condvar_init)(HWCryptoHook_CondVar*, HWCryptoHook_CallerContext *cactx);
int (*condvar_wait)(HWCryptoHook_CondVar*, HWCryptoHook_Mutex*);
void (*condvar_signal)(HWCryptoHook_CondVar*);
void (*condvar_broadcast)(HWCryptoHook_CondVar*);
void (*condvar_destroy)(HWCryptoHook_CondVar*);
/* The semantics of acquiring and releasing mutexes and broadcasting
* and waiting on condition variables are expected to be those from
* POSIX threads (pthreads). The mutexes may be (in pthread-speak)
* fast mutexes, recursive mutexes, or nonrecursive ones.
*
* The _release/_signal/_broadcast and _destroy functions must
* always succeed when given a valid argument; if they are given an
* invalid argument then the program (crypto plugin + application)
* has an internal error, and they should abort the program.
*/
int (*getpassphrase)(const char *prompt_info,
int *len_io, char *buf,
HWCryptoHook_PassphraseContext *ppctx,
HWCryptoHook_CallerContext *cactx);
/* Passphrases and the prompt_info, if they contain high-bit-set
* characters, are UTF-8. The prompt_info may be a null pointer if
* no prompt information is available (it should not be an empty
* string). It will not contain text like `enter passphrase';
* instead it might say something like `Operator Card for John
* Smith' or `SmartCard in nFast Module #1, Slot #1'.
*
* buf points to a buffer in which to return the passphrase; on
* entry *len_io is the length of the buffer. It should be updated
* by the callback. The returned passphrase should not be
* null-terminated by the callback.
*/
int (*getphystoken)(const char *prompt_info,
const char *wrong_info,
HWCryptoHook_PassphraseContext *ppctx,
HWCryptoHook_CallerContext *cactx);
/* Requests that the human user physically insert a different
* smartcard, DataKey, etc. The plugin should check whether the
* currently inserted token(s) are appropriate, and if they are it
* should not make this call.
*
* prompt_info is as before. wrong_info is a description of the
* currently inserted token(s) so that the user is told what
* something is. wrong_info, like prompt_info, may be null, but
* should not be an empty string. Its contents should be
* syntactically similar to that of prompt_info.
*/
/* Note that a single LoadKey operation might cause several calls to
* getpassphrase and/or requestphystoken. If requestphystoken is
* not provided (ie, a null pointer is passed) then the plugin may
* not support loading keys for which authorisation by several cards
* is required. If getpassphrase is not provided then cards with
* passphrases may not be supported.
*
* getpassphrase and getphystoken do not need to check that the
* passphrase has been entered correctly or the correct token
* inserted; the crypto plugin will do that. If this is not the
* case then the crypto plugin is responsible for calling these
* routines again as appropriate until the correct token(s) and
* passphrase(s) are supplied as required, or until any retry limits
* implemented by the crypto plugin are reached.
*
* In either case, the application must allow the user to say `no'
* or `cancel' to indicate that they do not know the passphrase or
* have the appropriate token; this should cause the callback to
* return nonzero indicating error.
*/
void (*logmessage)(void *logstream, const char *message);
/* A log message will be generated at least every time something goes
* wrong and an ErrMsgBuf is filled in (or would be if one was
* provided). Other diagnostic information may be written there too,
* including more detailed reasons for errors which are reported in an
* ErrMsgBuf.
*
* When a log message is generated, this callback is called. It
* should write a message to the relevant logging arrangements.
*
* The message string passed will be null-terminated and may be of arbitrary
* length. It will not be prefixed by the time and date, nor by the
* name of the library that is generating it - if this is required,
* the logmessage callback must do it. The message will not have a
* trailing newline (though it may contain internal newlines).
*
* If a null pointer is passed for logmessage a default function is
* used. The default function treats logstream as a FILE* which has
* been converted to a void*. If logstream is 0 it does nothing.
* Otherwise it prepends the date and time and library name and
* writes the message to logstream. Each line will be prefixed by a
* descriptive string containing the date, time and identity of the
* crypto plugin. Errors on the logstream are not reported
* anywhere, and the default function doesn't flush the stream, so
* the application must set the buffering how it wants it.
*
* The crypto plugin may also provide a facility to have copies of
* log messages sent elsewhere, and or for adjusting the verbosity
* of the log messages; any such facilities will be configured by
* external means.
*/
} HWCryptoHook_InitInfo;
typedef
HWCryptoHook_ContextHandle HWCryptoHook_Init_t(const HWCryptoHook_InitInfo *initinfo,
size_t initinfosize,
HWCryptoHook_ErrMsgBuf *errors,
HWCryptoHook_CallerContext *cactx);
extern HWCryptoHook_Init_t HWCryptoHook_Init;
/* Caller should set initinfosize to the size of the HWCryptoHook struct,
* so it can be extended later.
*
* On success, a message for display or logging by the server,
* including the name and version number of the plugin, will be filled
* in into *errors; on failure *errors is used for error handling, as
* usual.
*/
/* All these functions return 0 on success, HWCRYPTOHOOK_ERROR_FAILED
* on most failures. HWCRYPTOHOOK_ERROR_MPISIZE means at least one of
* the output MPI buffer(s) was too small; the sizes of all have been
* set to the desired size (and for those where the buffer was large
* enough, the value may have been copied in), and no error message
* has been recorded.
*
* You may pass 0 for the errors struct. In any case, unless you set
* _NoStderr at init time then messages may be reported to stderr.
*/
/* The RSAImmed* functions (and key managed RSA) only work with
* modules which have an RSA patent licence - currently that means KM
* units; the ModExp* ones work with all modules, so you need a patent
* licence in the software in the US.
*/
typedef
void HWCryptoHook_Finish_t(HWCryptoHook_ContextHandle hwctx);
extern HWCryptoHook_Finish_t HWCryptoHook_Finish;
/* You must not have any calls going or keys loaded when you call this. */
typedef
int HWCryptoHook_RandomBytes_t(HWCryptoHook_ContextHandle hwctx,
unsigned char *buf, size_t len,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_RandomBytes_t HWCryptoHook_RandomBytes;
typedef
int HWCryptoHook_ModExp_t(HWCryptoHook_ContextHandle hwctx,
HWCryptoHook_MPI a,
HWCryptoHook_MPI p,
HWCryptoHook_MPI n,
HWCryptoHook_MPI *r,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_ModExp_t HWCryptoHook_ModExp;
typedef
int HWCryptoHook_RSAImmedPub_t(HWCryptoHook_ContextHandle hwctx,
HWCryptoHook_MPI m,
HWCryptoHook_MPI e,
HWCryptoHook_MPI n,
HWCryptoHook_MPI *r,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_RSAImmedPub_t HWCryptoHook_RSAImmedPub;
typedef
int HWCryptoHook_ModExpCRT_t(HWCryptoHook_ContextHandle hwctx,
HWCryptoHook_MPI a,
HWCryptoHook_MPI p,
HWCryptoHook_MPI q,
HWCryptoHook_MPI dmp1,
HWCryptoHook_MPI dmq1,
HWCryptoHook_MPI iqmp,
HWCryptoHook_MPI *r,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_ModExpCRT_t HWCryptoHook_ModExpCRT;
typedef
int HWCryptoHook_RSAImmedPriv_t(HWCryptoHook_ContextHandle hwctx,
HWCryptoHook_MPI m,
HWCryptoHook_MPI p,
HWCryptoHook_MPI q,
HWCryptoHook_MPI dmp1,
HWCryptoHook_MPI dmq1,
HWCryptoHook_MPI iqmp,
HWCryptoHook_MPI *r,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_RSAImmedPriv_t HWCryptoHook_RSAImmedPriv;
/* The RSAImmed* and ModExp* functions may return E_FAILED or
* E_FALLBACK for failure.
*
* E_FAILED means the failure is permanent and definite and there
* should be no attempt to fall back to software. (Eg, for some
* applications, which support only the acceleration-only
* functions, the `key material' may actually be an encoded key
* identifier, and doing the operation in software would give wrong
* answers.)
*
* E_FALLBACK means that doing the computation in software would seem
* reasonable. If an application pays attention to this and is
* able to fall back, it should also set the Fallback init flags.
*/
typedef
int HWCryptoHook_RSALoadKey_t(HWCryptoHook_ContextHandle hwctx,
const char *key_ident,
HWCryptoHook_RSAKeyHandle *keyhandle_r,
const HWCryptoHook_ErrMsgBuf *errors,
HWCryptoHook_PassphraseContext *ppctx);
extern HWCryptoHook_RSALoadKey_t HWCryptoHook_RSALoadKey;
/* The key_ident is a null-terminated string configured by the
* user via the application's usual configuration mechanisms.
* It is provided to the user by the crypto provider's key management
* system. The user must be able to enter at least any string of between
* 1 and 1023 characters inclusive, consisting of printable 7-bit
* ASCII characters. The provider should avoid using
* any characters except alphanumerics and the punctuation
* characters _ - + . / @ ~ (the user is expected to be able
* to enter these without quoting). The string may be case-sensitive.
* The application may allow the user to enter other NULL-terminated strings,
* and the provider must cope (returning an error if the string is not
* valid).
*
* If the key does not exist, it is _not_ an error - in that case,
* keyhandle_r will be set to 0 instead of to a key handle.
*/
typedef
int HWCryptoHook_RSAGetPublicKey_t(HWCryptoHook_RSAKeyHandle k,
HWCryptoHook_MPI *n,
HWCryptoHook_MPI *e,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_RSAGetPublicKey_t HWCryptoHook_RSAGetPublicKey;
/* The crypto plugin will not store certificates.
*
* Although this function for acquiring the public key value is
* provided, it is not the purpose of this API to deal fully with the
* handling of the public key.
*
* It is expected that the crypto supplier's key generation program
* will provide general facilities for producing X.509
* self-certificates and certificate requests in PEM format. These
* will be given to the user so that they can configure them in the
* application, send them to CAs, or whatever.
*
* In case this kind of certificate handling is not appropriate, the
* crypto supplier's key generation program should be able to be
* configured not to generate such a self-certificate or certificate
* request. Then the application will need to do all of this, and
* will need to store and handle the public key and certificates
* itself.
*/
typedef
int HWCryptoHook_RSAUnloadKey_t(HWCryptoHook_RSAKeyHandle k,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_RSAUnloadKey_t HWCryptoHook_RSAUnloadKey;
/* Might fail due to locking problems, or other serious internal problems. */
typedef
int HWCryptoHook_RSA_t(HWCryptoHook_MPI m,
HWCryptoHook_RSAKeyHandle k,
HWCryptoHook_MPI *r,
const HWCryptoHook_ErrMsgBuf *errors);
extern HWCryptoHook_RSA_t HWCryptoHook_RSA;
#endif /*HWCRYPTOHOOK_H*/

View File

@@ -1,214 +0,0 @@
#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

@@ -1,239 +0,0 @@
/*
* 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

@@ -92,21 +92,21 @@ err_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
err_all.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
err_all.o: ../../include/openssl/des.h ../../include/openssl/dh.h
err_all.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
err_all.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
err_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
err_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
err_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
err_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
err_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
err_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
err_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
err_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
err_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
err_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
err_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
err_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
err_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
err_all.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
err_all.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
err_all.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
err_all.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
err_all.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
err_all.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
err_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
err_all.o: ../../include/openssl/opensslv.h ../../include/openssl/pem2.h
err_all.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
err_all.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
err_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
err_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
err_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
err_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
err_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
err_all.o: ../../include/openssl/x509v3.h
err_prn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
err_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
err_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h

View File

@@ -157,7 +157,6 @@ static ERR_STRING_DATA ERR_str_libraries[]=
{ERR_PACK(ERR_LIB_PKCS12,0,0) ,"PKCS12 routines"},
{ERR_PACK(ERR_LIB_RAND,0,0) ,"random number generator"},
{ERR_PACK(ERR_LIB_DSO,0,0) ,"DSO support routines"},
{ERR_PACK(ERR_LIB_ENGINE,0,0) ,"engine routines"},
{0,NULL},
};
@@ -209,7 +208,6 @@ static ERR_STRING_DATA ERR_str_reasons[]=
{ERR_R_ASN1_LENGTH_MISMATCH ,"asn1 length mismatch"},
{ERR_R_MISSING_ASN1_EOS ,"missing asn1 eos"},
{ERR_R_DSO_LIB ,"DSO lib"},
{ERR_R_ENGINE_LIB ,"ENGINE lib"},
{0,NULL},
};

View File

@@ -132,7 +132,6 @@ typedef struct err_state_st
#define ERR_LIB_PKCS12 35
#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,7 +162,6 @@ typedef struct err_state_st
#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),ERR_file_name,__LINE__)
#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
@@ -214,7 +212,6 @@ typedef struct err_state_st
#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7
#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 */

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