Skip to content

Commit

Permalink
OSCORE: Add in interopability tests
Browse files Browse the repository at this point in the history
See https://core-wg.github.io/oscore/test-spec5.html

Add in new test server oscore-interop-server to provide the necessary
functionality.

Add in script and configuration files to run the tests locally.
  • Loading branch information
mrdeep1 committed Jan 14, 2023
1 parent dac6bd3 commit 7623e0f
Show file tree
Hide file tree
Showing 12 changed files with 1,132 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ examples/coap-rd-*
examples/coap-server
examples/coap-server-*
examples/coap-tiny
examples/oscore-interop-server
examples/*.exe

# the include/ folder
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ if(ENABLE_EXAMPLES)

add_executable(tiny ${CMAKE_CURRENT_LIST_DIR}/examples/tiny.c)
target_link_libraries(tiny PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME})

add_executable(oscore-interop-server
${CMAKE_CURRENT_LIST_DIR}/examples/oscore-interop-server.c)
target_link_libraries(oscore-interop-server
PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME})
endif()
endif()

Expand Down Expand Up @@ -750,7 +755,7 @@ if(ENABLE_EXAMPLES)
COMPONENT dev)
if(NOT WIN32)
install(
TARGETS etsi_iot_01 tiny
TARGETS etsi_iot_01 tiny oscore-interop-server
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT dev)
endif()
Expand Down
20 changes: 18 additions & 2 deletions examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@
# This file is part of the CoAP C library libcoap. Please see README and
# COPYING for terms of use.

EXTRA_DIST = share.libcoap.examples.Makefile share.libcoap.examples.README
EXTRA_DIST = \
share.libcoap.examples.Makefile \
share.libcoap.examples.README \
coap_list.h \
getopt.c \
interop/a_client.conf \
interop/b_server.conf \
interop/c_client.conf \
interop/d_server.conf \
interop/e_client.conf \
interop/f_client.conf \
interop/g_client.conf \
oscore_testcases.sh

# just do nothing if 'BUILD_EXAMPLES' isn't defined
if BUILD_EXAMPLES
Expand Down Expand Up @@ -38,7 +50,7 @@ if HAVE_SERVER_SUPPORT

bin_PROGRAMS += coap-server@LIBCOAP_DTLS_LIB_EXTENSION_NAME@ \
coap-rd@LIBCOAP_DTLS_LIB_EXTENSION_NAME@
check_PROGRAMS += coap-etsi_iot_01
check_PROGRAMS += coap-etsi_iot_01 oscore-interop-server

if BUILD_ADD_DEFAULT_NAMES
noinst_PROGRAMS += coap-server coap-rd
Expand Down Expand Up @@ -79,6 +91,10 @@ coap_etsi_iot_01_SOURCES = etsi_iot_01.c
coap_etsi_iot_01_LDADD = $(DTLS_LIBS) \
$(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).la

oscore_interop_server_SOURCES = oscore-interop-server.c
oscore_interop_server_LDADD = $(DTLS_LIBS) \
$(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).la

coap_tiny_SOURCES = tiny.c
coap_tiny_LDADD = $(DTLS_LIBS) \
$(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).la
Expand Down
8 changes: 8 additions & 0 deletions examples/interop/a_client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
master_salt,hex,"9e7ca92223786340"
sender_id,hex,""
recipient_id,hex,"01"
replay_window,integer,30
aead_alg,integer,10
hkdf_alg,integer,-10
ssn_freq,integer,4
8 changes: 8 additions & 0 deletions examples/interop/b_server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
master_salt,hex,"9e7ca92223786340"
sender_id,hex,"01"
recipient_id,hex,""
replay_window,integer,30
aead_alg,integer,10
hkdf_alg,integer,-10
ssn_freq,integer,4
9 changes: 9 additions & 0 deletions examples/interop/c_client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
master_salt,hex,"9e7ca92223786340"
id_context,hex,"37cbf3210017a2d3"
sender_id,hex,""
recipient_id,hex,"01"
replay_window,integer,30
aead_alg,integer,10
hkdf_alg,integer,-10
ssn_freq,integer,4
9 changes: 9 additions & 0 deletions examples/interop/d_server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
master_salt,hex,"9e7ca92223786340"
id_context,hex,"37cbf3210017a2d3"
sender_id,hex,"01"
recipient_id,hex,""
replay_window,integer,30
aead_alg,integer,10
hkdf_alg,integer,-10
ssn_freq,integer,4
8 changes: 8 additions & 0 deletions examples/interop/e_client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
master_salt,hex,"9e7ca92223786340"
sender_id,hex,"010101"
recipient_id,hex,"01"
replay_window,integer,30
aead_alg,integer,10
hkdf_alg,integer,-10
ssn_freq,integer,4
10 changes: 10 additions & 0 deletions examples/interop/f_client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
master_salt,hex,"9e7ca92223786340"
sender_id,hex,""
recipient_id,hex,"01"
replay_window,integer,30
aead_alg,integer,10
hkdf_alg,integer,-10
ssn_freq,integer,4

break_sender_key,bool,true
10 changes: 10 additions & 0 deletions examples/interop/g_client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
master_salt,hex,"9e7ca92223786340"
sender_id,hex,""
recipient_id,hex,"01"
replay_window,integer,30
aead_alg,integer,10
hkdf_alg,integer,-10
ssn_freq,integer,4

break_recipient_key,bool,true
Loading

0 comments on commit 7623e0f

Please sign in to comment.