Fix DER encoder implementations for output structures "EC" and "SM2"
authorRichard Levitte <levitte@openssl.org>
Sun, 7 Nov 2021 05:18:16 +0000 (06:18 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 9 Nov 2021 04:42:20 +0000 (05:42 +0100)
commit2d49519210ed60ed16778b4b1097b4c6880541e5
treea0626ad7fa4bcd79463e2a86e13ebd74e0b4bbba
parent09235289c377ff998964bb6b074bb2a3ad768fd2
Fix DER encoder implementations for output structures "EC" and "SM2"

These DER encoder implementations are supposed to be aliases for the
"type-specific" output structure, but were made different in so far
that they would output a "type specific" public key, which turns out
to be garbage (it called i2o_ECPublicKey()).  The "type-specific"
output structure doesn't support that, and shouldn't.

Fixes #16977

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16983)

(cherry picked from commit 2cb802e16fff3fb2c57ae664baa7bd9ce3e33805)
providers/implementations/encode_decode/encode_key2any.c