[riot-notifications] [RIOT-OS/RIOT] pkg/edhoc-c: initial commit (#16295)

Francisco notifications at github.com
Fri Apr 9 16:21:24 CEST 2021


### Contribution description

This PR adds initial support for the [EDHOC-C](https://github.com/openwsn-berkeley/EDHOC-C) [edhoc](https://datatracker.ietf.org/doc/draft-ietf-lake-edhoc/) protocol. The pkg is up to date with draft 5. A test application is included that allows performing the handshake over COAP.

The current examples uses RPK keys, but x509 and c509 are also possible

Currently, the only supported crypto backend is wolfssl which is not very RAM friendly, the pkg currently supports HACL as well, but not the version in RIOT master.

@TimothyClaeys might want to take a look and can give a better status of the EDHOC implementation.

### Testing procedure

On native:

```
PORT=tap0 make -C tests/pkg_edhoc_c all test-with-config
```

On samr21-xpro:

```
BOARD=samr21-xpro make -C tests/pkg_edhoc_c flash test-with-config
```

```
2021-04-09 16:14:40,967 # init handshake fe80::204:2519:1801:a9ba
2021-04-09 16:14:40,970 # [initiator]: sending msg1 (37 bytes):
2021-04-09 16:14:40,974 # 0x0d 0x00 0x58 0x20 0x8d 0x3e 0xf5 0x6d
2021-04-09 16:14:40,978 # 0x1b 0x75 0x0a 0x43 0x51 0xd6 0x8a 0xc2
2021-04-09 16:14:40,982 # 0x50 0xa0 0xe8 0x83 0x79 0x0e 0xfc 0x80
2021-04-09 16:14:40,986 # 0xa5 0x38 0xa4 0x44 0xee 0x9e 0x2b 0x57
2021-04-09 16:14:40,988 # 0xe2 0x44 0x1a 0x7c 0x21
2021-04-09 16:14:40,993 # [responder]: received an EDHOC message (len 37):
2021-04-09 16:14:40,997 # 0x0d 0x00 0x58 0x20 0x8d 0x3e 0xf5 0x6d
2021-04-09 16:14:41,001 # 0x1b 0x75 0x0a 0x43 0x51 0xd6 0x8a 0xc2
2021-04-09 16:14:41,005 # 0x50 0xa0 0xe8 0x83 0x79 0x0e 0xfc 0x80
2021-04-09 16:14:41,009 # 0xa5 0x38 0xa4 0x44 0xee 0x9e 0x2b 0x57
2021-04-09 16:14:41,011 # 0xe2 0x44 0x1a 0x7c 0x21
2021-04-09 16:14:44,905 # [responder]: sending msg2 (46 bytes):
2021-04-09 16:14:44,909 # 0x58 0x20 0x52 0xfb 0xa0 0xbd 0xc8 0xd9
2021-04-09 16:14:44,912 # 0x53 0xdd 0x86 0xce 0x1a 0xb2 0xfd 0x7c
2021-04-09 16:14:44,916 # 0x05 0xa4 0x65 0x8c 0x7c 0x30 0xaf 0xdb
2021-04-09 16:14:44,920 # 0xfc 0x33 0x01 0x04 0x70 0x69 0x45 0x1b
2021-04-09 16:14:44,924 # 0xaf 0x35 0x37 0x4a 0xa3 0xf1 0xbd 0x5d
2021-04-09 16:14:44,927 # 0x02 0x8d 0x19 0xcf 0x3c 0x99
2021-04-09 16:14:44,931 # [initiator]: received a message (46 bytes):
2021-04-09 16:14:44,935 # 0x58 0x20 0x52 0xfb 0xa0 0xbd 0xc8 0xd9
2021-04-09 16:14:44,939 # 0x53 0xdd 0x86 0xce 0x1a 0xb2 0xfd 0x7c
2021-04-09 16:14:44,943 # 0x05 0xa4 0x65 0x8c 0x7c 0x30 0xaf 0xdb
2021-04-09 16:14:44,947 # 0xfc 0x33 0x01 0x04 0x70 0x69 0x45 0x1b
2021-04-09 16:14:44,951 # 0xaf 0x35 0x37 0x4a 0xa3 0xf1 0xbd 0x5d
2021-04-09 16:14:44,953 # 0x02 0x8d 0x19 0xcf 0x3c 0x99
2021-04-09 16:14:50,793 # [initiator]: sending msg3 (20 bytes):
2021-04-09 16:14:50,797 # 0x37 0x52 0xd5 0x53 0x5f 0x31 0x47 0xe8
2021-04-09 16:14:50,800 # 0x5f 0x1c 0xfa 0xcd 0x9e 0x78 0xab 0xf9
2021-04-09 16:14:50,803 # 0xe0 0xa8 0x1b 0xbf
2021-04-09 16:14:50,808 # [responder]: received an EDHOC message (len 20):
2021-04-09 16:14:50,811 # 0x37 0x52 0xd5 0x53 0x5f 0x31 0x47 0xe8
2021-04-09 16:14:50,815 # 0x5f 0x1c 0xfa 0xcd 0x9e 0x78 0xab 0xf9
2021-04-09 16:14:50,817 # 0xe0 0xa8 0x1b 0xbf
2021-04-09 16:14:50,820 # [responder]: finalize exchange
2021-04-09 16:14:52,770 # [responder]: handshake successfully completed
2021-04-09 16:14:52,774 # [initiator]: handshake successfully completed
2021-04-09 16:14:52,778 # [initiator]: Transcript hash 4 (32 bytes):
2021-04-09 16:14:52,782 # 0x7c 0xcf 0xde 0xdc 0x2c 0x10 0xca 0x03
2021-04-09 16:14:52,786 # 0x56 0xe9 0x57 0xb9 0xf6 0xa5 0x92 0xe0
2021-04-09 16:14:52,789 # 0xfa 0x74 0xdb 0x2a 0xb5 0x4f 0x59 0x24
2021-04-09 16:14:52,793 # 0x40 0x96 0xf9 0xa2 0xac 0x56 0xd2 0x07
2021-04-09 16:14:52,793 #
```
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/16295

-- Commit Summary --

  * pkg/nanocbor: bump version
  * pkg/edhoc-c: initial commit
  * tests/pkg_edhoc: initial import

-- File Changes --

    A pkg/edhoc-c/Makefile (28)
    A pkg/edhoc-c/Makefile.dep (18)
    A pkg/edhoc-c/Makefile.include (13)
    A pkg/edhoc-c/doc.txt (48)
    A pkg/edhoc-c/include/edhoc_config.h (109)
    A pkg/edhoc-c/patches/0001-treewide-ifdef-against-MODULE_HACL-WOLFSSL.patch (412)
    A pkg/edhoc-c/patches/0002-treewide-comment-out-wolfssl-options.h.patch (39)
    M pkg/nanocbor/Makefile (2)
    D pkg/nanocbor/patches/0001-Revert-decoder-Fix-return-codes-in-documentation-and.patch (92)
    A tests/pkg_edhoc_c/Makefile (37)
    A tests/pkg_edhoc_c/README.md (417)
    A tests/pkg_edhoc_c/common.c (143)
    A tests/pkg_edhoc_c/edhoc_keys.h (174)
    A tests/pkg_edhoc_c/initiator.c (289)
    A tests/pkg_edhoc_c/main.c (87)
    A tests/pkg_edhoc_c/responder.c (140)
    A tests/pkg_edhoc_c/tests-with-config/01-run.py (109)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16295.patch
https://github.com/RIOT-OS/RIOT/pull/16295.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210409/39794870/attachment.htm>


More information about the notifications mailing list