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:
51
modules/verify/include/checksum.hpp
Normal file
51
modules/verify/include/checksum.hpp
Normal 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);
|
||||
@@ -15,6 +15,8 @@
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
#include <dpmdk/include/CommonModuleAPI.hpp>
|
||||
#include "commands.hpp"
|
||||
#include "checksum.hpp"
|
||||
|
||||
/**
|
||||
* @brief Verifies checksums for a package file
|
||||
|
||||
Reference in New Issue
Block a user