Mercurial > trustbridge
comparison common/selftest.h @ 634:80d1a80b3e8d
Factor out selftest for better test and reviewability
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 23 Jun 2014 16:43:07 +0200 |
parents | |
children | 78798d3af8f0 |
comparison
equal
deleted
inserted
replaced
633:6c090638b2b4 | 634:80d1a80b3e8d |
---|---|
1 #ifndef COMMON_SELFTEST_H | |
2 #define COMMON_SELFTEST_H | |
3 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik | |
4 * Software engineering by Intevation GmbH | |
5 * | |
6 * This file is Free Software under the GNU GPL (v>=2) | |
7 * and comes with ABSOLUTELY NO WARRANTY! | |
8 * See LICENSE.txt for details. | |
9 */ | |
10 | |
11 /** @file self test against manipulation | |
12 * | |
13 * The selftest is intended to detect untargeted manipulation or | |
14 * corruption of the executable. Circumvention of the selftest | |
15 * by targeted manipulation of the binary can, of course, not | |
16 * be detected. | |
17 */ | |
18 | |
19 #include <stdbool.h> | |
20 | |
21 #ifdef __cplusplus | |
22 extern "C" { | |
23 #endif | |
24 /** @brief check that the current process is signed by the correct certificate | |
25 * | |
26 * Checks that the certificate is signed with a valid signature and the | |
27 * builtin public certificate. | |
28 * | |
29 * @returns true if the selftest is successful. false on error. | |
30 */ | |
31 bool selftest(); | |
32 | |
33 #ifdef __cplusplus | |
34 } | |
35 #endif | |
36 #endif // COMMON_SELFTEST_H |