13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @file
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * IPRT - Crypto - Microsoft SPC / Authenticode.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Copyright (C) 2006-2014 Oracle Corporation
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * available from http://www.virtualbox.org. This file is free software;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * General Public License (GPL) as published by the Free Software
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * The contents of this file may alternatively be used under the terms
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * of the Common Development and Distribution License Version 1.0
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * VirtualBox OSE distribution, in which case the provisions of the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * CDDL are applicable instead of those of the GPL.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * You may elect to license modified versions of this file under the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * terms and conditions of either the GPL or the CDDL or both.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#ifndef ___iprt_crypto_spc_h
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define ___iprt_crypto_spc_h
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#include <iprt/asn1.h>
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#include <iprt/crypto/x509.h>
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#include <iprt/crypto/pkcs7.h>
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#include <iprt/md5.h>
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#include <iprt/sha.h>
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRT_C_DECLS_BEGIN
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @defgroup grp_rt_spc RTCrSpc - Microsoft Authenticode
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @ingroup grp_rt_crypto
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * PE Image page hash table, generic union.
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync *
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * @remarks This table isn't used by ldrPE.cpp, it walks the table in a generic
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * fashion using the hash size. So, we can ditch it if we feel like it.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsynctypedef union RTCRSPCPEIMAGEPAGEHASHES
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** MD5 page hashes. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync struct
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The file offset. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint32_t offFile;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The hash. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint8_t abHash[RTSHA1_HASH_SIZE];
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } aMd5[1];
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** SHA-1 page hashes. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync struct
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The file offset. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint32_t offFile;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The hash. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint8_t abHash[RTSHA1_HASH_SIZE];
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } aSha1[1];
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** SHA-256 page hashes. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync struct
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The file offset. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint32_t offFile;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The hash. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint8_t abHash[RTSHA256_HASH_SIZE];
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } aSha256[1];
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** SHA-512 page hashes. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync struct
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The file offset. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint32_t offFile;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The hash. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint8_t abHash[RTSHA512_HASH_SIZE];
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } aSha512[1];
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync} RTCRSPCPEIMAGEPAGEHASHES;
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync/** Pointer to a PE image page hash table union. */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsynctypedef RTCRSPCPEIMAGEPAGEHASHES *PRTCRSPCPEIMAGEPAGEHASHES;
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync/** Pointer to a const PE image page hash table union. */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsynctypedef RTCRSPCPEIMAGEPAGEHASHES const *PCRTCRSPCPEIMAGEPAGEHASHES;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * Serialization wrapper for raw RTCRSPCPEIMAGEPAGEHASHES data.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsynctypedef struct RTCRSPCSERIALIZEDPAGEHASHES
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The page hashes are within a set. Dunno if there could be multiple
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * entries in this set, never seen it yet, so I doubt it. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1SETCORE SetCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Octet string containing the raw data. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1OCTETSTRING RawData;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Pointer to the hash data within that string.
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * The hash algorithm is given by the object attribute type in
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * RTCRSPCSERIALIZEDOBJECTATTRIBUTE. It is generally the same as for the
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * whole image hash. */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync PCRTCRSPCPEIMAGEPAGEHASHES pData;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Field the user can use to store the number of pages in pData. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint32_t cPages;
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync} RTCRSPCSERIALIZEDPAGEHASHES;
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync/** Pointer to a serialized wrapper for page hashes. */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsynctypedef RTCRSPCSERIALIZEDPAGEHASHES *PRTCRSPCSERIALIZEDPAGEHASHES;
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync/** Pointer to a const serialized wrapper for page hashes. */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsynctypedef RTCRSPCSERIALIZEDPAGEHASHES const *PCRTCRSPCSERIALIZEDPAGEHASHES;
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSERIALIZEDPAGEHASHES, RTDECL, RTCrSpcSerializedPageHashes, SetCore.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsyncRTDECL(int) RTCrSpcSerializedPageHashes_UpdateDerivedData(PRTCRSPCSERIALIZEDPAGEHASHES pThis);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Data type selection for RTCRSPCSERIALIZEDOBJECTATTRIBUTE.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef enum RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Invalid zero entry. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_INVALID = 0,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Not present pro forma. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_NOT_PRESENT,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Unknown object. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN,
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync /** SHA-1 page hashes (pPageHashes). */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1,
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync /** SHA-256 page hashes (pPageHashes). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** End of valid values. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_END,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Blow up the type to at least 32-bits. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_32BIT_HACK
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * One serialized object attribute (PE image data).
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef struct RTCRSPCSERIALIZEDOBJECTATTRIBUTE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Sequence core. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1SEQUENCECORE SeqCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The attribute type. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1OBJID Type;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The allocation of the data type. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1ALLOCATION Allocation;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Indicates the valid value in the union. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE enmType;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Union with data format depending on the Type. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync union
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The unknown value (RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTASN1CORE pCore;
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync /** Page hashes (RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1 or
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2). */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync PRTCRSPCSERIALIZEDPAGEHASHES pPageHashes;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } u;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCSERIALIZEDOBJECTATTRIBUTE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a serialized object attribute. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCSERIALIZEDOBJECTATTRIBUTE *PRTCRSPCSERIALIZEDOBJECTATTRIBUTE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a const serialized object attribute. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCSERIALIZEDOBJECTATTRIBUTE const *PCRTCRSPCSERIALIZEDOBJECTATTRIBUTE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSERIALIZEDOBJECTATTRIBUTE, RTDECL, RTCrSpcSerializedObjectAttribute, SeqCore.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @name RTCRSPCSERIALIZEDOBJECTATTRIBUTE::Type values
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @{ */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Serialized object attribute type for page hashes version 1. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTCRSPC_PE_IMAGE_HASHES_V1_OID "1.3.6.1.4.1.311.2.3.1"
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Serialized object attribute type for page hashes version 2. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTCRSPC_PE_IMAGE_HASHES_V2_OID "1.3.6.1.4.1.311.2.3.2"
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @} */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Set of serialized object attributes (PE image data).
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1_IMPL_GEN_SET_OF_TYPEDEFS_AND_PROTOS(RTCRSPCSERIALIZEDOBJECTATTRIBUTES, RTCRSPCSERIALIZEDOBJECTATTRIBUTE, RTDECL,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCrSpcSerializedObjectAttributes);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** The UUID found in RTCRSPCSERIALIZEDOBJECT::Uuid for
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * RTCRSPCSERIALIZEDOBJECTATTRIBUTES. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTCRSPCSERIALIZEDOBJECT_UUID_STR "d586b5a6-a1b4-6624-ae05-a217da8e60d6"
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Decoded encapsulated data type selection in RTCRSPCSERIALIZEDOBJECT.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef enum RTCRSPCSERIALIZEDOBJECTTYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Invalid zero value. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTTYPE_INVALID = 0,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Serialized object attributes (RTCRSPCSERIALIZEDOBJECT_UUID_STR / pAttribs). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTTYPE_ATTRIBUTES,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** End of valid values. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTTYPE_END,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** MAke sure the type is at least 32-bit wide. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTTYPE_32BIT_HACK = 0x7fffffff
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCSERIALIZEDOBJECTTYPE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * A serialized object (PE image data).
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef struct RTCRSPCSERIALIZEDOBJECT
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Sequence core. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1SEQUENCECORE SeqCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The UUID of the data object. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1OCTETSTRING Uuid;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Serialized data object. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1OCTETSTRING SerializedData;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Indicates the valid pointer in the union. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSERIALIZEDOBJECTTYPE enmType;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Union of pointers shadowing SerializedData.pEncapsulated. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync union
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Generic core pointer. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTASN1CORE pCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Pointer to decoded data if Uuid is RTCRSPCSERIALIZEDOBJECT_UUID_STR. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTCRSPCSERIALIZEDOBJECTATTRIBUTES pData;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } u;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCSERIALIZEDOBJECT;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a serialized object (PE image data). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCSERIALIZEDOBJECT *PRTCRSPCSERIALIZEDOBJECT;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a const serialized object (PE image data). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCSERIALIZEDOBJECT const *PCRTCRSPCSERIALIZEDOBJECT;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSERIALIZEDOBJECT, RTDECL, RTCrSpcSerializedObject, SeqCore.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * RTCRSPCSTRING choices.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef enum RTCRSPCSTRINGCHOICE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Invalid zero value. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRINGCHOICE_INVALID = 0,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Not present. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRINGCHOICE_NOT_PRESENT,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** UCS-2 string (pUcs2). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRINGCHOICE_UCS2,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** ASCII string (pAscii). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRINGCHOICE_ASCII,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** End of valid values. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRINGCHOICE_END,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Blow the type up to 32-bit. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRINGCHOICE_32BIT_HACK = 0x7fffffff
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCSTRINGCHOICE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Stupid microsoft choosy string type.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef struct RTCRSPCSTRING
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Dummy core. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1DUMMY Dummy;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Allocation of what the pointer below points to. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1ALLOCATION Allocation;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Pointer choice.*/
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRINGCHOICE enmChoice;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Pointer union. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync union
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Tag 0, implicit: UCS-2 (BMP) string. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTASN1STRING pUcs2;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Tag 1, implicit: ASCII (IA5) string. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTASN1STRING pAscii;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } u;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCSTRING;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a stupid microsoft string choice. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCSTRING *PRTCRSPCSTRING;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a const stupid microsoft string choice. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCSTRING const *PCRTCRSPCSTRING;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSTRING, RTDECL, RTCrSpcString, Dummy.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * RTCRSPCSTRING choices.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef enum RTCRSPCLINKCHOICE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Invalid zero value. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE_INVALID = 0,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Not present. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE_NOT_PRESENT,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** URL (ASCII) string (pUrl). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE_URL,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Serialized object (pMoniker). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE_MONIKER,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Filename (pT2). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE_FILE,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** End of valid values. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE_END,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Blow the type up to 32-bit. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE_32BIT_HACK = 0x7fffffff
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCLINKCHOICE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * PE image data link.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef struct RTCRSPCLINK
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Dummy core. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1DUMMY Dummy;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Allocation of what the pointer below points to. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1ALLOCATION Allocation;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Pointer choice.*/
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINKCHOICE enmChoice;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Pointer union. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync union
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Tag 0, implicit: An URL encoded as an IA5 STRING. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTASN1STRING pUrl;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Tag 1, implicit: A serialized object. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTCRSPCSERIALIZEDOBJECT pMoniker;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Tag 2, explicit: The default, a file name.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Documented to be set to "<<<Obsolete>>>" when used. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync struct
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Context tag 2. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1CONTEXTTAG2 CtxTag2;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The file name string. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCSTRING File;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } *pT2;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } u;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCLINK;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Poitner to a PE image data link. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCLINK *PRTCRSPCLINK;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Poitner to a const PE image data link. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCLINK const *PCRTCRSPCLINK;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCLINK, RTDECL, RTCrSpcLink, Dummy.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#if 0 /** @todo Might not be the correct bit order. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Flag values for RTCRSPCPEIMAGEDATA::Flags and RTCRSPCPEIMAGEDATA::fFlags.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef enum RTCRSPCPEIMAGEFLAGS
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCPEIMAGEFLAGS_INCLUDE_RESOURCES = 0,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCPEIMAGEFLAGS_INCLUDE_DEBUG_INFO = 1,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCPEIMAGEFLAGS_IMPORT_ADDRESS_TABLE = 2
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCPEIMAGEFLAGS;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#endif
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Authenticode PE Image data.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef struct RTCRSPCPEIMAGEDATA
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Sequence core. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1SEQUENCECORE SeqCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** One of the RTCRSPCPEIMAGEFLAGS value, default is
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * RTCRSPCPEIMAGEFLAGS_INCLUDE_RESOURCES. Obsolete with v2 page hashes? */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1BITSTRING Flags;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Tag 0, explicit: Link to the data. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync struct
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Context tag 0. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1CONTEXTTAG0 CtxTag0;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Link to the data. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCLINK File;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } T0;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCPEIMAGEDATA;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a authenticode PE image data representation. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCPEIMAGEDATA *PRTCRSPCPEIMAGEDATA;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a const authenticode PE image data representation. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCPEIMAGEDATA const *PCRTCRSPCPEIMAGEDATA;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCPEIMAGEDATA, RTDECL, RTCrSpcPeImageData, SeqCore.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** The object ID for SpcPeImageData. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTCRSPCPEIMAGEDATA_OID "1.3.6.1.4.1.311.2.1.15"
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Data type selection for RTCRSPCATTRIBUTETYPEANDOPTIONALVALUE.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef enum RTCRSPCAAOVTYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Invalid zero entry. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCAAOVTYPE_INVALID = 0,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Not present (pro forma). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCAAOVTYPE_NOT_PRESENT,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Unknown object. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCAAOVTYPE_UNKNOWN,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** PE image data (pPeImage). */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCAAOVTYPE_PE_IMAGE_DATA,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** End of valid values. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCAAOVTYPE_END,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Blow up the type to at least 32-bits. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCAAOVTYPE_32BIT_HACK
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCAAOVTYPE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Authenticode attribute type and optional value.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Note! Spec says the value should be explicitly tagged, but in real life
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * it isn't. So, not very optional?
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef struct RTCRSPCATTRIBUTETYPEANDOPTIONALVALUE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Sequence core. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1SEQUENCECORE SeqCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** An object ID indicating the type of the value. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1OBJID Type;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Allocation of the optional data value. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1ALLOCATION Allocation;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The valid pointer. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCAAOVTYPE enmType;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The value part depends on the Type. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync union
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync {
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** RTCRSPCAAOVTYPE_UNKNOWN / Generic. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTASN1CORE pCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** RTCRSPCAAOVTYPE_PE_IMAGE_DATA / RTCRSPCPEIMAGEDATA_OID. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync PRTCRSPCPEIMAGEDATA pPeImage;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync } uValue;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCATTRIBUTETYPEANDOPTIONALVALUE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a authentication attribute type and optional value
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * representation. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCATTRIBUTETYPEANDOPTIONALVALUE *PRTCRSPCATTRIBUTETYPEANDOPTIONALVALUE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a const authentication attribute type and optional value
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * representation. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCATTRIBUTETYPEANDOPTIONALVALUE const *PCRTCRSPCATTRIBUTETYPEANDOPTIONALVALUE;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCATTRIBUTETYPEANDOPTIONALVALUE, RTDECL, RTCrSpcAttributeTypeAndOptionalValue, SeqCore.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Authenticode indirect data content.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef struct RTCRSPCINDIRECTDATACONTENT
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync{
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Sequence core. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTASN1SEQUENCECORE SeqCore;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** Additional data. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRSPCATTRIBUTETYPEANDOPTIONALVALUE Data;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync /** The whole image digest. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTCRPKCS7DIGESTINFO DigestInfo;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync} RTCRSPCINDIRECTDATACONTENT;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a authenticode indirect data content representation. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCINDIRECTDATACONTENT *PRTCRSPCINDIRECTDATACONTENT;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** Pointer to a const authenticode indirect data content representation. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsynctypedef RTCRSPCINDIRECTDATACONTENT const *PCRTCRSPCINDIRECTDATACONTENT;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCINDIRECTDATACONTENT, RTDECL, RTCrSpcIndirectDataContent, SeqCore.Asn1Core);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** The object ID for SpcIndirectDataContent. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTCRSPCINDIRECTDATACONTENT_OID "1.3.6.1.4.1.311.2.1.4"
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Check the sanity of an Authenticode SPCIndirectDataContent object.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @returns IPRT status code
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @param pIndData The Authenticode SPCIndirectDataContent to
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * check.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @param pSignedData The related signed data object.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @param fFlags RTCRSPCINDIRECTDATACONTENT_SANITY_F_XXX.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @param pErrInfo Optional error info.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTDECL(int) RTCrSpcIndirectDataContent_CheckSanityEx(PCRTCRSPCINDIRECTDATACONTENT pIndData, PCRTCRPKCS7SIGNEDDATA pSignedData,
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync uint32_t fFlags, PRTERRINFO pErrInfo);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @name RTCRSPCINDIRECTDATACONTENT_SANITY_F_XXX for RTCrSpcIndirectDataContent_CheckSanityEx.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * @{ */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** The digest hash algorithm must be known to IPRT. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTCRSPCINDIRECTDATACONTENT_SANITY_F_ONLY_KNOWN_HASH RT_BIT_32(0)
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** PE image signing, check expectations of the spec. */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTCRSPCINDIRECTDATACONTENT_SANITY_F_PE_IMAGE RT_BIT_32(1)
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @} */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/**
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * Gets the first SPC serialized object attribute in a SPC PE image.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * @returns Pointer to the attribute with the given type, NULL if not found.
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync * @param pThis The Authenticode SpcIndirectDataContent.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsyncRTDECL(PCRTCRSPCSERIALIZEDOBJECTATTRIBUTE)
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsyncRTCrSpcIndirectDataContent_GetPeImageObjAttrib(PCRTCRSPCINDIRECTDATACONTENT pThis,
72ae3c29eeae4b10f2b363d6fd090cf1e9bdd145vboxsync RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE enmType);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @} */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRT_C_DECLS_END
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#endif
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync