/* $Id$ */
/** @file
* IPRT - Crypto - Microsoft SPC / Authenticode, Sanity Checkers.
*/
/*
* Copyright (C) 2006-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "spc-internal.h"
{
/*
* Match up the digest algorithms (page 8, v1.0).
*/
"SpcIndirectDataContent expects SignedData to have exactly one SignerInfos entries, found: %u",
"SpcIndirectDataContent expects SignedData to have exactly one DigestAlgorithms entries, found: %u",
if (RTCrX509AlgorithmIdentifier_Compare(&pIndData->DigestInfo.DigestAlgorithm, /** @todo not entirely sure about this check... */
"SpcIndirectDataContent DigestInfo and SignerInfos algorithms mismatch: %s vs %s",
"SpcIndirectDataContent DigestInfo and SignedData.DigestAlgorithms[0] mismatch: %s vs %s",
{
if (RTCrX509AlgorithmIdentifier_QueryDigestType(&pIndData->DigestInfo.DigestAlgorithm) == RTDIGESTTYPE_INVALID)
"SpcIndirectDataContent DigestAlgortihm is not known: %s",
}
uint32_t cbDigest = RTCrX509AlgorithmIdentifier_QueryDigestSize(&pIndData->DigestInfo.DigestAlgorithm);
"SpcIndirectDataContent Digest size mismatch with algorithm: %u, expected %u (%s)",
/*
* Data.
*/
{
"SpcIndirectDataContent.Data.Type is %s, expected %s (SpcPeImageData) [enmType=%d]",
"SpcIndirectDataContent.Data.uValue/PEImage is missing");
{
"SpcIndirectDataContent...MonikerT1.Uuid incorrect size: %u, expected %u.",
"SpcIndirectDataContent...MonikerT1.Uuid mismatch: %RTuuid, expected %s.",
"SpcIndirectDataContent...pMoniker->enmType=%d, expected %d.",
"SpcIndirectDataContent...pMoniker->pData is NULL.");
uint32_t cPageHashTabs = 0;
{
{
}
else
"SpcIndirectDataContent...MonikerT1 unknown attribute %u: %s.",
}
if (cPageHashTabs > 0)
"SpcIndirectDataContent...MonikerT1 multiple page hash attributes (%u).", cPageHashTabs);
}
{
/* Could check for "<<<Obsolete>>>" here, but it's really irrelevant. */
}
"SpcIndirectDataContent.Data.uValue.pPeImage->File is an URL, expected object Moniker or File.");
else
"SpcIndirectDataContent.Data.uValue.pPeImage->File has no content");
}
return VINF_SUCCESS;
}
/*
* Generate the standard core code.
*/
#include <iprt/asn1-generator-sanity.h>