]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
OSSL_DECODER 'decode' function must never be NULL.
authorRichard Levitte <levitte@openssl.org>
Thu, 10 Sep 2020 11:50:54 +0000 (13:50 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 12 Sep 2020 01:53:32 +0000 (03:53 +0200)
The conditions for a valid implementation allowed the 'decode'
function to be NULL or the 'export_object' was NULL.  That condition
is changed so that 'decode' is checked to be non-NULL by itself.

Fixes #12819

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12849)

crypto/encode_decode/decoder_meth.c

index 235899b6cea0d0f2dd62a59cdab13bda34403d8f..41406df90f51f14da602e607f7ddcd7552541703 100644 (file)
@@ -215,7 +215,7 @@ void *ossl_decoder_from_dispatch(int id, const OSSL_ALGORITHM *algodef,
      */
     if (!((decoder->newctx == NULL && decoder->freectx == NULL)
           || (decoder->newctx != NULL && decoder->freectx != NULL))
-        || (decoder->decode == NULL && decoder->export_object == NULL)) {
+        || decoder->decode == NULL) {
         OSSL_DECODER_free(decoder);
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROVIDER_FUNCTIONS);
         return NULL;