/*
 * PROCA certificate
 *
 * Copyright (C) 2018 Samsung Electronics, Inc.
 * Hryhorii Tur, <hryhorii.tur@partner.samsung.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef _LINUX_PROCA_CERTIFICATE_H
#define _LINUX_PROCA_CERTIFICATE_H

#include <linux/types.h>

#include "proca_porting.h"

struct proca_certificate {
	char *app_name;
	size_t app_name_size;

	char *five_signature_hash;
	size_t five_signature_hash_size;

	uint32_t flags;
};

int parse_proca_certificate(const char *certificate_buff,
			    const size_t buff_size,
			    struct proca_certificate *parsed_cert);

void deinit_proca_certificate(struct proca_certificate *certificate);

int compare_with_five_signature(const struct proca_certificate *certificate,
				const void *five_signature,
				const size_t five_signature_size);

int init_certificate_validation_hash(void);

int proca_certificate_copy(struct proca_certificate *dst,
			const struct proca_certificate *src);

bool is_certificate_relevant_to_task(
			const struct proca_certificate *parsed_cert,
			struct task_struct *task);

#endif //_LINUX_PROCA_CERTIFICATE_H
