Skip to content

Commit

Permalink
Merge branch 'main' into add-smp-OTT-task-delete
Browse files Browse the repository at this point in the history
  • Loading branch information
kar-rahul-aws authored Apr 17, 2024
2 parents 2a966b4 + 66b0b0a commit f063a40
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ static MQTTStatus_t prvProcessLoopWithTimeout( MQTTContext_t * pMqttContext,

/*-----------------------------------------------------------*/

extern BaseType_t xPlatformIsNetworkUp( void );

/*-----------------------------------------------------------*/

/* @brief Static buffer used to hold MQTT messages being sent and received. */
static uint8_t ucSharedBuffer[ democonfigNETWORK_BUFFER_SIZE ];

Expand Down Expand Up @@ -416,7 +420,18 @@ static void prvMQTTDemoTask( void * pvParameters )
for( ; ; )
{
LogInfo( ( "---------STARTING DEMO---------\r\n" ) );

/****************************** Connect. ******************************/
/* Wait for Networking */
if( xPlatformIsNetworkUp() == pdFALSE )
{
LogInfo( ( "Waiting for the network link up event..." ) );

while( xPlatformIsNetworkUp() == pdFALSE )
{
vTaskDelay( pdMS_TO_TICKS( 1000U ) );
}
}

/* Establish a TLS connection with the MQTT broker. This example connects
* to the MQTT broker as specified by democonfigMQTT_BROKER_ENDPOINT and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@

extern void vPlatformInitIpStack( void );

extern void vStartPKCSMutualAuthDemo( void );

/*-----------------------------------------------------------*/

int main( void )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ static int p11_ecdsa_check_pair( const void * pvPub,
};
unsigned char pucTestSignature[ MBEDTLS_ECDSA_MAX_SIG_LEN( 256 ) ] = { 0 };
size_t uxSigLen = 0;
lResult = p11_ecdsa_sign( pxMbedtlsPkCtx, MBEDTLS_MD_SHA256,
lResult = p11_ecdsa_sign( ( mbedtls_pk_context * ) pxMbedtlsPkCtx, MBEDTLS_MD_SHA256,
pucTestHash, sizeof( pucTestHash ),
pucTestSignature, sizeof( pucTestSignature ), &uxSigLen,
NULL, NULL );
Expand Down Expand Up @@ -883,7 +883,7 @@ static size_t p11_rsa_get_bitlen( const mbedtls_pk_context * pxMbedtlsPkCtx )

configASSERT( mbedtls_rsa_info.get_bitlen );

return mbedtls_rsa_info.get_bitlen( pxMbedtlsPkCtx );
return mbedtls_rsa_info.get_bitlen( ( mbedtls_pk_context * ) pxMbedtlsPkCtx );
}

/*-----------------------------------------------------------*/
Expand Down Expand Up @@ -1009,8 +1009,8 @@ static int p11_rsa_check_pair( const void * pvPub,
{
configASSERT( mbedtls_rsa_info.check_pair_func );

return mbedtls_rsa_info.check_pair_func( pvPub,
pxMbedtlsPkCtx,
return mbedtls_rsa_info.check_pair_func( ( void * ) pvPub,
( mbedtls_pk_context * ) pxMbedtlsPkCtx,
lFRng,
pvPRng );
}
Expand Down Expand Up @@ -1112,7 +1112,7 @@ static void p11_rsa_debug( const mbedtls_pk_context * pxMbedtlsPkCtx,
{
configASSERT( mbedtls_rsa_info.debug_func );

mbedtls_rsa_info.debug_func( pxMbedtlsPkCtx, pxItems );
mbedtls_rsa_info.debug_func( ( mbedtls_pk_context * ) pxMbedtlsPkCtx, pxItems );
}

/*-----------------------------------------------------------*/
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static CK_RV readCertificateIntoContext( SSLContext_t * pSslContext,

/* Get the handle of the certificate. */
xResult = xFindObjectWithLabelAndClass( pSslContext->xP11Session,
pcLabelName,
( char * ) pcLabelName,
strnlen( pcLabelName,
pkcs11configMAX_LABEL_LENGTH ),
xClass,
Expand Down Expand Up @@ -643,7 +643,6 @@ static CK_RV initializeClientKeys( SSLContext_t * pxCtx,
CK_RV xResult = CKR_OK;
CK_SLOT_ID * pxSlotIds = NULL;
CK_ULONG xCount = 0;
CK_ATTRIBUTE xTemplate[ 2 ];
mbedtls_pk_type_t xKeyAlgo = ( mbedtls_pk_type_t ) ~0;

/* Get the PKCS #11 module/token slot count. */
Expand Down Expand Up @@ -686,7 +685,7 @@ static CK_RV initializeClientKeys( SSLContext_t * pxCtx,
{
/* Get the handle of the device private key. */
xResult = xFindObjectWithLabelAndClass( pxCtx->xP11Session,
pcLabelName,
( char * ) pcLabelName,
strnlen( pcLabelName,
pkcs11configMAX_LABEL_LENGTH ),
CKO_PRIVATE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\</PublicIncludeDirectories>
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\published\2-40-errata-1;.\</PublicIncludeDirectories>
<AllProjectIncludesArePublic>true</AllProjectIncludesArePublic>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_with_Libslirp|Win32'">
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\</PublicIncludeDirectories>
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\published\2-40-errata-1;.\</PublicIncludeDirectories>
<AllProjectIncludesArePublic>true</AllProjectIncludesArePublic>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -56,7 +56,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.5.1.h";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\published\2-40-errata-1;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
Expand All @@ -70,7 +70,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config_v3.5.1.h";WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\published\2-40-errata-1;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
path: "FreeRTOS-Plus/Source/Application-Protocols/coreMQTT-Agent"

- name: "corePKCS11"
version: "cb865c1"
version: "59875a9"
repository:
type: "git"
url: "https://github.com/FreeRTOS/corePKCS11.git"
Expand Down

0 comments on commit f063a40

Please sign in to comment.