Skip to content

Commit 0283c54

Browse files
author
Amit Sheth
committed
Merge branch 'fix/idf_v5.4_warnings' into 'master'
Fix/idf v5.4 warnings See merge request app-frameworks/esp-aws-iot!83
2 parents 134bcd2 + 91154cf commit 0283c54

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

libraries/aws-iot-core-mqtt-file-streams-embedded-c/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ set_source_files_properties(
5353
"${CMAKE_CURRENT_LIST_DIR}/aws-iot-core-mqtt-file-streams-embedded-c/source/MQTTFileDownloader.c"
5454
PROPERTIES COMPILE_FLAGS -Wno-format)
5555

56-
set_source_files_properties(
57-
"${CMAKE_CURRENT_LIST_DIR}/aws-iot-core-mqtt-file-streams-embedded-c/source/MQTTFileDownloader_cbor.c"
58-
PROPERTIES COMPILE_FLAGS -Wno-incompatible-pointer-types)
59-
6056
if (NOT CONFIG_MQTT_STREAMS_USE_CUSTOM_CONFIG)
6157
target_compile_definitions( ${COMPONENT_TARGET} PUBLIC MQTT_STREAMS_DO_NOT_USE_CUSTOM_CONFIG=1 )
6258
endif()

libraries/aws-iot-core-mqtt-file-streams-embedded-c/port/ota_pal.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,13 @@ static CK_RV prvGetCertificate( const char * pcLabelName,
106106
uint8_t ** ppucData,
107107
uint32_t * pulDataSize );
108108

109-
static OtaPalStatus_t asn1_to_raw_ecdsa( uint8_t * signature,
109+
static OtaPalStatus_t asn1_to_raw_ecdsa( const uint8_t * signature,
110110
uint16_t sig_len,
111111
uint8_t * out_signature )
112112
{
113113
int ret = 0;
114-
const unsigned char * end = signature + sig_len;
114+
unsigned char * local_signature_ptr = ( unsigned char * ) signature;
115+
const unsigned char * end = local_signature_ptr + sig_len;
115116
size_t len;
116117
mbedtls_mpi r = { 0 };
117118
mbedtls_mpi s = { 0 };
@@ -125,21 +126,21 @@ static OtaPalStatus_t asn1_to_raw_ecdsa( uint8_t * signature,
125126
mbedtls_mpi_init( &r );
126127
mbedtls_mpi_init( &s );
127128

128-
if( ( ret = mbedtls_asn1_get_tag( &signature, end, &len,
129+
if( ( ret = mbedtls_asn1_get_tag( &local_signature_ptr, end, &len,
129130
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) != 0 )
130131
{
131132
LogError( ( "Bad Input Signature" ) );
132133
goto cleanup;
133134
}
134135

135-
if( signature + len != end )
136+
if( local_signature_ptr + len != end )
136137
{
137138
LogError( ( "Incorrect ASN1 Signature Length" ) );
138139
goto cleanup;
139140
}
140141

141-
if( ( ( ret = mbedtls_asn1_get_mpi( &signature, end, &r ) ) != 0 ) ||
142-
( ( ret = mbedtls_asn1_get_mpi( &signature, end, &s ) ) != 0 ) )
142+
if( ( ( ret = mbedtls_asn1_get_mpi( &local_signature_ptr, end, &r ) ) != 0 ) ||
143+
( ( ret = mbedtls_asn1_get_mpi( &local_signature_ptr, end, &s ) ) != 0 ) )
143144
{
144145
LogError( ( "ASN1 parsing failed" ) );
145146
goto cleanup;
@@ -475,7 +476,7 @@ OtaPalStatus_t otaPal_CheckFileSignature( AfrOtaJobDocumentFields_t * const pFil
475476
}
476477

477478
if( CRYPTO_SignatureVerificationFinal( pvSigVerifyContext, ( char * ) pucSignerCert, ulSignerCertSize,
478-
pFileContext->signature, pFileContext->signatureLen ) == pdFALSE )
479+
( const uint8_t * ) pFileContext->signature, pFileContext->signatureLen ) == pdFALSE )
479480
{
480481
LogError( ( "Signature verification failed." ) );
481482
result = OtaPalSignatureCheckFailed;
@@ -529,7 +530,7 @@ OtaPalStatus_t otaPal_CloseFile( AfrOtaJobDocumentFields_t * const pFileContext
529530
{
530531
memset( sec_boot_sig->sec_ver, 0x00, sizeof( sec_boot_sig->sec_ver ) );
531532
memset( sec_boot_sig->pad, 0xFF, sizeof( sec_boot_sig->pad ) );
532-
mainErr = asn1_to_raw_ecdsa( pFileContext->signature, pFileContext->signatureLen, sec_boot_sig->raw_ecdsa_sig );
533+
mainErr = asn1_to_raw_ecdsa( ( const uint8_t * ) pFileContext->signature, pFileContext->signatureLen, sec_boot_sig->raw_ecdsa_sig );
533534

534535
if( mainErr == OtaPalSuccess )
535536
{

libraries/corePKCS11/port/iot_crypto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static BaseType_t prvVerifySignature( char * pcSignerCertificate,
107107
BaseType_t xHashAlgorithm,
108108
uint8_t * pucHash,
109109
size_t xHashLength,
110-
uint8_t * pucSignature,
110+
const uint8_t * pucSignature,
111111
size_t xSignatureLength )
112112
{
113113
BaseType_t xResult = pdTRUE;
@@ -255,7 +255,7 @@ void CRYPTO_SignatureVerificationUpdate( void * pvContext,
255255
BaseType_t CRYPTO_SignatureVerificationFinal( void * pvContext,
256256
char * pcSignerCertificate,
257257
size_t xSignerCertificateLength,
258-
uint8_t * pucSignature,
258+
const uint8_t * pucSignature,
259259
size_t xSignatureLength )
260260
{
261261
BaseType_t xResult = pdFALSE;

libraries/corePKCS11/port/iot_crypto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void CRYPTO_SignatureVerificationUpdate( void * pvContext,
101101
BaseType_t CRYPTO_SignatureVerificationFinal( void * pvContext,
102102
char * pcSignerCertificate,
103103
size_t xSignerCertificateLength,
104-
uint8_t * pucSignature,
104+
const uint8_t * pucSignature,
105105
size_t xSignatureLength );
106106
#ifdef __cplusplus
107107
}

0 commit comments

Comments
 (0)