Commit Graph

103 Commits

Author SHA1 Message Date
Richard Levitte aa01b82c69 If an engine comes up explicitely, it must also come down explicitely
In apps/apps.c, one can set up an engine with setup_engine().
However, we freed the structural reference immediately, which means
that for engines that don't already have a structural reference
somewhere else (because it has registered at least one cipher or digest
algorithm method, and therefore gets a functional reference through the
ENGINE_set_default() call), we end up returning an invalid reference.

Instead, the function release_engine() is added, and called at the end
of the routines that call setup_engine().

Originally, the ENGINE API wasn't designed for this to happen, an
engine had to register at least one algorithm method, and was
especially expected to register the algorithms corresponding to the
key types that could be stored and hidden in hardware.  However, it
turns out that some engines will not register those algorithms with
the ENGINE_set_{algo}, ENGINE_set_cipher or ENGINE_set_digest
functions, as they only want the methods to be used for keys, not as
general crypto accelerator methods.  That may cause ENGINE_set_default()
to do nothing, and no functional reference is therefore made, leading
to a premature deallocation of the engine and it thereby becoming
unavailable when trying to fetch a key.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1644)
2016-10-20 09:04:00 +02:00
Richard Levitte 10e60f26ce Fix no-des
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1748)
2016-10-19 22:54:06 +02:00
Dr. Stephen Henson 6d3b5eeb51 Support PKCS v2.0 print in pkcs12 utility.
Extended alg_print() in pkcs12 utility to support PBES2 algorithms.

RT#4588

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-19 12:32:05 +01:00
Richard Levitte b9284c75ac Check return of PEM_write_* functions and report possible errors
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1025)
(cherry picked from commit c73aa30904)
2016-05-05 11:02:57 +02:00
Viktor Dukhovni a3d74afcae Fix X509_STORE_CTX_cleanup()
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-02 11:14:05 -05:00
Dr. Stephen Henson 2aa5a2c766 Check for FIPS mode after loading config.
PR#3958

Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-12 01:02:23 +01:00
Matt Caswell ae5c8664e5 Run util/openssl-format-source -v -c .
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22 09:31:38 +00:00
Dr. Stephen Henson af908bc48b Don't use RC2 with PKCS#12 files in FIPS mode.
(cherry picked from commit cdb6c48445)
2013-06-05 15:06:02 +01:00
Dr. Stephen Henson 13e230d505 PR: 2469
Submitted by: Jim Studt <jim@studt.net>
Reviewed by: steve

Check mac is present before trying to retrieve mac iteration count.
2011-03-13 18:20:23 +00:00
Dr. Stephen Henson 4386445c18 Change STRING to OPENSSL_STRING etc as common words such
as "STRING" cause conflicts with other headers/libraries.
2009-07-27 21:08:53 +00:00
Dr. Stephen Henson 6178da0142 Update from HEAD. 2009-06-17 12:05:51 +00:00
Dr. Stephen Henson 2e5975285e Update obsolete email address... 2008-11-05 18:39:08 +00:00
Dr. Stephen Henson 8528128b2a Update from stable branch. 2008-06-26 23:27:31 +00:00
Ben Laurie 5ce278a77b More type-checking. 2008-06-04 11:01:43 +00:00
Dr. Stephen Henson e7e8f4b333 Fix another warning. 2007-09-07 13:27:40 +00:00
Bodo Möller 96afc1cfd5 Add SEED encryption algorithm.
PR: 1503
Submitted by: KISA
Reviewed by: Bodo Moeller
2007-04-23 23:48:59 +00:00
Nils Larsch 123b23fa95 fix return value of get_cert_chain()
PR: 1441
2006-12-27 09:40:52 +00:00
Nils Larsch ec1edeb5fa update pkcs12 help message + manpage
PR: 1443
Submitted by: Artem Chuprina <ran@cryptocom.ru>
2006-12-21 20:36:15 +00:00
Bodo Möller f3dea9a595 Camellia cipher, contributed by NTT
Submitted by: Masashi Fujita
Reviewed by: Bodo Moeller
2006-06-09 15:44:59 +00:00
Dr. Stephen Henson 6657b9c73a Fix warnings. 2006-05-26 13:27:58 +00:00
Dr. Stephen Henson 121dd39f9f New option to pkcs12 utility to set alternative MAC digest algorithm. 2006-05-17 18:46:22 +00:00
Dr. Stephen Henson a263253545 Don't try to print PBE information if it can't be decoded. 2006-05-17 18:24:35 +00:00
Dr. Stephen Henson fbf6643607 Bugfix: the NONE string for PBE algorithms wasn't working. 2006-05-15 13:23:15 +00:00
Nils Larsch 6e04afb8c5 include opensslconf.h if OPENSSL_NO_* is used 2005-05-31 17:36:06 +00:00
Dr. Stephen Henson b6995add5c Make -CSP option work again in pkcs12 utility by checking for
attribute in EVP_PKEY structure.
2005-05-15 00:54:45 +00:00
Nils Larsch 7d727231b7 some const fixes 2005-04-05 19:11:19 +00:00
Dr. Stephen Henson 3fee255102 Typo. 2004-11-23 21:40:10 +00:00
Dr. Stephen Henson 16df5f066a Fix memory leak. 2004-11-23 21:22:21 +00:00
Richard Levitte 875a644a90 Constify d2i, s2i, c2i and r2i functions and other associated
functions and macros.

