-
Notifications
You must be signed in to change notification settings - Fork 116
Security Manager example #136
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
Conversation
@pan- @donatieng please review |
|
||
The application demonstrates usage as a central and a peripheral. The central will connect to any connectable device present. Please have one ready and advertising. Application will attempt pairing. Please authorise your peer device to pair. | ||
|
||
Upon success it will disconnect and start advertising to demonstrate usage as a peripheral. Please scan and connect using your peer device. Upon connection grant pairing if prompted. Upon success the application will disconnect. Observe the terminal to keep track of the sequence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phase two will start whether phase 1 succeed or not. Could you indicate that if phase 1 fail, the peripheral will request pairing or if phase 1 succeeded then the link is encrypted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reversed the order
BLE_SM/source/main.cpp
Outdated
} | ||
|
||
protected: | ||
/** Override to start chosen activity when initialisation completes */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to have a protected block here ? private seems fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, removed
BLE_SM/source/main.cpp
Outdated
return; | ||
} | ||
|
||
/* Tell the security manager to use methids in this class to inform us |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: methids => methods
BLE_SM/source/main.cpp
Outdated
return; | ||
} | ||
|
||
_ble.securityManager().setPairingRequestAuthorisation(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining what this means ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good and useful example. However phase 1 is hard to use in a crowded environment and it will be hard to automate tests for it.
Would it be good to add a configuration step where the device act as a peripheral and wait for a connection. The device which has initiated the connection will then be used in phase 1.
Will address comments and change the phases around so that we can store the address of the peer in the example app. |
@pan- review and merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work :), 2 things to update from my point of view and good for merging then
BLE_SM/mbed-os.lib
Outdated
@@ -0,0 +1 @@ | |||
https://github.com/paul-szczepanek-arm/mbed-os/tree/palsm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make it point to the 5.8 branch?
"target.features_add": ["BLE"], | ||
"target.extra_labels_add": ["ST_BLUENRG"] | ||
}, | ||
"NUCLEO_F401RE": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document that it is using the Cordio port for ST (as opposed to ST's official stack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note made about it in the readme
I've tried the amended example and it may not work if the phone advertise another address. |
BLE_SM/mbed-os.lib
Outdated
@@ -1 +1 @@ | |||
https://github.com/ARMmbed/mbed-os/tree/mbed-os-5.8 | |||
https://github.com/ARMmbed/mbed-os/tree/mbed-os-5.8.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use a commit ID ? So it's aligned with other example.
To demonstrate the basic use of the Security Manager and help validate the new features.
There are no tests for it yet, the ccli-app is being developed in parallel as it needs to provide access to the new API calls.