Fix input checks wrt legacy code
authorSimo Sorce <simo@redhat.com>
Fri, 24 May 2019 21:35:04 +0000 (17:35 -0400)
committerPauli <paul.dale@oracle.com>
Sun, 26 May 2019 22:05:36 +0000 (08:05 +1000)
commitd4d89a076262aa118c07a4766daf17202aef17f0
tree73dc5702db13fb2fd830cdfaf63648df58743054
parent2e9d61ecd81a6a512a0700486ccc1b3784b4c969
Fix input checks wrt legacy code

In all legacy code ctx->cipher is dereferenced without checks, so it
makes no sense to jump there is ctx->cipher is NULL as it will just lead
to a crash. Catch it separately and return an error.

This is simlar to the fix in d2c2e49eab69c7446c1c2c7227f63f8618ca99a5

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9002)
crypto/evp/evp_enc.c