aheinecke@4: aheinecke@4: #include aheinecke@4: aheinecke@4: /** aheinecke@4: * @file listutil.h aheinecke@4: * @brief Functions to work with the certificate list. aheinecke@4: * aheinecke@4: * This file definies the function aheinecke@4: */ aheinecke@4: aheinecke@4: /* Status of the List Operations */ aheinecke@4: typedef enum { aheinecke@4: Unknown = 0, // Not yet parsed aheinecke@4: UnknownError = 1, // The expected unexpected aheinecke@4: TooLarge = 2, // Failed because the file exeeds the limit aheinecke@4: InvalidFormat = 3, // File does not appear to be in list format aheinecke@4: InvalidSignature = 4, // Signature was invalid aheinecke@4: StatFailed = 5, // Could not stat the file aheinecke@4: ReadFailed = 6, // Could not read the file aheinecke@4: IncompatibleVersion = 7, // The Format Version does not match aheinecke@4: Valid = 8 // List is valid aheinecke@4: } list_status_t; aheinecke@4: aheinecke@4: /** aheinecke@4: * @brief Obtain the complete and verified Certificate list. aheinecke@4: * aheinecke@4: * This checks if the file fileName is a valid certificate aheinecke@4: * list signed by the key specified in pubkey.h aheinecke@4: * aheinecke@4: * The caller has to free data. aheinecke@4: * aheinecke@4: * @param[in] fileName Name of the file (UTF-8 encoded). aheinecke@4: * @param[out] data Newly allocated pointer to the file content. aheinecke@4: * @param[out] size Size in Bytes of the file content. aheinecke@4: * aheinecke@4: * @return status of the operation. aheinecke@4: */ aheinecke@4: list_status_t readAndVerifyList(char* fileName, void *data, size_t *size); aheinecke@4: