Skip to content

Enterprise_mode_+_wifi_configuraiton_api: update ODIN drivers to v3.7.0 RC1 #10454

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
merged 1 commit into from
May 20, 2019

Conversation

aqib-ublox
Copy link
Contributor

@aqib-ublox aqib-ublox commented Apr 23, 2019

Description

This pull requests contains

  • Enterprise mode supporting EAP_TLS and PEAP methods for enterprise security.

  • A new private API for wifi connect() as enterprise mode require certificates such as CA server and client certificate along with private key in addition to credentials for connection.

  • Wifi configuration API.

This release also contains following fixes

Tests Results

iar_mbed_os_log.txt
arm_mbed_os_logs.txt
gcc_arm_mbed_os_log.txt
arm_driver_log.txt
iar_driver_logs.txt
gcc_arm_driver_logs.txt
iar_ble_gatt_server.txt
gcc_arm_ble_gatt_server.txt
arm_ble_gatt_server.txt

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[X] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

A private API is provided for ODIN_W2 target against enterprise mode.

    nsapi_error_t connect(
        const char          *ssid,
        const char          *pass,
        nsapi_security_t  security,
        auth_cert_s         *cert_handle,
        const char          *username = NULL,
        const char          *user_pswd = NULL,
        uint8_t               channel = 0);

Application is required to pass certificate(CA cert or client cert) and key (private key) in PEM format currently. User is required to pass those certificates through cert_handle auth_cert_s and an appropriate security should be selected either NSAPI_SECURITY_EAP_TLS or NSAPI_SECURITY_PEAP.

For example:

static auth_cert_s   certificates;
_wifi = new OdinWiFiInterface(true);
#ifdef EAP_TLS_TESTING
    certificates.client_cert = &cert_data[0];
    certificates.client_prvt_key = &cert_data_key[0];
    certificates.ca_cert = NULL;
#elif defined(PEAP_TESTING)
    certificates.client_cert = NULL;
    certificates.client_prvt_key = NULL;
    certificates.ca_cert = &ca_cert_data[0];
#endif
_wifi->connect(ssid, pass, security, &certificates, _peap_username, _peap_user_pass, channel);

NOTE:
security could be NSAPI_SECURITY_EAP_TLS or NSAPI_SECURITY_PEAP

Configuration API

    virtual unsigned int get_config(void *setting);
    virtual void set_config(void *setting, cb_uint32 value);

@aqib-ublox aqib-ublox force-pushed the ublox_odin_driver_os_5_v3.7.0_rc1 branch from 0dda8c4 to c98c35e Compare April 23, 2019 10:26
@aqib-ublox
Copy link
Contributor Author

@MarceloSalazar can u ask ur team to start review as we need to target it in coming release i-e 12.2 most likely

@ciarmcom ciarmcom requested review from a team April 25, 2019 11:09
@ciarmcom
Copy link
Member

@aqib-ublox, thank you for your changes.
@ARMmbed/mbed-os-tls @ARMmbed/mbed-os-crypto @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@adbridge
Copy link
Contributor

@michalpasztamobica could you re-review please ?

Copy link
Contributor

@michalpasztamobica michalpasztamobica left a comment

Choose a reason for hiding this comment

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

I still think NSAPI_ERROR_CERT_SIZE is not necessary and NSAPI_ERROR_PARAMETER should be used instead.
@SeppoTakalo , what do you think?

@aqib-ublox
Copy link
Contributor Author

@SeppoTakalo what u suggest?

@SeppoTakalo
Copy link
Contributor

@SeppoTakalo what u suggest?

Use NSAPI_ERROR_PARAMETER so you are then not causing any changes to public Mbed OS APIs.

@aqib-ublox aqib-ublox force-pushed the ublox_odin_driver_os_5_v3.7.0_rc1 branch from c98c35e to 3eb8248 Compare April 29, 2019 10:13
@aqib-ublox
Copy link
Contributor Author

@SeppoTakalo what u suggest?

Use NSAPI_ERROR_PARAMETER so you are then not causing any changes to public Mbed OS APIs.

it's removed and replaced with NSAPI_ERROR_PARAMETER

@aqib-ublox
Copy link
Contributor Author

@MarceloSalazar waiting for review to be finalised?

@MarceloSalazar
Copy link

@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.

The main concern is about tls config change, requested help from tls team.

