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 |
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, printf, ret, and txtrX509CertInfo::strSubject.
Referenced by WriteRootCertificate().
|
static |
References tstrX509Name::au8NameSHA1, tstrRootCertEntryHeader::au8SHA1NameHash, tstrRootCertFlashHeader::au8StartPattern, gau8CertMem, m2m_memcmp(), m2m_memcpy(), M2M_TLS_ROOTCER_FLASH_SIZE, printf, 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, txtrX509CertInfo::strPubKey, tstrRootCertEntryHeader::strPubKey, tstrRootCertPubKeyInfo::strRsaKeyInfo, tstrX509CertPublicKey::strRsaPub, tstrRootCertEntryHeader::strStartDate, txtrX509CertInfo::strStartDate, txtrX509CertInfo::strSubject, tstrECDSAPubKey::u16CurveID, tstrRootCertEcdsaKeyInfo::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().