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

Richard Levitte noreply at github.com
Wed Jan 11 22:54:28 UTC 2023


  Branch: refs/heads/openssl-3.0
  Home:   https://github.com/openssl/openssl
  Commit: 5601648e91d99696bc7ae37e8972c5b4b15cf832
      https://github.com/openssl/openssl/commit/5601648e91d99696bc7ae37e8972c5b4b15cf832
  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)

(cherry picked from commit b49cf273883c8d3f47542941fe5cc6cb51aec9c9)
(cherry picked from commit 2b7b7eebf9b7d01f8abab88b9ae0685f33c74b54)


  Commit: f51b4ebb07948d942cd6536fe48e325655349d97
      https://github.com/openssl/openssl/commit/f51b4ebb07948d942cd6536fe48e325655349d97
  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)

(cherry picked from commit c2ae89148343750e420b72ef1b709ebbc16e47b8)
(cherry picked from commit fcc224a3c5c868ee4c0f5ab71d2f47e7f620bc98)


  Commit: 1932e595c8061bcb8d2718eaf5fdb6038bdec631
      https://github.com/openssl/openssl/commit/1932e595c8061bcb8d2718eaf5fdb6038bdec631
  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)

(cherry picked from commit c455f87aebf245814ba58d6a398b45ca4e80d1d7)
(cherry picked from commit e33c37aead7e7dd5647d949db7be875c8fa8c137)


Compare: https://github.com/openssl/openssl/compare/7b807ad6eaa3...1932e595c806


More information about the openssl-commits mailing list