1/* module-verify.h: module verification definitions 2 * 3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. 4 * Written by David Howells (dhowells@redhat.com) 5 * 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. 10 */ 11 12#include <linux/types.h> 13#include <asm/module.h> 14 15struct module_verify_data { 16 struct crypto_tfm *digest; /* module signature digest */ 17 const void *buffer; /* module buffer */ 18 const Elf_Ehdr *hdr; /* ELF header */ 19 const Elf_Shdr *sections; /* ELF section table */ 20 const Elf_Sym *symbols; /* ELF symbol table */ 21 const char *secstrings; /* ELF section string table */ 22 const char *strings; /* ELF string table */ 23 size_t *secsizes; /* section size list */ 24 size_t size; /* module object size */ 25 size_t nsects; /* number of sections */ 26 size_t nsyms; /* number of symbols */ 27 size_t nstrings; /* size of strings section */ 28 size_t signed_size; /* count of bytes contributed to digest */ 29 int *canonlist; /* list of canonicalised sections */ 30 int *canonmap; /* section canonicalisation map */ 31 int sig_index; /* module signature section index */ 32 uint8_t xcsum; /* checksum of bytes contributed to digest */ 33 uint8_t csum; /* checksum of bytes representing a section */ 34}; 35 36extern int module_verify(const Elf_Ehdr *hdr, size_t size); 37extern int module_verify_signature(struct module_verify_data *mvdata); 38

