view common/selftest.h @ 1395:a2574a029322

Fix Base 64 signature size calculation. If the signature byte size is not equally dividable by three the base 64 encoding needs three additional bytes. The value is now fixed to avoid such errors in the future.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 26 Jan 2015 13:17:32 +0100
parents 28885e8c891f
children
line wrap: on
line source
#ifndef COMMON_SELFTEST_H
#define COMMON_SELFTEST_H
/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=2)
 * and comes with ABSOLUTELY NO WARRANTY!
 * See LICENSE.txt for details.
 */

/** 
 * @file selftest.h 
 * @brief self test against manipulation
 *
 * The selftest is intended to detect untargeted manipulation or
 * corruption of the executable. Circumvention of the selftest
 * by targeted manipulation of the binary can, of course, not
 * be detected.
 */

#include <stdbool.h>
#include <time.h>

#ifdef __cplusplus
extern "C" {
#endif
/** @brief check that the current process is signed by the correct certificate
 *
 * Checks that the certificate is signed with a valid signature and the
 * builtin public certificate.
 *
 * @param[out] sig_time point this to a time_t to get the signature timestamp
 *
 * @returns true if the selftest is successful. false on error.
 */
bool selftest(time_t *sig_time);

#ifdef __cplusplus
}
#endif
#endif // COMMON_SELFTEST_H

http://wald.intevation.org/projects/trustbridge/