return method;
}
+int ossl_decoder_store_cache_flush(OSSL_LIB_CTX *libctx)
+{
+ OSSL_METHOD_STORE *store = get_decoder_store(libctx);
+
+ if (store != NULL)
+ return ossl_method_store_cache_flush_all(store);
+ return 1;
+}
+
+int ossl_decoder_store_remove_all_provided(const OSSL_PROVIDER *prov)
+{
+ OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
+ OSSL_METHOD_STORE *store = get_decoder_store(libctx);
+
+ if (store != NULL)
+ return ossl_method_store_remove_all_provided(store, prov);
+ return 1;
+}
+
/*
* Library of basic method functions
*/
return method;
}
+int ossl_encoder_store_cache_flush(OSSL_LIB_CTX *libctx)
+{
+ OSSL_METHOD_STORE *store = get_encoder_store(libctx);
+
+ if (store != NULL)
+ return ossl_method_store_cache_flush_all(store);
+ return 1;
+}
+
+int ossl_encoder_store_remove_all_provided(const OSSL_PROVIDER *prov)
+{
+ OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
+ OSSL_METHOD_STORE *store = get_encoder_store(libctx);
+
+ if (store != NULL)
+ return ossl_method_store_remove_all_provided(store, prov);
+ return 1;
+}
+
/*
* Library of basic method functions
*/
#include <openssl/params.h>
#include <openssl/opensslv.h>
#include "crypto/cryptlib.h"
+#include "crypto/decoder.h" /* ossl_decoder_store_cache_flush */
+#include "crypto/encoder.h" /* ossl_encoder_store_cache_flush */
#include "crypto/evp.h" /* evp_method_store_cache_flush */
+#include "crypto/store.h" /* ossl_store_loader_store_cache_flush */
#include "crypto/rand.h"
#include "internal/nelem.h"
#include "internal/thread_once.h"
freeing = store->freeing;
CRYPTO_THREAD_unlock(store->lock);
- if (!freeing)
- return evp_method_store_cache_flush(prov->libctx);
+ if (!freeing) {
+ int acc
+ = evp_method_store_cache_flush(prov->libctx)
+#ifndef FIPS_MODULE
+ + ossl_encoder_store_cache_flush(prov->libctx)
+ + ossl_decoder_store_cache_flush(prov->libctx)
+ + ossl_store_loader_store_cache_flush(prov->libctx)
+#endif
+ ;
+
+#ifndef FIPS_MODULE
+ return acc == 4;
+#else
+ return acc == 1;
+#endif
+ }
return 1;
}
CRYPTO_THREAD_unlock(store->lock);
if (!freeing) {
+ int acc;
+
+ if (!CRYPTO_THREAD_read_lock(prov->opbits_lock))
+ return 0;
OPENSSL_free(prov->operation_bits);
prov->operation_bits = NULL;
prov->operation_bits_sz = 0;
CRYPTO_THREAD_unlock(prov->opbits_lock);
- return evp_method_store_remove_all_provided(prov);
+ acc = evp_method_store_remove_all_provided(prov)
+#ifndef FIPS_MODULE
+ + ossl_encoder_store_remove_all_provided(prov)
+ + ossl_decoder_store_remove_all_provided(prov)
+ + ossl_store_loader_store_remove_all_provided(prov)
+#endif
+ ;
+
+#ifndef FIPS_MODULE
+ return acc == 4;
+#else
+ return acc == 1;
+#endif
}
return 1;
}
return method;
}
+int ossl_store_loader_store_cache_flush(OSSL_LIB_CTX *libctx)
+{
+ OSSL_METHOD_STORE *store = get_loader_store(libctx);
+
+ if (store != NULL)
+ return ossl_method_store_cache_flush_all(store);
+ return 1;
+}
+
+int ossl_store_loader_store_remove_all_provided(const OSSL_PROVIDER *prov)
+{
+ OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
+ OSSL_METHOD_STORE *store = get_loader_store(libctx);
+
+ if (store != NULL)
+ return ossl_method_store_remove_all_provided(store, prov);
+ return 1;
+}
+
/*
* Library of basic method functions
*/
const char *propquery);
int ossl_decoder_get_number(const OSSL_DECODER *encoder);
+int ossl_decoder_store_cache_flush(OSSL_LIB_CTX *libctx);
+int ossl_decoder_store_remove_all_provided(const OSSL_PROVIDER *prov);
#endif
* https://www.openssl.org/source/license.html
*/
-#include <openssl/types.h>
+#ifndef OSSL_CRYPTO_ENCODER_H
+# define OSSL_CRYPTO_ENCODER_H
+# pragma once
+
+# include <openssl/types.h>
OSSL_ENCODER *ossl_encoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id,
const char *properties);
int ossl_encoder_get_number(const OSSL_ENCODER *encoder);
+int ossl_encoder_store_cache_flush(OSSL_LIB_CTX *libctx);
+int ossl_encoder_store_remove_all_provided(const OSSL_PROVIDER *prov);
+
+#endif
void ossl_store_cleanup_int(void);
int ossl_store_loader_get_number(const OSSL_STORE_LOADER *loader);
+int ossl_store_loader_store_cache_flush(OSSL_LIB_CTX *libctx);
+int ossl_store_loader_store_remove_all_provided(const OSSL_PROVIDER *prov);
#endif