MHEG5  18.9.0
MHEG5 Documentation
Classes | Macros | Typedefs | Enumerations | Functions
mh5sig.c File Reference

Functions relating to HTTPS Signature certificates. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <openssl/sha.h>
#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include "mh5profile.h"
#include "mh5sig.h"
#include "mh5memory.h"
#include "mh5fileorm.h"
#include "mh5debug.h"
#include "stb_os.h"

Go to the source code of this file.

Classes

struct  sSigCacheEntry
 
struct  sCertLink
 
struct  sCertFile
 

Macros

#define SIG_CERT_TIMEOUT   (3 * 60 * 60 * 1000)
 
#define MAX_SIG_CERT_NAME   (22)
 
#define MAX_SIG_SIZE   (256)
 
#define ENTRY_STATE_STRING(e)
 
#define SIG_DEBUG_PRINT
 
#define PRINT(x)
 

Typedefs

typedef struct sSigCacheEntry SigCacheEntry
 
typedef struct sCertLink CertLink
 
typedef struct sCertFile CertFile
 

Enumerations

enum  SigEntryState {
  ENTRY_STATE_START, ENTRY_STATE_VERIFIED, ENTRY_STATE_NOT_VERIFIED, ENTRY_STATE_WAIT_FOR_CERT,
  ENTRY_STATE_HAS_CERT, ENTRY_STATE_NO_CERT
}
 

Functions

MHEG5SigVerifyStatus_t MHEG5IsValidSignature (MHEG5String *hash, MHEG5String *signature)
 Check whether the signature is valid. More...
 
void MHEG5ClearSigCertCache (void)
 Clear the signature certificate cache and all related information. More...
 
void MHEG5InvalidateSigCertCache (void)
 Invalidate the certificates in the certificate cache. More...
 
void MHEG5SetSigVerifyCallback (void(*callback)(void))
 Sets the callback to be called when pending requests are resolved. More...
 

Detailed Description

Functions relating to HTTPS Signature certificates.

Date
22/02/2010
Author
Omri Barel

Definition in file mh5sig.c.

Macro Definition Documentation

#define ENTRY_STATE_STRING (   e)
Value:
((e)->state == ENTRY_STATE_START ? "ENTRY_STATE_START" : \
(e)->state == ENTRY_STATE_VERIFIED ? "ENTRY_STATE_VERIFIED" : \
(e)->state == ENTRY_STATE_NOT_VERIFIED ? "ENTRY_STATE_NOT_VERIFIED" : \
(e)->state == ENTRY_STATE_WAIT_FOR_CERT ? "ENTRY_STATE_WAIT_FOR_CERT" : \
(e)->state == ENTRY_STATE_HAS_CERT ? "ENTRY_STATE_HAS_CERT" : \
(e)->state == ENTRY_STATE_NO_CERT ? "ENTRY_STATE_NO_CERT" : \
"UNKNOWN")

Definition at line 50 of file mh5sig.c.

#define MAX_SIG_CERT_NAME   (22)

Definition at line 47 of file mh5sig.c.

#define MAX_SIG_SIZE   (256)

Definition at line 48 of file mh5sig.c.

#define PRINT (   x)

Definition at line 64 of file mh5sig.c.

#define SIG_CERT_TIMEOUT   (3 * 60 * 60 * 1000)

Definition at line 45 of file mh5sig.c.

#define SIG_DEBUG_PRINT

Definition at line 59 of file mh5sig.c.

Typedef Documentation

typedef struct sCertFile CertFile
typedef struct sCertLink CertLink
typedef struct sSigCacheEntry SigCacheEntry

Enumeration Type Documentation

Enumerator
ENTRY_STATE_START 
ENTRY_STATE_VERIFIED 
ENTRY_STATE_NOT_VERIFIED 
ENTRY_STATE_WAIT_FOR_CERT 
ENTRY_STATE_HAS_CERT 
ENTRY_STATE_NO_CERT 

Definition at line 69 of file mh5sig.c.

Function Documentation

void MHEG5ClearSigCertCache ( void  )

Clear the signature certificate cache and all related information.

Returns
Nothing

Definition at line 242 of file mh5sig.c.

void MHEG5InvalidateSigCertCache ( void  )

Invalidate the certificates in the certificate cache.

Returns
Nothing

Definition at line 262 of file mh5sig.c.

MHEG5SigVerifyStatus_t MHEG5IsValidSignature ( MHEG5String hash,
MHEG5String signature 
)

Check whether the signature is valid.

Parameters
hashHash file contents
signatureSignature file contents
Returns
MHEG5_SIG_VERIFIED MHEG5_SIG_NOT_VERIFIED MHEG5_SIG_CHECK_PENDING

Definition at line 181 of file mh5sig.c.

void MHEG5SetSigVerifyCallback ( void(*)(void)  callback)

Sets the callback to be called when pending requests are resolved.

Parameters
callbackCallback function to be called when pending requests are resolved
Returns
Nothing

Definition at line 290 of file mh5sig.c.