openssl/0014-Return0-OPENSSL-init-crypto-cleanup.patch
Sahana Prasad e863fff325 Fix reading SPKAC data from stdin
Fix incorrect OSSL_PKEY_PARAM_MAX_SIZE for ed25519 and ed448
Return 0 after cleanup in OPENSSL_init_crypto()
Cleanup the peer point formats on regotiation
Fix default digest to SHA256

Resolves: rhbz#1958045, rhbz#1952850, rhbz#1961687
Related: rhbz#1958033
Signed-off-by: Sahana Prasad <sahana@redhat.com>
2021-06-04 11:07:23 +02:00

35 lines
1.3 KiB
Diff

diff -up openssl-3.0.0-alpha16/crypto/init.c.softhsm openssl-3.0.0-alpha16/crypto/init.c
--- openssl-3.0.0-alpha16/crypto/init.c.softhsm 2021-06-04 09:40:22.637748149 +0200
+++ openssl-3.0.0-alpha16/crypto/init.c 2021-06-04 09:44:09.695867437 +0200
@@ -454,6 +454,13 @@ int OPENSSL_init_crypto(uint64_t opts, c
uint64_t tmp;
int aloaddone = 0;
+ /* Applications depend on 0 being returned when cleanup was already done */
+ if (stopped) {
+ if (!(opts & OPENSSL_INIT_BASE_ONLY))
+ ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
+ return 0;
+ }
+
/*
* We ignore failures from this function. It is probably because we are
* on a platform that doesn't support lockless atomic loads (we may not
@@ -476,15 +483,7 @@ int OPENSSL_init_crypto(uint64_t opts, c
/*
* At some point we should look at this function with a view to moving
* most/all of this into OSSL_LIB_CTX.
- */
-
- if (stopped) {
- if (!(opts & OPENSSL_INIT_BASE_ONLY))
- ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
- return 0;
- }
-
- /*
+ *
* When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
* *only* option specified. With that option we return immediately after
* doing the requested limited initialization. Note that