Skip to content

Commit

Permalink
coap: Use published tools instead of custom Python script
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Jun 25, 2024
1 parent b9d59b0 commit ae07353
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/coap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ This application is a work in progress demo of running CoAP with OSCORE/EDHOC se

* Run on any board with networking, eg. `laze build -b particlex-xenon run`.
* [Set up networking](../README.md).
* Run `./fauxhoc.py`. This will establish a secure CoAP connection using EDHOC and OSCORE,
and show some interactions and eventually the log of the device.
* Running multiple concurrent `./fauxhoc.py` instances is supported,
* Run `pipx run coap-console coap://10.42.0.61 --credentials client.diag`,
which establishes a secure CoAP connection using EDHOC and OSCORE,
and shows the log of the device.
* Run `pipx run --spec 'aiocoap[all]' aiocoap-client coap://10.42.0.61/.well-known/core --credentials client.diag`
to show what else the device can do.
If you kept the log running, you will see that every new command runs through EDHOC once:
aiocoap does not currently attempt to persist EDHOC derived OSCORE contexts across runs.
* Running multiple concurrent terminal instances is supported,
up to the maximum number of security contexts that are stored (currently 4).
* There is also `./fauxhoc.py`, which did EDHOC manually before it was integrated in aiocoap.

## Roadmap

Expand Down
1 change: 1 addition & 0 deletions examples/coap/client.cosekey
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{1: 2, -1: 1, -4: h'fb13adeb6518cee5f88417660841142e830a81fe334380a953406a1305e8706b'}
12 changes: 12 additions & 0 deletions examples/coap/client.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"coap://10.42.0.61/*": {
"edhoc-oscore": {
"suite": 2,
"method": 3,
"own_cred_style": "by-key-id",
"own_cred": {14: {2: "42-50-31-FF-EF-37-32-39", 8: {1: {1: 2, 2: h'2b', -1: 1, -2: h'ac75e9ece3e50bfc8ed60399889522405c47bf16df96660a41298cb4307f7eb6', -3: h'6e5de611388a4b8a8211334ac7d37ecb52a387d257e6db3c2a93df21ff3affc8'}}}},
"private_key_file": "client.cosekey",
"peer_cred": {14: {2: "", 8: {1: {1: 2, 2: h'0a', -1: 1, -2: h'bbc34960526ea4d32e940cad2a234148ddc21791a12afbcbac93622046dd44f0', -3: h'4519e257236b2a0ce2023f0931f1f386ca7afda64fcde0108c224c51eabf6072'}}}},
}
},
}

0 comments on commit ae07353

Please sign in to comment.