Skip to content

Commit

Permalink
Upload wifi-connection-manager 3.3.0.2136 [2049]
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Dec 15, 2023
1 parent 2567493 commit 8602aab
Show file tree
Hide file tree
Showing 12 changed files with 296 additions and 95 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ This library and its features are supported on the following Infineon platforms:

- [XMC7200D-E272K8384 kit (KIT_XMC72_EVK_MUR_43439M2)](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc72_evk/)

- [PSoC™ 62S2 evaluation kit (CY8CEVAL-062S2-CYW43022CUB)](https://www.infineon.com/cms/en/product/evaluation-boards/cy8ceval-062s2/)

**Note**: Virtual APIs are supported on all PSoC 62 devices, but they have only been tested on the CY8CEVAL-062S2-MUR-43439M2 kit.

## Dependent libraries
Expand Down
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ See the [README.md](./README.md) for a complete description of the Wi-Fi Connect

## Changelog

### v3.3.0

- WPS changes to support MBEDTLS version 3.4.0
- Added support for CY8CEVAL-062S2-CYW43022CUB kit

### v3.2.0

- Added support for KIT_XMC72_EVK_MUR_43439M2 kit
Expand Down
3 changes: 2 additions & 1 deletion docs/api_reference_manual/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ <h1><a class="anchor" id="section_supported_platforms"></a>
<li><a href="https://www.infineon.com/cms/en/product/evaluation-boards/cyw954907aeval1f/">CYW954907AEVAL1F Evaluation Kit(CYW954907AEVAL1F)</a></li>
<li><a href="https://www.infineon.com/cms/en/product/evaluation-boards/cyw943907aeval1f/">CYW943907AEVAL1F Evaluation Kit(CYW943907AEVAL1F)</a></li>
<li><a href="https://www.infineon.com/cms/en/product/evaluation-boards/cy8ceval-062s2/">PSoC&trade; 62S2 evaluation kit (CY8CEVAL-062S2-MUR-43439M2)</a></li>
<li><a href="https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc72_evk/">XMC7200D-E272K8384 kit (KIT_XMC72_EVK_MUR_43439M2)</a> <dl class="section note"><dt>Note</dt><dd>Virtual APIs are supported on all PSoC 62 devices, but they have only been tested on the CY8CEVAL-062S2-MUR-43439M2 kit.</dd></dl>
<li><a href="https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc72_evk/">XMC7200D-E272K8384 kit (KIT_XMC72_EVK_MUR_43439M2)</a></li>
<li><a href="https://www.infineon.com/cms/en/product/evaluation-boards/cy8ceval-062s2/">PSoC&trade; 62S2 evaluation kit (CY8CEVAL-062S2-CYW43022CUB)</a> <dl class="section note"><dt>Note</dt><dd>Virtual APIs are supported on all PSoC 62 devices, but they have only been tested on the CY8CEVAL-062S2-MUR-43439M2 kit.</dd></dl>
</li>
</ul>
<h1><a class="anchor" id="section_dependencies"></a>
Expand Down
43 changes: 43 additions & 0 deletions source/COMPONENT_43022/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
* materials ("Software") is owned by Cypress Semiconductor Corporation
* or one of its affiliates ("Cypress") and is protected by and subject to
* worldwide patent protection (United States and foreign),
* United States copyright laws and international treaty provisions.
* Therefore, you may use this Software only as provided in the license
* agreement accompanying the software package from which you
* obtained this Software ("EULA").
* If no EULA applies, Cypress hereby grants you a personal, non-exclusive,
* non-transferable license to copy, modify, and compile the Software
* source code solely for use in connection with Cypress's
* integrated circuit products. Any reproduction, modification, translation,
* compilation, or representation of this Software except as specified
* above is prohibited without the express written permission of Cypress.
*
* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
* reserves the right to make changes to the Software without notice. Cypress
* does not assume any liability arising out of the application or use of the
* Software or any product or circuit described in the Software. Cypress does
* not authorize its products for use in any products where a malfunction or
* failure of the Cypress product may reasonably be expected to result in
* significant property damage, injury or death ("High Risk Product"). By
* including Cypress's product in a High Risk Product, the manufacturer
* of such system or application assumes all risk of such use and in doing
* so agrees to indemnify Cypress against all liability.
*/

/**
* @file cy_chip_constant.h
* @brief Chip-specific constants
*/

#define WL_CHANSPEC_BAND_MASK (0xc000)
#define WL_CHANSPEC_BW_MASK (0x3800)
#define WL_CHANSPEC_BW_10 (0x0800)
#define WL_CHANSPEC_BW_20 (0x1000)
#define WL_CHANSPEC_BW_40 (0x1800)
8 changes: 7 additions & 1 deletion source/COMPONENT_MBEDTLS/cy_wps_aes_ctr_ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
#define AES_CCM_AUTH_AAD_FLAG 0x40
#define AES_CCM_CRYPT_FLAGS(iv_len) (AES_CCM_NONCE_LEN - 1 - iv_len)

/* NOTE:
* AES encrypt/decrypt functions are used for WPS functionality. Remaining non-used functions by WPS are kept under
* AES_SELF_TEST macro to increase the code-coverage of WCM library.
*/

#ifdef AES_SELF_TEST
/* AES-CTR mode encryption/decryption algorithm
* - max data_len is (AES_BLOCK_SZ * 2^16)
* - nonce must be AES_BLOCK_SZ bytes
Expand Down Expand Up @@ -111,7 +117,6 @@ int aes_crypt_ctr( mbedtls_aes_context *ctx, uint32_t length, const unsigned cha
return ( 0 );
}


/* AES-CCM mode MAC calculation
* - computes AES_CCM_AUTH_LEN MAC
* - nonce must be AES_CCM_NONCE_LEN bytes
Expand Down Expand Up @@ -287,6 +292,7 @@ int aes_decrypt_ccm( mbedtls_aes_context *ctx, uint32_t length, uint32_t aad_len

return ( 0 );
}
#endif

/* AES-CBC mode encryption/decryption algorithm with padding
* - handle partial plaintext blocks with padding
Expand Down
42 changes: 40 additions & 2 deletions source/COMPONENT_MBEDTLS/cy_wps_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "cy_wps_crypto.h"
#include "cyabs_rtos_impl.h"
#include "cyhal.h"

#include "cy_wps_mbedtls_version.h"
/******************************************************
* Macros
******************************************************/
Expand Down Expand Up @@ -78,7 +78,14 @@ extern int aes_cbc_crypt_pad_length_padding( mbedtls_aes_context *ctx, int mode,
cy_rslt_t cy_sha256( const unsigned char *input, size_t ilen, unsigned char output[32], int is224 )
{

#if MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_3
mbedtls_sha256( (uint8_t*) input, ilen, output, is224 );
#elif MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_2
mbedtls_sha256_ret( (uint8_t*) input, ilen, output, is224 );
#else
error "Unsupported MBEDTLS version"
#endif

return CY_RSLT_SUCCESS;
}

Expand Down Expand Up @@ -115,7 +122,14 @@ void cy_sha2_hmac_starts(cy_sha2_hmac_context *ctx, const unsigned char *key, ui
unsigned char sum[32];

if (keylen > 64) {
mbedtls_sha256_ret(key, keylen, sum, is224);
#if MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_3
mbedtls_sha256(key, keylen, sum, is224);
#elif MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_2
mbedtls_sha256_ret(key, keylen, sum, is224);
#else
error "Unsupported MBEDTLS version"
#endif

keylen = (is224) ? 28 : 32;
key = sum;
}
Expand All @@ -129,8 +143,15 @@ void cy_sha2_hmac_starts(cy_sha2_hmac_context *ctx, const unsigned char *key, ui
}

mbedtls_sha256_init(&ctx->ctx);
#if MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_3
mbedtls_sha256_starts(&ctx->ctx, is224);
mbedtls_sha256_update(&ctx->ctx, ctx->ipad, 64);
#elif MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_2
mbedtls_sha256_starts_ret(&ctx->ctx, is224);
mbedtls_sha256_update_ret(&ctx->ctx, ctx->ipad, 64);
#else
error "Unsupported MBEDTLS version"
#endif

memset(sum, 0, sizeof(sum));
}
Expand All @@ -140,7 +161,13 @@ void cy_sha2_hmac_starts(cy_sha2_hmac_context *ctx, const unsigned char *key, ui
*/
void cy_sha2_hmac_update(cy_sha2_hmac_context *ctx, const unsigned char *input, uint32_t ilen)
{
#if MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_3
mbedtls_sha256_update(&ctx->ctx, input, ilen);
#elif MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_2
mbedtls_sha256_update_ret(&ctx->ctx, input, ilen);
#else
error "Unsupported MBEDTLS version"
#endif
}

/*
Expand All @@ -165,12 +192,23 @@ void cy_sha2_hmac_finish(cy_sha2_hmac_context * ctx, unsigned char output[32])
*/
hlen = 32;

#if MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_3
mbedtls_sha256_finish(&ctx->ctx, tmpbuf);
mbedtls_sha256_starts(&ctx->ctx, is224);
mbedtls_sha256_update(&ctx->ctx, ctx->opad, 64);
mbedtls_sha256_update(&ctx->ctx, tmpbuf, hlen);
mbedtls_sha256_finish(&ctx->ctx, output);
mbedtls_sha256_free(&ctx->ctx);
#elif MBEDTLS_VERSION_MAJOR == MBEDTLS_MAJOR_VERSION_2
mbedtls_sha256_finish_ret(&ctx->ctx, tmpbuf);
mbedtls_sha256_starts_ret(&ctx->ctx, is224);
mbedtls_sha256_update_ret(&ctx->ctx, ctx->opad, 64);
mbedtls_sha256_update_ret(&ctx->ctx, tmpbuf, hlen);
mbedtls_sha256_finish_ret(&ctx->ctx, output);
mbedtls_sha256_free(&ctx->ctx);
#else
error "Unsupported MBEDTLS version"
#endif

memset(tmpbuf, 0, sizeof(tmpbuf));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,83 +1,79 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
* materials ("Software") is owned by Cypress Semiconductor Corporation
* or one of its affiliates ("Cypress") and is protected by and subject to
* worldwide patent protection (United States and foreign),
* United States copyright laws and international treaty provisions.
* Therefore, you may use this Software only as provided in the license
* agreement accompanying the software package from which you
* obtained this Software ("EULA").
* If no EULA applies, Cypress hereby grants you a personal, non-exclusive,
* non-transferable license to copy, modify, and compile the Software
* source code solely for use in connection with Cypress's
* integrated circuit products. Any reproduction, modification, translation,
* compilation, or representation of this Software except as specified
* above is prohibited without the express written permission of Cypress.
*
* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
* reserves the right to make changes to the Software without notice. Cypress
* does not assume any liability arising out of the application or use of the
* Software or any product or circuit described in the Software. Cypress does
* not authorize its products for use in any products where a malfunction or
* failure of the Cypress product may reasonably be expected to result in
* significant property damage, injury or death ("High Risk Product"). By
* including Cypress's product in a High Risk Product, the manufacturer
* of such system or application assumes all risk of such use and in doing
* so agrees to indemnify Cypress against all liability.
*/

/**
* @file cy_eapol.c
* @brief EAPOL handling for receiving EAPOL data from WHD
*/

#include "cy_eapol.h"

#include "whd_buffer_api.h"
#include <stdio.h>

/******************************************************
* Macros
******************************************************/

/******************************************************
* Constants
******************************************************/

/******************************************************
* Enumerations
******************************************************/

/******************************************************
* Type Definitions
******************************************************/

/******************************************************
* Structures
******************************************************/

/******************************************************
* Function Declarations
******************************************************/

/******************************************************
* Variables Definitions
******************************************************/

/******************************************************
* Function Definitions
******************************************************/
uint8_t* cy_eapol_get_eapol_data( whd_buffer_t packet, whd_interface_t interface )
{
return whd_buffer_get_current_piece_data_pointer(interface->whd_driver, packet);
}

uint16_t cy_get_eapol_packet_size( whd_buffer_t packet, whd_interface_t interface )
{
return whd_buffer_get_current_piece_size(interface->whd_driver, packet);
}
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
* materials ("Software") is owned by Cypress Semiconductor Corporation
* or one of its affiliates ("Cypress") and is protected by and subject to
* worldwide patent protection (United States and foreign),
* United States copyright laws and international treaty provisions.
* Therefore, you may use this Software only as provided in the license
* agreement accompanying the software package from which you
* obtained this Software ("EULA").
* If no EULA applies, Cypress hereby grants you a personal, non-exclusive,
* non-transferable license to copy, modify, and compile the Software
* source code solely for use in connection with Cypress's
* integrated circuit products. Any reproduction, modification, translation,
* compilation, or representation of this Software except as specified
* above is prohibited without the express written permission of Cypress.
*
* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
* reserves the right to make changes to the Software without notice. Cypress
* does not assume any liability arising out of the application or use of the
* Software or any product or circuit described in the Software. Cypress does
* not authorize its products for use in any products where a malfunction or
* failure of the Cypress product may reasonably be expected to result in
* significant property damage, injury or death ("High Risk Product"). By
* including Cypress's product in a High Risk Product, the manufacturer
* of such system or application assumes all risk of such use and in doing
* so agrees to indemnify Cypress against all liability.
*/

/** @file cy_wps_mbedtls_version.h
* @brief MBEDTLS major version for WPS
*/

#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include "mbedtls/version.h"

#define MBEDTLS_MAJOR_VERSION_3 (3)
#define MBEDTLS_MAJOR_VERSION_2 (2)

/******************************************************
* Macros
******************************************************/

/******************************************************
* Constants
******************************************************/

/******************************************************
* Enumerations
******************************************************/

/******************************************************
* Type Definitions
******************************************************/

/******************************************************
* Structures
******************************************************/

/******************************************************
* Global Variables
******************************************************/

/******************************************************
* Function Declarations
******************************************************/

#ifdef __cplusplus
} /*extern "C" */
#endif
Loading

0 comments on commit 8602aab

Please sign in to comment.