@@ -996,7 +996,6 @@ int semanage_module_compute_checksum(semanage_handle_t *sh,
size_t *checksum_len)
{
semanage_module_info_t *extract_info = NULL;
- Sha256Context context;
SHA256_HASH sha256_hash;
char *checksum_str;
void *data;
@@ -1018,9 +1017,7 @@ int semanage_module_compute_checksum(semanage_handle_t *sh,
semanage_module_info_destroy(sh, extract_info);
free(extract_info);
- Sha256Initialise(&context);
- Sha256Update(&context, data, data_len);
- Sha256Finalise(&context, &sha256_hash);
+ Sha256Calculate(data, data_len, &sha256_hash);
munmap(data, data_len);
@@ -180,7 +180,7 @@ void
(
Sha256Context* Context, // [in out]
void const* Buffer, // [in]
- uint32_t BufferSize // [in]
+ size_t BufferSize // [in]
)
{
uint32_t n;
@@ -282,7 +282,7 @@ void
Sha256Calculate
(
void const* Buffer, // [in]
- uint32_t BufferSize, // [in]
+ size_t BufferSize, // [in]
SHA256_HASH* Digest // [in]
)
{
@@ -58,7 +58,7 @@ void
(
Sha256Context* Context, // [in out]
void const* Buffer, // [in]
- uint32_t BufferSize // [in]
+ size_t BufferSize // [in]
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -84,6 +84,6 @@ void
Sha256Calculate
(
void const* Buffer, // [in]
- uint32_t BufferSize, // [in]
+ size_t BufferSize, // [in]
SHA256_HASH* Digest // [in]
);