diff --git a/src/lib/tls/tls13_pqc/hybrid_public_key.cpp b/src/lib/tls/tls13_pqc/hybrid_public_key.cpp index dd985c31145..430b7024ab9 100644 --- a/src/lib/tls/tls13_pqc/hybrid_public_key.cpp +++ b/src/lib/tls/tls13_pqc/hybrid_public_key.cpp @@ -146,7 +146,7 @@ std::vector public_value_lengths_for_group(Group_Params group) { std::vector> convert_kex_to_kem_pks(std::vector> pks) { std::vector> result; std::transform(pks.begin(), pks.end(), std::back_inserter(result), [](auto& key) -> std::unique_ptr { - BOTAN_ASSERT_NONNULL(key); + BOTAN_ARG_CHECK(key != nullptr, "Public key list contains a nullptr"); if(key->supports_operation(PublicKeyOperation::KeyAgreement) && !key->supports_operation(PublicKeyOperation::KeyEncapsulation)) { return std::make_unique(std::move(key)); @@ -160,7 +160,7 @@ std::vector> convert_kex_to_kem_pks(std::vector> convert_kex_to_kem_sks(std::vector> sks) { std::vector> result; std::transform(sks.begin(), sks.end(), std::back_inserter(result), [](auto& key) -> std::unique_ptr { - BOTAN_ASSERT_NONNULL(key); + BOTAN_ARG_CHECK(key != nullptr, "Private key list contains a nullptr"); if(key->supports_operation(PublicKeyOperation::KeyAgreement) && !key->supports_operation(PublicKeyOperation::KeyEncapsulation)) { auto ka_key = dynamic_cast(key.get());