AKASHI Takahiro | fea4c84 | 2022-07-05 14:48:11 +0900 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | /* PE Binary parser bits |
| 3 | * |
| 4 | * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved. |
| 5 | * Written by David Howells (dhowells@redhat.com) |
| 6 | */ |
| 7 | |
| 8 | #include <crypto/pkcs7.h> |
| 9 | #ifndef __UBOOT__ |
| 10 | #include <crypto/hash_info.h> |
| 11 | #endif |
| 12 | |
| 13 | struct pefile_context { |
| 14 | #ifndef __UBOOT__ |
| 15 | unsigned header_size; |
| 16 | unsigned image_checksum_offset; |
| 17 | unsigned cert_dirent_offset; |
| 18 | unsigned n_data_dirents; |
| 19 | unsigned n_sections; |
| 20 | unsigned certs_size; |
| 21 | unsigned sig_offset; |
| 22 | unsigned sig_len; |
| 23 | const struct section_header *secs; |
| 24 | #endif |
| 25 | |
| 26 | /* PKCS#7 MS Individual Code Signing content */ |
| 27 | const void *digest; /* Digest */ |
| 28 | unsigned digest_len; /* Digest length */ |
| 29 | const char *digest_algo; /* Digest algorithm */ |
| 30 | }; |
| 31 | |
| 32 | #ifndef __UBOOT__ |
| 33 | #define kenter(FMT, ...) \ |
| 34 | pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__) |
| 35 | #define kleave(FMT, ...) \ |
| 36 | pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__) |
| 37 | #endif |
| 38 | |
| 39 | /* |
| 40 | * mscode_parser.c |
| 41 | */ |
| 42 | extern int mscode_parse(void *_ctx, const void *content_data, size_t data_len, |
| 43 | size_t asn1hdrlen); |