Microchip® Advanced Software Framework

root_setup.c File Reference

Root certificate parser and downloader.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

#include "crypto/crypto_api.h"
#include "root_setup.h"
#include "programmer/programmer.h"
#include "pem.h"

Data Structures

struct  tstrRootCertEcdsaKeyInfo
 Info about a ECDSA public key. More...
 
struct  tstrRootCertEntryHeader
 Header of a root certificate entry in flash. More...
 
struct  tstrRootCertFlashHeader
 Header of the root certificate flash storage area. More...
 
struct  tstrRootCertPubKeyInfo
 Info about the public key contained in a root certificate. More...
 
struct  tstrRootCertRsaKeyInfo
 Info about a RSA public key. More...
 

Macros

#define ROOT_CERT_FLASH_EMPTY_PATTERN
 
#define ROOT_CERT_FLASH_START_PATTERN
 
#define ROOT_CERT_FLASH_START_PATTERN_LENGTH   16
 
#define ROOT_CERT_FLASH_START_PATTERN_V0
 

Enumerations

enum  tenuRootCertPubKeyType {
  ROOT_CERT_PUBKEY_RSA = 1,
  ROOT_CERT_PUBKEY_ECDSA = 2,
  ROOT_CERT_PUBKEY_RSA = 1,
  ROOT_CERT_PUBKEY_ECDSA = 2
}
 

Functions

static int GetRootCertificate (uint8 *pu8RootCert, uint32 u32RootCertSz, txtrX509CertInfo *pstrX509)
 
static sint8 UpdateRootList (txtrX509CertInfo *pstrRootCert)
 
static uint16 writeRootCertEntry (uint8 *pu8WriteBuff, txtrX509CertInfo *pstrRootCert)
 
int WriteRootCertificate (uint8 *pu8RootCert, uint32 u32RootCertSz)
 

#define ROOT_CERT_FLASH_EMPTY_PATTERN
Value:
{\
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF \
}

Referenced by UpdateRootList().

#define ROOT_CERT_FLASH_START_PATTERN
Value:
{\
0x11, 0xF1, 0x12, 0xF2, 0x13, 0xF3, 0x14, 0xF4, \
0x15, 0xF5, 0x16, 0xF6, 0x17, 0xF7, 0x18, 0xF8 \
}

Referenced by UpdateRootList().

#define ROOT_CERT_FLASH_START_PATTERN_LENGTH   16

Referenced by UpdateRootList().

#define ROOT_CERT_FLASH_START_PATTERN_V0
Value:
{\
0x01, 0xF1, 0x02, 0xF2, 0x03, 0xF3, 0x04, 0xF4, \
0x05, 0xF5, 0x06, 0xF6, 0x07, 0xF7, 0x08, 0xF8 \
}

Enumerator
ROOT_CERT_PUBKEY_RSA 

RSA public key.

ROOT_CERT_PUBKEY_ECDSA 

ECDSA public key.

ROOT_CERT_PUBKEY_RSA 
ROOT_CERT_PUBKEY_ECDSA 

static int GetRootCertificate ( uint8 pu8RootCert,
uint32  u32RootCertSz,
txtrX509CertInfo pstrX509 
)
static