This change has associated tags: LEVITTE_before_const and
LEVITTE_after_const.  Those will be removed when this change has been
properly reviewed.
2004-03-15 23:15:26 +00:00
Richard Levitte d420ac2c7d Use BUF_strlcpy() instead of strcpy().
Use BUF_strlcat() instead of strcat().
Use BIO_snprintf() instead of sprintf().
In some cases, keep better track of buffer lengths.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-12-27 14:40:17 +00:00
Richard Levitte 3ae70939ba Correct a lot of printing calls. Remove extra arguments... 2003-04-03 23:39:48 +00:00
Dr. Stephen Henson 33075f229e Typo. 2003-02-10 17:52:10 +00:00
Richard Levitte 0b13e9f055 Add the possibility to build without the ENGINE framework.
PR: 287
2003-01-30 17:39:26 +00:00
Richard Levitte 1c3e4a3660 EXIT() may mean return(). That's confusing, so let's have it really mean
exit() in whatever way works for the intended platform, and define
OPENSSL_EXIT() to have the old meaning (the name is of course because
it's only used in the openssl program)
2002-12-03 16:33:03 +00:00
Richard Levitte c112323dd5 This didn't get to the 0.9.8-dev thread... 2002-11-13 18:09:27 +00:00
Ben Laurie 54a656ef08 Security fixes brought forward from 0.9.7. 2002-11-13 15:43:43 +00:00
Dr. Stephen Henson 9a48b07ee4 Various enhancements to PKCS#12 code, new
medium level API, improved PKCS12_create
and additional functionality in pkcs12
utility.
2002-10-03 23:53:52 +00:00
Dr. Stephen Henson 9a2601033d Fix crahses and leaks in pkcs12 utility -chain option 2002-08-22 21:54:51 +00:00
Richard Levitte da9b972466 Make it possible to load keys from stdin, and restore that
functionality in the programs that had that before.
Part fo PR 164
2002-08-01 16:28:40 +00:00
Richard Levitte 6991bf196c Potential memory leak removed. Notified by <threaded@totalise.co.uk> 2002-04-25 10:11:21 +00:00
Dr. Stephen Henson 31188ee1a8 Fix new -aes command argument handling 2002-02-26 13:46:55 +00:00
Dr. Stephen Henson 3647bee263 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 14:01:21 +00:00
Richard Levitte b3dfaaa143 Add AES support in the applications that support -des and -des3. 2002-02-20 18:03:07 +00:00
Richard Levitte 206eb6a11d Change pkcs12 so the certificates coming from -in do not get tossed if
-certfile is given as well.
2001-12-12 16:49:02 +00:00
Geoff Thorpe 1372965e2e Reduce the header dependencies on engine.h in apps/. 2001-09-12 02:39:06 +00:00
Geoff Thorpe 79aa04ef27 Make the necessary changes to work with the recent "ex_data" overhaul.
See the commit log message for that for more information.

NB: X509_STORE_CTX's use of "ex_data" support was actually misimplemented
(initialisation by "memset" won't/can't/doesn't work). This fixes that but
requires that X509_STORE_CTX_init() be able to handle errors - so its
prototype has been changed to return 'int' rather than 'void'. All uses of
that function throughout the source code have been tracked down and
adjusted.
2001-09-01 20:02:13 +00:00
Richard Levitte 5abc8ae6f9 Make better use of load_cert, load_certs and load_key. 2001-06-25 14:00:47 +00:00
Richard Levitte 531d630b5c Provide an application-common setup function for engines and use it
everywhere.
2001-06-18 06:22:33 +00:00
Dr. Stephen Henson f2a253e0dd Add support for MS CSP Name PKCS#12 attribute. 2001-06-11 00:43:20 +00:00
Dr. Stephen Henson 1358835050 Change the EVP_somecipher() and EVP_somedigest()
functions to return constant EVP_MD and EVP_CIPHER
pointers.

Update docs.
2001-03-09 02:51:02 +00:00