aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-10-26 13:08:54 +0100
committerRichard Levitte <levitte@openssl.org>2020-11-11 11:42:06 +0100
commit67c91ca23eae175a08f0f0c60be6e6957334d25e (patch)
tree0be1bcc38d78ca44d8ae714fd1d913f99ac568a4 /crypto
parentebfdb63d96496274106b4192fda6039cbb272bae (diff)
downloadopenssl-67c91ca23eae175a08f0f0c60be6e6957334d25e.zip
openssl-67c91ca23eae175a08f0f0c60be6e6957334d25e.tar.gz
openssl-67c91ca23eae175a08f0f0c60be6e6957334d25e.tar.bz2
DECODER: Add support for OSSL_FUNC_decoder_does_selection()
OSSL_FUNC_decoder_does_selection() is a dispatchable decoder implementation function that should return 1 if the given |selection| is supported by an decoder implementation and 0 if not. This can be used by libcrypto functionality to figure out if an encoder implementation should be considered or not. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13248)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/encode_decode/decoder_meth.c5
-rw-r--r--crypto/encode_decode/encoder_local.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c
index edbb140..0d389ac 100644
--- a/crypto/encode_decode/decoder_meth.c
+++ b/crypto/encode_decode/decoder_meth.c
@@ -198,6 +198,11 @@ void *ossl_decoder_from_dispatch(int id, const OSSL_ALGORITHM *algodef,
decoder->settable_ctx_params =
OSSL_FUNC_decoder_settable_ctx_params(fns);
break;
+ case OSSL_FUNC_DECODER_DOES_SELECTION:
+ if (decoder->does_selection == NULL)
+ decoder->does_selection =
+ OSSL_FUNC_decoder_does_selection(fns);
+ break;
case OSSL_FUNC_DECODER_DECODE:
if (decoder->decode == NULL)
decoder->decode = OSSL_FUNC_decoder_decode(fns);
diff --git a/crypto/encode_decode/encoder_local.h b/crypto/encode_decode/encoder_local.h
index 9378393..18cddf5 100644
--- a/crypto/encode_decode/encoder_local.h
+++ b/crypto/encode_decode/encoder_local.h
@@ -46,6 +46,7 @@ struct ossl_decoder_st {
OSSL_FUNC_decoder_gettable_params_fn *gettable_params;
OSSL_FUNC_decoder_set_ctx_params_fn *set_ctx_params;
OSSL_FUNC_decoder_settable_ctx_params_fn *settable_ctx_params;
+ OSSL_FUNC_decoder_does_selection_fn *does_selection;
OSSL_FUNC_decoder_decode_fn *decode;
OSSL_FUNC_decoder_export_object_fn *export_object;
};