1 /* module-verify.h: module verification definitions
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/types.h>
13 #include <linux/crypto.h>
14 #include <asm/module.h>
16 #ifdef CONFIG_MODULE_VERIFY
17 struct module_verify_data {
18 struct hash_desc hash; /* module signature digest */
19 const void *buffer; /* module buffer */
20 const Elf_Ehdr *hdr; /* ELF header */
21 const Elf_Shdr *sections; /* ELF section table */
22 const Elf_Sym *symbols; /* ELF symbol table */
23 const char *secstrings; /* ELF section string table */
24 const char *strings; /* ELF string table */
25 size_t *secsizes; /* section size list */
26 size_t size; /* module object size */
27 size_t nsects; /* number of sections */
28 size_t nsyms; /* number of symbols */
29 size_t nstrings; /* size of strings section */
30 size_t signed_size; /* count of bytes contributed to digest */
31 int *canonlist; /* list of canonicalised sections */
32 int *canonmap; /* section canonicalisation map */
33 int sig_index; /* module signature section index */
34 uint8_t xcsum; /* checksum of bytes contributed to digest */
35 uint8_t csum; /* checksum of bytes representing a section */
41 extern int module_verify(const Elf_Ehdr *hdr, size_t size);
46 #ifdef CONFIG_MODULE_VERIFY_ELF
47 extern int module_verify_elf(struct module_verify_data *mvdata);
49 #define module_verify_elf(m) (0)
55 #ifdef CONFIG_MODULE_SIG
56 extern int module_verify_signature(struct module_verify_data *mvdata);
58 #define module_verify_signature(m) (0)
62 #define module_verify(h, s) (0)