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>
Variables | |
static uint8 | gpau8HexTable [] = "0123456789abcdef" |
static tstrTlsSrvSecHdr * | gpstrTlsSrvSecHdr = NULL |
|
static |
References certEntry::acFileName, txtrX509CertInfo::au8SerialNo, EcdsaBuildServerX509CertChain(), FILE_MODE_WRITE, Hex2String(), M2M_ERR_FAIL, M2M_SUCCESS, NULL, certEntry::pstrNext, tstrBuff::pu8Data, RsaBuildServerX509CertChain(), certEntry::strX509, certEntry::strX509ASN1Buff, TLS_SRV_SEC_FILE_NAME_MAX, TlsSrvSecFclose(), TlsSrvSecFopen(), TlsSrvSecFwrite(), tstrBuff::u16BufferSize, txtrX509CertInfo::u8SerialNumberLength, X509_CERT_PUBKEY_ECDSA, and X509_CERT_PUBKEY_RSA.
Referenced by WriteTlsServerKeyMaterial().
|
static |
References gpau8HexTable.
Referenced by BuildServerX509CertChain().
|
static |
References tstrX509Name::acCmnName, tstrX509Name::au8NameSHA1, CRYPTO_SHA1_DIGEST_SIZE, CryptoX509CertDecode(), CryptoX509DeleteContext(), m2m_memcmp(), M2M_SUCCESS, NULL, certEntry::pstrNext, txtrX509CertInfo::strIssuer, txtrX509CertInfo::strSubject, certEntry::strX509, and certEntry::strX509ASN1Buff.
Referenced by WriteTlsServerKeyMaterial().
|
static |
References certEntry::acFileName, FILE_MODE_WRITE, M2M_ERR, M2M_ERR_FAIL, M2M_SUCCESS, NULL, certEntry::pstrNext, tstrASN1RSAPrivateKey::pu8AllocPtr, tstrASN1RSAPrivateKey::strRsaPrivKey, certEntry::strX509, TLS_SRV_SEC_FILE_NAME_MAX, TlsSrvSecFclose(), TlsSrvSecFopen(), TlsSrvSecFwrite(), tstrASN1RSAPrivateKey::u16KeyBufSz, and ValidateKeyMaterial().
Referenced by BuildServerX509CertChain().
|
static |
|
static |
References tstrTlsSrvSecFileEntry::acFileName, tstrTlsSrvSecHdr::astrEntries, FILE_MODE_READ, FILE_MODE_WRITE, M2M_MAX, m2m_strncmp(), NULL, tstrTlsSrvSecFileHandle::pstrFile, TLS_SRV_SEC_FILE_NAME_MAX, TLS_SRV_SEC_MAX_FILES, tstrTlsSrvSecFileEntry::u32FileAddr, tstrTlsSrvSecHdr::u32nEntries, tstrTlsSrvSecHdr::u32NextWriteAddr, and tstrTlsSrvSecFileHandle::u32Offset.
Referenced by BuildServerX509CertChain(), EcdsaBuildServerX509CertChain(), and RsaBuildServerX509CertChain().
|
static |
References gpstrTlsSrvSecHdr, M2M_ERR_FAIL, M2M_SUCCESS, M2M_TLS_SERVER_FLASH_OFFSET, NULL, tstrTlsSrvSecFileHandle::pstrFile, tstrTlsSrvSecFileEntry::u32FileAddr, and tstrTlsSrvSecFileHandle::u32Offset.
Referenced by BuildServerX509CertChain(), EcdsaBuildServerX509CertChain(), and RsaBuildServerX509CertChain().
sint8 TlsSrvSecWriteCertChain | ( | uint8 * | pu8PrivKey, |
uint32 | u32PrivKeySz, | ||
tstrFileInfo * | pstrCertChain, | ||
uint8 | u8ChainDepth, | ||
uint8 * | pu8TlsSrvSecBuff, | ||
uint32 * | pu32SecSz, | ||
tenuWriteMode | enuMode | ||
) |
References tstrTlsSrvSecHdr::au8SecStartPattern, M2M_ERR_FAIL, M2M_TLS_SERVER_FLASH_OFFSET, M2M_TLS_SERVER_FLASH_SIZE, NULL, TLS_SRV_SEC_MODE_APPEND, TLS_SRV_SEC_MODE_WRITE, TLS_SRV_SEC_START_PATTERN, TLS_SRV_SEC_START_PATTERN_LEN, tstrTlsSrvSecHdr::u32nEntries, tstrTlsSrvSecHdr::u32NextWriteAddr, and WriteTlsServerKeyMaterial().
Referenced by WriteTlsCertificate().
|
static |
|
static |
References tstrTlsSrvSecHdr::astrEntries, BuildServerX509CertChain(), CryptoDecodeRsaPrivKey(), CryptoX509DeleteContext(), DecodeX509Certificate(), tstrX509CertPublicKey::enuCertKeyType, M2M_ERR_FAIL, M2M_SUCCESS, NULL, certEntry::pstrNext, ReadServerX509Chain(), txtrX509CertInfo::strPubKey, certEntry::strX509, tstrBuff::u16BufferSize, tstrTlsSrvSecFileEntry::u32FileSize, tstrTlsSrvSecHdr::u32nEntries, WORD_ALIGN, X509_CERT_PUBKEY_ECDSA, and X509_CERT_PUBKEY_RSA.
Referenced by TlsSrvSecWriteCertChain().
|
static |
Referenced by Hex2String().
|
static |
Referenced by TlsSrvSecFwrite().