Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / kernel / module-verify.h
index 10efab8..fadbf9e 100644 (file)
@@ -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 <linux/types.h>
+#include <asm/module.h>
+
+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);