LibreOffice Module onlineupdate (master) 1
Macros | Typedefs | Functions | Variables
MacVerifyCrypto.cpp File Reference
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
#include <dlfcn.h>
#include "cryptox.h"
Include dependency graph for MacVerifyCrypto.cpp:

Go to the source code of this file.

Macros

#define MAC_OS_X_VERSION_10_7_HEX   0x00001070
 

Typedefs

typedef CFTypeRef SecTransformRef
 
typedef struct OpaqueSecKeyRef * SecKeyRef
 
typedef SecTransformRef(* SecTransformCreateReadTransformWithReadStreamFunc) (CFReadStreamRef inputStream)
 
typedef CFTypeRef(* SecTransformExecuteFunc) (SecTransformRef transform, CFErrorRef *error)
 
typedef SecTransformRef(* SecVerifyTransformCreateFunc) (SecKeyRef key, CFDataRef signature, CFErrorRef *error)
 
typedef Boolean(* SecTransformSetAttributeFunc) (SecTransformRef transform, CFStringRef key, CFTypeRef value, CFErrorRef *error)
 

Functions

static bool OnLionOrLater ()
 
void * cssmMalloc (CSSM_SIZE aSize, void *aAllocRef)
 
void cssmFree (void *aPtr, void *aAllocRef)
 
void * cssmRealloc (void *aPtr, CSSM_SIZE aSize, void *aAllocRef)
 
void * cssmCalloc (uint32 aNum, CSSM_SIZE aSize, void *aAllocRef)
 
CryptoX_Result CryptoMac_InitCryptoProvider ()
 
CryptoX_Result CryptoMac_VerifyBegin (CryptoX_SignatureHandle *aInputData)
 
CryptoX_Result CryptoMac_VerifyUpdate (CryptoX_SignatureHandle *aInputData, void *aBuf, unsigned int aLen)
 
CryptoX_Result CryptoMac_LoadPublicKey (const unsigned char *aCertData, unsigned int aDataSize, CryptoX_PublicKey *aPublicKey)
 
CryptoX_Result CryptoMac_VerifySignature (CryptoX_SignatureHandle *aInputData, CryptoX_PublicKey *aPublicKey, const unsigned char *aSignature, unsigned int aSignatureLen)
 
void CryptoMac_FreeSignatureHandle (CryptoX_SignatureHandle *aInputData)
 
void CryptoMac_FreePublicKey (CryptoX_PublicKey *aPublicKey)
 

Variables

const CFStringRef kSecTransformInputAttributeName = CFSTR("INPUT")
 
SecTransformCreateReadTransformWithReadStreamFunc SecTransformCreateReadTransformWithReadStreamPtr = NULL
 
SecTransformExecuteFunc SecTransformExecutePtr = NULL
 
SecVerifyTransformCreateFunc SecVerifyTransformCreatePtr = NULL
 
SecTransformSetAttributeFunc SecTransformSetAttributePtr = NULL
 
static int sOnLionOrLater = -1
 
static bool sCssmInitialized = false
 
static CSSM_VERSION sCssmVersion = {2, 0}
 
static const CSSM_GUID sMozCssmGuid
 
static CSSM_CSP_HANDLE sCspHandle = CSSM_INVALID_HANDLE
 
static CSSM_API_MEMORY_FUNCS cssmMemFuncs
 

Macro Definition Documentation

◆ MAC_OS_X_VERSION_10_7_HEX

#define MAC_OS_X_VERSION_10_7_HEX   0x00001070

Definition at line 37 of file MacVerifyCrypto.cpp.

Typedef Documentation

◆ SecKeyRef

typedef struct OpaqueSecKeyRef* SecKeyRef

Definition at line 17 of file MacVerifyCrypto.cpp.

◆ SecTransformCreateReadTransformWithReadStreamFunc

typedef SecTransformRef(* SecTransformCreateReadTransformWithReadStreamFunc) (CFReadStreamRef inputStream)

Definition at line 19 of file MacVerifyCrypto.cpp.

◆ SecTransformExecuteFunc

typedef CFTypeRef(* SecTransformExecuteFunc) (SecTransformRef transform, CFErrorRef *error)

Definition at line 23 of file MacVerifyCrypto.cpp.

◆ SecTransformRef

typedef CFTypeRef SecTransformRef

Definition at line 16 of file MacVerifyCrypto.cpp.

◆ SecTransformSetAttributeFunc

typedef Boolean(* SecTransformSetAttributeFunc) (SecTransformRef transform, CFStringRef key, CFTypeRef value, CFErrorRef *error)

Definition at line 30 of file MacVerifyCrypto.cpp.

◆ SecVerifyTransformCreateFunc

typedef SecTransformRef(* SecVerifyTransformCreateFunc) (SecKeyRef key, CFDataRef signature, CFErrorRef *error)

Definition at line 26 of file MacVerifyCrypto.cpp.

Function Documentation

◆ CryptoMac_FreePublicKey()

void CryptoMac_FreePublicKey ( CryptoX_PublicKey aPublicKey)

Definition at line 404 of file MacVerifyCrypto.cpp.

