From 53821438f3dbce60c7f4d12ae17d1991116055bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 13 Aug 2021 08:43:35 +0100 Subject: [PATCH] Code style fix ***NO_CI*** --- .../ssl_parse_certificate_internal.cpp | 41 +++++-------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/src/PAL/COM/sockets/ssl/mbedTLS/ssl_parse_certificate_internal.cpp b/src/PAL/COM/sockets/ssl/mbedTLS/ssl_parse_certificate_internal.cpp index 55023aacbf..679872802b 100644 --- a/src/PAL/COM/sockets/ssl/mbedTLS/ssl_parse_certificate_internal.cpp +++ b/src/PAL/COM/sockets/ssl/mbedTLS/ssl_parse_certificate_internal.cpp @@ -6,9 +6,7 @@ #include "mbedtls.h" -void SSL_GetCertDateTime_internal( - DATE_TIME_INFO * dt, - mbedtls_x509_time * mt ) +void SSL_GetCertDateTime_internal(DATE_TIME_INFO *dt, mbedtls_x509_time *mt) { dt->year = mt->year; dt->month = mt->mon; @@ -21,51 +19,34 @@ void SSL_GetCertDateTime_internal( dt->tzOffset = 0; } -bool ssl_parse_certificate_internal( - void * certificate, - size_t size, - void* pwd, - void* x509CertData) +bool ssl_parse_certificate_internal(void *certificate, size_t size, void *pwd, void *x509CertData) { (void)pwd; int ret; - X509CertData* x509 = (X509CertData*)x509CertData; + X509CertData *x509 = (X509CertData *)x509CertData; mbedtls_x509_crt cacert; mbedtls_x509_crt_init(&cacert); - + ///////////////////////////////////////////////////////////////////////////////////////////////// // developer notes: // // this call parses certificates in both string and binary formats // // when the formart is a string it has to include the terminator otherwise the parse will fail // ///////////////////////////////////////////////////////////////////////////////////////////////// - ret = mbedtls_x509_crt_parse( - &cacert, - (const unsigned char *)certificate, - size); - if(ret < 0) + ret = mbedtls_x509_crt_parse(&cacert, (const unsigned char *)certificate, size); + if (ret < 0) { return false; } - - mbedtls_x509_dn_gets( - x509->Issuer, - sizeof(x509->Issuer)-1, - &cacert.issuer ); - mbedtls_x509_dn_gets( - x509->Subject, - sizeof(x509->Subject)-1, - &cacert.subject ); + mbedtls_x509_dn_gets(x509->Issuer, sizeof(x509->Issuer) - 1, &cacert.issuer); + + mbedtls_x509_dn_gets(x509->Subject, sizeof(x509->Subject) - 1, &cacert.subject); - SSL_GetCertDateTime_internal( - &x509->EffectiveDate, - &cacert.valid_from ); + SSL_GetCertDateTime_internal(&x509->EffectiveDate, &cacert.valid_from); - SSL_GetCertDateTime_internal( - &x509->ExpirationDate, - &cacert.valid_to ); + SSL_GetCertDateTime_internal(&x509->ExpirationDate, &cacert.valid_to); return true; }