Skip to content

Commit

Permalink
Upload wifi-connection-manager 3.3.1.2233 [2307]
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Mar 28, 2024
1 parent 8602aab commit 90accf3
Show file tree
Hide file tree
Showing 38 changed files with 220 additions and 188 deletions.
12 changes: 8 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ See the [README.md](./README.md) for a complete description of the Wi-Fi Connect
| ------- | ---------- |
| The `cy_wcm_deinit` API does not bring down the network stack because the default underlying lwIP stack does not have an implementation for deinit. Therefore, the expectation is that `cy_wcm_init` and `cy_wcm_deinit` APIs should be invoked only once. | No workaround. Support will be added in a future release. |
| The `cy_wcm_connect_ap` API does not connect to AP if the MAC address is specified as a connection parameter.| No workaround. This issue will be fixed in future release. |
| IAR 9.30 toolchain throws build errors on Debug mode if the application explicitly includes the *iar_dlmalloc.h* file | Add `'--advance-heap'` to `LDFLAGS` in the application Makefile. |
| IAR 9.40.2 toolchain throws build errors on Debug mode if the application explicitly includes the *iar_dlmalloc.h* file | Add `'--advanced_heap'` to `LDFLAGS` in the application Makefile. |

## Changelog

### v3.3.1

- Minor bug fixes

### v3.3.0

- WPS changes to support MBEDTLS version 3.4.0
Expand Down Expand Up @@ -125,8 +129,8 @@ This version of the library was validated for compatibility with the following s

| Software and tools | Version |
| :--- | :----: |
| ModusToolbox™ software environment | 3.1 |
| ModusToolbox™ Device Configurator | 4.10 |
| ModusToolbox™ software environment | 3.2 |
| ModusToolbox™ Device Configurator | 4.20 |
| GCC Compiler | 11.3.1 |
| IAR Compiler | 9.30 |
| IAR Compiler | 9.40.2 |
| Arm® Compiler 6 | 6.16 |
144 changes: 72 additions & 72 deletions docs/api_reference_manual/html/index.html

Large diffs are not rendered by default.

