⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vlapi.c

📁 Next BIOS Source code : Extensible Firmware Interface
💻 C
📖 第 1 页 / 共 2 页
字号:
/*-----------------------------------------------------------------------
 *      File:   vlapi.c
 *
Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.

 *-----------------------------------------------------------------------
 */
/* 
 * INTEL CONFIDENTIAL 
 * This file, software, or program is supplied under the terms of a 
 * license agreement or nondisclosure agreement with Intel Corporation 
 * and may not be copied or disclosed except in accordance with the 
 * terms of that agreement. This file, software, or program contains 
 * copyrighted material and/or trade secret information of Intel 
 * Corporation, and must be treated as such. Intel reserves all rights 
 * in this material, except as the license agreement or nondisclosure 
 * agreement specifically indicate. 
 */ 
/* 
 * WARNING: EXPORT RESTRICTED. 
 * This software is subject to the U.S. Export Administration Regulations 
 * and other U.S. law, and may not be exported or re-exported to certain 
 * countries (currently Afghanistan (Taliban-controlled areas), Cuba, Iran, 
 * Iraq, Libya, North Korea, Serbia (except Kosovo), Sudan and Syria) or to 
 * persons or entities prohibited from receiving U.S. exports (including Denied 
 * Parties, Specially Designated Nationals, and entities on the Bureau of 
 * Export Administration Entity List or involved with missile technology or 
 * nuclear, chemical or biological weapons).
 */ 
/*
 * This file contains the functions that are contained in the Verification Library 
 * portion of the CSSM exported functions.
 */

#include "cssm.h"
#include "cssmport.h"
#include "internal.h"
#include "cssmvli.h"


/*---------------------------------------------------------------
 *Name: CSSM_VL_InstantiateVoFromLocation
 *
 *Description:
 *  This function calls the specified VLModule to instantiate 
 *  the specified VoIdentifier or VoName from the VoBundle available
 *  at the VoBundleLocation.  If the VoIdentifier is provided, 
 *  the VoName will be ignored, and the Vo with the specified Id
 *  will be instantiated.  If the VoIdentifier is not provided and
 *  a VoName is provided, the Vo with the specified Name will be 
 *  instantiated.  If neither the VoIdentifier nor the VoName are 
 *  provided, the behavior is indeterminite.
 *
 *Parameters: 
 *  VLHandle         (input) - The handle to the VLModule that will 
 *                             perform the instantiation
 *  VoBundleLocation (input) - The location of the bundle 
 *                             containing the Vo to instantiate.
 *  VoIdentifier     (input) - The identifier for the Vo to instantiate
 *  VoName           (input) - An alternate identifier for the 
 *                             Vo to instantiate
 *
 *Returns:
 *  non 0 - A handle to the instantiated Vo
 *  0 - an error occurred 
 *
 *----------------------------------------------------------------*/
CSSM_VO_HANDLE CSSMAPI CSSM_VL_InstantiateVoFromLocation
                                    (CSSM_VL_HANDLE VLHandle,
                                     CSSM_VL_LOCATION_PTR VoBundleLocation,
                                     CSSM_VO_UID_PTR VoIdentifier,
                                     CSSM_STRING VoName)
{
    CSSM_SPI_VL_FUNCS_PTR CallBack = NULL;

    /* CheckInit & ClearError are done in cssm_GetModuleRecord */
    /* Get the callback pointers associated with the specified handle */
    if (cssm_GetModuleRecord (VLHandle, CSSM_SERVICE_VL, 
                              (CSSM_SPI_VL_FUNCS_PTR *)&CallBack) == NULL)
        return CSSM_INVALID_HANDLE;

    /*
     * Obtain the bundle location from the registry. 
     * Call the callback function. 
     */
    if (CallBack->InstantiateVoFromLocation) {
        return CallBack->InstantiateVoFromLocation (VLHandle, VoBundleLocation, 
                                                    VoIdentifier, VoName);
    } else {
        CSSM_SetError (&CssmGUID, CSSM_FUNCTION_NOT_IMPLEMENTED);
        return CSSM_INVALID_HANDLE;
    }
}


/*---------------------------------------------------------------
 *Name: CSSM_VL_FreeVo
 *
 *Description:
 *  Allow the VLModule to cleanup all internal state information 
 *  associated with the specified instantiation.
 *
 *Parameters: 
 *  VLHandle (input) - Handle to the VLModule to perform this operation.
 *  VOHandle (input) - Handle to the Vo whose state can be freed.
 *
 *Returns:
 *  CSSM_OK - The free was successful 
 *  CSSM_FAIL - The free failed.
 *
 *----------------------------------------------------------------*/
