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

Generate OSCORE object and use it for endpoint creation #736

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
708e734
Generate OSCORE object and use it for endpoint creation
rikard-sics Sep 12, 2019
8fc7bfc
Removed Californium dependencies from leshan-client-core
rikard-sics Sep 17, 2019
dc37bd9
Removed static initializers from Oscore class, instead use constructors
rikard-sics Sep 17, 2019
ebc728a
Use hex string manipulation method from Leshan rather than adding new
rikard-sics Sep 17, 2019
dd58e43
Renamed initialization method for OSCORE only in Security object
rikard-sics Sep 17, 2019
ecebdfa
Updated Security object xml and introduced link to OSCORE object
rikard-sics Sep 18, 2019
3e7db26
Use link from Security to find OSCORE object when creating ServerInfo
rikard-sics Sep 18, 2019
ae73ab2
Modified OSCORE object to take an instance id in its constructor
rikard-sics Sep 18, 2019
495d501
Removed OSCORE endpoint create method and added db parameter to others
rikard-sics Sep 18, 2019
6617c21
Two small fixes
rikard-sics Sep 18, 2019
a255bd6
Do not iterate to find OSCORE object in ServersInfoExtractor
rikard-sics Sep 18, 2019
3a4e777
Removed SecurityMode for OSCORE. Instead use OSCORE Security Mode link
rikard-sics Sep 18, 2019
401db2b
Set client name as client OSCORE Sender ID
rikard-sics Sep 18, 2019
a83918e
Updated print statement to use LOG instead
rikard-sics Sep 18, 2019
40213f6
Fix for clients to register using name configured in server interface
rikard-sics Sep 18, 2019
17098a7
Undid the change to isSecure method in ServerInfo
rikard-sics Sep 18, 2019
7116077
Moved creation of OSCORE endpoint to a better place
rikard-sics Sep 18, 2019
0138768
Applying Leshan Eclipse formatter to code and small comment fixes
rikard-sics Sep 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ public Oscore() {
/**
* Default constructor.
*/
public Oscore(String masterSecret, String senderId, String recipientId, int aeadAlgorithm, int hkdfAlgorithm, String masterSalt) {
this.masterSecret = masterSecret;
public Oscore(int instanceId, String masterSecret, String senderId, String recipientId, int aeadAlgorithm, int hkdfAlgorithm, String masterSalt) {
this.setId(instanceId);
Copy link
Contributor

Choose a reason for hiding this comment

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

clearly not a big deal but you can use super(id)

Copy link
Contributor Author

@rikard-sics rikard-sics Sep 18, 2019

Choose a reason for hiding this comment

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

True, I will change that as part of the next commit. Done in commit 6617c21

this.masterSecret = masterSecret;
this.senderId = senderId;
this.recipientId = recipientId;
this.aeadAlgorithm = aeadAlgorithm;
Expand All @@ -82,8 +83,8 @@ public Oscore(String masterSecret, String senderId, String recipientId, int aead
* masterSalt = "";
*
*/
public Oscore(String masterSecret, String senderId, String recipientId) {
this(masterSecret, senderId, recipientId, 10, -10, "");
public Oscore(int instanceId, String masterSecret, String senderId, String recipientId) {
this(instanceId, masterSecret, senderId, recipientId, 10, -10, "");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,7 @@ public static void createAndStartClient(String endpoint, String localAddress, in
clientPrivateKey.getEncoded(), serverCertificate.getEncoded()));
initializer.setInstancesForObject(SERVER, new Server(123, 30, BindingMode.U, false));
} else if (useOSCore) {
Oscore oscoreObject = new Oscore("11223344", "AA", "BB"); //Hardcoded values
oscoreObject.setId(12346);
Oscore oscoreObject = new Oscore(12345, "11223344", "AA", "BB"); //Hardcoded values
initializer.setInstancesForObject(SECURITY, oscoreOnly(serverURI, 123, oscoreObject.getId()));
initializer.setInstancesForObject(OSCORE, oscoreObject);
initializer.setInstancesForObject(SERVER, new Server(123, 30, BindingMode.U, false));
Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding your remarks here :

One issue I had was how exactly to link the Security and Oscore objects together. I now see your suggestion here: #726 (comment)

To be able to do that, you will probably need to add a new XML version of security object.

You should get it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The security object xml has been updated and a link to the OSCORE object introduced in commit ecebdfa

Expand Down