LibreOffice Module onlineupdate (master) 1
|
Go to the source code of this file.
Functions | |
int | get_mar_file_info (const char *path, int *hasSignatureBlock, uint32_t *numSignatures, int *hasAdditionalBlocks, uint32_t *offsetAdditionalBlocks, uint32_t *numAdditionalBlocks) |
Determines MAR file information. More... | |
int | read_product_info_block (char *path, struct ProductInformationBlock *infoBlock) |
Reads the product info block from the MAR file's additional block section. More... | |
int | refresh_product_info_block (const char *path, struct ProductInformationBlock *infoBlock) |
Refreshes the product information block with the new information. More... | |
int | strip_signature_block (const char *src, const char *dest) |
Writes out a copy of the MAR at src but with the signature block stripped. More... | |
int | extract_signature (const char *src, uint32_t sigIndex, const char *dest) |
Extracts a signature from a MAR file, base64 encodes it, and writes it out. More... | |
int | import_signature (const char *src, uint32_t sigIndex, const char *base64SigFile, const char *dest) |
Imports a base64 encoded signature into a MAR file. More... | |
int extract_signature | ( | const char * | src, |
uint32_t | sigIndex, | ||
const char * | dest | ||
) |
Extracts a signature from a MAR file, base64 encodes it, and writes it out.
src | The path of the source MAR file |
sigIndex | The index of the signature to extract |
dest | The path of file to write the signature to |
Definition at line 489 of file mar_sign.c.
References FILE, i, ntohl(), NULL, remove(), and SIGNATURE_BLOCK_OFFSET.
Referenced by main().
int get_mar_file_info | ( | const char * | path, |
int * | hasSignatureBlock, | ||
uint32_t * | numSignatures, | ||
int * | hasAdditionalBlocks, | ||
uint32_t * | offsetAdditionalBlocks, | ||
uint32_t * | numAdditionalBlocks | ||
) |
Determines MAR file information.
path | The path of the MAR file to check. |
hasSignatureBlock | Optional out parameter specifying if the MAR file has a signature block or not. |
numSignatures | Optional out parameter for storing the number of signatures in the MAR file. |
hasAdditionalBlocks | Optional out parameter specifying if the MAR file has additional blocks or not. |
offsetAdditionalBlocks | Optional out parameter for the offset to the first additional block. Value is only valid if hasAdditionalBlocks is not equal to 0. |
numAdditionalBlocks | Optional out parameter for the number of additional blocks. Value is only valid if has_additional_blocks is not equal to 0. |
Determines MAR file information.
path | The path of the MAR file to check. |
hasSignatureBlock | Optional out parameter specifying if the MAR file has a signature block or not. |
numSignatures | Optional out parameter for storing the number of signatures in the MAR file. |
hasAdditionalBlocks | Optional out parameter specifying if the MAR file has additional blocks or not. |
offsetAdditionalBlocks | Optional out parameter for the offset to the first additional block. Value is only valid if hasAdditionalBlocks is not equal to 0. |
numAdditionalBlocks | Optional out parameter for the number of additional blocks. Value is only valid if has_additional_blocks is not equal to 0. |
Definition at line 551 of file mar_read.c.
References FILE, and get_mar_file_info_fp().
Referenced by main(), mar_repackage_and_sign(), refresh_product_info_block(), and strip_signature_block().
int import_signature | ( | const char * | src, |
uint32_t | sigIndex, | ||
const char * | base64SigFile, | ||
const char * | dest | ||
) |
Imports a base64 encoded signature into a MAR file.
src | The path of the source MAR file |
sigIndex | The index of the signature to import |
base64SigFile | A file which contains the signature to import |
dest | The path of the destination MAR file with replaced signature |
Definition at line 605 of file mar_sign.c.
References BLOCKSIZE, FILE, i, MAX_SIGNATURES, ntohl(), NULL, ReadAndWrite(), remove(), and SIGNATURE_BLOCK_OFFSET.
Referenced by main().
int read_product_info_block | ( | char * | path, |
struct ProductInformationBlock * | infoBlock | ||
) |
Reads the product info block from the MAR file's additional block section.
The caller is responsible for freeing the fields in infoBlock if the return is successful.
infoBlock | Out parameter for where to store the result to |
Definition at line 369 of file mar_read.c.
References MarFile_::fp, and mar_read_product_info_block().
Referenced by main().
int refresh_product_info_block | ( | const char * | path, |
struct ProductInformationBlock * | infoBlock | ||
) |
Refreshes the product information block with the new information.
The input MAR must not be signed or the function call will fail.
path | The path to the MAR file whose product info block should be refreshed. |
infoBlock | Out parameter for where to store the result to |
Definition at line 193 of file mar_create.c.
References FILE, get_mar_file_info(), i, mar_concat_product_info_block(), ntohl(), NULL, and PRODUCT_INFO_BLOCK_ID.
Referenced by main().
int strip_signature_block | ( | const char * | src, |
const char * | dest | ||
) |
Writes out a copy of the MAR at src but with the signature block stripped.
src | The path of the source MAR file |
dest | The path of the MAR file to write out that has no signature block |
Definition at line 255 of file mar_sign.c.
References AdjustIndexContentOffsets(), BLOCKSIZE, CryptoX_Error, FILE, get_mar_file_info(), HOST_TO_NETWORK64, htonl(), i, MAR_ID_SIZE, NETWORK_TO_HOST64, ntohl(), NULL, ReadAndWrite(), and remove().
Referenced by main().