
/*
 * =====================================================================================
 *
 *       Filename:  hdm_response.h
 *
 *    Description:  HDM response functions
 *
 *        Version:  1.0
 *        Created:  09/16/2019 15:26:11 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *        Company:  Samsung Electronics
 *        Copyright (c) 2015 by Samsung Electronics, All rights reserved.
 *
 * =====================================================================================
 */

#ifndef _HDM_RESPONSE_H_
#define _HDM_RESPONSE_H_

/**
 * Conditional includes
 */
// #ifdef CONFIG_QSEE
// #include "tz_iccc_comdef.h"
// #else
// #include "debug_log.h"
// #include "Iccc_Interface.h"
// #include "icccOperations.h"
// #endif

/**
 * HDM includes
 */
#include "tz_hdm_interface.h"
#include "hdm_defs.h"
#include "hdm_jws.h"
#include "hdm_rpmb.h"
#include "hdm_utils.h"
#include "hdm_x509.h"
#include "hdm_core.h"
#include "hdm_drk.h"
#include "hdm_wrapper.h"
#include "hdm_json.h"

/**
 * External includes
 */
#include <openssl/base.h>

/**
 * Device Status Values Definitions
 */
#define DEVICE_BLOCK_VALUE     "device"
#define COMPROMISE_BLOCK_VALUE "compromise"
#define DEFAULT_BLOCK_VALUE    "default"

/**
 * @brief
 * hdm_generate_response
 * Generates the response jws for a policy update.
 * 
 * @param[in]      command_id - command id
 * @param[in]     *tci_msg    - tci message
 * @param[in]      res_code   - the response code
 * @param[out]     buf        - the buffer to write the response jws
 * @param[in|out] *buf_size   - the size of buf as input, the number of bytes written to buf as output
 *
 * @return Status Code
*/
hdm_return_code_t hdm_generate_response(uint32_t command_id, tci_message_t *tci_msg, uint32_t res_code, uint8_t buffer[], uint32_t *buffer_size);

#endif /* _HDM_RESPONSE_H_ */