References OnLionOrLater(), and sCspHandle.

◆ CryptoMac_FreeSignatureHandle()

void CryptoMac_FreeSignatureHandle ( CryptoX_SignatureHandle aInputData)

Definition at line 384 of file MacVerifyCrypto.cpp.

References Data, NULL, and OnLionOrLater().

◆ CryptoMac_InitCryptoProvider()

CryptoX_Result CryptoMac_InitCryptoProvider ( )

◆ CryptoMac_LoadPublicKey()

CryptoX_Result CryptoMac_LoadPublicKey ( const unsigned char *  aCertData,
unsigned int  aDataSize,
CryptoX_PublicKey aPublicKey 
)

◆ CryptoMac_VerifyBegin()

CryptoX_Result CryptoMac_VerifyBegin ( CryptoX_SignatureHandle aInputData)

Definition at line 159 of file MacVerifyCrypto.cpp.

References CryptoX_Error, CryptoX_Success, and OnLionOrLater().

◆ CryptoMac_VerifySignature()

CryptoX_Result CryptoMac_VerifySignature ( CryptoX_SignatureHandle aInputData,
CryptoX_PublicKey aPublicKey,
const unsigned char *  aSignature,
unsigned int  aSignatureLen 
)

◆ CryptoMac_VerifyUpdate()

CryptoX_Result CryptoMac_VerifyUpdate ( CryptoX_SignatureHandle aInputData,
void *  aBuf,
unsigned int  aLen 
)

Definition at line 187 of file MacVerifyCrypto.cpp.

References aBuf, CryptoX_Error, CryptoX_Success, Data, and OnLionOrLater().

◆ cssmCalloc()

void * cssmCalloc ( uint32  aNum,
CSSM_SIZE  aSize,
void *  aAllocRef 
)

Definition at line 112 of file MacVerifyCrypto.cpp.

◆ cssmFree()

void cssmFree ( void *  aPtr,
void *  aAllocRef 
)

Definition at line 101 of file MacVerifyCrypto.cpp.

◆ cssmMalloc()

void * cssmMalloc ( CSSM_SIZE  aSize,
void *  aAllocRef 
)

Definition at line 96 of file MacVerifyCrypto.cpp.

◆ cssmRealloc()

void * cssmRealloc ( void *  aPtr,
CSSM_SIZE  aSize,
void *  aAllocRef 
)

Definition at line 107 of file MacVerifyCrypto.cpp.

◆ OnLionOrLater()

static bool OnLionOrLater ( )
static

Variable Documentation

◆ cssmMemFuncs

CSSM_API_MEMORY_FUNCS cssmMemFuncs
static
Initial value:
= {
}
void * cssmRealloc(void *aPtr, CSSM_SIZE aSize, void *aAllocRef)
void cssmFree(void *aPtr, void *aAllocRef)
void * cssmMalloc(CSSM_SIZE aSize, void *aAllocRef)
void * cssmCalloc(uint32 aNum, CSSM_SIZE aSize, void *aAllocRef)
return NULL

Definition at line 117 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_LoadPublicKey().

◆ kSecTransformInputAttributeName

const CFStringRef kSecTransformInputAttributeName = CFSTR("INPUT")

Definition at line 15 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_VerifySignature().

◆ sCspHandle

CSSM_CSP_HANDLE sCspHandle = CSSM_INVALID_HANDLE
static

◆ sCssmInitialized

bool sCssmInitialized = false
static

Definition at line 89 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_LoadPublicKey().

◆ sCssmVersion

CSSM_VERSION sCssmVersion = {2, 0}
static

Definition at line 90 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_LoadPublicKey().

◆ SecTransformCreateReadTransformWithReadStreamPtr

SecTransformCreateReadTransformWithReadStreamFunc SecTransformCreateReadTransformWithReadStreamPtr = NULL

Definition at line 22 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_InitCryptoProvider().

◆ SecTransformExecutePtr

SecTransformExecuteFunc SecTransformExecutePtr = NULL

Definition at line 25 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_InitCryptoProvider(), and CryptoMac_VerifySignature().

◆ SecTransformSetAttributePtr

SecTransformSetAttributeFunc SecTransformSetAttributePtr = NULL

Definition at line 34 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_InitCryptoProvider(), and CryptoMac_VerifySignature().

◆ SecVerifyTransformCreatePtr

SecVerifyTransformCreateFunc SecVerifyTransformCreatePtr = NULL

Definition at line 29 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_InitCryptoProvider(), and CryptoMac_VerifySignature().

◆ sMozCssmGuid

const CSSM_GUID sMozCssmGuid
static
Initial value:
=
{ 0x9243121f, 0x5820, 0x4b41,
{ 0xa6, 0x52, 0xba, 0xb6, 0x3f, 0x9d, 0x3d, 0x7f }}

Definition at line 91 of file MacVerifyCrypto.cpp.

Referenced by CryptoMac_LoadPublicKey().

◆ sOnLionOrLater

int sOnLionOrLater = -1
static

Definition at line 39 of file MacVerifyCrypto.cpp.

Referenced by OnLionOrLater().