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 |
struct | tstrRootCertEntryHeader |
struct | tstrRootCertFlashHeader |
struct | tstrRootCertPubKeyInfo |
struct | tstrRootCertRsaKeyInfo |
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 } |
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 |
Referenced by UpdateRootList().
#define ROOT_CERT_FLASH_START_PATTERN |
Referenced by UpdateRootList().
#define ROOT_CERT_FLASH_START_PATTERN_LENGTH 16 |
Referenced by UpdateRootList().
#define ROOT_CERT_FLASH_START_PATTERN_V0 |
|
static |
References tstrX509Name::acCmnName, CryptoX509CertDecode(), DecodeX509Certificate(), M2M_SUCCESS, and txtrX509CertInfo::strSubject.
Referenced by WriteRootCertificate().
|
static |
References tstrX509Name::au8NameSHA1, tstrRootCertEntryHeader::au8SHA1NameHash, tstrRootCertFlashHeader::au8StartPattern, gau8CertMem, m2m_memcmp(), m2m_memcpy(), M2M_TLS_ROOTCER_FLASH_SIZE, ROOT_CERT_FLASH_EMPTY_PATTERN, ROOT_CERT_FLASH_START_PATTERN, ROOT_CERT_FLASH_START_PATTERN_LENGTH, ROOT_CERT_PUBKEY_RSA, tstrRootCertPubKeyInfo::strEcsdaKeyInfo, tstrRootCertEntryHeader::strPubKey, tstrRootCertPubKeyInfo::strRsaKeyInfo, txtrX509CertInfo::strSubject, tstrRootCertRsaKeyInfo::u16ESz, tstrRootCertEcdsaKeyInfo::u16KeySz, tstrRootCertRsaKeyInfo::u16NSz, tstrRootCertFlashHeader::u32nCerts, tstrRootCertPubKeyInfo::u32PubKeyType, WORD_ALIGN, and writeRootCertEntry().
Referenced by WriteRootCertificate().
|
static |
References tstrECDSAPubKey::au8EcPoint, tstrX509Name::au8NameSHA1, tstrRootCertEntryHeader::au8SHA1NameHash, CRYPTO_SHA1_DIGEST_SIZE, tstrX509CertPublicKey::enuCertKeyType, m2m_memcpy(), m2m_memset(), NULL, tstrRSAPubKey::pu8E, tstrRSAPubKey::pu8N, ROOT_CERT_PUBKEY_ECDSA, ROOT_CERT_PUBKEY_RSA, tstrX509CertPublicKey::strEcdsaPub, tstrRootCertPubKeyInfo::strEcsdaKeyInfo, tstrRootCertEntryHeader::strExpDate, txtrX509CertInfo::strExpiryDate, tstrRootCertEntryHeader::strPubKey, txtrX509CertInfo::strPubKey, tstrRootCertPubKeyInfo::strRsaKeyInfo, tstrX509CertPublicKey::strRsaPub, tstrRootCertEntryHeader::strStartDate, txtrX509CertInfo::strStartDate, txtrX509CertInfo::strSubject, tstrRootCertEcdsaKeyInfo::u16CurveID, tstrECDSAPubKey::u16CurveID, tstrECDSAPubKey::u16EcPointSz, tstrRSAPubKey::u16ESize, tstrRootCertRsaKeyInfo::u16ESz, tstrRootCertEcdsaKeyInfo::u16KeySz, tstrRSAPubKey::u16NSize, tstrRootCertRsaKeyInfo::u16NSz, tstrRootCertPubKeyInfo::u32PubKeyType, WORD_ALIGN, X509_CERT_PUBKEY_ECDSA, and X509_CERT_PUBKEY_RSA.
Referenced by UpdateRootList().