tools/header_generation/create_hdr_common.c
/***************************************************************************
 * Function	:	create_img_hash_file
 * Arguments	:	NONE
 * Return	:	SUCCESS or FAILURE
 * Description	:	Writes Image Hash to a file
 ***************************************************************************/
Function     :       create_img_hash_file
Arguments    :       NONE
Return       :       SUCCESS or FAILURE
Description  :       Writes Image Hash to a file
Function : create_img_hash_file Arguments : NONE Return : SUCCESS or FAILURE Description : Writes Image Hash to a file
int create_img_hash_file(void)
{
	int ret;
	FILE *fp;
	fp = fopen(gd.img_hash_file_name, "wb");
	if (fp == NULL) {
		printf("Error in opening the file: %s\n",
			gd.img_hash_file_name);
		return FAILURE;
	}
	ret = fwrite(gd.img_hash, 1, SHA256_DIGEST_LENGTH, fp);
	fclose(fp);
	if (ret == 0) {
		printf("Error in Writing to file");
		return FAILURE;
	}
	return SUCCESS;
}
int create_img_hash_file ( void ) { int ret ; FILE * fp ; fp = fopen ( gd . img_hash_file_name , " " ) ; if ( fp == NULL ) { printf ( " \n " , gd . img_hash_file_name ) ; return FAILURE ; } ret = fwrite ( gd . img_hash , 1 , SHA256_DIGEST_LENGTH , fp ) ; fclose ( fp ) ; if ( ret == 0 ) { printf ( " " ) ; return FAILURE ; } return SUCCESS ; }
Function     :       create_img_hash_file
 Arguments    :       NONE
 Return       :       SUCCESS or FAILURE
 Description  :       Writes Image Hash to a file
Function : create_img_hash_file Arguments : NONE Return : SUCCESS or FAILURE Description : Writes Image Hash to a file