Compare commits

...

382 Commits

Author SHA1 Message Date
Lutz Jänicke
e970fa0022 Typo.
Submitted by:
Reviewed by:
PR:
2002-07-30 11:30:03 +00:00
Lutz Jänicke
458bb156bf Release 0.9.7-beta3
Submitted by:
Reviewed by:
PR:
2002-07-30 11:27:18 +00:00
Lutz Jänicke
bca9dc2a51 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 11:21:19 +00:00
Lutz Jänicke
3720ea24f0 "make update"
Submitted by:
Reviewed by:
PR:
2002-07-30 07:18:03 +00:00
Lutz Jänicke
72a37c03be Only use DSA-functions if available.
Submitted by: "Hellan,Kim KHE" <KHE@kmd.dk>
Reviewed by:
PR: 167
2002-07-29 13:28:57 +00:00
Bodo Möller
93d1969c78 mention SSL_do_handshake() 2002-07-29 12:34:14 +00:00
Bodo Möller
6178bb8fe9 Add bn_dup_expand() comment from the main branch explaining that
bn_dup_expand() is broken.

[No need to fix this in 0.9.7-stable, it is just an unused internal
function.]
2002-07-25 12:14:41 +00:00
Bodo Möller
5b195b5a0e more detailed instructions for export from US 2002-07-25 11:19:36 +00:00
Richard Levitte
4289131ae6 Don't clobber loop variable.
PR: 159
2002-07-24 14:42:38 +00:00
Richard Levitte
b721e1e239 Document the recent DJGPP-related changes 2002-07-23 13:46:05 +00:00
Richard Levitte
6cf2012a4d Make dummy tests to make it easier to physically remove unwanted algorithms.
This should complete PR 75
2002-07-23 13:32:10 +00:00
cvs2svn
e459ebaed1 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-07-23 13:31:07 +00:00
Richard Levitte
e9e3ce40c5 If DH is disabled, don't define the DH functions.
Notified by Kim Hellan <KHE@kmd.dk>
2002-07-22 14:18:00 +00:00
Bodo Möller
56d84db1d4 fix a typo and clarify 2002-07-22 09:05:41 +00:00
Bodo Möller
16758de0a2 add an explanation and fix a typo 2002-07-22 08:38:14 +00:00
Lutz Jänicke
f19b6474fe New cipher selection options COMPLEMENTOFALL and COMPLEMENTOFDEFAULT.
Submitted by:
Reviewed by:
PR: 127
2002-07-19 19:53:02 +00:00
Lutz Jänicke
2f6f2970c4 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:31:36 +00:00
Bodo Möller
f227a1af7d update 2002-07-19 12:32:52 +00:00
Lutz Jänicke
4408572079 The behaviour is undefined when calling SSL_write() with num=0.
Submitted by:
Reviewed by:
PR: 141
2002-07-19 11:53:11 +00:00
Lutz Jänicke
31b5b999c7 Manual page for SSL_do_handshake().
Submitted by: Martin Sjögren <martin@strakt.com>
PR: 137
2002-07-19 11:06:53 +00:00
cvs2svn
f8bcfb5d5a This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-07-19 11:05:53 +00:00
Geoff Thorpe
44e9c2617a This documentation change was being written at the same time as Richard's
changes. So I'm committing this version to overwrite his changes for now,
and he can always take his turn to overwrite my words if he wants :-)

PR: 86
2002-07-18 20:52:47 +00:00
Richard Levitte
b61739874e Explain why RSA_check_key() doesn't work with hard keys.
PR: 86
2002-07-18 19:11:06 +00:00
Richard Levitte
73957bd323 Add history for documented new functions.
PR: 59
2002-07-18 18:55:06 +00:00
Richard Levitte
81f1338613 Allow subjects with more than 255 characters to be properly printed.
PR: 147
2002-07-18 17:59:38 +00:00
Richard Levitte
90baf2a92d Further enhance assembler support on Cygwin and DJGPP.
Make pod2mantest useable on DOS-based systems.
Part of PR 75, the rest is still under investigation.
2002-07-18 12:38:07 +00:00
Bodo Möller
13793a0ddf Fix bug introduced with revision 1.95 when this filed was modified to
use the new X509_CRL_set_issuer_name() function:
The CRL issuer should be X509_get_subject_name(x509), not
X509_get_issuer_name(x509).

Submitted by: Juergen Lesny <lesnyj@informatik.tu-muenchen.de>

typo
2002-07-18 11:19:05 +00:00
Richard Levitte
b334853d72 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:49 +00:00
Richard Levitte
4b5d50e26b Make S/MIME output conform with the mail and MIME standards.
PR: 151
2002-07-18 08:47:56 +00:00
Richard Levitte
6d454e6ab2 Unixware doesn't have strings.h, so we need to declare strcasecmp()
differently.
Unixware 2 needs to link with libresolv.
PR: 148
2002-07-18 07:47:49 +00:00
Richard Levitte
4f0e09aa67 OPENSSL_SYS_WIN32 is important so util/mkdef.pl can detect it 2002-07-18 06:34:39 +00:00
Richard Levitte
e921bbf9f6 Make mkdir failsafe in case the directories are already present 2002-07-17 13:33:12 +00:00
Richard Levitte
205a4a9571 Add support for shared libraries with OS/2.
PR: 124
2002-07-17 13:28:29 +00:00
Richard Levitte
44279d4638 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:34 +00:00
Richard Levitte
9f1c3d7392 If OpenSSL is built with shared library support on MacOS X,
everything works fine.  Note: this is only true for 0.9.7 and on
2002-07-17 11:16:26 +00:00
Richard Levitte
362be34a2f On MacOS X, the shared library editor uses DYLD_LIBRARY_PATH 2002-07-17 11:09:59 +00:00
Richard Levitte
ec7f13d375 On MacOS X, you're not allowed to have common objects in shared libraries 2002-07-17 08:20:56 +00:00
Richard Levitte
ec27c2ac97 Add the usually recommended solution to the linking problem entry for MacOS X 2002-07-17 07:48:50 +00:00
Richard Levitte
b97c854e15 We had some experimental options in the Darwin entries. They are no longer needed 2002-07-16 11:07:49 +00:00
Richard Levitte
bdbbf930aa The default C compiler on MacOS X doesn't like empty object files 2002-07-16 10:46:09 +00:00
Richard Levitte
5254b53e97 Add the new PROBLEMS section from HEAD 2002-07-16 10:38:53 +00:00
cvs2svn
8adc3e5db7 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-07-16 10:20:08 +00:00
Richard Levitte
4810644f65 For those wanting to build for several platforms with the same source
directory, making a separate directory tree with lots of symbolic links
seems to be the solution.  Unfortunately, Configure doesn't take appropriate
steps to support this solution (as in removing a file that's going to be
rewritten).  This change corrects that situation.  Now I just have to
find all other places where there's lack of support for this.
2002-07-16 09:18:25 +00:00
Richard Levitte
d24d873e17 For those wanting to build for several platforms with the same source
directory, making a separate directory tree with lots of symbolic links
seems to be the solution.  Unfortunatelt, Configure doesn't take appropriate
steps to support this solution (as in removing a file that's going to be
rewritten).  This change corrects that situation.  Now I just have to
find all other places where there's lack of support for this.
2002-07-16 08:53:14 +00:00
Richard Levitte
7728770623 Let's not forget the second -Wtraditional 2002-07-16 07:06:18 +00:00
Richard Levitte
279c36564f Using -Wtraditional took it a little far. After all, we expect ANSI C, so
we don't need to care about traditional compilers
2002-07-16 06:53:22 +00:00
Richard Levitte
50d1c3fd85 Set up the engine before doing anything random-related, since engine randomness
is only used for seeding and doing it in the wrong order will mean seeding
is done before the engine randomness is hooked in.
Notified by Frederic DONNAT <frederic.donnat@zencod.com>
2002-07-16 06:51:45 +00:00
Lutz Jänicke
ed712101ea Rewording: some algorithms are also patented in Europe, so choose more
defensive phrases...
Submitted by:
Reviewed by:
PR:
2002-07-12 15:27:01 +00:00
Richard Levitte
015eb65963 In UI_UTIL_read_pw(), we should look at the size parameter, not at BUFSIZ.
Submitted by Götz Babin-Ebell <babinebell@trustcenter.de>
2002-07-11 09:12:37 +00:00
Lutz Jänicke
afafa3e15c Discussion about Redhat's specialties for the FAQ.
Submitted by: John.Airey@rnib.org.uk
Reviewed by:
PR: 128
2002-07-10 19:47:55 +00:00
Lutz Jänicke
150f2d8d24 Typos in links between manual pages
Submitted by: Richard.Koenning@fujitsu-siemens.com
Reviewed by:
PR: 129
2002-07-10 19:34:47 +00:00
Lutz Jänicke
a6545f0566 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:51:14 +00:00
Lutz Jänicke
5fc041cca0 Minor typos
Submitted by: jufi@nerdnet.de
Reviewed by:
PR: 138
2002-07-10 17:33:55 +00:00
Bodo Möller
089cd046af remove obsolete comment 2002-07-10 08:38:34 +00:00
Lutz Jänicke
7e8852c549 Reorder inclusion of header files:
des_old.h redefines crypt:
#define crypt(b,s)\
	DES_crypt((b),(s))

This scheme leads to failure, if header files with the OS's true definition
of crypt() are processed _after_ des_old.h was processed. This is e.g. the
case on HP-UX with unistd.h.
As evp.h now again includes des.h (which includes des_old.h), this problem
only came up after this modification.
Solution: move header files (indirectly) including e_os.h before the header
files (indirectly) including evp.h.
Submitted by:
Reviewed by:
PR:
2002-07-10 06:57:54 +00:00
Lutz Jänicke
4064a85205 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:40:18 +00:00
Bodo Möller
3a9fef60a1 fix synopsis
Submitted by: Nils Larsch
2002-07-09 10:52:30 +00:00
Bodo Möller
be9419edf4 emtpy fragments are not necessary for SSL_eNULL
(but noone uses it anyway)

fix t1_enc.c: use OPENSSL_NO_RC4, not NO_RC4
2002-07-09 08:48:49 +00:00
Geoff Thorpe
a729d47d41 oops, there were other cases of "ENGINE_ID" to change too. 2002-07-08 15:06:39 +00:00
Geoff Thorpe
6abf827f25 Correct an error in the README.ENGINE file.
Submitted by: Jan Tschirschwitz <Jan.Tschirschwitz@cluster-labs.de>
2002-07-08 14:48:44 +00:00
Bodo Möller
5af9fcaf35 AES cipher suites are now official (RFC3268) 2002-07-04 08:50:33 +00:00
Lutz Jänicke
5736d40dad README and INSTALL should contain information about the request tracker
(noted by Jonathan Louie <jlouie@recourse.com>).
Submitted by:
Reviewed by:
PR:
2002-06-30 19:38:01 +00:00
Richard Levitte
0dfd83b9f4 Do not define crypt() on OpenBSD. Notified by Bob Beck of OpenBSD. 2002-06-29 22:04:16 +00:00
Richard Levitte
8e10dea8ec opensslconf.h doesn't define what we want, e_os2.h does.
PR 123
2002-06-27 17:20:16 +00:00
Richard Levitte
a69e8ea1a1 Try to avoid double declaration of ERR_load_PEM_strings().
PR 71
2002-06-27 17:06:41 +00:00
Richard Levitte
1f656724f6 A few changes to BC-32.pl didn't get properly applied.
This completes PR 123
2002-06-27 16:56:36 +00:00
Richard Levitte
ca55c617e5 Pass CFLAG to dependency makers, so non-standard system include paths are
handled properly.
Part of PR 75
2002-06-27 16:44:52 +00:00
Richard Levitte
9063e375e8 DJGPP has some needed header files that other MSDOS/Windows compilers don't have.
Part of PR 75
2002-06-27 16:32:15 +00:00
Richard Levitte
97c9760f61 Update the information on Cygwin.
Part of PR 75
2002-06-27 16:30:18 +00:00
Richard Levitte
df60710ea8 Forgot to change the second $ENV{DJDIR} to /dev/env/DJDIR.
Part of PR 75
2002-06-27 16:28:28 +00:00
Richard Levitte
5d2edd2659 The new stuff is for Borland Bulider 5, so document it appropriately 2002-06-27 15:11:08 +00:00
Richard Levitte
a558ae9496 Document the new way of building with Borland Builder.
This concludes the changes from PR 123
2002-06-27 15:07:43 +00:00
Richard Levitte
d58a949aae Use underscores instead of dashes in temporary file names.
This is due to weird Borland compilers.
Part of PR 123
2002-06-27 14:58:06 +00:00
Richard Levitte
00e608c89d When compiling for Windows, make sure we have the windows definitions declared.
Part of PR 123
2002-06-27 14:56:02 +00:00
Richard Levitte
b4dfd76a4c Use 32-bit sections instead of the default, 16-bit ones.
Part of PR 123
2002-06-27 14:54:39 +00:00
Richard Levitte
ea9a52d124 have 'openssl pkcs7' exit with code 1 on error instead of 0.
PR: 119
2002-06-27 10:26:52 +00:00
Richard Levitte
75cc5e05ad gcc requires -m64 to link 64-bit shared libraries on Solaris.
PR: 117
2002-06-27 10:19:54 +00:00
Richard Levitte
84ae14d754 Use bg instead of bag as argument to macros, to avoid clashes with
structure field names.
PR: 112
2002-06-27 09:54:14 +00:00
Richard Levitte
a9e897adc3 There is no RSAREF any more, so do not ty to install it.
PR: 106
2002-06-27 09:18:30 +00:00
Richard Levitte
fc0f3ad254 The general debug target must specify that it doesn't use assembler routines.
PR: 105
2002-06-27 09:13:11 +00:00
Richard Levitte
a1fbe27123 A number of includes were removed from evp.h some time ago. The reason
was that they weren't really needed any more for EVP itself.  However,
it seems like soma applications (I know about OpenSSH, but there may
be more) used evp.h as the 'load all' header file, which makes sense
since we try our best to promote the use of EVP instead of the lower
level crypto algorithms.  Therefore, I put the inclusions back so
the application authors don't get too shocked by all the errors they
would otherwise get.

Thanks to Theo de Raadt for making us aware of this.
2002-06-27 05:03:12 +00:00
Bodo Möller
1c45b1fef3 Make sure buffers are large enough even for weird parameters
Submitted by: Nils Larsch
2002-06-26 14:29:10 +00:00
Bodo Möller
e003386793 update an entry on EVP changes 2002-06-26 14:22:39 +00:00
Richard Levitte
a533b89c9f For some reason, we need to return the full path to perl 2002-06-25 11:41:25 +00:00
Geoff Thorpe
a2ffad81c8 Make sure any ENGINE control commands make local copies of string
pointers passed to them whenever necessary. Otherwise it is possible the
caller may have overwritten (or deallocated) the original string data
when a later ENGINE operation tries to use the stored values.

Submitted by: Götz Babin-Ebell <babinebell@trustcenter.de>
Reviewed by: Geoff Thorpe
PR: 98
2002-06-21 02:48:57 +00:00
Lutz Jänicke
081cdf3f63 <sys/select.h> is included for AIX, when USE_SOCKETS is defined.
Submitted by: Bernhard Simon <bs@bsws.zid.tuwien.ac.at>
Reviewed by:
PR:
2002-06-20 20:13:12 +00:00
Lutz Jänicke
dbf5b18a99 HP-UX: shared libraries MUST be +x and SHOULD be -w.
Submitted by:
Reviewed by:
PR:
2002-06-20 19:55:58 +00:00
Lutz Jänicke
0b3f7afaed 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:47:59 +00:00
Lutz Jänicke
d6e8f6ae2b AIX (V3) requires <sys/select.h> (included via e_os.h) for fd_set.
Submitted by: Bernhard Simon <bs@bsws.zid.tuwien.ac.at>
Reviewed by:
PR:
2002-06-20 17:31:12 +00:00
Geoff Thorpe
af629a19d7 This apparently fixes compilation on OSX that was failing in 0.9.7 betas.
Submitted by: Pieter Bowman <bowman@math.utah.edu>
2002-06-20 15:17:02 +00:00
Lutz Jänicke
9a3eaa1117 load_netscape_key is static.
Submitted by:
Reviewed by:
PR:
2002-06-18 17:44:01 +00:00
Bodo Möller
7a68e6aad1 always include <string.h> (we do this in various other header files,
so it can't be bad)

PR: 102
2002-06-18 09:35:29 +00:00
Bodo Möller
f27fa54388 typo 2002-06-17 13:59:36 +00:00
Lutz Jänicke
48acb9e08a Roll OpenSSL-0.9.7-beta2
Submitted by:
Reviewed by:
PR:
2002-06-16 11:27:44 +00:00
Lutz Jänicke
e5706ccbde 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:29:55 +00:00
Lutz Jänicke
9a82ef5255 OpenSSL_add_all_algorithms has been replaced by configuration dependent
functions and is redirected by macros. Switch it off now, possible removal
later.
Submitted by:
Reviewed by:
PR:
2002-06-16 10:16:42 +00:00
Dr. Stephen Henson
4a1dcb2d03 Make update 2002-06-15 12:29:28 +00:00
Lutz Jänicke
ef92312b41 Initial support for hpux64-parisc-gcc
Submitted by: ross.alexander@uk.neceur.com
Reviewed by:
PR: 96
2002-06-14 20:10:24 +00:00
Lutz Jänicke
4673461789 Some more prototype fixes.
Use DECLARE macros in asn1* instead of direct declaration.
Submitted by: Goetz Babin-Ebell <babinebell@trustcenter.de>
Reviewed by:
PR: 89
2002-06-14 18:59:53 +00:00
Bodo Möller
2f8275c52d New option SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS for disabling CBC
vulnerability workaround (included in SSL_OP_ALL).

PR: #90
2002-06-14 12:20:27 +00:00
Richard Levitte
39ebb51bba make update 2002-06-13 23:38:11 +00:00
Richard Levitte
d7227da9a8 Merge from HEAD. 2002-06-13 23:37:26 +00:00
Richard Levitte
ab805194a6 Tentatively add support for UWIN, a Unix-like environment on top of Windows.
PR: 62
2002-06-13 21:44:01 +00:00
Richard Levitte
4fac53a757 Make sure that any dash in the prefix before the version number is removed.
PR: 96
2002-06-13 21:11:57 +00:00
Richard Levitte
11198b78a2 Add support for DJGPP. 2002-06-13 20:44:38 +00:00
Richard Levitte
573a568dd0 Add support for DJGPP.
PR: 75
2002-06-13 20:40:49 +00:00
Richard Levitte
ff3dd00370 Check for the executable $openssl, not just the file.
Part of PR: 75
2002-06-13 19:59:26 +00:00
Richard Levitte
2028c2800a Parse directory using both slashes and backslashes as separators.
Do file copying in term of perl statements instead of using cp.
Part of PR: 75
2002-06-13 19:50:26 +00:00
Richard Levitte
fd8766b67e Making a softlink from crypto/des/asm/perlasm to crypto/perlasm isn't
strictly necessary, so let's not do that.
2002-06-13 19:42:06 +00:00
Lutz Jänicke
7d210e5194 Add missing prototypes.
Submitted by: Goetz Babin-Ebell <babinebell@trustcenter.de>
Reviewed by:
PR: 89
2002-06-13 17:38:58 +00:00
Dr. Stephen Henson
2e674fc611 Fix ext_dat.h extension ordering.
Reinstate -reqout code.

Avoid coredump in ocsp if setup_verify
fails.

Fix typo in ocsp usage message.
2002-06-13 12:54:52 +00:00
Lutz Jänicke
5cfd3419c6 Add OIDs for Secure Electronic Transactions (SET)
Submitted by: Vadim Fedukovich <vf@unity.net>
Reviewed by: Lutz Jaenicke
PR: 80
2002-06-13 11:51:31 +00:00
Lutz Jänicke
9efd4fb891 Clarify formulation (proposed by Bodo Moeller).
Submitted by:
Reviewed by:
PR:
2002-06-13 08:52:25 +00:00
Dr. Stephen Henson
b2e85f9d93 The new ASN1 code automatically allocates
structures for fields that are not OPTIONAL.

However in the AUTHORITY_INFO_ACCESS case
the 'location' field was set to NULL in
the old code.

So in 0.9.7+ we should free up the field before
overwriting it in v2i_AUTHORITY_INFO_ACCESS.
2002-06-13 00:43:59 +00:00
Lutz Jänicke
f10581829d Make change uniqueIdentifier -> x500UniqueIdentifier clearly visible.
Submitted by:
Reviewed by:
PR: 82
2002-06-12 20:42:04 +00:00
Lutz Jänicke
78af3b274f Correct wrong usage information.
Submitted by:
Reviewed by:
PR: 95
2002-06-12 20:14:04 +00:00
Lutz Jänicke
facd9a2024 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.
Submitted by:
Reviewed by:
PR:
2002-06-12 12:25:42 +00:00
Ben Laurie
461f00dd53 Handle read failures better. 2002-06-11 11:41:26 +00:00
Bodo Möller
22f03eaedf fix for 'make update' 2002-06-10 11:45:21 +00:00
Lutz Jänicke
d467c74954 Make sure that flags are passed to "make" subprocesses.
Submitted by:
Reviewed by:
PR:
2002-06-10 08:11:20 +00:00
Lutz Jänicke
c4c745ccb8 For the main directory, Makefile.org is significant :-)
Submitted by:
Reviewed by:
PR:
2002-06-06 10:19:33 +00:00
Lutz Jänicke
3b66e34e74 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.
Submitted by:
Reviewed by:
PR:
2002-06-06 10:14:16 +00:00
Lutz Jänicke
2250f475fc New OID for X509 usage: pseudonym
Submitted by: Michael Bell <michael.bell@rz.hu-berlin.de>
Reviewed by: Lutz Jaenicke
PR: 83
2002-06-06 07:30:45 +00:00
Richard Levitte
ed703912b2 Make perl replacement for dirname, for system that lack the latter.
PR: 81
2002-06-05 14:10:31 +00:00
Richard Levitte
2cddcd1dbb It's not good to have a pointer point at something in an inner block.
PR: 66
2002-06-05 13:47:15 +00:00
Richard Levitte
231360a3b7 Check errors when parsing a PKCS8INF PEM FILE, or there will be a core dump on error.
PR: 77
2002-06-05 11:58:23 +00:00
Richard Levitte
65ac3faff6 Documentation bug corrected.
PR: 70
2002-06-05 09:30:20 +00:00
Richard Levitte
778252741e Since there's no continuation, the ; can go as well :-) 2002-06-05 09:08:49 +00:00
Lutz Jänicke
96e40d97cc There is no continuation at this point.
Submitted by:
Reviewed by:
PR:
2002-06-05 07:56:14 +00:00
Lutz Jänicke
4b3743c85a On some systems the default "perl" may still be perl4, use the correct
version determined by "config" instead.
Submitted by:
Reviewed by:
PR:
2002-06-05 07:27:21 +00:00
Lutz Jänicke
5795665a7d The correct PERL interpreter is passed via commandline.
Submitted by:
Reviewed by:
PR:
2002-06-05 07:01:39 +00:00
Richard Levitte
88f1be140c Correct syntax in ssl-lib.com
maketests.com was missing the TCP/IP options TCPIP and NONE
2002-06-05 06:45:27 +00:00
Richard Levitte
fc16b228fd 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:41 +00:00
Richard Levitte
a5b2ccaaad make update (including adjusting libeay.num in HEAD to the changes in the
0.9.7-stable libeay.num
2002-06-04 22:32:17 +00:00
Lutz Jänicke
5dd352c916 Typo.
Submitted by:
Reviewed by:
PR: 72
2002-06-04 20:44:10 +00:00
Richard Levitte
3c204aaf50 use sstrsep() to get the proper type to aoti().
Remove unneeded cast in ustrsep().
PR: 69
2002-06-03 15:27:52 +00:00
Lutz Jänicke
3ae184d31f Ok, we are rolling 0.9.7-beta1 now.
Submitted by:
Reviewed by:
PR:
2002-06-01 15:21:55 +00:00
Ben Laurie
3e975124f3 Fix a warning. 2002-05-31 14:34:15 +00:00
Ben Laurie
74c467f9f2 Fix warnings. 2002-05-31 14:28:30 +00:00
Richard Levitte
1b97c938e9 Document the AES changes. 2002-05-31 13:16:37 +00:00
Richard Levitte
b3e2acac4e Add the AES test vectors from NIST document SP800-38A. 2002-05-31 13:13:51 +00:00
Richard Levitte
403fa0dc53 Make it possible to give vectors only for decryption or encryption. 2002-05-31 13:12:54 +00:00
Richard Levitte
f918c330a9 For CFB and OFB modes, always create the encryption key. 2002-05-31 13:11:48 +00:00
Richard Levitte
7f52f77efe Declare the CFB and OFB modes for AES, and prepare for a declaration
of CTR mode.
2002-05-31 13:10:24 +00:00
Richard Levitte
90b480f2af In CFB mode, the iv is always encrypted. 2002-05-31 13:07:45 +00:00
Richard Levitte
578c33c010 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:06:52 +00:00
Richard Levitte
d6a821b9d7 Support the newly release gcc 3.1 on 64-bit Solaris. Not automatic.
PR: 57
2002-05-30 17:28:23 +00:00
Richard Levitte
7d8b5c530f Support shared libraries properly on linux-sparcv[89].
PR: 60
2002-05-30 17:07:55 +00:00
Richard Levitte
2033da0b23 a B< that wasn't properly ended. 2002-05-30 16:55:31 +00:00
Richard Levitte
c4ac954c59 Check the return values where memory allocation failures may happen.
PR: 49
2002-05-30 16:50:38 +00:00
Richard Levitte
2640aec227 CAformat should not be used for CA key format. 2002-05-30 16:24:26 +00:00
Richard Levitte
a1037ce3bc Make sure that MS_STATIC isn't defined to 'static' under Win32.
PR: 51
2002-05-30 15:45:02 +00:00
Richard Levitte
249737e53d pod2man.pl would only remove the first LF from the name. 2002-05-30 15:30:21 +00:00
Richard Levitte
c70573dee1 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:07 +00:00
Richard Levitte
6c98ed520d Correct AES counter mode, which incorrectly incremented the counter before
using it.
PR: 56
2002-05-30 14:06:17 +00:00
Richard Levitte
37ceea7333 Correct darwin shared library support.
PR: 39
2002-05-30 12:16:51 +00:00
Richard Levitte
374b227226 Some shlib extensions were in the wrong field 2002-05-30 10:47:52 +00:00
Richard Levitte
8c4a5016ce Our copy of pod2man.pl is old and comparatively broken, so lets remove it.
PR: 30
2002-05-30 10:18:23 +00:00
Richard Levitte
1056275825 Add more warnings for my debug targets. 2002-05-30 09:39:19 +00:00
Richard Levitte
9634acedaf Remove the duplicate description of -out.
PR: 28
2002-05-30 06:24:46 +00:00
Dr. Stephen Henson
3a4b0bed49 Make i2c_ASN1_BIT_STRING return the correct length. 2002-05-29 23:11:55 +00:00
Richard Levitte
84f4e33ea3 Set DLOPEN_FLAG the same way on NetBSD as on OpenBSD.
PR: 58, submitted by andrew@cis.uoguelph.ca
2002-05-29 21:00:33 +00:00
Richard Levitte
b093ef7445 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:45 +00:00
Lutz Jänicke
405ac901c9 Remove item listed twice <kromJx@crosswinds.net>.
Submitted by:
Reviewed by:
PR:
2002-05-28 17:48:12 +00:00
Ulf Möller
721ccb6cf5 as in main branch 2002-05-27 19:54:41 +00:00
Bodo Möller
ba05727773 Change as in main branch:
Use assembler implementations with Cygwin.
This also fixes the bn_sub_part_word problem.
2002-05-24 20:41:07 +00:00
Richard Levitte
f9332da521 Recover from errors 2002-05-23 23:32:30 +00:00
Richard Levitte
156516ce44 Avoid loops when linking doesn't work 2002-05-23 15:27:21 +00:00
Richard Levitte
157e44a799 Forgot this file. 2002-05-23 15:25:27 +00:00
Richard Levitte
7d2ff3f081 Allow the use of the TCP/IP stack keyword TCPIP and NONE 2002-05-22 11:37:02 +00:00
Richard Levitte
25a87e82d4 Use OPENSSL_SYS_VMS instead of just VMS 2002-05-22 11:35:41 +00:00
Richard Levitte
e400753ed8 Update copyright years.
This has already been applied in the main branch.
2002-05-22 07:58:02 +00:00
Richard Levitte
0984fcf118 Use 0 instead of NULL when casting to function pointers, to avoid
warnings from compilers when NULL is defined as '((void *)0)'.
This has already been applied in the main branch.
2002-05-22 07:56:38 +00:00
Richard Levitte
18cc99ac17 Remove warnings about uninitialised variables.
This has already been applied in the main branch.
2002-05-22 07:55:03 +00:00
Richard Levitte
1522c23470 Remove warnings about unused symbols when configured with no-rsa. 2002-05-22 07:53:53 +00:00
Richard Levitte
2341e303da This file was removed long ago. Why it's still in this branch is a
mystery to me.
2002-05-22 07:49:37 +00:00
Bodo Möller
dca142029c accept NULL in 'free' functions 2002-05-21 09:00:54 +00:00
Dr. Stephen Henson
7448f5e5ed Reorganise -subj option code, fix buffer overrun. 2002-05-19 16:32:21 +00:00
Dr. Stephen Henson
45caf9c50c Fix Mingw32 asm build: use the Unix
bignum assembly method of bn-586.pl
and co-586.pl which (for some reason)
VC++ doesn't use.
2002-05-19 12:00:46 +00:00
Dr. Stephen Henson
ace2ca484b Add missing EVP_CIPHER_CTX_init call. 2002-05-18 23:42:20 +00:00
Lutz Jänicke
7dc584ed91 Fix incorrect =over 4 location.
Submitted by: David Waitzman <djw@bbn.com>
Reviewed by: Lutz Jaenicke
PR: [openssl.org #38]
2002-05-16 17:44:50 +00:00
Bodo Möller
855f0b4f2f fix EVP_dsa_sha macro
Submitted by: Nils Larsch
2002-05-16 12:53:34 +00:00
Lutz Jänicke
2bf30d6b47 Use the indirect way to the actual request tracker, so that people
also are informed about the credentials required for guest access
and the operation instructions.
Submitted by:
Reviewed by:
PR:
2002-05-16 10:00:16 +00:00
Bodo Möller
685e7d7225 update 2002-05-16 09:31:27 +00:00
Dr. Stephen Henson
38dbcb2248 Oops, forgot CHANGES entry and description:
Allow reuse of cipher contexts by removing
automatic cleanup in EVP_*Final().
2002-05-15 18:23:07 +00:00
Dr. Stephen Henson
bb3a69f801 Zero cipher_data in EVP_CIPHER_CTX_cleanup
Add cleanup calls to evp_test.c
2002-05-15 17:52:19 +00:00
Bodo Möller
55db40d3e0 make b_print.c consistent with the rest of OpenSSL:
disable assert() except for debug builds
2002-05-14 19:03:12 +00:00
Bodo Möller
f1fbf15116 apply mingw32 patches from main branch 2002-05-14 17:19:26 +00:00
Lutz Jänicke
9bdbdda261 Add missing '"'
Submitted by: Boyd Gerber <gerberb@zenez.com>
Reviewed by:
PR:
2002-05-12 20:36:49 +00:00
Lutz Jänicke
ad2057500a Recognize PPC64 target.
Submitted by:
Reviewed by:
PR: 26
2002-05-12 19:44:19 +00:00
Dr. Stephen Henson
d0e3726ca4 EVP_SealFinal should return a value. 2002-05-11 17:33:01 +00:00
Dr. Stephen Henson
75a46764e5 closedir is not used on Win32. 2002-05-11 12:42:23 +00:00
Dr. Stephen Henson
4eceda658b Add config entry debug-steve-linux-pseudo64. This sets the
SIXTY_FOUR bignum library option to use 64 bit operations
on the 32 bit linux platform.

This is very inefficient but it can be used to test some
of the 64 bit logic on a 32 bit platform.
2002-05-10 22:57:29 +00:00
Dr. Stephen Henson
1c511bdb7c Fallback to normal multiply if n2 == 8 and dna or dnb is not zero
in bn_mul_recursive.

This is (hopefully) what was triggering bignum errors on 64 bit
platforms and causing the BN_mod_mul test to fail.
2002-05-10 22:22:55 +00:00
Dr. Stephen Henson
f9bd76e4f7 Avoid gcc warning: BN_DEC_CONV when SIXTY_FOUR_BIT is defined is unsigned. 2002-05-10 22:08:22 +00:00
Richard Levitte
e74e0dedcd Updating status for 0.9.6d 2002-05-09 23:53:35 +00:00
Richard Levitte
dcf6eb2a9e Synchronise the FAQ 2002-05-09 23:41:51 +00:00
Richard Levitte
7d2980f09e 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:50 +00:00
Richard Levitte
f1fe6fa6e4 One place where VMS wasn't changed to OPENSSL_SYS_VMS... 2002-05-09 18:27:56 +00:00
Richard Levitte
ecb7a9c73a 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:45 +00:00
Richard Levitte
aebe0396e9 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:33 +00:00
Ben Laurie
4e9a77cf26 Fix warning. 2002-05-08 15:13:24 +00:00
Richard Levitte
14ef32631c Generate an error if rewinding wasn't possible.
Notified by Ken Hirsch <kenhirsch@myself.com>.
PR: 23
2002-05-08 15:12:49 +00:00
Lutz Jänicke
500f07c8de Add missing ";" after fi
Submitted by: bryanh@giraffe-data.com
Reviewed by:
PR: [openssl.org #18]
2002-05-07 15:35:09 +00:00
Bodo Möller
ae936dae90 Fix ciphersuite list to enforce low priority for RC4. 2002-05-07 08:36:01 +00:00
Bodo Möller
67166dc05c ensure that, for each strength, RC4 ciphers have least preference
in the default ciphersuite list
2002-05-07 07:59:05 +00:00
Bodo Möller
aa9fed8cc2 refer to latest draft for AES ciphersuites 2002-05-07 07:56:09 +00:00
Bodo Möller
442eb8a4c3 fix warning 2002-05-06 10:44:08 +00:00
Bodo Möller
46805f696d update 2002-05-05 23:48:51 +00:00
Bodo Möller
29f6a99432 disable AES ciphersuites unless explicitly requested 2002-05-05 23:47:09 +00:00
Bodo Möller
1f13793b1a fix casts 2002-05-05 23:01:02 +00:00
Richard Levitte
08130eb158 Make sure that date is run under the C locale, so dates are given in the
default format.
PR: 16
2002-05-02 08:05:52 +00:00
Dr. Stephen Henson
b27dfeacc9 Add apps_startup and bio_err init code to smime.c 2002-05-01 20:06:24 +00:00
Lutz Jänicke
fb0f53b2e0 Fix escaping when using the -subj option of "openssl req", document
'hidden' -nameopt support. (Robert Joop <joop@fokus.gmd.de>)
Submitted by:
Reviewed by:
PR: #2
2002-04-30 12:10:10 +00:00
Lutz Jänicke
baa521bef5 Add information about -nameopt option for x509.
Submitted by:
Reviewed by:
PR:
2002-04-29 16:02:38 +00:00
Bodo Möller
7bcf65a125 undo nonsense patch (r *is* signed or we have signedness mismatches elsewhere) 2002-04-29 11:03:38 +00:00
Richard Levitte
306009bb6a Fix unsigned vs. signed clash 2002-04-29 10:30:34 +00:00
Bodo Möller
dfc5336975 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:29:18 +00:00
Lutz Jänicke
4cea95a547 Added generationQualifier OID (proposed by Fiel Cabral).
Submitted by:
Reviewed by:
PR:
2002-04-25 18:00:13 +00:00
Richard Levitte
b23b3272dc Potential memory leak removed. Notified by <threaded@totalise.co.uk> 2002-04-25 10:11:08 +00:00
Bodo Möller
1696aa1891 new items for 0.9.7 2002-04-25 07:51:51 +00:00
Bodo Möller
52407725c9 oops 2002-04-25 07:46:55 +00:00
Bodo Möller
81da3c3319 AlgorithmIdentifier bugs 2002-04-25 06:29:31 +00:00
Bodo Möller
7729bc2634 fix usage (no 'key') 2002-04-23 13:55:56 +00:00
Richard Levitte
69a305d434 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:27 +00:00
Lutz Jänicke
ab5b1cf86b ERR_file_name is no longer being used.
Submitted by:
Reviewed by:
PR:
2002-04-22 13:55:37 +00:00
Lutz Jänicke
c33387749b Add cygwin build script (Corinna Vinschen <vinschen@redhat.com>).
Submitted by:
Reviewed by:
PR:
2002-04-21 17:54:53 +00:00
cvs2svn
c9ca65b469 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-04-21 17:54:06 +00:00
Richard Levitte
8e078f45e0 Make sure ec is properly handled in Windows. 2002-04-20 10:25:19 +00:00
Richard Levitte
f84ffd0130 Make sure the opened directory is closed on exit.
Notified by Lorinczy Zsigmond <lzsiga@mail.ahiv.hu>
2002-04-18 16:20:21 +00:00
Lutz Jänicke
300e3d7c73 Missing "Configure" entry (Jean-Marc Desperrier <jean-marc.desperrier@certplus.com>).
Submitted by:
Reviewed by:
PR:
2002-04-18 12:46:41 +00:00
Lutz Jänicke
365c6e4661 Optimize: better shortcut evaluation ("Howard Chu" <hyc@highlandsun.com>).
Submitted by:
Reviewed by:
PR:
2002-04-18 11:53:35 +00:00
Lutz Jänicke
1dc03ef706 Handle headings uniformly to allow automatic processing.
Submitted by:
Reviewed by:
PR:
2002-04-18 08:09:59 +00:00
Bodo Möller
d4a67e3186 check return values
Submitted by: Nils Larsch
2002-04-17 09:31:02 +00:00
Lutz Jänicke
18e10315e5 Document OID changes.
Submitted by:
Reviewed by:
PR:
2002-04-15 14:17:20 +00:00
Lutz Jänicke
e9caaa4ad9 Use the "mail" short name according to RFC2798 (Michael Bell
<michael.bell@rz.hu-berlin.de>).
Submitted by:
Reviewed by:
PR:
2002-04-15 13:28:53 +00:00
Lutz Jänicke
a6198b9ed1 Some more OID enhancements.
Submitted by:
Reviewed by:
PR:
2002-04-15 10:38:37 +00:00
Lutz Jänicke
a7be294ed7 Fix CRLF problem in BASE64 decode.
Submitted by:
Reviewed by:
PR:
2002-04-15 09:53:47 +00:00
Bodo Möller
617f461c9d remove disabled code 2002-04-14 13:28:41 +00:00
Bodo Möller
1dcb6c994f fix length field we create when converting SSL 2.0 format into SSL 3.0/TLS 1.0 format
(the bug was introduced with message callback support)
2002-04-14 13:04:58 +00:00
Bodo Möller
a9ab63c01c 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:51:26 +00:00
Bodo Möller
f89db4020f error reported by Karsten Braaten 2002-04-13 22:06:25 +00:00
Richard Levitte
393c09659e Avoid emacs backup files when making a snapshot 2002-04-13 12:28:49 +00:00
Bodo Möller
2d96549cd0 looks like a typo 2002-04-12 13:51:42 +00:00
Bodo Möller
b48892d403 synchronize with main branch 2002-04-12 13:46:46 +00:00
Richard Levitte
7b907f0bb5 Check error code from a2d_ASN1_OBJECT(). 2002-04-11 22:14:10 +00:00
Richard Levitte
9dfcad117c Change the date to XX xxx XXXX in development versions. 2002-04-11 21:53:57 +00:00
Lutz Jänicke
7018feed88 Compile NEWS from CHANGES.
Submitted by:
Reviewed by:
PR:
2002-04-11 18:43:01 +00:00
Lutz Jänicke
9be529f12d In preparation of 0.9.7: re-order changelog, so that the changes
are listed as of ... -> 0.9.6c -> 0.9.6d -> 0.9.7
Submitted by:
Reviewed by:
PR:
2002-04-10 19:50:23 +00:00
Lutz Jänicke
f5e5277908 Keep my own specially optimized HP-UX shared library building up to date.
Submitted by:
Reviewed by:
PR:
2002-04-10 12:34:32 +00:00
Bodo Möller
c991c6e710 error reported by Karsten Braaten 2002-04-09 13:04:00 +00:00
Bodo Möller
e1f4319279 harmonize capitalization 2002-04-09 12:42:15 +00:00
Bodo Möller
2826fcc851 add usage examples 2002-04-09 11:53:51 +00:00
Richard Levitte
37562f753a Allow longer program names (VMS allows up to 39 characters).
Submitted by Compaq.
2002-04-06 20:22:40 +00:00
Richard Levitte
248252682c make update 2002-04-06 19:15:27 +00:00
Richard Levitte
cc3586028e Allow longer program names (VMS allows up to 39 characters).
Submitted by Compaq.
2002-04-06 18:59:57 +00:00
Richard Levitte
f60df86c89 Oops, the system macro for VMS is OPENSSL_SYS_VMS, not VMS 2002-04-06 11:57:58 +00:00
Richard Levitte
bc7a3a9e99 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:13 +00:00
Richard Levitte
d3cbf7d86a 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:45 +00:00
Richard Levitte
313bf45e42 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:25 +00:00
Lutz Jänicke
ce34d0ac09 Fix buggy object definitions (Svenning Sorensen <sss@sss.dnsalias.net>).
Submitted by:
Reviewed by:
PR:
2002-04-04 17:49:39 +00:00
Richard Levitte
4e9dd6b0f5 Forgot one of the casts 2002-04-03 15:02:00 +00:00
Richard Levitte
b6ccbffe2b Cast the pointers to the BIGNUM data to unsigned long *. This would be
harmful if we didn't also pass the exact number of bytes of that data
2002-04-03 14:47:50 +00:00
Richard Levitte
1aecc34e9e 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:43 +00:00
Lutz Jänicke
75b9c0044c Make short names of objects RFC2256-compliant.
Submitted by:
Reviewed by:
PR:
2002-03-26 17:15:32 +00:00
Richard Levitte
600b77a93f Add the possibility to enable olde des support, not just disable it, for future support. Redocument 2002-03-26 14:26:08 +00:00
Richard Levitte
39335c356b Add the mapping of des_random_seed() for 0.9.6 compatibility.
Make sure DES_cblock is defined at all times (meaning one shouldn't include
openssl/des_old.h directly any more).
2002-03-26 13:58:30 +00:00
Richard Levitte
a3c62bb737 Correct the mapping for des_read_pw() 2002-03-26 13:54:04 +00:00
Bodo Möller
2f6263a696 fix memory leak
Submitted by: Nils Larsch
2002-03-25 23:17:35 +00:00
Bodo Möller
35748f40d6 add missing declaration
Submitted by: Nils Larsch
2002-03-25 23:14:50 +00:00
Lutz Jänicke
ed62478192 Fix typo (Craig Davison <cd@securityfocus.com>).
Submitted by:
Reviewed by:
PR:
2002-03-25 17:11:25 +00:00
Bodo Möller
9e7733a743 fix conditational compilation for OPENSSL_NO_... 2002-03-22 11:02:45 +00:00
Richard Levitte
fc0bdd1aa8 Key schedules are given as arguments a bit differently in 0.9.6 and
earlier.  Also, it was an error to define crypt() at all times.
2002-03-22 10:46:13 +00:00
Richard Levitte
e9dad4048f Key schedules are given as arguments a bit differently in 0.9.6 and
earlier.  Also, a few 0.9.6 functions were missing their mappings.
2002-03-22 10:29:56 +00:00
Richard Levitte
ddba94214f Use the more modern DES API in the openssl subcommands. 2002-03-22 02:36:58 +00:00
Richard Levitte
e9f970891d Change des_old.h so OpenSSL 0.9.6 compatibility is default. One must
define OPENSSL_DES_LIBDES_COMPATIBILITY to get libdes compatibility.
At the same time, correct a couple of argument errors for the cfb
encryption routines.

Make destest use as much of the old API as possible, to make sure it
works properly.  Other tests will use the new API...
2002-03-22 02:33:24 +00:00
Lutz Jänicke
a89cf50c59 Fix buggy if-condition (thomas poindessous <poinde_t@epita.fr>).
Submitted by:
Reviewed by:
PR:
2002-03-21 19:17:06 +00:00
Lutz Jänicke
f90c544039 Remove superflous statement <justin.fletcher@ntlworld.com>.
Submitted by:
Reviewed by:
PR:
2002-03-21 19:10:07 +00:00
Bodo Möller
afcf54a5c9 fix DH_generate_parameters for general 'generator' 2002-03-20 16:02:46 +00:00
Lutz Jänicke
3671e38af4 Map new X509 verification errors to alert codes (Tom Wu <tom@arcot.com>).
Submitted by:
Reviewed by:
PR:
2002-03-19 16:44:26 +00:00
Dr. Stephen Henson
4fc3946111 Initialize ciph_ctx in kssl.c 2002-03-19 01:27:10 +00:00
Dr. Stephen Henson
59a941e4a4 Ensure EVP_CipherInit() uses the correct encode/decode parameter if
enc == -1

[Reported by Markus Friedl <markus@openbsd.org>]

Fix typo in dh_lib.c (use of DSAerr instead of DHerr).
2002-03-16 23:19:25 +00:00
Bodo Möller
a7cd5f3f38 Rename 'cray-t90-cc' into 'cray-j90'.
Add to 'config'.
2002-03-15 16:47:51 +00:00
Bodo Möller
0bdbc5a86e fix ssl3_pending 2002-03-15 10:52:03 +00:00
Lutz Jänicke
abecef77cf Add missing strength classification.
Submitted by:
Reviewed by:
PR:
2002-03-14 18:47:51 +00:00
Dr. Stephen Henson
b74dfe6e8e Initialize cipher context in KRB5
("D. Russell" <russelld@aol.net>)

Allow HMAC functions to use an alternative ENGINE.
2002-03-14 18:16:49 +00:00
Bodo Möller
d80f6e0f8c Fixes for 'no-hw' combined with 'no-SOME_CIPHER'.
Fix dsaparam usage output.

Submitted by: Nils Larsch (for 0.9.8-dev; backported to 0.9.7-dev)
2002-03-14 09:53:30 +00:00
Bodo Möller
13962f0b15 use BIO_nwrite() more properly 2002-03-14 09:48:32 +00:00
Bodo Möller
2fc1f3dd48 disable '#ifdef DEBUG' code 2002-03-14 09:35:15 +00:00
Dr. Stephen Henson
f2cbb15468 Undo previous patch: avoid warnings by #undef'ing
duplicate definitions.

Suggested by "Kenneth R. Robinette" <support@securenetterm.com>
2002-03-13 13:58:33 +00:00
Dr. Stephen Henson
e38e8b29f8 Fix Kerberos warnings with VC++. 2002-03-12 19:38:16 +00:00
Dr. Stephen Henson
c03ceadfbd Fix ASN1 additions for KRB5 2002-03-12 13:33:20 +00:00
Dr. Stephen Henson
e50baf58ab Fix various warnings when compiling with KRB5 code. 2002-03-12 03:00:59 +00:00
Bodo Möller
1750ec5c52 asm/mips3.o problems 2002-03-11 09:35:33 +00:00
Dr. Stephen Henson
c77bd28775 Make ciphers and digests obtain an ENGINE functional reference
if impl is explicitly supplied.
2002-03-09 18:56:38 +00:00
Dr. Stephen Henson
1619add90c Make {RSA,DSA,DH}_new_method obtain and release an ENGINE
functional reference.
2002-03-09 18:24:14 +00:00
Dr. Stephen Henson
a1a4e8b6bb typo 2002-03-08 19:12:38 +00:00
Dr. Stephen Henson
25f350a058 Fix the Win32_rename() function so it correctly
returns an error code. Use the same code in Win9X
and NT.

Fix some ca.c options so they work under Win32:
unlink/rename wont work under Win32 unless the file
is closed.
2002-03-08 19:06:36 +00:00
Richard Levitte
121cb9ee38 Synchronise the AEP engine in all branches. For 0.9.6-stable [engine], implement software fallback 2002-03-07 19:39:19 +00:00
Richard Levitte
bc173b9fb0 When closing, do not use close(). Also, if the closing call fails, do
not return immediately since that leaves a locked lock.
2002-03-07 17:13:49 +00:00
Richard Levitte
4fd9c70f06 Change des_old.c to use types prefixed with _ossl_old_des_. 2002-03-07 15:38:40 +00:00
Ben Laurie
91aeab0de3 ADH-DES-CBC-SHA should be LOW. 2002-03-06 16:59:12 +00:00
Dr. Stephen Henson
c913cf446f ENGINE module additions.
Add "init" command to control ENGINE
initialization.

Call ENGINE_finish on initialized ENGINEs on exit.

Reorder shutdown in apps.c: modules should be shut
down first.

Add test private key loader to openssl ENGINE: this
just loads a private key in PEM format.

Fix print format for dh length parameter.
2002-03-06 14:09:46 +00:00
Richard Levitte
a88f39457b OpenSSL currently fails on certain pure 64-bit architectures. This is a showstopper 2002-03-06 06:25:21 +00:00
Bodo Möller
2bbaab4a24 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:13 +00:00
Bodo Möller
1a8f4b57a9 fix printf call 2002-03-05 15:05:17 +00:00
Bodo Möller
022b31a8c8 typo 2002-03-05 15:03:16 +00:00
Dr. Stephen Henson
dd6b494eb3 Make sure the type accessed by the LONG and ZLONG ASN1 type
is really a long, to avoid problems on platforms where
sizeof(int) != sizeof(long).
2002-03-05 13:49:27 +00:00
Richard Levitte
c9bea5bad3 Provide a pre 0.9.7 compatibility mapping if
OPENSSL_DES_PRE_0_9_7_COMPATIBILITY is defined.  NOT AT ALL TESTED YET!
Add a comment as to the libdes compatibility.
2002-03-05 11:25:46 +00:00
Richard Levitte
296324ea03 New configuration targets for OpenBSD, handed to me by Bob Beck <beck@openbsd.org> 2002-03-05 09:43:09 +00:00
Bodo Möller
fa41e86a28 '#if OPENSSL_VERSION_NUMBER >= ...' to document the recent change 2002-03-05 09:06:57 +00:00
Richard Levitte
9e77b7075a A dash was missing in this branch as well. 2002-03-04 18:09:10 +00:00
Richard Levitte
5c7f9a627f Rename des_SPtrans to DES_SPtrans to differentiate from libdes and avoid certain linkage clashes. 2002-03-04 16:08:53 +00:00
Richard Levitte
bc3e3472c1 Make it so one can select tests from within the test directory 2002-03-04 15:59:05 +00:00
Dr. Stephen Henson
66bd86e2c2 Fix warnings about signed/unsigned mismatch and global
shadowing (random, index) in hw_4758.c
2002-03-03 17:07:27 +00:00
Ben Laurie
487fe20490 OpenBSD variant. 2002-03-01 15:39:29 +00:00
Richard Levitte
80d9b1ccd7 Remove the perl/ subdirectory. It hasn't been worked on for ages, is
very broken, and there are working modules in CPAN, which makes our
module even more moot.
2002-02-28 22:06:26 +00:00
Richard Levitte
69c48301e0 make update 2002-02-28 20:28:23 +00:00
Bodo Möller
2be9b88135 use ERR_peek_last_error() instead of ERR_peek_error() 2002-02-28 14:10:13 +00:00
Bodo Möller
98fa4fce09 use ERR_peek_last_error() instead of ERR_peek_error() to ignore
any other errors that may be left in the error queue

Submitted by: Jeffrey Altman
2002-02-28 14:03:41 +00:00
Richard Levitte
1ec1d17e16 VMS addaptation, including a few more long names that needed hacking. 2002-02-28 13:18:47 +00:00
Richard Levitte
1e11df0dc3 Make sure aep_close_connection() is declared and has a prototype that's
consistent with the rest of the AEP functions
2002-02-28 12:59:03 +00:00
Richard Levitte
421d474332 Increase internal security when using strncpy, by making sure the resulting string is NUL-terminated 2002-02-28 12:44:05 +00:00
Richard Levitte
58060fa11b Updated AEP engine, submitted by Diarmuid O'Neill <Diarmuid.ONeill@aep.ie> 2002-02-28 11:37:35 +00:00
Richard Levitte
cea698f19c Document the added modes for AES 2002-02-28 11:30:42 +00:00
Bodo Möller
48781ef7f7 Add 'void *' argument to app_verify_callback.
Submitted by: D. K. Smetters <smetters@parc.xerox.com>
Reviewed by: Bodo Moeller
2002-02-28 10:55:52 +00:00
Geoff Thorpe
6d1a837df7 This adds a new ENGINE to support IBM 4758 cards, contributed by Maurice
Gittens.
2002-02-27 22:45:48 +00:00
Lutz Jänicke
21f422ca5e Fix the fix (Yoram Zahavi)...
Submitted by:
Reviewed by:
PR:
2002-02-27 11:24:39 +00:00
Lutz Jänicke
291ae60b52 SSL_clear != SSL_free/SSL_new
Submitted by:
Reviewed by:
PR:
2002-02-27 08:10:12 +00:00
Lutz Jänicke
3b79d2789d Make sure that bad sessions are removed in SSL_clear() (found by
Yoram Zahavi).
Submitted by:
Reviewed by:
PR:
2002-02-26 21:44:07 +00:00
Dr. Stephen Henson
bb9dcc99cf Always init ctx_tmp in PKCS7_dataFinal since it is always cleaned up. 2002-02-26 19:32:16 +00:00
Richard Levitte
3d59821134 make update 2002-02-26 14:37:25 +00:00
Dr. Stephen Henson
cae111287b Fix new -aes command argument handling 2002-02-26 13:45:19 +00:00
Dr. Stephen Henson
e36e473859 Make the engine config module always add dynamic ENGINEs
to the list using dynamic_path. This stops ENGINEs which
don't supply any default algorithms being automatically
freed (because they have no references) and allows them
to be accessed by id.

Alternative dynamic loading behaviour can be achieved by
issuing the dynamic ENGINE ctrls separately in the config file.
2002-02-24 16:22:20 +00:00
Dr. Stephen Henson
d7fb66aa82 Remove old comment 2002-02-23 13:43:07 +00:00
Dr. Stephen Henson
344b3b5ce1 OPENSSL_LOAD_CONF define as in main trunk 2002-02-23 02:09:29 +00:00
Dr. Stephen Henson
3f7cf29124 Update from main branch. 2002-02-23 01:47:59 +00:00
cvs2svn
63dc69fef6 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-02-23 01:00:45 +00:00
Dr. Stephen Henson
cfe1c195c4 non-Monolith fixes.
Submitted by Andrew W. Gray <agray@iconsinc.com>
2002-02-22 21:27:47 +00:00
Dr. Stephen Henson
0cd8572b2d Config code updates.
CONF_modules_unload() now calls CONF_modules_finish()
automatically.

Default use of section openssl_conf moved to
CONF_modules_load()

Load config file in several openssl utilities.

Most utilities now load modules from the config file,
though in a few (such as version) this isn't done
because it couldn't be used for anything.

In the case of ca and req the config file used is
the same as the utility itself: that is the -config
command line option can be used to specify an
alternative file.
2002-02-22 13:58:15 +00:00
Richard Levitte
7c2831ac90 We have AES support in openssl speed 2002-02-21 17:23:08 +00:00
Bodo Möller
de603b75fc disable '#ifdef DEBUG' sections 2002-02-21 14:08:47 +00:00
Bodo Möller
1244be2eda disable '#ifdef DEBUG' sections 2002-02-21 13:00:45 +00:00
Richard Levitte
9f0a373b51 Add AES support in the applications that support -des and -des3. 2002-02-20 18:04:17 +00:00
Richard Levitte
b0701709c1 Add comfy aliases for AES in CBC mode. 2002-02-20 18:00:23 +00:00
Richard Levitte
34aa216a65 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:56:01 +00:00
Richard Levitte
a76a29f233 Merge in recent changes from the main trunk. 2002-02-20 17:53:17 +00:00
Richard Levitte
4e06ab75e8 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:40:33 +00:00
Richard Levitte
26147fb954 Merge in recent changes from the main trunk. 2002-02-20 13:20:32 +00:00
Richard Levitte
bd53a054b1 Merg in recent changes from the main trunk. 2002-02-20 12:28:32 +00:00
Bodo Möller
211b8685d3 bugfix: allocate sufficiently large buffer
Submitted by: Nils Larsch
2002-02-20 11:58:17 +00:00
Dr. Stephen Henson
9c75b2d931 Use default openssl.cnf if config filename set to NULL and
openssl_conf if appname NULL.
2002-02-19 23:25:18 +00:00
Richard Levitte
54d11e6057 Merge in Cygwin-related changes from main trunk. 2002-02-16 22:44:30 +00:00
Richard Levitte
3d7ba69a05 The AES modes OFB and CFB are defined with 128 feedback bits. This
deviates from the "standard" 64 bits of feedback that all other
algorithms are using.  Therefore, let's redo certain EVP macros to
accept different amounts of feedback bits for these modes.

Also, change e_aes.c to provide all usually available modes for AES.
CTR isn't included yet.
2002-02-16 12:39:58 +00:00
Richard Levitte
58133d22a8 Add the modes OFB128, CFB128 and CTR128 to AES.
Submitted by Stephen Sprunk <stephen@sprunk.org>
2002-02-16 12:21:43 +00:00
cvs2svn
330e5c5460 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-02-16 12:20:35 +00:00
Richard Levitte
ab519c8262 Adjust the NID names for the AES modes OFB and CFB to contain the number
of feedback bits
2002-02-16 12:16:43 +00:00
Richard Levitte
65f29a78b2 Give the linux-sparv9 target shared capability.
Submitted by Ian Marsh <mushypea@dominion.net.uk>
2002-02-15 16:23:50 +00:00
Bodo Möller
c363b5a62f constify 2002-02-15 10:19:22 +00:00
Bodo Möller
60ed0f94ed mention EC library 2002-02-15 10:12:01 +00:00
Lutz Jänicke
f38f8d94a9 Even though it is not really practical people should know about it.
Submitted by:
Reviewed by:
PR:
2002-02-15 07:44:44 +00:00
cvs2svn
679eb352e0 This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-02-15 07:41:46 +00:00
Dr. Stephen Henson
80bbb6578e Add flag to disable config module DSO loading. 2002-02-15 02:43:50 +00:00
Dr. Stephen Henson
19cc0f0ab4 Only initialize cipher ctx if cipher is not NULL. 2002-02-15 01:01:36 +00:00
Dr. Stephen Henson
14e14ea68c Allow a NULL store parameter to X509_STORE_CTX_init(). 2002-02-15 00:58:14 +00:00
Dr. Stephen Henson
834d37ed86 Don't call finish function if it isn't set.
Fix OID module.
2002-02-15 00:33:35 +00:00
Dr. Stephen Henson
adcc235ef6 Update NEWS 2002-02-15 00:12:44 +00:00
Dr. Stephen Henson
86a0d0234d Add argument to OPENSSL_config() and add flag to
tolerate missing config file.
2002-02-14 23:39:36 +00:00
Dr. Stephen Henson
4598be561a typo (?) 2002-02-14 18:52:37 +00:00
Dr. Stephen Henson
af5db47e99 Fix warnings:
#if out some unused function.

"index" is a global function on some platforms.
2002-02-14 18:46:12 +00:00
Richard Levitte
fb67f40f04 Add the configuration target VxWorks. 2002-02-14 16:23:55 +00:00
Bodo Möller
48033c3242 fix: make it possible to disable memory debugging even if it is
enabled by default
2002-02-14 14:47:15 +00:00
Bodo Möller
aa1f5b3581 don't call OPENSSL_config(), this does not make any sense during "make test" 2002-02-14 13:52:11 +00:00
Richard Levitte
d9d3a69595 Make sure memset() is defined by including string.h
Notified by Oscar Jacobsson <oscar@jacobsson.org>
2002-02-14 13:51:13 +00:00
Richard Levitte
f9adfa6d4e For some reason, getting the topmost error was done the same way as
getting the bottommost one.  I hope I understood correctly how this
should be done.  It seems to work when running evp_test in an
environment where it can't find openssl.cnf.
2002-02-14 13:42:33 +00:00
Richard Levitte
85b1fce1ef make update 2002-02-14 13:37:14 +00:00
Richard Levitte
da566db150 The Cygwin shared extension was shifted. 2002-02-14 13:36:13 +00:00
Richard Levitte
be37dc73f6 At Corinna Vinschen's request, change CygWin32 to Cygwin 2002-02-14 12:29:32 +00:00
Richard Levitte
976b2c9c2f Because making the key strong by xoring the last byte with 0xF0
generates different keys than previous versions of OpenSSL and libdes,
let's make Assar's change experimental for now.
2002-02-14 02:43:57 +00:00
Richard Levitte
b74d2cda28 Correct sh, please 2002-02-14 02:20:48 +00:00
Bodo Möller
cc5dd9f14e it's year 2002 now 2002-02-13 18:22:49 +00:00
cvs2svn
fbfcdc4cef This commit was manufactured by cvs2svn to create branch
'OpenSSL_0_9_7-stable'.
2002-02-13 14:44:34 +00:00
154 changed files with 5435 additions and 15392 deletions

149
CHANGES
View File

@ -2,105 +2,13 @@
OpenSSL CHANGES
_______________
Changes between 0.9.7 and 0.9.8 [xx XXX 2002]
*) Change default behaviour of 'openssl asn1parse' so that more
information is visible when viewing, e.g., a certificate:
Modify asn1_parse2 (crypto/asn1/asn1_par.c) so that in non-'dump'
mode the content of non-printable OCTET STRINGs is output in a
style similar to INTEGERs, but with '[HEX DUMP]' prepended to
avoid the appearance of a printable string.
[Nils Larsch <nla@trustcenter.de>]
*) Add 'asn1_flag' and 'asn1_form' member to EC_GROUP with access
functions
EC_GROUP_set_asn1_flag()
EC_GROUP_get_asn1_flag()
EC_GROUP_set_point_conversion_form()
EC_GROUP_get_point_conversion_form()
These control ASN1 encoding details:
- Curves (i.e., groups) are encoded explicitly unless asn1_flag
has been set to OPENSSL_EC_NAMED_CURVE.
- Points are encoded in uncompressed form by default; options for
asn1_for are as for point2oct, namely
POINT_CONVERSION_COMPRESSED
POINT_CONVERSION_UNCOMPRESSED
POINT_CONVERSION_HYBRID
Also add 'seed' and 'seed_len' members to EC_GROUP with access
functions
EC_GROUP_set_seed()
EC_GROUP_get0_seed()
EC_GROUP_get_seed_len()
This is used only for ASN1 purposes (so far).
[Nils Larsch <nla@trustcenter.de>]
*) Add 'field_type' member to EC_METHOD, which holds the NID
of the appropriate field type OID. The new function
EC_METHOD_get_field_type() returns this value.
[Nils Larsch <nla@trustcenter.de>]
*) Add functions
EC_POINT_point2bn()
EC_POINT_bn2point()
EC_POINT_point2hex()
EC_POINT_hex2point()
providing useful interfaces to EC_POINT_point2oct() and
EC_POINT_oct2point().
[Nils Larsch <nla@trustcenter.de>]
*) Change internals of the EC library so that the functions
EC_GROUP_set_generator()
EC_GROUP_get_generator()
EC_GROUP_get_order()
EC_GROUP_get_cofactor()
are implemented directly in crypto/ec/ec_lib.c and not dispatched
to methods, which would lead to unnecessary code duplication when
adding different types of curves.
[Nils Larsch <nla@trustcenter.de> with input by Bodo Moeller]
*) Implement compute_wNAF (crypto/ec/ec_mult.c) without BIGNUM
arithmetic, and such that modified wNAFs are generated
(which avoid length expansion in many cases).
[Bodo Moeller]
*) Add a function EC_GROUP_check_discriminant() (defined via
EC_METHOD) that verifies that the curve discriminant is non-zero.
Add a function EC_GROUP_check() that makes some sanity tests
on a EC_GROUP, its generator and order. This includes
EC_GROUP_check_discriminant().
[Nils Larsch <nla@trustcenter.de>]
*) Add ECDSA in new directory crypto/ecdsa/.
Add applications 'openssl ecparam' and 'openssl ecdsa'
(these are based on 'openssl dsaparam' and 'openssl dsa').
ECDSA support is also included in various other files across the
library. Most notably,
- 'openssl req' now has a '-newkey ecdsa:file' option;
- EVP_PKCS82PKEY (crypto/evp/evp_pkey.c) now can handle ECDSA;
- X509_PUBKEY_get (crypto/asn1/x_pubkey.c) and
d2i_PublicKey (crypto/asn1/d2i_pu.c) have been modified to make
them suitable for ECDSA where domain parameters must be
extracted before the specific public key.
[Nils Larsch <nla@trustcenter.de>]
*) Include some named elliptic curves, and add OIDs from X9.62,
SECG, and WAP/WTLS. The curves can be obtained from the new
functions
EC_GROUP_new_by_nid()
EC_GROUP_new_by_name()
Also add a 'curve_name' member to EC_GROUP objects, which can be
accessed via
EC_GROUP_set_nid()
EC_GROUP_get_nid()
[Nils Larsch <nla@trustcenter.de, Bodo Moeller]
Changes between 0.9.6e and 0.9.7 [XX xxx 2002]
*) Make sure tests can be performed even if the corresponding algorithms
have been removed entirely. This was also the last step to make
OpenSSL compilable with DJGPP under all reasonable conditions.
[Richard Levitte, Doug Kaufman <dkaufman@rahul.net>]
*) Add cipher selection rules COMPLEMENTOFALL and COMPLEMENTOFDEFAULT
to allow version independent disabling of normally unselected ciphers,
which may be activated as a side-effect of selecting a single cipher.
@ -118,8 +26,8 @@
# Place yourself outside of the OpenSSL source tree. In
# this example, the environment variable OPENSSL_SOURCE
# is assumed to contain the absolute OpenSSL source directory.
mkdir -p objtree/`uname -s`-`uname -r`-`uname -m`
cd objtree/`uname -s`-`uname -r`-`uname -m`
mkdir -p objtree/"`uname -s`-`uname -r`-`uname -m`"
cd objtree/"`uname -s`-`uname -r`-`uname -m`"
(cd $OPENSSL_SOURCE; find . -type f -o -type l) | while read F; do
mkdir -p `dirname $F`
ln -s $OPENSSL_SOURCE/$F $F
@ -1759,7 +1667,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Clean old EAY MD5 hack from e_os.h.
[Richard Levitte]
Changes between 0.9.6d and 0.9.6e [XX xxx XXXX]
Changes between 0.9.6d and 0.9.6e [30 Jul 2002]
*) Add various sanity checks to asn1_get_length() to reject
the ASN1 length bytes if they exceed sizeof(long), will appear
negative or the content length exceeds the length of the
supplied buffer.
[Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
*) Fix cipher selection routines: ciphers without encryption had no flags
for the cipher strength set and where therefore not handled correctly
@ -1782,6 +1696,41 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
applications.
[Bodo Moeller]
*) Changes in security patch:
Changes marked "(CHATS)" were sponsored by the Defense Advanced
Research Projects Agency (DARPA) and Air Force Research Laboratory,
Air Force Materiel Command, USAF, under agreement number
F30602-01-2-0537.
*) Add various sanity checks to asn1_get_length() to reject
the ASN1 length bytes if they exceed sizeof(long), will appear
negative or the content length exceeds the length of the
supplied buffer. (CAN-2002-0659)
[Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
*) Assertions for various potential buffer overflows, not known to
happen in practice.
[Ben Laurie (CHATS)]
*) Various temporary buffers to hold ASCII versions of integers were
too small for 64 bit platforms. (CAN-2002-0655)
[Matthew Byng-Maddick <mbm@aldigital.co.uk> and Ben Laurie (CHATS)>
*) Remote buffer overflow in SSL3 protocol - an attacker could
supply an oversized master key in Kerberos-enabled versions.
(CAN-2002-0657)
[Ben Laurie (CHATS)]
*) Remote buffer overflow in SSL3 protocol - an attacker could
supply an oversized session ID to a client. (CAN-2002-0656)
[Ben Laurie (CHATS)]
*) Remote buffer overflow in SSL2 protocol - an attacker could
supply an oversized client master key. (CAN-2002-0656)
[Ben Laurie (CHATS)]
Changes between 0.9.6c and 0.9.6d [9 May 2002]
*) Fix crypto/asn1/a_sign.c so that 'parameters' is omitted (not

View File

@ -745,14 +745,6 @@ PROCESS_ARGS:
$depflags .= "-DOPENSSL_NO_MDC2 ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_MDC2\n";
}
if ($algo eq "EC" || $algo eq "SHA" || $algo eq "SHA1")
{
push @skip, "ecdsa";
$options .= " no-ecdsa";
$flags .= "-DOPENSSL_NO_ECDSA ";
$depflags .= "-DOPENSSL_NO_ECDSA ";
$openssl_algorithm_defines .= "#define OPENSSL_NO_ECDSA\n";
}
if ($algo eq "MD5")
{
$no_md5 = 1;

2
FAQ
View File

@ -64,7 +64,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.6d was released on May 9, 2002.
OpenSSL 0.9.6e was released on July 30, 2002.
In addition to the current stable release, you can also access daily
snapshots of the OpenSSL development version at <URL:

View File

@ -166,7 +166,7 @@ SHLIBDIRS= crypto ssl
SDIRS= \
md2 md4 md5 sha mdc2 hmac ripemd \
des rc2 rc4 rc5 idea bf cast \
bn ec rsa dsa ecdsa dh dso engine aes \
bn ec rsa dsa dh dso engine aes \
buffer bio stack lhash rand err objects \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5

5
NEWS
View File

@ -40,6 +40,11 @@
o SSL/TLS: add callback to retrieve SSL/TLS messages.
o SSL/TLS: support AES cipher suites (RFC3268).
Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e:
o Important security related bugfixes.
o Various SSL/TLS library bugfixes.
Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
o Various SSL/TLS library bugfixes.

6
README
View File

@ -1,5 +1,5 @@
OpenSSL 0.9.8-dev XX xxx XXXX
OpenSSL 0.9.7-beta3 30 Jul 2002
Copyright (c) 1998-2002 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
@ -173,7 +173,9 @@
textual explanation of what your patch does.
Note: For legal reasons, contributions from the US can be accepted only
if a copy of the patch is sent to crypt@bxa.doc.gov
if a TSA notification and a copy of the patch is sent to crypt@bis.doc.gov;
see http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
and http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e)).
The preferred format for changes is "diff -u" output. You might
generate it like this:

4
STATUS
View File

@ -1,12 +1,14 @@
OpenSSL STATUS Last modified at
______________ $Date: 2002/06/16 18:20:28 $
______________ $Date: 2002/07/30 11:27:05 $
DEVELOPMENT STATE
o OpenSSL 0.9.8: Under development...
o OpenSSL 0.9.7-beta3: Released on July 30th, 2002
o OpenSSL 0.9.7-beta2: Released on June 16th, 2002
o OpenSSL 0.9.7-beta1: Released on June 1st, 2002
o OpenSSL 0.9.6e: Released on July 30th, 2002
o OpenSSL 0.9.6d: Released on May 9th, 2002
o OpenSSL 0.9.6c: Released on December 21st, 2001
o OpenSSL 0.9.6b: Released on July 9th, 2001

1
VMS/tcpip_shr_decc.opt Normal file
View File

@ -0,0 +1 @@
sys$share:tcpip$ipc_shr.exe/share

File diff suppressed because it is too large Load Diff

View File

@ -1513,11 +1513,6 @@ bad:
if (pkey->type == EVP_PKEY_DSA)
dgst=EVP_dss1();
else
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
dgst=EVP_ecdsa();
else
#endif
dgst=EVP_md5();
}
@ -1577,6 +1572,10 @@ bad:
}
j=TXT_DB_write(out,db);
if (j <= 0) goto err;
BIO_free_all(out);
out = NULL;
BIO_free_all(in);
in = NULL;
strncpy(buf[1],dbfile,BSIZE-4);
buf[1][BSIZE-4]='\0';
#ifndef OPENSSL_SYS_VMS
@ -1584,10 +1583,6 @@ bad:
#else
strcat(buf[1],"-old");
#endif
BIO_free(in);
in = NULL;
BIO_free(out);
out = NULL;
if (rename(dbfile,buf[1]) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]);
@ -2293,16 +2288,6 @@ again2:
EVP_PKEY_copy_parameters(pktmp,pkey);
EVP_PKEY_free(pktmp);
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
dgst = EVP_ecdsa();
pktmp = X509_get_pubkey(ret);
if (EVP_PKEY_missing_parameters(pktmp) &&
!EVP_PKEY_missing_parameters(pkey))
EVP_PKEY_copy_parameters(pktmp, pkey);
EVP_PKEY_free(pktmp);
#endif
if (!X509_sign(ret,pkey,dgst))
goto err;

View File

@ -1,394 +0,0 @@
/* apps/ecdsa.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef OPENSSL_NO_ECDSA
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#undef PROG
#define PROG ecdsa_main
/* -inform arg - input format - default PEM (one of DER, NET or PEM)
* -outform arg - output format - default PEM
* -in arg - input file - default stdin
* -out arg - output file - default stdout
* -des - encrypt output if PEM format with DES in cbc mode
* -text - print a text version
* -param_out - print the elliptic curve parameters
* -conv_form arg - specifies the point encoding form
* -param_enc arg - specifies the parameter encoding
*/
int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
int ret = 1;
ECDSA *ecdsa = NULL;
int i, badops = 0;
const EVP_CIPHER *enc = NULL;
BIO *in = NULL, *out = NULL;
int informat, outformat, text=0, noout=0;
int pubin = 0, pubout = 0, param_out = 0;
char *infile, *outfile, *prog, *engine;
char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL;
point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
int new_form = 0;
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
int new_asn1_flag = 0;
apps_startup();
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
if (!load_config(bio_err, NULL))
goto end;
engine = NULL;
infile = NULL;
outfile = NULL;
informat = FORMAT_PEM;
outformat = FORMAT_PEM;
prog = argv[0];
argc--;
argv++;
while (argc >= 1)
{
if (strcmp(*argv,"-inform") == 0)
{
if (--argc < 1) goto bad;
informat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-outform") == 0)
{
if (--argc < 1) goto bad;
outformat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-in") == 0)
{
if (--argc < 1) goto bad;
infile= *(++argv);
}
else if (strcmp(*argv,"-out") == 0)
{
if (--argc < 1) goto bad;
outfile= *(++argv);
}
else if (strcmp(*argv,"-passin") == 0)
{
if (--argc < 1) goto bad;
passargin= *(++argv);
}
else if (strcmp(*argv,"-passout") == 0)
{
if (--argc < 1) goto bad;
passargout= *(++argv);
}
else if (strcmp(*argv, "-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv, "-noout") == 0)
noout = 1;
else if (strcmp(*argv, "-text") == 0)
text = 1;
else if (strcmp(*argv, "-conv_form") == 0)
{
if (--argc < 1)
goto bad;
++argv;
new_form = 1;
if (strcmp(*argv, "compressed") == 0)
form = POINT_CONVERSION_COMPRESSED;
else if (strcmp(*argv, "uncompressed") == 0)
form = POINT_CONVERSION_UNCOMPRESSED;
else if (strcmp(*argv, "hybrid") == 0)
form = POINT_CONVERSION_HYBRID;
else
goto bad;
}
else if (strcmp(*argv, "-param_enc") == 0)
{
if (--argc < 1)
goto bad;
++argv;
new_asn1_flag = 1;
if (strcmp(*argv, "named_curve") == 0)
asn1_flag = OPENSSL_EC_NAMED_CURVE;
else if (strcmp(*argv, "explicit") == 0)
asn1_flag = 0;
else
goto bad;
}
else if (strcmp(*argv, "-param_out") == 0)
param_out = 1;
else if (strcmp(*argv, "-pubin") == 0)
pubin=1;
else if (strcmp(*argv, "-pubout") == 0)
pubout=1;
else if ((enc=EVP_get_cipherbyname(&(argv[0][1]))) == NULL)
{
BIO_printf(bio_err, "unknown option %s\n", *argv);
badops=1;
break;
}
argc--;
argv++;
}
if (badops)
{
bad:
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, " -inform arg input format - "
"DER or PEM\n");
BIO_printf(bio_err, " -outform arg output format - "
"DER or PEM\n");
BIO_printf(bio_err, " -in arg input file\n");
BIO_printf(bio_err, " -passin arg input file pass "
"phrase source\n");
BIO_printf(bio_err, " -out arg output file\n");
BIO_printf(bio_err, " -passout arg output file pass "
"phrase source\n");
BIO_printf(bio_err, " -engine e use engine e, "
"possibly a hardware device.\n");
BIO_printf(bio_err, " -des encrypt PEM output, "
"instead of 'des' every other \n"
" cipher "
"supported by OpenSSL can be used\n");
BIO_printf(bio_err, " -text print the key\n");
BIO_printf(bio_err, " -noout don't print key out\n");
BIO_printf(bio_err, " -param_out print the elliptic "
"curve parameters\n");
BIO_printf(bio_err, " -conv_form arg specifies the "
"point conversion form \n");
BIO_printf(bio_err, " possible values :"
" compressed\n");
BIO_printf(bio_err, " "
" uncompressed (default)\n");
BIO_printf(bio_err, " "
" hybrid\n");
BIO_printf(bio_err, " -param_enc arg specifies the way"
" the ec parameters are encoded\n");
BIO_printf(bio_err, " in the asn1 der "
"encoding\n");
BIO_printf(bio_err, " possilbe values :"
" named_curve (default)\n");
BIO_printf(bio_err," "
"explicit\n");
goto end;
}
ERR_load_crypto_strings();
e = setup_engine(bio_err, engine, 0);
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout))
{
BIO_printf(bio_err, "Error getting passwords\n");
goto end;
}
in = BIO_new(BIO_s_file());
out = BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL))
{
ERR_print_errors(bio_err);
goto end;
}
if (infile == NULL)
BIO_set_fp(in, stdin, BIO_NOCLOSE);
else
{
if (BIO_read_filename(in, infile) <= 0)
{
perror(infile);
goto end;
}
}
BIO_printf(bio_err, "read ECDSA key\n");
if (informat == FORMAT_ASN1)
{
if (pubin)
ecdsa = d2i_ECDSA_PUBKEY_bio(in, NULL);
else
ecdsa = d2i_ECDSAPrivateKey_bio(in, NULL);
}
else if (informat == FORMAT_PEM)
{
if (pubin)
ecdsa = PEM_read_bio_ECDSA_PUBKEY(in, NULL, NULL,
NULL);
else
ecdsa = PEM_read_bio_ECDSAPrivateKey(in, NULL, NULL,
passin);
}
else
{
BIO_printf(bio_err, "bad input format specified for key\n");
goto end;
}
if (ecdsa == NULL)
{
BIO_printf(bio_err,"unable to load Key\n");
ERR_print_errors(bio_err);
goto end;
}
if (outfile == NULL)
{
BIO_set_fp(out, stdout, BIO_NOCLOSE);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
out = BIO_push(tmpbio, out);
}
#endif
}
else
{
if (BIO_write_filename(out, outfile) <= 0)
{
perror(outfile);
goto end;
}
}
if (new_form)
{
EC_GROUP_set_point_conversion_form(ecdsa->group, form);
ECDSA_set_conversion_form(ecdsa, form);
}
if (new_asn1_flag)
EC_GROUP_set_asn1_flag(ecdsa->group, asn1_flag);
if (text)
if (!ECDSA_print(out, ecdsa, 0))
{
perror(outfile);
ERR_print_errors(bio_err);
goto end;
}
if (noout)
goto end;
BIO_printf(bio_err, "writing ECDSA key\n");
if (outformat == FORMAT_ASN1)
{
if (param_out)
i = i2d_ECPKParameters_bio(out, ecdsa->group);
else if (pubin || pubout)
i = i2d_ECDSA_PUBKEY_bio(out, ecdsa);
else
i = i2d_ECDSAPrivateKey_bio(out, ecdsa);
}
else if (outformat == FORMAT_PEM)
{
if (param_out)
i = PEM_write_bio_ECPKParameters(out, ecdsa->group);
else if (pubin || pubout)
i = PEM_write_bio_ECDSA_PUBKEY(out, ecdsa);
else
i = PEM_write_bio_ECDSAPrivateKey(out, ecdsa, enc,
NULL, 0, NULL, passout);
}
else
{
BIO_printf(bio_err, "bad output format specified for "
"outfile\n");
goto end;
}
if (!i)
{
BIO_printf(bio_err, "unable to write private key\n");
ERR_print_errors(bio_err);
}
else
ret=0;
end:
if (in)
BIO_free(in);
if (out)
BIO_free_all(out);
if (ecdsa)
ECDSA_free(ecdsa);
if (passin)
OPENSSL_free(passin);
if (passout)
OPENSSL_free(passout);
apps_shutdown();
EXIT(ret);
}
#endif

View File

@ -1,688 +0,0 @@
/* apps/ecparam.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef OPENSSL_NO_ECDSA
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/bn.h>
#include <openssl/ec.h>
#include <openssl/ecdsa.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#undef PROG
#define PROG ecparam_main
/* -inform arg - input format - default PEM (DER or PEM)
* -outform arg - output format - default PEM
* -in arg - input file - default stdin
* -out arg - output file - default stdout
* -noout
* -text
* -check - validate the ec parameters
* -C
* -noout
* -name file - use the ecparameters with 'short name' name
* -list_curves - prints a list of all currently available curve
* 'short names' and exits
* -conv_form - specifies the point conversion form
* possible values : compressed
* uncompressed (default)
* hybrid
* -param_enc - specifies the way the ec parameters are encoded
* in the asn1 der encoding
* possilbe values : named_curve (default)
* explicit
* -no_seed - if 'explicit' parameters are choosen do not
* use the seed
* -genkey - generates a ecdsa private key
* -rand file
* -engine e - use engine e, possible a hardware device
*/
static const char *curve_list[20] = {
"prime192v1 - NIST recommended curve over a 192 bit prime field",
"prime192v2 - 192 bit prime curve from the X9.62 draft",
"prime192v3 - 192 bit prime curve from the X9.62 draft",
"prime239v1 - 239 bit prime curve from the X9.62 draft",
"prime239v2 - 239 bit prime curve from the X9.62 draft",
"prime239v3 - 239 bit prime curve from the X9.62 draft",
"prime256v1 - NIST recommended curve over a 256 bit prime field",
"secp112r1 - SECG recommended curve over a 112 bit prime field",
"secp112r2 - SECG recommended curve over a 112 bit prime field",
"secp128r1 - SECG recommended curve over a 128 bit prime field",
"secp128r2 - SECG recommended curve over a 128 bit prime field",
"secp160k1 - SECG recommended curve over a 160 bit prime field",
"secp160r1 - SECG recommended curve over a 160 bit prime field",
"secp160r2 - SECG recommended curve over a 160 bit prime field",
"secp192k1 - SECG recommended curve over a 192 bit prime field",
"secp224k1 - SECG recommended curve over a 224 bit prime field",
"secp224r1 - NIST recommended curve over a 224 bit prime field",
"secp256k1 - SECG recommended curve over a 256 bit prime field",
"secp384r1 - NIST recommended curve over a 384 bit prime field",
"secp521r1 - NIST recommended curve over a 521 bit prime field"
};
static int ecparam_print_var(BIO *,BIGNUM *,const char *,int,unsigned char *);
int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
EC_GROUP *group = NULL;
point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
int new_form = 0;
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
int new_asn1_flag = 0;
char *curve_name = NULL, *inrand = NULL;
int list_curves = 0, no_seed = 0, check = 0,
badops = 0, text = 0, i, need_rand = 0, genkey = 0;
char *infile = NULL, *outfile = NULL, *prog;
BIO *in = NULL, *out = NULL;
int informat, outformat, noout = 0, C = 0, ret = 1;
ENGINE *e = NULL;
char *engine = NULL;
BIGNUM *ec_p = NULL, *ec_a = NULL, *ec_b = NULL,
*ec_gen = NULL, *ec_order = NULL, *ec_cofactor = NULL;
unsigned char *buffer = NULL;
apps_startup();
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
if (!load_config(bio_err, NULL))
goto end;
informat=FORMAT_PEM;
outformat=FORMAT_PEM;
prog=argv[0];
argc--;
argv++;
while (argc >= 1)
{
if (strcmp(*argv,"-inform") == 0)
{
if (--argc < 1) goto bad;
informat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-outform") == 0)
{
if (--argc < 1) goto bad;
outformat=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-in") == 0)
{
if (--argc < 1) goto bad;
infile= *(++argv);
}
else if (strcmp(*argv,"-out") == 0)
{
if (--argc < 1) goto bad;
outfile= *(++argv);
}
else if (strcmp(*argv,"-text") == 0)
text = 1;
else if (strcmp(*argv,"-C") == 0)
C = 1;
else if (strcmp(*argv,"-check") == 0)
check = 1;
else if (strcmp (*argv, "-name") == 0)
{
if (--argc < 1)
goto bad;
curve_name = *(++argv);
}
else if (strcmp(*argv, "-list_curves") == 0)
list_curves = 1;
else if (strcmp(*argv, "-conv_form") == 0)
{
if (--argc < 1)
goto bad;
++argv;
new_form = 1;
if (strcmp(*argv, "compressed") == 0)
form = POINT_CONVERSION_COMPRESSED;
else if (strcmp(*argv, "uncompressed") == 0)
form = POINT_CONVERSION_UNCOMPRESSED;
else if (strcmp(*argv, "hybrid") == 0)
form = POINT_CONVERSION_HYBRID;
else
goto bad;
}
else if (strcmp(*argv, "-param_enc") == 0)
{
if (--argc < 1)
goto bad;
++argv;
new_asn1_flag = 1;
if (strcmp(*argv, "named_curve") == 0)
asn1_flag = OPENSSL_EC_NAMED_CURVE;
else if (strcmp(*argv, "explicit") == 0)
asn1_flag = 0;
else
goto bad;
}
else if (strcmp(*argv, "-no_seed") == 0)
no_seed = 1;
else if (strcmp(*argv, "-noout") == 0)
noout=1;
else if (strcmp(*argv,"-genkey") == 0)
{
genkey=1;
need_rand=1;
}
else if (strcmp(*argv, "-rand") == 0)
{
if (--argc < 1) goto bad;
inrand= *(++argv);
need_rand=1;
}
else if(strcmp(*argv, "-engine") == 0)
{
if (--argc < 1) goto bad;
engine = *(++argv);
}
else
{
BIO_printf(bio_err,"unknown option %s\n",*argv);
badops=1;
break;
}
argc--;
argv++;
}
if (badops)
{
bad:
BIO_printf(bio_err, "%s [options] <infile >outfile\n",prog);
BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, " -inform arg input format - "
"default PEM (DER or PEM)\n");
BIO_printf(bio_err, " -outform arg output format - "
"default PEM\n");
BIO_printf(bio_err, " -in arg input file - "
"default stdin\n");
BIO_printf(bio_err, " -out arg output file - "
"default stdout\n");
BIO_printf(bio_err, " -noout do not print the "
"ec parameter\n");
BIO_printf(bio_err, " -text print the ec "
"parameters in text form\n");
BIO_printf(bio_err, " -check validate the ec "
"parameters\n");
BIO_printf(bio_err, " -C print a 'C' "
"function creating the parameters\n");
BIO_printf(bio_err, " -name arg use the "
"ec parameters with 'short name' name\n");
BIO_printf(bio_err, " -list_curves prints a list of "
"all currently available curve\n");
BIO_printf(bio_err, " 'short names'\n");
BIO_printf(bio_err, " -conv_form arg specifies the "
"point conversion form \n");
BIO_printf(bio_err, " possible values :"
" compressed\n");
BIO_printf(bio_err, " "
" uncompressed (default)\n");
BIO_printf(bio_err, " "
" hybrid\n");
BIO_printf(bio_err, " -param_enc arg specifies the way"
" the ec parameters are encoded\n");
BIO_printf(bio_err, " in the asn1 der "
"encoding\n");
BIO_printf(bio_err, " possilbe values :"
" named_curve (default)\n");
BIO_printf(bio_err," "
" explicit\n");
BIO_printf(bio_err, " -no_seed if 'explicit'"
" parameters are choosen do not\n");
BIO_printf(bio_err, " use the seed\n");
BIO_printf(bio_err, " -genkey generate ecdsa"
" key\n");
BIO_printf(bio_err, " -rand file files to use for"
" random number input\n");
BIO_printf(bio_err, " -engine e use engine e, "
"possible a hardware device\n");
goto end;
}
ERR_load_crypto_strings();
in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL))
{
ERR_print_errors(bio_err);
goto end;
}
if (infile == NULL)
BIO_set_fp(in,stdin,BIO_NOCLOSE);
else
{
if (BIO_read_filename(in,infile) <= 0)
{
perror(infile);
goto end;
}
}
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
out = BIO_push(tmpbio, out);
}
#endif
}
else
{
if (BIO_write_filename(out,outfile) <= 0)
{
perror(outfile);
goto end;
}
}
e = setup_engine(bio_err, engine, 0);
if (list_curves)
{
int counter=0;
for (; counter < sizeof(curve_list)/sizeof(char *); counter++)
if (BIO_printf(bio_err, " %s\n", curve_list[counter])
<= 0)
goto end;
ret = 0;
goto end;
}
if (curve_name != NULL)
{
int nid = OBJ_sn2nid(curve_name);
if (nid == 0)
{
BIO_printf(bio_err, "unknown curve name (%s)\n",
curve_name);
goto end;
}
group = EC_GROUP_new_by_nid(nid);
if (group == NULL)
{
BIO_printf(bio_err, "unable to create curve (%s)\n",
curve_name);
goto end;
}
EC_GROUP_set_asn1_flag(group, asn1_flag);
EC_GROUP_set_point_conversion_form(group, form);
}
else if (informat == FORMAT_ASN1)
{
group = d2i_ECPKParameters_bio(in, NULL);
}
else if (informat == FORMAT_PEM)
{
group = PEM_read_bio_ECPKParameters(in,NULL,NULL,NULL);
}
else
{
BIO_printf(bio_err, "bad input format specified\n");
goto end;
}
if (group == NULL)
{
BIO_printf(bio_err,
"unable to load elliptic curve parameters\n");
ERR_print_errors(bio_err);
goto end;
}
if (new_form)
EC_GROUP_set_point_conversion_form(group, form);
if (new_asn1_flag)
EC_GROUP_set_asn1_flag(group, asn1_flag);
if (no_seed)
{
EC_GROUP_set_seed(group, NULL, 0);
}
if (text)
{
if (!ECPKParameters_print(out, group, 0))
goto end;
}
if (check)
{
if (group == NULL)
BIO_printf(bio_err, "no elliptic curve parameters\n");
BIO_printf(bio_err, "checking elliptic curve parameters: ");
if (!EC_GROUP_check(group, NULL))
{
BIO_printf(bio_err, "failed\n");
ERR_print_errors(bio_err);
}
else
BIO_printf(bio_err, "ok\n");
}
if (C)
{
size_t buf_len = 0, tmp_len = 0;
const EC_POINT *point;
int is_prime, len = 0;
const EC_METHOD *meth = EC_GROUP_method_of(group);
if ((ec_p = BN_new()) == NULL || (ec_a = BN_new()) == NULL ||
(ec_b = BN_new()) == NULL || (ec_gen = BN_new()) == NULL ||
(ec_order = BN_new()) == NULL ||
(ec_cofactor = BN_new()) == NULL )
{
perror("OPENSSL_malloc");
goto end;
}
is_prime = (EC_METHOD_get_field_type(meth) ==
NID_X9_62_prime_field);
if (is_prime)
{
if (!EC_GROUP_get_curve_GFp(group, ec_p, ec_a,
ec_b, NULL))
goto end;
}
else
{
/* TODO */
goto end;
}
if ((point = EC_GROUP_get0_generator(group)) == NULL)
goto end;
if (!EC_POINT_point2bn(group, point,
EC_GROUP_get_point_conversion_form(group), ec_gen,
NULL))
goto end;
if (!EC_GROUP_get_order(group, ec_order, NULL))
goto end;
if (!EC_GROUP_get_cofactor(group, ec_cofactor, NULL))
goto end;
if (!ec_p || !ec_a || !ec_b || !ec_gen ||
!ec_order || !ec_cofactor)
goto end;
len = BN_num_bits(ec_order);
if ((tmp_len = (size_t)BN_num_bytes(ec_p)) > buf_len)
buf_len = tmp_len;
if ((tmp_len = (size_t)BN_num_bytes(ec_a)) > buf_len)
buf_len = tmp_len;
if ((tmp_len = (size_t)BN_num_bytes(ec_b)) > buf_len)
buf_len = tmp_len;
if ((tmp_len = (size_t)BN_num_bytes(ec_gen)) > buf_len)
buf_len = tmp_len;
if ((tmp_len = (size_t)BN_num_bytes(ec_order)) > buf_len)
buf_len = tmp_len;
if ((tmp_len = (size_t)BN_num_bytes(ec_cofactor)) > buf_len)
buf_len = tmp_len;
buffer = (unsigned char *)OPENSSL_malloc(buf_len);
if (buffer == NULL)
{
perror("OPENSSL_malloc");
goto end;
}
ecparam_print_var(out, ec_p, "ec_p", len, buffer);
ecparam_print_var(out, ec_a, "ec_a", len, buffer);
ecparam_print_var(out, ec_b, "ec_b", len, buffer);
ecparam_print_var(out, ec_gen, "ec_gen", len, buffer);
ecparam_print_var(out, ec_order, "ec_order", len, buffer);
ecparam_print_var(out, ec_cofactor, "ec_cofactor", len,
buffer);
BIO_printf(out, "\n\n");
BIO_printf(out, "EC_GROUP *get_ec_group_%d(void)\n\t{\n", len);
BIO_printf(out, "\tint ok=0;\n");
BIO_printf(out, "\tEC_GROUP *group = NULL;\n");
BIO_printf(out, "\tEC_POINT *point = NULL;\n");
BIO_printf(out, "\tBIGNUM *tmp_1 = NULL, *tmp_2 = NULL, "
"*tmp_3 = NULL;\n\n");
BIO_printf(out, "\tif ((tmp_1 = BN_bin2bn(ec_p_%d, "
"sizeof(ec_p_%d), NULL)) == NULL)\n\t\t"
"goto err;\n", len, len);
BIO_printf(out, "\tif ((tmp_2 = BN_bin2bn(ec_a_%d, "
"sizeof(ec_a_%d), NULL)) == NULL)\n\t\t"
"goto err;\n", len, len);
BIO_printf(out, "\tif ((tmp_3 = BN_bin2bn(ec_b_%d, "
"sizeof(ec_b_%d), NULL)) == NULL)\n\t\t"
"goto err;\n", len, len);
if (is_prime)
{
BIO_printf(out, "\tif ((group = EC_GROUP_new_curve_"
"GFp(tmp_1, tmp_2, tmp_3, NULL)) == NULL)"
"\n\t\tgoto err;\n\n");
}
else
{
/* TODO */
goto end;
}
BIO_printf(out, "\t/* build generator */\n");
BIO_printf(out, "\tif ((tmp_1 = BN_bin2bn(ec_gen_%d, "
"sizeof(ec_gen_%d), tmp_1)) == NULL)"
"\n\t\tgoto err;\n", len, len);
BIO_printf(out, "\tpoint = EC_POINT_bn2point(group, tmp_1, "
"NULL, NULL);\n");
BIO_printf(out, "\tif (point == NULL)\n\t\tgoto err;\n");
BIO_printf(out, "\tif ((tmp_2 = BN_bin2bn(ec_order_%d, "
"sizeof(ec_order_%d), tmp_2)) == NULL)"
"\n\t\tgoto err;\n", len, len);
BIO_printf(out, "\tif ((tmp_3 = BN_bin2bn(ec_cofactor_%d, "
"sizeof(ec_cofactor_%d), tmp_3)) == NULL)"
"\n\t\tgoto err;\n", len, len);
BIO_printf(out, "\tif (!EC_GROUP_set_generator(group, point,"
" tmp_2, tmp_3))\n\t\tgoto err;\n");
BIO_printf(out, "\n\tok=1;\n");
BIO_printf(out, "err:\n");
BIO_printf(out, "\tif (tmp_1)\n\t\tBN_free(tmp_1);\n");
BIO_printf(out, "\tif (tmp_2)\n\t\tBN_free(tmp_2);\n");
BIO_printf(out, "\tif (tmp_3)\n\t\tBN_free(tmp_3);\n");
BIO_printf(out, "\tif (point)\n\t\tEC_POINT_free(point);\n");
BIO_printf(out, "\tif (!ok)\n");
BIO_printf(out, "\t\t{\n");
BIO_printf(out, "\t\tEC_GROUP_free(group);\n");
BIO_printf(out, "\t\tgroup = NULL;\n");
BIO_printf(out, "\t\t}\n");
BIO_printf(out, "\treturn(group);\n\t}\n");
}
if (!noout)
{
if (outformat == FORMAT_ASN1)
i = i2d_ECPKParameters_bio(out, group);
else if (outformat == FORMAT_PEM)
i = PEM_write_bio_ECPKParameters(out, group);
else
{
BIO_printf(bio_err,"bad output format specified for"
" outfile\n");
goto end;
}
if (!i)
{
BIO_printf(bio_err, "unable to write elliptic "
"curve parameters\n");
ERR_print_errors(bio_err);
goto end;
}
}
if (need_rand)
{
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
if (inrand != NULL)
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
app_RAND_load_files(inrand));
}
if (genkey)
{
ECDSA *ecdsa = ECDSA_new();
if (ecdsa == NULL)
goto end;
assert(need_rand);
ecdsa->group = group;
if (!ECDSA_generate_key(ecdsa))
{
ecdsa->group = NULL;
ECDSA_free(ecdsa);
goto end;
}
if (outformat == FORMAT_ASN1)
i = i2d_ECDSAPrivateKey_bio(out, ecdsa);
else if (outformat == FORMAT_PEM)
i = PEM_write_bio_ECDSAPrivateKey(out, ecdsa, NULL,
NULL, 0, NULL, NULL);
else
{
BIO_printf(bio_err, "bad output format specified "
"for outfile\n");
ecdsa->group = NULL;
ECDSA_free(ecdsa);
goto end;
}
ecdsa->group = NULL;
ECDSA_free(ecdsa);
}
if (need_rand)
app_RAND_write_file(NULL, bio_err);
ret=0;
end:
if (ec_p)
BN_free(ec_p);
if (ec_a)
BN_free(ec_a);
if (ec_b)
BN_free(ec_b);
if (ec_gen)
BN_free(ec_gen);
if (ec_order)
BN_free(ec_order);
if (ec_cofactor)
BN_free(ec_cofactor);
if (buffer)
OPENSSL_free(buffer);
if (in != NULL)
BIO_free(in);
if (out != NULL)
BIO_free_all(out);
if (group != NULL)
EC_GROUP_free(group);
apps_shutdown();
EXIT(ret);
}
int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
int len, unsigned char *buffer)
{
BIO_printf(out, "static unsigned char %s_%d[] = {", var, len);
if (BN_is_zero(in))
BIO_printf(out, "\n\t0x00");
else
{
int i, l;
l = BN_bn2bin(in, buffer);
for (i=0; i<l-1; i++)
{
if ((i%12) == 0)
BIO_printf(out, "\n\t");
BIO_printf(out, "0x%02X,", buffer[i]);
}
if ((i%12) == 0)
BIO_printf(out, "\n\t");
BIO_printf(out, "0x%02X", buffer[i]);
}
BIO_printf(out, "\n\t};\n\n");
return 1;
}
#endif

View File

@ -17,8 +17,6 @@ extern int rsa_main(int argc,char *argv[]);
extern int rsautl_main(int argc,char *argv[]);
extern int dsa_main(int argc,char *argv[]);
extern int dsaparam_main(int argc,char *argv[]);
extern int ecdsa_main(int argc,char *argv[]);
extern int ecparam_main(int argc,char *argv[]);
extern int x509_main(int argc,char *argv[]);
extern int genrsa_main(int argc,char *argv[]);
extern int gendsa_main(int argc,char *argv[]);
@ -80,12 +78,6 @@ FUNCTION functions[] = {
#endif
#ifndef OPENSSL_NO_DSA
{FUNC_TYPE_GENERAL,"dsaparam",dsaparam_main},
#endif
#ifndef OPENSSL_NO_ECDSA
{FUNC_TYPE_GENERAL,"ecdsa",ecdsa_main},
#endif
#ifndef OPENSSL_NO_ECDSA
{FUNC_TYPE_GENERAL,"ecparam",ecparam_main},
#endif
{FUNC_TYPE_GENERAL,"x509",x509_main},
#ifndef OPENSSL_NO_RSA

View File

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

View File

@ -142,7 +142,6 @@ static int batch=0;
#define TYPE_RSA 1
#define TYPE_DSA 2
#define TYPE_DH 3
#define TYPE_ECDSA 4
int MAIN(int, char **);
@ -151,9 +150,6 @@ int MAIN(int argc, char **argv)
ENGINE *e = NULL;
#ifndef OPENSSL_NO_DSA
DSA *dsa_params=NULL;
#endif
#ifndef OPENSSL_NO_ECDSA
ECDSA *ecdsa_params = NULL;
#endif
unsigned long nmflag = 0;
int ex=1,x509=0,days=30;
@ -322,67 +318,11 @@ int MAIN(int argc, char **argv)
}
}
BIO_free(in);
in=NULL;
newkey=BN_num_bits(dsa_params->p);
in=NULL;
}
else
#endif
#ifndef OPENSSL_NO_ECDSA
if (strncmp("ecdsa:",p,4) == 0)
{
X509 *xtmp=NULL;
EVP_PKEY *dtmp;
pkey_type=TYPE_ECDSA;
p+=6;
if ((in=BIO_new_file(p,"r")) == NULL)
{
perror(p);
goto end;
}
if ((ecdsa_params = ECDSA_new()) == NULL)
goto end;
if ((ecdsa_params->group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL)) == NULL)
{
if (ecdsa_params)
ECDSA_free(ecdsa_params);
ERR_clear_error();
(void)BIO_reset(in);
if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL)
{
BIO_printf(bio_err,"unable to load ECDSA parameters from file\n");
goto end;
}
if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end;
if (dtmp->type == EVP_PKEY_ECDSA)
ecdsa_params = ECDSAParameters_dup(dtmp->pkey.ecdsa);
EVP_PKEY_free(dtmp);
X509_free(xtmp);
if (ecdsa_params == NULL)
{
BIO_printf(bio_err,"Certificate does not contain ECDSA parameters\n");
goto end;
}
}
BIO_free(in);
in=NULL;
{
BIGNUM *order = BN_new();
if (!order)
goto end;
if (!EC_GROUP_get_order(ecdsa_params->group, order, NULL))
goto end;
newkey = BN_num_bits(order);
BN_free(order);
}
}
else
#endif
#ifndef OPENSSL_NO_DH
if (strncmp("dh:",p,4) == 0)
{
@ -494,7 +434,6 @@ bad:
BIO_printf(bio_err," the random number generator\n");
BIO_printf(bio_err," -newkey rsa:bits generate a new RSA key of 'bits' in size\n");
BIO_printf(bio_err," -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n");
BIO_printf(bio_err," -newkey ecdsa:file generate a new ECDSA key, parameters taken from CA in 'file'\n");
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2, md4)\n");
BIO_printf(bio_err," -config file request template file.\n");
BIO_printf(bio_err," -subj arg set or modify request subject\n");
@ -691,7 +630,7 @@ bad:
message */
goto end;
}
if (EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA || EVP_PKEY_type(pkey->type) == EVP_PKEY_ECDSA)
if (EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA)
{
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
if (randfile == NULL)
@ -715,15 +654,14 @@ bad:
newkey=DEFAULT_KEY_LENGTH;
}
if (newkey < MIN_KEY_LENGTH && (pkey_type == TYPE_RSA || pkey_type == TYPE_DSA))
/* TODO: appropriate minimal keylength for the different algorithm (esp. ECDSA) */
if (newkey < MIN_KEY_LENGTH)
{
BIO_printf(bio_err,"private key length is too short,\n");
BIO_printf(bio_err,"it needs to be at least %d bits, not %d\n",MIN_KEY_LENGTH,newkey);
goto end;
}
BIO_printf(bio_err,"Generating a %d bit %s private key\n",
newkey,(pkey_type == TYPE_RSA)?"RSA":(pkey_type == TYPE_DSA)?"DSA":"ECDSA");
newkey,(pkey_type == TYPE_RSA)?"RSA":"DSA");
if ((pkey=EVP_PKEY_new()) == NULL) goto end;
@ -745,14 +683,6 @@ bad:
dsa_params=NULL;
}
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey_type == TYPE_ECDSA)
{
if (!ECDSA_generate_key(ecdsa_params)) goto end;
if (!EVP_PKEY_assign_ECDSA(pkey, ecdsa_params)) goto end;
ecdsa_params = NULL;
}
#endif
app_RAND_write_file(randfile, bio_err);
@ -858,10 +788,6 @@ loop:
#ifndef OPENSSL_NO_DSA
if (pkey->type == EVP_PKEY_DSA)
digest=EVP_dss1();
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
digest=EVP_ecdsa();
#endif
if (req == NULL)
{
@ -1143,9 +1069,6 @@ end:
OBJ_cleanup();
#ifndef OPENSSL_NO_DSA
if (dsa_params != NULL) DSA_free(dsa_params);
#endif
#ifndef OPENSSL_NO_ECDSA
if (ecdsa_params != NULL) ECDSA_free(ecdsa_params);
#endif
apps_shutdown();
EXIT(ex);

View File

@ -710,7 +710,7 @@ bad:
}
}
#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA)
#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA)
if (nocert)
#endif
{

View File

@ -869,10 +869,6 @@ bad:
if (Upkey->type == EVP_PKEY_DSA)
digest=EVP_dss1();
#endif
#ifndef OPENSSL_NO_ECDSA
if (Upkey->type == EVP_PKEY_ECDSA)
digest=EVP_ecdsa();
#endif
assert(need_rand);
if (!sign(x,Upkey,days,clrext,digest,
@ -892,10 +888,6 @@ bad:
if (CApkey->type == EVP_PKEY_DSA)
digest=EVP_dss1();
#endif
#ifndef OPENSSL_NO_ECDSA
if (CApkey->type == EVP_PKEY_ECDSA)
digest = EVP_ecdsa();
#endif
assert(need_rand);
if (!x509_certify(ctx,CAfile,digest,x,xca,
@ -923,10 +915,10 @@ bad:
BIO_printf(bio_err,"Generating certificate request\n");
#ifndef OPENSSL_NO_DSA
if (pk->type == EVP_PKEY_DSA)
digest=EVP_dss1();
else if (pk->type == EVP_PKEY_ECDSA)
digest=EVP_ecdsa();
#endif
rq=X509_to_X509_REQ(x,pk,digest);
EVP_PKEY_free(pk);

View File

@ -28,7 +28,7 @@ LIBS=
SDIRS= md2 md5 sha mdc2 hmac ripemd \
des rc2 rc4 rc5 idea bf cast \
bn ec rsa dsa ecdsa dh dso engine aes \
bn ec rsa dsa dh dso engine aes \
buffer bio stack lhash rand err objects \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
@ -180,7 +180,7 @@ cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h
cversion.o: ../include/openssl/symhacks.h buildinf.h cryptlib.h cversion.c
ebcdic.o: ../include/openssl/opensslconf.h ebcdic.c
ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h

View File

@ -145,19 +145,18 @@ a_d2i_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_d2i_fp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
a_d2i_fp.o: ../../include/openssl/symhacks.h ../cryptlib.h a_d2i_fp.c
a_digest.o: ../../e_os.h ../../include/openssl/aes.h
a_digest.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
a_digest.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
a_digest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
a_digest.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
a_digest.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
a_digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
a_digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
a_digest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
a_digest.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
a_digest.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
a_digest.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
a_digest.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
a_digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
a_digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
a_digest.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
a_digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
a_digest.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
a_digest.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
a_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
a_digest.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
a_digest.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
a_digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
a_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_digest.o: ../../include/openssl/opensslconf.h
a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
a_digest.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
@ -267,49 +266,46 @@ a_set.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
a_set.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
a_set.o: ../cryptlib.h a_set.c
a_sign.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
a_sign.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
a_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
a_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
a_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
a_sign.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
a_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
a_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
a_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
a_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
a_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
a_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
a_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
a_sign.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
a_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
a_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
a_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
a_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
a_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
a_sign.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
a_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_sign.c
a_sign.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
a_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
a_sign.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
a_sign.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
a_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
a_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
a_sign.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
a_sign.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
a_sign.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
a_sign.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
a_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
a_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
a_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
a_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
a_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
a_sign.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
a_sign.o: ../cryptlib.h a_sign.c
a_strex.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
a_strex.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
a_strex.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
a_strex.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
a_strex.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
a_strex.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
a_strex.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
a_strex.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
a_strex.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
a_strex.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
a_strex.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
a_strex.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
a_strex.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_strex.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_strex.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
a_strex.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
a_strex.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
a_strex.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
a_strex.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
a_strex.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
a_strex.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
a_strex.o: a_strex.c charmap.h
a_strex.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
a_strex.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
a_strex.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
a_strex.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
a_strex.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
a_strex.o: ../../include/openssl/e_os2.h ../../include/openssl/evp.h
a_strex.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
a_strex.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
a_strex.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
a_strex.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_strex.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
a_strex.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
a_strex.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
a_strex.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
a_strex.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
a_strex.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
a_strex.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
a_strex.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
a_strex.o: ../../include/openssl/x509_vfy.h a_strex.c charmap.h
a_strnid.o: ../../e_os.h ../../include/openssl/asn1.h
a_strnid.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
a_strnid.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
@ -354,19 +350,18 @@ a_utf8.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
a_utf8.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
a_utf8.o: ../cryptlib.h a_utf8.c
a_verify.o: ../../e_os.h ../../include/openssl/aes.h
a_verify.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
a_verify.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
a_verify.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
a_verify.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
a_verify.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
a_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
a_verify.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
a_verify.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
a_verify.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
a_verify.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
a_verify.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
a_verify.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
a_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
a_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
a_verify.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
a_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
a_verify.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
a_verify.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
a_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
a_verify.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
a_verify.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
a_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
a_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_verify.o: ../../include/openssl/opensslconf.h
a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
a_verify.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
@ -402,20 +397,19 @@ asn1_par.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
asn1_par.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
asn1_par.o: ../../include/openssl/symhacks.h ../cryptlib.h asn1_par.c
asn_moid.o: ../../e_os.h ../../include/openssl/aes.h
asn_moid.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
asn_moid.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
asn_moid.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
asn_moid.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
asn_moid.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
asn_moid.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
asn_moid.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
asn_moid.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
asn_moid.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
asn_moid.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
asn_moid.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
asn_moid.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
asn_moid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
asn_moid.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
asn_moid.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
asn_moid.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
asn_moid.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
asn_moid.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
asn_moid.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
asn_moid.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
asn_moid.o: ../../include/openssl/err.h ../../include/openssl/evp.h
asn_moid.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
asn_moid.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
asn_moid.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
asn_moid.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
asn_moid.o: ../../include/openssl/opensslconf.h
asn_moid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
asn_moid.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
asn_moid.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
@ -434,47 +428,43 @@ asn_pack.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
asn_pack.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
asn_pack.o: ../../include/openssl/symhacks.h ../cryptlib.h asn_pack.c
d2i_pr.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
d2i_pr.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
d2i_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
d2i_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
d2i_pr.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
d2i_pr.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
d2i_pr.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
d2i_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
d2i_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
d2i_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
d2i_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
d2i_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
d2i_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
d2i_pr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
d2i_pr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
d2i_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
d2i_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
d2i_pr.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
d2i_pr.o: ../cryptlib.h d2i_pr.c
d2i_pr.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
d2i_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
d2i_pr.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
d2i_pr.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
d2i_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
d2i_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
d2i_pr.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
d2i_pr.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
d2i_pr.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
d2i_pr.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
d2i_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
d2i_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
d2i_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
d2i_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
d2i_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
d2i_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
d2i_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
d2i_pr.o: ../../include/openssl/ui_compat.h ../cryptlib.h d2i_pr.c
d2i_pu.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
d2i_pu.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
d2i_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
d2i_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
d2i_pu.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
d2i_pu.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
d2i_pu.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
d2i_pu.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
d2i_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
d2i_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
d2i_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
d2i_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
d2i_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
d2i_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
d2i_pu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
d2i_pu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
d2i_pu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
d2i_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
d2i_pu.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
d2i_pu.o: ../cryptlib.h d2i_pu.c
d2i_pu.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
d2i_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
d2i_pu.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
d2i_pu.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
d2i_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
d2i_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
d2i_pu.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
d2i_pu.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
d2i_pu.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
d2i_pu.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
d2i_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
d2i_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
d2i_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
d2i_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
d2i_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
d2i_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
d2i_pu.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
d2i_pu.o: ../../include/openssl/ui_compat.h ../cryptlib.h d2i_pu.c
evp_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
evp_asn1.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
evp_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@ -509,47 +499,43 @@ f_string.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
f_string.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
f_string.o: ../../include/openssl/symhacks.h ../cryptlib.h f_string.c
i2d_pr.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
i2d_pr.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
i2d_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
i2d_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
i2d_pr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
i2d_pr.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
i2d_pr.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
i2d_pr.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
i2d_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
i2d_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
i2d_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
i2d_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
i2d_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
i2d_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
i2d_pr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
i2d_pr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
i2d_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
i2d_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
i2d_pr.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
i2d_pr.o: ../cryptlib.h i2d_pr.c
i2d_pr.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
i2d_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
i2d_pr.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
i2d_pr.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
i2d_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
i2d_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
i2d_pr.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
i2d_pr.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
i2d_pr.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
i2d_pr.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
i2d_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
i2d_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
i2d_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
i2d_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
i2d_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
i2d_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
i2d_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
i2d_pr.o: ../../include/openssl/ui_compat.h ../cryptlib.h i2d_pr.c
i2d_pu.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
i2d_pu.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
i2d_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
i2d_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
i2d_pu.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
i2d_pu.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
i2d_pu.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
i2d_pu.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
i2d_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
i2d_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
i2d_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
i2d_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
i2d_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
i2d_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
i2d_pu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
i2d_pu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
i2d_pu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
i2d_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
i2d_pu.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
i2d_pu.o: ../cryptlib.h i2d_pu.c
i2d_pu.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
i2d_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
i2d_pu.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
i2d_pu.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
i2d_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
i2d_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
i2d_pu.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
i2d_pu.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
i2d_pu.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
i2d_pu.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
i2d_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
i2d_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
i2d_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
i2d_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
i2d_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
i2d_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
i2d_pu.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
i2d_pu.o: ../../include/openssl/ui_compat.h ../cryptlib.h i2d_pu.c
n_pkey.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
n_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/asn1t.h
n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@ -557,8 +543,7 @@ n_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
n_pkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
n_pkey.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
n_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
n_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
n_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
n_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
n_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
n_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -580,7 +565,6 @@ nsseq.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
nsseq.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
nsseq.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
nsseq.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
nsseq.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
nsseq.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
nsseq.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
nsseq.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -601,7 +585,6 @@ p5_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
p5_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
p5_pbe.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
p5_pbe.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
p5_pbe.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
p5_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p5_pbe.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
p5_pbe.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
@ -624,8 +607,7 @@ p5_pbev2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
p5_pbev2.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
p5_pbev2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
p5_pbev2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p5_pbev2.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
p5_pbev2.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
p5_pbev2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
p5_pbev2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -647,8 +629,7 @@ p8_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
p8_pkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
p8_pkey.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
p8_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p8_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
p8_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
p8_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
p8_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -664,155 +645,144 @@ p8_pkey.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
p8_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p8_pkey.o: ../cryptlib.h p8_pkey.c
t_bitst.o: ../../e_os.h ../../include/openssl/aes.h
t_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
t_bitst.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_bitst.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_bitst.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
t_bitst.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
t_bitst.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_bitst.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_bitst.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
t_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
t_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
t_bitst.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_bitst.o: ../cryptlib.h t_bitst.c
t_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
t_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_bitst.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
t_bitst.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
t_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
t_bitst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
t_bitst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_bitst.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h t_bitst.c
t_crl.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
t_crl.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
t_crl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
t_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_crl.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
t_crl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
t_crl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
t_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
t_crl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
t_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_crl.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h t_crl.c
t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
t_pkey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
t_crl.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_crl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_crl.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
t_crl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
t_crl.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
t_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
t_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
t_crl.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_crl.o: ../cryptlib.h t_crl.c
t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
t_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
t_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
t_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
t_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
t_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
t_pkey.o: ../../include/openssl/symhacks.h ../cryptlib.h t_pkey.c
t_req.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
t_req.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
t_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
t_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_req.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
t_req.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
t_req.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
t_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
t_req.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
t_req.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_req.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h t_req.c
t_req.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_req.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
t_req.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
t_req.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
t_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
t_req.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_req.o: ../cryptlib.h t_req.c
t_spki.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
t_spki.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
t_spki.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
t_spki.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
t_spki.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
t_spki.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
t_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_spki.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
t_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_spki.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_spki.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_spki.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_spki.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
t_spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
t_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
t_spki.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_spki.c
t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_spki.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
t_spki.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
t_spki.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
t_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
t_spki.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
t_spki.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
t_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
t_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_spki.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_spki.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_spki.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
t_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_spki.o: ../cryptlib.h t_spki.c
t_x509.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
t_x509.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
t_x509.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
t_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_x509.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
t_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
t_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
t_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
t_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
t_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_x509.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h t_x509.c
t_x509.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_x509.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
t_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
t_x509.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
t_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
t_x509.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_x509.o: ../cryptlib.h t_x509.c
t_x509a.o: ../../e_os.h ../../include/openssl/aes.h
t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
t_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_x509a.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
t_x509a.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
t_x509a.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
t_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
t_x509a.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
t_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
t_x509a.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
t_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
t_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
t_x509a.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
t_x509a.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
t_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_x509a.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
t_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_x509a.o: ../cryptlib.h t_x509a.c
t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
t_x509a.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
t_x509a.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
t_x509a.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
t_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_x509a.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_x509a.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
t_x509a.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
t_x509a.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
t_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_x509a.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
t_x509a.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
t_x509a.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
t_x509a.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_x509a.c
tasn_dec.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
tasn_dec.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
tasn_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
@ -870,7 +840,6 @@ x_algor.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_algor.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_algor.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_algor.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_algor.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_algor.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_algor.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_algor.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -892,8 +861,7 @@ x_attrib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
x_attrib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
x_attrib.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
x_attrib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_attrib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
x_attrib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_attrib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_attrib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -924,7 +892,6 @@ x_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_crl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_crl.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_crl.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
@ -946,7 +913,6 @@ x_exten.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_exten.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_exten.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_exten.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_exten.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_exten.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_exten.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_exten.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -962,27 +928,26 @@ x_exten.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
x_exten.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_exten.o: x_exten.c
x_info.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
x_info.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_info.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
x_info.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_info.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_info.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_info.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
x_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
x_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
x_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
x_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
x_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_info.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
x_info.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
x_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_info.c
x_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
x_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
x_info.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
x_info.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
x_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
x_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
x_info.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_info.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_info.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
x_info.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
x_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
x_info.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
x_info.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
x_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_info.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
x_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_info.o: ../cryptlib.h x_info.c
x_long.o: ../../e_os.h ../../include/openssl/asn1.h
x_long.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_long.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@ -999,7 +964,6 @@ x_name.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_name.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_name.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_name.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_name.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_name.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_name.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_name.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
@ -1015,28 +979,26 @@ x_name.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
x_name.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
x_name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_name.c
x_pkey.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
x_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/asn1t.h
x_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
x_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
x_pkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
x_pkey.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
x_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
x_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
x_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
x_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
x_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
x_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
x_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_pkey.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
x_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_pkey.o: ../cryptlib.h x_pkey.c
x_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
x_pkey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
x_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_pkey.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_pkey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
x_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
x_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
x_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
x_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
x_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
x_pkey.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
x_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_pkey.c
x_pubkey.o: ../../e_os.h ../../include/openssl/aes.h
x_pubkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
x_pubkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@ -1044,8 +1006,7 @@ x_pubkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
x_pubkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
x_pubkey.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
x_pubkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
x_pubkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_pubkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_pubkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_pubkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_pubkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -1067,7 +1028,6 @@ x_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_req.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_req.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_req.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
@ -1089,7 +1049,6 @@ x_sig.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_sig.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_sig.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_sig.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_sig.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_sig.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_sig.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_sig.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
@ -1111,7 +1070,6 @@ x_spki.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_spki.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_spki.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_spki.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_spki.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_spki.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
@ -1133,7 +1091,6 @@ x_val.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_val.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
x_val.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
x_val.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_val.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
x_val.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_val.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
x_val.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
@ -1155,8 +1112,7 @@ x_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
x_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
x_x509.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
x_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
@ -1178,8 +1134,7 @@ x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
x_x509a.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
x_x509a.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
x_x509a.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_x509a.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
x_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
x_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
x_x509a.o: ../../include/openssl/md4.h ../../include/openssl/md5.h

View File

@ -1009,13 +1009,12 @@ void ERR_load_ASN1_strings(void);
#define ASN1_F_D2I_X509_PKEY 159
#define ASN1_F_I2D_ASN1_TIME 160
#define ASN1_F_I2D_DSA_PUBKEY 161
#define ASN1_F_I2D_ECDSA_PUBKEY 174
#define ASN1_F_I2D_NETSCAPE_RSA 162
#define ASN1_F_I2D_PRIVATEKEY 163
#define ASN1_F_I2D_PUBLICKEY 164
#define ASN1_F_I2D_RSA_PUBKEY 165
#define ASN1_F_LONG_C2I 166
#define ASN1_F_OID_MODULE_INIT 175
#define ASN1_F_OID_MODULE_INIT 174
#define ASN1_F_PKCS5_PBE2_SET 167
#define ASN1_F_X509_CINF_NEW 168
#define ASN1_F_X509_CRL_ADD0_REVOKED 169

View File

@ -1,6 +1,6 @@
/* crypto/asn1/asn1_err.c */
/* ====================================================================
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -128,7 +128,6 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_D2I_X509_PKEY,0), "d2i_X509_PKEY"},
{ERR_PACK(0,ASN1_F_I2D_ASN1_TIME,0), "I2D_ASN1_TIME"},
{ERR_PACK(0,ASN1_F_I2D_DSA_PUBKEY,0), "i2d_DSA_PUBKEY"},
{ERR_PACK(0,ASN1_F_I2D_ECDSA_PUBKEY,0), "i2d_ECDSA_PUBKEY"},
{ERR_PACK(0,ASN1_F_I2D_NETSCAPE_RSA,0), "i2d_Netscape_RSA"},
{ERR_PACK(0,ASN1_F_I2D_PRIVATEKEY,0), "i2d_PrivateKey"},
{ERR_PACK(0,ASN1_F_I2D_PUBLICKEY,0), "i2d_PublicKey"},

View File

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

View File

@ -261,11 +261,9 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
opp=op;
os=d2i_ASN1_OCTET_STRING(NULL,&opp,len+hl);
if (os != NULL && os->length > 0)
if (os != NULL)
{
opp = os->data;
/* testing whether the octet string is
* printable */
opp=os->data;
for (i=0; i<os->length; i++)
{
if (( (opp[i] < ' ') &&
@ -278,8 +276,7 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
break;
}
}
if (printable)
/* printable string */
if (printable && (os->length > 0))
{
if (BIO_write(bp,":",1) <= 0)
goto end;
@ -287,21 +284,8 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
os->length) <= 0)
goto end;
}
else if (!dump)
/* not printable => print octet string
* as hex dump */
{
if (BIO_write(bp,"[HEX DUMP]:",11) <= 0)
goto end;
for (i=0; i<os->length; i++)
{
if (BIO_printf(bp,"%02X"
, opp[i]) <= 0)
goto end;
}
}
else
/* print the normal dump */
if (!printable && (os->length > 0)
&& dump)
{
if (!nl)
{
@ -309,15 +293,11 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
goto end;
}
if (BIO_dump_indent(bp,(char *)opp,
((dump == -1 || dump >
os->length)?os->length:dump),
((dump == -1 || dump > os->length)?os->length:dump),
dump_indent) <= 0)
goto end;
nl=1;
}
}
if (os != NULL)
{
M_ASN1_OCTET_STRING_free(os);
os=NULL;
}

View File

@ -68,9 +68,6 @@
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp,
long length)
@ -110,16 +107,6 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp,
goto err;
}
break;
#endif
#ifndef OPENSSL_NO_ECDSA
case EVP_PKEY_ECDSA:
if ((ret->pkey.ecdsa = d2i_ECDSAPrivateKey(NULL,
(const unsigned char **)pp, length)) == NULL)
{
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
goto err;
}
break;
#endif
default:
ASN1err(ASN1_F_D2I_PRIVATEKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
@ -151,10 +138,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, unsigned char **pp,
/* Since we only need to discern "traditional format" RSA and DSA
* keys we can just count the elements.
*/
if(sk_ASN1_TYPE_num(inkey) == 6)
keytype = EVP_PKEY_DSA;
else if (sk_ASN1_TYPE_num(inkey) == 4)
keytype = EVP_PKEY_ECDSA;
if(sk_ASN1_TYPE_num(inkey) == 6) keytype = EVP_PKEY_DSA;
else keytype = EVP_PKEY_RSA;
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
return d2i_PrivateKey(keytype, a, pp, length);

View File

@ -68,9 +68,6 @@
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
long length)
@ -103,23 +100,13 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
#endif
#ifndef OPENSSL_NO_DSA
case EVP_PKEY_DSA:
if ((ret->pkey.dsa=d2i_DSAPublicKey(&(ret->pkey.dsa),
if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL,
(const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
{
ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
goto err;
}
break;
#endif
#ifndef OPENSSL_NO_ECDSA
case EVP_PKEY_ECDSA:
if ((ret->pkey.ecdsa = ECDSAPublicKey_set_octet_string(&(ret->pkey.ecdsa),
(const unsigned char **)pp, length)) == NULL)
{
ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB);
goto err;
}
break;
#endif
default:
ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);

View File

@ -67,9 +67,6 @@
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
{
@ -86,12 +83,6 @@ int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
return(i2d_DSAPrivateKey(a->pkey.dsa,pp));
}
#endif
#ifndef OPENSSL_NO_ECDSA
if (a->type == EVP_PKEY_ECDSA)
{
return(i2d_ECDSAPrivateKey(a->pkey.ecdsa, pp));
}
#endif
ASN1err(ASN1_F_I2D_PRIVATEKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
return(-1);

View File

@ -67,9 +67,6 @@
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
{
@ -82,10 +79,6 @@ int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
#ifndef OPENSSL_NO_DSA
case EVP_PKEY_DSA:
return(i2d_DSAPublicKey(a->pkey.dsa,pp));
#endif
#ifndef OPENSSL_NO_ECDSA
case EVP_PKEY_ECDSA:
return(ECDSAPublicKey_get_octet_string(a->pkey.ecdsa, pp));
#endif
default:
ASN1err(ASN1_F_I2D_PUBLICKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);

View File

@ -58,7 +58,6 @@
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/objects.h>
#include <openssl/buffer.h>
#include <openssl/bn.h>
#ifndef OPENSSL_NO_RSA
@ -70,29 +69,26 @@
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
static int print(BIO *fp,const char *str,BIGNUM *num,
unsigned char *buf,int off);
#ifndef OPENSSL_NO_RSA
#ifndef OPENSSL_NO_FP_API
int RSA_print_fp(FILE *fp, const RSA *x, int off)
{
BIO *b;
int ret;
{
BIO *b;
int ret;
if ((b=BIO_new(BIO_s_file())) == NULL)
if ((b=BIO_new(BIO_s_file())) == NULL)
{
RSAerr(RSA_F_RSA_PRINT_FP,ERR_R_BUF_LIB);
return(0);
return(0);
}
BIO_set_fp(b,fp,BIO_NOCLOSE);
ret=RSA_print(b,x,off);
BIO_free(b);
return(ret);
}
BIO_set_fp(b,fp,BIO_NOCLOSE);
ret=RSA_print(b,x,off);
BIO_free(b);
return(ret);
}
#endif
int RSA_print(BIO *bp, const RSA *x, int off)
@ -240,293 +236,6 @@ err:
}
#endif /* !OPENSSL_NO_DSA */
#ifndef OPENSSL_NO_EC
#ifndef OPENSSL_NO_FP_API
int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off)
{
BIO *b;
int ret;
if ((b=BIO_new(BIO_s_file())) == NULL)
{
ECerr(EC_F_ECPKPARAMETERS_PRINT_FP,ERR_R_BUF_LIB);
return(0);
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
ret = ECPKParameters_print(b, x, off);
BIO_free(b);
return(ret);
}
#endif
int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
{
char str[128];
unsigned char *buffer=NULL;
size_t buf_len=0, i;
int ret=0, reason=ERR_R_BIO_LIB;
BN_CTX *ctx=NULL;
EC_POINT *point=NULL;
BIGNUM *p=NULL, *a=NULL, *b=NULL, *gen=NULL,
*order=NULL, *cofactor=NULL, *seed=NULL;
static const char *gen_compressed = "Generator (compressed):";
static const char *gen_uncompressed = "Generator (uncompressed):";
static const char *gen_hybrid = "Generator (hybrid):";
if (!x)
{
reason = ERR_R_PASSED_NULL_PARAMETER;
goto err;
}
if (EC_GROUP_get_asn1_flag(x))
{
/* the curve parameter are given by an asn1 OID */
int nid;
if (off)
{
if (off > 128)
off=128;
memset(str, ' ', off);
if (BIO_write(bp, str, off) <= 0)
goto err;
}
nid = EC_GROUP_get_nid(x);
if (nid == 0)
goto err;
if (BIO_printf(bp, "ASN1 OID: %s", OBJ_nid2sn(nid)) <= 0)
goto err;
if (BIO_printf(bp, "\n") <= 0)
goto err;
}
else
{
/* explicit parameters */
/* TODO */
point_conversion_form_t form;
if ((p = BN_new()) == NULL || (a = BN_new()) == NULL ||
(b = BN_new()) == NULL || (order = BN_new()) == NULL ||
(cofactor = BN_new()) == NULL)
{
reason = ERR_R_MALLOC_FAILURE;
goto err;
}
if (!EC_GROUP_get_curve_GFp(x, p, a, b, ctx))
{
reason = ERR_R_EC_LIB;
goto err;
}
if ((point = EC_GROUP_get0_generator(x)) == NULL)
{
reason = ERR_R_EC_LIB;
goto err;
}
if (!EC_GROUP_get_order(x, order, NULL) ||
!EC_GROUP_get_cofactor(x, cofactor, NULL))
{
reason = ERR_R_EC_LIB;
goto err;
}
form = EC_GROUP_get_point_conversion_form(x);
if ((gen = EC_POINT_point2bn(x, point,
form, NULL, ctx)) == NULL)
{
reason = ERR_R_EC_LIB;
goto err;
}
buf_len = (size_t)BN_num_bytes(p);
if (buf_len < (i = (size_t)BN_num_bytes(a)))
buf_len = i;
if (buf_len < (i = (size_t)BN_num_bytes(b)))
buf_len = i;
if (buf_len < (i = (size_t)BN_num_bytes(gen)))
buf_len = i;
if (buf_len < (i = (size_t)BN_num_bytes(order)))
buf_len = i;
if (buf_len < (i = (size_t)BN_num_bytes(cofactor)))
buf_len = i;
if (EC_GROUP_get0_seed(x))
{
seed = BN_bin2bn(EC_GROUP_get0_seed(x),
EC_GROUP_get_seed_len(x), NULL);
if (seed == NULL)
{
reason = ERR_R_BN_LIB;
goto err;
}
if (buf_len < (i = (size_t)BN_num_bytes(seed)))
buf_len = i;
}
buf_len += 10;
if ((buffer = OPENSSL_malloc(buf_len)) == NULL)
{
reason = ERR_R_MALLOC_FAILURE;
goto err;
}
if (off)
{
if (off > 128) off=128;
memset(str,' ',off);
}
if ((p != NULL) && !print(bp, "P: ", p, buffer, off))
goto err;
if ((a != NULL) && !print(bp, "A: ", a, buffer, off))
goto err;
if ((b != NULL) && !print(bp, "B: ", b, buffer, off))
goto err;
if (form == POINT_CONVERSION_COMPRESSED)
{
if ((gen != NULL) && !print(bp, gen_compressed, gen,
buffer, off))
goto err;
}
else if (form == POINT_CONVERSION_UNCOMPRESSED)
{
if ((gen != NULL) && !print(bp, gen_uncompressed, gen,
buffer, off))
goto err;
}
else /* form == POINT_CONVERSION_HYBRID */
{
if ((gen != NULL) && !print(bp, gen_hybrid, gen,
buffer, off))
goto err;
}
if ((order != NULL) && !print(bp, "Order: ", order,
buffer, off)) goto err;
if ((cofactor != NULL) && !print(bp, "Cofactor: ", cofactor,
buffer, off)) goto err;
if ((seed != NULL) && !print(bp, "Seed:", seed,
buffer, off)) goto err;
}
ret=1;
err:
if (!ret)
ECerr(EC_F_ECPKPARAMETERS_PRINT, reason);
if (p)
BN_free(p);
if (a)
BN_free(a);
if (b)
BN_free(b);
if (gen)
BN_free(gen);
if (order)
BN_free(order);
if (cofactor)
BN_free(cofactor);
if (seed)
BN_free(seed);
if (ctx)
BN_CTX_free(ctx);
if (buffer != NULL)
OPENSSL_free(buffer);
return(ret);
}
#endif /* OPENSSL_NO_EC */
#ifndef OPENSSL_NO_ECDSA
#ifndef OPENSSL_NO_FP_API
int ECDSA_print_fp(FILE *fp, const ECDSA *x, int off)
{
BIO *b;
int ret;
if ((b=BIO_new(BIO_s_file())) == NULL)
{
ECDSAerr(ECDSA_F_ECDSA_PRINT_FP, ERR_R_BIO_LIB);
return(0);
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
ret = ECDSA_print(b, x, off);
BIO_free(b);
return(ret);
}
#endif
int ECDSA_print(BIO *bp, const ECDSA *x, int off)
{
char str[128];
unsigned char *buffer=NULL;
size_t buf_len=0, i;
int ret=0, reason=ERR_R_BIO_LIB;
BIGNUM *pub_key=NULL;
BN_CTX *ctx=NULL;
if (!x || !x->group)
{
reason = ERR_R_PASSED_NULL_PARAMETER;
goto err;
}
if ((pub_key = EC_POINT_point2bn(x->group, x->pub_key,
ECDSA_get_conversion_form(x), NULL, ctx)) == NULL)
{
reason = ERR_R_EC_LIB;
goto err;
}
buf_len = (size_t)BN_num_bytes(pub_key);
if (x->priv_key)
{
if ((i = (size_t)BN_num_bytes(x->priv_key)) > buf_len)
buf_len = i;
}
buf_len += 10;
if ((buffer = OPENSSL_malloc(buf_len)) == NULL)
{
reason = ERR_R_MALLOC_FAILURE;
goto err;
}
if (off)
{
if (off > 128) off=128;
memset(str,' ',off);
}
if (x->priv_key != NULL)
{
if (off && (BIO_write(bp, str, off) <= 0)) goto err;
if (BIO_printf(bp, "Private-Key: (%d bit)\n",
BN_num_bits(x->priv_key)) <= 0) goto err;
}
if ((x->priv_key != NULL) && !print(bp, "priv:", x->priv_key,
buffer, off))
goto err;
if ((pub_key != NULL) && !print(bp, "pub: ", pub_key,
buffer, off))
goto err;
if (!ECPKParameters_print(bp, x->group, off))
goto err;
ret=1;
err:
if (!ret)
ECDSAerr(ECDSA_F_ECDSA_PRINT, reason);
if (pub_key)
BN_free(pub_key);
if (ctx)
BN_CTX_free(ctx);
if (buffer != NULL)
OPENSSL_free(buffer);
return(ret);
}
#endif
static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf,
int off)
{
@ -580,20 +289,20 @@ static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf,
#ifndef OPENSSL_NO_DH
#ifndef OPENSSL_NO_FP_API
int DHparams_print_fp(FILE *fp, const DH *x)
{
BIO *b;
int ret;
{
BIO *b;
int ret;
if ((b=BIO_new(BIO_s_file())) == NULL)
if ((b=BIO_new(BIO_s_file())) == NULL)
{
DHerr(DH_F_DHPARAMS_PRINT_FP,ERR_R_BUF_LIB);
return(0);
return(0);
}
BIO_set_fp(b,fp,BIO_NOCLOSE);
ret=DHparams_print(b, x);
BIO_free(b);
return(ret);
}
BIO_set_fp(b,fp,BIO_NOCLOSE);
ret=DHparams_print(b, x);
BIO_free(b);
return(ret);
}
#endif
int DHparams_print(BIO *bp, const DH *x)
@ -638,20 +347,20 @@ err:
#ifndef OPENSSL_NO_DSA
#ifndef OPENSSL_NO_FP_API
int DSAparams_print_fp(FILE *fp, const DSA *x)
{
BIO *b;
int ret;
{
BIO *b;
int ret;
if ((b=BIO_new(BIO_s_file())) == NULL)
if ((b=BIO_new(BIO_s_file())) == NULL)
{
DSAerr(DSA_F_DSAPARAMS_PRINT_FP,ERR_R_BUF_LIB);
return(0);
return(0);
}
BIO_set_fp(b,fp,BIO_NOCLOSE);
ret=DSAparams_print(b, x);
BIO_free(b);
return(ret);
}
BIO_set_fp(b,fp,BIO_NOCLOSE);
ret=DSAparams_print(b, x);
BIO_free(b);
return(ret);
}
#endif
int DSAparams_print(BIO *bp, const DSA *x)
@ -690,59 +399,3 @@ err:
#endif /* !OPENSSL_NO_DSA */
#ifndef OPENSSL_NO_ECDSA
#ifndef OPENSSL_NO_FP_API
int ECDSAParameters_print_fp(FILE *fp, const ECDSA *x)
{
BIO *b;
int ret;
if ((b=BIO_new(BIO_s_file())) == NULL)
{
ECDSAerr(ECDSA_F_ECDSAPARAMETERS_PRINT_FP, ERR_R_BIO_LIB);
return(0);
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
ret = ECDSAParameters_print(b, x);
BIO_free(b);
return(ret);
}
#endif
int ECDSAParameters_print(BIO *bp, const ECDSA *x)
{
int reason=ERR_R_EC_LIB, ret=0;
BIGNUM *order=NULL;
if (!x || !x->group)
{
reason = ERR_R_PASSED_NULL_PARAMETER;;
goto err;
}
if ((order = BN_new()) == NULL)
{
reason = ERR_R_MALLOC_FAILURE;
goto err;
}
if (!EC_GROUP_get_order(x->group, order, NULL))
{
reason = ERR_R_EC_LIB;
goto err;
}
if (BIO_printf(bp, "ECDSA-Parameters: (%d bit)\n",
BN_num_bits(order)) <= 0)
goto err;
if (!ECPKParameters_print(bp, x->group, 4))
goto err;
ret=1;
err:
if (order)
BN_free(order);
ECDSAerr(ECDSA_F_ECDSAPARAMETERS_PRINT, reason);
return(ret);
}
#endif

View File

@ -134,15 +134,6 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
}
else
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey != NULL && pkey->type == EVP_PKEY_ECDSA)
{
BIO_printf(bp, "%12sECDSA Public Key: \n","");
ECDSA_print(bp, pkey->pkey.ecdsa, 16);
}
else
#endif
BIO_printf(bp,"%12sUnknown Public Key:\n","");
if (pkey != NULL)

View File

@ -93,15 +93,6 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
}
else
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
{
BIO_printf(out, " ECDSA Public Key:\n");
ECDSA_print(out, pkey->pkey.ecdsa,2);
}
else
#endif
BIO_printf(out," Unknown Public Key:\n");
EVP_PKEY_free(pkey);
}

View File

@ -66,9 +66,6 @@
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
@ -231,14 +228,6 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
DSA_print(bp,pkey->pkey.dsa,16);
}
else
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
{
BIO_printf(bp, "%12sECDSA Public Key:\n","");
ECDSA_print(bp, pkey->pkey.ecdsa, 16);
}
else
#endif
BIO_printf(bp,"%12sUnknown Public Key:\n","");

View File

@ -63,14 +63,13 @@
/* Minor tweak to operation: free up EVP_PKEY */
static int pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it)
{
if (operation == ASN1_OP_FREE_POST)
{
{
if(operation == ASN1_OP_FREE_POST) {
X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval;
EVP_PKEY_free(pubkey->pkey);
}
return 1;
}
return 1;
}
ASN1_SEQUENCE_cb(X509_PUBKEY, pubkey_cb) = {
ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR),
@ -109,12 +108,13 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
a->parameter->type=V_ASN1_NULL;
}
}
else
#ifndef OPENSSL_NO_DSA
else if (pkey->type == EVP_PKEY_DSA)
if (pkey->type == EVP_PKEY_DSA)
{
unsigned char *pp;
DSA *dsa;
dsa=pkey->pkey.dsa;
dsa->write_params=0;
ASN1_TYPE_free(a->parameter);
@ -128,62 +128,8 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
ASN1_STRING_set(a->parameter->value.sequence,p,i);
OPENSSL_free(p);
}
else
#endif
#ifndef OPENSSL_NO_ECDSA
else if (pkey->type == EVP_PKEY_ECDSA)
{
int nid=0;
unsigned char *pp;
ECDSA *ecdsa;
ecdsa = pkey->pkey.ecdsa;
ASN1_TYPE_free(a->parameter);
if ((a->parameter = ASN1_TYPE_new()) == NULL)
{
X509err(X509_F_X509_PUBKEY_SET, ERR_R_ASN1_LIB);
goto err;
}
if (EC_GROUP_get_asn1_flag(ecdsa->group)
&& (nid = EC_GROUP_get_nid(ecdsa->group)))
{
/* just set the OID */
a->parameter->type = V_ASN1_OBJECT;
a->parameter->value.object = OBJ_nid2obj(nid);
}
else /* explicit parameters */
{
if ((i = i2d_ECDSAParameters(ecdsa, NULL)) == 0)
{
X509err(X509_F_X509_PUBKEY_SET, ERR_R_ECDSA_LIB);
goto err;
}
if ((p = (unsigned char *) OPENSSL_malloc(i)) == NULL)
{
X509err(X509_F_X509_PUBKEY_SET, ERR_R_MALLOC_FAILURE);
goto err;
}
pp = p;
if (!i2d_ECDSAParameters(ecdsa, &pp))
{
X509err(X509_F_X509_PUBKEY_SET, ERR_R_ECDSA_LIB);
OPENSSL_free(p);
goto err;
}
a->parameter->type = V_ASN1_SEQUENCE;
if ((a->parameter->value.sequence = ASN1_STRING_new()) == NULL)
{
X509err(X509_F_X509_PUBKEY_SET, ERR_R_ASN1_LIB);
OPENSSL_free(p);
goto err;
}
ASN1_STRING_set(a->parameter->value.sequence, p, i);
OPENSSL_free(p);
}
}
#endif
else if (1)
{
X509err(X509_F_X509_PUBKEY_SET,X509_R_UNSUPPORTED_ALGORITHM);
goto err;
@ -227,7 +173,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
long j;
int type;
unsigned char *p;
#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA)
#ifndef OPENSSL_NO_DSA
const unsigned char *cp;
X509_ALGOR *a;
#endif
@ -235,101 +181,40 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
if (key == NULL) goto err;
if (key->pkey != NULL)
{
CRYPTO_add(&key->pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);
return(key->pkey);
}
{
CRYPTO_add(&key->pkey->references,1,CRYPTO_LOCK_EVP_PKEY);
return(key->pkey);
}
if (key->public_key == NULL) goto err;
type=OBJ_obj2nid(key->algor->algorithm);
if ((ret = EVP_PKEY_new()) == NULL)
p=key->public_key->data;
j=key->public_key->length;
if ((ret=d2i_PublicKey(type,NULL,&p,(long)j)) == NULL)
{
X509err(X509_F_X509_PUBKEY_GET, ERR_R_MALLOC_FAILURE);
X509err(X509_F_X509_PUBKEY_GET,X509_R_ERR_ASN1_LIB);
goto err;
}
ret->type = EVP_PKEY_type(type);
ret->save_parameters=0;
/* the parameters must be extracted before the public key (ECDSA!) */
#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA)
a=key->algor;
#endif
if (0)
;
#ifndef OPENSSL_NO_DSA
else if (ret->type == EVP_PKEY_DSA)
a=key->algor;
if (ret->type == EVP_PKEY_DSA)
{
if (a->parameter && (a->parameter->type == V_ASN1_SEQUENCE))
{
if ((ret->pkey.dsa = DSA_new()) == NULL)
{
X509err(X509_F_X509_PUBKEY_GET, ERR_R_MALLOC_FAILURE);
goto err;
}
ret->pkey.dsa->write_params=0;
cp=p=a->parameter->value.sequence->data;
j=a->parameter->value.sequence->length;
if (!d2i_DSAparams(&ret->pkey.dsa, &cp, (long)j))
if (!d2i_DSAparams(&ret->pkey.dsa,&cp,(long)j))
goto err;
}
ret->save_parameters=1;
}
#endif
#ifndef OPENSSL_NO_ECDSA
else if (ret->type == EVP_PKEY_ECDSA)
{
if (a->parameter && (a->parameter->type == V_ASN1_SEQUENCE))
{
/* type == V_ASN1_SEQUENCE => we have explicit parameters
* (e.g. parameters in the X9_62_EC_PARAMETERS-structure )
*/
if ((ret->pkey.ecdsa= ECDSA_new()) == NULL)
{
X509err(X509_F_X509_PUBKEY_GET, ERR_R_MALLOC_FAILURE);
goto err;
}
cp = p = a->parameter->value.sequence->data;
j = a->parameter->value.sequence->length;
if (!d2i_ECDSAParameters(&ret->pkey.ecdsa, &cp, (long)j))
{
X509err(X509_F_X509_PUBKEY_GET, ERR_R_ECDSA_LIB);
goto err;
}
}
else if (a->parameter && (a->parameter->type == V_ASN1_OBJECT))
{
/* type == V_ASN1_OBJECT => the parameters are given
* by an asn1 OID
*/
ECDSA *ecdsa;
if (ret->pkey.ecdsa == NULL)
ret->pkey.ecdsa = ECDSA_new();
ecdsa = ret->pkey.ecdsa;
if (ecdsa->group)
EC_GROUP_free(ecdsa->group);
if ((ecdsa->group = EC_GROUP_new_by_name(
OBJ_obj2nid(a->parameter->value.object))) == NULL)
goto err;
EC_GROUP_set_asn1_flag(ecdsa->group,
OPENSSL_EC_NAMED_CURVE);
}
/* the case implicitlyCA is currently not implemented */
ret->save_parameters = 1;
}
#endif
p=key->public_key->data;
j=key->public_key->length;
if ((ret = d2i_PublicKey(type, &ret, &p, (long)j)) == NULL)
{
X509err(X509_F_X509_PUBKEY_GET, X509_R_ERR_ASN1_LIB);
goto err;
}
key->pkey = ret;
CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY);
key->pkey=ret;
CRYPTO_add(&ret->references,1,CRYPTO_LOCK_EVP_PKEY);
return(ret);
err:
if (ret != NULL)
@ -343,7 +228,7 @@ err:
EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, unsigned char **pp,
long length)
{
{
X509_PUBKEY *xpk;
EVP_PKEY *pktmp;
xpk = d2i_X509_PUBKEY(NULL, pp, length);
@ -351,16 +236,15 @@ EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, unsigned char **pp,
pktmp = X509_PUBKEY_get(xpk);
X509_PUBKEY_free(xpk);
if(!pktmp) return NULL;
if(a)
{
if(a) {
EVP_PKEY_free(*a);
*a = pktmp;
}
return pktmp;
}
return pktmp;
}
int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp)
{
{
X509_PUBKEY *xpk=NULL;
int ret;
if(!a) return 0;
@ -368,7 +252,7 @@ int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp)
ret = i2d_X509_PUBKEY(xpk, pp);
X509_PUBKEY_free(xpk);
return ret;
}
}
/* The following are equivalents but which return RSA and DSA
* keys
@ -376,117 +260,75 @@ int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp)
#ifndef OPENSSL_NO_RSA
RSA *d2i_RSA_PUBKEY(RSA **a, unsigned char **pp,
long length)
{
{
EVP_PKEY *pkey;
RSA *key;
unsigned char *q;
q = *pp;
pkey = d2i_PUBKEY(NULL, &q, length);
if (!pkey) return NULL;
if(!pkey) return NULL;
key = EVP_PKEY_get1_RSA(pkey);
EVP_PKEY_free(pkey);
if (!key) return NULL;
if(!key) return NULL;
*pp = q;
if (a)
{
if(a) {
RSA_free(*a);
*a = key;
}
return key;
}
return key;
}
int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp)
{
{
EVP_PKEY *pktmp;
int ret;
if (!a) return 0;
if(!a) return 0;
pktmp = EVP_PKEY_new();
if (!pktmp)
{
if(!pktmp) {
ASN1err(ASN1_F_I2D_RSA_PUBKEY, ERR_R_MALLOC_FAILURE);
return 0;
}
}
EVP_PKEY_set1_RSA(pktmp, a);
ret = i2d_PUBKEY(pktmp, pp);
EVP_PKEY_free(pktmp);
return ret;
}
}
#endif
#ifndef OPENSSL_NO_DSA
DSA *d2i_DSA_PUBKEY(DSA **a, unsigned char **pp,
long length)
{
{
EVP_PKEY *pkey;
DSA *key;
unsigned char *q;
q = *pp;
pkey = d2i_PUBKEY(NULL, &q, length);
if (!pkey) return NULL;
if(!pkey) return NULL;
key = EVP_PKEY_get1_DSA(pkey);
EVP_PKEY_free(pkey);
if (!key) return NULL;
if(!key) return NULL;
*pp = q;
if (a)
{
if(a) {
DSA_free(*a);
*a = key;
}
return key;
}
return key;
}
int i2d_DSA_PUBKEY(DSA *a, unsigned char **pp)
{
{
EVP_PKEY *pktmp;
int ret;
if(!a) return 0;
pktmp = EVP_PKEY_new();
if(!pktmp)
{
if(!pktmp) {
ASN1err(ASN1_F_I2D_DSA_PUBKEY, ERR_R_MALLOC_FAILURE);
return 0;
}
}
EVP_PKEY_set1_DSA(pktmp, a);
ret = i2d_PUBKEY(pktmp, pp);
EVP_PKEY_free(pktmp);
return ret;
}
#endif
#ifndef OPENSSL_NO_ECDSA
ECDSA *d2i_ECDSA_PUBKEY(ECDSA **a, unsigned char **pp, long length)
{
EVP_PKEY *pkey;
ECDSA *key;
unsigned char *q;
q = *pp;
pkey = d2i_PUBKEY(NULL, &q, length);
if (!pkey) return(NULL);
key = EVP_PKEY_get1_ECDSA(pkey);
EVP_PKEY_free(pkey);
if (!key) return(NULL);
*pp = q;
if (a)
{
ECDSA_free(*a);
*a = key;
}
return(key);
}
int i2d_ECDSA_PUBKEY(ECDSA *a, unsigned char **pp)
{
EVP_PKEY *pktmp;
int ret;
if (!a) return(0);
if ((pktmp = EVP_PKEY_new()) == NULL)
{
ASN1err(ASN1_F_I2D_ECDSA_PUBKEY, ERR_R_MALLOC_FAILURE);
return(0);
}
EVP_PKEY_set1_ECDSA(pktmp, a);
ret = i2d_PUBKEY(pktmp, pp);
EVP_PKEY_free(pktmp);
return(ret);
}
}
#endif

View File

@ -397,6 +397,12 @@ BIGNUM *bn_dup_expand(const BIGNUM *b, int words)
{
BIGNUM *r = NULL;
/* This function does not work if
* words <= b->dmax && top < words
* because BN_dup() does not preserve 'dmax'!
* (But bn_dup_expand() is not used anywhere yet.)
*/
if (words > b->dmax)
{
BN_ULONG *a = bn_expand_internal(b, words);

View File

@ -89,14 +89,14 @@ conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
conf_api.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
conf_api.o: conf_api.c
conf_def.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
conf_def.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h
conf_def.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
conf_def.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
conf_def.o: ../../include/openssl/opensslconf.h
conf_def.o: ../../e_os.h ../../include/openssl/bio.h
conf_def.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
conf_def.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
conf_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
conf_def.o: conf_def.c conf_def.h
conf_def.o: ../cryptlib.h conf_def.c conf_def.h
conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
conf_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
@ -112,20 +112,19 @@ conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
conf_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
conf_lib.o: conf_lib.c
conf_mall.o: ../../e_os.h ../../include/openssl/aes.h
conf_mall.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
conf_mall.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
conf_mall.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
conf_mall.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
conf_mall.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
conf_mall.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
conf_mall.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
conf_mall.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
conf_mall.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
conf_mall.o: ../../include/openssl/err.h ../../include/openssl/evp.h
conf_mall.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
conf_mall.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
conf_mall.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
conf_mall.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
conf_mall.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
conf_mall.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
conf_mall.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
conf_mall.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
conf_mall.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
conf_mall.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
conf_mall.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
conf_mall.o: ../../include/openssl/engine.h ../../include/openssl/err.h
conf_mall.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
conf_mall.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
conf_mall.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
conf_mall.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
conf_mall.o: ../../include/openssl/objects.h
conf_mall.o: ../../include/openssl/opensslconf.h
conf_mall.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
conf_mall.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
@ -137,20 +136,19 @@ conf_mall.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
conf_mall.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
conf_mall.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mall.c
conf_mod.o: ../../e_os.h ../../include/openssl/aes.h
conf_mod.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
conf_mod.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
conf_mod.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
conf_mod.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
conf_mod.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
conf_mod.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
conf_mod.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
conf_mod.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
conf_mod.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
conf_mod.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
conf_mod.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
conf_mod.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
conf_mod.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
conf_mod.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
conf_mod.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
conf_mod.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
conf_mod.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
conf_mod.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
conf_mod.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
conf_mod.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
conf_mod.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
conf_mod.o: ../../include/openssl/err.h ../../include/openssl/evp.h
conf_mod.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
conf_mod.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
conf_mod.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
conf_mod.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
conf_mod.o: ../../include/openssl/opensslconf.h
conf_mod.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
conf_mod.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
conf_mod.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
@ -161,21 +159,19 @@ conf_mod.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
conf_mod.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
conf_mod.o: ../cryptlib.h conf_mod.c
conf_sap.o: ../../e_os.h ../../include/openssl/aes.h
conf_sap.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
conf_sap.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
conf_sap.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
conf_sap.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
conf_sap.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
conf_sap.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
conf_sap.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
conf_sap.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
conf_sap.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
conf_sap.o: ../../include/openssl/err.h ../../include/openssl/evp.h
conf_sap.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
conf_sap.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
conf_sap.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
conf_sap.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
conf_sap.o: ../../include/openssl/opensslconf.h
conf_sap.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
conf_sap.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
conf_sap.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
conf_sap.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
conf_sap.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
conf_sap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
conf_sap.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
conf_sap.o: ../../include/openssl/engine.h ../../include/openssl/err.h
conf_sap.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
conf_sap.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
conf_sap.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
conf_sap.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
conf_sap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
conf_sap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
conf_sap.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
conf_sap.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h

View File

@ -67,6 +67,7 @@
#include "conf_def.h"
#include <openssl/buffer.h>
#include <openssl/err.h>
#include "cryptlib.h"
static char *eat_ws(CONF *conf, char *p);
static char *eat_alpha_numeric(CONF *conf, char *p);
@ -208,12 +209,12 @@ static int def_load(CONF *conf, const char *name, long *line)
static int def_load_bio(CONF *conf, BIO *in, long *line)
{
#define BUFSIZE 512
char btmp[16];
int bufnum=0,i,ii;
BUF_MEM *buff=NULL;
char *s,*p,*end;
int again,n;
long eline=0;
char btmp[DECIMAL_SIZE(eline)+1];
CONF_VALUE *v=NULL,*tv;
CONF_VALUE *sv=NULL;
char *section=NULL,*buf;

View File

@ -230,7 +230,7 @@ static int module_run(const CONF *cnf, char *name, char *value,
{
if (!(flags & CONF_MFLAGS_SILENT))
{
char rcode[10];
char rcode[DECIMAL_SIZE(ret)+1];
CONFerr(CONF_F_CONF_MODULES_LOAD, CONF_R_MODULE_INITIALIZATION_ERROR);
sprintf(rcode, "%-8d", ret);
ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);

View File

@ -103,9 +103,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
"dynlock",
"engine",
"ui",
"ecdsa",
"ec",
#if CRYPTO_NUM_LOCKS != 33
#if CRYPTO_NUM_LOCKS != 31
# error "Inconsistency between crypto.h and cryptlib.c"
#endif
};
@ -494,3 +492,11 @@ 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

@ -89,6 +89,14 @@ extern "C" {
#define X509_CERT_DIR_EVP "SSL_CERT_DIR"
#define X509_CERT_FILE_EVP "SSL_CERT_FILE"
/* size of string represenations */
#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1)
#define HEX_SIZE(type) ((sizeof(type)*2)
/* die if we have to */
void OpenSSLDie(const char *file,int line,const char *assertion);
#define die(e) ((e) ? (void)0 : OpenSSLDie(__FILE__, __LINE__, #e))
#ifdef __cplusplus
}
#endif

View File

@ -202,14 +202,12 @@ $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
"bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
"bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
"bn_recp,bn_mont,bn_mpi,bn_exp2"
$ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_recp,ecp_nist,ec_cvt,ec_mult,"+ -
"ec_err"
$ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
"rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
"rsa_asn1"
$ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_recp,ecp_nist,ec_cvt,ec_mult,"+ -
"ec_err"
$ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl"
$ LIB_ECDSA = "ecs_lib,ecs_gen,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,"+ -
"ecs_key,ecs_err"
$ LIB_DH = "dh_asn1,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"

View File

@ -126,9 +126,7 @@ extern "C" {
#define CRYPTO_LOCK_DYNLOCK 28
#define CRYPTO_LOCK_ENGINE 29
#define CRYPTO_LOCK_UI 30
#define CRYPTO_LOCK_ECDSA 31
#define CRYPTO_LOCK_EC 32
#define CRYPTO_NUM_LOCKS 33
#define CRYPTO_NUM_LOCKS 31
#define CRYPTO_LOCK 1
#define CRYPTO_UNLOCK 2
@ -235,7 +233,6 @@ DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
#define CRYPTO_EX_INDEX_ENGINE 9
#define CRYPTO_EX_INDEX_X509 10
#define CRYPTO_EX_INDEX_UI 11
#define CRYPTO_EX_INDEX_ECDSA 12
/* Dynamically assigned indexes start from this value (don't use directly, use
* via CRYPTO_ex_data_new_class). */

View File

@ -69,7 +69,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef OPENSSL_SYS_MSDOS
#if !defined(OPENSSL_SYS_VMS) || defined(__DECC)
@ -90,6 +89,10 @@
#include <io.h>
#endif
#if defined(__STDC__) || defined(OPENSSL_SYS_VMS) || defined(M_XENIX) || defined(OPENSSL_SYS_MSDOS)
#include <string.h>
#endif
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT

View File

@ -112,12 +112,10 @@ dh_gen.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dh_gen.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
dh_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dh_gen.o: ../cryptlib.h dh_gen.c
dh_key.o: ../../e_os.h ../../include/openssl/asn1.h
dh_key.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
dh_key.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
dh_key.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dh_key.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dh_key.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
dh_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
dh_key.o: ../../include/openssl/engine.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/ossl_typ.h
@ -125,12 +123,10 @@ dh_key.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dh_key.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
dh_key.o: ../cryptlib.h dh_key.c
dh_lib.o: ../../e_os.h ../../include/openssl/asn1.h
dh_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
dh_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
dh_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dh_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
dh_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
dh_lib.o: ../../include/openssl/engine.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/ossl_typ.h

View File

@ -129,54 +129,49 @@ dsa_key.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
dsa_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dsa_key.o: ../cryptlib.h dsa_key.c
dsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h
dsa_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
dsa_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dsa_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
dsa_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
dsa_lib.o: ../../include/openssl/engine.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/ossl_typ.h
dsa_lib.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
dsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dsa_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
dsa_lib.o: ../cryptlib.h dsa_lib.c
dsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
dsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
dsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
dsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dsa_lib.o: ../../include/openssl/ui.h ../cryptlib.h dsa_lib.c
dsa_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
dsa_ossl.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
dsa_ossl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dsa_ossl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
dsa_ossl.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
dsa_ossl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dsa_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dsa_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dsa_ossl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
dsa_ossl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
dsa_ossl.o: ../../include/openssl/opensslconf.h
dsa_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dsa_ossl.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
dsa_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dsa_ossl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
dsa_ossl.o: ../cryptlib.h dsa_ossl.c
dsa_sign.o: ../../e_os.h ../../include/openssl/asn1.h
dsa_sign.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
dsa_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
dsa_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
dsa_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dsa_sign.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dsa_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
dsa_sign.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
dsa_sign.o: ../../include/openssl/opensslconf.h
dsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dsa_sign.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
dsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dsa_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
dsa_sign.o: ../cryptlib.h dsa_sign.c
dsa_vrf.o: ../../e_os.h ../../include/openssl/asn1.h
dsa_vrf.o: ../../include/openssl/asn1_mac.h ../../include/openssl/asn1t.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_os2.h ../../include/openssl/ec.h
dsa_vrf.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.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/ossl_typ.h ../../include/openssl/rand.h
dsa_vrf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
dsa_vrf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dsa_vrf.o: ../../include/openssl/ui.h ../cryptlib.h dsa_vrf.c
dsa_vrf.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
dsa_vrf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dsa_vrf.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dsa_vrf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
dsa_vrf.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_vrf.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dsa_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
dsa_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dsa_vrf.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
dsa_vrf.o: ../cryptlib.h dsa_vrf.c

View File

@ -1,4 +1,4 @@
/* dso.h -*- mode:C; c-file-style: "eay" -*- */
/* dso.h */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
@ -107,22 +107,6 @@ typedef struct dso_st DSO;
* condition) or a newly allocated string containing the transformed form that
* the caller will need to free with OPENSSL_free() when done. */
typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
/* The function prototype used for method functions (or caller-provided
* callbacks) that merge two file specifications. They are passed a
* DSO structure pointer (or NULL if they are to be used independantly of
* a DSO object) and two file specifications to merge. They should
* either return NULL (if there is an error condition) or a newly allocated
* string containing the result of merging that the caller will need
* to free with OPENSSL_free() when done.
* Here, merging means that bits and pieces are taken from each of the
* file specifications and added together in whatever fashion that is
* sensible for the DSO method in question. The only rule that really
* applies is that if the two specification contain pieces of the same
* type, the copy from the string string takes priority. One could see
* it as the first specification is the one given by the user and the
* second being a bunch of defaults to add on if they're missing in the
* first. */
typedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
typedef struct dso_meth_st
{
@ -156,9 +140,6 @@ typedef struct dso_meth_st
/* The default DSO_METHOD-specific function for converting filenames to
* a canonical native form. */
DSO_NAME_CONVERTER_FUNC dso_name_converter;
/* The default DSO_METHOD-specific function for converting filenames to
* a canonical native form. */
DSO_MERGER_FUNC dso_merger;
/* [De]Initialisation handlers. */
int (*init)(DSO *dso);
@ -183,13 +164,9 @@ struct dso_st
* don't touch meth_data! */
CRYPTO_EX_DATA ex_data;
/* If this callback function pointer is set to non-NULL, then it will
* be used in DSO_load() in place of meth->dso_name_converter. NB: This
* be used on DSO_load() in place of meth->dso_name_converter. NB: This
* should normally set using DSO_set_name_converter(). */
DSO_NAME_CONVERTER_FUNC name_converter;
/* If this callback function pointer is set to non-NULL, then it will
* be used in DSO_load() in place of meth->dso_merger. NB: This
* should normally set using DSO_set_merger(). */
DSO_MERGER_FUNC merger;
/* This is populated with (a copy of) the platform-independant
* filename used for this DSO. */
char *filename;
@ -232,11 +209,6 @@ int DSO_set_filename(DSO *dso, const char *filename);
* caller-created DSO_METHODs can do the same thing. A non-NULL return value
* will need to be OPENSSL_free()'d. */
char *DSO_convert_filename(DSO *dso, const char *filename);
/* This function will invoke the DSO's merger callback to merge two file
* specifications, or if the callback isn't set it will instead use the
* DSO_METHOD's merger. A non-NULL return value will need to be
* OPENSSL_free()'d. */
char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
/* If the DSO is currently loaded, this returns the filename that it was loaded
* under, otherwise it returns NULL. So it is also useful as a test as to
* whether the DSO is currently loaded. NB: This will not necessarily return
@ -301,13 +273,11 @@ void ERR_load_DSO_strings(void);
#define DSO_F_DLFCN_BIND_FUNC 100
#define DSO_F_DLFCN_BIND_VAR 101
#define DSO_F_DLFCN_LOAD 102
#define DSO_F_DLFCN_MERGER 130
#define DSO_F_DLFCN_NAME_CONVERTER 123
#define DSO_F_DLFCN_UNLOAD 103
#define DSO_F_DL_BIND_FUNC 104
#define DSO_F_DL_BIND_VAR 105
#define DSO_F_DL_LOAD 106
#define DSO_F_DL_MERGER 131
#define DSO_F_DL_NAME_CONVERTER 124
#define DSO_F_DL_UNLOAD 107
#define DSO_F_DSO_BIND_FUNC 108
@ -318,34 +288,27 @@ void ERR_load_DSO_strings(void);
#define DSO_F_DSO_GET_FILENAME 127
#define DSO_F_DSO_GET_LOADED_FILENAME 128
#define DSO_F_DSO_LOAD 112
#define DSO_F_DSO_MERGE 132
#define DSO_F_DSO_NEW_METHOD 113
#define DSO_F_DSO_SET_FILENAME 129
#define DSO_F_DSO_SET_NAME_CONVERTER 122
#define DSO_F_DSO_UP_REF 114
#define DSO_F_VMS_BIND_VAR 115
#define DSO_F_VMS_LOAD 116
#define DSO_F_VMS_MERGER 133
#define DSO_F_VMS_UNLOAD 117
#define DSO_F_WIN32_BIND_FUNC 118
#define DSO_F_WIN32_BIND_VAR 119
#define DSO_F_WIN32_LOAD 120
#define DSO_F_WIN32_MERGER 134
#define DSO_F_WIN32_NAME_CONVERTER 125
#define DSO_F_WIN32_UNLOAD 121
/* Reason codes. */
#define DSO_R_CTRL_FAILED 100
#define DSO_R_DSO_ALREADY_LOADED 110
#define DSO_R_EMPTY_FILE_STRUCTURE 113
#define DSO_R_FAILURE 114
#define DSO_R_FILENAME_TOO_BIG 101
#define DSO_R_FINISH_FAILED 102
#define DSO_R_INCORRECT_FILE_SYNTAX 115
#define DSO_R_LOAD_FAILED 103
#define DSO_R_NAME_TRANSLATION_FAILED 109
#define DSO_R_NO_FILENAME 111
#define DSO_R_NO_FILE_SPECIFICATION 116
#define DSO_R_NULL_HANDLE 104
#define DSO_R_SET_FILENAME_FAILED 112
#define DSO_R_STACK_ERROR 105

View File

@ -1,4 +1,4 @@
/* dso_dl.c -*- mode:C; c-file-style: "eay" -*- */
/* dso_dl.c */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2000.
*/
@ -84,7 +84,6 @@ static int dl_finish(DSO *dso);
static int dl_ctrl(DSO *dso, int cmd, long larg, void *parg);
#endif
static char *dl_name_converter(DSO *dso, const char *filename);
static char *dl_merger(DSO *dso, const char *filespec1, const char *filespec2);
static DSO_METHOD dso_meth_dl = {
"OpenSSL 'dl' shared library method",
@ -99,7 +98,6 @@ static DSO_METHOD dso_meth_dl = {
#endif
NULL, /* ctrl */
dl_name_converter,
dl_merger,
NULL, /* init */
NULL /* finish */
};
@ -240,72 +238,6 @@ static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname)
return((DSO_FUNC_TYPE)sym);
}
static char *dl_merger(DSO *dso, const char *filespec1, const char *filespec2)
{
char *merged;
if(!filespec1 && !filespec2)
{
DSOerr(DSO_F_DL_MERGER,
ERR_R_PASSED_NULL_PARAMETER);
return(NULL);
}
/* If the first file specification is a rooted path, it rules.
same goes if the second file specification is missing. */
if (!filespec2 || filespec1[0] == '/')
{
merged = OPENSSL_malloc(strlen(filespec1) + 1);
if(!merged)
{
DSOerr(DSO_F_DL_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec1);
}
/* If the first file specification is missing, the second one rules. */
else if (!filespec1)
{
merged = OPENSSL_malloc(strlen(filespec2) + 1);
if(!merged)
{
DSOerr(DSO_F_DL_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec2);
}
else
/* This part isn't as trivial as it looks. It assumes that
the second file specification really is a directory, and
makes no checks whatsoever. Therefore, the result becomes
the concatenation of filespec2 followed by a slash followed
by filespec1. */
{
int spec2len, len;
spec2len = (filespec2 ? strlen(filespec2) : 0);
len = spec2len + (filespec1 ? strlen(filespec1) : 0);
if(filespec2 && filespec2[spec2len - 1] == '/')
{
spec2len--;
len--;
}
merged = OPENSSL_malloc(len + 2);
if(!merged)
{
DSOerr(DSO_F_DL_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec2);
merged[spec2len] = '/';
strcpy(&merged[spec2len + 1], filespec1);
}
return(merged);
}
/* This function is identical to the one in dso_dlfcn.c, but as it is highly
* unlikely that both the "dl" *and* "dlfcn" variants are being compiled at the
* same time, there's no great duplicating the code. Figuring out an elegant

View File

@ -1,4 +1,4 @@
/* dso_dlfcn.c -*- mode:C; c-file-style: "eay" -*- */
/* dso_dlfcn.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
@ -85,8 +85,6 @@ static int dlfcn_finish(DSO *dso);
static long dlfcn_ctrl(DSO *dso, int cmd, long larg, void *parg);
#endif
static char *dlfcn_name_converter(DSO *dso, const char *filename);
static char *dlfcn_merger(DSO *dso, const char *filespec1,
const char *filespec2);
static DSO_METHOD dso_meth_dlfcn = {
"OpenSSL 'dlfcn' shared library method",
@ -101,7 +99,6 @@ static DSO_METHOD dso_meth_dlfcn = {
#endif
NULL, /* ctrl */
dlfcn_name_converter,
dlfcn_merger,
NULL, /* init */
NULL /* finish */
};
@ -255,73 +252,6 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
return(sym);
}
static char *dlfcn_merger(DSO *dso, const char *filespec1,
const char *filespec2)
{
char *merged;
if(!filespec1 && !filespec2)
{
DSOerr(DSO_F_DLFCN_MERGER,
ERR_R_PASSED_NULL_PARAMETER);
return(NULL);
}
/* If the first file specification is a rooted path, it rules.
same goes if the second file specification is missing. */
if (!filespec2 || filespec1[0] == '/')
{
merged = OPENSSL_malloc(strlen(filespec1) + 1);
if(!merged)
{
DSOerr(DSO_F_DLFCN_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec1);
}
/* If the first file specification is missing, the second one rules. */
else if (!filespec1)
{
merged = OPENSSL_malloc(strlen(filespec2) + 1);
if(!merged)
{
DSOerr(DSO_F_DLFCN_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec2);
}
else
/* This part isn't as trivial as it looks. It assumes that
the second file specification really is a directory, and
makes no checks whatsoever. Therefore, the result becomes
the concatenation of filespec2 followed by a slash followed
by filespec1. */
{
int spec2len, len;
spec2len = (filespec2 ? strlen(filespec2) : 0);
len = spec2len + (filespec1 ? strlen(filespec1) : 0);
if(filespec2 && filespec2[spec2len - 1] == '/')
{
spec2len--;
len--;
}
merged = OPENSSL_malloc(len + 2);
if(!merged)
{
DSOerr(DSO_F_DLFCN_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec2);
merged[spec2len] = '/';
strcpy(&merged[spec2len + 1], filespec1);
}
return(merged);
}
static char *dlfcn_name_converter(DSO *dso, const char *filename)
{
char *translated;

View File

@ -1,6 +1,6 @@
/* crypto/dso/dso_err.c */
/* ====================================================================
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -69,13 +69,11 @@ static ERR_STRING_DATA DSO_str_functs[]=
{ERR_PACK(0,DSO_F_DLFCN_BIND_FUNC,0), "DLFCN_BIND_FUNC"},
{ERR_PACK(0,DSO_F_DLFCN_BIND_VAR,0), "DLFCN_BIND_VAR"},
{ERR_PACK(0,DSO_F_DLFCN_LOAD,0), "DLFCN_LOAD"},
{ERR_PACK(0,DSO_F_DLFCN_MERGER,0), "DLFCN_MERGER"},
{ERR_PACK(0,DSO_F_DLFCN_NAME_CONVERTER,0), "DLFCN_NAME_CONVERTER"},
{ERR_PACK(0,DSO_F_DLFCN_UNLOAD,0), "DLFCN_UNLOAD"},
{ERR_PACK(0,DSO_F_DL_BIND_FUNC,0), "DL_BIND_FUNC"},
{ERR_PACK(0,DSO_F_DL_BIND_VAR,0), "DL_BIND_VAR"},
{ERR_PACK(0,DSO_F_DL_LOAD,0), "DL_LOAD"},
{ERR_PACK(0,DSO_F_DL_MERGER,0), "DL_MERGER"},
{ERR_PACK(0,DSO_F_DL_NAME_CONVERTER,0), "DL_NAME_CONVERTER"},
{ERR_PACK(0,DSO_F_DL_UNLOAD,0), "DL_UNLOAD"},
{ERR_PACK(0,DSO_F_DSO_BIND_FUNC,0), "DSO_bind_func"},
@ -86,19 +84,16 @@ static ERR_STRING_DATA DSO_str_functs[]=
{ERR_PACK(0,DSO_F_DSO_GET_FILENAME,0), "DSO_get_filename"},
{ERR_PACK(0,DSO_F_DSO_GET_LOADED_FILENAME,0), "DSO_get_loaded_filename"},
{ERR_PACK(0,DSO_F_DSO_LOAD,0), "DSO_load"},
{ERR_PACK(0,DSO_F_DSO_MERGE,0), "DSO_merge"},
{ERR_PACK(0,DSO_F_DSO_NEW_METHOD,0), "DSO_new_method"},
{ERR_PACK(0,DSO_F_DSO_SET_FILENAME,0), "DSO_set_filename"},
{ERR_PACK(0,DSO_F_DSO_SET_NAME_CONVERTER,0), "DSO_set_name_converter"},
{ERR_PACK(0,DSO_F_DSO_UP_REF,0), "DSO_up_ref"},
{ERR_PACK(0,DSO_F_VMS_BIND_VAR,0), "VMS_BIND_VAR"},
{ERR_PACK(0,DSO_F_VMS_LOAD,0), "VMS_LOAD"},
{ERR_PACK(0,DSO_F_VMS_MERGER,0), "VMS_MERGER"},
{ERR_PACK(0,DSO_F_VMS_UNLOAD,0), "VMS_UNLOAD"},
{ERR_PACK(0,DSO_F_WIN32_BIND_FUNC,0), "WIN32_BIND_FUNC"},
{ERR_PACK(0,DSO_F_WIN32_BIND_VAR,0), "WIN32_BIND_VAR"},
{ERR_PACK(0,DSO_F_WIN32_LOAD,0), "WIN32_LOAD"},
{ERR_PACK(0,DSO_F_WIN32_MERGER,0), "WIN32_MERGER"},
{ERR_PACK(0,DSO_F_WIN32_NAME_CONVERTER,0), "WIN32_NAME_CONVERTER"},
{ERR_PACK(0,DSO_F_WIN32_UNLOAD,0), "WIN32_UNLOAD"},
{0,NULL}
@ -108,15 +103,11 @@ static ERR_STRING_DATA DSO_str_reasons[]=
{
{DSO_R_CTRL_FAILED ,"control command failed"},
{DSO_R_DSO_ALREADY_LOADED ,"dso already loaded"},
{DSO_R_EMPTY_FILE_STRUCTURE ,"empty file structure"},
{DSO_R_FAILURE ,"failure"},
{DSO_R_FILENAME_TOO_BIG ,"filename too big"},
{DSO_R_FINISH_FAILED ,"cleanup method function failed"},
{DSO_R_INCORRECT_FILE_SYNTAX ,"incorrect file syntax"},
{DSO_R_LOAD_FAILED ,"could not load the shared library"},
{DSO_R_NAME_TRANSLATION_FAILED ,"name translation failed"},
{DSO_R_NO_FILENAME ,"no filename"},
{DSO_R_NO_FILE_SPECIFICATION ,"no file specification"},
{DSO_R_NULL_HANDLE ,"a null shared library handle was used"},
{DSO_R_SET_FILENAME_FAILED ,"set filename failed"},
{DSO_R_STACK_ERROR ,"the meth_data stack is corrupt"},

View File

@ -1,4 +1,4 @@
/* dso_lib.c -*- mode:C; c-file-style: "eay" -*- */
/* dso_lib.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
@ -390,33 +390,6 @@ int DSO_set_filename(DSO *dso, const char *filename)
return(1);
}
char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2)
{
char *result = NULL;
if(dso == NULL || filespec1 == NULL)
{
DSOerr(DSO_F_DSO_MERGE,ERR_R_PASSED_NULL_PARAMETER);
return(NULL);
}
if(filespec1 == NULL)
filespec1 = dso->filename;
if(filespec1 == NULL)
{
DSOerr(DSO_F_DSO_MERGE,DSO_R_NO_FILE_SPECIFICATION);
return(NULL);
}
if((dso->flags & DSO_FLAG_NO_NAME_TRANSLATION) == 0)
{
if(dso->merger != NULL)
result = dso->merger(dso, filespec1, filespec2);
else if(dso->meth->dso_merger != NULL)
result = dso->meth->dso_merger(dso,
filespec1, filespec2);
}
return(result);
}
char *DSO_convert_filename(DSO *dso, const char *filename)
{
char *result = NULL;

View File

@ -1,4 +1,4 @@
/* dso_vms.c -*- mode:C; c-file-style: "eay" -*- */
/* dso_vms.c */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2000.
*/
@ -63,7 +63,6 @@
#include <openssl/dso.h>
#ifdef OPENSSL_SYS_VMS
#pragma message disable DOLLARID
#include <rms.h>
#include <lib$routines.h>
#include <stsdef.h>
#include <descrip.h>
@ -90,8 +89,6 @@ static int vms_finish(DSO *dso);
static long vms_ctrl(DSO *dso, int cmd, long larg, void *parg);
#endif
static char *vms_name_converter(DSO *dso, const char *filename);
static char *vms_merger(DSO *dso, const char *filespec1,
const char *filespec2);
static DSO_METHOD dso_meth_vms = {
"OpenSSL 'VMS' shared library method",
@ -106,7 +103,6 @@ static DSO_METHOD dso_meth_vms = {
#endif
NULL, /* ctrl */
vms_name_converter,
vms_merger,
NULL, /* init */
NULL /* finish */
};
@ -372,127 +368,6 @@ static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname)
return sym;
}
static char *vms_merger(DSO *dso, const char *filespec1, const char *filespec2)
{
int status;
int filespec1len, filespec2len;
struct FAB fab;
#ifdef NAML$C_MAXRSS
struct NAML nam;
char esa[NAML$C_MAXRSS];
#else
struct NAM nam;
char esa[NAM$C_MAXRSS];
#endif
char *merged;
if (!filespec1) filespec1 = "";
if (!filespec2) filespec2 = "";
filespec1len = strlen(filespec1);
filespec2len = strlen(filespec2);
fab = cc$rms_fab;
#ifdef NAML$C_MAXRSS
nam = cc$rms_naml;
#else
nam = cc$rms_nam;
#endif
fab.fab$l_fna = (char *)filespec1;
fab.fab$b_fns = filespec1len;
fab.fab$l_dna = (char *)filespec2;
fab.fab$b_dns = filespec2len;
#ifdef NAML$C_MAXRSS
if (filespec1len > NAM$C_MAXRSS)
{
fab.fab$l_fna = 0;
fab.fab$b_fns = 0;
nam.naml$l_long_filename = (char *)filespec1;
nam.naml$l_long_filename_size = filespec1len;
}
if (filespec2len > NAM$C_MAXRSS)
{
fab.fab$l_dna = 0;
fab.fab$b_dns = 0;
nam.naml$l_long_defname = (char *)filespec2;
nam.naml$l_long_defname_size = filespec2len;
}
nam.naml$l_esa = esa;
nam.naml$b_ess = NAM$C_MAXRSS;
nam.naml$l_long_expand = esa;
nam.naml$l_long_expand_alloc = sizeof(esa);
nam.naml$b_nop = NAM$M_SYNCHK | NAM$M_PWD;
nam.naml$v_no_short_upcase = 1;
fab.fab$l_naml = &nam;
#else
nam.nam$l_esa = esa;
nam.nam$b_ess = NAM$C_MAXRSS;
nam.nam$b_nop = NAM$M_SYNCHK | NAM$M_PWD;
fab.fab$l_nam = &nam;
#endif
status = sys$parse(&fab, 0, 0);
if(!$VMS_STATUS_SUCCESS(status))
{
unsigned short length;
char errstring[257];
struct dsc$descriptor_s errstring_dsc;
errstring_dsc.dsc$w_length = sizeof(errstring);
errstring_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
errstring_dsc.dsc$b_class = DSC$K_CLASS_S;
errstring_dsc.dsc$a_pointer = errstring;
status = sys$getmsg(status, &length, &errstring_dsc, 1, 0);
if (!$VMS_STATUS_SUCCESS(status))
lib$signal(status); /* This is really bad. Abort! */
else
{
errstring[length] = '\0';
DSOerr(DSO_F_VMS_MERGER,DSO_R_FAILURE);
ERR_add_error_data(7,
"filespec \"", filespec1, "\", ",
"defaults \"", filespec2, "\": ",
errstring);
}
return(NULL);
}
#ifdef NAML$C_MAXRSS
if (nam.naml$l_long_expand_size)
{
merged = OPENSSL_malloc(nam.naml$l_long_expand_size + 1);
if(!merged)
goto malloc_err;
strncpy(merged, nam.naml$l_long_expand,
nam.naml$l_long_expand_size);
merged[nam.naml$l_long_expand_size] = '\0';
}
else
{
merged = OPENSSL_malloc(nam.naml$b_esl + 1);
if(!merged)
goto malloc_err;
strncpy(merged, nam.naml$l_esa,
nam.naml$b_esl);
merged[nam.naml$b_esl] = '\0';
}
#else
merged = OPENSSL_malloc(nam.nam$b_esl + 1);
if(!merged)
goto malloc_err;
strncpy(merged, nam.nam$l_esa,
nam.nam$b_esl);
merged[nam.nam$b_esl] = '\0';
#endif
return(merged);
malloc_err:
DSOerr(DSO_F_VMS_MERGER,
ERR_R_MALLOC_FAILURE);
}
static char *vms_name_converter(DSO *dso, const char *filename)
{
int len = strlen(filename);

View File

@ -1,4 +1,4 @@
/* dso_win32.c -*- mode:C; c-file-style: "eay" -*- */
/* dso_win32.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
@ -83,8 +83,6 @@ static int win32_finish(DSO *dso);
static long win32_ctrl(DSO *dso, int cmd, long larg, void *parg);
#endif
static char *win32_name_converter(DSO *dso, const char *filename);
static char *win32_merger(DSO *dso, const char *filespec1,
const char *filespec2);
static DSO_METHOD dso_meth_win32 = {
"OpenSSL 'win32' shared library method",
@ -99,7 +97,6 @@ static DSO_METHOD dso_meth_win32 = {
#endif
NULL, /* ctrl */
win32_name_converter,
win32_merger,
NULL, /* init */
NULL /* finish */
};
@ -251,304 +248,6 @@ static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname)
return((DSO_FUNC_TYPE)sym);
}
struct file_st
{
const char *node; int nodelen;
const char *device; int devicelen;
const char *predir; int predirlen;
const char *dir; int dirlen;
const char *file; int filelen;
}
static struct file_st *win32_splitter(DSO *dso, const char *filename,
int assume_last_is_dir)
{
struct file_st *result = NULL;
enum { IN_NODE, IN_DEVICE, IN_FILE } position;
const char *start = filename;
if (!filename)
{
DSOerr(DSO_F_WIN32_MERGER,DSO_R_NO_FILENAME);
goto err;
}
result = OPENSSL_malloc(sizeof(struct file_st));
if(result == NULL)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
memset(result, 0, sizeof(struct file_st));
position = IN_DEVICE;
if(filename[0] == '\\' && filename[1] == '\\'
|| filename[0] == '/' && filename[1] == '/')
{
position = IN_NODE;
filename += 2;
start = filename;
result->node = start;
}
do
{
switch(filename[0])
{
case ':':
if(position != IN_DEVICE)
{
DSOerr(DSO_F_WIN32_MERGER,
DSO_R_INCORRECT_FILE_SYNTAX);
goto err;
}
result->device = start;
result->devicelen = filename - start;
position = IN_FILE;
start = ++filename;
result->dir = start;
break;
case '\\':
case '/':
if(position == IN_NODE)
{
result->nodelen = filename - start;
position = IN_FILE;
start = ++filename;
result->dir = start;
}
else
{
filename++;
result->dirlen += filename - start;
}
break;
case '\0':
if(position == IN_NODE)
{
result->nodelen = filename - start;
}
else
{
if(filename - start > 0)
{
if (assume_last_is_dir)
{
result->devicelen += filename - start;
}
else
{
result->file = start;
result->filelen = filename - start;
}
}
}
break;
default:
filename++;
break;
}
}
while(*filename);
if(!result->nodelen) result->node = NULL;
if(!result->devicelen) result->devicce = NULL;
if(!result->dirlen) result->dir = NULL;
if(!result->filelen) result->file = NULL;
return(result);
}
static char *win32_joiner(DSO *dso, const file_st *file_split)
{
int len = 0, offset = 0;
char *result = NULL;
const char *start;
if(!file_split)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_PASSED_NULL_PARAMETER);
return(NULL);
}
if(file_split->node)
{
len += 2 + file_split->nodelen; /* 2 for starting \\ */
if(file_split->predir || file_split->dir || file_split->file)
len++; /* 1 for ending \ */
}
else if(file_split->device)
{
len += file_split->devicelen + 1; /* 1 for ending : */
}
len += file_split->predirlen;
if(file_split->predir && (file_split->dir || file_split->file))
{
len++; /* 1 for ending \ */
}
len += file_split->dirlen;
if(file_split->dir && file_split->file)
{
len++; /* 1 for ending \ */
}
len += file_split->filelen;
if(!len)
{
DSOerr(DSO_F_WIN32_MERGER, DSO_R_EMPTY_FILE_STRUCTURE);
return(NULL);
}
result = OPENSSL_malloc(len + 1);
if (!result)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
if(file_split->node)
{
strcpy(&result[offset], "\\\\"); offset += 2;
strncpy(&result[offset], file_split->node,
file_split->nodelen); offset += file_split->nodelen;
if(file_split->predir || file_split->dir || file_split->file)
{
result[offset] = '\\'; offset++;
}
}
else if(file_split->device)
{
strncpy(&result[offset], file_split->device,
file_split->devicelen); offset += file_split->devicelen;
result[offset] = ':'; offset++;
}
start = file_split->predir;
while(file_split->predirlen > (start - file_split->predir))
{
const char *end = strnchr(start, '/',
file_split->predirlen - (start - file_split->predir));
if(!end)
end = start
+ file_split->predirlen
- (start - file_split->predir);
strncpy(&result[offset], start,
end - start); offset += end - start;
result[offset] = '\\'; offset++;
start = end + 1;
}
if(file_split->predir && (file_split->dir || file_split->file))
{
result[offset] = '\\'; offset++;
}
start = file_split->dir;
while(file_split->dirlen > (start - file_split->dir))
{
const char *end = strnchr(start, '/',
file_split->dirlen - (start - file_split->dir));
if(!end)
end = start
+ file_split->dirlen
- (start - file_split->dir);
strncpy(&result[offset], start,
end - start); offset += end - start;
result[offset] = '\\'; offset++;
start = end + 1;
}
if(file_split->dir && file_split->file)
{
result[offset] = '\\'; offset++;
}
strncpy(&result[offset], file_split->file,
file_split->filelen); offset += file_split->filelen;
result[offset] = '\0';
return(result);
}
static char *win32_merger(DSO *dso, const char *filespec1, const char *filespec2)
{
char *merged = NULL;
struct file_st *filespec1_split = NULL;
struct file_st *filespec2_split = NULL;
if(!filespec1 && !filespec2)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_PASSED_NULL_PARAMETER);
return(NULL);
}
if (!filespec2)
{
merged = OPENSSL_malloc(strlen(filespec1) + 1);
if(!merged)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec1);
}
else if (!filespec1)
{
merged = OPENSSL_malloc(strlen(filespec2) + 1);
if(!merged)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec2);
}
else
{
filespec1_split = win32_splitter(dso, filespec1, 1);
if (!filespec1_split)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_MALLOC_FAILURE);
return(NULL);
}
filespec2_split = win32_splitter(dso, filespec2, 0);
if (!filespec1_split)
{
DSOerr(DSO_F_WIN32_MERGER,
ERR_R_MALLOC_FAILURE);
OPENSSL_free(filespec1_split);
return(NULL);
}
/* Fill in into filespec1_split */
if (!filespec1_split->node && !filespec1_split->device)
{
filespec1_split->node = filespec2_split->node;
filespec1_split->nodelen = filespec2_split->nodelen;
filespec1_split->device = filespec2_split->device;
filespec1_split->devicelen = filespec2_split->devicelen;
}
if (!filespec1_split->dir)
{
filespec1_split->dir = filespec2_split->dir;
filespec1_split->dirlen = filespec2_split->dirlen;
}
else if (filespec1_split->dir[0] != '\\'
&& filespec1_split->dir[0] != '/')
{
filespec1_split->predir = filespec2_split->dir;
filespec1_split->predirlen = filespec2_split->dirlen;
}
if (!filespec1_split->file)
{
filespec1_split->file = filespec2_split->file;
filespec1_split->filelen = filespec2_split->filelen;
}
merged = win32_joiner(dso, filespec1_split);
}
return(merged);
}
static char *win32_name_converter(DSO *dso, const char *filename)
{
char *translated;

View File

@ -24,10 +24,10 @@ APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= ec_lib.c ecp_smpl.c ecp_mont.c ecp_recp.c ecp_nist.c ec_cvt.c ec_mult.c \
ec_err.c ec_curve.c ec_check.c ec_print.c ec_asn1.c
ec_err.c
LIBOBJ= ec_lib.o ecp_smpl.o ecp_mont.o ecp_recp.o ecp_nist.o ec_cvt.o ec_mult.o \
ec_err.o ec_curve.o ec_check.o ec_print.o ec_asn1.o
ec_err.o
SRC= $(LIBSRC)
@ -82,98 +82,47 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
ec_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
ec_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ec_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ec_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ec_asn1.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ec_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ec_asn1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ec_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_asn1.o: ../../include/openssl/symhacks.h ../cryptlib.h ec_asn1.c ec_lcl.h
ec_check.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_check.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_check.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ec_check.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ec_check.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ec_check.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_check.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_check.o: ../../include/openssl/symhacks.h ec_check.c ec_lcl.h
ec_curve.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
ec_curve.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ec_curve.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ec_curve.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ec_curve.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ec_curve.o: ../../include/openssl/opensslconf.h
ec_curve.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_curve.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_curve.o: ../../include/openssl/symhacks.h ec_curve.c ec_lcl.h
ec_cvt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_cvt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ec_cvt.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ec_cvt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_cvt.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h
ec_cvt.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h
ec_cvt.o: ../../include/openssl/symhacks.h ec_cvt.c ec_lcl.h
ec_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ec_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ec_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ec_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ec_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ec_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ec_err.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ec_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ec_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
ec_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ec_err.o: ec_err.c
ec_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ec_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ec_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ec_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_lib.o: ../../include/openssl/symhacks.h ec_lcl.h ec_lib.c
ec_mult.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_mult.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_mult.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ec_mult.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ec_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_mult.o: ../../include/openssl/symhacks.h ec_lcl.h ec_mult.c
ec_print.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_print.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_print.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ec_print.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ec_print.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_print.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_print.o: ../../include/openssl/symhacks.h ec_lcl.h ec_print.c
ecp_mont.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecp_mont.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecp_mont.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecp_mont.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ecp_mont.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ecp_mont.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecp_mont.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecp_mont.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_mont.c
ecp_nist.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecp_nist.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecp_nist.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecp_nist.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ecp_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecp_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ec_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ec_lib.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ec_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ec_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
ec_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ec_lib.o: ec_lcl.h ec_lib.c
ec_mult.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ec_mult.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ec_mult.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ec_mult.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
ec_mult.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ec_mult.o: ec_lcl.h ec_mult.c
ecp_mont.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ecp_mont.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecp_mont.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ecp_mont.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ecp_mont.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
ecp_mont.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecp_mont.o: ec_lcl.h ecp_mont.c
ecp_nist.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h
ecp_nist.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h
ecp_nist.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_nist.c
ecp_recp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecp_recp.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecp_recp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecp_recp.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ecp_recp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecp_recp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecp_recp.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h
ecp_recp.o: ../../include/openssl/ec.h ../../include/openssl/opensslconf.h
ecp_recp.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_recp.c
ecp_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecp_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecp_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecp_smpl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ecp_smpl.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
ecp_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecp_smpl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecp_smpl.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_smpl.c
ecp_smpl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ecp_smpl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecp_smpl.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ecp_smpl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ecp_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
ecp_smpl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecp_smpl.o: ec_lcl.h ecp_smpl.c

View File

@ -1,6 +1,6 @@
/* crypto/ec/ec.h */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -61,7 +61,6 @@
#endif
#include <openssl/bn.h>
#include <openssl/asn1.h>
#include <openssl/symhacks.h>
#ifdef __cplusplus
@ -86,7 +85,6 @@ typedef struct ec_group_st
-- curve coefficients
-- optional generator with associated information (order, cofactor)
-- optional extra data (TODO: precomputed table for fast computation of multiples of generator)
-- ASN1 stuff
*/
EC_GROUP;
@ -110,25 +108,7 @@ void EC_GROUP_clear_free(EC_GROUP *);
int EC_GROUP_copy(EC_GROUP *, const EC_GROUP *);
const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *);
int EC_METHOD_get_field_type(const EC_METHOD *);
int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *);
int EC_GROUP_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *);
int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *);
void EC_GROUP_set_nid(EC_GROUP *, int); /* curve name */
int EC_GROUP_get_nid(const EC_GROUP *);
void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag);
int EC_GROUP_get_asn1_flag(const EC_GROUP *);
void EC_GROUP_set_point_conversion_form(EC_GROUP *, point_conversion_form_t);
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
unsigned char *EC_GROUP_get0_seed(const EC_GROUP *);
size_t EC_GROUP_get_seed_len(const EC_GROUP *);
size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
/* We don't have types for field specifications and field elements in general.
* Otherwise we could declare
@ -137,54 +117,14 @@ size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
int EC_GROUP_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
int EC_GROUP_get_curve_GFp(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *);
/* EC_GROUP_check() returns 1 if 'group' defines a valid group, 0 otherwise */
int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
/* EC_GROUP_check_discriminant() returns 1 if the discriminant of the
* elliptic curve is not zero, 0 otherwise */
int EC_GROUP_check_discriminant(const EC_GROUP *, BN_CTX *);
/* EC_GROUP_new_GFp() calls EC_GROUP_new() and EC_GROUP_set_GFp()
* after choosing an appropriate EC_METHOD */
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
/* EC_GROUP_new_by_nid() and EC_GROUP_new_by_name() also set
* generator and order */
EC_GROUP *EC_GROUP_new_by_nid(int nid);
EC_GROUP *EC_GROUP_new_by_name(int name);
/* Currently valid arguments to EC_GROUP_new_by_name() */
#define EC_GROUP_NO_CURVE 0
#define EC_GROUP_NIST_PRIME_192 NID_X9_62_prime192v1
#define EC_GROUP_NIST_PRIME_224 NID_secp224r1
#define EC_GROUP_NIST_PRIME_256 NID_X9_62_prime256v1
#define EC_GROUP_NIST_PRIME_384 NID_secp384r1
#define EC_GROUP_NIST_PRIME_521 NID_secp521r1
#define EC_GROUP_X9_62_PRIME_192V1 NID_X9_62_prime192v1
#define EC_GROUP_X9_62_PRIME_192V2 NID_X9_62_prime192v2
#define EC_GROUP_X9_62_PRIME_192V3 NID_X9_62_prime192v3
#define EC_GROUP_X9_62_PRIME_239V1 NID_X9_62_prime239v1
#define EC_GROUP_X9_62_PRIME_239V2 NID_X9_62_prime239v2
#define EC_GROUP_X9_62_PRIME_239V3 NID_X9_62_prime239v3
#define EC_GROUP_X9_62_PRIME_256V1 NID_X9_62_prime256v1
#define EC_GROUP_SECG_PRIME_112R1 NID_secp112r1
#define EC_GROUP_SECG_PRIME_112R2 NID_secp112r2
#define EC_GROUP_SECG_PRIME_128R1 NID_secp128r1
#define EC_GROUP_SECG_PRIME_128R2 NID_secp128r2
#define EC_GROUP_SECG_PRIME_160K1 NID_secp160k1
#define EC_GROUP_SECG_PRIME_160R1 NID_secp160r1
#define EC_GROUP_SECG_PRIME_160R2 NID_secp160r2
#define EC_GROUP_SECG_PRIME_192K1 NID_secp192k1
#define EC_GROUP_SECG_PRIME_192R1 NID_X9_62_prime192v1
#define EC_GROUP_SECG_PRIME_224K1 NID_secp224k1
#define EC_GROUP_SECG_PRIME_224R1 NID_secp224r1
#define EC_GROUP_SECG_PRIME_256K1 NID_secp256k1
#define EC_GROUP_SECG_PRIME_256R1 NID_X9_62_prime256v1
#define EC_GROUP_SECG_PRIME_384R1 NID_secp384r1
#define EC_GROUP_SECG_PRIME_521R1 NID_secp521r1
#define EC_GROUP_WTLS_6 NID_wap_wsg_idm_ecid_wtls6
#define EC_GROUP_WTLS_7 NID_secp160r1
#define EC_GROUP_WTLS_8 NID_wap_wsg_idm_ecid_wtls8
#define EC_GROUP_WTLS_9 NID_wap_wsg_idm_ecid_wtls9
#define EC_GROUP_WTLS_12 NID_secp224r1
int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *);
int EC_GROUP_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *);
int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *);
EC_POINT *EC_POINT_new(const EC_GROUP *);
void EC_POINT_free(EC_POINT *);
@ -210,16 +150,6 @@ size_t EC_POINT_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_f
int EC_POINT_oct2point(const EC_GROUP *, EC_POINT *,
const unsigned char *buf, size_t len, BN_CTX *);
/* other interfaces to point2oct/oct2point: */
BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
point_conversion_form_t form, BIGNUM *, BN_CTX *);
EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
EC_POINT *, BN_CTX *);
char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
point_conversion_form_t form, BN_CTX *);
EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
EC_POINT *, BN_CTX *);
int EC_POINT_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *);
int EC_POINT_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *);
int EC_POINT_invert(const EC_GROUP *, EC_POINT *, BN_CTX *);
@ -238,44 +168,6 @@ int EC_GROUP_precompute_mult(EC_GROUP *, BN_CTX *);
/* ASN1 stuff */
#define OPENSSL_EC_NAMED_CURVE 0x001
typedef struct ec_parameters_st ECPARAMETERS;
typedef struct ecpk_parameters_st ECPKPARAMETERS;
DECLARE_ASN1_ITEM(ECPARAMETERS)
DECLARE_ASN1_ITEM(ECPKPARAMETERS)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECPARAMETERS, ECPARAMETERS)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECPKPARAMETERS, ECPKPARAMETERS)
EC_GROUP *EC_ASN1_pkparameters2group(const ECPKPARAMETERS *);
ECPKPARAMETERS *EC_ASN1_group2pkparameters(const EC_GROUP *, ECPKPARAMETERS *);
EC_GROUP *d2i_ECParameters(EC_GROUP **, const unsigned char **in, long len);
int i2d_ECParameters(const EC_GROUP *, unsigned char **out);
EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
#define d2i_ECPKParameters_bio(bp,x) (EC_GROUP *)ASN1_d2i_bio(NULL, \
(char *(*)())d2i_ECPKParameters,(bp),(unsigned char **)(x))
#define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio(i2d_ECPKParameters,(bp), \
(unsigned char *)(x))
#define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
(char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
#define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
(unsigned char *)(x))
#ifndef OPENSSL_NO_BIO
int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
#endif
#ifndef OPENSSL_NO_FP_API
int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
#endif
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
@ -286,22 +178,10 @@ void ERR_load_EC_strings(void);
/* Function codes. */
#define EC_F_COMPUTE_WNAF 143
#define EC_F_D2I_ECDSAPARAMETERS 154
#define EC_F_D2I_ECPARAMETERS 155
#define EC_F_D2I_ECPKPARAMETERS 161
#define EC_F_ECPKPARAMETERS_PRINT 166
#define EC_F_ECPKPARAMETERS_PRINT_FP 167
#define EC_F_EC_ASN1_GROUP2CURVE 159
#define EC_F_EC_ASN1_GROUP2FIELDID 156
#define EC_F_EC_ASN1_GROUP2PARAMETERS 160
#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 162
#define EC_F_EC_ASN1_PARAMETERS2GROUP 157
#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 163
#define EC_F_EC_GFP_MONT_FIELD_DECODE 133
#define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
#define EC_F_EC_GFP_MONT_FIELD_MUL 131
#define EC_F_EC_GFP_MONT_FIELD_SQR 132
#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 152
#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100
#define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101
#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
@ -311,19 +191,13 @@ void ERR_load_EC_strings(void);
#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105
#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128
#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129
#define EC_F_EC_GROUP_CHECK 150
#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 153
#define EC_F_EC_GROUP_COPY 106
#define EC_F_EC_GROUP_GET0_GENERATOR 139
#define EC_F_EC_GROUP_GET_COFACTOR 140
#define EC_F_EC_GROUP_GET_CURVE_GFP 130
#define EC_F_EC_GROUP_GET_EXTRA_DATA 107
#define EC_F_EC_GROUP_GET_ORDER 141
#define EC_F_EC_GROUP_GROUP2NID 147
#define EC_F_EC_GROUP_NEW 108
#define EC_F_EC_GROUP_NEW_BY_NAME 144
#define EC_F_EC_GROUP_NEW_BY_NID 146
#define EC_F_EC_GROUP_NEW_GFP_FROM_HEX 148
#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
#define EC_F_EC_GROUP_SET_CURVE_GFP 109
#define EC_F_EC_GROUP_SET_EXTRA_DATA 110
@ -347,23 +221,9 @@ void ERR_load_EC_strings(void);
#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
#define EC_F_EC_POINT_SET_TO_INFINITY 127
#define EC_F_GFP_MONT_GROUP_SET_CURVE_GFP 135
#define EC_F_I2D_ECDSAPARAMETERS 158
#define EC_F_I2D_ECPARAMETERS 164
#define EC_F_I2D_ECPKPARAMETERS 165
/* Reason codes. */
#define EC_R_ASN1_ERROR 130
#define EC_R_ASN1_UNKNOWN_FIELD 131
#define EC_R_BUFFER_TOO_SMALL 100
#define EC_R_D2I_ECPARAMETERS_FAILURE 132
#define EC_R_D2I_ECPKPARAMETERS_FAILURE 133
#define EC_R_D2I_EC_PARAMETERS_FAILURE 123
#define EC_R_DISCRIMINANT_IS_ZERO 118
#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 124
#define EC_R_GROUP2PARAMETERS_FAILURE 125
#define EC_R_GROUP2PKPARAMETERS_FAILURE 134
#define EC_R_I2D_ECPKPARAMETERS_FAILURE 135
#define EC_R_I2D_EC_PARAMETERS_FAILURE 126
#define EC_R_INCOMPATIBLE_OBJECTS 101
#define EC_R_INVALID_ARGUMENT 112
#define EC_R_INVALID_COMPRESSED_POINT 110
@ -371,22 +231,13 @@ void ERR_load_EC_strings(void);
#define EC_R_INVALID_ENCODING 102
#define EC_R_INVALID_FIELD 103
#define EC_R_INVALID_FORM 104
#define EC_R_INVALID_GROUP_ORDER 119
#define EC_R_MISSING_PARAMETERS 127
#define EC_R_NOT_IMPLEMENTED 136
#define EC_R_NOT_INITIALIZED 111
#define EC_R_NO_SUCH_EXTRA_DATA 105
#define EC_R_PARAMETERS2GROUP_FAILURE 128
#define EC_R_PKPARAMETERS2GROUP_FAILURE 137
#define EC_R_POINT_AT_INFINITY 106
#define EC_R_POINT_IS_NOT_ON_CURVE 107
#define EC_R_SLOT_FULL 108
#define EC_R_UNDEFINED_GENERATOR 113
#define EC_R_UNDEFINED_ORDER 122
#define EC_R_UNKNOWN_GROUP 116
#define EC_R_UNKNOWN_NID 117
#define EC_R_UNKNOWN_ORDER 114
#define EC_R_UNKNOWN_PARAMETERS_TYPE 129
#ifdef __cplusplus
}

View File

@ -1,874 +0,0 @@
/* crypto/ec/ec_asn1.c */
/* ====================================================================
* Copyright (c) 2000-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
* 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 "cryptlib.h"
#include "ec_lcl.h"
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>
/* some structures needed for the asn1 encoding */
typedef struct x9_62_fieldid_st {
ASN1_OBJECT *fieldType;
ASN1_TYPE *parameters;
} X9_62_FIELDID;
typedef struct x9_62_characteristic_two_st {
ASN1_INTEGER *m;
ASN1_OBJECT *basis;
ASN1_TYPE *parameters;
} X9_62_CHARACTERISTIC_TWO;
typedef struct x9_62_pentanomial_st {
ASN1_INTEGER k1;
ASN1_INTEGER k2;
ASN1_INTEGER k3;
} X9_62_PENTANOMIAL;
typedef struct x9_62_curve_st {
ASN1_OCTET_STRING *a;
ASN1_OCTET_STRING *b;
ASN1_BIT_STRING *seed;
} X9_62_CURVE;
struct ec_parameters_st {
ASN1_INTEGER *version;
X9_62_FIELDID *fieldID;
X9_62_CURVE *curve;
ASN1_OCTET_STRING *base;
ASN1_INTEGER *order;
ASN1_INTEGER *cofactor;
}/* ECPARAMETERS */;
struct ecpk_parameters_st {
int type;
union {
ASN1_OBJECT *named_curve;
ECPARAMETERS *parameters;
ASN1_NULL *implicitlyCA;
} value;
}/* ECPKPARAMETERS */;
/* the OpenSSL asn1 definitions */
ASN1_SEQUENCE(X9_62_FIELDID) = {
ASN1_SIMPLE(X9_62_FIELDID, fieldType, ASN1_OBJECT),
ASN1_SIMPLE(X9_62_FIELDID, parameters, ASN1_ANY)
} ASN1_SEQUENCE_END(X9_62_FIELDID)
DECLARE_ASN1_FUNCTIONS_const(X9_62_FIELDID)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(X9_62_FIELDID, X9_62_FIELDID)
IMPLEMENT_ASN1_FUNCTIONS_const(X9_62_FIELDID)
ASN1_SEQUENCE(X9_62_CHARACTERISTIC_TWO) = {
ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, m, ASN1_INTEGER),
ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, basis, ASN1_OBJECT),
ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, parameters, ASN1_ANY)
} ASN1_SEQUENCE_END(X9_62_CHARACTERISTIC_TWO)
DECLARE_ASN1_FUNCTIONS_const(X9_62_CHARACTERISTIC_TWO)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(X9_62_CHARACTERISTIC_TWO, X9_62_CHARACTERISTIC_TWO)
IMPLEMENT_ASN1_FUNCTIONS_const(X9_62_CHARACTERISTIC_TWO)
ASN1_SEQUENCE(X9_62_PENTANOMIAL) = {
ASN1_SIMPLE(X9_62_PENTANOMIAL, k1, ASN1_INTEGER),
ASN1_SIMPLE(X9_62_PENTANOMIAL, k2, ASN1_INTEGER),
ASN1_SIMPLE(X9_62_PENTANOMIAL, k3, ASN1_INTEGER)
} ASN1_SEQUENCE_END(X9_62_PENTANOMIAL)
DECLARE_ASN1_FUNCTIONS_const(X9_62_PENTANOMIAL)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(X9_62_PENTANOMIAL, X9_62_PENTANOMIAL)
IMPLEMENT_ASN1_FUNCTIONS_const(X9_62_PENTANOMIAL)
ASN1_SEQUENCE(X9_62_CURVE) = {
ASN1_SIMPLE(X9_62_CURVE, a, ASN1_OCTET_STRING),
ASN1_SIMPLE(X9_62_CURVE, b, ASN1_OCTET_STRING),
ASN1_OPT(X9_62_CURVE, seed, ASN1_BIT_STRING)
} ASN1_SEQUENCE_END(X9_62_CURVE)
DECLARE_ASN1_FUNCTIONS_const(X9_62_CURVE)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(X9_62_CURVE, X9_62_CURVE)
IMPLEMENT_ASN1_FUNCTIONS_const(X9_62_CURVE)
ASN1_SEQUENCE(ECPARAMETERS) = {
ASN1_SIMPLE(ECPARAMETERS, version, ASN1_INTEGER),
ASN1_SIMPLE(ECPARAMETERS, fieldID, X9_62_FIELDID),
ASN1_SIMPLE(ECPARAMETERS, curve, X9_62_CURVE),
ASN1_SIMPLE(ECPARAMETERS, base, ASN1_OCTET_STRING),
ASN1_SIMPLE(ECPARAMETERS, order, ASN1_INTEGER),
ASN1_SIMPLE(ECPARAMETERS, cofactor, ASN1_INTEGER)
} ASN1_SEQUENCE_END(ECPARAMETERS)
DECLARE_ASN1_FUNCTIONS_const(ECPARAMETERS)
IMPLEMENT_ASN1_FUNCTIONS_const(ECPARAMETERS)
ASN1_CHOICE(ECPKPARAMETERS) = {
ASN1_SIMPLE(ECPKPARAMETERS, value.named_curve, ASN1_OBJECT),
ASN1_SIMPLE(ECPKPARAMETERS, value.parameters, ECPARAMETERS),
ASN1_SIMPLE(ECPKPARAMETERS, value.implicitlyCA, ASN1_NULL)
} ASN1_CHOICE_END(ECPKPARAMETERS)
DECLARE_ASN1_FUNCTIONS_const(ECPKPARAMETERS)
IMPLEMENT_ASN1_FUNCTIONS_const(ECPKPARAMETERS)
/* some internal functions */
static X9_62_FIELDID *ec_asn1_group2field(const EC_GROUP *, X9_62_FIELDID *);
static X9_62_CURVE *ec_asn1_group2curve(const EC_GROUP *, X9_62_CURVE *);
static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *);
static ECPARAMETERS *ec_asn1_group2parameters(const EC_GROUP *,
ECPARAMETERS *);
static X9_62_FIELDID *ec_asn1_group2field(const EC_GROUP *group,
X9_62_FIELDID *field)
{
int ok=0, nid;
X9_62_FIELDID *ret=NULL;
BIGNUM *tmp=NULL;
if (field == NULL)
{
if ((ret = X9_62_FIELDID_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_MALLOC_FAILURE);
return NULL;
}
}
else
{
ret = field;
if (ret->fieldType != NULL)
ASN1_OBJECT_free(ret->fieldType);
if (ret->parameters != NULL)
ASN1_TYPE_free(ret->parameters);
}
nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
if ((ret->fieldType = OBJ_nid2obj(nid)) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_OBJ_LIB);
goto err;
}
if (nid == NID_X9_62_prime_field)
{
if ((tmp = BN_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_MALLOC_FAILURE);
goto err;
}
if ((ret->parameters = ASN1_TYPE_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_MALLOC_FAILURE);
goto err;
}
ret->parameters->type = V_ASN1_INTEGER;
if (!EC_GROUP_get_curve_GFp(group, tmp, NULL, NULL, NULL))
{
ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_EC_LIB);
goto err;
}
ret->parameters->value.integer = BN_to_ASN1_INTEGER(tmp, NULL);
if (ret->parameters->value.integer == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_ASN1_LIB);
goto err;
}
}
else
goto err;
ok = 1;
err : if (!ok)
{
if (ret && !field)
X9_62_FIELDID_free(ret);
ret = NULL;
}
if (tmp)
BN_free(tmp);
return(ret);
}
static X9_62_CURVE *ec_asn1_group2curve(const EC_GROUP *group,
X9_62_CURVE *curve)
{
int ok=0, nid;
X9_62_CURVE *ret=NULL;
BIGNUM *tmp_1=NULL,
*tmp_2=NULL;
unsigned char *buffer_1=NULL,
*buffer_2=NULL,
*a_buf=NULL,
*b_buf=NULL;
size_t len_1, len_2;
unsigned char char_zero = 0;
if ((tmp_1 = BN_new()) == NULL || (tmp_2 = BN_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_MALLOC_FAILURE);
goto err;
}
if (curve == NULL)
{
if ((ret = X9_62_CURVE_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_MALLOC_FAILURE);
goto err;
}
}
else
{
ret = curve;
if (ret->a)
ASN1_OCTET_STRING_free(ret->a);
if (ret->b)
ASN1_OCTET_STRING_free(ret->b);
if (ret->seed)
ASN1_BIT_STRING_free(ret->seed);
}
nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
/* get a and b */
if (nid == NID_X9_62_prime_field)
{
if (!EC_GROUP_get_curve_GFp(group, NULL, tmp_1, tmp_2, NULL))
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_EC_LIB);
goto err;
}
len_1 = (size_t)BN_num_bytes(tmp_1);
len_2 = (size_t)BN_num_bytes(tmp_2);
if (len_1 == 0)
{
/* len_1 == 0 => a == 0 */
a_buf = &char_zero;
len_1 = 1;
}
else
{
if ((buffer_1 = OPENSSL_malloc(len_1)) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE,
ERR_R_MALLOC_FAILURE);
goto err;
}
if ( (len_1 = BN_bn2bin(tmp_1, buffer_1)) == 0)
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_BN_LIB);
goto err;
}
a_buf = buffer_1;
}
if (len_2 == 0)
{
/* len_2 == 0 => b == 0 */
b_buf = &char_zero;
len_2 = 1;
}
else
{
if ((buffer_2 = OPENSSL_malloc(len_2)) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE,
ERR_R_MALLOC_FAILURE);
goto err;
}
if ( (len_2 = BN_bn2bin(tmp_2, buffer_2)) == 0)
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_BN_LIB);
goto err;
}
b_buf = buffer_2;
}
}
else
goto err;
/* set a and b */
if ((ret->a = M_ASN1_OCTET_STRING_new()) == NULL ||
(ret->b = M_ASN1_OCTET_STRING_new()) == NULL )
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!M_ASN1_OCTET_STRING_set(ret->a, a_buf, len_1) ||
!M_ASN1_OCTET_STRING_set(ret->b, b_buf, len_2))
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_ASN1_LIB);
goto err;
}
/* set the seed (optional) */
if (group->seed)
{
if ((ret->seed = ASN1_BIT_STRING_new()) == NULL) goto err;
if (!ASN1_BIT_STRING_set(ret->seed, group->seed,
(int)group->seed_len))
{
ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_ASN1_LIB);
goto err;
}
}
else
ret->seed = NULL;
ok = 1;
err : if (!ok)
{
if (ret && !curve)
X9_62_CURVE_free(ret);
ret = NULL;
}
if (buffer_1)
OPENSSL_free(buffer_1);
if (buffer_2)
OPENSSL_free(buffer_2);
if (tmp_1)
BN_free(tmp_1);
if (tmp_2)
BN_free(tmp_2);
return(ret);
}
static ECPARAMETERS *ec_asn1_group2parameters(const EC_GROUP *group,
ECPARAMETERS *param)
{
int ok=0;
size_t len=0;
ECPARAMETERS *ret=NULL;
BIGNUM *tmp=NULL;
unsigned char *buffer=NULL;
const EC_POINT *point=NULL;
point_conversion_form_t form;
if ((tmp = BN_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_MALLOC_FAILURE);
goto err;
}
if (param == NULL)
{
if ((ret = ECPARAMETERS_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS,
ERR_R_MALLOC_FAILURE);
goto err;
}
}
else
ret = param;
/* set the version (always one) */
if (ret->version == NULL && !(ret->version = ASN1_INTEGER_new()))
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!ASN1_INTEGER_set(ret->version, (long)0x1))
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_ASN1_LIB);
goto err;
}
/* set the fieldID */
ret->fieldID = ec_asn1_group2field(group, ret->fieldID);
if (ret->fieldID == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
goto err;
}
/* set the curve */
ret->curve = ec_asn1_group2curve(group, ret->curve);
if (ret->curve == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
goto err;
}
/* set the base point */
if ((point = EC_GROUP_get0_generator(group)) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, EC_R_UNDEFINED_GENERATOR);
goto err;
}
form = EC_GROUP_get_point_conversion_form(group);
len = EC_POINT_point2oct(group, point, form, NULL, len, NULL);
if (len == 0)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
goto err;
}
if ((buffer = OPENSSL_malloc(len)) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!EC_POINT_point2oct(group, point, form, buffer, len, NULL))
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
goto err;
}
if (ret->base == NULL && (ret->base = ASN1_OCTET_STRING_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!ASN1_OCTET_STRING_set(ret->base, buffer, len))
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_ASN1_LIB);
goto err;
}
/* set the order */
if (!EC_GROUP_get_order(group, tmp, NULL))
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
goto err;
}
ret->order = BN_to_ASN1_INTEGER(tmp, ret->order);
if (ret->order == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_ASN1_LIB);
goto err;
}
/* set the cofactor */
if (!EC_GROUP_get_cofactor(group, tmp, NULL))
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
goto err;
}
ret->cofactor = BN_to_ASN1_INTEGER(tmp, ret->cofactor);
if (ret->cofactor == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_ASN1_LIB);
goto err;
}
ok = 1;
err : if(!ok)
{
if (ret && !param)
ECPARAMETERS_free(ret);
ret = NULL;
}
if (tmp)
BN_free(tmp);
if (buffer)
OPENSSL_free(buffer);
return(ret);
}
ECPKPARAMETERS *EC_ASN1_group2pkparameters(const EC_GROUP *group,
ECPKPARAMETERS *params)
{
int ok = 1, tmp;
ECPKPARAMETERS *ret = params;
if (ret == NULL)
{
if ((ret = ECPKPARAMETERS_new()) == NULL)
{
ECerr(EC_F_EC_ASN1_GROUP2PKPARAMETERS,
ERR_R_MALLOC_FAILURE);
return NULL;
}
}
else
{
if (ret->type == 0 && ret->value.named_curve)
ASN1_OBJECT_free(ret->value.named_curve);
else if (ret->type == 1 && ret->value.parameters)
ECPARAMETERS_free(ret->value.parameters);
}
if (EC_GROUP_get_asn1_flag(group))
{
/* use the asn1 OID to describe the
* the elliptic curve parameters
*/
tmp = EC_GROUP_get_nid(group);
if (tmp)
{
ret->type = 0;
if ((ret->value.named_curve = OBJ_nid2obj(tmp)) == NULL)
ok = 0;
}
else
{
/* we have no nid => use the normal
* ECPARAMETERS structure
*/
ret->type = 1;
if ((ret->value.parameters = ec_asn1_group2parameters(
group, NULL)) == NULL)
ok = 0;
}
}
else
{
/* use the ECPARAMETERS structure */
ret->type = 1;
if ((ret->value.parameters = ec_asn1_group2parameters(
group, NULL)) == NULL)
ok = 0;
}
if (!ok)
{
ECPKPARAMETERS_free(ret);
return NULL;
}
return ret;
}
static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params)
{
int ok=0, tmp;
EC_GROUP *ret=NULL;
BIGNUM *p=NULL, *a=NULL, *b=NULL;
EC_POINT *point=NULL;
if (!params->fieldID || !params->fieldID->fieldType ||
!params->fieldID->parameters)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);
goto err;
}
tmp = OBJ_obj2nid(params->fieldID->fieldType);
if (tmp == NID_X9_62_characteristic_two_field)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_NOT_IMPLEMENTED);
goto err;
}
else if (tmp == NID_X9_62_prime_field)
{
/* we have a curve over a prime field */
/* extract the prime number */
if (params->fieldID->parameters->type != V_ASN1_INTEGER ||
!params->fieldID->parameters->value.integer)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);
goto err;
}
p = ASN1_INTEGER_to_BN(params->fieldID->parameters->value.integer, NULL);
if (p == NULL)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_ASN1_LIB);
goto err;
}
/* now extract the curve parameters a and b */
if (!params->curve || !params->curve->a ||
!params->curve->a->data || !params->curve->b ||
!params->curve->b->data)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);
goto err;
}
a = BN_bin2bn(params->curve->a->data,
params->curve->a->length, NULL);
if (a == NULL)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB);
goto err;
}
b = BN_bin2bn(params->curve->b->data, params->curve->b->length, NULL);
if (b == NULL)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB);
goto err;
}
/* create the EC_GROUP structure */
/* TODO */
ret = EC_GROUP_new_curve_GFp(p, a, b, NULL);
if (ret == NULL)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB);
goto err;
}
/* create the generator */
if ((point = EC_POINT_new(ret)) == NULL) goto err;
}
else
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_UNKNOWN_FIELD);
goto err;
}
if (params->curve->seed != NULL)
{
if (ret->seed != NULL)
OPENSSL_free(ret->seed);
if (!(ret->seed = OPENSSL_malloc(params->curve->seed->length)))
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP,
ERR_R_MALLOC_FAILURE);
goto err;
}
memcpy(ret->seed, params->curve->seed->data,
params->curve->seed->length);
ret->seed_len = params->curve->seed->length;
}
if (!params->order || !params->cofactor || !params->base ||
!params->base->data)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);
goto err;
}
a = ASN1_INTEGER_to_BN(params->order, a);
b = ASN1_INTEGER_to_BN(params->cofactor, b);
if (!a || !b)
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_ASN1_LIB);
goto err;
}
if (!EC_POINT_oct2point(ret, point, params->base->data,
params->base->length, NULL))
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB);
goto err;
}
/* set the point conversion form */
EC_GROUP_set_point_conversion_form(ret, (point_conversion_form_t)
(params->base->data[0] & ~0x01));
if (!EC_GROUP_set_generator(ret, point, a, b))
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB);
goto err;
}
ok = 1;
err: if (!ok)
{
if (ret)
EC_GROUP_clear_free(ret);
ret = NULL;
}
if (p)
BN_free(p);
if (a)
BN_free(a);
if (b)
BN_free(b);
if (point)
EC_POINT_free(point);
return(ret);
}
EC_GROUP *EC_ASN1_pkparameters2group(const ECPKPARAMETERS *params)
{
EC_GROUP *ret=NULL;
int tmp=0;
if (params == NULL)
{
ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP,
EC_R_MISSING_PARAMETERS);
return NULL;
}
if (params->type == 0)
{ /* the curve is given by an OID */
tmp = OBJ_obj2nid(params->value.named_curve);
if ((ret = EC_GROUP_new_by_name(tmp)) == NULL)
{
ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP,
EC_R_EC_GROUP_NEW_BY_NAME_FAILURE);
return NULL;
}
EC_GROUP_set_asn1_flag(ret, OPENSSL_EC_NAMED_CURVE);
}
else if (params->type == 1)
{ /* the parameters are given by a ECPARAMETERS
* structure */
ret = ec_asn1_parameters2group(params->value.parameters);
if (!ret)
{
ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP, ERR_R_EC_LIB);
return NULL;
}
EC_GROUP_set_asn1_flag(ret, 0x0);
}
else if (params->type == 2)
{ /* implicitlyCA */
return NULL;
}
else
{
ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);
return NULL;
}
return ret;
}
/* EC_GROUP <-> DER encoding of EC[PK]PARAMETERS */
EC_GROUP *d2i_ECParameters(EC_GROUP **a, const unsigned char **in, long len)
{
EC_GROUP *group = NULL;
ECPARAMETERS *params = NULL;
if ((params = d2i_ECPARAMETERS(NULL, in, len)) == NULL)
{
ECerr(EC_F_D2I_ECPARAMETERS, EC_R_D2I_ECPARAMETERS_FAILURE);
ECPARAMETERS_free(params);
return NULL;
}
if ((group = ec_asn1_parameters2group(params)) == NULL)
{
ECerr(EC_F_D2I_ECPARAMETERS, EC_R_PARAMETERS2GROUP_FAILURE);
return NULL;
}
if (a && *a)
EC_GROUP_clear_free(*a);
if (a)
*a = group;
ECPARAMETERS_free(params);
return(group);
}
EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)
{
EC_GROUP *group = NULL;
ECPKPARAMETERS *params = NULL;
if ((params = d2i_ECPKPARAMETERS(NULL, in, len)) == NULL)
{
ECerr(EC_F_D2I_ECPKPARAMETERS, EC_R_D2I_ECPKPARAMETERS_FAILURE);
ECPKPARAMETERS_free(params);
return NULL;
}
if ((group = EC_ASN1_pkparameters2group(params)) == NULL)
{
ECerr(EC_F_D2I_ECPKPARAMETERS, EC_R_PKPARAMETERS2GROUP_FAILURE);
return NULL;
}
if (a && *a)
EC_GROUP_clear_free(*a);
if (a)
*a = group;
ECPKPARAMETERS_free(params);
return(group);
}
int i2d_ECParameters(const EC_GROUP *a, unsigned char **out)
{
int ret=0;
ECPARAMETERS *tmp = ec_asn1_group2parameters(a, NULL);
if (tmp == NULL)
{
ECerr(EC_F_I2D_ECPARAMETERS, EC_R_GROUP2PARAMETERS_FAILURE);
return 0;
}
if ((ret = i2d_ECPARAMETERS(tmp, out)) == 0)
{
ECerr(EC_F_I2D_ECPARAMETERS, EC_R_I2D_EC_PARAMETERS_FAILURE);
ECPARAMETERS_free(tmp);
return 0;
}
ECPARAMETERS_free(tmp);
return(ret);
}
int i2d_ECPKParameters(const EC_GROUP *a, unsigned char **out)
{
int ret=0;
ECPKPARAMETERS *tmp = EC_ASN1_group2pkparameters(a, NULL);
if (tmp == NULL)
{
ECerr(EC_F_I2D_ECPKPARAMETERS, EC_R_GROUP2PKPARAMETERS_FAILURE);
return 0;
}
if ((ret = i2d_ECPKPARAMETERS(tmp, out)) == 0)
{
ECerr(EC_F_I2D_ECPKPARAMETERS, EC_R_I2D_ECPKPARAMETERS_FAILURE);
ECPKPARAMETERS_free(tmp);
return 0;
}
ECPKPARAMETERS_free(tmp);
return(ret);
}

View File

@ -1,122 +0,0 @@
/* crypto/ec/ec_check.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include "ec_lcl.h"
#include <openssl/err.h>
int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx)
{
int ret = 0;
BIGNUM *order;
BN_CTX *new_ctx = NULL;
EC_POINT *point = NULL;
if (ctx == NULL)
{
ctx = new_ctx = BN_CTX_new();
if (ctx == NULL)
{
ECerr(EC_F_EC_GROUP_CHECK, ERR_R_MALLOC_FAILURE);
goto err;
}
}
BN_CTX_start(ctx);
if ((order = BN_CTX_get(ctx)) == NULL) goto err;
/* check the discriminant */
if (!EC_GROUP_check_discriminant(group, ctx))
{
ECerr(EC_F_EC_GROUP_CHECK, EC_R_DISCRIMINANT_IS_ZERO);
goto err;
}
/* check the generator */
if (group->generator == NULL)
{
ECerr(EC_F_EC_GROUP_CHECK, EC_R_UNDEFINED_GENERATOR);
goto err;
}
if (!EC_POINT_is_on_curve(group, group->generator, ctx))
{
ECerr(EC_F_EC_GROUP_CHECK, EC_R_POINT_IS_NOT_ON_CURVE);
goto err;
}
/* check the order of the generator */
if ((point = EC_POINT_new(group)) == NULL) goto err;
if (!EC_GROUP_get_order(group, order, ctx)) goto err;
if (BN_is_zero(order))
{
ECerr(EC_F_EC_GROUP_CHECK, EC_R_UNDEFINED_ORDER);
goto err;
}
if (!EC_POINT_mul(group, point, order, NULL, NULL, ctx)) goto err;
if (!EC_POINT_is_at_infinity(group, point))
{
ECerr(EC_F_EC_GROUP_CHECK, EC_R_INVALID_GROUP_ORDER);
goto err;
}
ret = 1;
err:
BN_CTX_end(ctx);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
if (point)
EC_POINT_free(point);
return ret;
}

View File

@ -1,362 +0,0 @@
/* crypto/ec/ec_curve.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include "ec_lcl.h"
#include <openssl/err.h>
#include <openssl/obj_mac.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
/* #define _EC_GROUP_EXAMPLE_PRIME_CURVE \
* "the prime number p", "a", "b", "the compressed base point", "y-bit", "order", "cofactor"
*/
/* the nist prime curves */
#define _EC_GROUP_NIST_PRIME_192 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",\
"64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1",\
"188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012",1,\
"FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831",1
#define _EC_GROUP_NIST_PRIME_224 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001",\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE",\
"B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4",\
"B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21",0,\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D",1
#define _EC_GROUP_NIST_PRIME_384 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF",\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC",\
"B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF",\
"AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7",1,\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973",1
#define _EC_GROUP_NIST_PRIME_521 \
"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",\
"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC",\
"051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B"\
"315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00",\
"C6858E06B70404E9CD9E3ECB662395B4429C648139053F"\
"B521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66",0,\
"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\
"FFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409",1
/* the x9.62 prime curves (minus the nist prime curves) */
#define _EC_GROUP_X9_62_PRIME_192V2 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",\
"CC22D6DFB95C6B25E49C0D6364A4E5980C393AA21668D953",\
"EEA2BAE7E1497842F2DE7769CFE9C989C072AD696F48034A",1,\
"FFFFFFFFFFFFFFFFFFFFFFFE5FB1A724DC80418648D8DD31",1
#define _EC_GROUP_X9_62_PRIME_192V3 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",\
"22123DC2395A05CAA7423DAECCC94760A7D462256BD56916",\
"7D29778100C65A1DA1783716588DCE2B8B4AEE8E228F1896",0,\
"FFFFFFFFFFFFFFFFFFFFFFFF7A62D031C83F4294F640EC13",1
#define _EC_GROUP_X9_62_PRIME_239V1 \
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",\
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",\
"6B016C3BDCF18941D0D654921475CA71A9DB2FB27D1D37796185C2942C0A",\
"0FFA963CDCA8816CCC33B8642BEDF905C3D358573D3F27FBBD3B3CB9AAAF",0,\
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B",1
#define _EC_GROUP_X9_62_PRIME_239V2 \
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",\
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",\
"617FAB6832576CBBFED50D99F0249C3FEE58B94BA0038C7AE84C8C832F2C",\
"38AF09D98727705120C921BB5E9E26296A3CDCF2F35757A0EAFD87B830E7",0,\
"7FFFFFFFFFFFFFFFFFFFFFFF800000CFA7E8594377D414C03821BC582063",1
#define _EC_GROUP_X9_62_PRIME_239V3 \
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",\
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",\
"255705FA2A306654B1F4CB03D6A750A30C250102D4988717D9BA15AB6D3E",\
"6768AE8E18BB92CFCF005C949AA2C6D94853D0E660BBF854B1C9505FE95A",1,\
"7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF975DEB41B3A6057C3C432146526551",1
#define _EC_GROUP_X9_62_PRIME_256V1 \
"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",\
"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",\
"5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",\
"6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",1,\
"FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",1
/* the secg prime curves (minus the nist and x9.62 prime curves) */
#define _EC_GROUP_SECG_PRIME_112R1 \
"DB7C2ABF62E35E668076BEAD208B",\
"DB7C2ABF62E35E668076BEAD2088",\
"659EF8BA043916EEDE8911702B22",\
"09487239995A5EE76B55F9C2F098",0,\
"DB7C2ABF62E35E7628DFAC6561C5",1
#define _EC_GROUP_SECG_PRIME_112R2 \
"DB7C2ABF62E35E668076BEAD208B",\
"6127C24C05F38A0AAAF65C0EF02C",\
"51DEF1815DB5ED74FCC34C85D709",\
"4BA30AB5E892B4E1649DD0928643",1,\
"36DF0AAFD8B8D7597CA10520D04B",4
#define _EC_GROUP_SECG_PRIME_128R1 \
"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",\
"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC",\
"E87579C11079F43DD824993C2CEE5ED3",\
"161FF7528B899B2D0C28607CA52C5B86",1,\
"FFFFFFFE0000000075A30D1B9038A115",1
#define _EC_GROUP_SECG_PRIME_128R2 \
"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",\
"D6031998D1B3BBFEBF59CC9BBFF9AEE1",\
"5EEEFCA380D02919DC2C6558BB6D8A5D",\
"7B6AA5D85E572983E6FB32A7CDEBC140",0,\
"3FFFFFFF7FFFFFFFBE0024720613B5A3",4
#define _EC_GROUP_SECG_PRIME_160K1 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",\
"0",\
"7",\
"3B4C382CE37AA192A4019E763036F4F5DD4D7EBB",0,\
"0100000000000000000001B8FA16DFAB9ACA16B6B3",1
#define _EC_GROUP_SECG_PRIME_160R1 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF",\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC",\
"1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45",\
"4A96B5688EF573284664698968C38BB913CBFC82",0,\
"0100000000000000000001F4C8F927AED3CA752257",1
#define _EC_GROUP_SECG_PRIME_160R2 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70",\
"B4E134D3FB59EB8BAB57274904664D5AF50388BA",\
"52DCB034293A117E1F4FF11B30F7199D3144CE6D",0,\
"0100000000000000000000351EE786A818F3A1A16B",1
#define _EC_GROUP_SECG_PRIME_192K1 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37",\
"0",\
"3",\
"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D",1,\
"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D",1
#define _EC_GROUP_SECG_PRIME_224K1 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D",\
"0",\
"5",\
"A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C",1,\
"010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7",1
#define _EC_GROUP_SECG_PRIME_256K1 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F",\
"0",\
"7",\
"79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",0,\
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",1
/* some wap/wtls curves */
#define _EC_GROUP_WTLS_6 \
"DB7C2ABF62E35E668076BEAD208B",\
"DB7C2ABF62E35E668076BEAD2088",\
"659EF8BA043916EEDE8911702B22",\
"09487239995A5EE76B55F9C2F098",0,\
"DB7C2ABF62E35E7628DFAC6561C5",1
#define _EC_GROUP_WTLS_8 \
"FFFFFFFFFFFFFFFFFFFFFFFFFDE7",\
"0",\
"3",\
"1",0,\
"0100000000000001ECEA551AD837E9",1
#define _EC_GROUP_WTLS_9 \
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC808F",\
"0",\
"3",\
"1",0,\
"0100000000000000000001CDC98AE0E2DE574ABF33",1
static EC_GROUP *ec_group_new_GFp_from_hex(const char *prime_in,
const char *a_in, const char *b_in,
const char *x_in, const int y_bit, const char *order_in, const BN_ULONG cofac_in)
{
EC_GROUP *group=NULL;
EC_POINT *P=NULL;
BN_CTX *ctx=NULL;
BIGNUM *prime=NULL,*a=NULL,*b=NULL,*x=NULL,*order=NULL;
int ok=0;
if ((ctx = BN_CTX_new()) == NULL) goto bn_err;
if ((prime = BN_new()) == NULL || (a = BN_new()) == NULL || (b = BN_new()) == NULL ||
(x = BN_new()) == NULL || (order = BN_new()) == NULL) goto bn_err;
if (!BN_hex2bn(&prime, prime_in)) goto bn_err;
if (!BN_hex2bn(&a, a_in)) goto bn_err;
if (!BN_hex2bn(&b, b_in)) goto bn_err;
if ((group = EC_GROUP_new_curve_GFp(prime, a, b, ctx)) == NULL) goto err;
if ((P = EC_POINT_new(group)) == NULL) goto err;
if (!BN_hex2bn(&x, x_in)) goto bn_err;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, y_bit, ctx)) goto err;
if (!BN_hex2bn(&order, order_in)) goto bn_err;
if (!BN_set_word(x, cofac_in)) goto bn_err;
if (!EC_GROUP_set_generator(group, P, order, x)) goto err;
ok=1;
bn_err:
if (!ok)
ECerr(EC_F_EC_GROUP_NEW_GFP_FROM_HEX, ERR_R_BN_LIB);
err:
if (!ok)
{
EC_GROUP_free(group);
group = NULL;
}
if (P) EC_POINT_free(P);
if (ctx) BN_CTX_free(ctx);
if (prime) BN_free(prime);
if (a) BN_free(a);
if (b) BN_free(b);
if (order) BN_free(order);
if (x) BN_free(x);
return(group);
}
EC_GROUP *EC_GROUP_new_by_name(int name)
{
EC_GROUP *ret = NULL;
switch (name)
{
case EC_GROUP_NO_CURVE:
return NULL;
/* some nist curves */
case EC_GROUP_NIST_PRIME_224: /* EC_GROUP_NIST_PRIME_224 == EC_GROUP_SECG_PRIME_224R1 */
ret = ec_group_new_GFp_from_hex(_EC_GROUP_NIST_PRIME_224);
break;
case EC_GROUP_NIST_PRIME_384: /* EC_GROUP_NIST_PRIME_384 == EC_GROUP_SECG_PRIME_384R1 */
ret = ec_group_new_GFp_from_hex(_EC_GROUP_NIST_PRIME_384);
break;
case EC_GROUP_NIST_PRIME_521: /* EC_GROUP_NIST_PRIME_521 == EC_GROUP_SECG_PRIME_521R1 */
ret = ec_group_new_GFp_from_hex(_EC_GROUP_NIST_PRIME_521);
break;
/* x9.62 prime curves */
case EC_GROUP_X9_62_PRIME_192V1: /* == EC_GROUP_NIST_PRIME_192 == EC_GROUP_SECG_PRIME_192R1 */
ret = ec_group_new_GFp_from_hex(_EC_GROUP_NIST_PRIME_192);
break;
case EC_GROUP_X9_62_PRIME_192V2:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_X9_62_PRIME_192V2);
break;
case EC_GROUP_X9_62_PRIME_192V3:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_X9_62_PRIME_192V3);
break;
case EC_GROUP_X9_62_PRIME_239V1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_X9_62_PRIME_239V1);
break;
case EC_GROUP_X9_62_PRIME_239V2:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_X9_62_PRIME_239V2);
break;
case EC_GROUP_X9_62_PRIME_239V3:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_X9_62_PRIME_239V3);
break;
case EC_GROUP_X9_62_PRIME_256V1: /* == EC_GROUP_NIST_PRIME_256 == EC_GROUP_SECG_PRIME_256R1 */
ret = ec_group_new_GFp_from_hex(_EC_GROUP_X9_62_PRIME_256V1);
break;
/* the remaining secg curves */
case EC_GROUP_SECG_PRIME_112R1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_112R1);
break;
case EC_GROUP_SECG_PRIME_112R2:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_112R2);
break;
case EC_GROUP_SECG_PRIME_128R1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_128R1);
break;
case EC_GROUP_SECG_PRIME_128R2:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_128R2);
break;
case EC_GROUP_SECG_PRIME_160K1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_160K1);
break;
case EC_GROUP_SECG_PRIME_160R1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_160R1);
break;
case EC_GROUP_SECG_PRIME_160R2:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_160R2);
break;
case EC_GROUP_SECG_PRIME_192K1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_192K1);
break;
case EC_GROUP_SECG_PRIME_224K1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_224K1);
break;
case EC_GROUP_SECG_PRIME_256K1:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_SECG_PRIME_256K1);
break;
/* some wap/wtls curves */
case EC_GROUP_WTLS_6:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_WTLS_6);
break;
case EC_GROUP_WTLS_8:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_WTLS_8);
break;
case EC_GROUP_WTLS_9:
ret = ec_group_new_GFp_from_hex(_EC_GROUP_WTLS_9);
break;
}
if (ret == NULL)
{
ECerr(EC_F_EC_GROUP_NEW_BY_NAME, EC_R_UNKNOWN_GROUP);
return NULL;
}
EC_GROUP_set_nid(ret, name);
return ret;
}
EC_GROUP *EC_GROUP_new_by_nid(int nid)
{
return EC_GROUP_new_by_name(nid);
}

View File

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

View File

@ -1,6 +1,6 @@
/* crypto/ec/ec_err.c */
/* ====================================================================
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -67,24 +67,12 @@
static ERR_STRING_DATA EC_str_functs[]=
{
{ERR_PACK(0,EC_F_COMPUTE_WNAF,0), "COMPUTE_WNAF"},
{ERR_PACK(0,EC_F_D2I_ECDSAPARAMETERS,0), "d2i_ECDSAParameters"},
{ERR_PACK(0,EC_F_D2I_ECPARAMETERS,0), "d2i_ECParameters"},
{ERR_PACK(0,EC_F_D2I_ECPKPARAMETERS,0), "d2i_ECPKParameters"},
{ERR_PACK(0,EC_F_ECPKPARAMETERS_PRINT,0), "ECPKParameters_print"},
{ERR_PACK(0,EC_F_ECPKPARAMETERS_PRINT_FP,0), "ECPKParameters_print_fp"},
{ERR_PACK(0,EC_F_EC_ASN1_GROUP2CURVE,0), "EC_ASN1_GROUP2CURVE"},
{ERR_PACK(0,EC_F_EC_ASN1_GROUP2FIELDID,0), "EC_ASN1_GROUP2FIELDID"},
{ERR_PACK(0,EC_F_EC_ASN1_GROUP2PARAMETERS,0), "EC_ASN1_GROUP2PARAMETERS"},
{ERR_PACK(0,EC_F_EC_ASN1_GROUP2PKPARAMETERS,0), "EC_ASN1_group2pkparameters"},
{ERR_PACK(0,EC_F_EC_ASN1_PARAMETERS2GROUP,0), "EC_ASN1_PARAMETERS2GROUP"},
{ERR_PACK(0,EC_F_EC_ASN1_PKPARAMETERS2GROUP,0), "EC_ASN1_pkparameters2group"},
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_DECODE,0), "ec_GFp_mont_field_decode"},
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_ENCODE,0), "ec_GFp_mont_field_encode"},
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_MUL,0), "ec_GFp_mont_field_mul"},
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_SQR,0), "ec_GFp_mont_field_sqr"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT,0), "ec_GFp_simple_group_check_discriminant"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP,0), "ec_GFp_simple_group_set_curve_GFp"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR,0), "EC_GFP_SIMPLE_GROUP_SET_GENERATOR"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR,0), "ec_GFp_simple_group_set_generator"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_MAKE_AFFINE,0), "ec_GFp_simple_make_affine"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_OCT2POINT,0), "ec_GFp_simple_oct2point"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT2OCT,0), "ec_GFp_simple_point2oct"},
@ -92,19 +80,13 @@ static ERR_STRING_DATA EC_str_functs[]=
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP,0), "ec_GFp_simple_point_get_affine_coordinates_GFp"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP,0), "ec_GFp_simple_point_set_affine_coordinates_GFp"},
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP,0), "ec_GFp_simple_set_compressed_coordinates_GFp"},
{ERR_PACK(0,EC_F_EC_GROUP_CHECK,0), "EC_GROUP_check"},
{ERR_PACK(0,EC_F_EC_GROUP_CHECK_DISCRIMINANT,0), "EC_GROUP_check_discriminant"},
{ERR_PACK(0,EC_F_EC_GROUP_COPY,0), "EC_GROUP_copy"},
{ERR_PACK(0,EC_F_EC_GROUP_GET0_GENERATOR,0), "EC_GROUP_get0_generator"},
{ERR_PACK(0,EC_F_EC_GROUP_GET_COFACTOR,0), "EC_GROUP_get_cofactor"},
{ERR_PACK(0,EC_F_EC_GROUP_GET_CURVE_GFP,0), "EC_GROUP_get_curve_GFp"},
{ERR_PACK(0,EC_F_EC_GROUP_GET_EXTRA_DATA,0), "EC_GROUP_get_extra_data"},
{ERR_PACK(0,EC_F_EC_GROUP_GET_ORDER,0), "EC_GROUP_get_order"},
{ERR_PACK(0,EC_F_EC_GROUP_GROUP2NID,0), "EC_GROUP_GROUP2NID"},
{ERR_PACK(0,EC_F_EC_GROUP_NEW,0), "EC_GROUP_new"},
{ERR_PACK(0,EC_F_EC_GROUP_NEW_BY_NAME,0), "EC_GROUP_new_by_name"},
{ERR_PACK(0,EC_F_EC_GROUP_NEW_BY_NID,0), "EC_GROUP_new_by_nid"},
{ERR_PACK(0,EC_F_EC_GROUP_NEW_GFP_FROM_HEX,0), "EC_GROUP_NEW_GFP_FROM_HEX"},
{ERR_PACK(0,EC_F_EC_GROUP_PRECOMPUTE_MULT,0), "EC_GROUP_precompute_mult"},
{ERR_PACK(0,EC_F_EC_GROUP_SET_CURVE_GFP,0), "EC_GROUP_set_curve_GFp"},
{ERR_PACK(0,EC_F_EC_GROUP_SET_EXTRA_DATA,0), "EC_GROUP_set_extra_data"},
@ -128,26 +110,12 @@ static ERR_STRING_DATA EC_str_functs[]=
{ERR_PACK(0,EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP,0), "EC_POINT_set_Jprojective_coordinates_GFp"},
{ERR_PACK(0,EC_F_EC_POINT_SET_TO_INFINITY,0), "EC_POINT_set_to_infinity"},
{ERR_PACK(0,EC_F_GFP_MONT_GROUP_SET_CURVE_GFP,0), "GFP_MONT_GROUP_SET_CURVE_GFP"},
{ERR_PACK(0,EC_F_I2D_ECDSAPARAMETERS,0), "i2d_ECDSAParameters"},
{ERR_PACK(0,EC_F_I2D_ECPARAMETERS,0), "i2d_ECParameters"},
{ERR_PACK(0,EC_F_I2D_ECPKPARAMETERS,0), "i2d_ECPKParameters"},
{0,NULL}
};
static ERR_STRING_DATA EC_str_reasons[]=
{
{EC_R_ASN1_ERROR ,"asn1 error"},
{EC_R_ASN1_UNKNOWN_FIELD ,"asn1 unknown field"},
{EC_R_BUFFER_TOO_SMALL ,"buffer too small"},
{EC_R_D2I_ECPARAMETERS_FAILURE ,"d2i ecparameters failure"},
{EC_R_D2I_ECPKPARAMETERS_FAILURE ,"d2i ecpkparameters failure"},
{EC_R_D2I_EC_PARAMETERS_FAILURE ,"d2i ec parameters failure"},
{EC_R_DISCRIMINANT_IS_ZERO ,"discriminant is zero"},
{EC_R_EC_GROUP_NEW_BY_NAME_FAILURE ,"ec group new by name failure"},
{EC_R_GROUP2PARAMETERS_FAILURE ,"group2parameters failure"},
{EC_R_GROUP2PKPARAMETERS_FAILURE ,"group2pkparameters failure"},
{EC_R_I2D_ECPKPARAMETERS_FAILURE ,"i2d ecpkparameters failure"},
{EC_R_I2D_EC_PARAMETERS_FAILURE ,"i2d ec parameters failure"},
{EC_R_INCOMPATIBLE_OBJECTS ,"incompatible objects"},
{EC_R_INVALID_ARGUMENT ,"invalid argument"},
{EC_R_INVALID_COMPRESSED_POINT ,"invalid compressed point"},
@ -155,22 +123,13 @@ static ERR_STRING_DATA EC_str_reasons[]=
{EC_R_INVALID_ENCODING ,"invalid encoding"},
{EC_R_INVALID_FIELD ,"invalid field"},
{EC_R_INVALID_FORM ,"invalid form"},
{EC_R_INVALID_GROUP_ORDER ,"invalid group order"},
{EC_R_MISSING_PARAMETERS ,"missing parameters"},
{EC_R_NOT_IMPLEMENTED ,"not implemented"},
{EC_R_NOT_INITIALIZED ,"not initialized"},
{EC_R_NO_SUCH_EXTRA_DATA ,"no such extra data"},
{EC_R_PARAMETERS2GROUP_FAILURE ,"parameters2group failure"},
{EC_R_PKPARAMETERS2GROUP_FAILURE ,"pkparameters2group failure"},
{EC_R_POINT_AT_INFINITY ,"point at infinity"},
{EC_R_POINT_IS_NOT_ON_CURVE ,"point is not on curve"},
{EC_R_SLOT_FULL ,"slot full"},
{EC_R_UNDEFINED_GENERATOR ,"undefined generator"},
{EC_R_UNDEFINED_ORDER ,"undefined order"},
{EC_R_UNKNOWN_GROUP ,"unknown group"},
{EC_R_UNKNOWN_NID ,"unknown nid"},
{EC_R_UNKNOWN_ORDER ,"unknown order"},
{EC_R_UNKNOWN_PARAMETERS_TYPE ,"unknown parameters type"},
{0,NULL}
};

View File

@ -56,7 +56,6 @@
#include <stdlib.h>
#include <openssl/obj_mac.h>
#include <openssl/ec.h>
@ -64,9 +63,6 @@
* so all this may change in future versions. */
struct ec_method_st {
/* used by EC_METHOD_get_field_type: */
int field_type; /* a NID */
/* used by EC_GROUP_new, EC_GROUP_free, EC_GROUP_clear_free, EC_GROUP_copy: */
int (*group_init)(EC_GROUP *);
void (*group_finish)(EC_GROUP *);
@ -77,8 +73,14 @@ struct ec_method_st {
int (*group_set_curve_GFp)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
int (*group_get_curve_GFp)(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *);
/* used by EC_GROUP_check: */
int (*group_check_discriminant)(const EC_GROUP *, BN_CTX *);
/* used by EC_GROUP_set_generator, EC_GROUP_get0_generator,
* EC_GROUP_get_order, EC_GROUP_get_cofactor:
*/
int (*group_set_generator)(EC_GROUP *, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor);
EC_POINT *(*group_get0_generator)(const EC_GROUP *);
int (*group_get_order)(const EC_GROUP *, BIGNUM *order, BN_CTX *);
int (*group_get_cofactor)(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *);
/* used by EC_POINT_new, EC_POINT_free, EC_POINT_clear_free, EC_POINT_copy: */
int (*point_init)(EC_POINT *);
@ -141,29 +143,16 @@ struct ec_method_st {
struct ec_group_st {
const EC_METHOD *meth;
EC_POINT *generator; /* optional */
BIGNUM order, cofactor;
int curve_name;/* optional NID for named curve */
int asn1_flag; /* flag to control the asn1 encoding */
point_conversion_form_t asn1_form;
unsigned char *seed; /* optional seed for parameters (appears in ASN1) */
size_t seed_len;
void *extra_data;
void *(*extra_data_dup_func)(void *);
void (*extra_data_free_func)(void *);
void (*extra_data_clear_free_func)(void *);
/* The following members are handled by the method functions,
* even if they appear generic */
/* All members except 'meth' and 'extra_data...' are handled by
* the method functions, even if they appear generic */
BIGNUM field; /* Field specification.
* For curves over GF(p), this is the modulus;
* for curves over GF(2^m), this is the
* irreducible polynomial defining the field.
*/
* For curves over GF(p), this is the modulus. */
BIGNUM a, b; /* Curve coefficients.
* (Here the assumption is that BIGNUMs can be used
@ -171,13 +160,12 @@ struct ec_group_st {
* For characteristic > 3, the curve is defined
* by a Weierstrass equation of the form
* y^2 = x^3 + a*x + b.
* For characteristic 2, the curve is defined by
* an equation of the form
* y^2 + x*y = x^3 + a*x^2 + b.
*/
int a_is_minus3; /* enable optimized point arithmetics for special case */
EC_POINT *generator; /* optional */
BIGNUM order, cofactor;
void *field_data1; /* method-specific (e.g., Montgomery structure) */
void *field_data2; /* method-specific */
} /* EC_GROUP */;
@ -220,7 +208,11 @@ void ec_GFp_simple_group_clear_finish(EC_GROUP *);
int ec_GFp_simple_group_copy(EC_GROUP *, const EC_GROUP *);
int ec_GFp_simple_group_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
int ec_GFp_simple_group_get_curve_GFp(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *);
int ec_GFp_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *);
int ec_GFp_simple_group_set_generator(EC_GROUP *, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor);
EC_POINT *ec_GFp_simple_group_get0_generator(const EC_GROUP *);
int ec_GFp_simple_group_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *);
int ec_GFp_simple_group_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *);
int ec_GFp_simple_point_init(EC_POINT *);
void ec_GFp_simple_point_finish(EC_POINT *);
void ec_GFp_simple_point_clear_finish(EC_POINT *);

View File

@ -1,6 +1,6 @@
/* crypto/ec/ec_lib.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -93,18 +93,7 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
ret->extra_data_dup_func = 0;
ret->extra_data_free_func = 0;
ret->extra_data_clear_free_func = 0;
ret->generator = NULL;
BN_init(&ret->order);
BN_init(&ret->cofactor);
ret->curve_name = 0;
ret->asn1_flag = 0;
ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
ret->seed = NULL;
ret->seed_len = 0;
if (!meth->group_init(ret))
{
OPENSSL_free(ret);
@ -124,14 +113,6 @@ void EC_GROUP_free(EC_GROUP *group)
EC_GROUP_free_extra_data(group);
if (group->generator != NULL)
EC_POINT_free(group->generator);
BN_free(&group->order);
BN_free(&group->cofactor);
if (group->seed)
OPENSSL_free(group->seed);
OPENSSL_free(group);
}
@ -147,17 +128,6 @@ void EC_GROUP_clear_free(EC_GROUP *group)
EC_GROUP_clear_free_extra_data(group);
if (group->generator != NULL)
EC_POINT_clear_free(group->generator);
BN_clear_free(&group->order);
BN_clear_free(&group->cofactor);
if (group->seed)
{
memset(group->seed, 0, group->seed_len);
OPENSSL_free(group->seed);
}
memset(group, 0, sizeof *group);
OPENSSL_free(group);
}
@ -193,52 +163,6 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
dest->extra_data_clear_free_func = src->extra_data_clear_free_func;
}
if (src->generator != NULL)
{
if (dest->generator == NULL)
{
dest->generator = EC_POINT_new(dest);
if (dest->generator == NULL) return 0;
}
if (!EC_POINT_copy(dest->generator, src->generator)) return 0;
}
else
{
/* src->generator == NULL */
if (dest->generator != NULL)
{
EC_POINT_clear_free(dest->generator);
dest->generator = NULL;
}
}
if (!BN_copy(&dest->order, &src->order)) return 0;
if (!BN_copy(&dest->cofactor, &src->cofactor)) return 0;
dest->curve_name = src->curve_name;
dest->asn1_flag = src->asn1_flag;
dest->asn1_form = src->asn1_form;
if (src->seed)
{
if (dest->seed)
OPENSSL_free(dest->seed);
dest->seed = OPENSSL_malloc(src->seed_len);
if (dest->seed == NULL)
return 0;
if (!memcpy(dest->seed, src->seed, src->seed_len))
return 0;
dest->seed_len = src->seed_len;
}
else
{
if (dest->seed)
OPENSSL_free(dest->seed);
dest->seed = NULL;
dest->seed_len = 0;
}
return dest->meth->group_copy(dest, src);
}
@ -249,135 +173,6 @@ const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
}
int EC_METHOD_get_field_type(const EC_METHOD *meth)
{
return meth->field_type;
}
int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor)
{
if (generator == NULL)
{
ECerr(EC_F_EC_GROUP_SET_GENERATOR, ERR_R_PASSED_NULL_PARAMETER);
return 0 ;
}
if (group->generator == NULL)
{
group->generator = EC_POINT_new(group);
if (group->generator == NULL) return 0;
}
if (!EC_POINT_copy(group->generator, generator)) return 0;
if (order != NULL)
{ if (!BN_copy(&group->order, order)) return 0; }
else
{ if (!BN_zero(&group->order)) return 0; }
if (cofactor != NULL)
{ if (!BN_copy(&group->cofactor, cofactor)) return 0; }
else
{ if (!BN_zero(&group->cofactor)) return 0; }
return 1;
}
EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group)
{
return group->generator;
}
int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
{
if (!BN_copy(order, &group->order))
return 0;
return !BN_is_zero(order);
}
int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
{
if (!BN_copy(cofactor, &group->cofactor))
return 0;
return !BN_is_zero(&group->cofactor);
}
void EC_GROUP_set_nid(EC_GROUP *group, int nid)
{
group->curve_name = nid;
}
int EC_GROUP_get_nid(const EC_GROUP *group)
{
return group->curve_name;
}
void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag)
{
group->asn1_flag = flag;
}
int EC_GROUP_get_asn1_flag(const EC_GROUP *group)
{
return group->asn1_flag;
}
void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
point_conversion_form_t form)
{
group->asn1_form = form;
}
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *group)
{
return group->asn1_form;
}
size_t EC_GROUP_set_seed(EC_GROUP *group, const unsigned char *p, size_t len)
{
if (group->seed)
{
OPENSSL_free(group->seed);
group->seed = NULL;
group->seed_len = 0;
}
if (!len || !p)
return 1;
if ((group->seed = OPENSSL_malloc(len)) == NULL)
return 0;
memcpy(group->seed, p, len);
group->seed_len = len;
return len;
}
unsigned char *EC_GROUP_get0_seed(const EC_GROUP *group)
{
return group->seed;
}
size_t EC_GROUP_get_seed_len(const EC_GROUP *group)
{
return group->seed_len;
}
int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
if (group->meth->group_set_curve_GFp == 0)
@ -400,14 +195,47 @@ int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *
}
int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor)
{
if (group->meth->group_check_discriminant == 0)
if (group->meth->group_set_generator == 0)
{
ECerr(EC_F_EC_GROUP_CHECK_DISCRIMINANT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
ECerr(EC_F_EC_GROUP_SET_GENERATOR, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
return group->meth->group_check_discriminant(group, ctx);
return group->meth->group_set_generator(group, generator, order, cofactor);
}
EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group)
{
if (group->meth->group_get0_generator == 0)
{
ECerr(EC_F_EC_GROUP_GET0_GENERATOR, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
return group->meth->group_get0_generator(group);
}
int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
{
if (group->meth->group_get_order == 0)
{
ECerr(EC_F_EC_GROUP_GET_ORDER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
return group->meth->group_get_order(group, order, ctx);
}
int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
{
if (group->meth->group_get_cofactor == 0)
{
ECerr(EC_F_EC_GROUP_GET_COFACTOR, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
return group->meth->group_get_cofactor(group, cofactor, ctx);
}
@ -474,6 +302,7 @@ void EC_GROUP_clear_free_extra_data(EC_GROUP *group)
}
/* functions for EC_POINT objects */
EC_POINT *EC_POINT_new(const EC_GROUP *group)

View File

@ -1,6 +1,6 @@
/* crypto/ec/ec_mult.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -68,23 +68,25 @@
*/
/* Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'.
/* Determine the width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'.
* This is an array r[] of values that are either zero or odd with an
* absolute value less than 2^w satisfying
* scalar = \sum_j r[j]*2^j
* where at most one of any w+1 consecutive digits is non-zero
* with the exception that the most significant digit may be only
* w-1 zeros away from that next non-zero digit.
* where at most one of any w+1 consecutive digits is non-zero.
*/
static signed char *compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
static signed char *compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len, BN_CTX *ctx)
{
int window_val;
BIGNUM *c;
int ok = 0;
signed char *r = NULL;
int sign = 1;
int bit, next_bit, mask;
size_t len = 0, j;
BN_CTX_start(ctx);
c = BN_CTX_get(ctx);
if (c == NULL) goto err;
if (w <= 0 || w > 7) /* 'signed char' can represent integers with absolute values less than 2^7 */
{
ECerr(EC_F_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
@ -94,84 +96,60 @@ static signed char *compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
next_bit = bit << 1; /* at most 256 */
mask = next_bit - 1; /* at most 255 */
if (scalar->neg)
if (!BN_copy(c, scalar)) goto err;
if (c->neg)
{
sign = -1;
c->neg = 0;
}
len = BN_num_bits(scalar);
r = OPENSSL_malloc(len + 1); /* modified wNAF may be one digit longer than binary representation */
len = BN_num_bits(c) + 1; /* wNAF may be one digit longer than binary representation */
r = OPENSSL_malloc(len);
if (r == NULL) goto err;
if (scalar->d == NULL || scalar->top == 0)
{
ECerr(EC_F_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
goto err;
}
window_val = scalar->d[0] & mask;
j = 0;
while ((window_val != 0) || (j + w + 1 < len)) /* if j+w+1 >= len, window_val will not increase */
while (!BN_is_zero(c))
{
int digit = 0;
int u = 0;
/* 0 <= window_val <= 2^(w+1) */
if (window_val & 1)
if (BN_is_odd(c))
{
/* 0 < window_val < 2^(w+1) */
if (window_val & bit)
{
digit = window_val - next_bit; /* -2^w < digit < 0 */
#if 1 /* modified wNAF */
if (j + w + 1 >= len)
{
/* special case for generating modified wNAFs:
* no new bits will be added into window_val,
* so using a positive digit here will decrease
* the total length of the representation */
digit = window_val & (mask >> 1); /* 0 < digit < 2^w */
}
#endif
}
else
{
digit = window_val; /* 0 < digit < 2^w */
}
if (digit <= -bit || digit >= bit || !(digit & 1))
if (c->d == NULL || c->top == 0)
{
ECerr(EC_F_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
goto err;
}
u = c->d[0] & mask;
if (u & bit)
{
u -= next_bit;
/* u < 0 */
if (!BN_add_word(c, -u)) goto err;
}
else
{
/* u > 0 */
if (!BN_sub_word(c, u)) goto err;
}
window_val -= digit;
/* now window_val is 0 or 2^(w+1) in standard wNAF generation;
* for modified window NAFs, it may also be 2^w
*/
if (window_val != 0 && window_val != next_bit && window_val != bit)
if (u <= -bit || u >= bit || !(u & 1) || c->neg)
{
ECerr(EC_F_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
goto err;
}
}
r[j++] = sign * digit;
window_val >>= 1;
window_val += bit * BN_is_bit_set(scalar, j + w);
if (window_val > next_bit)
r[j++] = sign * u;
if (BN_is_odd(c))
{
ECerr(EC_F_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
goto err;
}
if (!BN_rshift1(c, c)) goto err;
}
if (j > len + 1)
if (j > len)
{
ECerr(EC_F_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
goto err;
@ -180,6 +158,7 @@ static signed char *compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
ok = 1;
err:
BN_CTX_end(ctx);
if (!ok)
{
OPENSSL_free(r);
@ -335,7 +314,7 @@ int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
}
wNAF[i + 1] = NULL; /* make sure we always have a pivot */
wNAF[i] = compute_wNAF((i < num ? scalars[i] : scalar), wsize[i], &wNAF_len[i]);
wNAF[i] = compute_wNAF((i < num ? scalars[i] : scalar), wsize[i], &wNAF_len[i], ctx);
if (wNAF[i] == NULL) goto err;
if (wNAF_len[i] > max_len)
max_len = wNAF_len[i];

View File

@ -1,195 +0,0 @@
/* crypto/ec/ec_print.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <openssl/crypto.h>
#include "ec_lcl.h"
BIGNUM *EC_POINT_point2bn(const EC_GROUP *group,
const EC_POINT *point,
point_conversion_form_t form,
BIGNUM *ret,
BN_CTX *ctx)
{
size_t buf_len=0;
unsigned char *buf;
buf_len = EC_POINT_point2oct(group, point, form,
NULL, 0, ctx);
if (buf_len == 0)
return NULL;
if ((buf = OPENSSL_malloc(buf_len)) == NULL)
return NULL;
if (!EC_POINT_point2oct(group, point, form, buf, buf_len, ctx))
{
OPENSSL_free(buf);
return NULL;
}
ret = BN_bin2bn(buf, buf_len, ret);
OPENSSL_free(buf);
return ret;
}
EC_POINT *EC_POINT_bn2point(const EC_GROUP *group,
const BIGNUM *bn,
EC_POINT *point,
BN_CTX *ctx)
{
size_t buf_len=0;
unsigned char *buf;
EC_POINT *ret;
if ((buf_len = BN_num_bytes(bn)) == 0) return NULL;
buf = OPENSSL_malloc(buf_len);
if (buf == NULL)
return NULL;
if (!BN_bn2bin(bn, buf))
{
OPENSSL_free(buf);
return NULL;
}
if (point == NULL)
{
if ((ret = EC_POINT_new(group)) == NULL)
{
OPENSSL_free(buf);
return NULL;
}
}
else
ret = point;
if (!EC_POINT_oct2point(group, ret, buf, buf_len, ctx))
{
if (point == NULL)
EC_POINT_clear_free(ret);
OPENSSL_free(buf);
return NULL;
}
OPENSSL_free(buf);
return ret;
}
static const char *HEX_DIGITS = "0123456789ABCDEF";
/* the return value must be freed (using OPENSSL_free()) */
char *EC_POINT_point2hex(const EC_GROUP *group,
const EC_POINT *point,
point_conversion_form_t form,
BN_CTX *ctx)
{
char *ret, *p;
size_t buf_len=0,i;
unsigned char *buf, *pbuf;
buf_len = EC_POINT_point2oct(group, point, form,
NULL, 0, ctx);
if (buf_len == 0)
return NULL;
if ((buf = OPENSSL_malloc(buf_len)) == NULL)
return NULL;
if (!EC_POINT_point2oct(group, point, form, buf, buf_len, ctx))
{
OPENSSL_free(buf);
return NULL;
}
ret = (char *)OPENSSL_malloc(buf_len*2+2);
if (ret == NULL)
{
OPENSSL_free(buf);
return NULL;
}
p = ret;
pbuf = buf;
for (i=buf_len; i > 0; i--)
{
int v = (int) *(pbuf++);
*(p++)=HEX_DIGITS[v>>4];
*(p++)=HEX_DIGITS[v&0x0F];
}
*p='\0';
OPENSSL_free(buf);
return ret;
}
EC_POINT *EC_POINT_hex2point(const EC_GROUP *group,
const char *buf,
EC_POINT *point,
BN_CTX *ctx)
{
EC_POINT *ret=NULL;
BIGNUM *tmp_bn=NULL;
if (!BN_hex2bn(&tmp_bn, buf))
return NULL;
ret = EC_POINT_bn2point(group, tmp_bn, point, ctx);
BN_clear_free(tmp_bn);
return ret;
}

View File

@ -61,14 +61,16 @@
const EC_METHOD *EC_GFp_mont_method(void)
{
static const EC_METHOD ret = {
NID_X9_62_prime_field,
ec_GFp_mont_group_init,
ec_GFp_mont_group_finish,
ec_GFp_mont_group_clear_finish,
ec_GFp_mont_group_copy,
ec_GFp_mont_group_set_curve_GFp,
ec_GFp_simple_group_get_curve_GFp,
ec_GFp_simple_group_check_discriminant,
ec_GFp_simple_group_set_generator,
ec_GFp_simple_group_get0_generator,
ec_GFp_simple_group_get_order,
ec_GFp_simple_group_get_cofactor,
ec_GFp_simple_point_init,
ec_GFp_simple_point_finish,
ec_GFp_simple_point_clear_finish,

View File

@ -69,7 +69,6 @@ const EC_METHOD *EC_GFp_nist_method(void)
ec_GFp_simple_group_get0_generator,
ec_GFp_simple_group_get_order,
ec_GFp_simple_group_get_cofactor,
ec_GFp_simple_group_check_discriminant,
ec_GFp_simple_point_init,
ec_GFp_simple_point_finish,
ec_GFp_simple_point_clear_finish,

View File

@ -69,7 +69,6 @@ const EC_METHOD *EC_GFp_recp_method(void)
ec_GFp_simple_group_get0_generator,
ec_GFp_simple_group_get_order,
ec_GFp_simple_group_get_cofactor,
ec_GFp_simple_group_check_discriminant,
ec_GFp_simple_point_init,
ec_GFp_simple_point_finish,
ec_GFp_simple_point_clear_finish,

View File

@ -2,7 +2,7 @@
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project. */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -56,21 +56,23 @@
*/
#include <openssl/err.h>
#include <openssl/symhacks.h>
#include "ec_lcl.h"
const EC_METHOD *EC_GFp_simple_method(void)
{
static const EC_METHOD ret = {
NID_X9_62_prime_field,
ec_GFp_simple_group_init,
ec_GFp_simple_group_finish,
ec_GFp_simple_group_clear_finish,
ec_GFp_simple_group_copy,
ec_GFp_simple_group_set_curve_GFp,
ec_GFp_simple_group_get_curve_GFp,
ec_GFp_simple_group_check_discriminant,
ec_GFp_simple_group_set_generator,
ec_GFp_simple_group_get0_generator,
ec_GFp_simple_group_get_order,
ec_GFp_simple_group_get_cofactor,
ec_GFp_simple_point_init,
ec_GFp_simple_point_finish,
ec_GFp_simple_point_clear_finish,
@ -107,6 +109,9 @@ int ec_GFp_simple_group_init(EC_GROUP *group)
BN_init(&group->a);
BN_init(&group->b);
group->a_is_minus3 = 0;
group->generator = NULL;
BN_init(&group->order);
BN_init(&group->cofactor);
return 1;
}
@ -116,6 +121,10 @@ void ec_GFp_simple_group_finish(EC_GROUP *group)
BN_free(&group->field);
BN_free(&group->a);
BN_free(&group->b);
if (group->generator != NULL)
EC_POINT_free(group->generator);
BN_free(&group->order);
BN_free(&group->cofactor);
}
@ -124,6 +133,13 @@ void ec_GFp_simple_group_clear_finish(EC_GROUP *group)
BN_clear_free(&group->field);
BN_clear_free(&group->a);
BN_clear_free(&group->b);
if (group->generator != NULL)
{
EC_POINT_clear_free(group->generator);
group->generator = NULL;
}
BN_clear_free(&group->order);
BN_clear_free(&group->cofactor);
}
@ -135,6 +151,28 @@ int ec_GFp_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
dest->a_is_minus3 = src->a_is_minus3;
if (src->generator != NULL)
{
if (dest->generator == NULL)
{
dest->generator = EC_POINT_new(dest);
if (dest->generator == NULL) return 0;
}
if (!EC_POINT_copy(dest->generator, src->generator)) return 0;
}
else
{
/* src->generator == NULL */
if (dest->generator != NULL)
{
EC_POINT_clear_free(dest->generator);
dest->generator = NULL;
}
}
if (!BN_copy(&dest->order, &src->order)) return 0;
if (!BN_copy(&dest->cofactor, &src->cofactor)) return 0;
return 1;
}
@ -245,69 +283,58 @@ int ec_GFp_simple_group_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *
}
int ec_GFp_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
int ec_GFp_simple_group_set_generator(EC_GROUP *group, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor)
{
int ret = 0;
BIGNUM *a,*b,*order,*tmp_1,*tmp_2;
const BIGNUM *p = &group->field;
BN_CTX *new_ctx = NULL;
if (ctx == NULL)
if (generator == NULL)
{
ctx = new_ctx = BN_CTX_new();
if (ctx == NULL)
{
ECerr(EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT, ERR_R_MALLOC_FAILURE);
goto err;
}
ECerr(EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR, ERR_R_PASSED_NULL_PARAMETER);
return 0 ;
}
BN_CTX_start(ctx);
a = BN_CTX_get(ctx);
b = BN_CTX_get(ctx);
tmp_1 = BN_CTX_get(ctx);
tmp_2 = BN_CTX_get(ctx);
order = BN_CTX_get(ctx);
if (order == NULL) goto err;
if (group->meth->field_decode)
if (group->generator == NULL)
{
if (!group->meth->field_decode(group, a, &group->a, ctx)) goto err;
if (!group->meth->field_decode(group, b, &group->b, ctx)) goto err;
group->generator = EC_POINT_new(group);
if (group->generator == NULL) return 0;
}
if (!EC_POINT_copy(group->generator, generator)) return 0;
if (order != NULL)
{ if (!BN_copy(&group->order, order)) return 0; }
else
{
if (!BN_copy(a, &group->a)) goto err;
if (!BN_copy(b, &group->b)) goto err;
}
/* check the discriminant:
* y^2 = x^3 + a*x + b is an elliptic curve <=> 4*a^3 + 27*b^2 != 0 (mod p)
* 0 =< a, b < p */
if (BN_is_zero(a))
{
if (BN_is_zero(b)) goto err;
}
else if (!BN_is_zero(b))
{
if (!BN_mod_sqr(tmp_1, a, p, ctx)) goto err;
if (!BN_mod_mul(tmp_2, tmp_1, a, p, ctx)) goto err;
if (!BN_lshift(tmp_1, tmp_2, 2)) goto err;
/* tmp_1 = 4*a^3 */
{ if (!BN_zero(&group->order)) return 0; }
if (!BN_mod_sqr(tmp_2, b, p, ctx)) goto err;
if (!BN_mul_word(tmp_2, 27)) goto err;
/* tmp_2 = 27*b^2 */
if (cofactor != NULL)
{ if (!BN_copy(&group->cofactor, cofactor)) return 0; }
else
{ if (!BN_zero(&group->cofactor)) return 0; }
if (!BN_mod_add(a, tmp_1, tmp_2, p, ctx)) goto err;
if (BN_is_zero(a)) goto err;
}
ret = 1;
return 1;
}
err:
BN_CTX_end(ctx);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
return ret;
EC_POINT *ec_GFp_simple_group_get0_generator(const EC_GROUP *group)
{
return group->generator;
}
int ec_GFp_simple_group_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
{
if (!BN_copy(order, &group->order))
return 0;
return !BN_is_zero(&group->order);
}
int ec_GFp_simple_group_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
{
if (!BN_copy(cofactor, &group->cofactor))
return 0;
return !BN_is_zero(&group->cofactor);
}

View File

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

View File

@ -1,161 +0,0 @@
#
# crypto/ecdsa/Makefile
#
DIR= ecdsa
TOP= ../..
CC= cc
INCLUDES= -I.. -I$(TOP) -I../../include
CFLAG=-g -Wall
INSTALL_PREFIX=
OPENSSLDIR= /usr/local/ssl
INSTALLTOP=/usr/local/ssl
MAKE= make -f Makefile.ssl
MAKEDEPPROG= makedepend
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
MAKEFILE= Makefile.ssl
AR= ar r
CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile
TEST=ecdsatest.c
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= ecs_lib.c ecs_gen.c ecs_asn1.c ecs_ossl.c ecs_sign.c ecs_vrf.c \
ecs_key.c ecs_err.c
LIBOBJ= ecs_lib.o ecs_gen.o ecs_asn1.o ecs_ossl.o ecs_sign.o ecs_vrf.o \
ecs_key.o ecs_err.o
SRC= $(LIBSRC)
EXHEADER= ecdsa.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) || echo Never mind.
@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.
ecs_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
ecs_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ecs_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ecs_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_asn1.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ecs_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ecs_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_asn1.o: ../../include/openssl/symhacks.h ../cryptlib.h ecdsa.h ecs_asn1.c
ecs_err.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
ecs_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ecs_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_err.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ecs_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ecs_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ecs_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_err.o: ecs_err.c
ecs_gen.o: ecs_gen.c
ecs_key.o: ../../e_os.h ../../include/openssl/asn1.h
ecs_key.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ecs_key.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ecs_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_key.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ecs_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ecs_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ecs_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_key.o: ../cryptlib.h ecs_key.c
ecs_lib.o: ../../e_os.h ../../include/openssl/asn1.h
ecs_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ecs_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ecs_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
ecs_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
ecs_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ecs_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ecs_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_lib.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
ecs_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
ecs_lib.o: ../cryptlib.h ecdsa.h ecs_lib.c
ecs_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
ecs_ossl.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ecs_ossl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ecs_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_ossl.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_ossl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ecs_ossl.o: ../../include/openssl/opensslconf.h
ecs_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_ossl.o: ../../include/openssl/symhacks.h ../cryptlib.h ecs_ossl.c
ecs_sign.o: ../../e_os.h ../../include/openssl/asn1.h
ecs_sign.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ecs_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ecs_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
ecs_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
ecs_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ecs_sign.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ecs_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_sign.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
ecs_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
ecs_sign.o: ../cryptlib.h ecs_sign.c
ecs_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
ecs_vrf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ecs_vrf.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
ecs_vrf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
ecs_vrf.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ecs_vrf.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ecs_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_vrf.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
ecs_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_vrf.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
ecs_vrf.o: ecs_vrf.c

View File

@ -1,272 +0,0 @@
/* crypto/ecdsa/ecdsa.h */
/* ====================================================================
* Copyright (c) 2000-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
* 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_ECDSA_H
#define HEADER_ECDSA_H
#ifdef OPENSSL_NO_ECDSA
#error ECDSA is disabled.
#endif
#ifndef OPENSSL_NO_BIO
#include <openssl/bio.h>
#endif
#include <openssl/bn.h>
#include <openssl/ec.h>
#include <openssl/crypto.h>
#include <openssl/ossl_typ.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ecdsa_st ECDSA;
typedef struct ECDSA_SIG_st
{
BIGNUM *r;
BIGNUM *s;
} ECDSA_SIG;
typedef struct ecdsa_method
{
const char *name;
ECDSA_SIG *(*ecdsa_do_sign)(const unsigned char *dgst, int dgst_len, ECDSA *ecdsa);
int (*ecdsa_sign_setup)(ECDSA *ecdsa, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **r);
int (*ecdsa_do_verify)(const unsigned char *dgst, int dgst_len, ECDSA_SIG *sig, ECDSA *ecdsa);
int (*init)(ECDSA *ecdsa);
int (*finish)(ECDSA *ecdsa);
int flags;
char *app_data;
} ECDSA_METHOD;
struct ecdsa_st
{
int version;
point_conversion_form_t conversion_form;
EC_GROUP *group;
EC_POINT *pub_key;
BIGNUM *priv_key;
BIGNUM *kinv; /* signing pre-calc */
BIGNUM *r; /* signing pre-calc */
int references;
int flags;
CRYPTO_EX_DATA ex_data;
const ECDSA_METHOD *meth;
struct engine_st *engine;
};
ECDSA_SIG *ECDSA_SIG_new(void);
void ECDSA_SIG_free(ECDSA_SIG *a);
int i2d_ECDSA_SIG(const ECDSA_SIG *a, unsigned char **pp);
ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **v, const unsigned char **pp, long length);
ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len, ECDSA *ecdsa);
int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, ECDSA_SIG *sig, ECDSA* ecdsa);
int ECDSA_generate_key(ECDSA *ecdsa);
int ECDSA_check_key(ECDSA *ecdsa);
const ECDSA_METHOD *ECDSA_OpenSSL(void);
void ECDSA_set_default_method(const ECDSA_METHOD *);
const ECDSA_METHOD *ECDSA_get_default_method(void);
int ECDSA_set_method(ECDSA *, const ECDSA_METHOD *);
ECDSA *ECDSA_new(void);
ECDSA *ECDSA_new_method(ENGINE *engine);
int ECDSA_size(const ECDSA *);
int ECDSA_sign_setup(ECDSA *ecdsa, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp);
int ECDSA_sign(int type, const unsigned char *dgst, int dgst_len, unsigned char *sig,
unsigned int *siglen, ECDSA *ecdsa);
int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sig,
int sig_len, ECDSA *ecdsa);
int ECDSA_up_ref(ECDSA *ecdsa);
void ECDSA_free(ECDSA *a);
int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int ECDSA_set_ex_data(ECDSA *d, int idx, void *arg);
void *ECDSA_get_ex_data(ECDSA *d, int idx);
#ifndef OPENSSL_NO_BIO
int ECDSAParameters_print(BIO *bp, const ECDSA *x);
int ECDSA_print(BIO *bp, const ECDSA *x, int off);
#endif
#ifndef OPENSSL_NO_FP_API
int ECDSAParameters_print_fp(FILE *fp, const ECDSA *x);
int ECDSA_print_fp(FILE *fp, const ECDSA *x, int off);
#endif
/* The ECDSA_{set|get}_conversion_type() functions set/get the
* conversion form for ec-points (see ec.h) in a ECDSA-structure */
void ECDSA_set_conversion_form(ECDSA *, const point_conversion_form_t);
point_conversion_form_t ECDSA_get_conversion_form(const ECDSA *);
/* The ECDSA_{set|get}_default_conversion_form() functions set/get the
* default conversion form */
void ECDSA_set_default_conversion_form(const point_conversion_form_t);
point_conversion_form_t ECDSA_get_default_conversion_form(void);
/* the basic de- and encode functions ( see ecs_asn1.c ) */
ECDSA *d2i_ECDSAParameters(ECDSA **a, const unsigned char **in, long len);
int i2d_ECDSAParameters(ECDSA *a, unsigned char **out);
ECDSA *d2i_ECDSAPrivateKey(ECDSA **a, const unsigned char **in, long len);
int i2d_ECDSAPrivateKey(ECDSA *a, unsigned char **out);
/* ECDSAPublicKey_set_octet_string() sets the public key in the ECDSA-structure.
* (*a) must be a pointer to a ECDSA-structure with (*a)->group not zero
* (e.g. a ECDSA-structure with a valid EC_GROUP-structure) */
ECDSA *ECDSAPublicKey_set_octet_string(ECDSA **a, const unsigned char **in, long len);
/* ECDSAPublicKey_get_octet_string() returns the length of the octet string encoding
* of the public key. If out != NULL then the function returns in *out
* a pointer to the octet string */
int ECDSAPublicKey_get_octet_string(ECDSA *a, unsigned char **out);
#define ECDSAParameters_dup(x) (ECDSA *)ASN1_dup((int (*)())i2d_ECDSAParameters, \
(char *(*)())d2i_ECDSAParameters,(char *)(x))
#define d2i_ECDSAParameters_fp(fp,x) (ECDSA *)ASN1_d2i_fp((char *(*)())ECDSA_new, \
(char *(*)())d2i_ECDSAParameters,(fp),(unsigned char **)(x))
#define i2d_ECDSAParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECDSAParameters,(fp), \
(unsigned char *)(x))
#define d2i_ECDSAParameters_bio(bp,x) (ECDSA *)ASN1_d2i_bio((char *(*)())ECDSA_new, \
(char *(*)())d2i_ECDSAParameters,(bp),(unsigned char **)(x))
#define i2d_ECDSAParameters_bio(bp,x) ASN1_i2d_bio(i2d_ECDSAParameters,(bp), \
(unsigned char *)(x))
/* 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_ECDSA_strings(void);
/* Error codes for the ECDSA functions. */
/* Function codes. */
#define ECDSA_F_D2I_ECDSAPARAMETERS 100
#define ECDSA_F_D2I_ECDSAPRIVATEKEY 101
#define ECDSA_F_ECDSAPARAMETERS_PRINT 102
#define ECDSA_F_ECDSAPARAMETERS_PRINT_FP 103
#define ECDSA_F_ECDSA_DO_SIGN 104
#define ECDSA_F_ECDSA_DO_VERIFY 105
#define ECDSA_F_ECDSA_GENERATE_KEY 106
#define ECDSA_F_ECDSA_GET 107
#define ECDSA_F_ECDSA_GET_CURVE_NID 120
#define ECDSA_F_ECDSA_GET_ECDSA 121
#define ECDSA_F_ECDSA_GET_EC_PARAMETERS 122
#define ECDSA_F_ECDSA_GET_X9_62_CURVE 108
#define ECDSA_F_ECDSA_GET_X9_62_EC_PARAMETERS 109
#define ECDSA_F_ECDSA_GET_X9_62_FIELDID 110
#define ECDSA_F_ECDSA_NEW 111
#define ECDSA_F_ECDSA_PRINT 112
#define ECDSA_F_ECDSA_PRINT_FP 113
#define ECDSA_F_ECDSA_SET_GROUP_P 114
#define ECDSA_F_ECDSA_SET_PRIME_GROUP 123
#define ECDSA_F_ECDSA_SIGN_SETUP 115
#define ECDSA_F_I2D_ECDSAPARAMETERS 116
#define ECDSA_F_I2D_ECDSAPRIVATEKEY 117
#define ECDSA_F_I2D_ECDSAPUBLICKEY 118
#define ECDSA_F_SIG_CB 119
/* Reason codes. */
#define ECDSA_R_BAD_SIGNATURE 100
#define ECDSA_R_CAN_NOT_GET_GENERATOR 101
#define ECDSA_R_D2I_ECDSAPRIVATEKEY_MISSING_PRIVATE_KEY 102
#define ECDSA_R_D2I_ECDSA_PRIVATEKEY_FAILURE 103
#define ECDSA_R_D2I_EC_PARAMETERS_FAILURE 133
#define ECDSA_R_D2I_X9_62_EC_PARAMETERS_FAILURE 104
#define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 105
#define ECDSA_R_ECDSAPRIVATEKEY_NEW_FAILURE 106
#define ECDSA_R_ECDSA_F_ECDSA_NEW 107
#define ECDSA_R_ECDSA_GET_EC_PARAMETERS_FAILURE 134
#define ECDSA_R_ECDSA_GET_FAILURE 108
#define ECDSA_R_ECDSA_GET_X9_62_CURVE_FAILURE 109
#define ECDSA_R_ECDSA_GET_X9_62_EC_PARAMETERS_FAILURE 110
#define ECDSA_R_ECDSA_GET_X9_62_FIELDID_FAILURE 111
#define ECDSA_R_ECDSA_NEW_FAILURE 112
#define ECDSA_R_ECDSA_R_D2I_EC_PARAMETERS_FAILURE 135
#define ECDSA_R_ECDSA_R_D2I_X9_62_EC_PARAMETERS_FAILURE 113
#define ECDSA_R_ECPARAMETERS2ECDSA_FAILURE 138
#define ECDSA_R_EC_GROUP_NID2CURVE_FAILURE 136
#define ECDSA_R_ERR_EC_LIB 114
#define ECDSA_R_I2D_ECDSA_PRIVATEKEY 115
#define ECDSA_R_I2D_ECDSA_PUBLICKEY 116
#define ECDSA_R_MISSING_PARAMETERS 117
#define ECDSA_R_MISSING_PRIVATE_KEY 139
#define ECDSA_R_NOT_SUPPORTED 118
#define ECDSA_R_NO_CURVE_PARAMETER_A_SPECIFIED 119
#define ECDSA_R_NO_CURVE_PARAMETER_B_SPECIFIED 120
#define ECDSA_R_NO_CURVE_SPECIFIED 121
#define ECDSA_R_NO_FIELD_SPECIFIED 122
#define ECDSA_R_PRIME_MISSING 123
#define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 124
#define ECDSA_R_SIGNATURE_MALLOC_FAILED 125
#define ECDSA_R_UNEXPECTED_ASN1_TYPE 126
#define ECDSA_R_UNEXPECTED_PARAMETER 127
#define ECDSA_R_UNEXPECTED_PARAMETER_LENGTH 128
#define ECDSA_R_UNEXPECTED_VERSION_NUMER 129
#define ECDSA_R_UNKNOWN_PARAMETERS_TYPE 137
#define ECDSA_R_WRONG_FIELD_IDENTIFIER 130
#define ECDSA_R_X9_62_CURVE_NEW_FAILURE 131
#define ECDSA_R_X9_62_EC_PARAMETERS_NEW_FAILURE 132
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,684 +0,0 @@
/* crypto/ecdsa/ecdsatest.c */
/* ====================================================================
* Copyright (c) 2000-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
* 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 <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef CLOCKS_PER_SEC
/* "To determine the time in seconds, the value returned
* by the clock function should be divided by the value
* of the macro CLOCKS_PER_SEC."
* -- ISO/IEC 9899 */
# define UNIT "s"
#else
/* "`CLOCKS_PER_SEC' undeclared (first use this function)"
* -- cc on NeXTstep/OpenStep */
# define UNIT "units"
# define CLOCKS_PER_SEC 1
#endif
#ifdef OPENSSL_NO_ECDSA
int main(int argc, char * argv[]) { puts("Elliptic curves are disabled."); return 0; }
#else
#include <openssl/crypto.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/ecdsa.h>
#include <openssl/engine.h>
#include <openssl/err.h>
static BIO *bio_err=NULL;
static const char rnd_seed[] = "string to make the random number generator think it has entropy";
#define ECDSA_NIST_TESTS 10
ECDSA_SIG* signatures[ECDSA_NIST_TESTS];
unsigned char digest[ECDSA_NIST_TESTS][20];
void clear_ecdsa(ECDSA *ecdsa)
{
if (!ecdsa)
return;
if (ecdsa->group)
{
EC_GROUP_free(ecdsa->group);
ecdsa->group = NULL;
}
if (ecdsa->pub_key)
{
EC_POINT_free(ecdsa->pub_key);
ecdsa->pub_key = NULL;
}
if (ecdsa->priv_key)
{
BN_free(ecdsa->priv_key);
ecdsa->priv_key = NULL;
}
}
int set_p192_param(ECDSA *ecdsa)
{
BN_CTX *ctx=NULL;
int ret=0;
if (!ecdsa)
return 0;
if ((ctx = BN_CTX_new()) == NULL) goto err;
clear_ecdsa(ecdsa);
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_X9_62_PRIME_192V1)) == NULL)
{
BIO_printf(bio_err,"ECDSA_SET_GROUP_P_192_V1() failed \n");
goto err;
}
if ((ecdsa->pub_key = EC_POINT_new(ecdsa->group)) == NULL)
{
BIO_printf(bio_err,"EC_POINT_new failed \n");
goto err;
}
if (!BN_dec2bn(&(ecdsa->priv_key), "651056770906015076056810763456358567190100156695615665659")) goto err;
if (!EC_POINT_mul(ecdsa->group,ecdsa->pub_key,ecdsa->priv_key,NULL,NULL,ctx))
{
BIO_printf(bio_err,"EC_POINT_mul() failed \n");
goto err;
}
ret = 1;
err : if (ctx) BN_CTX_free(ctx);
return ret;
}
int set_p239_param(ECDSA *ecdsa)
{
BN_CTX *ctx=NULL;
int ret=0;
if (!ecdsa)
return 0;
if ((ctx = BN_CTX_new()) == NULL) goto err;
clear_ecdsa(ecdsa);
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_X9_62_PRIME_239V1)) == NULL)
{
BIO_printf(bio_err,"ECDSA_SET_GROUP_P_239_V1() failed \n");
goto err;
}
if ((ecdsa->pub_key = EC_POINT_new(ecdsa->group)) == NULL)
{
BIO_printf(bio_err,"EC_POINT_new failed \n");
goto err;
}
if (!BN_dec2bn(&(ecdsa->priv_key), "876300101507107567501066130761671078357010671067781776716671676178726717")) goto err;
if (!EC_POINT_mul(ecdsa->group,ecdsa->pub_key,ecdsa->priv_key,NULL,NULL,ctx))
{
BIO_printf(bio_err,"EC_POINT_mul() failed \n");
goto err;
}
ret = 1;
err : if (ctx) BN_CTX_free(ctx);
return ret;
}
int test_sig_vrf(ECDSA *ecdsa, const unsigned char* dgst)
{
int ret=0,type=0;
unsigned char *buffer=NULL;
unsigned int buf_len;
clock_t tim;
if (!ecdsa || !ecdsa->group || !ecdsa->pub_key || !ecdsa->priv_key)
return 0;
if ((buf_len = ECDSA_size(ecdsa)) == 0)
{
BIO_printf(bio_err, "ECDSA_size() == 0 \n");
goto err;
}
if ((buffer = OPENSSL_malloc(buf_len)) == NULL)
goto err;
tim = clock();
if (!ECDSA_sign(type, dgst , 20, buffer, &buf_len, ecdsa))
{
BIO_printf(bio_err, "ECDSA_sign() FAILED \n");
goto err;
}
tim = clock() - tim;
BIO_printf(bio_err, " [ ECDSA_sign() %.2f"UNIT, (double)tim/(CLOCKS_PER_SEC));
tim = clock();
ret = ECDSA_verify(type, dgst, 20, buffer, buf_len, ecdsa);
if (ret != 1)
{
BIO_printf(bio_err, "ECDSA_verify() FAILED \n");
goto err;
}
tim = clock() - tim;
BIO_printf(bio_err, " and ECDSA_verify() %.2f"UNIT" ] ", (double)tim/(CLOCKS_PER_SEC));
err: OPENSSL_free(buffer);
return(ret == 1);
}
int test_x962_sig_vrf(ECDSA *ecdsa, const unsigned char *dgst,
const char *k_in, const char *r_in, const char *s_in)
{
int ret=0;
ECDSA_SIG *sig=NULL;
EC_POINT *point=NULL;
BIGNUM *r=NULL,*s=NULL,*k=NULL,*x=NULL,*y=NULL,*m=NULL,*ord=NULL;
BN_CTX *ctx=NULL;
char *tmp_char=NULL;
if (!ecdsa || !ecdsa->group || !ecdsa->pub_key || !ecdsa->priv_key)
return 0;
if ((point = EC_POINT_new(ecdsa->group)) == NULL) goto err;
if ((r = BN_new()) == NULL || (s = BN_new()) == NULL || (k = BN_new()) == NULL ||
(x = BN_new()) == NULL || (y = BN_new()) == NULL || (m = BN_new()) == NULL ||
(ord = BN_new()) == NULL) goto err;
if ((ctx = BN_CTX_new()) == NULL) goto err;
if (!BN_bin2bn(dgst, 20, m)) goto err;
if (!BN_dec2bn(&k, k_in)) goto err;
if (!EC_POINT_mul(ecdsa->group, point, k, NULL, NULL, ctx)) goto err;
if (!EC_POINT_get_affine_coordinates_GFp(ecdsa->group, point, x, y, ctx)) goto err;
if (!EC_GROUP_get_order(ecdsa->group, ord, ctx)) goto err;
if ((ecdsa->r = BN_dup(x)) == NULL) goto err;
if ((ecdsa->kinv = BN_mod_inverse(NULL, k, ord, ctx)) == NULL) goto err;
if ((sig = ECDSA_do_sign(dgst, 20, ecdsa)) == NULL)
{
BIO_printf(bio_err,"ECDSA_do_sign() failed \n");
goto err;
}
if (!BN_dec2bn(&r, r_in)) goto err;
if (!BN_dec2bn(&s, s_in)) goto err;
if (BN_cmp(sig->r,r) != 0 || BN_cmp(sig->s,s) != 0)
{
tmp_char = OPENSSL_malloc(128);
if (tmp_char == NULL) goto err;
tmp_char = BN_bn2dec(sig->r);
BIO_printf(bio_err,"unexpected signature \n");
BIO_printf(bio_err,"sig->r = %s\n",tmp_char);
tmp_char = BN_bn2dec(sig->s);
BIO_printf(bio_err,"sig->s = %s\n",tmp_char);
goto err;
}
ret = ECDSA_do_verify(dgst, 20, sig, ecdsa);
if (ret != 1)
{
BIO_printf(bio_err,"ECDSA_do_verify : signature verification failed \n");
goto err;
}
ret = 1;
err : if (r) BN_free(r);
if (s) BN_free(s);
if (k) BN_free(k);
if (x) BN_free(x);
if (y) BN_free(y);
if (m) BN_free(m);
if (ord) BN_free(ord);
if (sig) ECDSA_SIG_free(sig);
if (ctx) BN_CTX_free(ctx);
if (point) EC_POINT_free(point);
if (tmp_char) OPENSSL_free(tmp_char);
return(ret == 1);
}
int ecdsa_cmp(const ECDSA *a, const ECDSA *b)
{
int ret=1;
BN_CTX *ctx=NULL;
BIGNUM *tmp_a1=NULL, *tmp_a2=NULL, *tmp_a3=NULL;
BIGNUM *tmp_b1=NULL, *tmp_b2=NULL, *tmp_b3=NULL;
if ((ctx = BN_CTX_new()) == NULL) return 1;
if ((tmp_a1 = BN_new()) == NULL || (tmp_a2 = BN_new()) == NULL || (tmp_a3 = BN_new()) == NULL) goto err;
if ((tmp_b1 = BN_new()) == NULL || (tmp_b2 = BN_new()) == NULL || (tmp_b3 = BN_new()) == NULL) goto err;
if (a->pub_key && b->pub_key)
if (EC_POINT_cmp(a->group, a->pub_key, b->pub_key, ctx) != 0) goto err;
if (a->priv_key && b->priv_key)
if (BN_cmp(a->priv_key, b->priv_key) != 0) goto err;
if (!EC_GROUP_get_curve_GFp(a->group, tmp_a1, tmp_a2, tmp_a3, ctx)) goto err;
if (!EC_GROUP_get_curve_GFp(a->group, tmp_b1, tmp_b2, tmp_b3, ctx)) goto err;
if (BN_cmp(tmp_a1, tmp_b1) != 0) goto err;
if (BN_cmp(tmp_a2, tmp_b2) != 0) goto err;
if (BN_cmp(tmp_a3, tmp_b3) != 0) goto err;
ret = 0;
err: if (tmp_a1) BN_free(tmp_a1);
if (tmp_a2) BN_free(tmp_a2);
if (tmp_a3) BN_free(tmp_a3);
if (tmp_b1) BN_free(tmp_b1);
if (tmp_b2) BN_free(tmp_b2);
if (tmp_b3) BN_free(tmp_b3);
if (ctx) BN_CTX_free(ctx);
return(ret);
}
int main(void)
{
ECDSA *ecdsa=NULL, *ret_ecdsa=NULL;
BIGNUM *d=NULL;
X509_PUBKEY *x509_pubkey=NULL;
PKCS8_PRIV_KEY_INFO *pkcs8=NULL;
EVP_PKEY *pkey=NULL, *ret_pkey=NULL;
int dgst_len=0;
unsigned char *dgst=NULL;
int ret = 0, i=0;
clock_t tim;
unsigned char *buffer=NULL;
unsigned char *pp;
long buf_len=0;
double tim_d;
EVP_MD_CTX *md_ctx=NULL;
/* enable memory leak checking unless explicitly disabled */
if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off"))))
{
CRYPTO_malloc_debug_init();
CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
}
else
{
/* OPENSSL_DEBUG_MEMORY=off */
CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);
}
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
ERR_load_crypto_strings();
if (bio_err == NULL)
bio_err=BIO_new_fp(stderr, BIO_NOCLOSE);
RAND_seed(rnd_seed, sizeof(rnd_seed));
if ((ecdsa = ECDSA_new()) == NULL) goto err;
set_p192_param(ecdsa);
ECDSA_print(bio_err, ecdsa, 0);
/* en- decode tests */
/* i2d_ - d2i_ECDSAParameters() */
BIO_printf(bio_err, "\nTesting i2d_ - d2i_ECDSAParameters \n");
buf_len = i2d_ECDSAParameters(ecdsa, NULL);
if (!buf_len || (buffer = OPENSSL_malloc(buf_len)) == NULL) goto err;
pp = buffer;
if (!i2d_ECDSAParameters(ecdsa, &pp)) goto err;
pp = buffer;
if ((ret_ecdsa = d2i_ECDSAParameters(&ret_ecdsa, (const unsigned char **)&pp,
buf_len)) == NULL) goto err;
ECDSAParameters_print(bio_err, ret_ecdsa);
if (ecdsa_cmp(ecdsa, ret_ecdsa)) goto err;
OPENSSL_free(buffer);
buffer = NULL;
ECDSA_free(ret_ecdsa);
ret_ecdsa = NULL;
/* i2d_ - d2i_ECDSAPrivateKey() */
BIO_printf(bio_err, "\nTesting i2d_ - d2i_ECDSAPrivateKey \n");
buf_len = i2d_ECDSAPrivateKey(ecdsa, NULL);
if (!buf_len || (buffer = OPENSSL_malloc(buf_len)) == NULL) goto err;
pp = buffer;
if (!i2d_ECDSAPrivateKey(ecdsa, &pp)) goto err;
pp = buffer;
if ((ret_ecdsa = d2i_ECDSAPrivateKey(&ret_ecdsa, (const unsigned char**)&pp,
buf_len)) == NULL) goto err;
ECDSA_print(bio_err, ret_ecdsa, 0);
if (ecdsa_cmp(ecdsa, ret_ecdsa)) goto err;
ECDSA_free(ret_ecdsa);
ret_ecdsa = NULL;
OPENSSL_free(buffer);
buffer = NULL;
/* X509_PUBKEY_set() & X509_PUBKEY_get() */
BIO_printf(bio_err, "\nTesting X509_PUBKEY_{get,set} : ");
if ((pkey = EVP_PKEY_new()) == NULL) goto err;
EVP_PKEY_assign_ECDSA(pkey, ecdsa);
if ((x509_pubkey = X509_PUBKEY_new()) == NULL) goto err;
if (!X509_PUBKEY_set(&x509_pubkey, pkey)) goto err;
if ((ret_pkey = X509_PUBKEY_get(x509_pubkey)) == NULL) goto err;
ret_ecdsa = EVP_PKEY_get1_ECDSA(ret_pkey);
EVP_PKEY_free(ret_pkey);
ret_pkey = NULL;
if (ecdsa_cmp(ecdsa, ret_ecdsa))
{
BIO_printf(bio_err, "TEST FAILED \n");
goto err;
}
else BIO_printf(bio_err, "TEST OK \n");
X509_PUBKEY_free(x509_pubkey);
x509_pubkey = NULL;
ECDSA_free(ret_ecdsa);
ret_ecdsa = NULL;
/* Testing PKCS8_PRIV_KEY_INFO <-> EVP_PKEY */
BIO_printf(bio_err, "Testing PKCS8_PRIV_KEY_INFO <-> EVP_PKEY : \n");
BIO_printf(bio_err, "PKCS8_OK : ");
if ((pkcs8 = EVP_PKEY2PKCS8_broken(pkey, PKCS8_OK)) == NULL) goto err;
if ((ret_pkey = EVP_PKCS82PKEY(pkcs8)) == NULL) goto err;
ret_ecdsa = EVP_PKEY_get1_ECDSA(ret_pkey);
if (ecdsa_cmp(ecdsa, ret_ecdsa))
{
BIO_printf(bio_err, "TEST FAILED \n");
goto err;
}
else BIO_printf(bio_err, "TEST OK \n");
EVP_PKEY_free(ret_pkey);
ret_pkey = NULL;
ECDSA_free(ret_ecdsa);
ret_ecdsa = NULL;
PKCS8_PRIV_KEY_INFO_free(pkcs8);
BIO_printf(bio_err, "PKCS8_NO_OCTET : ");
if ((pkcs8 = EVP_PKEY2PKCS8_broken(pkey, PKCS8_NO_OCTET)) == NULL) goto err;
if ((ret_pkey = EVP_PKCS82PKEY(pkcs8)) == NULL) goto err;
ret_ecdsa = EVP_PKEY_get1_ECDSA(ret_pkey);
if (ecdsa_cmp(ecdsa, ret_ecdsa))
{
BIO_printf(bio_err, "TEST FAILED \n");
goto err;
}
else BIO_printf(bio_err, "TEST OK \n");
EVP_PKEY_free(ret_pkey);
ret_pkey = NULL;
ECDSA_free(ret_ecdsa);
ret_ecdsa = NULL;
PKCS8_PRIV_KEY_INFO_free(pkcs8);
BIO_printf(bio_err, "PKCS8_EMBEDDED_PARAM : ");
if ((pkcs8 = EVP_PKEY2PKCS8_broken(pkey, PKCS8_EMBEDDED_PARAM)) == NULL) goto err;
if ((ret_pkey = EVP_PKCS82PKEY(pkcs8)) == NULL) goto err;
ret_ecdsa = EVP_PKEY_get1_ECDSA(ret_pkey);
if (ecdsa_cmp(ecdsa, ret_ecdsa))
{
BIO_printf(bio_err, "TEST FAILED \n");
goto err;
}
else BIO_printf(bio_err, "TEST OK \n");
EVP_PKEY_free(ret_pkey);
ret_pkey = NULL;
ECDSA_free(ret_ecdsa);
ret_ecdsa = NULL;
PKCS8_PRIV_KEY_INFO_free(pkcs8);
BIO_printf(bio_err, "PKCS8_NS_DB : ");
if ((pkcs8 = EVP_PKEY2PKCS8_broken(pkey, PKCS8_NS_DB)) == NULL) goto err;
if ((ret_pkey = EVP_PKCS82PKEY(pkcs8)) == NULL) goto err;
ret_ecdsa = EVP_PKEY_get1_ECDSA(ret_pkey);
if (ecdsa_cmp(ecdsa, ret_ecdsa))
{
BIO_printf(bio_err, "TEST FAILED \n");
goto err;
}
else BIO_printf(bio_err, "TEST OK \n");
EVP_PKEY_free(ret_pkey);
ret_pkey = NULL;
ECDSA_free(ret_ecdsa);
ret_ecdsa = NULL;
EVP_PKEY_free(pkey);
pkey = NULL;
ecdsa = NULL;
PKCS8_PRIV_KEY_INFO_free(pkcs8);
pkcs8 = NULL;
/* sign and verify tests */
if ((d = BN_new()) == NULL) goto err;
if (!BN_dec2bn(&d, "968236873715988614170569073515315707566766479517")) goto err;
dgst_len = BN_num_bytes(d);
if ((dgst = OPENSSL_malloc(dgst_len)) == NULL) goto err;
if (!BN_bn2bin(d, dgst)) goto err;
BIO_printf(bio_err, "Performing tests based on examples H.3.1 and H.3.2 of X9.62 \n");
BIO_printf(bio_err, "PRIME_192_V1 : ");
if ((ecdsa = ECDSA_new()) == NULL) goto err;
if (!set_p192_param(ecdsa)) goto err;
if (!test_x962_sig_vrf(ecdsa, dgst, "6140507067065001063065065565667405560006161556565665656654",
"3342403536405981729393488334694600415596881826869351677613",
"5735822328888155254683894997897571951568553642892029982342"))
goto err;
else
BIO_printf(bio_err, "OK\n");
BIO_printf(bio_err, "PRIME_239_V1 : ");
if (!set_p239_param(ecdsa))
goto err;
if (!test_x962_sig_vrf(ecdsa, dgst, "700000017569056646655505781757157107570501575775705779575555657156756655",
"308636143175167811492622547300668018854959378758531778147462058306432176",
"323813553209797357708078776831250505931891051755007842781978505179448783"))
goto err;
else
BIO_printf(bio_err, "OK\n");
ECDSA_free(ecdsa);
ecdsa = NULL;
OPENSSL_free(dgst);
dgst = NULL;
/* NIST PRIME CURVES TESTS */
/* EC_GROUP_NIST_PRIME_192 */
for (i=0; i<ECDSA_NIST_TESTS; i++)
if (!RAND_bytes(digest[i], 20)) goto err;
BIO_printf(bio_err, "\nTesting sign & verify with NIST Prime-Curve P-192 : \n");
ECDSA_free(ecdsa);
if ((ecdsa = ECDSA_new()) == NULL) goto err;
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_NIST_PRIME_192)) == NULL) goto err;
if (!ECDSA_generate_key(ecdsa)) goto err;
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if ((signatures[i] = ECDSA_do_sign(digest[i], 20, ecdsa)) == NULL) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_sign() in %.2f"UNIT" => average time for ECDSA_do_sign() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d / ECDSA_NIST_TESTS);
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if (!ECDSA_do_verify(digest[i], 20, signatures[i], ecdsa)) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_verify() in %.2f"UNIT" => average time for ECDSA_do_verify() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d/ECDSA_NIST_TESTS);
for (i=0; i<ECDSA_NIST_TESTS; i++)
{
ECDSA_SIG_free(signatures[i]);
signatures[i] = NULL;
}
/* EC_GROUP_NIST_PRIME_224 */
BIO_printf(bio_err, "Testing sign & verify with NIST Prime-Curve P-224 : \n");
ECDSA_free(ecdsa);
if ((ecdsa = ECDSA_new()) == NULL) goto err;
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_NIST_PRIME_224)) == NULL) goto err;
if (!ECDSA_generate_key(ecdsa)) goto err;
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if ((signatures[i] = ECDSA_do_sign(digest[i], 20, ecdsa)) == NULL) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_sign() in %.2f"UNIT" => average time for ECDSA_do_sign() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d / ECDSA_NIST_TESTS);
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if (!ECDSA_do_verify(digest[i], 20, signatures[i], ecdsa)) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_verify() in %.2f"UNIT" => average time for ECDSA_do_verify() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d/ECDSA_NIST_TESTS);
for (i=0; i<ECDSA_NIST_TESTS; i++)
{
ECDSA_SIG_free(signatures[i]);
signatures[i] = NULL;
}
/* EC_GROUP_NIST_PRIME_256 */
BIO_printf(bio_err, "Testing sign & verify with NIST Prime-Curve P-256 : \n");
ECDSA_free(ecdsa);
if ((ecdsa = ECDSA_new()) == NULL) goto err;
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_NIST_PRIME_256)) == NULL) goto err;
if (!ECDSA_generate_key(ecdsa)) goto err;
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if ((signatures[i] = ECDSA_do_sign(digest[i], 20, ecdsa)) == NULL) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_sign() in %.2f"UNIT" => average time for ECDSA_do_sign() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d / ECDSA_NIST_TESTS);
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if (!ECDSA_do_verify(digest[i], 20, signatures[i], ecdsa)) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_verify() in %.2f"UNIT" => average time for ECDSA_do_verify() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d/ECDSA_NIST_TESTS);
for (i=0; i<ECDSA_NIST_TESTS; i++)
{
ECDSA_SIG_free(signatures[i]);
signatures[i] = NULL;
}
/* EC_GROUP_NIST_PRIME_384 */
BIO_printf(bio_err, "Testing sign & verify with NIST Prime-Curve P-384 : \n");
ECDSA_free(ecdsa);
if ((ecdsa = ECDSA_new()) == NULL) goto err;
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_NIST_PRIME_384)) == NULL) goto err;
if (!ECDSA_generate_key(ecdsa)) goto err;
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if ((signatures[i] = ECDSA_do_sign(digest[i], 20, ecdsa)) == NULL) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_sign() in %.2f"UNIT" => average time for ECDSA_do_sign() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d / ECDSA_NIST_TESTS);
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if (!ECDSA_do_verify(digest[i], 20, signatures[i], ecdsa)) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_verify() in %.2f"UNIT" => average time for ECDSA_do_verify() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d/ECDSA_NIST_TESTS);
for (i=0; i<ECDSA_NIST_TESTS; i++)
{
ECDSA_SIG_free(signatures[i]);
signatures[i] = NULL;
}
/* EC_GROUP_NIST_PRIME_521 */
BIO_printf(bio_err, "Testing sign & verify with NIST Prime-Curve P-521 : \n");
ECDSA_free(ecdsa);
if ((ecdsa = ECDSA_new()) == NULL) goto err;
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_NIST_PRIME_521)) == NULL) goto err;
if (!ECDSA_generate_key(ecdsa)) goto err;
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if ((signatures[i] = ECDSA_do_sign(digest[i], 20, ecdsa)) == NULL) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_sign() in %.2f"UNIT" => average time for ECDSA_do_sign() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d / ECDSA_NIST_TESTS);
tim = clock();
for (i=0; i<ECDSA_NIST_TESTS; i++)
if (!ECDSA_do_verify(digest[i], 20, signatures[i], ecdsa)) goto err;
tim = clock() - tim;
tim_d = (double)tim / CLOCKS_PER_SEC;
BIO_printf(bio_err, "%d x ECDSA_do_verify() in %.2f"UNIT" => average time for ECDSA_do_verify() %.4f"UNIT"\n"
, ECDSA_NIST_TESTS, tim_d, tim_d/ECDSA_NIST_TESTS);
ECDSA_free(ecdsa);
ecdsa = NULL;
for (i=0; i<ECDSA_NIST_TESTS; i++)
{
ECDSA_SIG_free(signatures[i]);
signatures[i] = NULL;
}
OPENSSL_free(buffer);
buffer = NULL;
EVP_PKEY_free(pkey);
pkey = NULL;
ecdsa = NULL;
ret = 1;
err: if (!ret)
BIO_printf(bio_err, "TEST FAILED \n");
else
BIO_printf(bio_err, "TEST PASSED \n");
if (!ret)
ERR_print_errors(bio_err);
if (ecdsa) ECDSA_free(ecdsa);
if (d) BN_free(d);
if (dgst) OPENSSL_free(dgst);
if (md_ctx) EVP_MD_CTX_destroy(md_ctx);
CRYPTO_cleanup_all_ex_data();
ERR_remove_state(0);
ERR_free_strings();
CRYPTO_mem_leaks(bio_err);
if (bio_err != NULL)
{
BIO_free(bio_err);
bio_err = NULL;
}
return(0);
}
#endif

View File

@ -1,356 +0,0 @@
/* crypto/ecdsa/ecs_asn1.c */
/* ====================================================================
* Copyright (c) 2000-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
* 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 "ecdsa.h"
#include "cryptlib.h"
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
typedef struct ecdsa_priv_key_st {
int version;
ECPKPARAMETERS *parameters;
ASN1_OBJECT *named_curve;
ASN1_OCTET_STRING *pub_key;
BIGNUM *priv_key;
} ECDSAPrivateKey;
ASN1_SEQUENCE(ECDSA_SIG) = {
ASN1_SIMPLE(ECDSA_SIG, r, CBIGNUM),
ASN1_SIMPLE(ECDSA_SIG, s, CBIGNUM)
} ASN1_SEQUENCE_END(ECDSA_SIG)
DECLARE_ASN1_FUNCTIONS_const(ECDSA_SIG)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECDSA_SIG, ECDSA_SIG)
IMPLEMENT_ASN1_FUNCTIONS_const(ECDSA_SIG)
ASN1_SEQUENCE(ECDSAPrivateKey) = {
ASN1_SIMPLE(ECDSAPrivateKey, version, LONG),
ASN1_SIMPLE(ECDSAPrivateKey, parameters, ECPKPARAMETERS),
ASN1_SIMPLE(ECDSAPrivateKey, pub_key, ASN1_OCTET_STRING),
ASN1_SIMPLE(ECDSAPrivateKey, priv_key, BIGNUM)
} ASN1_SEQUENCE_END(ECDSAPrivateKey)
DECLARE_ASN1_FUNCTIONS_const(ECDSAPrivateKey)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECDSAPrivateKey, ecdsaPrivateKey)
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(ECDSAPrivateKey, ECDSAPrivateKey, ECDSAPrivateKey)
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(ECDSAPrivateKey, ECDSAPrivateKey, ecdsaPrivateKey)
int i2d_ECDSAParameters(ECDSA *a, unsigned char **out)
{
if (a == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPARAMETERS,
ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
return i2d_ECPKParameters(a->group, out);
}
ECDSA *d2i_ECDSAParameters(ECDSA **a, const unsigned char **in, long len)
{
EC_GROUP *group;
ECDSA *ret;
if (in == NULL || *in == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPARAMETERS,
ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
group = d2i_ECPKParameters(NULL, in, len);
if (group == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPARAMETERS,
ERR_R_EC_LIB);
return NULL;
}
if (a == NULL || *a == NULL)
{
if ((ret = ECDSA_new()) == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPARAMETERS,
ERR_R_MALLOC_FAILURE);
return NULL;
}
if (a)
*a = ret;
}
else
ret = *a;
if (ret->group)
EC_GROUP_clear_free(ret->group);
ret->group = group;
return ret;
}
ECDSA *d2i_ECDSAPrivateKey(ECDSA **a, const unsigned char **in, long len)
{
int ok=0;
ECDSA *ret=NULL;
ECDSAPrivateKey *priv_key=NULL;
if ((priv_key = ECDSAPrivateKey_new()) == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, ERR_R_MALLOC_FAILURE);
return NULL;
}
if ((priv_key = d2i_ecdsaPrivateKey(&priv_key, in, len)) == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY,
ECDSA_R_D2I_ECDSA_PRIVATEKEY_FAILURE);
ECDSAPrivateKey_free(priv_key);
return NULL;
}
if (a == NULL || *a == NULL)
{
if ((ret = ECDSA_new()) == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (a)
*a = ret;
}
else
ret = *a;
if (ret->group)
EC_GROUP_clear_free(ret->group);
ret->group = EC_ASN1_pkparameters2group(priv_key->parameters);
if (ret->group == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, ERR_R_EC_LIB);
goto err;
}
ret->version = priv_key->version;
if (priv_key->priv_key)
{
if ((ret->priv_key = BN_dup(priv_key->priv_key)) == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY,
ERR_R_BN_LIB);
goto err;
}
}
else
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY,
ECDSA_R_MISSING_PRIVATE_KEY);
goto err;
}
if ((ret->pub_key = EC_POINT_new(ret->group)) == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, ERR_R_EC_LIB);
goto err;
}
if (!EC_POINT_oct2point(ret->group, ret->pub_key,
priv_key->pub_key->data, priv_key->pub_key->length, NULL))
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, ERR_R_EC_LIB);
goto err;
}
ok = 1;
err : if (!ok)
{
if (ret) ECDSA_free(ret);
ret = NULL;
}
if (priv_key)
ECDSAPrivateKey_free(priv_key);
return(ret);
}
int i2d_ECDSAPrivateKey(ECDSA *a, unsigned char **out)
{
int ret=0, ok=0;
unsigned char *buffer=NULL;
size_t buf_len=0;
ECDSAPrivateKey *priv_key=NULL;
if (a == NULL || a->group == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY,
ERR_R_PASSED_NULL_PARAMETER);
goto err;
}
if ((priv_key = ECDSAPrivateKey_new()) == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
if ((priv_key->parameters = EC_ASN1_group2pkparameters(a->group,
priv_key->parameters)) == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY, ERR_R_EC_LIB);
goto err;
}
priv_key->version = a->version;
if (BN_copy(priv_key->priv_key, a->priv_key) == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY, ERR_R_BN_LIB);
goto err;
}
buf_len = EC_POINT_point2oct(a->group, a->pub_key,
ECDSA_get_conversion_form(a), NULL, 0, NULL);
if ((buffer = OPENSSL_malloc(buf_len)) == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!EC_POINT_point2oct(a->group, a->pub_key,
ECDSA_get_conversion_form(a), buffer, buf_len, NULL))
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY, ERR_R_EC_LIB);
goto err;
}
if (!M_ASN1_OCTET_STRING_set(priv_key->pub_key, buffer, buf_len))
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY, ERR_R_ASN1_LIB);
goto err;
}
if ((ret = i2d_ecdsaPrivateKey(priv_key, out)) == 0)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPRIVATEKEY,
ECDSA_R_I2D_ECDSA_PRIVATEKEY);
goto err;
}
ok=1;
err:
if (buffer)
OPENSSL_free(buffer);
if (priv_key)
ECDSAPrivateKey_free(priv_key);
return(ok?ret:0);
}
ECDSA *ECDSAPublicKey_set_octet_string(ECDSA **a, const unsigned char **in, long len)
{
ECDSA *ret=NULL;
if (a == NULL || (*a) == NULL || (*a)->group == NULL)
{
/* sorry, but a EC_GROUP-structur is necessary
* to set the public key */
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, ECDSA_R_MISSING_PARAMETERS);
return 0;
}
ret = *a;
if (ret->pub_key == NULL && (ret->pub_key = EC_POINT_new(ret->group)) == NULL)
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, ERR_R_MALLOC_FAILURE);
return 0;
}
if (!EC_POINT_oct2point(ret->group, ret->pub_key, *in, len, NULL))
{
ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, ERR_R_EC_LIB);
return 0;
}
ECDSA_set_conversion_form(ret, (point_conversion_form_t)(*in[0] & ~0x01));
return ret;
}
int ECDSAPublicKey_get_octet_string(ECDSA *a, unsigned char **out)
{
size_t buf_len=0;
if (a == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPUBLICKEY, ECDSA_R_MISSING_PARAMETERS);
return 0;
}
buf_len = EC_POINT_point2oct(a->group, a->pub_key,
ECDSA_get_conversion_form(a), NULL, 0, NULL);
if (out == NULL || buf_len == 0)
/* out == NULL => just return the length of the octet string */
return buf_len;
if (*out == NULL)
if ((*out = OPENSSL_malloc(buf_len)) == NULL)
{
ECDSAerr(ECDSA_F_I2D_ECDSAPUBLICKEY, ERR_R_MALLOC_FAILURE);
return 0;
}
if (!EC_POINT_point2oct(a->group, a->pub_key, ECDSA_get_conversion_form(a),
*out, buf_len, NULL))
{
ECDSAerr(ECDSA_F_I2D_ECDSAPUBLICKEY, ERR_R_EC_LIB);
OPENSSL_free(*out);
*out = NULL;
return 0;
}
return buf_len;
}

View File

@ -1,156 +0,0 @@
/* crypto/ecdsa/ecs_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/ecdsa.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
static ERR_STRING_DATA ECDSA_str_functs[]=
{
{ERR_PACK(0,ECDSA_F_D2I_ECDSAPARAMETERS,0), "d2i_ECDSAParameters"},
{ERR_PACK(0,ECDSA_F_D2I_ECDSAPRIVATEKEY,0), "d2i_ECDSAPrivateKey"},
{ERR_PACK(0,ECDSA_F_ECDSAPARAMETERS_PRINT,0), "ECDSAParameters_print"},
{ERR_PACK(0,ECDSA_F_ECDSAPARAMETERS_PRINT_FP,0), "ECDSAParameters_print_fp"},
{ERR_PACK(0,ECDSA_F_ECDSA_DO_SIGN,0), "ECDSA_do_sign"},
{ERR_PACK(0,ECDSA_F_ECDSA_DO_VERIFY,0), "ECDSA_do_verify"},
{ERR_PACK(0,ECDSA_F_ECDSA_GENERATE_KEY,0), "ECDSA_generate_key"},
{ERR_PACK(0,ECDSA_F_ECDSA_GET,0), "ECDSA_GET"},
{ERR_PACK(0,ECDSA_F_ECDSA_GET_CURVE_NID,0), "ECDSA_GET_CURVE_NID"},
{ERR_PACK(0,ECDSA_F_ECDSA_GET_ECDSA,0), "ECDSA_GET_ECDSA"},
{ERR_PACK(0,ECDSA_F_ECDSA_GET_EC_PARAMETERS,0), "ECDSA_GET_EC_PARAMETERS"},
{ERR_PACK(0,ECDSA_F_ECDSA_GET_X9_62_CURVE,0), "ECDSA_GET_X9_62_CURVE"},
{ERR_PACK(0,ECDSA_F_ECDSA_GET_X9_62_EC_PARAMETERS,0), "ECDSA_GET_X9_62_EC_PARAMETERS"},
{ERR_PACK(0,ECDSA_F_ECDSA_GET_X9_62_FIELDID,0), "ECDSA_GET_X9_62_FIELDID"},
{ERR_PACK(0,ECDSA_F_ECDSA_NEW,0), "ECDSA_new"},
{ERR_PACK(0,ECDSA_F_ECDSA_PRINT,0), "ECDSA_print"},
{ERR_PACK(0,ECDSA_F_ECDSA_PRINT_FP,0), "ECDSA_print_fp"},
{ERR_PACK(0,ECDSA_F_ECDSA_SET_GROUP_P,0), "ECDSA_SET_GROUP_P"},
{ERR_PACK(0,ECDSA_F_ECDSA_SET_PRIME_GROUP,0), "ECDSA_SET_PRIME_GROUP"},
{ERR_PACK(0,ECDSA_F_ECDSA_SIGN_SETUP,0), "ECDSA_sign_setup"},
{ERR_PACK(0,ECDSA_F_I2D_ECDSAPARAMETERS,0), "i2d_ECDSAParameters"},
{ERR_PACK(0,ECDSA_F_I2D_ECDSAPRIVATEKEY,0), "i2d_ECDSAPrivateKey"},
{ERR_PACK(0,ECDSA_F_I2D_ECDSAPUBLICKEY,0), "I2D_ECDSAPUBLICKEY"},
{ERR_PACK(0,ECDSA_F_SIG_CB,0), "SIG_CB"},
{0,NULL}
};
static ERR_STRING_DATA ECDSA_str_reasons[]=
{
{ECDSA_R_BAD_SIGNATURE ,"bad signature"},
{ECDSA_R_CAN_NOT_GET_GENERATOR ,"can not get generator"},
{ECDSA_R_D2I_ECDSAPRIVATEKEY_MISSING_PRIVATE_KEY,"d2i ecdsaprivatekey missing private key"},
{ECDSA_R_D2I_ECDSA_PRIVATEKEY_FAILURE ,"d2i ecdsa privatekey failure"},
{ECDSA_R_D2I_EC_PARAMETERS_FAILURE ,"d2i ec parameters failure"},
{ECDSA_R_D2I_X9_62_EC_PARAMETERS_FAILURE ,"d2i x9 62 ec parameters failure"},
{ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE ,"data too large for key size"},
{ECDSA_R_ECDSAPRIVATEKEY_NEW_FAILURE ,"ecdsaprivatekey new failure"},
{ECDSA_R_ECDSA_F_ECDSA_NEW ,"ecdsa f ecdsa new"},
{ECDSA_R_ECDSA_GET_EC_PARAMETERS_FAILURE ,"ecdsa get ec parameters failure"},
{ECDSA_R_ECDSA_GET_FAILURE ,"ecdsa get failure"},
{ECDSA_R_ECDSA_GET_X9_62_CURVE_FAILURE ,"ecdsa get x9 62 curve failure"},
{ECDSA_R_ECDSA_GET_X9_62_EC_PARAMETERS_FAILURE,"ecdsa get x9 62 ec parameters failure"},
{ECDSA_R_ECDSA_GET_X9_62_FIELDID_FAILURE ,"ecdsa get x9 62 fieldid failure"},
{ECDSA_R_ECDSA_NEW_FAILURE ,"ecdsa new failure"},
{ECDSA_R_ECDSA_R_D2I_EC_PARAMETERS_FAILURE,"ecdsa r d2i ec parameters failure"},
{ECDSA_R_ECDSA_R_D2I_X9_62_EC_PARAMETERS_FAILURE,"ecdsa r d2i x9 62 ec parameters failure"},
{ECDSA_R_ECPARAMETERS2ECDSA_FAILURE ,"ecparameters2ecdsa failure"},
{ECDSA_R_EC_GROUP_NID2CURVE_FAILURE ,"ec group nid2curve failure"},
{ECDSA_R_ERR_EC_LIB ,"err ec lib"},
{ECDSA_R_I2D_ECDSA_PRIVATEKEY ,"i2d ecdsa privatekey"},
{ECDSA_R_I2D_ECDSA_PUBLICKEY ,"i2d ecdsa publickey"},
{ECDSA_R_MISSING_PARAMETERS ,"missing parameters"},
{ECDSA_R_MISSING_PRIVATE_KEY ,"missing private key"},
{ECDSA_R_NOT_SUPPORTED ,"not supported"},
{ECDSA_R_NO_CURVE_PARAMETER_A_SPECIFIED ,"no curve parameter a specified"},
{ECDSA_R_NO_CURVE_PARAMETER_B_SPECIFIED ,"no curve parameter b specified"},
{ECDSA_R_NO_CURVE_SPECIFIED ,"no curve specified"},
{ECDSA_R_NO_FIELD_SPECIFIED ,"no field specified"},
{ECDSA_R_PRIME_MISSING ,"prime missing"},
{ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED ,"random number generation failed"},
{ECDSA_R_SIGNATURE_MALLOC_FAILED ,"signature malloc failed"},
{ECDSA_R_UNEXPECTED_ASN1_TYPE ,"unexpected asn1 type"},
{ECDSA_R_UNEXPECTED_PARAMETER ,"unexpected parameter"},
{ECDSA_R_UNEXPECTED_PARAMETER_LENGTH ,"unexpected parameter length"},
{ECDSA_R_UNEXPECTED_VERSION_NUMER ,"unexpected version numer"},
{ECDSA_R_UNKNOWN_PARAMETERS_TYPE ,"unknown parameters type"},
{ECDSA_R_WRONG_FIELD_IDENTIFIER ,"wrong field identifier"},
{ECDSA_R_X9_62_CURVE_NEW_FAILURE ,"x9 62 curve new failure"},
{ECDSA_R_X9_62_EC_PARAMETERS_NEW_FAILURE ,"x9 62 ec parameters new failure"},
{0,NULL}
};
#endif
void ERR_load_ECDSA_strings(void)
{
static int init=1;
if (init)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(ERR_LIB_ECDSA,ECDSA_str_functs);
ERR_load_strings(ERR_LIB_ECDSA,ECDSA_str_reasons);
#endif
}
}

View File

@ -1,83 +0,0 @@
/* crypto/ecdsa/ecs_gen.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* TODO: implementation of ecdsa parameter generation
*/
#if 0
#include <stdio.h>
#include <time.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/bn.h>
#include <openssl/ecdsa.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#ifdef __cplusplus
extern "C" {
#endif
ECDSA *ECDSA_generate_parameters(int bits,
unsigned char *seed_in, int seed_len,
int *counter_ret, unsigned long *h_ret,
void (*callback)(int, int, void *),
void *cb_arg)
{
return NULL;
}
#ifdef __cplusplus
}
#endif
#else
static void *dummy=&dummy;
#endif

View File

@ -1,141 +0,0 @@
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include "cryptlib.h"
#include <openssl/ecdsa.h>
int ECDSA_generate_key(ECDSA *ecdsa)
{
int ok=0;
BN_CTX *ctx=NULL;
BIGNUM *priv_key=NULL,*order=NULL;
EC_POINT *pub_key=NULL;
if (!ecdsa || !ecdsa->group)
{
ECDSAerr(ECDSA_F_ECDSA_GENERATE_KEY,ECDSA_R_MISSING_PARAMETERS);
return 0;
}
if ((order = BN_new()) == NULL) goto err;
if ((ctx = BN_CTX_new()) == NULL) goto err;
if (ecdsa->priv_key == NULL)
{
if ((priv_key = BN_new()) == NULL) goto err;
}
else
priv_key = ecdsa->priv_key;
if (!EC_GROUP_get_order(ecdsa->group, order, ctx)) goto err;
do
if (!BN_rand_range(priv_key, order)) goto err;
while (BN_is_zero(priv_key));
if (ecdsa->pub_key == NULL)
{
if ((pub_key = EC_POINT_new(ecdsa->group)) == NULL) goto err;
}
else
pub_key = ecdsa->pub_key;
if (!EC_POINT_mul(ecdsa->group, pub_key, priv_key, NULL, NULL, ctx)) goto err;
ecdsa->priv_key = priv_key;
ecdsa->pub_key = pub_key;
ok=1;
err: if (order) BN_free(order);
if ((pub_key != NULL) && (ecdsa->pub_key == NULL)) EC_POINT_free(pub_key);
if ((priv_key != NULL) && (ecdsa->priv_key == NULL)) BN_free(priv_key);
if (ctx != NULL) BN_CTX_free(ctx);
return(ok);
}
int ECDSA_check_key(ECDSA *ecdsa)
{
int ok=0;
BN_CTX *ctx=NULL;
BIGNUM *order=NULL;
EC_POINT *point=NULL;
if (!ecdsa || !ecdsa->group || !ecdsa->pub_key)
return 0;
if ((ctx = BN_CTX_new()) == NULL) goto err;
if ((order = BN_new()) == NULL) goto err;
if ((point = EC_POINT_new(ecdsa->group)) == NULL) goto err;
/* testing whether pub_key is a valid point on the elliptic curve */
if (!EC_POINT_is_on_curve(ecdsa->group,ecdsa->pub_key,ctx)) goto err;
/* testing whether pub_key * order is the point at infinity */
if (!EC_GROUP_get_order(ecdsa->group,order,ctx)) goto err;
if (!EC_POINT_copy(point,ecdsa->pub_key)) goto err;
if (!EC_POINT_mul(ecdsa->group,point,order,NULL,NULL,ctx)) goto err;
if (!EC_POINT_is_at_infinity(ecdsa->group,point)) goto err;
/* in case the priv_key is present : check if generator * priv_key == pub_key */
if (ecdsa->priv_key)
{
if (BN_cmp(ecdsa->priv_key,order) >= 0) goto err;
if (!EC_POINT_mul(ecdsa->group,point,ecdsa->priv_key,NULL,NULL,ctx)) goto err;
if (EC_POINT_cmp(ecdsa->group,point,ecdsa->pub_key,ctx) != 0) goto err;
}
ok = 1;
err:
if (ctx != NULL) BN_CTX_free(ctx);
if (order != NULL) BN_free(order);
if (point != NULL) EC_POINT_free(point);
return(ok);
}

View File

@ -1,318 +0,0 @@
/* crypto/ecdsa/ecs_lib.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include "cryptlib.h"
#include "ecdsa.h"
#include <openssl/engine.h>
const char *ECDSA_version="ECDSA" OPENSSL_VERSION_PTEXT;
static const ECDSA_METHOD *default_ECDSA_method = NULL;
void ECDSA_set_default_method(const ECDSA_METHOD *meth)
{
default_ECDSA_method = meth;
}
const ECDSA_METHOD *ECDSA_get_default_method(void)
{
if(!default_ECDSA_method)
default_ECDSA_method = ECDSA_OpenSSL();
return default_ECDSA_method;
}
ECDSA *ECDSA_new(void)
{
return ECDSA_new_method(NULL);
}
int ECDSA_set_method(ECDSA *ecdsa, const ECDSA_METHOD *meth)
{
const ECDSA_METHOD *mtmp;
mtmp = ecdsa->meth;
if (mtmp->finish) mtmp->finish(ecdsa);
if (ecdsa->engine)
{
ENGINE_finish(ecdsa->engine);
ecdsa->engine = NULL;
}
ecdsa->meth = meth;
if (meth->init) meth->init(ecdsa);
return 1;
}
ECDSA *ECDSA_new_method(ENGINE *engine)
{
ECDSA *ret;
ret=(ECDSA *)OPENSSL_malloc(sizeof(ECDSA));
if (ret == NULL)
{
ECDSAerr(ECDSA_F_ECDSA_NEW,ERR_R_MALLOC_FAILURE);
return(NULL);
}
ret->meth = ECDSA_get_default_method();
ret->engine = engine;
if (!ret->engine)
ret->engine = ENGINE_get_default_ECDSA();
if (ret->engine)
{
ret->meth = ENGINE_get_ECDSA(ret->engine);
if (!ret->meth)
{
ECDSAerr(ECDSA_R_ECDSA_F_ECDSA_NEW, ERR_R_ENGINE_LIB);
ENGINE_finish(ret->engine);
OPENSSL_free(ret);
return NULL;
}
}
ret->version = 1;
ret->conversion_form = ECDSA_get_default_conversion_form();
ret->group = NULL;
ret->pub_key = NULL;
ret->priv_key = NULL;
ret->kinv = NULL;
ret->r = NULL;
ret->references = 1;
ret->flags = ret->meth->flags;
CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ECDSA, ret, &ret->ex_data);
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
{
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, ret, &ret->ex_data);
OPENSSL_free(ret);
ret=NULL;
}
return(ret);
}
void ECDSA_free(ECDSA *r)
{
int i;
if (r == NULL) return;
i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_ECDSA);
#ifdef REF_PRINT
REF_PRINT("ECDSA",r);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"ECDSA_free, bad reference count\n");
abort();
}
#endif
if (r->meth->finish)
r->meth->finish(r);
if (r->engine)
ENGINE_finish(r->engine);
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, r, &r->ex_data);
if (r->group != NULL) EC_GROUP_free(r->group);
if (r->pub_key != NULL) EC_POINT_free(r->pub_key);
if (r->priv_key != NULL) BN_clear_free(r->priv_key);
if (r->kinv != NULL) BN_clear_free(r->kinv);
if (r->r != NULL) BN_clear_free(r->r);
OPENSSL_free(r);
}
int ECDSA_size(const ECDSA *r)
{
int ret,i;
ASN1_INTEGER bs;
BIGNUM *order=NULL;
unsigned char buf[4];
if (r == NULL || r->group == NULL)
return 0;
if ((order = BN_new()) == NULL) return 0;
if (!EC_GROUP_get_order(r->group,order,NULL))
{
BN_clear_free(order);
return 0;
}
i=BN_num_bits(order);
bs.length=(i+7)/8;
bs.data=buf;
bs.type=V_ASN1_INTEGER;
/* If the top bit is set the asn1 encoding is 1 larger. */
buf[0]=0xff;
i=i2d_ASN1_INTEGER(&bs,NULL);
i+=i; /* r and s */
ret=ASN1_object_size(1,i,V_ASN1_SEQUENCE);
BN_clear_free(order);
return(ret);
}
int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ECDSA, argl, argp,
new_func, dup_func, free_func);
}
int ECDSA_set_ex_data(ECDSA *d, int idx, void *arg)
{
return(CRYPTO_set_ex_data(&d->ex_data,idx,arg));
}
void *ECDSA_get_ex_data(ECDSA *d, int idx)
{
return(CRYPTO_get_ex_data(&d->ex_data,idx));
}
int ECDSA_up_ref(ECDSA *ecdsa)
{
int i = CRYPTO_add(&ecdsa->references, 1, CRYPTO_LOCK_ECDSA);
#ifdef REF_PRINT
REF_PRINT("ECDSA",r);
#endif
#ifdef REF_CHECK
if (i < 2)
{
fprintf(stderr, "ECDSA_up_ref, bad reference count\n");
abort();
}
#endif
return ((i > 1) ? 1 : 0);
}
void ECDSA_set_conversion_form(ECDSA *ecdsa, const point_conversion_form_t form)
{
if (ecdsa) ecdsa->conversion_form = form;
}
point_conversion_form_t ECDSA_get_conversion_form(const ECDSA *ecdsa)
{
return ecdsa ? ecdsa->conversion_form : 0;
}
static point_conversion_form_t default_conversion_form = POINT_CONVERSION_UNCOMPRESSED;
void ECDSA_set_default_conversion_form(const point_conversion_form_t form)
{
default_conversion_form = form;
}
point_conversion_form_t ECDSA_get_default_conversion_form(void)
{
return default_conversion_form;
}

View File

@ -1,375 +0,0 @@
/* crypto/ecdsa/ecs_ossl.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include "cryptlib.h"
#include <openssl/ecdsa.h>
/* TODO : general case */
#define EC_POINT_get_affine_coordinates EC_POINT_get_affine_coordinates_GFp
static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dlen, ECDSA *ecdsa);
static int ecdsa_sign_setup(ECDSA *ecdsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len, ECDSA_SIG *sig,
ECDSA *ecdsa);
static ECDSA_METHOD openssl_ecdsa_meth = {
"OpenSSL ECDSA method",
ecdsa_do_sign,
ecdsa_sign_setup,
ecdsa_do_verify,
0,
NULL
};
const ECDSA_METHOD *ECDSA_OpenSSL(void)
{
return &openssl_ecdsa_meth;
}
static int ecdsa_sign_setup(ECDSA *ecdsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
{
BN_CTX *ctx = NULL;
BIGNUM k,*kinv=NULL,*r=NULL,*order=NULL,*X=NULL;
EC_POINT *tmp_point=NULL;
int ret = 0,reason = ERR_R_BN_LIB;
if (!ecdsa || !ecdsa->group || !ecdsa->pub_key || !ecdsa->priv_key)
{
reason = ECDSA_R_MISSING_PARAMETERS;
return 0;
}
if (ctx_in == NULL)
{
if ((ctx=BN_CTX_new()) == NULL) goto err;
}
else
ctx=ctx_in;
if ((r = BN_new()) == NULL) goto err;
if ((order = BN_new()) == NULL) goto err;
if ((X = BN_new()) == NULL) goto err;
if ((tmp_point = EC_POINT_new(ecdsa->group)) == NULL)
{
reason = ERR_R_EC_LIB;
goto err;
}
if (!EC_GROUP_get_order(ecdsa->group,order,ctx))
{
reason = ERR_R_EC_LIB;
goto err;
}
do
{
/* get random k */
BN_init(&k);
do
if (!BN_rand_range(&k,order))
{
reason = ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED;
goto err;
}
while (BN_is_zero(&k));
/* compute r the x-coordinate of generator * k */
if (!EC_POINT_mul(ecdsa->group,tmp_point,&k,NULL,NULL,ctx)
|| !EC_POINT_get_affine_coordinates(ecdsa->group,tmp_point,X,NULL,ctx))
{
reason = ERR_R_EC_LIB;
goto err;
}
if (!BN_nnmod(r,X,order,ctx)) goto err;
}
while (BN_is_zero(r));
/* compute the inverse of k */
if ((kinv = BN_mod_inverse(NULL,&k,order,ctx)) == NULL) goto err;
if (*rp == NULL)
BN_clear_free(*rp);
*rp = r;
if (*kinvp == NULL)
BN_clear_free(*kinvp);
*kinvp = kinv;
kinv = NULL;
ret = 1;
err:
if (!ret)
{
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP,reason);
if (kinv != NULL) BN_clear_free(kinv);
if (r != NULL) BN_clear_free(r);
}
if (ctx_in == NULL)
BN_CTX_free(ctx);
if (kinv != NULL)
BN_clear_free(kinv);
if (order != NULL)
BN_clear_free(order);
if (tmp_point != NULL)
EC_POINT_free(tmp_point);
if (X) BN_clear_free(X);
BN_clear_free(&k);
return(ret);
}
static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dgst_len, ECDSA *ecdsa)
{
BIGNUM *kinv=NULL,*r=NULL,*s=NULL,*m=NULL,*tmp=NULL,*order=NULL;
BIGNUM xr;
BN_CTX *ctx=NULL;
int reason=ERR_R_BN_LIB;
ECDSA_SIG *ret=NULL;
if (!ecdsa || !ecdsa->group || !ecdsa->pub_key || !ecdsa->priv_key)
{
reason = ECDSA_R_MISSING_PARAMETERS;
goto err;
}
BN_init(&xr);
if ((ctx = BN_CTX_new()) == NULL) goto err;
if ((order = BN_new()) == NULL) goto err;
if ((tmp = BN_new()) == NULL) goto err;
if ((m = BN_new()) == NULL) goto err;
if ((s = BN_new()) == NULL) goto err;
if (!EC_GROUP_get_order(ecdsa->group,order,ctx))
{
reason = ECDSA_R_ERR_EC_LIB;
goto err;
}
if (dgst_len > BN_num_bytes(order))
{
reason = ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE;
goto err;
}
if (BN_bin2bn(dgst,dgst_len,m) == NULL) goto err;
do
{
if ((ecdsa->kinv == NULL) || (ecdsa->r == NULL))
{
if (!ECDSA_sign_setup(ecdsa,ctx,&kinv,&r)) goto err;
}
else
{
kinv = ecdsa->kinv;
ecdsa->kinv = NULL;
r = ecdsa->r;
ecdsa->r = NULL;
}
if (!BN_mod_mul(tmp,ecdsa->priv_key,r,order,ctx)) goto err;
if (!BN_add(s,tmp,m)) goto err;
if (BN_cmp(s,order) > 0)
BN_sub(s,s,order);
if (!BN_mod_mul(s,s,kinv,order,ctx)) goto err;
}
while (BN_is_zero(s));
if ((ret = ECDSA_SIG_new()) == NULL)
{
reason = ECDSA_R_SIGNATURE_MALLOC_FAILED;
goto err;
}
if (BN_copy(ret->r, r) == NULL || BN_copy(ret->s, s) == NULL)
{
ECDSA_SIG_free(ret);
ret = NULL;
reason = ERR_R_BN_LIB;
}
err:
if (!ret)
{
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN,reason);
}
if (r != NULL) BN_clear_free(r);
if (s != NULL) BN_clear_free(s);
if (ctx != NULL) BN_CTX_free(ctx);
if (m != NULL) BN_clear_free(m);
if (tmp != NULL) BN_clear_free(tmp);
if (order != NULL) BN_clear_free(order);
if (kinv != NULL) BN_clear_free(kinv);
return(ret);
}
static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len, ECDSA_SIG *sig,
ECDSA *ecdsa)
{
BN_CTX *ctx;
BIGNUM *order=NULL,*u1=NULL,*u2=NULL,*m=NULL,*X=NULL;
EC_POINT *point=NULL;
int ret = -1,reason = ERR_R_BN_LIB;
if (!ecdsa || !ecdsa->group || !ecdsa->pub_key || !sig)
{
reason = ECDSA_R_MISSING_PARAMETERS;
return -1;
}
if ((ctx = BN_CTX_new()) == NULL) goto err;
if ((order = BN_new()) == NULL) goto err;
if ((u1 = BN_new()) == NULL) goto err;
if ((u2 = BN_new()) == NULL) goto err;
if ((m = BN_new()) == NULL) goto err;
if ((X = BN_new()) == NULL) goto err;
if (!EC_GROUP_get_order(ecdsa->group,order,ctx)) goto err;
if (BN_is_zero(sig->r) || sig->r->neg || BN_ucmp(sig->r, order) >= 0)
{
reason = ECDSA_R_BAD_SIGNATURE;
ret = 0;
goto err;
}
if (BN_is_zero(sig->s) || sig->s->neg || BN_ucmp(sig->s, order) >= 0)
{
reason = ECDSA_R_BAD_SIGNATURE;
ret = 0;
goto err;
}
/* calculate tmp1 = inv(S) mod order */
if ((BN_mod_inverse(u2,sig->s,order,ctx)) == NULL) goto err;
/* digest -> m */
if (BN_bin2bn(dgst,dgst_len,m) == NULL) goto err;
/* u1 = m * tmp mod order */
if (!BN_mod_mul(u1,m,u2,order,ctx)) goto err;
/* u2 = r * w mod q */
if (!BN_mod_mul(u2,sig->r,u2,order,ctx)) goto err;
if ((point = EC_POINT_new(ecdsa->group)) == NULL)
{
reason = ERR_R_EC_LIB;
goto err;
}
if (!EC_POINT_mul(ecdsa->group,point,u1,ecdsa->pub_key,u2,ctx)
|| !EC_POINT_get_affine_coordinates(ecdsa->group,point,X,NULL,ctx))
{
reason = ERR_R_EC_LIB;
goto err;
}
if (!BN_nnmod(u1,X,order,ctx)) goto err;
/* is now in u1. If the signature is correct, it will be
* equal to R. */
ret = (BN_ucmp(u1,sig->r) == 0);
err:
if (ret != 1) ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY,reason);
if (ctx != NULL) BN_CTX_free(ctx);
if (u1 != NULL) BN_clear_free(u1);
if (u2 != NULL) BN_clear_free(u2);
if (m != NULL) BN_clear_free(m);
if (X != NULL) BN_clear_free(X);
if (order != NULL) BN_clear_free(order);
if (point != NULL) EC_POINT_free(point);
return(ret);
}

View File

@ -1,138 +0,0 @@
/* crypto/ecdsa/ecdsa_sign.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include "cryptlib.h"
#include <openssl/ecdsa.h>
#include <openssl/engine.h>
ECDSA_SIG * ECDSA_do_sign(const unsigned char *dgst, int dlen, ECDSA *ecdsa)
{
return ecdsa->meth->ecdsa_do_sign(dgst, dlen, ecdsa);
}
int ECDSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
unsigned int *siglen, ECDSA *ecdsa)
{
ECDSA_SIG *s;
s=ECDSA_do_sign(dgst,dlen,ecdsa);
if (s == NULL)
{
*siglen=0;
return(0);
}
*siglen=i2d_ECDSA_SIG(s,&sig);
ECDSA_SIG_free(s);
return(1);
}
int ECDSA_sign_setup(ECDSA *ecdsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
{
return ecdsa->meth->ecdsa_sign_setup(ecdsa, ctx_in, kinvp, rp);
}

View File

@ -1,141 +0,0 @@
/* crypto/ecdsa/ecdsa_vrf.c */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <openssl/ecdsa.h>
#include <openssl/engine.h>
/* returns
* 1: correct signature
* 0: incorrect signature
* -1: error
*/
int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, ECDSA_SIG *sig, ECDSA *ecdsa)
{
return ecdsa->meth->ecdsa_do_verify(dgst, dgst_len, sig, ecdsa);
}
/* returns
* 1: correct signature
* 0: incorrect signature
* -1: error
*/
int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, ECDSA *ecdsa)
{
ECDSA_SIG *s;
int ret=-1;
s = ECDSA_SIG_new();
if (s == NULL) return(ret);
if (d2i_ECDSA_SIG(&s,&sigbuf,sig_len) == NULL) goto err;
ret=ECDSA_do_verify(dgst,dgst_len,s,ecdsa);
err:
ECDSA_SIG_free(s);
return(ret);
}

View File

@ -25,13 +25,13 @@ APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c \
eng_table.c eng_pkey.c eng_fat.c eng_all.c \
tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_rand.c tb_cipher.c tb_digest.c \
tb_rsa.c tb_dsa.c tb_dh.c tb_rand.c tb_cipher.c tb_digest.c \
eng_openssl.c eng_dyn.c eng_cnf.c \
hw_atalla.c hw_cswift.c hw_ncipher.c hw_nuron.c hw_ubsec.c \
hw_openbsd_dev_crypto.c hw_aep.c hw_sureware.c hw_4758_cca.c
LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \
eng_table.o eng_pkey.o eng_fat.o eng_all.o \
tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_rand.o tb_cipher.o tb_digest.o \
tb_rsa.o tb_dsa.o tb_dh.o tb_rand.o tb_cipher.o tb_digest.o \
eng_openssl.o eng_dyn.o eng_cnf.o \
hw_atalla.o hw_cswift.o hw_ncipher.o hw_nuron.o hw_ubsec.o \
hw_openbsd_dev_crypto.o hw_aep.o hw_sureware.o hw_4758_cca.o
@ -93,136 +93,122 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
eng_all.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
eng_all.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_all.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_all.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_all.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_all.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_all.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_all.o: eng_all.c eng_int.h
eng_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
eng_all.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
eng_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_all.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_all.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
eng_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
eng_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_all.o: ../../include/openssl/ui.h eng_all.c eng_int.h
eng_cnf.o: ../../e_os.h ../../include/openssl/asn1.h
eng_cnf.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_cnf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_cnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
eng_cnf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_cnf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_cnf.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_cnf.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_cnf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_cnf.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
eng_cnf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
eng_cnf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_cnf.o: ../../include/openssl/ui.h ../cryptlib.h eng_cnf.c
eng_cnf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_cnf.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
eng_cnf.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_cnf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_cnf.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_cnf.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_cnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_cnf.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_cnf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_cnf.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_cnf.o: ../cryptlib.h eng_cnf.c
eng_ctrl.o: ../../e_os.h ../../include/openssl/asn1.h
eng_ctrl.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_ctrl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_ctrl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_ctrl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_ctrl.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_ctrl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_ctrl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_ctrl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_ctrl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_ctrl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_ctrl.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_ctrl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_ctrl.o: ../../include/openssl/opensslconf.h
eng_ctrl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_ctrl.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_ctrl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_ctrl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_ctrl.o: ../cryptlib.h eng_ctrl.c eng_int.h
eng_dyn.o: ../../e_os.h ../../include/openssl/asn1.h
eng_dyn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_dyn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_dyn.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_dyn.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
eng_dyn.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_dyn.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_dyn.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_dyn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_dyn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
eng_dyn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
eng_dyn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_dyn.o: ../../include/openssl/ui.h ../cryptlib.h eng_dyn.c eng_int.h
eng_err.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
eng_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_err.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_err.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_err.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_err.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_err.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_err.o: eng_err.c
eng_dyn.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_dyn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_dyn.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_dyn.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
eng_dyn.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_dyn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_dyn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_dyn.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_dyn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_dyn.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_dyn.o: ../cryptlib.h eng_dyn.c eng_int.h
eng_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
eng_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
eng_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_err.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
eng_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
eng_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_err.o: ../../include/openssl/ui.h eng_err.c
eng_fat.o: ../../e_os.h ../../include/openssl/asn1.h
eng_fat.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_fat.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_fat.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
eng_fat.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_fat.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_fat.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_fat.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_fat.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_fat.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
eng_fat.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
eng_fat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_fat.o: ../../include/openssl/ui.h ../cryptlib.h eng_fat.c eng_int.h
eng_fat.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_fat.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
eng_fat.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_fat.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_fat.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_fat.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_fat.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_fat.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_fat.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_fat.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_fat.o: ../cryptlib.h eng_fat.c eng_int.h
eng_init.o: ../../e_os.h ../../include/openssl/asn1.h
eng_init.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_init.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_init.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_init.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_init.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_init.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_init.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_init.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_init.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_init.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_init.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_init.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_init.o: ../../include/openssl/opensslconf.h
eng_init.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_init.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_init.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_init.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_init.o: ../cryptlib.h eng_init.c eng_int.h
eng_lib.o: ../../e_os.h ../../include/openssl/asn1.h
eng_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_lib.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_lib.o: ../cryptlib.h eng_int.h eng_lib.c
eng_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
eng_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
eng_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_lib.o: ../../include/openssl/ui.h ../cryptlib.h eng_int.h eng_lib.c
eng_list.o: ../../e_os.h ../../include/openssl/asn1.h
eng_list.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_list.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_list.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_list.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_list.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_list.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_list.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_list.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_list.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_list.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_list.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_list.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_list.o: ../../include/openssl/opensslconf.h
eng_list.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_list.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_list.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_list.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_list.o: ../cryptlib.h eng_int.h eng_list.c
eng_openssl.o: ../../e_os.h ../../include/openssl/aes.h
eng_openssl.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
eng_openssl.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
eng_openssl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_openssl.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
eng_openssl.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
eng_openssl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_openssl.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
eng_openssl.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_openssl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_openssl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
eng_openssl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
eng_openssl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
eng_openssl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
eng_openssl.o: ../../include/openssl/objects.h
eng_openssl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
eng_openssl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
eng_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
eng_openssl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
eng_openssl.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
eng_openssl.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
eng_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_openssl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_openssl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
eng_openssl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
eng_openssl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
eng_openssl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_openssl.o: ../../include/openssl/opensslconf.h
eng_openssl.o: ../../include/openssl/opensslv.h
eng_openssl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
@ -236,31 +222,29 @@ eng_openssl.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
eng_openssl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_openssl.o: ../cryptlib.h eng_openssl.c
eng_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
eng_pkey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
eng_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
eng_pkey.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
eng_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
eng_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
eng_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
eng_pkey.o: ../../include/openssl/opensslconf.h
eng_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_pkey.o: ../cryptlib.h eng_int.h eng_pkey.c
eng_table.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
eng_table.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
eng_table.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
eng_table.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
eng_table.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
eng_table.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
eng_table.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_table.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_table.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_table.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
eng_table.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
eng_table.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
eng_table.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_table.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
eng_table.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
eng_table.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
eng_table.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
eng_table.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_table.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
eng_table.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
eng_table.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
eng_table.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
eng_table.o: ../../include/openssl/objects.h
eng_table.o: ../../include/openssl/opensslconf.h
eng_table.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_table.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
@ -271,20 +255,18 @@ eng_table.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_table.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
eng_table.o: eng_int.h eng_table.c
hw_4758_cca.o: ../../e_os.h ../../include/openssl/aes.h
hw_4758_cca.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
hw_4758_cca.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
hw_4758_cca.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_4758_cca.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
hw_4758_cca.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
hw_4758_cca.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_4758_cca.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_4758_cca.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
hw_4758_cca.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_4758_cca.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
hw_4758_cca.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
hw_4758_cca.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
hw_4758_cca.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
hw_4758_cca.o: ../../include/openssl/objects.h
hw_4758_cca.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_4758_cca.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
hw_4758_cca.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
hw_4758_cca.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
hw_4758_cca.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
hw_4758_cca.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
hw_4758_cca.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_4758_cca.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hw_4758_cca.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
hw_4758_cca.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
hw_4758_cca.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
hw_4758_cca.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_4758_cca.o: ../../include/openssl/opensslconf.h
hw_4758_cca.o: ../../include/openssl/opensslv.h
hw_4758_cca.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
@ -297,28 +279,25 @@ hw_4758_cca.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
hw_4758_cca.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
hw_4758_cca.o: ../cryptlib.h hw_4758_cca.c hw_4758_cca_err.c hw_4758_cca_err.h
hw_4758_cca.o: vendor_defns/hw_4758_cca.h
hw_aep.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
hw_aep.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_aep.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
hw_aep.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_aep.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_aep.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
hw_aep.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_aep.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
hw_aep.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
hw_aep.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
hw_aep.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
hw_aep.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h hw_aep.c
hw_aep.o: hw_aep_err.c hw_aep_err.h vendor_defns/aep.h
hw_aep.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_aep.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_aep.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
hw_aep.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
hw_aep.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
hw_aep.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
hw_aep.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
hw_aep.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
hw_aep.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
hw_aep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
hw_aep.o: ../../include/openssl/ui.h hw_aep.c hw_aep_err.c hw_aep_err.h
hw_aep.o: vendor_defns/aep.h
hw_atalla.o: ../../e_os.h ../../include/openssl/asn1.h
hw_atalla.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
hw_atalla.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_atalla.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
hw_atalla.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
hw_atalla.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
hw_atalla.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
hw_atalla.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
hw_atalla.o: ../../include/openssl/opensslconf.h
hw_atalla.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_atalla.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
hw_atalla.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_atalla.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_atalla.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_atalla.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
hw_atalla.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
hw_atalla.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
hw_atalla.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
@ -326,14 +305,12 @@ hw_atalla.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
hw_atalla.o: ../cryptlib.h hw_atalla.c hw_atalla_err.c hw_atalla_err.h
hw_atalla.o: vendor_defns/atalla.h
hw_cswift.o: ../../e_os.h ../../include/openssl/asn1.h
hw_cswift.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
hw_cswift.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_cswift.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
hw_cswift.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
hw_cswift.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
hw_cswift.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
hw_cswift.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
hw_cswift.o: ../../include/openssl/opensslconf.h
hw_cswift.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_cswift.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
hw_cswift.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_cswift.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_cswift.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_cswift.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
hw_cswift.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
hw_cswift.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
hw_cswift.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
@ -341,20 +318,18 @@ hw_cswift.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
hw_cswift.o: ../cryptlib.h hw_cswift.c hw_cswift_err.c hw_cswift_err.h
hw_cswift.o: vendor_defns/cswift.h
hw_ncipher.o: ../../e_os.h ../../include/openssl/aes.h
hw_ncipher.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
hw_ncipher.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
hw_ncipher.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_ncipher.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
hw_ncipher.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
hw_ncipher.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_ncipher.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_ncipher.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
hw_ncipher.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_ncipher.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
hw_ncipher.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
hw_ncipher.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
hw_ncipher.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
hw_ncipher.o: ../../include/openssl/objects.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/des_old.h ../../include/openssl/dh.h
hw_ncipher.o: ../../include/openssl/dsa.h ../../include/openssl/dso.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/ossl_typ.h
hw_ncipher.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
@ -368,14 +343,12 @@ hw_ncipher.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
hw_ncipher.o: ../../include/openssl/x509_vfy.h ../cryptlib.h hw_ncipher.c
hw_ncipher.o: hw_ncipher_err.c hw_ncipher_err.h vendor_defns/hwcryptohook.h
hw_nuron.o: ../../e_os.h ../../include/openssl/asn1.h
hw_nuron.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
hw_nuron.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_nuron.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
hw_nuron.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
hw_nuron.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
hw_nuron.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
hw_nuron.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
hw_nuron.o: ../../include/openssl/opensslconf.h
hw_nuron.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_nuron.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
hw_nuron.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_nuron.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_nuron.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_nuron.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
hw_nuron.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
hw_nuron.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
hw_nuron.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
@ -383,7 +356,6 @@ hw_nuron.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
hw_nuron.o: ../cryptlib.h hw_nuron.c hw_nuron_err.c hw_nuron_err.h
hw_openbsd_dev_crypto.o: ../../include/openssl/aes.h
hw_openbsd_dev_crypto.o: ../../include/openssl/asn1.h
hw_openbsd_dev_crypto.o: ../../include/openssl/asn1t.h
hw_openbsd_dev_crypto.o: ../../include/openssl/bio.h
hw_openbsd_dev_crypto.o: ../../include/openssl/blowfish.h
hw_openbsd_dev_crypto.o: ../../include/openssl/bn.h
@ -394,8 +366,6 @@ hw_openbsd_dev_crypto.o: ../../include/openssl/des.h
hw_openbsd_dev_crypto.o: ../../include/openssl/des_old.h
hw_openbsd_dev_crypto.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_openbsd_dev_crypto.o: ../../include/openssl/e_os2.h
hw_openbsd_dev_crypto.o: ../../include/openssl/ec.h
hw_openbsd_dev_crypto.o: ../../include/openssl/ecdsa.h
hw_openbsd_dev_crypto.o: ../../include/openssl/engine.h
hw_openbsd_dev_crypto.o: ../../include/openssl/err.h
hw_openbsd_dev_crypto.o: ../../include/openssl/evp.h
@ -424,20 +394,18 @@ hw_openbsd_dev_crypto.o: ../../include/openssl/ui.h
hw_openbsd_dev_crypto.o: ../../include/openssl/ui_compat.h ../evp/evp_locl.h
hw_openbsd_dev_crypto.o: eng_int.h hw_openbsd_dev_crypto.c
hw_sureware.o: ../../e_os.h ../../include/openssl/aes.h
hw_sureware.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
hw_sureware.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
hw_sureware.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_sureware.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
hw_sureware.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
hw_sureware.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_sureware.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_sureware.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
hw_sureware.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_sureware.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
hw_sureware.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
hw_sureware.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
hw_sureware.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
hw_sureware.o: ../../include/openssl/objects.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/des_old.h ../../include/openssl/dh.h
hw_sureware.o: ../../include/openssl/dsa.h ../../include/openssl/dso.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
hw_sureware.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
@ -452,14 +420,12 @@ hw_sureware.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
hw_sureware.o: ../cryptlib.h eng_int.h engine.h hw_sureware.c hw_sureware_err.c
hw_sureware.o: hw_sureware_err.h vendor_defns/sureware.h
hw_ubsec.o: ../../e_os.h ../../include/openssl/asn1.h
hw_ubsec.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
hw_ubsec.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
hw_ubsec.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
hw_ubsec.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
hw_ubsec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
hw_ubsec.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
hw_ubsec.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
hw_ubsec.o: ../../include/openssl/opensslconf.h
hw_ubsec.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_ubsec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
hw_ubsec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_ubsec.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_ubsec.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_ubsec.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
hw_ubsec.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
hw_ubsec.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
hw_ubsec.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
@ -467,18 +433,17 @@ hw_ubsec.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
hw_ubsec.o: ../cryptlib.h hw_ubsec.c hw_ubsec_err.c hw_ubsec_err.h
hw_ubsec.o: vendor_defns/hw_ubsec.h
tb_cipher.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
tb_cipher.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
tb_cipher.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
tb_cipher.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
tb_cipher.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
tb_cipher.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
tb_cipher.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_cipher.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_cipher.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_cipher.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
tb_cipher.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
tb_cipher.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
tb_cipher.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_cipher.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
tb_cipher.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
tb_cipher.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
tb_cipher.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
tb_cipher.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
tb_cipher.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_cipher.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
tb_cipher.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
tb_cipher.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
tb_cipher.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
tb_cipher.o: ../../include/openssl/objects.h
tb_cipher.o: ../../include/openssl/opensslconf.h
tb_cipher.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_cipher.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
@ -489,39 +454,37 @@ tb_cipher.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_cipher.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
tb_cipher.o: eng_int.h tb_cipher.c
tb_dh.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
tb_dh.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
tb_dh.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
tb_dh.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
tb_dh.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
tb_dh.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
tb_dh.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_dh.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_dh.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_dh.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
tb_dh.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
tb_dh.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
tb_dh.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_dh.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_dh.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
tb_dh.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
tb_dh.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
tb_dh.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
tb_dh.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_dh.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
tb_dh.o: ../../include/openssl/ui_compat.h eng_int.h tb_dh.c
tb_dh.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
tb_dh.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
tb_dh.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
tb_dh.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
tb_dh.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
tb_dh.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_dh.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
tb_dh.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
tb_dh.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
tb_dh.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
tb_dh.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_dh.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_dh.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
tb_dh.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
tb_dh.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
tb_dh.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_dh.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_dh.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h eng_int.h
tb_dh.o: tb_dh.c
tb_digest.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
tb_digest.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
tb_digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
tb_digest.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
tb_digest.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
tb_digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
tb_digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_digest.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_digest.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
tb_digest.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
tb_digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
tb_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_digest.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
tb_digest.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
tb_digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
tb_digest.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
tb_digest.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
tb_digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_digest.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
tb_digest.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
tb_digest.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
tb_digest.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
tb_digest.o: ../../include/openssl/objects.h
tb_digest.o: ../../include/openssl/opensslconf.h
tb_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_digest.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
@ -532,87 +495,62 @@ tb_digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_digest.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
tb_digest.o: eng_int.h tb_digest.c
tb_dsa.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
tb_dsa.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
tb_dsa.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
tb_dsa.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
tb_dsa.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
tb_dsa.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
tb_dsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_dsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_dsa.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_dsa.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
tb_dsa.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
tb_dsa.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
tb_dsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_dsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_dsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
tb_dsa.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
tb_dsa.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
tb_dsa.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
tb_dsa.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_dsa.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
tb_dsa.o: ../../include/openssl/ui_compat.h eng_int.h tb_dsa.c
tb_ecdsa.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
tb_ecdsa.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
tb_ecdsa.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
tb_ecdsa.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
tb_ecdsa.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
tb_ecdsa.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
tb_ecdsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_ecdsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_ecdsa.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_ecdsa.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
tb_ecdsa.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
tb_ecdsa.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
tb_ecdsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_ecdsa.o: ../../include/openssl/opensslconf.h
tb_ecdsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_ecdsa.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
tb_ecdsa.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
tb_ecdsa.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
tb_ecdsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_ecdsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_ecdsa.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
tb_ecdsa.o: eng_int.h tb_ecdsa.c
tb_dsa.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
tb_dsa.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
tb_dsa.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
tb_dsa.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
tb_dsa.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
tb_dsa.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_dsa.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
tb_dsa.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
tb_dsa.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
tb_dsa.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
tb_dsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_dsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_dsa.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
tb_dsa.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
tb_dsa.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
tb_dsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_dsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_dsa.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
tb_dsa.o: eng_int.h tb_dsa.c
tb_rand.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
tb_rand.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
tb_rand.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
tb_rand.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
tb_rand.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
tb_rand.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
tb_rand.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_rand.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_rand.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_rand.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
tb_rand.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
tb_rand.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
tb_rand.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_rand.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_rand.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
tb_rand.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
tb_rand.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
tb_rand.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
tb_rand.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_rand.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
tb_rand.o: ../../include/openssl/ui_compat.h eng_int.h tb_rand.c
tb_rand.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
tb_rand.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
tb_rand.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
tb_rand.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
tb_rand.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
tb_rand.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_rand.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
tb_rand.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
tb_rand.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
tb_rand.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
tb_rand.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_rand.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_rand.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
tb_rand.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
tb_rand.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
tb_rand.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_rand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_rand.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
tb_rand.o: eng_int.h tb_rand.c
tb_rsa.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
tb_rsa.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
tb_rsa.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
tb_rsa.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
tb_rsa.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
tb_rsa.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
tb_rsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_rsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_rsa.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_rsa.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
tb_rsa.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
tb_rsa.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
tb_rsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_rsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_rsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
tb_rsa.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
tb_rsa.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
tb_rsa.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
tb_rsa.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_rsa.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
tb_rsa.o: ../../include/openssl/ui_compat.h eng_int.h tb_rsa.c
tb_rsa.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
tb_rsa.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
tb_rsa.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
tb_rsa.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
tb_rsa.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
tb_rsa.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_rsa.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
tb_rsa.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
tb_rsa.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
tb_rsa.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
tb_rsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_rsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_rsa.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
tb_rsa.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
tb_rsa.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
tb_rsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_rsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_rsa.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
tb_rsa.o: eng_int.h tb_rsa.c

View File

@ -146,7 +146,6 @@ struct engine_st
const RSA_METHOD *rsa_meth;
const DSA_METHOD *dsa_meth;
const DH_METHOD *dh_meth;
const ECDSA_METHOD *ecdsa_meth;
const RAND_METHOD *rand_meth;
/* Cipher handling is via this callback */
ENGINE_CIPHERS_PTR ciphers;

View File

@ -323,9 +323,6 @@ static void engine_cpy(ENGINE *dest, const ENGINE *src)
#endif
#ifndef OPENSSL_NO_DH
dest->dh_meth = src->dh_meth;
#endif
#ifndef OPENSSL_NO_ECDSA
dest->ecdsa_meth = src->ecdsa_meth;
#endif
dest->rand_meth = src->rand_meth;
dest->ciphers = src->ciphers;

View File

@ -70,9 +70,6 @@
#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
#endif
#ifndef OPENSSL_NO_ECDSA
#include <openssl/ecdsa.h>
#endif
#include <openssl/rand.h>
#include <openssl/ui.h>
#include <openssl/symhacks.h>
@ -92,9 +89,6 @@ typedef void DSA_METHOD;
#ifdef OPENSSL_NO_DH
typedef void DH_METHOD;
#endif
#ifdef OPENSSL_NO_ECDSA
typedef void ECDSA_METHOD;
#endif
/* These flags are used to control combinations of algorithm (methods)
* by bitwise "OR"ing. */
@ -102,7 +96,6 @@ typedef void ECDSA_METHOD;
#define ENGINE_METHOD_DSA (unsigned int)0x0002
#define ENGINE_METHOD_DH (unsigned int)0x0004
#define ENGINE_METHOD_RAND (unsigned int)0x0008
#define ENGINE_METHOD_ECDSA (unsigned int)0x000F
#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
/* Obvious all-or-nothing cases. */
@ -338,10 +331,6 @@ int ENGINE_register_DSA(ENGINE *e);
void ENGINE_unregister_DSA(ENGINE *e);
void ENGINE_register_all_DSA(void);
int ENGINE_register_ECDSA(ENGINE *e);
void ENGINE_unregister_ECDSA(ENGINE *e);
void ENGINE_register_all_ECDSA(void);
int ENGINE_register_DH(ENGINE *e);
void ENGINE_unregister_DH(ENGINE *e);
void ENGINE_register_all_DH(void);
@ -421,7 +410,6 @@ int ENGINE_set_id(ENGINE *e, const char *id);
int ENGINE_set_name(ENGINE *e, const char *name);
int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth);
int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
@ -454,7 +442,6 @@ const char *ENGINE_get_id(const ENGINE *e);
const char *ENGINE_get_name(const ENGINE *e);
const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e);
const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
@ -507,7 +494,6 @@ EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
ENGINE *ENGINE_get_default_RSA(void);
/* Same for the other "methods" */
ENGINE *ENGINE_get_default_DSA(void);
ENGINE *ENGINE_get_default_ECDSA(void);
ENGINE *ENGINE_get_default_DH(void);
ENGINE *ENGINE_get_default_RAND(void);
/* These functions can be used to get a functional reference to perform
@ -523,7 +509,6 @@ int ENGINE_set_default_RSA(ENGINE *e);
int ENGINE_set_default_string(ENGINE *e, const char *list);
/* Same for the other "methods" */
int ENGINE_set_default_DSA(ENGINE *e);
int ENGINE_set_default_ECDSA(ENGINE *e);
int ENGINE_set_default_DH(ENGINE *e);
int ENGINE_set_default_RAND(ENGINE *e);
int ENGINE_set_default_ciphers(ENGINE *e);

View File

@ -501,7 +501,7 @@ static int cswift_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
goto err;
default:
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
@ -518,7 +518,7 @@ static int cswift_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP, &arg, 1,
&res, 1)) != SW_OK)
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
@ -608,7 +608,7 @@ static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
goto err;
default:
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
@ -625,7 +625,7 @@ static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP_CRT, &arg, 1,
&res, 1)) != SW_OK)
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
@ -740,7 +740,7 @@ static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
goto err;
default:
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
@ -758,7 +758,7 @@ static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
&res, 1);
if(sw_status != SW_OK)
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
@ -852,7 +852,7 @@ static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
goto err;
default:
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
@ -874,7 +874,7 @@ static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
&res, 1);
if(sw_status != SW_OK)
{
char tmpbuf[20];
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);

View File

@ -827,7 +827,6 @@ static void surewarehk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
}
#if 0
/* not currently used (bug?) */
/* 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,

View File

@ -1,120 +0,0 @@
/* ====================================================================
* Copyright (c) 2000-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
* 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/evp.h>
#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_ECDSA(), the function that is
* used by ECDSA to hook in implementation code and cache defaults (etc), will
* display brief debugging summaries to stderr with the 'nid'. */
/* #define ENGINE_ECDSA_DEBUG */
static ENGINE_TABLE *ecdsa_table = NULL;
static const int dummy_nid = 1;
void ENGINE_unregister_ECDSA(ENGINE *e)
{
engine_table_unregister(&ecdsa_table, e);
}
static void engine_unregister_all_ECDSA(void)
{
engine_table_cleanup(&ecdsa_table);
}
int ENGINE_register_ECDSA(ENGINE *e)
{
if(e->ecdsa_meth)
return engine_table_register(&ecdsa_table,
&engine_unregister_all_ECDSA, e, &dummy_nid, 1, 0);
return 1;
}
void ENGINE_register_all_ECDSA()
{
ENGINE *e;
for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e))
ENGINE_register_ECDSA(e);
}
int ENGINE_set_default_ECDSA(ENGINE *e)
{
if(e->ecdsa_meth)
return engine_table_register(&ecdsa_table,
&engine_unregister_all_ECDSA, e, &dummy_nid, 1, 0);
return 1;
}
/* Exposed API function to get a functional reference from the implementation
* table (ie. try to get a functional reference from the tabled structural
* references). */
ENGINE *ENGINE_get_default_ECDSA(void)
{
return engine_table_select(&ecdsa_table, dummy_nid);
}
/* Obtains an ECDSA implementation from an ENGINE functional reference */
const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e)
{
return e->ecdsa_meth;
}
/* Sets an ECDSA implementation in an ENGINE structure */
int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth)
{
e->ecdsa_meth = ecdsa_meth;
return 1;
}

View File

@ -86,14 +86,13 @@ err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
err.o: ../../include/openssl/symhacks.h ../cryptlib.h err.c
err_all.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
err_all.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
err_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
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/des_old.h
err_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
err_all.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
err_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
err_all.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
err_all.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
err_all.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
err_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
err_all.o: ../../include/openssl/des_old.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/ec.h
err_all.o: ../../include/openssl/engine.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

View File

@ -131,7 +131,6 @@ typedef struct err_state_st
#define ERR_LIB_OCSP 39
#define ERR_LIB_UI 40
#define ERR_LIB_COMP 41
#define ERR_LIB_ECDSA 42
#define ERR_LIB_USER 128
@ -160,7 +159,6 @@ typedef struct err_state_st
#define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__)
#define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__)
#define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__)
#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)
/* Borland C seems too stupid to be able to shift and do longs in
* the pre-processor :-( */
@ -213,7 +211,6 @@ typedef struct err_state_st
#define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */
#define ERR_R_UI_LIB ERR_LIB_UI /* 40 */
#define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */
#define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */
#define ERR_R_NESTED_ASN1_ERROR 58
#define ERR_R_BAD_ASN1_OBJECT_HEADER 59

View File

@ -27,12 +27,10 @@ L DSO crypto/dso/dso.h crypto/dso/dso_err.c
L ENGINE crypto/engine/engine.h crypto/engine/eng_err.c
L OCSP crypto/ocsp/ocsp.h crypto/ocsp/ocsp_err.c
L UI crypto/ui/ui.h crypto/ui/ui_err.c
L ECDSA crypto/ecdsa/ecdsa.h crypto/ecdsa/ecs_err.c
# additional header files to be scanned for function names
L NONE crypto/x509/x509_vfy.h NONE
L NONE crypto/ec/ec_lcl.h NONE
L NONE crypto/ecdsa/ecs_locl.h NONE
F RSAREF_F_RSA_BN2BIN

File diff suppressed because it is too large Load Diff

View File

@ -91,9 +91,6 @@ void OpenSSL_add_all_digests(void)
EVP_add_digest_alias(SN_dsaWithSHA1,"DSS1");
EVP_add_digest_alias(SN_dsaWithSHA1,"dss1");
#endif
#ifndef OPENSSL_NO_ECDSA
EVP_add_digest(EVP_ecdsa());
#endif
#endif
#if !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES)
EVP_add_digest(EVP_mdc2());

View File

@ -150,13 +150,11 @@
#define EVP_PK_RSA 0x0001
#define EVP_PK_DSA 0x0002
#define EVP_PK_DH 0x0004
#define EVP_PK_ECDSA 0x0008
#define EVP_PKT_SIGN 0x0010
#define EVP_PKT_ENC 0x0020
#define EVP_PKT_EXCH 0x0040
#define EVP_PKS_RSA 0x0100
#define EVP_PKS_DSA 0x0200
#define EVP_PKS_ECDSA 0x0400
#define EVP_PKT_EXP 0x1000 /* <= 512 bit key */
#define EVP_PKEY_NONE NID_undef
@ -168,7 +166,6 @@
#define EVP_PKEY_DSA3 NID_dsaWithSHA1
#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
#define EVP_PKEY_DH NID_dhKeyAgreement
#define EVP_PKEY_ECDSA NID_X9_62_id_ecPublicKey
#ifdef __cplusplus
extern "C" {
@ -192,9 +189,6 @@ struct evp_pkey_st
#endif
#ifndef OPENSSL_NO_DH
struct dh_st *dh; /* DH */
#endif
#ifndef OPENSSL_NO_ECDSA
struct ecdsa_st *ecdsa; /* ECDSA */
#endif
} pkey;
int save_parameters;
@ -307,13 +301,6 @@ struct env_md_st
#define EVP_PKEY_DSA_method EVP_PKEY_NULL_method
#endif
#ifndef OPENSSL_NO_ECDSA
#define EVP_PKEY_ECDSA_method ECDSA_sign,ECDSA_verify, \
{EVP_PKEY_ECDSA,0,0,0}
#else
#define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method
#endif
#ifndef OPENSSL_NO_RSA
#define EVP_PKEY_RSA_method RSA_sign,RSA_verify, \
{EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
@ -454,11 +441,6 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
(char *)(dh))
#endif
#ifndef OPENSSL_NO_ECDSA
#define EVP_PKEY_assign_ECDSA(pkey,ecdsa) EVP_PKEY_assign((pkey),EVP_PKEY_ECDSA,\
(char *)(ecdsa))
#endif
/* Add some extra combinations */
#define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
#define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
@ -642,7 +624,6 @@ const EVP_MD *EVP_sha(void);
const EVP_MD *EVP_sha1(void);
const EVP_MD *EVP_dss(void);
const EVP_MD *EVP_dss1(void);
const EVP_MD *EVP_ecdsa(void);
#endif
#ifndef OPENSSL_NO_MDC2
const EVP_MD *EVP_mdc2(void);
@ -785,11 +766,7 @@ struct dh_st;
int EVP_PKEY_set1_DH(EVP_PKEY *pkey,struct dh_st *key);
struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey);
#endif
#ifndef OPENSSL_NO_ECDSA
struct ecdsa_st;
int EVP_PKEY_set1_ECDSA(EVP_PKEY *pkey,struct ecdsa_st *key);
struct ecdsa_st *EVP_PKEY_get1_ECDSA(EVP_PKEY *pkey);
#endif
EVP_PKEY * EVP_PKEY_new(void);
void EVP_PKEY_free(EVP_PKEY *pkey);
@ -847,7 +824,6 @@ void ERR_load_EVP_strings(void);
/* Function codes. */
#define EVP_F_D2I_PKEY 100
#define EVP_F_ECDSA_PKEY2PKCS8 129
#define EVP_F_EVP_CIPHERINIT 123
#define EVP_F_EVP_CIPHER_CTX_CTRL 124
#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
@ -866,7 +842,6 @@ void ERR_load_EVP_strings(void);
#define EVP_F_EVP_PKEY_ENCRYPT 105
#define EVP_F_EVP_PKEY_GET1_DH 119
#define EVP_F_EVP_PKEY_GET1_DSA 120
#define EVP_F_EVP_PKEY_GET1_ECDSA 130
#define EVP_F_EVP_PKEY_GET1_RSA 121
#define EVP_F_EVP_PKEY_NEW 106
#define EVP_F_EVP_RIJNDAEL 126
@ -878,7 +853,6 @@ void ERR_load_EVP_strings(void);
#define EVP_F_RC5_CTRL 125
/* Reason codes. */
#define EVP_R_ASN1_LIB 140
#define EVP_R_BAD_BLOCK_LENGTH 136
#define EVP_R_BAD_DECRYPT 100
#define EVP_R_BAD_KEY_LENGTH 137
@ -895,7 +869,6 @@ void ERR_load_EVP_strings(void);
#define EVP_R_EXPECTING_AN_RSA_KEY 127
#define EVP_R_EXPECTING_A_DH_KEY 128
#define EVP_R_EXPECTING_A_DSA_KEY 129
#define EVP_R_EXPECTING_A_ECDSA_KEY 141
#define EVP_R_INITIALIZATION_ERROR 134
#define EVP_R_INPUT_NOT_INITIALIZED 111
#define EVP_R_INVALID_KEY_LENGTH 130

View File

@ -67,7 +67,6 @@
static ERR_STRING_DATA EVP_str_functs[]=
{
{ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"},
{ERR_PACK(0,EVP_F_ECDSA_PKEY2PKCS8,0), "ECDSA_PKEY2PKCS8"},
{ERR_PACK(0,EVP_F_EVP_CIPHERINIT,0), "EVP_CipherInit"},
{ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_CTRL,0), "EVP_CIPHER_CTX_ctrl"},
{ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,0), "EVP_CIPHER_CTX_set_key_length"},
@ -86,7 +85,6 @@ static ERR_STRING_DATA EVP_str_functs[]=
{ERR_PACK(0,EVP_F_EVP_PKEY_ENCRYPT,0), "EVP_PKEY_encrypt"},
{ERR_PACK(0,EVP_F_EVP_PKEY_GET1_DH,0), "EVP_PKEY_get1_DH"},
{ERR_PACK(0,EVP_F_EVP_PKEY_GET1_DSA,0), "EVP_PKEY_get1_DSA"},
{ERR_PACK(0,EVP_F_EVP_PKEY_GET1_ECDSA,0), "EVP_PKEY_get1_ECDSA"},
{ERR_PACK(0,EVP_F_EVP_PKEY_GET1_RSA,0), "EVP_PKEY_get1_RSA"},
{ERR_PACK(0,EVP_F_EVP_PKEY_NEW,0), "EVP_PKEY_new"},
{ERR_PACK(0,EVP_F_EVP_RIJNDAEL,0), "EVP_RIJNDAEL"},
@ -101,7 +99,6 @@ static ERR_STRING_DATA EVP_str_functs[]=
static ERR_STRING_DATA EVP_str_reasons[]=
{
{EVP_R_ASN1_LIB ,"asn1 lib"},
{EVP_R_BAD_BLOCK_LENGTH ,"bad block length"},
{EVP_R_BAD_DECRYPT ,"bad decrypt"},
{EVP_R_BAD_KEY_LENGTH ,"bad key length"},
@ -118,7 +115,6 @@ static ERR_STRING_DATA EVP_str_reasons[]=
{EVP_R_EXPECTING_AN_RSA_KEY ,"expecting an rsa key"},
{EVP_R_EXPECTING_A_DH_KEY ,"expecting a dh key"},
{EVP_R_EXPECTING_A_DSA_KEY ,"expecting a dsa key"},
{EVP_R_EXPECTING_A_ECDSA_KEY ,"expecting a ecdsa key"},
{EVP_R_INITIALIZATION_ERROR ,"initialization error"},
{EVP_R_INPUT_NOT_INITIALIZED ,"input not initialized"},
{EVP_R_INVALID_KEY_LENGTH ,"invalid key length"},

View File

@ -3,7 +3,7 @@
* project 1999.
*/
/* ====================================================================
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -65,9 +65,6 @@
#ifndef OPENSSL_NO_DSA
static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey);
#endif
#ifndef OPENSSL_NO_ECDSA
static int ecdsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey);
#endif
/* Extract a private key from a PKCS8 structure */
@ -79,14 +76,9 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
#endif
#ifndef OPENSSL_NO_DSA
DSA *dsa = NULL;
#endif
#ifndef OPENSSL_NO_ECDSA
ECDSA *ecdsa = NULL;
#endif
#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA)
ASN1_INTEGER *privkey;
ASN1_TYPE *t1, *t2, *param = NULL;
STACK_OF(ASN1_TYPE) *n_stack = NULL;
ASN1_TYPE *t1, *t2, *param = NULL;
STACK_OF(ASN1_TYPE) *ndsa = NULL;
BN_CTX *ctx = NULL;
int plen;
#endif
@ -94,7 +86,6 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
unsigned char *p;
const unsigned char *cp;
int pkeylen;
int nid;
char obj_tmp[80];
if(p8->pkey->type == V_ASN1_OCTET_STRING) {
@ -111,8 +102,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
return NULL;
}
a = p8->pkeyalg;
nid = OBJ_obj2nid(a->algorithm);
switch(nid)
switch (OBJ_obj2nid(a->algorithm))
{
#ifndef OPENSSL_NO_RSA
case NID_rsaEncryption:
@ -124,166 +114,97 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
EVP_PKEY_assign_RSA (pkey, rsa);
break;
#endif
#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA)
case NID_ecdsa_with_SHA1:
#ifndef OPENSSL_NO_DSA
case NID_dsa:
/* PKCS#8 DSA/ECDSA is weird: you just get a private key integer
/* PKCS#8 DSA is weird: you just get a private key integer
* and parameters in the AlgorithmIdentifier the pubkey must
* be recalculated.
*/
/* Check for broken DSA/ECDSA PKCS#8, UGH! */
if(*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED))
{
if(!(n_stack = ASN1_seq_unpack_ASN1_TYPE(p, pkeylen,
/* Check for broken DSA PKCS#8, UGH! */
if(*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED)) {
if(!(ndsa = ASN1_seq_unpack_ASN1_TYPE(p, pkeylen,
d2i_ASN1_TYPE,
ASN1_TYPE_free)))
{
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
}
if(sk_ASN1_TYPE_num(n_stack) != 2 )
{
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
}
ASN1_TYPE_free))) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto dsaerr;
}
if(sk_ASN1_TYPE_num(ndsa) != 2 ) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto dsaerr;
}
/* Handle Two broken types:
* SEQUENCE {parameters, priv_key}
* SEQUENCE {pub_key, priv_key}
*/
t1 = sk_ASN1_TYPE_value(n_stack, 0);
t2 = sk_ASN1_TYPE_value(n_stack, 1);
if(t1->type == V_ASN1_SEQUENCE)
{
t1 = sk_ASN1_TYPE_value(ndsa, 0);
t2 = sk_ASN1_TYPE_value(ndsa, 1);
if(t1->type == V_ASN1_SEQUENCE) {
p8->broken = PKCS8_EMBEDDED_PARAM;
param = t1;
}
else if(a->parameter->type == V_ASN1_SEQUENCE)
{
} else if(a->parameter->type == V_ASN1_SEQUENCE) {
p8->broken = PKCS8_NS_DB;
param = a->parameter;
}
else
{
} else {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
goto dsaerr;
}
if(t2->type != V_ASN1_INTEGER) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
goto dsaerr;
}
privkey = t2->value.integer;
}
else
{
if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen)))
{
} else {
if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
goto dsaerr;
}
param = p8->pkeyalg->parameter;
}
if (!param || (param->type != V_ASN1_SEQUENCE))
{
if (!param || (param->type != V_ASN1_SEQUENCE)) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
goto dsaerr;
}
cp = p = param->value.sequence->data;
plen = param->value.sequence->length;
if (!(ctx = BN_CTX_new()))
{
if (!(dsa = d2i_DSAparams (NULL, &cp, plen))) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto dsaerr;
}
/* We have parameters now set private key */
if (!(dsa->priv_key = ASN1_INTEGER_to_BN(privkey, NULL))) {
EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_DECODE_ERROR);
goto dsaerr;
}
/* Calculate public key (ouch!) */
if (!(dsa->pub_key = BN_new())) {
EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE);
goto err;
goto dsaerr;
}
if (!(ctx = BN_CTX_new())) {
EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE);
goto dsaerr;
}
if (nid == NID_dsa)
{
#ifndef OPENSSL_NO_DSA
if (!(dsa = d2i_DSAparams (NULL, &cp, plen)))
{
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
}
/* We have parameters now set private key */
if (!(dsa->priv_key = ASN1_INTEGER_to_BN(privkey, NULL)))
{
EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_DECODE_ERROR);
goto err;
}
/* Calculate public key (ouch!) */
if (!(dsa->pub_key = BN_new()))
{
EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE);
goto err;
}
if (!BN_mod_exp(dsa->pub_key, dsa->g,
dsa->priv_key, dsa->p, ctx))
{
EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_PUBKEY_ERROR);
goto err;
}
EVP_PKEY_assign_DSA(pkey, dsa);
BN_CTX_free(ctx);
if(n_stack) sk_ASN1_TYPE_pop_free(n_stack, ASN1_TYPE_free);
else ASN1_INTEGER_free(privkey);
#else
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
goto err;
#endif
}
else /* nid == NID_ecdsa_with_SHA1 */
{
#ifndef OPENSSL_NO_ECDSA
if ((ecdsa = d2i_ECDSAParameters(NULL, &cp, plen)) == NULL)
{
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
}
if ((ecdsa->priv_key = ASN1_INTEGER_to_BN(privkey, NULL)) == NULL)
{
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
goto err;
}
if ((ecdsa->pub_key = EC_POINT_new(ecdsa->group)) == NULL)
{
EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_EC_LIB);
goto err;
}
if (!EC_POINT_copy(ecdsa->pub_key, EC_GROUP_get0_generator(ecdsa->group)))
{
EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_EC_LIB);
goto err;
}
if (!EC_POINT_mul(ecdsa->group, ecdsa->pub_key, ecdsa->priv_key,
NULL, NULL, ctx))
{
EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_EC_LIB);
goto err;
}
EVP_PKEY_assign_ECDSA(pkey, ecdsa);
BN_CTX_free(ctx);
if (n_stack) sk_ASN1_TYPE_pop_free(n_stack, ASN1_TYPE_free);
else
ASN1_INTEGER_free(privkey);
#else
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
goto err;
#endif
if (!BN_mod_exp(dsa->pub_key, dsa->g,
dsa->priv_key, dsa->p, ctx)) {
EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_PUBKEY_ERROR);
goto dsaerr;
}
EVP_PKEY_assign_DSA(pkey, dsa);
BN_CTX_free (ctx);
if(ndsa) sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
else ASN1_INTEGER_free(privkey);
break;
err:
if (ctx) BN_CTX_free(ctx);
sk_ASN1_TYPE_pop_free(n_stack, ASN1_TYPE_free);
#ifndef OPENSSL_NO_DSA
if (dsa) DSA_free(dsa);
#endif
#ifndef OPENSSL_NO_ECDSA
if (ecdsa) ECDSA_free(ecdsa);
#endif
if (pkey) EVP_PKEY_free(pkey);
dsaerr:
BN_CTX_free (ctx);
sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
DSA_free(dsa);
EVP_PKEY_free(pkey);
return NULL;
break;
#endif
@ -346,15 +267,6 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken)
break;
#endif
#ifndef OPENSSL_NO_ECDSA
case EVP_PKEY_ECDSA:
if (!ecdsa_pkey2pkcs8(p8, pkey))
{
PKCS8_PRIV_KEY_INFO_free(p8);
return(NULL);
}
break;
#endif
default:
EVPerr(EVP_F_EVP_PKEY2PKCS8, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
PKCS8_PRIV_KEY_INFO_free (p8);
@ -498,210 +410,3 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
return 1;
}
#endif
#ifndef OPENSSL_NO_ECDSA
static int ecdsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
{
ASN1_STRING *params=NULL;
ASN1_INTEGER *prkey=NULL;
ASN1_TYPE *ttmp=NULL;
STACK_OF(ASN1_TYPE) *necdsa=NULL;
unsigned char *p=NULL, *q=NULL;
int len=0;
EC_POINT *point=NULL;
if (pkey->pkey.ecdsa == NULL || pkey->pkey.ecdsa->group == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, EVP_R_MISSING_PARAMETERS);
return 0;
}
p8->pkeyalg->algorithm = OBJ_nid2obj(NID_ecdsa_with_SHA1);
len = i2d_ECDSAParameters(pkey->pkey.ecdsa, NULL);
if ((p = OPENSSL_malloc(len)) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
return 0;
}
q = p;
if (!i2d_ECDSAParameters(pkey->pkey.ecdsa, &q))
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_ECDSA_LIB);
OPENSSL_free(p);
return 0;
}
if ((params = ASN1_STRING_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
OPENSSL_free(p);
return 0;
}
if (!ASN1_STRING_set(params, p, len))
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_ASN1_LIB);
OPENSSL_free(p);
return 0;
}
OPENSSL_free(p);
if ((prkey = BN_to_ASN1_INTEGER(pkey->pkey.ecdsa->priv_key, NULL)) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_ASN1_LIB);
return 0;
}
switch(p8->broken) {
case PKCS8_OK:
case PKCS8_NO_OCTET:
if (!ASN1_pack_string((char *)prkey, i2d_ASN1_INTEGER,
&p8->pkey->value.octet_string))
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
M_ASN1_INTEGER_free(prkey);
return 0;
}
ASN1_INTEGER_free(prkey);
p8->pkeyalg->parameter->value.sequence = params;
p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE;
break;
case PKCS8_NS_DB:
p8->pkeyalg->parameter->value.sequence = params;
p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE;
necdsa = sk_ASN1_TYPE_new_null();
if (necdsa == NULL || (ttmp = ASN1_TYPE_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
return 0;
}
if ((point = EC_GROUP_get0_generator(pkey->pkey.ecdsa->group)) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_EC_LIB);
return 0;
}
len = EC_POINT_point2oct(pkey->pkey.ecdsa->group, point, ECDSA_get_conversion_form(pkey->pkey.ecdsa),
NULL, 0, NULL);
p = OPENSSL_malloc(len);
if (!len || !p || !EC_POINT_point2oct(pkey->pkey.ecdsa->group, point,
ECDSA_get_conversion_form(pkey->pkey.ecdsa), p, len, NULL))
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_EC_LIB);
OPENSSL_free(p);
return 0;
}
if ((ttmp->value.octet_string = ASN1_OCTET_STRING_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
return 0;
}
if (!ASN1_OCTET_STRING_set(ttmp->value.octet_string, p, len))
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, EVP_R_ASN1_LIB);
return 0;
}
OPENSSL_free(p);
ttmp->type = V_ASN1_OCTET_STRING;
if (!sk_ASN1_TYPE_push(necdsa, ttmp))
{
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
ASN1_INTEGER_free(prkey);
return 0;
}
if ((ttmp = ASN1_TYPE_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
return 0;
}
ttmp->value.integer = prkey;
ttmp->type = V_ASN1_INTEGER;
if (!sk_ASN1_TYPE_push(necdsa, ttmp))
{
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
ASN1_INTEGER_free(prkey);
return 0;
}
if ((p8->pkey->value.octet_string = ASN1_OCTET_STRING_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
return 0;
}
if (!ASN1_seq_pack_ASN1_TYPE(necdsa, i2d_ASN1_TYPE,
&p8->pkey->value.octet_string->data,
&p8->pkey->value.octet_string->length))
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
return 0;
}
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
break;
case PKCS8_EMBEDDED_PARAM:
p8->pkeyalg->parameter->type = V_ASN1_NULL;
necdsa = sk_ASN1_TYPE_new_null();
if ((ttmp = ASN1_TYPE_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
ASN1_INTEGER_free(prkey);
return 0;
}
ttmp->value.sequence = params;
ttmp->type = V_ASN1_SEQUENCE;
if (!sk_ASN1_TYPE_push(necdsa, ttmp))
{
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
ASN1_INTEGER_free(prkey);
return 0;
}
if ((ttmp = ASN1_TYPE_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
ASN1_INTEGER_free(prkey);
return 0;
}
ttmp->value.integer = prkey;
ttmp->type = V_ASN1_INTEGER;
if (!sk_ASN1_TYPE_push(necdsa, ttmp))
{
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
ASN1_INTEGER_free(prkey);
return 0;
}
if ((p8->pkey->value.octet_string = ASN1_OCTET_STRING_new()) == NULL)
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
return 0;
}
if (!ASN1_seq_pack_ASN1_TYPE(necdsa, i2d_ASN1_TYPE,
&p8->pkey->value.octet_string->data,
&p8->pkey->value.octet_string->length))
{
EVPerr(EVP_F_ECDSA_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
return 0;
}
sk_ASN1_TYPE_pop_free(necdsa, ASN1_TYPE_free);
break;
}
return 1;
}
#endif

View File

@ -1,95 +0,0 @@
/* crypto/evp/m_ecdsa.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
#ifndef OPENSSL_NO_SHA
static int init(EVP_MD_CTX *ctx)
{ return SHA1_Init(ctx->md_data); }
static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count)
{ return SHA1_Update(ctx->md_data,data,count); }
static int final(EVP_MD_CTX *ctx,unsigned char *md)
{ return SHA1_Final(md,ctx->md_data); }
static const EVP_MD ecdsa_md=
{
NID_ecdsa_with_SHA1,
NID_ecdsa_with_SHA1,
SHA_DIGEST_LENGTH,
0,
init,
update,
final,
NULL,
NULL,
EVP_PKEY_ECDSA_method,
SHA_CBLOCK,
sizeof(EVP_MD *)+sizeof(SHA_CTX),
};
const EVP_MD *EVP_ecdsa(void)
{
return(&ecdsa_md);
}
#endif

View File

@ -58,8 +58,6 @@
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/asn1_mac.h>
@ -69,37 +67,14 @@ static void EVP_PKEY_free_it(EVP_PKEY *x);
int EVP_PKEY_bits(EVP_PKEY *pkey)
{
if (0)
return 0;
#ifndef OPENSSL_NO_RSA
else if (pkey->type == EVP_PKEY_RSA)
if (pkey->type == EVP_PKEY_RSA)
return(BN_num_bits(pkey->pkey.rsa->n));
else
#endif
#ifndef OPENSSL_NO_DSA
else if (pkey->type == EVP_PKEY_DSA)
if (pkey->type == EVP_PKEY_DSA)
return(BN_num_bits(pkey->pkey.dsa->p));
#endif
#ifndef OPENSSL_NO_ECDSA
else if (pkey->type == EVP_PKEY_ECDSA)
{
BIGNUM *order = BN_new();
int ret;
if (!order)
{
ERR_clear_error();
return 0;
}
if (!EC_GROUP_get_order(pkey->pkey.ecdsa->group, order, NULL))
{
ERR_clear_error();
return 0;
}
ret = BN_num_bits(order);
BN_free(order);
return ret;
}
#endif
return(0);
}
@ -117,11 +92,6 @@ int EVP_PKEY_size(EVP_PKEY *pkey)
if (pkey->type == EVP_PKEY_DSA)
return(DSA_size(pkey->pkey.dsa));
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
return(ECDSA_size(pkey->pkey.ecdsa));
#endif
return(0);
}
@ -136,16 +106,6 @@ int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
pkey->save_parameters=mode;
return(ret);
}
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
{
int ret = pkey->save_parameters;
if (mode >= 0)
pkey->save_parameters = mode;
return(ret);
}
#endif
return(0);
}
@ -180,15 +140,6 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, EVP_PKEY *from)
if (to->pkey.dsa->g != NULL) BN_free(to->pkey.dsa->g);
to->pkey.dsa->g=a;
}
#endif
#ifndef OPENSSL_NO_ECDSA
if (to->type == EVP_PKEY_ECDSA)
{
if (to->pkey.ecdsa->group != NULL)
EC_GROUP_free(to->pkey.ecdsa->group);
if ((to->pkey.ecdsa->group = EC_GROUP_new(EC_GROUP_method_of(from->pkey.ecdsa->group))) == NULL) goto err;
if (!EC_GROUP_copy(to->pkey.ecdsa->group,from->pkey.ecdsa->group)) goto err;
}
#endif
return(1);
err:
@ -207,14 +158,6 @@ int EVP_PKEY_missing_parameters(EVP_PKEY *pkey)
return(1);
}
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
{
if (pkey->pkey.ecdsa->group == NULL)
return(1);
}
#endif
return(0);
}
@ -303,28 +246,6 @@ DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey)
}
#endif
#ifndef OPENSSL_NO_ECDSA
int EVP_PKEY_set1_ECDSA(EVP_PKEY *pkey, ECDSA *key)
{
int ret = EVP_PKEY_assign_ECDSA(pkey,key);
if (ret) CRYPTO_add(&key->references, 1,CRYPTO_LOCK_ECDSA);
return ret;
}
ECDSA *EVP_PKEY_get1_ECDSA(EVP_PKEY *pkey)
{
if (pkey->type != EVP_PKEY_ECDSA)
{
EVPerr(EVP_F_EVP_PKEY_GET1_ECDSA, EVP_R_EXPECTING_A_ECDSA_KEY);
return NULL;
}
CRYPTO_add(&pkey->pkey.ecdsa->references, 1, CRYPTO_LOCK_ECDSA);
return pkey->pkey.ecdsa;
}
#endif
#ifndef OPENSSL_NO_DH
int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key)
@ -361,8 +282,6 @@ int EVP_PKEY_type(int type)
return(EVP_PKEY_DSA);
case EVP_PKEY_DH:
return(EVP_PKEY_DH);
case EVP_PKEY_ECDSA:
return(EVP_PKEY_ECDSA);
default:
return(NID_undef);
}
@ -408,11 +327,6 @@ static void EVP_PKEY_free_it(EVP_PKEY *x)
DSA_free(x->pkey.dsa);
break;
#endif
#ifndef OPENSSL_NO_ECDSA
case EVP_PKEY_ECDSA:
ECDSA_free(x->pkey.ecdsa);
break;
#endif
#ifndef OPENSSL_NO_DH
case EVP_PKEY_DH:
DH_free(x->pkey.dh);

View File

@ -34,7 +34,7 @@ $ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
$
$ SDIRS := ,MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,-
DES,RC2,RC4,RC5,IDEA,BF,CAST,-
BN,EC,RSA,DSA,ECDSA,DH,DSO,ENGINE,AES,-
BN,EC,RSA,DSA,DH,DSO,ENGINE,AES,-
BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,-
EVP,ASN1,PEM,X509,X509V3,CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,-
UI,KRB5
@ -58,7 +58,6 @@ $ EXHEADER_BN := bn.h
$ EXHEADER_EC := ec.h
$ EXHEADER_RSA := rsa.h
$ EXHEADER_DSA := dsa.h
$ EXHEADER_ECDSA := ecdsa.h
$ EXHEADER_DH := dh.h
$ EXHEADER_DSO := dso.h
$ EXHEADER_ENGINE := engine.h

View File

@ -436,7 +436,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
unsigned long l;
unsigned char *p;
const char *s;
char tbuf[32];
char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
if (buf_len <= 0) return(0);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -500,209 +500,148 @@ personalSignature 499
dITRedirect 500
audio 501
documentPublisher 502
X9_62_id_characteristic_two_basis 503
X9_62_onBasis 504
X9_62_tpBasis 505
X9_62_ppBasis 506
X9_62_c2pnb163v1 507
X9_62_c2pnb163v2 508
X9_62_c2pnb163v3 509
X9_62_c2pnb176v1 510
X9_62_c2tnb191v1 511
X9_62_c2tnb191v2 512
X9_62_c2tnb191v3 513
X9_62_c2onb191v4 514
X9_62_c2onb191v5 515
X9_62_c2pnb208w1 516
X9_62_c2tnb239v1 517
X9_62_c2tnb239v2 518
X9_62_c2tnb239v3 519
X9_62_c2onb239v4 520
X9_62_c2onb239v5 521
X9_62_c2pnb272w1 522
X9_62_c2pnb304w1 523
X9_62_c2tnb359v1 524
X9_62_c2pnb368w1 525
X9_62_c2tnb431r1 526
identified_organization 527
certicom_arc 528
secp112r1 529
secp112r2 530
secp128r1 531
secp128r2 532
secp160k1 533
secp160r1 534
secp160r2 535
secp192k1 536
secp192r1 537
secp224k1 538
secp224r1 539
secp256k1 540
secp256r1 541
secp384r1 542
secp521r1 543
sect113r1 544
sect113r2 545
sect131r1 546
sect131r2 547
sect163k1 548
sect163r1 549
sect163r2 550
sect193r1 551
sect193r2 552
sect233k1 553
sect233r1 554
sect239k1 555
sect283k1 556
sect283r1 557
sect409k1 558
sect409r1 559
sect571k1 560
sect571r1 561
wap 562
wap_wsg 563
wap_wsg_idm_ecid_wtls1 564
wap_wsg_idm_ecid_wtls6 565
wap_wsg_idm_ecid_wtls8 566
wap_wsg_idm_ecid_wtls9 567
x500UniqueIdentifier 568
mime_mhs 569
mime_mhs_headings 570
mime_mhs_bodies 571
id_hex_partial_message 572
id_hex_multipart_message 573
generationQualifier 574
pseudonym 575
id_set 576
set_ctype 577
set_msgExt 578
set_attr 579
set_policy 580
set_certExt 581
set_brand 582
setct_PANData 583
setct_PANToken 584
setct_PANOnly 585
setct_OIData 586
setct_PI 587
setct_PIData 588
setct_PIDataUnsigned 589
setct_HODInput 590
setct_AuthResBaggage 591
setct_AuthRevReqBaggage 592
setct_AuthRevResBaggage 593
setct_CapTokenSeq 594
setct_PInitResData 595
setct_PI_TBS 596
setct_PResData 597
setct_AuthReqTBS 598
setct_AuthResTBS 599
setct_AuthResTBSX 600
setct_AuthTokenTBS 601
setct_CapTokenData 602
setct_CapTokenTBS 603
setct_AcqCardCodeMsg 604
setct_AuthRevReqTBS 605
setct_AuthRevResData 606
setct_AuthRevResTBS 607
setct_CapReqTBS 608
setct_CapReqTBSX 609
setct_CapResData 610
setct_CapRevReqTBS 611
setct_CapRevReqTBSX 612
setct_CapRevResData 613
setct_CredReqTBS 614
setct_CredReqTBSX 615
setct_CredResData 616
setct_CredRevReqTBS 617
setct_CredRevReqTBSX 618
setct_CredRevResData 619
setct_PCertReqData 620
setct_PCertResTBS 621
setct_BatchAdminReqData 622
setct_BatchAdminResData 623
setct_CardCInitResTBS 624
setct_MeAqCInitResTBS 625
setct_RegFormResTBS 626
setct_CertReqData 627
setct_CertReqTBS 628
setct_CertResData 629
setct_CertInqReqTBS 630
setct_ErrorTBS 631
setct_PIDualSignedTBE 632
setct_PIUnsignedTBE 633
setct_AuthReqTBE 634
setct_AuthResTBE 635
setct_AuthResTBEX 636
setct_AuthTokenTBE 637
setct_CapTokenTBE 638
setct_CapTokenTBEX 639
setct_AcqCardCodeMsgTBE 640
setct_AuthRevReqTBE 641
setct_AuthRevResTBE 642
setct_AuthRevResTBEB 643
setct_CapReqTBE 644
setct_CapReqTBEX 645
setct_CapResTBE 646
setct_CapRevReqTBE 647
setct_CapRevReqTBEX 648
setct_CapRevResTBE 649
setct_CredReqTBE 650
setct_CredReqTBEX 651
setct_CredResTBE 652
setct_CredRevReqTBE 653
setct_CredRevReqTBEX 654
setct_CredRevResTBE 655
setct_BatchAdminReqTBE 656
setct_BatchAdminResTBE 657
setct_RegFormReqTBE 658
setct_CertReqTBE 659
setct_CertReqTBEX 660
setct_CertResTBE 661
setct_CRLNotificationTBS 662
setct_CRLNotificationResTBS 663
setct_BCIDistributionTBS 664
setext_genCrypt 665
setext_miAuth 666
setext_pinSecure 667
setext_pinAny 668
setext_track2 669
setext_cv 670
set_policy_root 671
setCext_hashedRoot 672
setCext_certType 673
setCext_merchData 674
setCext_cCertRequired 675
setCext_tunneling 676
setCext_setExt 677
setCext_setQualf 678
setCext_PGWYcapabilities 679
setCext_TokenIdentifier 680
setCext_Track2Data 681
setCext_TokenType 682
setCext_IssuerCapabilities 683
setAttr_Cert 684
setAttr_PGWYcap 685
setAttr_TokenType 686
setAttr_IssCap 687
set_rootKeyThumb 688
set_addPolicy 689
setAttr_Token_EMV 690
setAttr_Token_B0Prime 691
setAttr_IssCap_CVM 692
setAttr_IssCap_T2 693
setAttr_IssCap_Sig 694
setAttr_GenCryptgrm 695
setAttr_T2Enc 696
setAttr_T2cleartxt 697
setAttr_TokICCsig 698
setAttr_SecDevSig 699
set_brand_IATA_ATA 700
set_brand_Diners 701
set_brand_AmericanExpress 702
set_brand_JCB 703
set_brand_Visa 704
set_brand_MasterCard 705
set_brand_Novus 706
des_cdmf 707
rsaOAEPEncryptionSET 708
x500UniqueIdentifier 503
mime_mhs 504
mime_mhs_headings 505
mime_mhs_bodies 506
id_hex_partial_message 507
id_hex_multipart_message 508
generationQualifier 509
pseudonym 510
InternationalRA 511
id_set 512
set_ctype 513
set_msgExt 514
set_attr 515
set_policy 516
set_certExt 517
set_brand 518
setct_PANData 519
setct_PANToken 520
setct_PANOnly 521
setct_OIData 522
setct_PI 523
setct_PIData 524
setct_PIDataUnsigned 525
setct_HODInput 526
setct_AuthResBaggage 527
setct_AuthRevReqBaggage 528
setct_AuthRevResBaggage 529
setct_CapTokenSeq 530
setct_PInitResData 531
setct_PI_TBS 532
setct_PResData 533
setct_AuthReqTBS 534
setct_AuthResTBS 535
setct_AuthResTBSX 536
setct_AuthTokenTBS 537
setct_CapTokenData 538
setct_CapTokenTBS 539
setct_AcqCardCodeMsg 540
setct_AuthRevReqTBS 541
setct_AuthRevResData 542
setct_AuthRevResTBS 543
setct_CapReqTBS 544
setct_CapReqTBSX 545
setct_CapResData 546
setct_CapRevReqTBS 547
setct_CapRevReqTBSX 548
setct_CapRevResData 549
setct_CredReqTBS 550
setct_CredReqTBSX 551
setct_CredResData 552
setct_CredRevReqTBS 553
setct_CredRevReqTBSX 554
setct_CredRevResData 555
setct_PCertReqData 556
setct_PCertResTBS 557
setct_BatchAdminReqData 558
setct_BatchAdminResData 559
setct_CardCInitResTBS 560
setct_MeAqCInitResTBS 561
setct_RegFormResTBS 562
setct_CertReqData 563
setct_CertReqTBS 564
setct_CertResData 565
setct_CertInqReqTBS 566
setct_ErrorTBS 567
setct_PIDualSignedTBE 568
setct_PIUnsignedTBE 569
setct_AuthReqTBE 570
setct_AuthResTBE 571
setct_AuthResTBEX 572
setct_AuthTokenTBE 573
setct_CapTokenTBE 574
setct_CapTokenTBEX 575
setct_AcqCardCodeMsgTBE 576
setct_AuthRevReqTBE 577
setct_AuthRevResTBE 578
setct_AuthRevResTBEB 579
setct_CapReqTBE 580
setct_CapReqTBEX 581
setct_CapResTBE 582
setct_CapRevReqTBE 583
setct_CapRevReqTBEX 584
setct_CapRevResTBE 585
setct_CredReqTBE 586
setct_CredReqTBEX 587
setct_CredResTBE 588
setct_CredRevReqTBE 589
setct_CredRevReqTBEX 590
setct_CredRevResTBE 591
setct_BatchAdminReqTBE 592
setct_BatchAdminResTBE 593
setct_RegFormReqTBE 594
setct_CertReqTBE 595
setct_CertReqTBEX 596
setct_CertResTBE 597
setct_CRLNotificationTBS 598
setct_CRLNotificationResTBS 599
setct_BCIDistributionTBS 600
setext_genCrypt 601
setext_miAuth 602
setext_pinSecure 603
setext_pinAny 604
setext_track2 605
setext_cv 606
set_policy_root 607
setCext_hashedRoot 608
setCext_certType 609
setCext_merchData 610
setCext_cCertRequired 611
setCext_tunneling 612
setCext_setExt 613
setCext_setQualf 614
setCext_PGWYcapabilities 615
setCext_TokenIdentifier 616
setCext_Track2Data 617
setCext_TokenType 618
setCext_IssuerCapabilities 619
setAttr_Cert 620
setAttr_PGWYcap 621
setAttr_TokenType 622
setAttr_IssCap 623
set_rootKeyThumb 624
set_addPolicy 625
setAttr_Token_EMV 626
setAttr_Token_B0Prime 627
setAttr_IssCap_CVM 628
setAttr_IssCap_T2 629
setAttr_IssCap_Sig 630
setAttr_GenCryptgrm 631
setAttr_T2Enc 632
setAttr_T2cleartxt 633
setAttr_TokICCsig 634
setAttr_SecDevSig 635
set_brand_IATA_ATA 636
set_brand_Diners 637
set_brand_AmericanExpress 638
set_brand_JCB 639
set_brand_Visa 640
set_brand_MasterCard 641
set_brand_Novus 642
des_cdmf 643
rsaOAEPEncryptionSET 644
itu_t 645
joint_iso_itu_t 646
international_organizations 647

View File

@ -6,13 +6,6 @@
iso 2 : member-body : ISO Member Body
iso 3 : identified-organization
identified-organization 132 : certicom-arc
joint-iso-ccitt 23 43 : wap
wap 13 : wap-wsg
joint-iso-ccitt 5 1 5 : selected-attribute-types : Selected Attribute Types
selected-attribute-types 55 : clearance
@ -31,34 +24,12 @@ ISO-US 10045 : ansi-X9-62 : ANSI X9.62
!Alias id-fieldType ansi-X9-62 1
X9-62_id-fieldType 1 : prime-field
X9-62_id-fieldType 2 : characteristic-two-field
X9-62_characteristic-two-field 3 : id-characteristic-two-basis
X9-62_id-characteristic-two-basis 1 : onBasis
X9-62_id-characteristic-two-basis 2 : tpBasis
X9-62_id-characteristic-two-basis 3 : ppBasis
# ... characteristic-two-field OID subtree
!Alias id-publicKeyType ansi-X9-62 2
X9-62_id-publicKeyType 1 : id-ecPublicKey
!Alias ellipticCurve ansi-X9-62 3
!Alias c-TwoCurve X9-62_ellipticCurve 0
X9-62_c-TwoCurve 1 : c2pnb163v1
X9-62_c-TwoCurve 2 : c2pnb163v2
X9-62_c-TwoCurve 3 : c2pnb163v3
X9-62_c-TwoCurve 4 : c2pnb176v1
X9-62_c-TwoCurve 5 : c2tnb191v1
X9-62_c-TwoCurve 6 : c2tnb191v2
X9-62_c-TwoCurve 7 : c2tnb191v3
X9-62_c-TwoCurve 8 : c2onb191v4
X9-62_c-TwoCurve 9 : c2onb191v5
X9-62_c-TwoCurve 10 : c2pnb208w1
X9-62_c-TwoCurve 11 : c2tnb239v1
X9-62_c-TwoCurve 12 : c2tnb239v2
X9-62_c-TwoCurve 13 : c2tnb239v3
X9-62_c-TwoCurve 14 : c2onb239v4
X9-62_c-TwoCurve 15 : c2onb239v5
X9-62_c-TwoCurve 16 : c2pnb272w1
X9-62_c-TwoCurve 17 : c2pnb304w1
X9-62_c-TwoCurve 18 : c2tnb359v1
X9-62_c-TwoCurve 19 : c2pnb368w1
X9-62_c-TwoCurve 20 : c2tnb431r1
# ... characteristic 2 curve OIDs
!Alias primeCurve X9-62_ellipticCurve 1
X9-62_primeCurve 1 : prime192v1
X9-62_primeCurve 2 : prime192v2
@ -71,49 +42,6 @@ X9-62_primeCurve 7 : prime256v1
!global
X9-62_id-ecSigType 1 : ecdsa-with-SHA1
# SECG curve OIDs from "SEC 2: Recommended Elliptic Curve Domain Parameters"
# (http://www.secg.org/)
!Alias secg_ellipticCurve certicom-arc 0
# SECG prime curves OIDs
secg-ellipticCurve 6 : secp112r1
secg-ellipticCurve 7 : secp112r2
secg-ellipticCurve 28 : secp128r1
secg-ellipticCurve 29 : secp128r2
secg-ellipticCurve 9 : secp160k1
secg-ellipticCurve 8 : secp160r1
secg-ellipticCurve 30 : secp160r2
secg-ellipticCurve 31 : secp192k1
secg-ellipticCurve 32 : secp224k1
secg-ellipticCurve 33 : secp224r1
secg-ellipticCurve 10 : secp256k1
secg-ellipticCurve 34 : secp384r1
secg-ellipticCurve 35 : secp521r1
# SECG characteristic two curves OIDs
secg-ellipticCurve 4 : sect113r1
secg-ellipticCurve 5 : sect113r2
secg-ellipticCurve 22 : sect131r1
secg-ellipticCurve 23 : sect131r2
secg-ellipticCurve 1 : sect163k1
secg-ellipticCurve 2 : sect163r1
secg-ellipticCurve 15 : sect163r2
secg-ellipticCurve 24 : sect193r1
secg-ellipticCurve 25 : sect193r2
secg-ellipticCurve 26 : sect233k1
secg-ellipticCurve 27 : sect233r1
secg-ellipticCurve 3 : sect239k1
secg-ellipticCurve 16 : sect283k1
secg-ellipticCurve 17 : sect283r1
secg-ellipticCurve 36 : sect409k1
secg-ellipticCurve 37 : sect409r1
secg-ellipticCurve 38 : sect571k1
secg-ellipticCurve 39 : sect571r1
# WAP/TLS curve OIDs (http://www.wapforum.org/)
!Alias wap-wsg-idm-ecid wap-wsg 4
wap-wsg-idm-ecid 1 : wap-wsg-idm-ecid-wtls1
wap-wsg-idm-ecid 6 : wap-wsg-idm-ecid-wtls6
wap-wsg-idm-ecid 8 : wap-wsg-idm-ecid-wtls8
wap-wsg-idm-ecid 9 : wap-wsg-idm-ecid-wtls9
ISO-US 113533 7 66 10 : CAST5-CBC : cast5-cbc

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