NAME
coap-oscore-conf — CoAP OSCORE configuration file format
DESCRIPTION
The OSCORE configuration file is read in when using the -E oscore_conf_file
option for the coap-client(5) or coap-server(5) executables. This then
allows a client or server to use OSCORE to protect the CoAP information
between endpoints (RFC8613).
It is also read in and parsed by coap_new_oscore_conf(3).
This configuration file can be a configuration held in memory, the formatting
of the memory region is same as that for a file as if the file was mapped
into memory. The coap_new_oscore_conf(3) function uses the memory
version of the file.
The configuration file comprises of a set of keywords, the value of the
keyword encoding type and the keyword value, one per line, comma separated.
keyword,encoding,value
The keywords are case sensitive. If a line starts with a #, then it is
treated as a comment line and so is ignored. Empty lines are also valid
and ignored.
The possible encodings are:
-
ascii
-
The value is encoded as a binary representation of the ascii string. This
string can optionally be enclosed in ".
-
bool
-
The textual string is either true or false and is subsequently encoded as
an integer number.
-
hex
-
The value is encoded as a binary representation of the hex string. This
string can optionally be enclosed in ".
-
integer
-
The value is encoded as an integer number.
-
unsigned64
-
The value is encoded as an unsigned 64-bit integer number.
-
text
-
The string value is mapped and then encoded as an integer number. This
string can optionally be enclosed in ". A subset of the Names from
https://www.iana.org/assignments/cose/cose.xhtml#algorithms or
https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves are
supported.
-
config
-
A set of configuration lines comprising of keyword,encoding,value starting and ending with a single quote '.
Multiple configuration lines are supported.
The valid keywords are:
OSCORE
-
master_secret
-
(hex or ascii) (Required) (No default)
"RFC8613 Section 3.1.
Security Context Definition".
Master Secret. Variable length. Must be the same for both client and
server.
-
master_salt
-
(hex or ascii) (Optional) (No default)
"RFC8613 Section 3.1.
Security Context Definition".
Master Salt. Variable length. Must be the same for both client and
server.
-
id_context
-
(hex or ascii) (Optional) (No default)
"RFC8613 Section 3.1.
Security Context Definition".
ID Context. Variable length. Must be the same for both client and
server.
-
sender_id
-
(hex or ascii) (Required) (No default)
"RFC8613 Section 3.1.
Security Context Definition".
Sender ID. This is the local application ID.
Maximum length is determined by the AEAD Algorithm (typically 7 bytes).
NOTE: Can be defined in complex_sender.
-
recipient_id
-
(hex or ascii) (Required for client, else Optional) (No default)
"RFC8613 Section 3.1.
Security Context Definition".
Recipient ID. This is the remote peer application ID.
Maximum length is determined by the AEAD Algorithm (typically 7 bytes).
For servers, there can be zero or more (unique) recipient_ids.
Additional recipient_ids can be added programmatically to the OSCORE
configuration - see coap_new_oscore_recipient(3).
For clients, there should only be one recipient_id (only the first is used).
NOTE: Can be defined in complex_recipient.
-
replay_window
-
(integer) (Optional) (Default is 32)
"RFC8613 Section 3.1.
Security Context Definition".
Recipient Replay Window (Server Only). Supported values are 1 - 63.
-
aead_alg
-
(integer or text) (Optional) (Default is 10 or "AES-CCM-16-64-128")
"RFC8613 Section 3.1.
Security Context Definition".
AEAD Algorithm. Only the mandatory and a small subset of the algorithms
are supported depending on the TLS library.
-
hkdf_alg
-
(integer or text) (Optional) (Default is -10 or "direct+HKDF-SHA-256")
"RFC8613 Section 3.1.
Security Context Definition".
HDKF Algorithm. Only the mandatory and a small subset of the algorithms
are supported depending on the TLS library.
-
rfc8613_b_1_2
-
(bool) (Optional) (Default is true)
"RFC8613 Appendix B.1.2.
Replay Window".
Enable server rebooting Replay Window.
-
rfc8613_b_2
-
(bool) (Optional) (Default is false)
"RFC8613 Appendix B.2.
Security Context Derived Multiple Times".
Enable Security Context protocol.
-
pub_file_pem
-
The public key is read from the specified .pem file and is encoded
internally as a binary representation of the value. This .pem file can
optionally be enclosed in ".
-
pri_file_pem
-
The private key is read from the specified .pem file and is encoded
internally as a binary representation of the value. This .pem file can
optionally be enclosed in ".
-
pub_asn1
-
The public key (encoded as ASN1(DER)) is read from the binary
representation of the hex string. This string can optionally be enclosed
in ".
-
pri_asn1
-
The private key (encoded as ASN1(DER)) is read from the binary
representation of the hex string. This string can optionally be enclosed
in ".
OSCORE COMPLEX
In addition to the above, it is possible to define specific additional options
for the sender and/or recipient by setting up a complex definition for the sender
and/or recipient. The start and end of this definition are indicated by the
single quote ' character. This definition can be (and usually is) over multiple
lines.
-
complex_sender
-
(config) (Optional) (No default)
One or more sender specific definitions in the form of keyword,encoding,value
with a start and end single quote '.
-
complex_recipient
-
(config) (Optional) (No default)
One or more recipient specific definitions in the form of keyword,encoding,value
with a start and end single quote '.
For servers, there can be zero or more (unique) complex_recipient.
For clients, there should only be one complex_recipient (only the first is used).
OSCORE COMPLEX SENDER
-
sender_id
-
(hex or ascii) (Required) (No default)
"RFC8613 Section 3.1.
Security Context Definition".
Sender ID. This is the local application ID.
Maximum length is determined by the AEAD Algorithm (typically 7 bytes).
-
sender_private_key
-
(pri_file_pem or pri_asn1) (Required if Group or Pairwise) (No default)
This is the local application private key.
-
sender_public_key
-
(pub_file_pem or pub_asn1) (Required if Group or Pairwise) (No default)
This is the local application public key.
OSCORE COMPLEX RECIPIENT
-
recipient_id
-
(hex or ascii) (Required for client, else Optional) (No default)
"RFC8613 Section 3.1.
Security Context Definition".
Recipient ID. This is the remote peer application ID.
Maximum length is determined by the AEAD Algorithm (typically 7 bytes).
Additional recipient_ids can be added programmatically to the OSCORE
configuration - see coap_new_oscore_recipient(3).
-
silent_server
-
(bool) (Optional) (Default is false)
The remote server normally does not send any response if set.
-
recipient_public_key
-
(pub_file_pem or pub_asn1) (Required if Group or Pairwise) (No default)
This is the remote application public key.
For servers, there can be multiple (unique) recipient_public_keys.
For clients, there should only be one recipient_public_keys (only the
first is used).
The following 2 entries are used for external credential stores to restore
replay-protection state across restarts as per RFC8613 Appenxix B.
Setting either last_seq or sliding_window marks the replay window as
initialized.
-
last_seq
-
(unsigned64) (Optional) (Default is 0)
The highest sequence number observed for this recipient.
-
sliding_window
-
(unsigned64) (Optional) (Default is 0)
The sliding replay-window bitmask for this recipient.
Used together with last_seq to restore the full replay-protection state.
OSCORE GROUP
-
group_mode
-
(bool) (Required if Group) (Default is false)
Enable OSCORE Group mode if true.
-
pairwise_mode
-
(bool) (Required if Pairwise) (Default is false)
Enable OSCORE Pairwise mode if true.
-
alg_group_enc
-
(integer or text) (Required if Group or Pairwise) (Default is 10 or "AES-CCM-16-64-128")
"RFC 10021 Section 2.
Security Context".
Group Encryption Algorithm. Only the mandatory and a small subset of the algorithms
are supported depending on the TLS library.
-
alg_signature
-
(integer or text) (Required if Group or Pairwise) (Default is -8 or "EdDSA")
"RFC 10021 Section 2.
Security Context".
Only the mandatory and a small subset of the algorithms are supported.
-
sign_enc_alg
-
(integer or text) (Required if Group or Pairwise) (Default is 10 or "AES-CCM-16-64-128")
"RFC 10021 Section 2.
Security Context".
Only the mandatory and a small subset of the algorithms are supported.
-
alg_pairwise_key_agreement
-
(integer or text) (Required if Pairwise) (Default is 6 or "Ed25519")
"RFC 10021 Section 2.
Security Context".
Pairwise Key Agreement Algorithm. Only the mandatory and a small subset of the algorithms
are supported depending on the TLS library.
-
sign_curve
-
(integer or text) (Optional) (Default is 6 or "Ed25519")
Only the mandatory and a small subset of the curves are supported.
-
gm_public_key
-
(pub_file_pem or pub_asn1) (Optional) (No default)
Group Manager public key.
DIAGNOSTIC TESTING
-
break_sender_key
-
(bool) (Optional) (Default is false)
Enable random breaking of the derived sender key.
-
break_recipient_key
-
(bool) (Optional) (Default is false)
Enable random breaking of the derived recipient key.
EXAMPLE SERVER OSCORE CONFIGURATION FILE
# Master Secret (same for both client and server)
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
# Master Salt (same for both client and server)
master_salt,hex,"9e7ca92223786340"
# Sender ID
sender_id,ascii,"server"
# Recipient ID
recipient_id,ascii,"client"
# Replay Window (usually 32)
replay_window,integer,32
# AEAD COSE Cipher Algorithm (usually 10)
aead_alg,integer,10
# HKDF COSE Algorithm (usually -10)
hkdf_alg,integer,-10
EXAMPLE CLIENT OSCORE CONFIGURATION FILE
# Master Secret (same for both client and server)
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
# Master Salt (same for both client and server)
master_salt,hex,"9e7ca92223786340"
# Sender ID (This is the client who is the Sender)
sender_id,ascii,"client"
# Recipient ID (It is the server that is remote)
recipient_id,ascii,"server"
# Replay Window (usually 32)
replay_window,integer,32
# AEAD COSE Cipher Algorithm (usually 10)
aead_alg,integer,10
# HKDF COSE Algorithm (usually -10)
hkdf_alg,integer,-10
EXAMPLE COMPLEX CLIENT OSCORE CONFIGURATION FILE
# Master Secret (same for both client and server)
master_secret,hex,"0102030405060708090a0b0c0d0e0f10"
# Master Salt (same for both client and server)
master_salt,hex,"9e7ca92223786340"
# Replay Window (usually 32)
replay_window,integer,32
# AEAD COSE Cipher Algorithm (usually 10)
aead_alg,integer,10
# HKDF COSE Algorithm (usually -10)
hkdf_alg,integer,-10
# Set up complex sender definition
complex_sender,config,'
# Sender ID (This is the client who is the Sender)
sender_id,ascii,"client"
# Sender Keys (This is the server who is the Sender)
sender_private_key,pri_asn1,"302e020100300506032b657004220420475c40ff2a0ff59290a6e815cf9233a186722bfa9e3f5a5aac9cdc6b50b571af"
sender_public_key,pub_asn1,"302a300506032b65700321002de63a7f1a003de75debce4b33f02b8efd5dc39a58e59db56d1975ccdc23eae1"
# Closing ' for complex_sender
'
# Set up complex recipient definition
complex_recipient,config,'
# Recipient ID (It is the server that is remote)
recipient_id,ascii,"server"
# Recipient Key (It is the client that is remote)
recipient_public_key,pub_asn1,"302a300506032b6570032100cca3677a114856e5a0e605c13796178fad7c3329a980bc32cb406b928fa23f30"
# Remote server is silent
silent_server,bool,true
# Closing ' for complex_recipient
'
# Configure as Group Mode
group_mode,bool,true
# ID Context (same for both client and server)
id_context,hex,"120406"