summaryrefslogtreecommitdiffstats
path: root/crypto/encode_decode
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/encode_decode')
-rw-r--r--crypto/encode_decode/decoder_meth.c12
-rw-r--r--crypto/encode_decode/decoder_pkey.c8
-rw-r--r--crypto/encode_decode/encoder_meth.c12
3 files changed, 20 insertions, 12 deletions
diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c
index 2f2f401b8c..6baf5836e8 100644
--- a/crypto/encode_decode/decoder_meth.c
+++ b/crypto/encode_decode/decoder_meth.c
@@ -473,19 +473,21 @@ void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
&data);
}
-void OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder,
- void (*fn)(const char *name, void *data),
- void *data)
+int OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder,
+ void (*fn)(const char *name, void *data),
+ void *data)
{
if (decoder == NULL)
- return;
+ return 0;
if (decoder->base.prov != NULL) {
OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
- ossl_namemap_doall_names(namemap, decoder->base.id, fn, data);
+ return ossl_namemap_doall_names(namemap, decoder->base.id, fn, data);
}
+
+ return 1;
}
const OSSL_PARAM *
diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c
index ca9c507582..0fff6823bd 100644
--- a/crypto/encode_decode/decoder_pkey.c
+++ b/crypto/encode_decode/decoder_pkey.c
@@ -302,8 +302,12 @@ int ossl_decoder_ctx_setup_for_pkey(OSSL_DECODER_CTX *ctx,
* If the key type is given by the caller, we only use the matching
* KEYMGMTs, otherwise we use them all.
*/
- if (keytype == NULL || EVP_KEYMGMT_is_a(keymgmt, keytype))
- EVP_KEYMGMT_names_do_all(keymgmt, collect_name, names);
+ if (keytype == NULL || EVP_KEYMGMT_is_a(keymgmt, keytype)) {
+ if (!EVP_KEYMGMT_names_do_all(keymgmt, collect_name, names)) {
+ ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
+ }
EVP_KEYMGMT_free(keymgmt);
}
diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c
index f1a6e89b83..191ca8640f 100644
--- a/crypto/encode_decode/encoder_meth.c
+++ b/crypto/encode_decode/encoder_meth.c
@@ -490,19 +490,21 @@ void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
encoder_do_one, NULL, &data);
}
-void OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
- void (*fn)(const char *name, void *data),
- void *data)
+int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
+ void (*fn)(const char *name, void *data),
+ void *data)
{
if (encoder == NULL)
- return;
+ return 0;
if (encoder->base.prov != NULL) {
OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
- ossl_namemap_doall_names(namemap, encoder->base.id, fn, data);
+ return ossl_namemap_doall_names(namemap, encoder->base.id, fn, data);
}
+
+ return 1;
}
const OSSL_PARAM *