Skip to content

Remove WEP security Green Tea Test case as the WEP security Key are sequence of Hex Values #13654

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

Merged

Conversation

balajicyp
Copy link
Contributor

@balajicyp balajicyp commented Sep 22, 2020

Summary of changes

Remove WEP security Test Case with NULL as WEP security Key are sequence of Hex Values , the character "NULL" is (0x00) it is a valid value ( for ex: this is key index, followed by length and hex key array).

Impact of changes

Remove the test case for NULL( "" )key with NSAPI_SECURITY_WEP to test return value with NSAPI_ERROR_PARAMETER

The set_credentials(const char *ssid, const char *pass, nsapi_security_t security) API has no key length, the key length is derived by using strlen(pass), which works if the pass ( is a string) , but in case of NSAPI_SECURITY_WEP and NSAPI_SECURITY_WPA2_ENT, the key does not happen to be string but a hex char array.

WEP security Key are sequence of Hex Values , the character "NULL" is (0x00) it is a valid value ( for ex: this is key index, followed by length and hex key array).

The key index 0 , 1, 2, 3 are keys used for an WiFi Access point.

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Sep 22, 2020
@ciarmcom ciarmcom requested a review from a team September 22, 2020 02:00
@ciarmcom
Copy link
Member

@balajicyp, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a reason for removal to the commit message.

I do not fully understand why "" is being removed ?

@balajicyp
Copy link
Contributor Author

Hi @0xc0170

The set_credentials(const char *ssid, const char *pass, nsapi_security_t security) API has no key length, the key length is derived by using strlen(pass), which works if the pass ( is a string) , but in case of NSAPI_SECURITY_WEP and NSAPI_SECURITY_WPA2_ENT, the key does not happen to be string but a hex char array.

In the implementation of the WhdSTAInteface::set_credentials() the following line

(strlen(pass) == 0 && (security != NSAPI_SECURITY_NONE && security != NSAPI_SECURITY_WPA2_ENT)) will fail for WEP even with Valid key as the key is hex array ( key index 0, 5 ( length for 5 bytes = 40 bit key), key_bytes[] ) the first key index 0 (strlen(pass) == 0 ) will fail causing the Green Tea test failure with change in PR #13602

Thanks
Balaji.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 30, 2020

Thanks , that helps me to understand this fix. Please amend the commit message and add details.

@balajicyp
Copy link
Contributor Author

@0xc0170

I have updated the commit message, please check if it is ok.

Thank you
Balaji.

@balajicyp
Copy link
Contributor Author

@0xc0170

Anything else you need from me for this issue?

Thanks
Balaji.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 15, 2020

I have updated the commit message, please check if it is ok.

I don't see the commit message updated, please review. Once done, let us know, we shall start CI

@balajicyp
Copy link
Contributor Author

@0xc0170 ,

I have updated the "Summary of Changes " sections to below please review the same

Remove WEP security Test Case with NULL as WEP security Key are sequence of Hex Values , the character "NULL" is (0x00) it is a valid value ( for ex: this is key index, followed by length and hex key array).

Thanks
Balaji

@balajicyp balajicyp changed the title Remove WEP security Green Tea Test case with NULL Remove WEP security Green Tea Test case as the WEP security Key are sequence of Hex Values Oct 15, 2020
@mergify mergify bot added needs: CI and removed needs: work labels Oct 17, 2020
@mbed-ci
Copy link

mbed-ci commented Oct 17, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants