2019-05-21 01:08:01 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2014-07-01 23:02:51 +08:00
|
|
|
/* PE Binary parser bits
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
|
|
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <crypto/pkcs7.h>
|
|
|
|
#include <crypto/hash_info.h>
|
|
|
|
|
|
|
|
struct pefile_context {
|
|
|
|
unsigned header_size;
|
|
|
|
unsigned image_checksum_offset;
|
|
|
|
unsigned cert_dirent_offset;
|
|
|
|
unsigned n_data_dirents;
|
|
|
|
unsigned n_sections;
|
|
|
|
unsigned certs_size;
|
|
|
|
unsigned sig_offset;
|
|
|
|
unsigned sig_len;
|
|
|
|
const struct section_header *secs;
|
|
|
|
|
|
|
|
/* PKCS#7 MS Individual Code Signing content */
|
|
|
|
const void *digest; /* Digest */
|
|
|
|
unsigned digest_len; /* Digest length */
|
2016-03-04 05:49:27 +08:00
|
|
|
const char *digest_algo; /* Digest algorithm */
|
2014-07-01 23:02:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define kenter(FMT, ...) \
|
|
|
|
pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)
|
|
|
|
#define kleave(FMT, ...) \
|
|
|
|
pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
|
2014-07-01 23:02:52 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* mscode_parser.c
|
|
|
|
*/
|
2016-04-06 23:14:24 +08:00
|
|
|
extern int mscode_parse(void *_ctx, const void *content_data, size_t data_len,
|
|
|
|
size_t asn1hdrlen);
|