diff options
Diffstat (limited to 'security/tf_sdk/include')
-rw-r--r-- | security/tf_sdk/include/s_type.h | 2 | ||||
-rw-r--r-- | security/tf_sdk/include/sddi.h | 85 | ||||
-rw-r--r-- | security/tf_sdk/include/smapi.h | 366 | ||||
-rw-r--r-- | security/tf_sdk/include/smapi_ex.h | 123 | ||||
-rw-r--r-- | security/tf_sdk/include/ssdi.h | 529 | ||||
-rw-r--r-- | security/tf_sdk/include/ssdi_smc_ext.h | 61 | ||||
-rw-r--r-- | security/tf_sdk/include/ssdi_v2_compat.h | 308 |
7 files changed, 1 insertions, 1473 deletions
diff --git a/security/tf_sdk/include/s_type.h b/security/tf_sdk/include/s_type.h index ae260cc4..72f2a8ac 100644 --- a/security/tf_sdk/include/s_type.h +++ b/security/tf_sdk/include/s_type.h @@ -35,7 +35,7 @@ #define __S_TYPE_H__ /* C99 integer types */ -#if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) &&(!defined(ANDROID)) +#if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) &&(!defined(__ANDROID32__)) #include <limits.h> diff --git a/security/tf_sdk/include/sddi.h b/security/tf_sdk/include/sddi.h deleted file mode 100644 index 713e0703..00000000 --- a/security/tf_sdk/include/sddi.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright(c) 2011 Trusted Logic. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name Trusted Logic nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __SDDI_H__ -#define __SDDI_H__ - -#include "ssdi.h" - -#ifndef SDDI_EXPORT -#if defined(WIN32) || defined(__ARMCC_VERSION) -#ifdef SMODULE_IMPLEMENTATION -#define SDDI_EXPORT __declspec(dllexport) -#else -#define SDDI_EXPORT __declspec(dllimport) -#endif -#elif defined(__GNUC__) -#define SDDI_EXPORT __attribute__ ((visibility ("default"))) -#else -#define SDDI_EXPORT -#endif -#endif /* !SDDI_EXPORT */ - -#ifndef SDRV_EXPORT -#if defined(WIN32) || defined(_WIN32_WCE) || defined(__ARMCC_VERSION) -#define SDRV_EXPORT __declspec(dllexport) -#elif defined(__GNUC__) -#define SDRV_EXPORT __attribute__ ((visibility ("default"))) -#else -#define SDRV_EXPORT -#endif -#endif /* !SDRV_EXPORT */ - -#define S_CACHE_OPERATION_CLEAN 0x00000001 -#define S_CACHE_OPERATION_INVALIDATE 0x00000002 -#define S_CACHE_OPERATION_CLEAN_AND_INVALIDATE 0x00000003 - -void SDDI_EXPORT *SMemGetVirtual(uint32_t nSegmentID); - -S_RESULT SDDI_EXPORT SMemGetPhysical(void* pVirtual, uint32_t* pnPhysical); - -S_RESULT SDDI_EXPORT SMemFlush( - uint32_t nSegmentID, - uint32_t nOperation); - -S_RESULT SDDI_EXPORT SMemFlushByAddress( - void* pStartAddress, - uint32_t nLength, - uint32_t nOperation); - -/*------------------------------------------------------------------------------ - Driver Common Entry Points -------------------------------------------------------------------------------*/ - -S_RESULT SDRV_EXPORT SDrvCreate(uint32_t nParam0, uint32_t nParam1); - -void SDRV_EXPORT SDrvDestroy(void); - -#endif /* #ifndef __SDDI_H__ */ diff --git a/security/tf_sdk/include/smapi.h b/security/tf_sdk/include/smapi.h deleted file mode 100644 index 2fc3e5e0..00000000 --- a/security/tf_sdk/include/smapi.h +++ /dev/null @@ -1,366 +0,0 @@ -/** - * Copyright(c) 2011 Trusted Logic. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name Trusted Logic nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * File : smapi.h - * Last-Author : Trusted Logic S.A. - * Created : March 15, 2003 - */ - -#ifndef __SMAPI_H__ -#define __SMAPI_H__ - -#ifdef __cplusplus -extern "C" { -#endif - - -/*------------------------------------------------------------------------------ - Includes -------------------------------------------------------------------------------*/ - -#include "s_type.h" -#include "s_error.h" -/*------------------------------------------------------------------------------ - SMAPI Types -------------------------------------------------------------------------------*/ - - -#ifdef SM_EXPORT_IMPLEMENTATION -#define SM_EXPORT S_DLL_EXPORT -#else -#define SM_EXPORT S_DLL_IMPORT -#endif - -typedef struct SM_PROPERTY -{ - wchar_t* pName; - wchar_t* pValue; -} SM_PROPERTY; - -typedef struct SM_TIME_LIMIT -{ - uint32_t nHighTime; - uint32_t nLowTime; -} SM_TIME_LIMIT; - -/*------------------------------------------------------------------------------ - Constants -------------------------------------------------------------------------------*/ - - -#define SM_API_VERSION 0x03000000 - -#define SM_CONTROL_MODE_USER ( (uint32_t)0x00000002 ) -#define SM_CONTROL_MODE_MANAGER ( (uint32_t)0x00000008 ) -#define SM_CONTROL_MODE_EXCLUSIVE_MANAGER ( (uint32_t)0x00000010 ) - -#define SM_LOGIN_PUBLIC ( (uint32_t)0x00000000 ) -#define SM_LOGIN_OS_IDENTIFICATION ( (uint32_t)0x00000005 ) -#define SM_LOGIN_AUTHENTICATION ( (uint32_t)0x80000000 ) -#define SM_LOGIN_AUTHENTICATION_FALLBACK_OS_IDENTIFICATION ( (uint32_t)0x80000001 ) -#define SM_LOGIN_PRIVILEGED ( (uint32_t)0x80000002 ) - -#define SM_MEMORY_ACCESS_CLIENT_WRITE_SERVICE_READ ( (uint32_t)0x00000001 ) -#define SM_MEMORY_ACCESS_CLIENT_READ_SERVICE_WRITE ( (uint32_t)0x00000002 ) - -#define SMX_MEMORY_ACCESS_DIRECT ( (uint32_t)0x80000000 ) -#define SMX_MEMORY_ACCESS_DIRECT_FORCE ( (uint32_t)0x40000000 ) - -#define SM_INFINITE_TIMEOUT ( (uint32_t)0xFFFFFFFF ) - -#define SM_NULL_ELEMENT ( (uint32_t)0xFFFFFFFF ) - -/*------------------------------------------------------------------------------ - Functions and Macros -------------------------------------------------------------------------------*/ - -SM_EXPORT SM_ERROR SMDeviceCreateContext( - const wchar_t* pDeviceName, - uint32_t nReserved, - SM_HANDLE* phDevice); - -SM_EXPORT SM_ERROR SMDeviceDeleteContext( - SM_HANDLE hDevice); - -SM_EXPORT void SMFree( - SM_HANDLE hElement, - void* pBuffer); - -SM_EXPORT SM_ERROR SMStubGetTimeLimit( - SM_HANDLE hElement, - uint32_t nTimeout, - SM_TIME_LIMIT* pTimeLimit); - -SM_EXPORT SM_ERROR SMStubPrepareOpenOperation( - SM_HANDLE hDevice, - uint32_t nLoginType, - const void* pLoginInfo, - const SM_UUID* pidService, - uint32_t nControlMode, - const SM_TIME_LIMIT* pTimeLimit, - uint32_t nReserved1, - uint32_t nReserved2, - SM_HANDLE* phClientSession, - SM_HANDLE* phParameterEncoder, - SM_HANDLE* phOperation); - -SM_EXPORT SM_ERROR SMStubPrepareInvokeOperation( - SM_HANDLE hClientSession, - uint32_t nCommandIdentifier, - const SM_TIME_LIMIT* pTimeLimit, - uint32_t nReserved1, - uint32_t nReserved2, - SM_HANDLE* phParameterEncoder, - SM_HANDLE* phOperation); - -SM_EXPORT SM_ERROR SMStubPrepareCloseOperation( - SM_HANDLE hClientSession, - uint32_t nReserved1, - uint32_t nReserved2, - SM_HANDLE* phParameterEncoder, - SM_HANDLE* phOperation); - -SM_EXPORT SM_ERROR SMStubPerformOperation( - SM_HANDLE hOperation, - uint32_t nReserved, - SM_ERROR* pnServiceErrorCode, - SM_HANDLE* phAnswerDecoder); - -SM_EXPORT SM_ERROR SMStubCancelOperation( - SM_HANDLE hOperation); - -SM_EXPORT SM_ERROR SMStubReleaseOperation( - SM_HANDLE hOperation); - -SM_EXPORT SM_ERROR SMStubAllocateSharedMemory( - SM_HANDLE hClientSession, - uint32_t nLength, - uint32_t nFlags, - uint32_t nReserved, - void** ppBlock, - SM_HANDLE* phBlockHandle); - -SM_EXPORT SM_ERROR SMStubRegisterSharedMemory( - SM_HANDLE hClientSession, - void* pBuffer, - uint32_t nBufferLength, - uint32_t nFlags, - uint32_t nReserved, - SM_HANDLE* phBlockHandle); - -SM_EXPORT SM_ERROR SMStubReleaseSharedMemory( - SM_HANDLE hBlockHandle); - -SM_EXPORT void SMStubEncoderWriteUint8( - SM_HANDLE hEncoder, - uint8_t nValue); - -SM_EXPORT void SMStubEncoderWriteUint16( - SM_HANDLE hEncoder, - uint16_t nValue); - -SM_EXPORT void SMStubEncoderWriteUint32( - SM_HANDLE hEncoder, - uint32_t nValue); - -SM_EXPORT void SMStubEncoderWriteBoolean( - SM_HANDLE hEncoder, - bool nValue); - -SM_EXPORT void SMStubEncoderWriteHandle( - SM_HANDLE hEncoder, - SM_HANDLE hValue); - -SM_EXPORT void SMStubEncoderWriteString( - SM_HANDLE hEncoder, - const wchar_t* pValue); - -SM_EXPORT void SMStubEncoderWriteUint8Array( - SM_HANDLE hEncoder, - uint32_t nArrayLength, - const uint8_t* pnArray); - -SM_EXPORT void SMStubEncoderWriteUint16Array( - SM_HANDLE hEncoder, - uint32_t nArrayLength, - const uint16_t* pnArray); - -SM_EXPORT void SMStubEncoderWriteUint32Array( - SM_HANDLE hEncoder, - uint32_t nArrayLength, - const uint32_t* pnArray); - -SM_EXPORT void SMStubEncoderWriteHandleArray( - SM_HANDLE hEncoder, - uint32_t nArrayLength, - const SM_HANDLE* pnArray); - -SM_EXPORT void SMStubEncoderWriteMemoryReference( - SM_HANDLE hEncoder, - SM_HANDLE hBlock, - uint32_t nOffset, - uint32_t nLength, - uint32_t nFlags); - -SM_EXPORT void SMStubEncoderOpenSequence( - SM_HANDLE hEncoder); - -SM_EXPORT void SMStubEncoderCloseSequence( - SM_HANDLE hEncoder); - -SM_EXPORT SM_ERROR SMStubDecoderGetError( - SM_HANDLE hDecoder); - -SM_EXPORT bool SMStubDecoderHasData( - SM_HANDLE hDecoder); - -SM_EXPORT uint8_t SMStubDecoderReadUint8( - SM_HANDLE hDecoder); - -SM_EXPORT uint16_t SMStubDecoderReadUint16( - SM_HANDLE hDecoder); - -SM_EXPORT uint32_t SMStubDecoderReadUint32( - SM_HANDLE hDecoder); - -SM_EXPORT bool SMStubDecoderReadBoolean( - SM_HANDLE hDecoder); - -SM_EXPORT SM_HANDLE SMStubDecoderReadHandle( - SM_HANDLE hDecoder); - -SM_EXPORT wchar_t* SMStubDecoderReadString( - SM_HANDLE hDecoder); - -SM_EXPORT uint8_t* SMStubDecoderReadUint8Array( - SM_HANDLE hDecoder, - uint32_t* pnArrayLength); - -SM_EXPORT uint16_t* SMStubDecoderReadUint16Array( - SM_HANDLE hDecoder, - uint32_t* pnArrayLength); - -SM_EXPORT uint32_t* SMStubDecoderReadUint32Array( - SM_HANDLE hDecoder, - uint32_t* pnArrayLength); - -SM_EXPORT SM_HANDLE* SMStubDecoderReadHandleArray( - SM_HANDLE hDecoder, - uint32_t* pnArrayLength); - -SM_EXPORT uint32_t SMStubDecoderReadArrayLength( - SM_HANDLE hDecoder); - -SM_EXPORT uint32_t SMStubDecoderCopyUint8Array( - SM_HANDLE hDecoder, - uint32_t nIndex, - uint32_t nMaxLength, - uint8_t* pArray); - -SM_EXPORT uint32_t SMStubDecoderCopyUint16Array( - SM_HANDLE hDecoder, - uint32_t nIndex, - uint32_t nMaxLength, - uint16_t* pArray); - -SM_EXPORT uint32_t SMStubDecoderCopyUint32Array( - SM_HANDLE hDecoder, - uint32_t nIndex, - uint32_t nMaxLength, - uint32_t* pArray); - -SM_EXPORT uint32_t SMStubDecoderCopyHandleArray( - SM_HANDLE hDecoder, - uint32_t nIndex, - uint32_t nMaxLength, - SM_HANDLE* pArray); - -SM_EXPORT void SMStubDecoderReadSequence( - SM_HANDLE hDecoder, - SM_HANDLE* phSequenceDecoder); - -SM_EXPORT void SMStubDecoderSkip( - SM_HANDLE hDecoder); - -SM_EXPORT SM_ERROR SMManagerOpen( - SM_HANDLE hDevice, - uint32_t nLoginType, - const void* pLoginInfo, - uint32_t nControlMode, - SM_HANDLE* phServiceManager); - -SM_EXPORT SM_ERROR SMManagerClose( - SM_HANDLE hServiceManager); - -SM_EXPORT SM_ERROR SMManagerGetAllServices( - SM_HANDLE hServiceManager, - SM_UUID** ppServiceIdentifierList, - uint32_t* pnListLength); - -SM_EXPORT SM_ERROR SMManagerGetServiceProperty( - SM_HANDLE hServiceManager, - const SM_UUID* pidService, - wchar_t* pPropertyName, - wchar_t** ppPropertyValue); - -SM_EXPORT SM_ERROR SMManagerGetAllServiceProperties( - SM_HANDLE hServiceManager, - const SM_UUID* pidService, - SM_PROPERTY** ppProperties, - uint32_t* pnPropertiesLength); - -SM_EXPORT SM_ERROR SMManagerDownloadService( - SM_HANDLE hServiceManager, - const uint8_t* pServiceCode, - uint32_t nServiceCodeSize, - SM_UUID* pidService); - -SM_EXPORT SM_ERROR SMManagerRemoveService( - SM_HANDLE hServiceManager, - const SM_UUID* pidService); - -SM_EXPORT SM_ERROR SMGetImplementationProperty( - SM_HANDLE hDevice, - const wchar_t* pPropertyName, - wchar_t** ppPropertyValue); - -SM_EXPORT SM_ERROR SMGetAllImplementationProperties( - SM_HANDLE hDevice, - SM_PROPERTY** ppProperties, - uint32_t* pnPropertiesLength); - -#include "smapi_ex.h" - -#ifdef __cplusplus -} -#endif - -#endif /* __SMAPI_H__ */ diff --git a/security/tf_sdk/include/smapi_ex.h b/security/tf_sdk/include/smapi_ex.h deleted file mode 100644 index 14444f7c..00000000 --- a/security/tf_sdk/include/smapi_ex.h +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright(c) 2011 Trusted Logic. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name Trusted Logic nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * File : smapi_ex.h - * Last-Author : Trusted Logic S.A. - * Created : April 23, 2007 - */ - -#ifndef __SMAPI_EX_H__ -#define __SMAPI_EX_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Appends the specified UUID value to the encoded data of the specified - * encoder instance. - * - * Upon error, this function sets the error state of the encoder. No other state - * is affected. - * - * This function does nothing if the error state of the encoder is set upon - * entry. - * - * @param hEncoder The handle of the encoder instance. - * - * @param pUUID A pointer to the UUID value to encode. - */ -SM_EXPORT void SMStubEncoderWriteUUID( - SM_HANDLE hEncoder, - const SM_UUID *pUUID); - -/** - * Reads the UUID value at the current offset in the encoded data parsed by the - * specified decoder instance. - * - * Upon return, the current offset of the decoder references the first item - * following the decoded item. - * - * If the decoder error state is set upon entry, the function sets the UUID - * placeholder to the nil UUID and does nothing more. - * - * @param hDecoder The handle of the decoder instance. - * - * @param pUUID A pointer to the placeholder to be set to the decoded UUID - * value. This placeholder is set to the nil UUID upon failure. - */ -SM_EXPORT void SMStubDecoderReadUUID( - SM_HANDLE hDecoder, - SM_UUID *pUUID); - -/** - * Opens a sequence in the current decoder. The current decoder must point to a - * sequence. - * - * After this function is called, the current decoder points to the first element - * of the sequence. - * - * If the error state of the decoder is set upon entry, this function does nothing. - * - * Upon error, this function sets the error state of the current decoder. - * In particular, if the decoder does not point to a sequence, the error state - * is set to S_ERROR_BAD_FORMAT. - * - * @param hDecoder A handle of the decoder instance. - * - */ -SM_EXPORT void SMStubDecoderOpenSequence( - SM_HANDLE hDecoder); - -/** - * Closes a sequence in the current decoder. At least one sequence must have been - * opened using the function {SMStubDecoderOpenSequence} - * - * When this function returns, the current decoder points to the first element - * following the current sequence. - * - * If the error state of the decoder is set upon entry, this function does nothing. - * - * Upon error, this function sets the error state of the current decoder. - * In particular, if the decoder does not point within a sequence, the error state - * is set to S_ERROR_ILLEGAL_STATE. - * - * @param hDecoder A handle of the decoder instance. - * - */ -SM_EXPORT void SMStubDecoderCloseSequence( - SM_HANDLE hDecoder); - -#ifdef __cplusplus -} -#endif - -#endif /* __SMAPI_EX_H__ */ diff --git a/security/tf_sdk/include/ssdi.h b/security/tf_sdk/include/ssdi.h deleted file mode 100644 index 256f62ed..00000000 --- a/security/tf_sdk/include/ssdi.h +++ /dev/null @@ -1,529 +0,0 @@ -/** - * Copyright(c) 2011 Trusted Logic. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name Trusted Logic nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* -* File : ssdi.h -* -* Original-Author : Trusted Logic S.A. -* -* Created : May 31, 2006 -*/ - -/** - * SSDI specification 3.0 header file. - */ - -#ifndef __SSDI_H__ -#define __SSDI_H__ - -#include "s_type.h" -#include "s_error.h" - -#ifndef SSDI_EXPORT -#ifdef SMODULE_IMPLEMENTATION -#define SSDI_EXPORT S_DLL_EXPORT -#else -#define SSDI_EXPORT S_DLL_IMPORT -#endif -#endif - -#ifndef SRVX_EXPORT -#define SRVX_EXPORT S_DLL_EXPORT -#endif - -/*------------------------------------------------------------------------------ - SSDI Types -------------------------------------------------------------------------------*/ - -typedef struct S_PROPERTY -{ - char* pName; - char* pValue ; -} S_PROPERTY; - -typedef struct S_TIME_LIMIT -{ - uint32_t nTime1; - uint32_t nTime2; -} S_TIME_LIMIT; - -typedef struct S_CALENDAR -{ - int32_t nYear; - int32_t nMonth; - int32_t nDayOfWeek; - int32_t nDay; - int32_t nHour; - int32_t nMinute; - int32_t nSecond; -} S_CALENDAR; - -typedef enum -{ - S_FILE_SEEK_SET = 0, - S_FILE_SEEK_CUR, - S_FILE_SEEK_END -} S_WHENCE; - -typedef struct S_FILE_INFO -{ - char* pName; - uint32_t nSize; - uint32_t nNameLength; -}S_FILE_INFO; - -typedef struct -{ - void* pBuffer; - uint32_t nSize; -} -S_PARAM_MEMREF; - -typedef struct -{ - uint32_t a; - uint32_t b; -} -S_PARAM_VALUE; - -typedef union -{ - S_PARAM_MEMREF memref; - S_PARAM_VALUE value; -} -S_PARAM; - - -/*------------------------------------------------------------------------------ - Constants -------------------------------------------------------------------------------*/ -#define S_TIMEOUT_INFINITE 0xFFFFFFFF - -/* storage private to the service */ -#define S_FILE_STORAGE_PRIVATE 0x00000001 - -#ifdef SUPPORT_RPMB_PARTITION -/* storage on rpmb */ -#define S_FILE_STORAGE_RPMB 0x00000002 -#endif - -/* Cryptoki slotID constants */ -#define S_CRYPTOKI_KEYSTORE_PRIVATE 0x00000001 -#define S_CRYPTOKI_KEYSTORE_PRIVATE_USER 0x00004004 - -/* SFile constants */ -#define S_FILE_FLAG_ACCESS_READ 0x0001 -#define S_FILE_FLAG_ACCESS_WRITE 0x0002 -#define S_FILE_FLAG_ACCESS_WRITE_META 0x0004 - -#define S_FILE_FLAG_SHARE_READ 0x0010 -#define S_FILE_FLAG_SHARE_WRITE 0x0020 - -#define S_FILE_FLAG_CREATE 0x0200 -#define S_FILE_FLAG_EXCLUSIVE 0x0400 - -#define S_FILE_NAME_MAX 0x40 -#define S_FILE_MAX_POSITION 0xFFFFFFFF - -/* SDate constants */ -#define S_DATE_STATUS_NOT_SET 0xFFFF5000 -#define S_DATE_STATUS_NEEDS_RESET 0xFFFF5001 -#define S_DATE_STATUS_SET 0x00000000 - -/* Login types */ -#define S_LOGIN_PUBLIC 0x00000000 -#define S_LOGIN_USER 0x00000001 -#define S_LOGIN_GROUP 0x00000002 -#define S_LOGIN_APPLICATION 0x00000004 -#define S_LOGIN_APPLICATION_USER 0x00000005 -#define S_LOGIN_APPLICATION_GROUP 0x00000006 -#define S_LOGIN_AUTHENTICATION 0x80000000 -#define S_LOGIN_PRIVILEGED 0x80000002 -#define S_LOGIN_CLIENT_IS_SERVICE 0xF0000000 -#define S_LOGIN_SYSTEM 0xF0000001 - -/* Parameter types */ -#define S_PARAM_TYPE_NONE 0x0 -#define S_PARAM_TYPE_VALUE_INPUT 0x1 -#define S_PARAM_TYPE_VALUE_OUTPUT 0x2 -#define S_PARAM_TYPE_VALUE_INOUT 0x3 -#define S_PARAM_TYPE_MEMREF_INPUT 0x5 -#define S_PARAM_TYPE_MEMREF_OUTPUT 0x6 -#define S_PARAM_TYPE_MEMREF_INOUT 0x7 - -#define S_PARAM_TYPE_INPUT_FLAG 0x1 -#define S_PARAM_TYPE_OUTPUT_FLAG 0x2 -#define S_PARAM_TYPE_MEMREF_FLAG 0x4 - -#define S_PARAM_TYPES(t0,t1,t2,t3) ((t0) | ((t1) << 4) | ((t2) << 8) | ((t3) << 12)) -#define S_PARAM_TYPE_GET(t, i) (((t) >> (i*4)) & 0xF) - -#define S_ORIGIN_API 1 -#define S_ORIGIN_COMMS 2 -#define S_ORIGIN_TEE 3 -#define S_ORIGIN_TRUSTED_APP 4 - -/*------------------------------------------------------------------------------ - Implementation Functions -------------------------------------------------------------------------------*/ - -S_RESULT SSDI_EXPORT SImplementationGetAllProperties( - S_PROPERTY** ppProperties, - uint32_t* pnPropertiesCount); - -S_RESULT SSDI_EXPORT SImplementationGetProperty(const char* pName, - char** ppValue); - -S_RESULT SSDI_EXPORT SImplementationGetPropertyAsInt(const char* pName, - uint32_t* pnValue); - -S_RESULT SSDI_EXPORT SImplementationGetPropertyAsBool(const char* pName, - bool* pbValue); - -/*------------------------------------------------------------------------------ - Service Functions -------------------------------------------------------------------------------*/ - -S_RESULT SSDI_EXPORT SServiceGetAllProperties( - OUT S_PROPERTY** ppProperties, - OUT uint32_t* pnPropertiesCount); - -S_RESULT SSDI_EXPORT SServiceGetProperty ( - IN const char* pName, - OUT char** ppValue); - -S_RESULT SSDI_EXPORT SServiceGetPropertyAsInt ( - IN const char* pName, - OUT uint32_t* pnValue); - -S_RESULT SSDI_EXPORT SServiceGetPropertyAsBool( - IN const char* pName, - OUT bool* pbValue); - -/*------------------------------------------------------------------------------ - Instance Functions -------------------------------------------------------------------------------*/ - -void SSDI_EXPORT SInstanceSetData( - void* pInstanceData); - -void SSDI_EXPORT *SInstanceGetData(void); - -/*------------------------------------------------------------------------------ - Session Functions -------------------------------------------------------------------------------*/ - -void SSDI_EXPORT SSessionGetClientID( - S_UUID* pClientID); - -S_RESULT SSDI_EXPORT SSessionGetAllClientProperties( - OUT uint32_t* pnPropertyCount, - OUT S_PROPERTY** ppPropertyArray); - -S_RESULT SSDI_EXPORT SSessionGetClientProperty( - IN const char* pName, - OUT char** ppValue); - -S_RESULT SSDI_EXPORT SSessionGetClientPropertyAsInt ( - IN const char* pName, - OUT uint32_t* pnValue); - -S_RESULT SSDI_EXPORT SSessionGetClientPropertyAsBool ( - IN const char* pName, - OUT bool* pnValue); - -/*------------------------------------------------------------------------------ - Memory Management Functions -------------------------------------------------------------------------------*/ - -void SSDI_EXPORT *SMemAlloc(uint32_t size); - -void SSDI_EXPORT *SMemRealloc(void* ptr, uint32_t newSize); - -void SSDI_EXPORT SMemFree(void *ptr); - -void SSDI_EXPORT *SMemMove(void *dest, const void *src, uint32_t n); - -int32_t SSDI_EXPORT SMemCompare(const void *s1, const void *s2, uint32_t n); - -void SSDI_EXPORT *SMemFill(void *s, uint32_t c, uint32_t n); - -void SSDI_EXPORT *SMemAllocEx(uint32_t nPoolID, uint32_t nSize); - -S_RESULT SMemDup(void *src, uint32_t n, void **dest); - -/*------------------------------------------------------------------------------ - Trace & Debug Functions -------------------------------------------------------------------------------*/ -void SSDI_EXPORT _SLogTrace( - const char *message, - ... /* arguments */); -void SSDI_EXPORT _SLogWarning( - const char *message, - ... /* arguments */); -void SSDI_EXPORT _SLogError( - const char *message, - ... /* arguments */); - -#ifdef __SSDI_USE_TRACE_EX -#include "ssdi_trace_ex.h" -#else - -#ifndef SSDI_NO_TRACE - -#define SLogTrace _SLogTrace -#define SLogWarning _SLogWarning -#define SLogError _SLogError - -#else /* defined(SSDI_NO_TRACE) */ - -/* Note that the following code depends on the compiler's supporting variadic macros */ -#define SLogTrace(...) do ; while(false) -#define SLogWarning(...) do ; while(false) -#define SLogError(...) do ; while(false) - -#endif /* !defined(SSDI_NO_TRACE) */ - -#endif /* __SSDI_USE_TRACE_EX */ - -void SSDI_EXPORT _SAssertionFailed( - const char* pFileName, - uint32_t nLine, - const char* pExpression); - -#ifdef SSDI_DEBUG -#define SAssert(test) \ - do \ - { \ - if (!(test)) \ - { \ - _SAssertionFailed(__FILE__, __LINE__, #test); \ - } \ - } \ - while (0) -#else /* !defined(SSDI_DEBUG) */ -#define SAssert(test) -#endif /* defined(SSDI_DEBUG) */ - -#define S_VAR_NOT_USED(variable) do{(void)(variable);}while(0); - -/*------------------------------------------------------------------------------ - Time Utility -------------------------------------------------------------------------------*/ -void SSDI_EXPORT STimeGetLimit( - uint32_t nTimeout, - OUT S_TIME_LIMIT* pTimeLimit ); - - -/*------------------------------------------------------------------------------ - Thread Functions -------------------------------------------------------------------------------*/ -S_RESULT SSDI_EXPORT SThreadCreate( - OUT S_HANDLE* phThread, - uint32_t stackSize, - uint32_t (*pEntryPoint)(void*), - IN void* pThreadArg); - -S_RESULT SSDI_EXPORT SThreadJoin( - S_HANDLE hThread, - uint32_t* pnExitCode, - const S_TIME_LIMIT* pTimeLimit); - -void SSDI_EXPORT SThreadYield(void); - -S_RESULT SSDI_EXPORT SThreadSleep(const S_TIME_LIMIT* pTimeLimit); - -void SSDI_EXPORT SThreadCancel(S_HANDLE hThread, uint32_t nReserved); - -bool SSDI_EXPORT SThreadIsCancelled (void* pReserved); - -void SSDI_EXPORT SThreadResetCancel(void); - -void SSDI_EXPORT SThreadMaskCancellation ( bool bMask ); - -/*------------------------------------------------------------------------------ - Semaphore Functions -------------------------------------------------------------------------------*/ - -S_RESULT SSDI_EXPORT SSemaphoreCreate ( - uint32_t initialCount, - S_HANDLE* phSemaphore); - -S_RESULT SSDI_EXPORT SSemaphoreAcquire(S_HANDLE hSemaphore, const S_TIME_LIMIT* pTimeLimit); - -void SSDI_EXPORT SSemaphoreRelease(S_HANDLE hSemaphore); - -/*------------------------------------------------------------------------------ - File System Functions -------------------------------------------------------------------------------*/ - -S_RESULT SSDI_EXPORT SFileOpen( - uint32_t nStorageID, - const char *pFilename, - uint32_t nFlags, - uint32_t nReserved, - S_HANDLE *phFile); - -S_RESULT SSDI_EXPORT SFileRead(S_HANDLE hFile, - uint8_t* pBuffer, - uint32_t nSize, - uint32_t* pnCount); - -S_RESULT SSDI_EXPORT SFileWrite (S_HANDLE hFile, - const uint8_t* pBuffer, - uint32_t nSize); - -S_RESULT SSDI_EXPORT SFileTruncate(S_HANDLE hFile, - uint32_t nSize); - -S_RESULT SSDI_EXPORT SFileSeek(S_HANDLE hFile, - int32_t nOffset, - S_WHENCE eWhence); - -uint32_t SSDI_EXPORT SFileTell(S_HANDLE hFile); - -bool SSDI_EXPORT SFileEOF(S_HANDLE hFile); - -S_RESULT SSDI_EXPORT SFileCloseAndDelete(S_HANDLE hFile); - -S_RESULT SSDI_EXPORT SFileRename(S_HANDLE hFile, const char* pNewFilename); - -S_RESULT SSDI_EXPORT SFileGetSize(uint32_t nStorageID, - const char* pFilename, - uint32_t* pnFileSize); - -S_RESULT SSDI_EXPORT SFileEnumerationStart ( - uint32_t nStorageID, - const char* pFilenamePattern, - uint32_t nReserved1, - uint32_t nReserved2, - S_HANDLE* phFileEnumeration); - -S_RESULT SSDI_EXPORT SFileEnumerationGetNext ( - S_HANDLE hFileEnumeration, - OUT S_FILE_INFO** ppFileInfo); - -/*------------------------------------------------------------------------------ - Date Functions -------------------------------------------------------------------------------*/ - -S_RESULT SSDI_EXPORT SDateSet ( - int32_t nSeconds, - uint32_t nReserved); - -S_RESULT SSDI_EXPORT SDateGet( - OUT int32_t* pnSeconds, - OUT uint32_t* pnDateStatus, - uint32_t nReserved ); - -int32_t SSDI_EXPORT SClockGet(void); - -S_RESULT SSDI_EXPORT SDateConvertSecondsToCalendar( - IN int32_t nSeconds, - IN const S_CALENDAR* pOrigin, - OUT S_CALENDAR* pDate ); - -S_RESULT SSDI_EXPORT SDateConvertCalendarToSeconds( - IN const S_CALENDAR* pOrigin, - IN const S_CALENDAR* pDate, - OUT int32_t* pnSeconds); - -/*------------------------------------------------------------------------------ - Handle Functions -------------------------------------------------------------------------------*/ -void SSDI_EXPORT SHandleClose ( S_HANDLE hHandle); - -/*------------------------------------------------------------------------------ - Crypto API -------------------------------------------------------------------------------*/ - -#define PKCS11_EXPORT SSDI_EXPORT - -#include "pkcs11.h" - -/*------------------------------------------------------------------------------ - Cryptoki Update Shortcut -------------------------------------------------------------------------------*/ - -#define S_UPDATE_SHORTCUT_FLAG_AGGRESSIVE 0x00000001 - -CK_RV SSDI_EXPORT CV_ActivateUpdateShortcut2( - CK_SESSION_HANDLE hCryptokiSession, - uint32_t nCommandID, - uint32_t nFlags, - uint32_t nReserved); - -void SSDI_EXPORT CV_DeactivateUpdateShortcut( - CK_SESSION_HANDLE hCryptokiSession); - - -/*------------------------------------------------------------------------------ - Panic Function -------------------------------------------------------------------------------*/ - -void SSDI_EXPORT SPanic(uint32_t nReserved); - -/*------------------------------------------------------------------------------ - SXControl functions -------------------------------------------------------------------------------*/ -S_RESULT SSDI_EXPORT SXControlOpenClientSession ( - const S_UUID* pDestination, - S_TIME_LIMIT* pDeadline, - uint32_t nParamTypes, - S_PARAM pParams[4], - OUT S_HANDLE* phSessionHandle, - uint32_t* pnReturnOrigin); - -S_RESULT SSDI_EXPORT SXControlInvokeCommand ( - S_HANDLE hSessionHandle, - S_TIME_LIMIT* pDeadline, - uint32_t nCommandID, - uint32_t nParamTypes, - S_PARAM pParams[4], - uint32_t* pnReturnOrigin); - -/*------------------------------------------------------------------------------ - SRVX Entry Points -------------------------------------------------------------------------------*/ - -extern S_RESULT SRVX_EXPORT SRVXCreate(void); -extern void SRVX_EXPORT SRVXDestroy(void); -extern S_RESULT SRVX_EXPORT SRVXOpenClientSession(uint32_t nParamTypes, - IN OUT S_PARAM pParams[4], - OUT void** ppSessionContext); -extern S_RESULT SRVX_EXPORT SRVXInvokeCommand(IN OUT void* pSessionContext, - uint32_t nCommandID, - uint32_t nParamTypes, - IN OUT S_PARAM pParams[4]); -extern void SRVX_EXPORT SRVXCloseClientSession(IN OUT void* pSessionContext); - -#include "ssdi_v2_compat.h" - -#endif /* __SSDI_H__ */ diff --git a/security/tf_sdk/include/ssdi_smc_ext.h b/security/tf_sdk/include/ssdi_smc_ext.h deleted file mode 100644 index d0cb1c78..00000000 --- a/security/tf_sdk/include/ssdi_smc_ext.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright(c) 2011 Trusted Logic. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name Trusted Logic nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* -* File : ssdi_smc_ext.h -* -* Original-Author : Trusted Logic S.A. -* -* Created : October 27, 2008 -*/ - -/** - * SSDI SMC Extensions specification header file. - */ - -#ifndef __SSDI_SMC_EXT_H__ -#define __SSDI_SMC_EXT_H__ - - -/* Cryptoki slotID constants */ -#define S_CRYPTOKI_KEYSTORE_HW_TOKEN 0x00007FFF - - -#define CKMV_SMC_KEK_DERIVE 0xC0000000 - - -typedef struct CKV_SMC_KEK_DERIVE_PARAMS -{ - CK_ULONG Id; - CK_BYTE diversify[16]; -} CKV_SMC_KEK_DERIVE_PARAMS; - - -#endif /* __SSDI_SMC_EXT_H__ */ diff --git a/security/tf_sdk/include/ssdi_v2_compat.h b/security/tf_sdk/include/ssdi_v2_compat.h deleted file mode 100644 index 06a3b0e4..00000000 --- a/security/tf_sdk/include/ssdi_v2_compat.h +++ /dev/null @@ -1,308 +0,0 @@ -/** - * Copyright(c) 2011 Trusted Logic. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name Trusted Logic nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* -* File : ssdi_v2_compat.h -* -* Original-Author : Trusted Logic S.A. -* -* Created : July 08, 2010 -*/ - -/** - * This header file contains the definitions for the legacy - * SSDI-V2 types and functions - */ - -#ifndef __SSDI_V2_COMPAT_H__ -#define __SSDI_V2_COMPAT_H__ - -#include "s_type.h" -#include "s_error.h" -#include "ssdi.h" - -/* SSPI entry points must not be exported. - SRVX entry points defined in the ssdi_v2_compat library are exported. */ -#define SSPI_EXPORT - -/*------------------------------------------------------------------------------ - Constants -------------------------------------------------------------------------------*/ -#define S_SHARED_MEMORY_ACCESS_READ 0x01 -#define S_SHARED_MEMORY_ACCESS_WRITE 0x02 - -#define S_NULL_ELEMENT 0xFFFFFFFF - -#define S_SHARED_MEMORY_ACCESS_READ 0x01 -#define S_SHARED_MEMORY_ACCESS_WRITE 0x02 - -/* SControl constants */ -#define S_CONTROL_MODE_USER 0x00000002 -#define S_CONTROL_MODE_MANAGER 0x00000008 -#define S_CONTROL_MODE_EXCLUSIVE_MANAGER 0x00000010 - -/* Shared memory access */ -#define S_MEMORY_ACCESS_CLIENT_WRITE_SERVICE_READ 0x00000001 -#define S_MEMORY_ACCESS_CLIENT_READ_SERVICE_WRITE 0x00000002 - -/* Login types */ -#define S_LOGIN_OS_IDENTIFICATION S_LOGIN_APPLICATION_USER - -/*------------------------------------------------------------------------------ - Decoder Functions -------------------------------------------------------------------------------*/ - -S_RESULT SDecoderGetError(S_HANDLE hDecoder); - -bool SDecoderHasData(S_HANDLE hDecoder); - -uint8_t SDecoderReadUint8(S_HANDLE hDecoder); - -uint16_t SDecoderReadUint16(S_HANDLE hDecoder); - -uint32_t SDecoderReadUint32(S_HANDLE hDecoder); - -char *SDecoderReadString(S_HANDLE hDecoder); - -bool SDecoderReadBoolean(S_HANDLE hDecoder); - -uint8_t *SDecoderReadUint8Array( - S_HANDLE hDecoder, - OUT uint32_t* pnArrayLength); - -uint16_t *SDecoderReadUint16Array( - S_HANDLE hDecoder, - OUT uint32_t* pnArrayLength); - -uint32_t *SDecoderReadUint32Array( - S_HANDLE hDecoder, - OUT uint32_t* pnArrayLength); - -uint32_t SDecoderReadArrayLength(S_HANDLE hDecoder); - -uint32_t SDecoderCopyUint8Array( - IN S_HANDLE hDecoder, - IN uint32_t nIndex, - IN uint32_t nMaxLength, - OUT uint8_t* pArray); - -uint32_t SDecoderCopyUint16Array( - IN S_HANDLE hDecoder, - IN uint32_t nIndex, - IN uint32_t nMaxLength, - OUT uint16_t* pArray); - -uint32_t SDecoderCopyUint32Array( - IN S_HANDLE hDecoder, - IN uint32_t nIndex, - IN uint32_t nMaxLength, - OUT uint32_t* pArray); - -void SDecoderOpenSequence(S_HANDLE hDecoder); - -void SDecoderCloseSequence(S_HANDLE hDecoder); - -void SDecoderSkip(S_HANDLE hDecoder); - -uint8_t *SDecoderReadMemoryReference( - S_HANDLE hDecoder, - uint32_t nFlags, - OUT uint32_t* pnSize); -void SDecoderReadUUID( - IN S_HANDLE hDecoder, - OUT S_UUID* pUUID); - -/*------------------------------------------------------------------------------ - Encoder Functions -------------------------------------------------------------------------------*/ - -void SEncoderWriteUint8( - IN S_HANDLE hEncoder, - IN uint8_t value); - -void SEncoderWriteUint16( - IN S_HANDLE hEncoder, - IN uint16_t value); - -void SEncoderWriteUint32(IN S_HANDLE hEncoder, - IN uint32_t value); - -void SEncoderWriteBoolean(IN S_HANDLE hEncoder, - IN bool value); - -void SEncoderWriteString(IN S_HANDLE hEncoder, - IN const char* value); - -void SEncoderWriteUint8Array(IN S_HANDLE hEncoder, - IN uint32_t nArrayLength, - IN const uint8_t* pnArray); - -void SEncoderWriteUint16Array(IN S_HANDLE hEncoder, - IN uint32_t nArrayLength, - IN const uint16_t* pnArray); - -void SEncoderWriteUint32Array(IN S_HANDLE hEncoder, - IN uint32_t nArrayLength, - IN const uint32_t* pnArray); - -void SEncoderWriteBooleanArray(IN S_HANDLE hEncoder, - IN uint32_t nArrayLength, - IN const bool* pnArray); - -void SEncoderWriteStringArray(IN S_HANDLE hEncoder, - IN uint32_t nArrayLength, - IN const char** pnArray); - -void SEncoderWriteMemoryReference( - S_HANDLE hEncoder, - S_HANDLE hBlock, - uint32_t nOffset, - uint32_t nLength, - uint32_t nFlags); - -void SEncoderOpenSequence( S_HANDLE hEncoder ); - -void SEncoderCloseSequence( S_HANDLE hEncoder ); - -S_RESULT SEncoderGetError(S_HANDLE hEncoder); - -void SEncoderReset( S_HANDLE hEncoder ); - -void SEncoderWriteUUID( - IN S_HANDLE hEncoder, - IN const S_UUID* pUUID); - -/*------------------------------------------------------------------------------ - Service Control Functions -------------------------------------------------------------------------------*/ - -S_RESULT SControlPrepareOpenOperation( - IN const S_UUID* pIdService, - uint32_t nControlMode, - IN const S_TIME_LIMIT* pTimeLimit, - uint32_t nEncoderBufferSize, - uint32_t nDecoderBufferSize, - OUT S_HANDLE* phClientSession, - OUT S_HANDLE* phParameterEncoder, - OUT S_HANDLE* phOperation ); - -S_RESULT SControlPrepareInvokeOperation( - S_HANDLE hClientSession, - uint32_t nCommandIdentifier, - IN const S_TIME_LIMIT* pTimeLimit, - uint32_t nEncoderBufferSize, - uint32_t nDecoderBufferSize, - OUT S_HANDLE* phParameterEncoder, - OUT S_HANDLE* phOperation ); - -S_RESULT SControlPrepareCloseOperation( - S_HANDLE hClientSession, - uint32_t nEncoderBufferSize, - uint32_t nDecoderBufferSize, - OUT S_HANDLE* phParameterEncoder, - OUT S_HANDLE* phOperation ); - -S_RESULT SControlPerformOperation( - S_HANDLE hOperation, - uint32_t nReserved, - OUT S_RESULT* pnServiceErrorCode, - OUT S_HANDLE* phAnswerDecoder ); - -S_RESULT SControlCancelOperation( S_HANDLE hOperation ); - -S_RESULT SControlAllocateSharedMemory( - S_HANDLE hClientSession, - uint32_t nLength, - uint32_t nFlags, - uint32_t nReserved, - OUT void** ppBlock, - OUT S_HANDLE* phBlockHandle); - -S_RESULT SControlRegisterSharedMemory( - S_HANDLE hClientSession, - IN const void* pBuffer, - uint32_t nBufferLength, - uint32_t nFlags, - uint32_t nReserved, - OUT S_HANDLE* phBlockHandle ); - -/*------------------------------------------------------------------------------ - Service Manager Functions -------------------------------------------------------------------------------*/ - -S_RESULT SManagerOpen( - uint32_t nControlMode, - S_HANDLE* phServiceManager); - -S_RESULT SManagerGetAllServices( - S_HANDLE hServiceManager, - S_UUID** ppServiceIdentifierList, - uint32_t* pnListLength); - -S_RESULT SManagerGetServiceProperty( - S_HANDLE hServiceManager, - const S_UUID* pidService, - const char* pPropertyName, - char** ppPropertyValue); - -S_RESULT SManagerGetAllServiceProperties( - S_HANDLE hServiceManager, - const S_UUID* pidService, - S_PROPERTY** ppProperties, - uint32_t* pnPropertiesLength); - -S_RESULT SManagerDownloadService( - S_HANDLE hServiceManager, - const uint8_t* pServiceCode, - uint32_t nServiceCodeSize, - S_UUID* pidService); - -S_RESULT SManagerRemoveService( - S_HANDLE hServiceManager, - const S_UUID* pidService); - -/*------------------------------------------------------------------------------ - SSPI Entry Points -------------------------------------------------------------------------------*/ - -S_RESULT SSPICreate(void); -void SSPIDestroy(void); -S_RESULT SSPIOpenClientSession(S_HANDLE hDecoder, - S_HANDLE hEncoder, - OUT void** ppSessionContext); -S_RESULT SSPIInvokeCommand(IN OUT void* pSessionContext, - uint32_t nCommandID, - S_HANDLE hDecoder, - S_HANDLE hEncoder); -S_RESULT SSPICloseClientSession(IN OUT void* pSessionContext, - uint32_t nCause, - S_HANDLE hDecoder, - S_HANDLE hEncoder); -#endif /* __SSDI_V2_COMPAT_H__ */ |