linux/security/integrity/ima/ima_template.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013 Politecnico di Torino, Italy
 *                    TORSEC group -- https://security.polito.it
 *
 * Author: Roberto Sassu <[email protected]>
 *
 * File: ima_template.c
 *      Helpers to manage template descriptors.
 */

#include <linux/rculist.h>
#include "ima.h"
#include "ima_template_lib.h"

enum header_fields {};

static struct ima_template_desc builtin_templates[] =;

static LIST_HEAD(defined_templates);
static DEFINE_SPINLOCK(template_list);
static int template_setup_done;

static const struct ima_template_field supported_fields[] =;

/*
 * Used when restoring measurements carried over from a kexec. 'd' and 'n' don't
 * need to be accounted for since they shouldn't be defined in the same template
 * description as 'd-ng' and 'n-ng' respectively.
 */
#define MAX_TEMPLATE_NAME_LEN

static struct ima_template_desc *ima_template;
static struct ima_template_desc *ima_buf_template;

/**
 * ima_template_has_modsig - Check whether template has modsig-related fields.
 * @ima_template: IMA template to check.
 *
 * Tells whether the given template has fields referencing a file's appended
 * signature.
 */
bool ima_template_has_modsig(const struct ima_template_desc *ima_template)
{}

static int __init ima_template_setup(char *str)
{}
__setup();

static int __init ima_template_fmt_setup(char *str)
{}
__setup();

struct ima_template_desc *lookup_template_desc(const char *name)
{}

static const struct ima_template_field *
lookup_template_field(const char *field_id)
{}

static int template_fmt_size(const char *template_fmt)
{}

int template_desc_init_fields(const char *template_fmt,
			      const struct ima_template_field ***fields,
			      int *num_fields)
{}

void ima_init_template_list(void)
{}

struct ima_template_desc *ima_template_desc_current(void)
{}

struct ima_template_desc *ima_template_desc_buf(void)
{}

int __init ima_init_template(void)
{}

static struct ima_template_desc *restore_template_fmt(char *template_name)
{}

static int ima_restore_template_data(struct ima_template_desc *template_desc,
				     void *template_data,
				     int template_data_size,
				     struct ima_template_entry **entry)
{}

/* Restore the serialized binary measurement list without extending PCRs. */
int ima_restore_measurement_list(loff_t size, void *buf)
{}