MHEG5  15.3.0
source/core/src/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"

Data Structures

struct  sSigCacheEntry
struct  sCertLink
struct  sCertFile

Defines

#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)   printf 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.
void MHEG5ClearSigCertCache (void)
 Clear the signature certificate cache and all related information.
void MHEG5InvalidateSigCertCache (void)
 Invalidate the certificates in the certificate cache.
void MHEG5SetSigVerifyCallback (void(*callback)(void))
 Sets the callback to be called when pending requests are resolved.

Detailed Description

Functions relating to HTTPS Signature certificates.

Date:
22/02/2010
Author:
Omri Barel

Define 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")

Function Documentation

void MHEG5ClearSigCertCache ( void  )

Clear the signature certificate cache and all related information.

Returns:
Nothing
void MHEG5InvalidateSigCertCache ( void  )

Invalidate the certificates in the certificate cache.

Returns:
Nothing
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
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
 All Data Structures Files Functions Variables Typedefs Defines