diff options
author | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-07-28 15:17:14 +0900 |
---|---|---|
committer | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-07-28 15:17:14 +0900 |
commit | 1ca1a139b4c1a00de4d72f64b7411e118111a161 (patch) | |
tree | 2c93e5dbce5b42d1efd45520b1c8cd50b6bf6998 /src/openssl/app.c | |
parent | fe8ea3dba5971ab3f47090ba52d7f824c3d23545 (diff) | |
parent | d4d35351fd63a7051a7cbef2002cb0c641925ec3 (diff) | |
download | xmlsec1-1ca1a139b4c1a00de4d72f64b7411e118111a161.tar.gz xmlsec1-1ca1a139b4c1a00de4d72f64b7411e118111a161.tar.bz2 xmlsec1-1ca1a139b4c1a00de4d72f64b7411e118111a161.zip |
Merge branch 'upstream' into tizen
Change-Id: Iacc73c9ed5e9cfd188df62c405426bfa89bf4e51
Diffstat (limited to 'src/openssl/app.c')
-rw-r--r-- | src/openssl/app.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/openssl/app.c b/src/openssl/app.c index 4f8f79e6..373e03a8 100644 --- a/src/openssl/app.c +++ b/src/openssl/app.c @@ -4,7 +4,7 @@ * This is free software; see Copyright file in the source * distribution for preciese wording. * - * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> + * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ #include "globals.h" @@ -19,6 +19,7 @@ #include <openssl/pem.h> #include <openssl/pkcs12.h> #include <openssl/conf.h> +#include <openssl/engine.h> #include <xmlsec/xmlsec.h> #include <xmlsec/keys.h> @@ -96,6 +97,7 @@ xmlSecOpenSSLAppInit(const char* config) { int xmlSecOpenSSLAppShutdown(void) { xmlSecOpenSSLAppSaveRANDFile(NULL); + RAND_cleanup(); EVP_cleanup(); @@ -103,14 +105,21 @@ xmlSecOpenSSLAppShutdown(void) { X509_TRUST_cleanup(); #endif /* XMLSEC_NO_X509 */ -#ifndef XMLSEC_OPENSSL_096 + ENGINE_cleanup(); + CONF_modules_unload(1); + CRYPTO_cleanup_all_ex_data(); -#endif /* XMLSEC_OPENSSL_096 */ /* finally cleanup errors */ +#if defined(XMLSEC_OPENSSL_100) || defined(XMLSEC_OPENSSL_110) + ERR_remove_thread_state(NULL); +#else ERR_remove_state(0); +#endif /* defined(XMLSEC_OPENSSL_100) || defined(XMLSEC_OPENSSL_110) */ + ERR_free_strings(); + /* done */ return(0); } @@ -255,7 +264,7 @@ xmlSecOpenSSLAppKeyLoadBIO(BIO* bio, xmlSecKeyDataFormat format, } if(pKey == NULL) { /* go to start of the file and try to read public key */ - BIO_reset(bio); + (void)BIO_reset(bio); pKey = PEM_read_bio_PUBKEY(bio, NULL, XMLSEC_PTR_TO_FUNC(pem_password_cb, pwdCallback), pwdCallbackCtx); @@ -274,7 +283,7 @@ xmlSecOpenSSLAppKeyLoadBIO(BIO* bio, xmlSecKeyDataFormat format, pKey = d2i_PrivateKey_bio(bio, NULL); if(pKey == NULL) { /* go to start of the file and try to read public key */ - BIO_reset(bio); + (void)BIO_reset(bio); pKey = d2i_PUBKEY_bio(bio, NULL); if(pKey == NULL) { xmlSecError(XMLSEC_ERRORS_HERE, |