ENCODER: Don't pass libctx to OSSL_ENCODER_CTX_new_by_EVP_PKEY()
authorRichard Levitte <levitte@openssl.org>
Fri, 27 Nov 2020 06:59:02 +0000 (07:59 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 2 Dec 2020 12:36:49 +0000 (13:36 +0100)
commitcbcbac644c4679e535948e49983d335ae46c578e
tree6c4b4663f015494700064c526a953bf1ac9523b6
parent4c0d49ed414fbf19bd06198376c05a303bdbcaac
ENCODER: Don't pass libctx to OSSL_ENCODER_CTX_new_by_EVP_PKEY()

The passed 'pkey' already contains a library context, and the encoder
implementations should be found within the same context, so passing an
explicit library context seems unnecessary, and potentially dangerous.

It should be noted that it's possible to pass an EVP_PKEY with a
legacy internal key.  The condition there is that it doesn't have a
library context assigned to it, so the NULL library context is used
automatically, thus requiring that appropriate encoders are available
through that context.

Fixes #13544

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13545)
crypto/encode_decode/encoder_pkey.c
doc/man3/OSSL_ENCODER_CTX_new_by_EVP_PKEY.pod
include/openssl/encoder.h