This way, we guarantee that a zero is represented with one byte of data
that's set to zero.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20013)
/* We add 1 byte for signed numbers, to make space for a sign extension */
if (p->data_type == OSSL_PARAM_INTEGER)
bytes++;
+ /* We make sure that at least one byte is used, so zero is properly set */
+ if (bytes == 0)
+ bytes++;
p->return_size = bytes;
if (p->data == NULL)