"Das U-Boot" Source Tree
at jcs/rk3128 48 lines 1.2 kB view raw
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#if CONFIG_IS_ENABLED(MBEDTLS_LIB_X509) 13#include "mbedtls_options.h" 14#include <mbedtls/asn1.h> 15#include <mbedtls/oid.h> 16#endif 17 18struct pefile_context { 19#ifndef __UBOOT__ 20 unsigned header_size; 21 unsigned image_checksum_offset; 22 unsigned cert_dirent_offset; 23 unsigned n_data_dirents; 24 unsigned n_sections; 25 unsigned certs_size; 26 unsigned sig_offset; 27 unsigned sig_len; 28 const struct section_header *secs; 29#endif 30 31 /* PKCS#7 MS Individual Code Signing content */ 32 const void *digest; /* Digest */ 33 unsigned digest_len; /* Digest length */ 34 const char *digest_algo; /* Digest algorithm */ 35}; 36 37#ifndef __UBOOT__ 38#define kenter(FMT, ...) \ 39 pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__) 40#define kleave(FMT, ...) \ 41 pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__) 42#endif 43 44/* 45 * mscode_parser.c 46 */ 47extern int mscode_parse(void *_ctx, const void *content_data, size_t data_len, 48 size_t asn1hdrlen);