Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protocomm component should not use #if CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION guard (IDFGH-7925) #9443

Closed
AxelLin opened this issue Jul 27, 2022 · 2 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@AxelLin
Copy link
Contributor

AxelLin commented Jul 27, 2022

Environment

  • IDF version: v5.0-dev-4379-g36f49f361c

Problem Description

People may implement a customized provision function that uses protocomm directly.
Having CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION in protocom assumes wifi_provisioning
is the only user to use protocomm which is wrong.
The lower layer (protocomm) component should not use any #if/#ifdef guard from upper layer (wifi_provisioning) component.

The bug:
When I use esp_prov.py to test my own provision code it fails if setting "--sec_ver 0".
i.e. it fails if CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y && "--sec_ver 0".
So I notice it's very strange that I need to change wifi_provisioning component setting even though I didn't use that component.

The suggestion:
The protocomm component should provide a config (maybe an argument or a new function) to allow setting enable encryption or not.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 27, 2022
@github-actions github-actions bot changed the title protocomm component should not use #if CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION guard protocomm component should not use #if CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION guard (IDFGH-7925) Jul 27, 2022
@rahult-github
Copy link
Collaborator

Hi @AxelLin,

Having CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION in protocom assumes wifi_provisioning
is the only user to use protocomm which is wrong.

Isn't the option "CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION " configurable from menuconfig ? IDF is a generic code targeted for wide audience and user has the option to enable / disable features as per their use case .

Thanks,

@AxelLin
Copy link
Contributor Author

AxelLin commented Jul 27, 2022

@rahult-github

It's in menuconfig:
Wi-Fi Provisioning Manager --->
[ ] Force Link Encryption during characteristic Read / Write

Why should I change this setting even though I'm sure I don't use "Wi-Fi Provisioning Manager".
So I disagree with your comment. You can make it better.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Jan 19, 2023
espressif-bot pushed a commit that referenced this issue Mar 4, 2023
…nfig

- `protocomm` depends on a config option `CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION`
  from `wifi_provisioning`; however, a lower layer component (`protocomm`) should
  not have any `#ifdef` guard dependent on an upper layer component (`wifi_provisioning`).
- Added a new `ble_link_encryption` flag in `protocomm_ble_config_t` to manage the same

Closes #9443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants