struggling a little with API exposure between modules and C++ types, needs a complete overhaul for checksums -- snapshot commit -- not functional

This commit is contained in:
Chris Punches
2025-03-31 02:03:18 -04:00
parent 045294aeb6
commit 81645c6d09
11 changed files with 573 additions and 223 deletions

View File

@@ -0,0 +1,51 @@
/**
* @file checksum.hpp
* @brief Header file for package checksum verification functions
*
* Defines functions for verifying checksums of DPM package components.
*
* @copyright Copyright (c) 2025 SILO GROUP LLC
* @author Chris Punches <chris.punches@silogroup.org>
*
* Part of the Dark Horse Linux Package Manager (DPM)
*/
#pragma once
#include <string>
#include <filesystem>
#include <dpmdk/include/CommonModuleAPI.hpp>
#include "checksum.hpp"
/**
* @brief Verify the CONTENTS_MANIFEST_DIGEST file
*
* Compares checksums in manifest with actual file checksums
*
* @param stage_dir Path to the stage directory
* @param build_module Handle to the loaded build module
* @return 0 on success, non-zero on failure
*/
int checksum_verify_contents_digest(const std::string& stage_dir, void* build_module);
/**
* @brief Verify the HOOKS_DIGEST file
*
* Compares checksums in hooks digest with actual file checksums
*
* @param stage_dir Path to the stage directory
* @param build_module Handle to the loaded build module
* @return 0 on success, non-zero on failure
*/
int checksum_verify_hooks_digest(const std::string& stage_dir, void* build_module);
/**
* @brief Verify the PACKAGE_DIGEST file
*
* Calculates the combined checksum of CONTENTS_MANIFEST_DIGEST and HOOKS_DIGEST
* and compares it with the value in PACKAGE_DIGEST
*
* @param stage_dir Path to the stage directory
* @param build_module Handle to the loaded build module
* @return 0 on success, non-zero on failure
*/
int checksum_verify_package_digest(const std::string& stage_dir, void* build_module);