Skip to content

Bug: DH/ECDH key exchange tests fail on OpenSSL 3.x when salt is not used #75

@seanjin99

Description

@seanjin99

Problem/Opportunity

The testKeyExchangeDH and testKeyExchangeECDH tests with useSalt=SEC_FALSE
fail on OpenSSL 3.x. The hkdf() function in exchange.cpp passes nullptr to
EVP_PKEY_CTX_set1_hkdf_salt() when no salt is used. OpenSSL 3.x rejects a NULL
pointer even with length 0, while OpenSSL 1.1.x accepted it.

Affected tests (8 total):

  • testKeyExchangeDH(..., SEC_FALSE)
  • testKeyExchangeECDH(..., SEC_FALSE)

All pass with useSalt=SEC_TRUE.

Steps to reproduce

run sec_api_2_adapter_test

Expected Behavior

PASS

Actual Behavior

failed

Notes (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions