X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fmodule-verify.h;h=fadbf9ec9b5adb436c49c4dac4709ddfcd81bc24;hb=e8e9568327cd6722d116bcaabda81f718d451939;hp=10efab86b239916c1e4b7998c26de20c628e95cd;hpb=b8a110738d6eead9db88372cd9385d49347e4ee1;p=linux-2.6.git diff --git a/kernel/module-verify.h b/kernel/module-verify.h index 10efab86b..fadbf9ec9 100644 --- a/kernel/module-verify.h +++ b/kernel/module-verify.h @@ -9,7 +9,29 @@ * 2 of the License, or (at your option) any later version. */ -#ifdef CONFIG_MODULE_SIG -extern int module_verify_sig(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, - const char *secstrings, struct module *mod); -#endif +#include +#include + +struct module_verify_data { + struct crypto_tfm *digest; /* module signature digest */ + const void *buffer; /* module buffer */ + const Elf_Ehdr *hdr; /* ELF header */ + const Elf_Shdr *sections; /* ELF section table */ + const Elf_Sym *symbols; /* ELF symbol table */ + const char *secstrings; /* ELF section string table */ + const char *strings; /* ELF string table */ + size_t *secsizes; /* section size list */ + size_t size; /* module object size */ + size_t nsects; /* number of sections */ + size_t nsyms; /* number of symbols */ + size_t nstrings; /* size of strings section */ + size_t signed_size; /* count of bytes contributed to digest */ + int *canonlist; /* list of canonicalised sections */ + int *canonmap; /* section canonicalisation map */ + int sig_index; /* module signature section index */ + uint8_t xcsum; /* checksum of bytes contributed to digest */ + uint8_t csum; /* checksum of bytes representing a section */ +}; + +extern int module_verify(const Elf_Ehdr *hdr, size_t size); +extern int module_verify_signature(struct module_verify_data *mvdata);