CSSM_RETURN CSSMAPI CSSM_VL_FreeVo  (CSSM_VL_HANDLE VLHandle,
                                     CSSM_VO_HANDLE VOHandle)
{
    CSSM_SPI_VL_FUNCS_PTR CallBack = NULL;

    /* CheckInit & ClearError are done in cssm_GetModuleRecord */
    /* Get the callback pointers associated with the specified handle */
    if (cssm_GetModuleRecord (VLHandle, CSSM_SERVICE_VL, 
                              (CSSM_SPI_VL_FUNCS_PTR *)&CallBack) == NULL)
        return CSSM_FAIL;

    /*
     * Call the callback function. 
     */
    if (CallBack->FreeVo) {
        return CallBack->FreeVo (VLHandle, VOHandle);
    } else {
        CSSM_SetError (&CssmGUID, CSSM_FUNCTION_NOT_IMPLEMENTED);
        return CSSM_FAIL;
    }
}

/*---------------------------------------------------------------
 *Name: CSSM_VL_GetDoInfoByName
 *
 *Description:
 *  This function retrieves information about the specified data object
 *
 *Parameters: 
 *  VLHandle (input) - Handle to the VLModule to perform this operation.
 *  VOHandle (input) - Handle to the Vo containing the specified data object.
 *  JoinName (input) - The name of the data object whose info is requested.
 *
 *Returns:
 *  non NULL - a copy of the DoInfo for the specified data object
 *  NULL - an error occurred
 *
 *----------------------------------------------------------------*/
CSSM_VL_DO_INFO_PTR CSSMAPI CSSM_VL_GetDoInfoByName
                                    (CSSM_VL_HANDLE VLHandle,
                                     CSSM_VO_HANDLE VOHandle,
                                     const CSSM_STRING JoinName)
{
    CSSM_SPI_VL_FUNCS_PTR CallBack = NULL;

    /* CheckInit & ClearError are done in cssm_GetModuleRecord */
    /* Get the callback pointers associated with the specified handle */
    if (cssm_GetModuleRecord (VLHandle, CSSM_SERVICE_VL, 
                              (CSSM_SPI_VL_FUNCS_PTR *)&CallBack) == NULL)
        return NULL;

    /*
     * Call the callback function. 
     */
    if (CallBack->GetDoInfoByName) {
        return CallBack->GetDoInfoByName (VLHandle, VOHandle, JoinName);
    } else {
        CSSM_SetError (&CssmGUID, CSSM_FUNCTION_NOT_IMPLEMENTED);
        return NULL;
    }
}


/*---------------------------------------------------------------
 *Name: CSSM_VL_FreeDoInfos
 *
 *Description:
 *  This function frees the input structures
 *
 *Parameters: 
 *  VLHandle (input) - Handle to the VLModule to perform this operation.
 *  DoInfos (input) - The structure to be freed.
 *  NumberOfDoInfos (input) - The length of the DoInfos array.
 *
 *Returns:
 *  CSSM_OK - The free was successful.
 *  CSSM_FAIL - an error occurred.
 *
 *----------------------------------------------------------------*/
CSSM_RETURN CSSMAPI CSSM_VL_FreeDoInfos
                                    (CSSM_VL_HANDLE VLHandle,
                                     CSSM_VL_DO_INFO_PTR DoInfos,
                                     uint32 NumberOfDoInfos)
{
    CSSM_SPI_VL_FUNCS_PTR CallBack = NULL;

    /* CheckInit & ClearError are done in cssm_GetModuleRecord */
    /* Get the callback pointers associated with the specified handle */
    if (cssm_GetModuleRecord (VLHandle, CSSM_SERVICE_VL, 
                              (CSSM_SPI_VL_FUNCS_PTR *)&CallBack) == NULL)
        return CSSM_FAIL;

    /*
     * Call the callback function. 
     */
    if (CallBack->FreeDoInfos) {
        return CallBack->FreeDoInfos (VLHandle, DoInfos, NumberOfDoInfos);
    } else {
        CSSM_SetError (&CssmGUID, CSSM_FUNCTION_NOT_IMPLEMENTED);
        return CSSM_FAIL;
    }
}


/*---------------------------------------------------------------
 *Name: CSSM_VL_GetFirstSignatureInfo
 *
 *Description:
 *  This function retrieves info about the first signature over 
 *  the specified Vo.
 *
 *Parameters: 
 *  VLHandle (input) - Handle to the VLModule to perform this operation.
 *  VOHandle (input) - Handle to the Vo whose signature info is requested.
 *  SignerIteratorHandle (output) - Handle to use to obtain info 
 *                                  about additional signatures.
 *
 *Returns:
 *  non NULL - a copy of the first SignatureInfo
 *  NULL - an error occurred
 *
 *----------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -