]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix the decoder start type handling
authorMatt Caswell <matt@openssl.org>
Thu, 1 Oct 2020 16:17:58 +0000 (17:17 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 8 Oct 2020 11:31:00 +0000 (12:31 +0100)
If an explicit decoder start type was provided then it wasn't being
handled correctly in all cases. Specifically if a PEM start type was
provided then the decoder would fail.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13050)

crypto/encode_decode/decoder_lib.c

index ab7c5370382e8739decea1752e092c46ef32b9de..e44ca8cbd4e58a0a69f8fb56e9139544ca7c4701 100644 (file)
@@ -259,7 +259,7 @@ int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
              * on top of this one, so we don't.
              */
             if (ctx->start_input_type != NULL
-                && strcasecmp(ctx->start_input_type, input_type) != 0)
+                && strcasecmp(ctx->start_input_type, input_type) == 0)
                 continue;
 
             ERR_set_mark();