Skip to content

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

Merged
merged 16 commits into from
May 25, 2018
Merged

Conversation

paul-szczepanek-arm
Copy link
Member

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.

@paul-szczepanek-arm
Copy link
Member Author

@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.
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

reversed the order

}

protected:
/** Override to start chosen activity when initialisation completes */
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

nope, removed

return;
}

/* Tell the security manager to use methids in this class to inform us
Copy link
Member

Choose a reason for hiding this comment

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

typo: methids => methods

return;
}

_ble.securityManager().setPairingRequestAuthorisation(true);
Copy link
Member

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 ?

Copy link
Member

@pan- pan- left a 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.

@paul-szczepanek-arm
Copy link
Member Author

Will address comments and change the phases around so that we can store the address of the peer in the example app.

@paul-szczepanek-arm
Copy link
Member Author

@pan- review and merge?

Copy link
Contributor

@donatieng donatieng left a 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

@@ -0,0 +1 @@
https://github.com/paul-szczepanek-arm/mbed-os/tree/palsm
Copy link
Contributor

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": {
Copy link
Contributor

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)

Copy link
Member Author

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

@pan-
Copy link
Member

pan- commented Mar 14, 2018

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.

I've tried the amended example and it may not work if the phone advertise another address.
We can use manufacturer data in advertising payload as a more reliable option.

@@ -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
Copy link
Member

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.

@donatieng donatieng merged commit b818bdb into ARMmbed:master May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants