Microchip® Advanced Software Framework

tls_srv_sec.c File Reference

This module implements TLS Server Certificate Installation.

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

#include "root_tls_cert/crypto/crypto_api.h"
#include "pem.h"
#include "tls_srv_sec.h"
#include <stdlib.h>

Functions

static sint8 BuildServerX509CertChain (tenuCertPubKeyType enuChainType, tstrX509Entry *pstrHead, tstrASN1RSAPrivateKey *pstrRsaPrivKey)
 
static sint8 EcdsaBuildServerX509CertChain (tstrX509Entry *pstrHead)
 
static void Hex2String (uint8 *pu8HexArray, uint32 u32Length, char *pcHexString)
 
static sint8 ReadServerX509Chain (tstrBuff *pstrX509Chain, uint8 u8nCerts, tstrX509Entry **ppstrChainHead)
 
static sint8 RsaBuildServerX509CertChain (tstrX509Entry *pstrHead, tstrASN1RSAPrivateKey *pstrRsaPrivKey)
 
static void TlsSrvSecFclose (tstrTlsSrvSecFileHandle *pstrHandle)
 
static tstrTlsSrvSecFileHandleTlsSrvSecFopen (char *pcFileName, tenuTlsSrvSecFileMode enuMode)
 
static sint8 TlsSrvSecFwrite (uint8 *pu8WriteBuff, uint16 u16BuffSize, tstrTlsSrvSecFileHandle *pstrHandle)
 
sint8 TlsSrvSecWriteCertChain (uint8 *pu8PrivKey, uint32 u32PrivKeySz, tstrFileInfo *pstrCertChain, uint8 u8ChainDepth, uint8 *pu8TlsSrvSecBuff, uint32 *pu32SecSz, tenuWriteMode enuMode)
 
static sint8 ValidateKeyMaterial (tstrRsaPrivateKey *pstrPrivKey, txtrX509CertInfo *pstrServerCert)
 
static sint8 WriteTlsServerKeyMaterial (uint8 *pu8PrivKey, uint32 u32PrivKeySz, tstrFileInfo *pstrCertChain, uint8 u8nCerts, uint32 *pu32SecSz)
 

Variables

static uint8 gpau8HexTable [] = "0123456789abcdef"
 
static tstrTlsSrvSecHdrgpstrTlsSrvSecHdr = NULL
 

static void Hex2String ( uint8 pu8HexArray,
uint32  u32Length,
char *  pcHexString 
)
static

References gpau8HexTable.

Referenced by BuildServerX509CertChain().

uint8 gpau8HexTable[] = "0123456789abcdef"
static

Referenced by Hex2String().

tstrTlsSrvSecHdr* gpstrTlsSrvSecHdr = NULL
static

Referenced by TlsSrvSecFwrite().