verify_pefile.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* PE Binary parser bits
  2. *
  3. * Copyright (C) 2014 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 Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <crypto/pkcs7.h>
  12. #include <crypto/hash_info.h>
  13. struct pefile_context {
  14. unsigned header_size;
  15. unsigned image_checksum_offset;
  16. unsigned cert_dirent_offset;
  17. unsigned n_data_dirents;
  18. unsigned n_sections;
  19. unsigned certs_size;
  20. unsigned sig_offset;
  21. unsigned sig_len;
  22. const struct section_header *secs;
  23. /* PKCS#7 MS Individual Code Signing content */
  24. const void *digest; /* Digest */
  25. unsigned digest_len; /* Digest length */
  26. const char *digest_algo; /* Digest algorithm */
  27. };
  28. #define kenter(FMT, ...) \
  29. pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)
  30. #define kleave(FMT, ...) \
  31. pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
  32. /*
  33. * mscode_parser.c
  34. */
  35. extern int mscode_parse(void *_ctx, const void *content_data, size_t data_len,
  36. size_t asn1hdrlen);