Check the plaintext buffer is large enough when decrypting SM2
authorMatt Caswell <matt@openssl.org>
Fri, 13 Aug 2021 15:58:21 +0000 (16:58 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 24 Aug 2021 13:22:07 +0000 (14:22 +0100)
commitad1ca777f9702f355a2f74dc5eed713476825f23
tree2c31595c82dc9aa3757f2d3bb9209152694f61a9
parentd07036b98d2ea8b3d9a93181bd8b0cb33a6c8ba1
Check the plaintext buffer is large enough when decrypting SM2

Previously there was no check that the supplied buffer was large enough.
It was just assumed to be sufficient. Instead we should check and fail if
not.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
crypto/sm2/sm2_crypt.c