mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
formatting updates
This commit is contained in:
@ -921,11 +921,10 @@ static int atcatls_set_certificates(WOLFSSL_CTX *ctx)
|
|||||||
#ifndef ATCATLS_TNGTLS_DEVICE_CERT_SIZE
|
#ifndef ATCATLS_TNGTLS_DEVICE_CERT_SIZE
|
||||||
#define ATCATLS_TNGTLS_DEVICE_CERT_SIZE 0x222
|
#define ATCATLS_TNGTLS_DEVICE_CERT_SIZE 0x222
|
||||||
#endif
|
#endif
|
||||||
#ifndef ATCATLS_TNGTLS_CERT_BUFF_SIZE
|
#ifndef ATCATLS_TNGTLS_CERT_BUFF_SIZE
|
||||||
#define ATCATLS_TNGTLS_CERT_BUFF_SIZE (ATCATLS_TNGTLS_SIGNER_CERT_SIZE +\
|
#define ATCATLS_TNGTLS_CERT_BUFF_SIZE (ATCATLS_TNGTLS_SIGNER_CERT_SIZE +\
|
||||||
ATCATLS_TNGTLS_DEVICE_CERT_SIZE)
|
ATCATLS_TNGTLS_DEVICE_CERT_SIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
ATCA_STATUS status;
|
ATCA_STATUS status;
|
||||||
@ -935,7 +934,7 @@ static int atcatls_set_certificates(WOLFSSL_CTX *ctx)
|
|||||||
|
|
||||||
/*Read signer cert*/
|
/*Read signer cert*/
|
||||||
status = tng_atcacert_read_signer_cert(&certBuffer[ATCATLS_TNGTLS_DEVICE_CERT_SIZE],
|
status = tng_atcacert_read_signer_cert(&certBuffer[ATCATLS_TNGTLS_DEVICE_CERT_SIZE],
|
||||||
&signerCertSize);
|
&signerCertSize);
|
||||||
if (ATCA_SUCCESS != status) {
|
if (ATCA_SUCCESS != status) {
|
||||||
ret = atmel_ecc_translate_err(ret);
|
ret = atmel_ecc_translate_err(ret);
|
||||||
return ret;
|
return ret;
|
||||||
@ -943,14 +942,14 @@ static int atcatls_set_certificates(WOLFSSL_CTX *ctx)
|
|||||||
if (signerCertSize != ATCATLS_TNGTLS_SIGNER_CERT_SIZE) {
|
if (signerCertSize != ATCATLS_TNGTLS_SIGNER_CERT_SIZE) {
|
||||||
#ifdef WOLFSSL_ATECC_DEBUG
|
#ifdef WOLFSSL_ATECC_DEBUG
|
||||||
printf("signer cert size != ATCATLS_TNGTLS_SIGNER_CERT_SIZE.(%d)\r\n",
|
printf("signer cert size != ATCATLS_TNGTLS_SIGNER_CERT_SIZE.(%d)\r\n",
|
||||||
signerCertSize);
|
signerCertSize);
|
||||||
#endif
|
#endif
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Read device cert signed by the signer above*/
|
/*Read device cert signed by the signer above*/
|
||||||
status = tng_atcacert_read_device_cert(certBuffer, &deviceCertSize,\
|
status = tng_atcacert_read_device_cert(certBuffer, &deviceCertSize,\
|
||||||
&certBuffer[ATCATLS_TNGTLS_DEVICE_CERT_SIZE]);
|
&certBuffer[ATCATLS_TNGTLS_DEVICE_CERT_SIZE]);
|
||||||
if (ATCA_SUCCESS != status) {
|
if (ATCA_SUCCESS != status) {
|
||||||
ret = atmel_ecc_translate_err(ret);
|
ret = atmel_ecc_translate_err(ret);
|
||||||
return ret;
|
return ret;
|
||||||
@ -958,14 +957,14 @@ static int atcatls_set_certificates(WOLFSSL_CTX *ctx)
|
|||||||
if (deviceCertSize != ATCATLS_TNGTLS_DEVICE_CERT_SIZE) {
|
if (deviceCertSize != ATCATLS_TNGTLS_DEVICE_CERT_SIZE) {
|
||||||
#ifdef WOLFSSL_ATECC_DEBUG
|
#ifdef WOLFSSL_ATECC_DEBUG
|
||||||
printf("device cert size != ATCATLS_TNGTLS_DEVICE_CERT_SIZE.(%d)\r\n",
|
printf("device cert size != ATCATLS_TNGTLS_DEVICE_CERT_SIZE.(%d)\r\n",
|
||||||
deviceCertSize);
|
deviceCertSize);
|
||||||
#endif
|
#endif
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = wolfSSL_CTX_use_certificate_chain_buffer_format(ctx,
|
ret = wolfSSL_CTX_use_certificate_chain_buffer_format(ctx,
|
||||||
(const unsigned char*)certBuffer, ATCATLS_TNGTLS_CERT_BUFF_SIZE,
|
(const unsigned char*)certBuffer, ATCATLS_TNGTLS_CERT_BUFF_SIZE,
|
||||||
WOLFSSL_FILETYPE_ASN1);
|
WOLFSSL_FILETYPE_ASN1);
|
||||||
if (ret != WOLFSSL_SUCCESS) {
|
if (ret != WOLFSSL_SUCCESS) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user