[openssl/openssl] b49cf2: test/param_build_test.c: test zero BIGNUM

Richard Levitte noreply at github.com
Wed Jan 11 22:42:27 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: b49cf273883c8d3f47542941fe5cc6cb51aec9c9
      https://github.com/openssl/openssl/commit/b49cf273883c8d3f47542941fe5cc6cb51aec9c9
  Author: Richard Levitte <levitte at openssl.org>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    M test/param_build_test.c

  Log Message:
  -----------
  test/param_build_test.c: test zero BIGNUM

We also add tests where the zero bignum is the only parameter, to test what
that does with the allocated blocks that the OSSL_PARAM_BLD functionality
handles.

Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20013)


  Commit: c2ae89148343750e420b72ef1b709ebbc16e47b8
      https://github.com/openssl/openssl/commit/c2ae89148343750e420b72ef1b709ebbc16e47b8
  Author: Richard Levitte <levitte at openssl.org>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    M crypto/params.c

  Log Message:
  -----------
  In OSSL_PARAM_set_BN(), make sure that the data_size field is at least 1

This way, we guarantee that a zero is represented with one byte of data
that's set to zero.

Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20013)


  Commit: c455f87aebf245814ba58d6a398b45ca4e80d1d7
      https://github.com/openssl/openssl/commit/c455f87aebf245814ba58d6a398b45ca4e80d1d7
  Author: Richard Levitte <levitte at openssl.org>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    M crypto/param_build.c

  Log Message:
  -----------
  OSSL_PARAM_BLD and BIGNUM; ensure at least one byte is allocated

A zero BIGNUM contains zero bytes, while OSSL_PARAMs with an INTEGER (or
UNSIGNED INTEGER) data type are expected to have at least one data byte
allocated, containing a zero.  This wasn't handled correctly.

Fixes #20011

Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20013)


Compare: https://github.com/openssl/openssl/compare/174d166bc3e5...c455f87aebf2


More information about the openssl-commits mailing list