@@ -0,0 +1,52 @@
/* ODIN-W2 implementation of WiFi Config Interface
* Copyright (c) 2016 u-blox Malm� AB
Copy link
Contributor

Choose a reason for hiding this comment

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

year should be 2019

Add please SPDX identifier as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also here, SPDX identifier

already there LICENSE-2.0 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

SPDX-License-Identifier: Apache-2.0 is needed, as in other files

@@ -0,0 +1,117 @@
/* ODIN-W2 user Config Interface
* Copyright (c) 2016 u-blox Malm� AB
*
Copy link
Contributor

Choose a reason for hiding this comment

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

also here, SPDX identifier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@0xc0170 corrected

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 30, 2019

Functionality change

Only in targets code - can go to the patch release ? I see above note about 5.12.2 .

@aqib-ublox
Copy link
Contributor Author

aqib-ublox commented May 2, 2019

Functionality change

Only in targets code - can go to the patch release ? I see above note about 5.12.2 .

@0xc0170 couldn't get it? 5.12.2 is released so might be target in next patch release or u prefer it to be part of full release? in that case as per @MarceloSalazar code freeze for that is 30 May and that's too far. Please correct me if i am wrong

@0xc0170
Copy link
Contributor

0xc0170 commented May 2, 2019

Edited: this is extending security type, therefore it was as "functionality change". In this case, 5.13 would be appropriate.

@RonEld If you can help how to resolve that mbed config - it is the main outstanding one in this PR.

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.

Waiting for mbedtls config change

@aqib-ublox aqib-ublox force-pushed the ublox_odin_driver_os_5_v3.7.0_rc1 branch from 3c1a2c2 to 0282f1e Compare May 3, 2019 11:31
@aqib-ublox
Copy link
Contributor Author

@0xc0170 and @RonEld can u please acknowledge recent changset

@aqib-ublox
Copy link
Contributor Author

@0xc0170, @RonEld any update?

Copy link
Contributor

@RonEld RonEld left a comment

Choose a reason for hiding this comment

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

LGTM
The configuration for MBEDTLS_MPI_WINDOW_SIZE should be documented though, in case your users would like to change it in their user defined configuration.

@aqib-ublox
Copy link
Contributor Author

@0xc0170 ?

@MarceloSalazar
Copy link

@ARMmbed/mbed-os-maintainers please review and comment.
If possible, we'd like this to be released in the next patch release.

Copy link
Contributor

@k-stachowiak k-stachowiak left a comment

Choose a reason for hiding this comment

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

I left a question regarding a curious construct; otherwise I did not find any Mbed TLS related issues.

case ODIN_CFG_SET_FT_MODE: return cbTARGET_CFG_SET_FT_MODE;
case ODIN_CFG_GET_FT_MODE: return cbTARGET_CFG_GET_FT_MODE;
default:
MBED_ASSERT(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be asserting true? It would seem more natural to assert false upon encountering an unrecognized identifier.

Edit: there is one more such case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that's right @AmmadRehmat please see this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@k-stachowiak it's corrected thanks for pointing out

@aqib-ublox aqib-ublox force-pushed the ublox_odin_driver_os_5_v3.7.0_rc1 branch from 0282f1e to 43759c0 Compare May 8, 2019 12:55
case ODIN_CFG_SET_FT_MODE: return cbTARGET_CFG_SET_FT_MODE;
case ODIN_CFG_GET_FT_MODE: return cbTARGET_CFG_GET_FT_MODE;
default:
MBED_ASSERT(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@k-stachowiak corrected

case ODIN_POWER_SAVE_MODE_DEEP_SLEEP: return cbTARGET_POWER_SAVE_MODE_DEEP_SLEEP;
default:
MBED_ASSERT(false);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@k-stachowiak corrected

@aqib-ublox
Copy link
Contributor Author

@0xc0170 any update?

@aqib-ublox
Copy link
Contributor Author

@0xc0170 ?

@aqib-ublox
Copy link
Contributor Author

@MarceloSalazar whats status?

@adbridge
Copy link
Contributor

@0xc0170 please confirm you are happy with the licence updates. Running the CI in the meantime

@mbed-ci
Copy link

mbed-ci commented May 17, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@terrier1-github
Copy link

Hello, I'm working on IoT project and I want to use WiFi enterprise protocole (eap-tls) to connect my device, I recovered a EKV-ODIN-W2 board, but regarding the software part I don't know how to start, is it possible to recover a getting started for Enterprise mode for ODIN-W2 ?

@JanneKiiskila
Copy link
Contributor

@aqib-ublox @adbridge @0xc0170 to comment.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 21, 2022

cc @ARMmbed/team-ublox if anyone can help with the above question

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.