52 changes: 33 additions & 19 deletions include/cy_wcm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down Expand Up @@ -114,23 +114,29 @@ extern "C" {
/******************************************************
* Constants
******************************************************/
#define CY_WCM_MAX_SSID_LEN (32) /**< Max SSID length. */
#define CY_WCM_MAX_PASSPHRASE_LEN (63) /**< Max passphrase length. */
#define CY_WCM_MIN_PASSPHRASE_LEN (8) /**< Min passphrase length. */
#define CY_WCM_MAC_ADDR_LEN (6) /**< MAC address length. */
#define CY_WCM_MAX_IE_LENGTH (3) /**< Maximum Length of Information Element */
#define WEP_ENABLED 0x0001 /**< Flag to enable WEP security. */
#define TKIP_ENABLED 0x0002 /**< Flag to enable TKIP encryption. */
#define AES_ENABLED 0x0004 /**< Flag to enable AES encryption. */
#define SHARED_ENABLED 0x00008000 /**< Flag to enable shared key security. */
#define WPA_SECURITY 0x00200000 /**< Flag to enable WPA security. */
#define WPA2_SECURITY 0x00400000 /**< Flag to enable WPA2 security. */
#define WPA2_SHA256_SECURITY 0x00800000 /**< Flag to enable WPA2 SHA256 Security */
#define WPA3_SECURITY 0x01000000 /**< Flag to enable WPA3 PSK security. */
#define ENTERPRISE_ENABLED 0x02000000 /**< Flag to enable enterprise security. */
#define WPS_ENABLED 0x10000000 /**< Flag to enable WPS security. */
#define IBSS_ENABLED 0x20000000 /**< Flag to enable IBSS mode. */
#define FBT_ENABLED 0x40000000 /**< Flag to enable FBT. */
#define CY_WCM_MAX_SSID_LEN (32) /**< Max SSID length. */
#define CY_WCM_MAX_PASSPHRASE_LEN (63) /**< Max passphrase length. */
#define CY_WCM_MIN_PASSPHRASE_LEN (8) /**< Min passphrase length. */
#define CY_WCM_MAC_ADDR_LEN (6) /**< MAC address length. */
#define CY_WCM_MAX_IE_LENGTH (3) /**< Maximum Length of Information Element */
#define WEP_ENABLED 0x0001 /**< Flag to enable WEP security. */
#define TKIP_ENABLED 0x0002 /**< Flag to enable TKIP encryption. */
#define AES_ENABLED 0x0004 /**< Flag to enable AES encryption. */
#define SHARED_ENABLED 0x00008000 /**< Flag to enable shared key security. */
#define WPA_SECURITY 0x00200000 /**< Flag to enable WPA security. */
#define WPA2_SECURITY 0x00400000 /**< Flag to enable WPA2 security. */
#ifndef COMPONENT_CAT5
#define WPA2_SHA256_SECURITY 0x00800000 /**< Flag to enable WPA2 SHA256 Security */
#endif
#define WPA3_SECURITY 0x01000000 /**< Flag to enable WPA3 PSK security. */
#define ENTERPRISE_ENABLED 0x02000000 /**< Flag to enable enterprise security. */
#ifdef COMPONENT_CAT5
#define SHA256_1X 0x04000000 /**< Flag 1X with SHA256 key derivation */
#define SUITE_B_SHA384 0x08000000 /**< Flag to enable Suite B-192 SHA384 Security */
#endif
#define WPS_ENABLED 0x10000000 /**< Flag to enable WPS security. */
#define IBSS_ENABLED 0x20000000 /**< Flag to enable IBSS mode. */
#define FBT_ENABLED 0x40000000 /**< Flag to enable FBT. */

/** WPS password length for PIN mode. */
#define CY_WCM_WPS_PIN_LENGTH (9)
Expand Down Expand Up @@ -179,7 +185,11 @@ typedef enum
CY_WCM_SECURITY_WPA_AES_PSK = ( WPA_SECURITY | AES_ENABLED ), /**< WPA PSK security with AES. */
CY_WCM_SECURITY_WPA_MIXED_PSK = ( WPA_SECURITY | AES_ENABLED | TKIP_ENABLED ), /**< WPA PSK security with AES and TKIP. */
CY_WCM_SECURITY_WPA2_AES_PSK = ( WPA2_SECURITY | AES_ENABLED ), /**< WPA2 PSK security with AES. */
#ifndef COMPONENT_CAT5
CY_WCM_SECURITY_WPA2_AES_PSK_SHA256 = ( WPA2_SECURITY | WPA2_SHA256_SECURITY | AES_ENABLED ), /**< WPA2 PSK SHA256 Security with AES */
#else
CY_WCM_SECURITY_WPA2_AES_PSK_SHA256 = ( WPA2_SECURITY | SHA256_1X | AES_ENABLED ), /**< WPA2 PSK SHA256 Security with AES */
#endif
CY_WCM_SECURITY_WPA2_TKIP_PSK = ( WPA2_SECURITY | TKIP_ENABLED ), /**< WPA2 PSK security with TKIP. */
CY_WCM_SECURITY_WPA2_MIXED_PSK = ( WPA2_SECURITY | AES_ENABLED | TKIP_ENABLED ), /**< WPA2 PSK security with AES and TKIP. */
CY_WCM_SECURITY_WPA2_FBT_PSK = ( WPA2_SECURITY | AES_ENABLED | FBT_ENABLED), /**< WPA2 FBT PSK security with AES and TKIP. */
Expand All @@ -194,7 +204,11 @@ typedef enum
CY_WCM_SECURITY_WPA2_AES_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED), /**< WPA2 Enterprise Security with AES. */
CY_WCM_SECURITY_WPA2_MIXED_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED | TKIP_ENABLED), /**< WPA2 Enterprise Security with AES and TKIP. */
CY_WCM_SECURITY_WPA2_FBT_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED | FBT_ENABLED), /**< WPA2 Enterprise Security with AES and FBT. */

#ifdef COMPONENT_CAT5
CY_WCM_SECURITY_WPA3_192BIT_ENT = (ENTERPRISE_ENABLED | WPA3_SECURITY | SUITE_B_SHA384 | AES_ENABLED), /**< WPA3 192-BIT Enterprise Security with AES */
CY_WCM_SECURITY_WPA3_ENT = (ENTERPRISE_ENABLED | WPA3_SECURITY | SHA256_1X | AES_ENABLED), /**< WPA3 Enterprise Security with AES GCM-256 */
CY_WCM_SECURITY_WPA3_ENT_AES_CCMP = (ENTERPRISE_ENABLED | WPA3_SECURITY | WPA2_SECURITY | SHA256_1X | AES_ENABLED), /**< WPA3 Enterprise Security with AES CCM-128 */
#endif
CY_WCM_SECURITY_IBSS_OPEN = ( IBSS_ENABLED ), /**< Open security on IBSS ad hoc network. */
CY_WCM_SECURITY_WPS_SECURE = ( WPS_ENABLED | AES_ENABLED), /**< WPS with AES security. */

