comparison common/binverify.h @ 586:ecfd77751daf

Disambiguate enumerator values and add portable wrapper.
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 27 May 2014 16:30:58 +0000
parents f4ce4eef3b38
children facb13c578f1
comparison
equal deleted inserted replaced
585:21f8d32f2d2a 586:ecfd77751daf
21 /** 21 /**
22 * @enum bin_verify_result 22 * @enum bin_verify_result
23 * @brief Result of a verification 23 * @brief Result of a verification
24 */ 24 */
25 typedef enum { 25 typedef enum {
26 Valid = 100, /*! Could be read and signature matched */ 26 VerifyValid = 100, /*! Could be read and signature matched */
27 UnknownError = 1, /*! The expected unexpected */ 27 VerifyUnknownError = 1, /*! The expected unexpected */
28 InvalidSignature = 4, /*! Signature was invalid */ 28 VerifyInvalidSignature = 4, /*! Signature was invalid */
29 ReadFailed = 6, /*! File exists but could not read the file */ 29 VerifyReadFailed = 6, /*! File exists but could not read the file */
30 } bin_verify_result; 30 } bin_verify_result;
31 31
32 #ifdef WIN32
33 /** 32 /**
34 * @brief verify a binary 33 * @brief verify a binary
35 * 34 *
36 * This function checks that a binary is signed by a built 35 * This function checks that a binary is signed by a built
37 * in certificate. 36 * in certificate.
46 * @param[in] filename absolute null terminated UTF-8 encoded path to the file. 45 * @param[in] filename absolute null terminated UTF-8 encoded path to the file.
47 * @param[in] name_len length of the filename. 46 * @param[in] name_len length of the filename.
48 * 47 *
49 * @returns the verification result. 48 * @returns the verification result.
50 */ 49 */
50 bin_verify_result verify_binary(const char *filename, size_t name_len);
51
52 #ifdef WIN32
53 /**
54 * @brief windows implementation of verify_binary
55 */
51 bin_verify_result verify_binary_win(const char *filename, size_t name_len); 56 bin_verify_result verify_binary_win(const char *filename, size_t name_len);
52 #endif /* WIN32 */ 57 #endif /* WIN32 */
53 58
54 #ifdef __cplusplus 59 #ifdef __cplusplus
55 } 60 }

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