MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Macros | Typedefs | Enumerations | Functions
mh5hash.c File Reference

Functions relating to HTTPS Content Verification. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <openssl/evp.h>
#include "mh5hash.h"
#include "mh5base.h"
#include "mh5memory.h"
#include "mh5fileorm.h"
#include "mh5sig.h"
#include "stb_os.h"

Macros

#define GET_16BITS_FROM_ARRAY(X, Y)   ((X[Y] << 8) | X[Y + 1])
 

Typedefs

typedef struct sHashDigest HashDigest
 
typedef struct sHashfileData HashfileData
 

Enumerations

enum  HashFileState_t {
  HASH_FILE_RELOAD, HASH_FILE_WAITING_FOR_HASH, HASH_FILE_WAITING_FOR_SIG, HASH_FILE_WAITING_FOR_HASH_AND_SIG,
  HASH_FILE_WAITING_FOR_CERT, HASH_FILE_VERIFYING, HASH_FILE_VERIFIED, HASH_FILE_FAILED
}
 
enum  RequestState_t { REQ_OK, REQ_FAILED, REQ_PENDING }
 

Functions

void MHEG5SetVerificationCallback (void(*callback)(void))
 Register a callback to be fired when the state of the verification file changes. More...
 
void MHEG5ResetVerification (void)
 Reset the state of the verification subsystem. More...
 
MHEG5ContentVerification_t MHEG5IsContentVerified (U8BIT *url, U8BIT *content, U32BIT length)
 
void MHEG5ResetHashFile (U8BIT *url)
 Reset the state and clear cache of the hashfile associated with a content file. More...
 

Detailed Description

Functions relating to HTTPS Content Verification.

Date
22/02/2010
Author
Omri Barel

Function Documentation

MHEG5ContentVerification_t MHEG5IsContentVerified ( U8BIT *  url,
U8BIT *  content,
U32BIT  length 
)
Parameters
urlURL of the content to be verified
contentPointer to the content to be verified
lengthSize of content in bytes
Returns
CONTENT_NOT_VERIFIED_NEW if content could not be verified CONTENT_VERIFIED if the content was verified, CONTENT_VERIFICATION_PENDING if the verification process could not be completed, pending a file-load
void MHEG5ResetHashFile ( U8BIT *  url)

Reset the state and clear cache of the hashfile associated with a content file.

Parameters
urlURL of content file
Returns
void MHEG5ResetVerification ( void  )

Reset the state of the verification subsystem.

Reset the entire state of the verification mechanism.

Returns
nothing
void MHEG5SetVerificationCallback ( void(*)(void)  callback)

Register a callback to be fired when the state of the verification file changes.

Register a callback to be fired when the state of the verification subsystem changes.

Parameters
callbackPointer to the callback function to be used.
Returns