Expand Down
2 changes: 1 addition & 1 deletion include/cy_wcm_error.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion include/cy_wcm_internal.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion include/cy_wcm_log.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_43012/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_43022/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_43438/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_43439/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_4343W/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_4373/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_4390X/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_55500/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_55900/cy_chip_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_MBEDTLS/cy_wps_aes_ctr_ccm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_MBEDTLS/cy_wps_crypto.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_MBEDTLS/cy_wps_crypto.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_MBEDTLS/cy_wps_mbedtls_version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/Utilities/TLV/tlv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/Utilities/TLV/tlv.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/cy_wcm_wps.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/cy_wps.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
58 changes: 12 additions & 46 deletions source/COMPONENT_WPS/cy_wps_common.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down Expand Up @@ -52,6 +52,9 @@
#include "whd_buffer_api.h"
#include "whd_types.h"
#include "cyhal.h"
#ifdef COMPONENT_MBEDTLS
#include "entropy_poll.h"
#endif

/******************************************************
* Macros
Expand Down Expand Up @@ -340,59 +343,22 @@ uint32_t cy_host_get_timer( void* workspace )
return host->timer_timeout;
}

#ifndef COMPONENT_4390X
static int trng_get_bytes(cyhal_trng_t *obj, uint8_t *output, size_t length, size_t *output_length)
{
uint32_t offset = 0;
/* If output is not word-aligned, write partial word */
uint32_t prealign = (uint32_t)((uintptr_t)output % sizeof(uint32_t));
if (prealign != 0) {
uint32_t value = cyhal_trng_generate(obj);
uint32_t count = sizeof(uint32_t) - prealign;
memmove(&output[0], &value, count);
offset += count;
}
/* Write aligned full words */
for (; offset < length - (sizeof(uint32_t) - 1u); offset += sizeof(uint32_t)) {
*(uint32_t *)(&output[offset]) = cyhal_trng_generate(obj);
}
/* Write partial trailing word if requested */
if (offset < length) {
uint32_t value = cyhal_trng_generate(obj);
uint32_t count = length - offset;
memmove(&output[offset], &value, count);
offset += count;
}
*output_length = offset;
return 0;
}
#endif
cy_rslt_t cy_host_random_bytes( void* buffer, size_t buffer_length, size_t* output_length )
{
#ifndef COMPONENT_4390X
uint8_t* p = buffer;
size_t length = 0;
#ifdef COMPONENT_MBEDTLS
int result = 0;
size_t length;

cyhal_trng_t obj;
int ret;
cy_rslt_t result;

result = cyhal_trng_init(&obj);
if( result != CY_RSLT_SUCCESS)
{
cy_wcm_log_msg(CYLF_MIDDLEWARE, CY_LOG_ERR, "Failed to initialize hal TRNG \r\n");
return result;
}

ret = trng_get_bytes(&obj, p, buffer_length, (size_t*) &length);
if( ret != CY_RSLT_SUCCESS)
result = mbedtls_hardware_poll(NULL, (unsigned char*)buffer, buffer_length, &length);
if(result != 0)
{
cy_wcm_log_msg(CYLF_MIDDLEWARE, CY_LOG_ERR, "Failed to initialize random bytes \r\n");
return result;
cy_wcm_log_msg(CYLF_MIDDLEWARE, CY_LOG_ERR, "mbedtls_hardware_poll failed \r\n");
return CY_RSLT_WPS_ERROR;
}

*output_length = length;
cyhal_trng_free(&obj);
#endif
#else
/* 43907 kits does not have TRNG module. Get the random
* number from wifi-mw-core internal PRNG API. */
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/cy_wps_enrollee.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/include/cy_eapol.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/include/cy_template_wps_packets.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/COMPONENT_WPS/include/cy_wps.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
Loading

0 comments on commit 90accf3

Please sign in to comment.