andre@634: #ifndef COMMON_SELFTEST_H
andre@634: #define COMMON_SELFTEST_H
andre@634: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
andre@634:  * Software engineering by Intevation GmbH
andre@634:  *
andre@634:  * This file is Free Software under the GNU GPL (v>=2)
andre@634:  * and comes with ABSOLUTELY NO WARRANTY!
andre@634:  * See LICENSE.txt for details.
andre@634:  */
andre@634: 
emanuel@1053: /** 
emanuel@1053:  * @file selftest.h 
emanuel@1053:  * @brief self test against manipulation
andre@634:  *
andre@634:  * The selftest is intended to detect untargeted manipulation or
andre@634:  * corruption of the executable. Circumvention of the selftest
andre@634:  * by targeted manipulation of the binary can, of course, not
andre@634:  * be detected.
andre@634:  */
andre@634: 
andre@634: #include <stdbool.h>
andre@634: 
andre@634: #ifdef __cplusplus
andre@634: extern "C" {
andre@634: #endif
andre@634: /** @brief check that the current process is signed by the correct certificate
andre@634:  *
andre@634:  * Checks that the certificate is signed with a valid signature and the
andre@634:  * builtin public certificate.
andre@634:  *
andre@634:  * @returns true if the selftest is successful. false on error.
andre@634:  */
andre@634: bool selftest();
andre@634: 
andre@634: #ifdef __cplusplus
andre@634: }
andre@634: #endif
andre@634: #endif // COMMON_SELFTEST_H