Skip to content

Commit

Permalink
Fix libspdm_hmac_new return type
Browse files Browse the repository at this point in the history
Fix #2961.

Signed-off-by: Steven Bellock <[email protected]>
  • Loading branch information
steven-bellock committed Jan 17, 2025
1 parent 87d6c6c commit 4cbc8b9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions library/spdm_crypt_lib/libspdm_crypt_hmac.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2022 DMTF. All rights reserved.
* Copyright 2021-2025 DMTF. All rights reserved.
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
**/

Expand All @@ -14,53 +14,53 @@ void *libspdm_hmac_new(uint32_t base_hash_algo)
return libspdm_hmac_sha256_new();
#else
LIBSPDM_ASSERT(false);
return false;
return NULL;
#endif
case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384:
#if LIBSPDM_SHA384_SUPPORT
return libspdm_hmac_sha384_new();
#else
LIBSPDM_ASSERT(false);
return false;
return NULL;
#endif
case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512:
#if LIBSPDM_SHA512_SUPPORT
return libspdm_hmac_sha512_new();
#else
LIBSPDM_ASSERT(false);
return false;
return NULL;
#endif
case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256:
#if LIBSPDM_SHA3_256_SUPPORT
return libspdm_hmac_sha3_256_new();
#else
LIBSPDM_ASSERT(false);
return false;
return NULL;
#endif
case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384:
#if LIBSPDM_SHA3_384_SUPPORT
return libspdm_hmac_sha3_384_new();
#else
LIBSPDM_ASSERT(false);
return false;
return NULL;
#endif
case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512:
#if LIBSPDM_SHA3_512_SUPPORT
return libspdm_hmac_sha3_512_new();
#else
LIBSPDM_ASSERT(false);
return false;
return NULL;
#endif
case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256:
#if LIBSPDM_SM3_256_SUPPORT
return libspdm_hmac_sm3_256_new();
#else
LIBSPDM_ASSERT(false);
return false;
return NULL;
#endif
default:
LIBSPDM_ASSERT(false);
return false;
return NULL;
}
}

Expand Down

0 comments on commit 4cbc8b9

Please sign in to comment.