Commit 86d1ec05 authored by Tomáš Stefan's avatar Tomáš Stefan

documentation of modules acroform, catalog, cert

parent c612d4e3
......@@ -7,9 +7,21 @@
#include "types.h"
/** @brief Process the interactive form dictionary (AcroForm), get values from
* the Fields and SigFlags entries
*
* @param sgl context
* @return ERR_NONE if success
*/
sigil_err_t process_acroform(sigil_t *sgl);
int sigil_auxiliary_self_test(int verbosity);
/** @brief Tests for the acroform module
*
* @param verbosity output level - 0 means nothing, 1 prints module names with
* the overall module result, and 2 prints also each test inside
* of the module
* @return 0 if success, 1 if failed
*/
int sigil_acroform_self_test(int verbosity);
#endif //PDF_SIGIL_ACROFORM_H
/** @file
*
*/
#ifndef PDF_SIGIL_CATALOG_DICT_H
#define PDF_SIGIL_CATALOG_DICT_H
#include "types.h"
/** @brief Process the catalog dictionary, get value of the AcroForm entry
*
* @param sgl context
* @return ERR_NONE if success
*/
sigil_err_t process_catalog(sigil_t *sgl);
/** @brief Tests for the catalog module
*
* @param verbosity output level - 0 means nothing, 1 prints module names with
* the overall module result, and 2 prints also each test inside
* of the module
* @return 0 if success, 1 if failed
*/
int sigil_catalog_self_test(int verbosity);
#endif /* PDF_SIGIL_CATALOG_DICT_H */
/** @file
*
*/
#ifndef PDF_SIGIL_CATALOG_DICT_H
#define PDF_SIGIL_CATALOG_DICT_H
#include "types.h"
sigil_err_t process_catalog_dictionary(sigil_t *sgl);
int sigil_header_self_test(int verbosity);
#endif /* PDF_SIGIL_CATALOG_DICT_H */
......@@ -7,9 +7,21 @@
#include "types.h"
/** @brief Read the certificates in hex, the first one is the signing certificate
* and the following are for verifying the authenticity of the signing one
*
* @param sgl context
* @return ERR_NONE if success
*/
sigil_err_t parse_certs(sigil_t *sgl);
/** @brief Tests for the cert module
*
* @param verbosity output level - 0 means nothing, 1 prints module names with
* the overall module result, and 2 prints also each test inside
* of the module
* @return 0 if success, 1 if failed
*/
int sigil_cert_self_test(int verbosity);
#endif /* PDF_SIGIL_CERT_H */
......@@ -53,4 +53,22 @@ sigil_err_t process_acroform(sigil_t *sgl)
return ERR_NONE;
return err;
}
\ No newline at end of file
}
int sigil_acroform_self_test(int verbosity)
{
print_module_name("acroform", verbosity);
// place for possible later tests
// ...
// all tests done
print_module_result(1, verbosity);
return 0;
failed:
print_test_result(0, verbosity);
print_module_result(0, verbosity);
return 1;
}
#include "acroform.h"
#include "auxiliary.h"
#include "catalog_dict.h"
#include "catalog.h"
#include "constants.h"
#include "types.h"
sigil_err_t process_catalog_dictionary(sigil_t *sgl)
sigil_err_t process_catalog(sigil_t *sgl)
{
sigil_err_t err;
size_t offset;
......@@ -70,3 +70,21 @@ sigil_err_t process_catalog_dictionary(sigil_t *sgl)
return err;
}
int sigil_catalog_self_test(int verbosity)
{
print_module_name("catalog", verbosity);
// place for possible later tests
// ...
// all tests done
print_module_result(1, verbosity);
return 0;
failed:
print_test_result(0, verbosity);
print_module_result(0, verbosity);
return 1;
}
\ No newline at end of file
......@@ -127,4 +127,22 @@ sigil_err_t parse_certs(sigil_t *sgl)
if (err != ERR_NONE)
return err;
}
}
int sigil_cert_self_test(int verbosity)
{
print_module_name("cert", verbosity);
// place for possible later tests
// ...
// all tests done
print_module_result(1, verbosity);
return 0;
failed:
print_test_result(0, verbosity);
print_module_result(0, verbosity);
return 1;
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
#include <types.h>
#include "acroform.h"
#include "auxiliary.h"
#include "catalog_dict.h"
#include "catalog.h"
#include "config.h"
#include "constants.h"
#include "cryptography.h"
......@@ -295,7 +295,7 @@ sigil_err_t sigil_verify(sigil_t *sgl)
return err;
}
err = process_catalog_dictionary(sgl);
err = process_catalog(sgl);
if (err != ERR_NONE)
return err;
......
#include <stdio.h>
#include <string.h>
#include "acroform.h"
#include "auxiliary.h"
#include "catalog.h"
#include "cert.h"
#include "config.h"
#include "header.h"
#include "sigil.h"
......@@ -55,6 +58,12 @@ int main(int argc, char **argv)
failed++;
if (sigil_xref_self_test(verbosity) != 0)
failed++;
if (sigil_acroform_self_test(verbosity) != 0)
failed++;
if (sigil_catalog_self_test(verbosity) != 0)
failed++;
if (sigil_cert_self_test(verbosity) != 0)
failed++;
if (sigil_sigil_self_test(verbosity) != 0)
failed++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment