draft-ietf-ace-oscore-profile-13.txt   draft-ietf-ace-oscore-profile-14.txt 
ACE Working Group F. Palombini ACE Working Group F. Palombini
Internet-Draft Ericsson AB Internet-Draft Ericsson AB
Intended status: Standards Track L. Seitz Intended status: Standards Track L. Seitz
Expires: April 30, 2021 Combitech Expires: June 17, 2021 Combitech
G. Selander G. Selander
Ericsson AB Ericsson AB
M. Gunnarsson M. Gunnarsson
RISE RISE
October 27, 2020 December 14, 2020
OSCORE Profile of the Authentication and Authorization for Constrained OSCORE Profile of the Authentication and Authorization for Constrained
Environments Framework Environments Framework
draft-ietf-ace-oscore-profile-13 draft-ietf-ace-oscore-profile-14
Abstract Abstract
This memo specifies a profile for the Authentication and This memo specifies a profile for the Authentication and
Authorization for Constrained Environments (ACE) framework. It Authorization for Constrained Environments (ACE) framework. It
utilizes Object Security for Constrained RESTful Environments utilizes Object Security for Constrained RESTful Environments
(OSCORE) to provide communication security and proof-of-possession (OSCORE) to provide communication security and proof-of-possession
for a key owned by the client and bound to an OAuth 2.0 access token. for a key owned by the client and bound to an OAuth 2.0 access token.
Status of This Memo Status of This Memo
skipping to change at page 1, line 40 skipping to change at page 1, line 40
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 30, 2021. This Internet-Draft will expire on June 17, 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 17 skipping to change at page 2, line 17
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 4 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 4
3. Client-AS Communication . . . . . . . . . . . . . . . . . . . 6 3. Client-AS Communication . . . . . . . . . . . . . . . . . . . 6
3.1. C-to-AS: POST to token endpoint . . . . . . . . . . . . . 6 3.1. C-to-AS: POST to token endpoint . . . . . . . . . . . . . 7
3.2. AS-to-C: Access Token . . . . . . . . . . . . . . . . . . 8 3.2. AS-to-C: Access Token . . . . . . . . . . . . . . . . . . 8
3.2.1. The OSCORE_Input_Material . . . . . . . . . . . . . . 12 3.2.1. The OSCORE_Input_Material . . . . . . . . . . . . . . 12
4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 15 4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 15
4.1. C-to-RS: POST to authz-info endpoint . . . . . . . . . . 16 4.1. C-to-RS: POST to authz-info endpoint . . . . . . . . . . 16
4.1.1. The Nonce 1 Parameter . . . . . . . . . . . . . . . . 17 4.1.1. The Nonce 1 Parameter . . . . . . . . . . . . . . . . 17
4.1.2. The ace_client_recipientid Parameter . . . . . . . . 17 4.1.2. The ace_client_recipientid Parameter . . . . . . . . 18
4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 17 4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 18
4.2.1. The Nonce 2 Parameter . . . . . . . . . . . . . . . . 19 4.2.1. The Nonce 2 Parameter . . . . . . . . . . . . . . . . 19
4.2.2. The ace_server_recipientid Parameter . . . . . . . . 19 4.2.2. The ace_server_recipientid Parameter . . . . . . . . 20
4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 19 4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 20
4.4. Access rights verification . . . . . . . . . . . . . . . 22 4.4. Access rights verification . . . . . . . . . . . . . . . 22
5. Secure Communication with AS . . . . . . . . . . . . . . . . 22 5. Secure Communication with AS . . . . . . . . . . . . . . . . 22
6. Discarding the Security Context . . . . . . . . . . . . . . . 22 6. Discarding the Security Context . . . . . . . . . . . . . . . 23
7. Security Considerations . . . . . . . . . . . . . . . . . . . 23 7. Security Considerations . . . . . . . . . . . . . . . . . . . 24
8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 25 8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 25
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26
9.1. ACE Profile Registry . . . . . . . . . . . . . . . . . . 25 9.1. ACE Profile Registry . . . . . . . . . . . . . . . . . . 26
9.2. OAuth Parameters Registry . . . . . . . . . . . . . . . . 26 9.2. OAuth Parameters Registry . . . . . . . . . . . . . . . . 26
9.3. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 26 9.3. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 27
9.4. OSCORE Security Context Parameters Registry . . . . . . . 27 9.4. OSCORE Security Context Parameters Registry . . . . . . . 27
9.5. CWT Confirmation Methods Registry . . . . . . . . . . . . 28 9.5. CWT Confirmation Methods Registry . . . . . . . . . . . . 28
9.6. JWT Confirmation Methods Registry . . . . . . . . . . . . 28 9.6. JWT Confirmation Methods Registry . . . . . . . . . . . . 28
9.7. Expert Review Instructions . . . . . . . . . . . . . . . 28 9.7. Expert Review Instructions . . . . . . . . . . . . . . . 29
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 29 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 29
10.1. Normative References . . . . . . . . . . . . . . . . . . 29 10.1. Normative References . . . . . . . . . . . . . . . . . . 29
10.2. Informative References . . . . . . . . . . . . . . . . . 30 10.2. Informative References . . . . . . . . . . . . . . . . . 31
Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 31 Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 31
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 31 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 32
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32
1. Introduction 1. Introduction
This memo specifies a profile of the ACE framework This memo specifies a profile of the ACE framework
[I-D.ietf-ace-oauth-authz]. In this profile, a client and a resource [I-D.ietf-ace-oauth-authz]. In this profile, a client and a resource
server use the Constrained Application Protocol (CoAP) [RFC7252] to server use the Constrained Application Protocol (CoAP) [RFC7252] to
communicate. The client uses an access token, bound to a symmetric communicate. The client uses an access token, bound to a symmetric
key (the proof-of-possession key) to authorize its access to the key (the proof-of-possession key) to authorize its access to the
resource server. Note that this profile uses a symmetric-crypto- resource server. Note that this profile uses a symmetric-crypto-
based scheme, where the symmetric secret is used as input material based scheme, where the symmetric secret is used as input material
for keying material derivation. In order to provide communication for keying material derivation. In order to provide communication
security and proof of possession, the client and resource server use security and proof of possession, the client and resource server use
Object Security for Constrained RESTful Environments (OSCORE) Object Security for Constrained RESTful Environments (OSCORE)
[RFC8613]. Note that the proof of possession is not done by a [RFC8613]. Note that the proof of possession is not achieved through
dedicated protocol element, but rather occurs after the first OSCORE a dedicated protocol element, but rather occurs after the first
exchange. message exchange using OSCORE.
OSCORE specifies how to use CBOR Object Signing and Encryption (COSE) OSCORE specifies how to use CBOR Object Signing and Encryption (COSE)
[RFC8152] to secure CoAP messages. Note that OSCORE can be used to [RFC8152] to secure CoAP messages. Note that OSCORE can be used to
secure CoAP messages, as well as HTTP and combinations of HTTP and secure CoAP messages, as well as HTTP and combinations of HTTP and
CoAP; a profile of ACE similar to the one described in this document, CoAP; a profile of ACE similar to the one described in this document,
with the difference of using HTTP instead of CoAP as communication with the difference of using HTTP instead of CoAP as communication
protocol, could be specified analogously to this one. protocol, could be specified analogously to this one.
1.1. Terminology 1.1. Terminology
skipping to change at page 5, line 16 skipping to change at page 5, line 16
section 3.2 of [RFC8613]. section 3.2 of [RFC8613].
In a similar way, after receiving the nonce N2, the client In a similar way, after receiving the nonce N2, the client
concatenates the input salt, N1 and N2 to obtain the Master Salt of concatenates the input salt, N1 and N2 to obtain the Master Salt of
the OSCORE Security Context. The client then derives the complete the OSCORE Security Context. The client then derives the complete
Security Context from the Master Salt, the OSCORE Recipient ID Security Context from the Master Salt, the OSCORE Recipient ID
generated by the RS (set as its OSCORE Sender ID), its own OSCORE generated by the RS (set as its OSCORE Sender ID), its own OSCORE
Recipient ID, plus the parameters received from the AS. Recipient ID, plus the parameters received from the AS.
Finally, the client sends a request protected with OSCORE to the RS. Finally, the client sends a request protected with OSCORE to the RS.
If the request verifies, the server stores the complete Security If the request is successfully verified, the server stores the
Context state that is ready for use in protecting messages, and uses complete Security Context state that is ready for use in protecting
it in the response, and in further communications with the client, messages, and uses it in the response, and in further communications
until token expiration. This Security Context is discarded when a with the client, until token deletion, due to e.g. expiration. This
token (whether the same or different) is used to successfully derive Security Context is discarded when a token (whether the same or a
a new Security Context for that client. different one) is used to successfully derive a new Security Context
for that client.
The use of random nonces during the exchange prevents the reuse of an The use of random nonces during the exchange prevents the reuse of an
Authenticated Encryption with Associated Data (AEAD) nonces/key pair Authenticated Encryption with Associated Data (AEAD) nonces/key pair
for two different messages. Two-time pad might otherwise occur when for two different messages. Two-time pad might otherwise occur when
client and RS derive a new Security Context from an existing (non- client and RS derive a new Security Context from an existing (non-
expired) access token, as might occur when either party has just expired) access token, as might occur when either party has just
rebooted. Instead, by using random nonces as part of the Master rebooted. Instead, by using random nonces as part of the Master
Salt, the request to the authz-info endpoint posting the same token Salt, the request to the authz-info endpoint posting the same token
results in a different Security Context, by OSCORE construction, results in a different Security Context, by OSCORE construction,
since even though the Master Secret, Sender ID and Recipient ID are since even though the Master Secret, Sender ID and Recipient ID are
the same, the Master Salt is different (see Section 3.2.1 of the same, the Master Salt is different (see Section 3.2.1 of
[RFC8613]). Therefore, the main requirement for the nonces is that [RFC8613]). Therefore, the main requirement for the nonces is that
they have a good amount of randomness. If random nonces were not they have a good amount of randomness. If random nonces were not
used, a node re-using a non-expired old token would be susceptible to used, a node re-using a non-expired old token would be susceptible to
on-path attackers provoking the creation of OSCORE messages using old on-path attackers provoking the creation of OSCORE messages using old
AEAD keys and nonces. AEAD keys and nonces.
After the whole message exchange has taken place, the client can After the whole message exchange has taken place, the client can
contact the AS to request an update of its access rights, sending a contact the AS to request an update of its access rights, sending a
similar request to the token endpoint that also includes an similar request to the token endpoint that also includes an
identifier so that the AS can find the correct OSCORE security identifier so that the AS can find the correct OSCORE security input
material it has previously shared with the client. This specific material it has previously shared with the client. This specific
identifier, encoded as a byte string, is assigned by the AS to be identifier, encoded as a byte string, is assigned by the AS to be
unique in the sets of its OSCORE Security Contexts, and is not used unique in the sets of its OSCORE security input materials, and is not
as input material to derive the full OSCORE Security Context. used as input material to derive the full OSCORE Security Context.
An overview of the profile flow for the OSCORE profile is given in An overview of the profile flow for the OSCORE profile is given in
Figure 1. The names of messages coincide with those of Figure 1. The names of messages coincide with those of
[I-D.ietf-ace-oauth-authz] when applicable. [I-D.ietf-ace-oauth-authz] when applicable.
C RS AS C RS AS
| | | | | |
| ----- POST /token ----------------------------> | | ----- POST /token ----------------------------> |
| | | | | |
| <---------------------------- Access Token ----- | | <---------------------------- Access Token ----- |
skipping to change at page 6, line 32 skipping to change at page 6, line 32
| Sec Context storage/ | | Sec Context storage/ |
| | | | | |
| <--- OSCORE Response ----- | | | <--- OSCORE Response ----- | |
| | | | | |
/proof-of-possession | | /proof-of-possession | |
Sec Context storage/ | | Sec Context storage/ | |
| | | | | |
| ---- OSCORE Request -----> | | | ---- OSCORE Request -----> | |
| | | | | |
| <--- OSCORE Response ----- | | | <--- OSCORE Response ----- | |
| ... | | | | |
/mutual ... | |
authentication/
Figure 1: Protocol Overview Figure 1: Protocol Overview
3. Client-AS Communication 3. Client-AS Communication
The following subsections describe the details of the POST request The following subsections describe the details of the POST request
and response to the token endpoint between client and AS. and response to the token endpoint between client and AS.
Section 3.2 of [RFC8613] defines how to derive a Security Context Section 3.2 of [RFC8613] defines how to derive a Security Context
based on a shared master secret and a set of other parameters, based on a shared master secret and a set of other parameters,
established between client and server, which the client receives from established between client and server, which the client receives from
skipping to change at page 7, line 28 skipping to change at page 7, line 33
{ {
"req_aud" : "tempSensor4711", "req_aud" : "tempSensor4711",
"scope" : "read" "scope" : "read"
} }
Figure 2: Example C-to-AS POST /token request for an access token Figure 2: Example C-to-AS POST /token request for an access token
bound to a symmetric key. bound to a symmetric key.
If the client wants to update its access rights without changing an If the client wants to update its access rights without changing an
existing OSCORE Security Context, it MUST include in its POST request existing OSCORE Security Context, it MUST include in its POST request
to the token endpoint a req_cnf object. kid field carrying a CBOR to the token endpoint a req_cnf object, with the kid field carrying a
byte string containing the OSCORE_Input_Material Identifier (assigned CBOR byte string containing the OSCORE_Input_Material Identifier
as discussed in Section 3.2). This identifier, together with other (assigned as discussed in Section 3.2). This identifier, together
information such as audience (see Section 5.6.1 of with other information such as audience (see Section 5.6.1 of
[I-D.ietf-ace-oauth-authz]), can be used by the AS to determine the [I-D.ietf-ace-oauth-authz]), can be used by the AS to determine the
shared secret bound to the proof-of-possession token and therefore shared secret bound to the proof-of-possession token and therefore
MUST identify a symmetric key that was previously generated by the AS MUST identify a symmetric key that was previously generated by the AS
as a shared secret for the communication between the client and the as a shared secret for the communication between the client and the
RS. The AS MUST verify that the received value identifies a proof- RS. The AS MUST verify that the received value identifies a proof-
of-possession key that has previously been issued to the requesting of-possession key that has previously been issued to the requesting
client. If that is not the case, the Client-to-AS request MUST be client. If that is not the case, the Client-to-AS request MUST be
declined with the error code 'invalid_request' as defined in declined with the error code 'invalid_request' as defined in
Section 5.6.3 of [I-D.ietf-ace-oauth-authz]. Section 5.6.3 of [I-D.ietf-ace-oauth-authz].
skipping to change at page 8, line 35 skipping to change at page 8, line 35
not authorized, the AS returns an error response as described in not authorized, the AS returns an error response as described in
section 5.6.3 of [I-D.ietf-ace-oauth-authz]. section 5.6.3 of [I-D.ietf-ace-oauth-authz].
The AS can signal that the use of OSCORE is REQUIRED for a specific The AS can signal that the use of OSCORE is REQUIRED for a specific
access token by including the "profile" parameter with the value access token by including the "profile" parameter with the value
"coap_oscore" in the access token response. This means that the "coap_oscore" in the access token response. This means that the
client MUST use OSCORE towards all resource servers for which this client MUST use OSCORE towards all resource servers for which this
access token is valid, and follow Section 4.3 to derive the security access token is valid, and follow Section 4.3 to derive the security
context to run OSCORE. Usually it is assumed that constrained context to run OSCORE. Usually it is assumed that constrained
devices will be pre-configured with the necessary profile, so that devices will be pre-configured with the necessary profile, so that
this kind of profile negotiation can be omitted. this kind of profile signaling can be omitted.
Moreover, the AS MUST send the following data: Moreover, the AS MUST send the following data:
o a master secret o a master secret
o an identifier of the OSCORE Input Material o an identifier of the OSCORE Input Material
Additionally, the AS MAY send the following data, in the same Additionally, the AS MAY send the following data, in the same
response. response.
o a context identifier o a context identifier
o an AEAD algorithm o an AEAD algorithm
o an HMAC-based key derivation function (HKDF) algorithm o an HMAC-based key derivation function (HKDF) algorithm
o a salt o a salt
o the OSCORE version number o the OSCORE version number
This data is transported in the the OSCORE_Input_Material. The This data is transported in the OSCORE_Input_Material. The
OSCORE_Input_Material is a CBOR map object, defined in Section 3.2.1. OSCORE_Input_Material is a CBOR map object, defined in Section 3.2.1.
This object is transported in the 'cnf' parameter of the access token This object is transported in the 'cnf' parameter of the access token
response as defined in Section 3.2 of [I-D.ietf-ace-oauth-params], as response as defined in Section 3.2 of [I-D.ietf-ace-oauth-params], as
the value of a field named 'osc', registered in Section 9.5 and the value of a field named 'osc', registered in Section 9.5 and
Section 9.6. Section 9.6.
The AS MAY assign an identifier to the context (context identifier). The AS MAY assign an identifier to the context (context identifier).
This identifier is used as ID Context in the OSCORE context as This identifier is used as ID Context in the OSCORE context as
described in section 3.1 of [RFC8613]. If assigned, this parameters described in section 3.1 of [RFC8613]. If assigned, this parameters
MUST be communicated as the 'contextId' field in the MUST be communicated as the 'contextId' field in the
OSCORE_Input_Material. The applications needs to consider that this OSCORE_Input_Material. The applications needs to consider that this
identifier is sent in the clear and may reveal information about the identifier is sent in the clear and may reveal information about the
endpoints, as mentioned in section 12.8 of [RFC8613]. endpoints, as mentioned in section 12.8 of [RFC8613].
The master secret and the identifier of the OSCORE_Input_Material The master secret and the identifier of the OSCORE_Input_Material
MUST be communicated as the 'ms' and 'id' field in the 'osc' field in MUST be communicated as the 'ms' and 'id' field in the 'osc' field in
the 'cnf' parameter of the access token response. If included, the the 'cnf' parameeter of the access token response. If included, the
AEAD algorithm is sent in the 'alg' parameter in the AEAD algorithm is sent in the 'alg' parameter in the
OSCORE_Input_Material; the HKDF algorithm in the 'hkdf' parameter of OSCORE_Input_Material; the HKDF algorithm in the 'hkdf' parameter of
the OSCORE_Input_Material; a salt in the 'salt' parameter of the the OSCORE_Input_Material; a salt in the 'salt' parameter of the
OSCORE_Input_Material; and the OSCORE version in the 'version' OSCORE_Input_Material; and the OSCORE version in the 'version'
parameter of the OSCORE_Input_Material. parameter of the OSCORE_Input_Material.
The same parameters MUST be included in the claims associated with The same parameters MUST be included in the claims associated with
the access token. This profile RECOMMENDS the use of CBOR web token the access token. This profile RECOMMENDS the use of CBOR web token
(CWT) as specified in [RFC8392]. If the token is a CWT, the same (CWT) as specified in [RFC8392]. If the token is a CWT, the same
OSCORE_Input_Material structure defined above MUST be placed in the OSCORE_Input_Material structure defined above MUST be placed in the
skipping to change at page 11, line 48 skipping to change at page 11, line 48
41 # bytes(1) 41 # bytes(1)
01 # "\x01" 01 # "\x01"
Figure 6: Example CWT Claims Set with OSCORE parameters, CBOR Figure 6: Example CWT Claims Set with OSCORE parameters, CBOR
encoded. encoded.
If the client has requested an update to its access rights using the If the client has requested an update to its access rights using the
same OSCORE Security Context, which is valid and authorized, the AS same OSCORE Security Context, which is valid and authorized, the AS
MUST omit the 'cnf' parameter in the response, and MUST carry the MUST omit the 'cnf' parameter in the response, and MUST carry the
OSCORE Input Material identifier in the 'kid' field in the 'cnf' OSCORE Input Material identifier in the 'kid' field in the 'cnf'
parameter of the token. This identifier needs to be included in the claim of the token. This identifier needs to be included in the
token in order for the RS to identify the correct OSCORE Input token in order for the RS to identify the correct OSCORE Input
Material. Material.
Figure 7 shows an example of such an AS response, with payload in Figure 7 shows an example of such an AS response, with payload in
CBOR diagnostic notation without the tag and value abbreviations. CBOR diagnostic notation without the tag and value abbreviations.
The access token has been truncated for readability. The access token has been truncated for readability.
Header: Created (Code=2.01) Header: Created (Code=2.01)
Content-Type: "application/ace+cbor" Content-Type: "application/ace+cbor"
Payload: Payload:
skipping to change at page 13, line 12 skipping to change at page 13, line 12
parameters that can appear in an OSCORE_Input_Material can be found parameters that can appear in an OSCORE_Input_Material can be found
in the IANA "OSCORE Security Context Parameters" registry in the IANA "OSCORE Security Context Parameters" registry
(Section 9.4), defined for extensibility, and is specified below. (Section 9.4), defined for extensibility, and is specified below.
All parameters are optional. Table 1 provides a summary of the All parameters are optional. Table 1 provides a summary of the
OSCORE_Input_Material parameters defined in this section. OSCORE_Input_Material parameters defined in this section.
+-----------+-------+-------------+-------------------+-------------+ +-----------+-------+-------------+-------------------+-------------+
| name | CBOR | CBOR type | registry | description | | name | CBOR | CBOR type | registry | description |
| | label | | | | | | label | | | |
+-----------+-------+-------------+-------------------+-------------+ +-----------+-------+-------------+-------------------+-------------+
| version | 0 | unsigned | | OSCORE | | id | 0 | byte string | | OSCORE |
| | | | | Input |
| | | | | Material |
| | | | | Identifier |
| | | | | |
| version | 1 | unsigned | | OSCORE |
| | | integer | | Version | | | | integer | | Version |
| | | | | | | | | | | |
| ms | 1 | byte string | | OSCORE | | ms | 2 | byte string | | OSCORE |
| | | | | Master | | | | | | Master |
| | | | | Secret | | | | | | Secret |
| | | | | value | | | | | | value |
| | | | | | | | | | | |
| id | 2 | byte string | | OSCORE |
| | | | | Input |
| | | | | Material |
| | | | | Identifier |
| | | | | |
| hkdf | 3 | text string | [COSE.Algorithms] | OSCORE HKDF | | hkdf | 3 | text string | [COSE.Algorithms] | OSCORE HKDF |
| | | / integer | Values (HMAC- | value | | | | / integer | Values (HMAC- | value |
| | | | based) | | | | | | based) | |
| | | | | | | | | | | |
| alg | 4 | text string | [COSE.Algorithms] | OSCORE AEAD | | alg | 4 | text string | [COSE.Algorithms] | OSCORE AEAD |
| | | / integer | Values (AEAD) | Algorithm | | | | / integer | Values (AEAD) | Algorithm |
| | | | | value | | | | | | value |
| | | | | | | | | | | |
| salt | 5 | byte string | | an input to | | salt | 5 | byte string | | an input to |
| | | | | OSCORE | | | | | | OSCORE |
| | | | | Master Salt | | | | | | Master Salt |
| | | | | value | | | | | | value |
| | | | | | | | | | | |
| contextId | 6 | byte string | | OSCORE ID | | contextId | 6 | byte string | | OSCORE ID |
| | | | | Context | | | | | | Context |
| | | | | value | | | | | | value |
+-----------+-------+-------------+-------------------+-------------+ +-----------+-------+-------------+-------------------+-------------+
Table 1: OSCORE_Input_Material Parameters Table 1: OSCORE_Input_Material Parameters
id: This parameter identifies the OSCORE_Input_Material and is
encoded as a byte string. In JSON, the "id" value is a Base64
encoded byte string. In CBOR, the "id" type is byte string, and
has label 8.
version: This parameter identifies the OSCORE Version number, which version: This parameter identifies the OSCORE Version number, which
is an unsigned integer. For more information about this field, is an unsigned integer. For more information about this field,
see section 5.4 of [RFC8613]. In JSON, the "version" value is an see section 5.4 of [RFC8613]. In JSON, the "version" value is an
integer. In CBOR, the "version" type is int, and has label 0. integer. In CBOR, the "version" type is integer, and has label 0.
ms: This parameter identifies the OSCORE Master Secret value, which ms: This parameter identifies the OSCORE Master Secret value, which
is a byte string. For more information about this field, see is a byte string. For more information about this field, see
section 3.1 of [RFC8613]. In JSON, the "ms" value is a Base64 section 3.1 of [RFC8613]. In JSON, the "ms" value is a Base64
encoded byte string. In CBOR, the "ms" type is bstr, and has encoded byte string. In CBOR, the "ms" type is byte string, and
label 1. has label 1.
id: This parameter identifies the OSCORE_Input_Material and is
encoded as a byte string. In JSON, the "id" value is a Base64
encoded byte string. In CBOR, the "id" type is byte string, and
has label 8.
hkdf: This parameter identifies the OSCORE HKDF Algorithm. For more hkdf: This parameter identifies the OSCORE HKDF Algorithm. For more
information about this field, see section 3.1 of [RFC8613]. The information about this field, see section 3.1 of [RFC8613]. The
values used MUST be registered in the IANA "COSE Algorithms" values used MUST be registered in the IANA "COSE Algorithms"
registry (see [COSE.Algorithms]) and MUST be HMAC-based HKDF registry (see [COSE.Algorithms]) and MUST be HMAC-based HKDF
algorithms. The value can either be the integer or the text algorithms. The value can either be the integer or the text
string value of the HMAC-based HKDF algorithm in the "COSE string value of the HMAC-based HKDF algorithm in the "COSE
Algorithms" registry. In JSON, the "hkdf" value is a case- Algorithms" registry. In JSON, the "hkdf" value is a case-
sensitive ASCII string or an integer. In CBOR, the "hkdf" type is sensitive ASCII string or an integer. In CBOR, the "hkdf" type is
tstr or int, and has label 4. text string or integer, and has label 4.
alg: This parameter identifies the OSCORE AEAD Algorithm. For more alg: This parameter identifies the OSCORE AEAD Algorithm. For more
information about this field, see section 3.1 of [RFC8613] The information about this field, see section 3.1 of [RFC8613] The
values used MUST be registered in the IANA "COSE Algorithms" values used MUST be registered in the IANA "COSE Algorithms"
registry (see [COSE.Algorithms]) and MUST be AEAD algorithms. The registry (see [COSE.Algorithms]) and MUST be AEAD algorithms. The
value can either be the integer or the text string value of the value can either be the integer or the text string value of the
HMAC-based HKDF algorithm in the "COSE Algorithms" registry. In HMAC-based HKDF algorithm in the "COSE Algorithms" registry. In
JSON, the "alg" value is a case-sensitive ASCII string or an JSON, the "alg" value is a case-sensitive ASCII string or an
integer. In CBOR, the "alg" type is tstr or int, and has label 5. integer. In CBOR, the "alg" type is text string or integer, and
has label 5.
salt: This parameter identifies an input to the OSCORE Master Salt salt: This parameter identifies an input to the OSCORE Master Salt
value, which is a byte string. For more information about this value, which is a byte string. For more information about this
field, see section 3.1 of [RFC8613]. In JSON, the "salt" value is field, see section 3.1 of [RFC8613]. In JSON, the "salt" value is
a Base64 encoded byte string. In CBOR, the "salt" type is bstr, a Base64 encoded byte string. In CBOR, the "salt" type is byte
and has label 6. string, and has label 6.
contextId: This parameter identifies the security context as a byte contextId: This parameter identifies the security context as a byte
string. This identifier is used as OSCORE ID Context. For more string. This identifier is used as OSCORE ID Context. For more
information about this field, see section 3.1 of [RFC8613]. In information about this field, see section 3.1 of [RFC8613]. In
JSON, the "contextID" value is a Base64 encoded byte string. In JSON, the "contextID" value is a Base64 encoded byte string. In
CBOR, the "contextID" type is bstr, and has label 7. CBOR, the "contextID" type is byte string, and has label 7.
An example of JSON OSCORE_Input_Material is given in Figure 9. An example of JSON OSCORE_Input_Material is given in Figure 9.
"osc" : { "osc" : {
"alg" : "AES-CCM-16-64-128", "alg" : "AES-CCM-16-64-128",
"id" : b64'AQ==' "id" : b64'AQ=='
"ms" : b64'+a+Dg2jjU+eIiOFCa9lObw' "ms" : b64'+a+Dg2jjU+eIiOFCa9lObw'
} }
Figure 9: Example JSON OSCORE_Input_Material Figure 9: Example JSON OSCORE_Input_Material
The CDDL grammar describing the CBOR OSCORE_Input_Material is: The CDDL grammar describing the CBOR OSCORE_Input_Material is:
OSCORE_Input_Material = { OSCORE_Input_Material = {
? 0 => int, ; version ? 0 => bstr, ; id
? 1 => bstr, ; ms ? 1 => int, ; version
? 2 => bstr, ; id ? 2 => bstr, ; ms
? 3 => tstr / int, ; hkdf ? 3 => tstr / int, ; hkdf
? 4 => tstr / int, ; alg ? 4 => tstr / int, ; alg
? 5 => bstr, ; salt ? 5 => bstr, ; salt
? 6 => bstr, ; contextId ? 6 => bstr, ; contextId
* int / tstr => any * int / tstr => any
} }
4. Client-RS Communication 4. Client-RS Communication
The following subsections describe the details of the POST request The following subsections describe the details of the POST request
skipping to change at page 15, line 43 skipping to change at page 15, line 43
to the RS. The RS then generates a nonce N2 and an identifier ID2 to the RS. The RS then generates a nonce N2 and an identifier ID2
unique in the sets of its own Recipient IDs, and uses Section 3.2 of unique in the sets of its own Recipient IDs, and uses Section 3.2 of
[RFC8613] to derive a security context based on a shared master [RFC8613] to derive a security context based on a shared master
secret, the two nonces and the two identifiers, established between secret, the two nonces and the two identifiers, established between
client and server. The nonces and identifiers are encoded as CBOR client and server. The nonces and identifiers are encoded as CBOR
byte string if CBOR is used, and as Base64 string if JSON is used. byte string if CBOR is used, and as Base64 string if JSON is used.
This security context is used to protect all future communication This security context is used to protect all future communication
between client and RS using OSCORE, as long as the access token is between client and RS using OSCORE, as long as the access token is
valid. valid.
Note that the RS and client authenticates themselves by generating Note that the RS and client authenticates each other by generating
the shared OSCORE Security Context using the pop-key as master the shared OSCORE Security Context using the pop-key as master
secret. An attacker posting a valid token to the RS will not be able secret. An attacker posting a valid token to the RS will not be able
to generate a valid OSCORE context and thus not be able to prove to generate a valid OSCORE Security Context and thus not be able to
possession of the pop-key. Additionally, the mutual authentication prove possession of the pop-key. Additionally, the mutual
is only achieved after the client has successfully verified the authentication is only achieved after the client has successfully
response from the RS. verified a response from the RS protectd with the generated OSCORE
Security Context.
4.1. C-to-RS: POST to authz-info endpoint 4.1. C-to-RS: POST to authz-info endpoint
The client MUST generate a nonce value very unlikely to have been The client MUST generate a nonce value very unlikely to have been
previously used with the same input keying material. This profile previously used with the same input keying material. This profile
RECOMMENDS to use a 64-bit long random number as nonce's value. The RECOMMENDS to use a 64-bit long random number as nonce's value. The
client MUST store the nonce N1 as long as the response from the RS is client MUST store the nonce N1 as long as the response from the RS is
not received and the access token related to it is still valid. not received and the access token related to it is still valid (to
the best of the client's knowledge).
The client generates its own Recipient ID, ID1, for the OSCORE The client generates its own Recipient ID, ID1, for the OSCORE
Security Context that it is establishing with the RS. By generating Security Context that it is establishing with the RS. By generating
its own Recipient ID, the client makes sure that it does not collide its own Recipient ID, the client makes sure that it does not collide
with any of its Recipient IDs. with any of its Recipient IDs, nor with any other identifier ID1 if
the client is executing this exchange with a different RS at the same
time.
The client MUST use CoAP and the Authorization Information resource The client MUST use CoAP and the Authorization Information resource
as described in section 5.8.1 of [I-D.ietf-ace-oauth-authz] to as described in section 5.8.1 of [I-D.ietf-ace-oauth-authz] to
transport the token, N1 and ID1 to the RS. transport the token, N1 and ID1 to the RS.
Note that the use of the payload and the Content-Format is different Note that the use of the payload and the Content-Format is different
from what is described in section 5.8.1 of from what is described in section 5.8.1 of
[I-D.ietf-ace-oauth-authz], which only transports the token without [I-D.ietf-ace-oauth-authz], which only transports the token without
any CBOR wrapping. In this profile, the client MUST wrap the token any CBOR wrapping. In this profile, the client MUST wrap the token,
and N1 in a CBOR map. The client MUST use the Content-Format N1 and ID1 in a CBOR map. The client MUST use the Content-Format
"application/ace+cbor" defined in section 8.14 of "application/ace+cbor" defined in section 8.14 of
[I-D.ietf-ace-oauth-authz]. The client MUST include the access token [I-D.ietf-ace-oauth-authz]. The client MUST include the access token
using the "access_token" parameter, N1 using the 'nonce1' parameter using the 'access_token' parameter, N1 using the 'nonce1' parameter
defined in Section 4.1.1, and ID1 using the 'ace_client_recipientid' defined in Section 4.1.1, and ID1 using the 'ace_client_recipientid'
parameter defined in Section 4.1.2. parameter defined in Section 4.1.2.
The communication with the authz-info endpoint does not have to be The communication with the authz-info endpoint does not have to be
protected, except for the update of access rights case described protected, except for the update of access rights case described
below. below.
Note that a client may be required to re-POST the access token in Note that a client may be required to re-POST the access token in
order to complete a request, since an RS may delete a stored access order to complete a request, since an RS may delete a stored access
token (and associated Security Context) at any time, for example due token (and associated Security Context) at any time, for example due
to all storage space being consumed. This situation is detected by to all storage space being consumed. This situation is detected by
the client when it receives an AS Request Creation Hints response. the client when it receives an AS Request Creation Hints response.
Reposting the same access token will result in deriving a new OSCORE Reposting the same access token will result in deriving a new OSCORE
Security Context to be used with the RS, as different nonces will be Security Context to be used with the RS, as different nonces will be
used. used.
The client may also chose to re-POST the access token in order to
renew its OSCORE Security Context. In that case, the client and the
RS will exchange newly generated nonces, re-negotiate identifiers,
and derive new keying material. The client and RS might decide to
keep the same identifiers or renew them during the re-negotiation.
Figure 10 shows an example of the request sent from the client to the Figure 10 shows an example of the request sent from the client to the
RS, with payload in CBOR diagnostic notation without the tag and RS, with payload in CBOR diagnostic notation without the tag and
value abbreviations. The access token has been truncated for value abbreviations. The access token has been truncated for
readability. readability.
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "rs.example.com" Uri-Host: "rs.example.com"
Uri-Path: "authz-info" Uri-Path: "authz-info"
Content-Format: "application/ace+cbor" Content-Format: "application/ace+cbor"
Payload: Payload:
skipping to change at page 17, line 25 skipping to change at page 17, line 32
} }
Figure 10: Example C-to-RS POST /authz-info request using CWT Figure 10: Example C-to-RS POST /authz-info request using CWT
If the client has already posted a valid token, has already If the client has already posted a valid token, has already
established a security association with the RS, and wants to update established a security association with the RS, and wants to update
its access rights, the client can do so by posting the new token its access rights, the client can do so by posting the new token
(retrieved from the AS and containing the update of access rights) to (retrieved from the AS and containing the update of access rights) to
the /authz-info endpoint. The client MUST protect the request using the /authz-info endpoint. The client MUST protect the request using
the OSCORE Security Context established during the first token the OSCORE Security Context established during the first token
exchange. The client MUST only send the access token in the payload, exchange. The client MUST only send the 'access_token' field in the
no nonce or identifier are sent. After proper verification (see CBOR map in the payload, no nonce or identifier are sent. After
Section 4.2), the RS will replace the old token with the new one, proper verification (see Section 4.2), the RS will replace the old
maintaining the same Security Context. token with the new one, maintaining the same Security Context.
4.1.1. The Nonce 1 Parameter 4.1.1. The Nonce 1 Parameter
This parameter MUST be sent from the client to the RS, together with This parameter MUST be sent from the client to the RS, together with
the access token, if the ace profile used is coap_oscore. The the access token, if the ace profile used is coap_oscore, and the
parameter is encoded as a byte string for CBOR-based interactions, message is not an update of access rights, protected with an existing
and as a string (Base64 encoded binary) for JSON-based interactions. OSCORE Security Context. The parameter is encoded as a byte string
This parameter is registered in Section 9.2. for CBOR-based interactions, and as a string (Base64 encoded binary)
for JSON-based interactions. This parameter is registered in
Section 9.2.
4.1.2. The ace_client_recipientid Parameter 4.1.2. The ace_client_recipientid Parameter
This parameter MUST be sent from the client to the RS, together with This parameter MUST be sent from the client to the RS, together with
the access token, if the ace profile used is coap_oscore. The the access token, if the ace profile used is coap_oscore, and the
parameter is encoded as a byte string for CBOR-based interactions, message is not an update of access rights, protected with an existing
and as a string (Base64 encoded binary) for JSON-based interactions. OSCORE Security Context. The parameter is encoded as a byte string
This parameter is registered in Section 9.2. for CBOR-based interactions, and as a string (Base64 encoded binary)
for JSON-based interactions. This parameter is registered in
Section 9.2.
4.2. RS-to-C: 2.01 (Created) 4.2. RS-to-C: 2.01 (Created)
The RS MUST follow the procedures defined in section 5.8.1 of The RS MUST follow the procedures defined in section 5.8.1 of
[I-D.ietf-ace-oauth-authz]: the RS must verify the validity of the [I-D.ietf-ace-oauth-authz]: the RS must verify the validity of the
token. If the token is valid, the RS must respond to the POST token. If the token is valid, the RS must respond to the POST
request with 2.01 (Created). If the token is valid but is associated request with 2.01 (Created). If the token is valid but is associated
to claims that the RS cannot process (e.g., an unknown scope), or if to claims that the RS cannot process (e.g., an unknown scope), or if
any of the expected parameters is missing (e.g., any of the mandatory any of the expected parameters is missing (e.g., any of the mandatory
parameters from the AS or the identifier), or if any parameters parameters from the AS or the identifier 'id1'), or if any parameters
received in the 'osc' is unrecognized, the RS must respond with an received in the 'osc' field is unrecognized, the RS must respond with
error response code equivalent to the CoAP code 4.00 (Bad Request). an error response code equivalent to the CoAP code 4.00 (Bad
In the latter two cases, the RS may provide additional information in Request). In the latter two cases, the RS may provide additional
the error response, in order to clarify what went wrong. The RS may information in the error response, in order to clarify what went
make an introspection request (see Section 5.7.1 of wrong. The RS may make an introspection request (see Section 5.7.1
[I-D.ietf-ace-oauth-authz]) to validate the token before responding of [I-D.ietf-ace-oauth-authz]) to validate the token before
to the POST request to the authz-info endpoint. responding to the POST request to the authz-info endpoint.
Additionally, the RS MUST generate a nonce N2 very unlikely to have Additionally, the RS MUST generate a nonce N2 very unlikely to have
been previously used with the same input keying material, and its own been previously used with the same input keying material, and its own
Recipient ID, ID2. The RS makes sure that ID2 does not collide with Recipient ID, ID2. The RS makes sure that ID2 does not collide with
any of its Recipient IDs. The RS MUST ensure that ID2 is different any of its Recipient IDs. The RS MUST ensure that ID2 is different
from the ace_client_recipientid. The RS sends N2 and ID2 within the from the value received in the ace_client_recipientid parameter. The
2.01 (Created) response. The payload of the 2.01 (Created) response RS sends N2 and ID2 within the 2.01 (Created) response. The payload
MUST be a CBOR map containing the 'nonce2' parameter defined in of the 2.01 (Created) response MUST be a CBOR map containing the
Section 4.2.1, set to N2, and the 'ace_server_recipientid' parameter 'nonce2' parameter defined in Section 4.2.1, set to N2, and the
defined in Section 4.2.2, set to ID2. This profile RECOMMENDS to use 'ace_server_recipientid' parameter defined in Section 4.2.2, set to
a 64-bit long random number as nonce's value. The RS MUST use the ID2. This profile RECOMMENDS to use a 64-bit long random number as
Content-Format "application/ace+cbor" defined in section 8.14 of nonce's value. The RS MUST use the Content-Format "application/
[I-D.ietf-ace-oauth-authz]. ace+cbor" defined in section 8.14 of [I-D.ietf-ace-oauth-authz].
Figure 11 shows an example of the response sent from the RS to the Figure 11 shows an example of the response sent from the RS to the
client, with payload in CBOR diagnostic notation without the tag and client, with payload in CBOR diagnostic notation without the tag and
value abbreviations. value abbreviations.
Header: Created (Code=2.01) Header: Created (Code=2.01)
Content-Format: "application/ace+cbor" Content-Format: "application/ace+cbor"
Payload: Payload:
{ {
"nonce2": h'25a8991cd700ac01', "nonce2": h'25a8991cd700ac01',
skipping to change at page 18, line 49 skipping to change at page 19, line 22
Figure 11: Example RS-to-C 2.01 (Created) response Figure 11: Example RS-to-C 2.01 (Created) response
As specified in section 5.8.3 of [I-D.ietf-ace-oauth-authz], the RS As specified in section 5.8.3 of [I-D.ietf-ace-oauth-authz], the RS
must notify the client with an error response with code 4.01 must notify the client with an error response with code 4.01
(Unauthorized) for any long running request before terminating the (Unauthorized) for any long running request before terminating the
session, when the access token expires. session, when the access token expires.
If the RS receives the token in a OSCORE protected message, it means If the RS receives the token in a OSCORE protected message, it means
that the client is requesting an update of access rights. The RS that the client is requesting an update of access rights. The RS
MUST discard any nonce and identifiers in the request, if any was MUST ignore any nonce and identifiers in the request, if any was
sent. The RS MUST check that the "kid" of the "cnf" parameter of the sent. The RS MUST check that the "kid" of the 'cnf' claim of the new
new access token matches the OSCORE Input Material of the context access token matches the identifier of the OSCORE Input Material of
used to protect the message. If that is the case, the RS MUST the context used to protect the message. If that is the case, the RS
discard the old token and associate the new token to the Security MUST overwrite the old token and associate the new token to the
Context identified by the "kid" value in the "cnf" parameter. The RS Security Context identified by the "kid" value in the 'cnf' claim.
MUST respond with a 2.01 (Created) response protected with the same The RS MUST respond with a 2.01 (Created) response protected with the
Security Context, with no payload. If any verification fails, the RS same Security Context, with no payload. If any verification fails,
MUST respond with a 4.01 (Unauthorized) error response. the RS MUST respond with a 4.01 (Unauthorized) error response.
As specified in section 5.8.1 of [I-D.ietf-ace-oauth-authz], when As specified in section 5.8.1 of [I-D.ietf-ace-oauth-authz], when
receiving an updated access token with updated authorization receiving an updated access token with updated authorization
information from the client (see Section 3.1), it is recommended that information from the client (see Section 3.1), it is recommended that
the RS overwrites the previous token, that is only the latest the RS overwrites the previous token, that is only the latest
authorization information in the token received by the RS is valid. authorization information in the token received by the RS is valid.
This simplifies the process needed by the RS to keep track of This simplifies the process needed by the RS to keep track of
authorization information for a given client. authorization information for a given client.
4.2.1. The Nonce 2 Parameter 4.2.1. The Nonce 2 Parameter
This parameter MUST be sent from the RS to the client if the ace This parameter MUST be sent from the RS to the client if the ace
profile used is coap_oscore. The parameter is encoded as a byte profile used is coap_oscore, and the message is not a response to an
string for CBOR-based interactions, and as a string (Base64 encoded update of access rights, protected with an existing OSCORE Security
binary) for JSON-based interactions. This parameter is registered in Context. The parameter is encoded as a byte string for CBOR-based
Section 9.2 interactions, and as a string (Base64 encoded binary) for JSON-based
interactions. This parameter is registered in Section 9.2
4.2.2. The ace_server_recipientid Parameter 4.2.2. The ace_server_recipientid Parameter
This parameter MUST be sent from the RS to the client if the ace This parameter MUST be sent from the RS to the client if the ace
profile used is coap_oscore. The parameter is encoded as a byte profile used is coap_oscore, and the message is not a response to an
string for CBOR-based interactions, and as a string (Base64 encoded update of access rights, protected with an existing OSCORE Security
binary) for JSON-based interactions. This parameter is registered in Context. The parameter is encoded as a byte string for CBOR-based
Section 9.2 interactions, and as a string (Base64 encoded binary) for JSON-based
interactions. This parameter is registered in Section 9.2
4.3. OSCORE Setup 4.3. OSCORE Setup
Once receiving the 2.01 (Created) response from the RS, following the Once receiving the 2.01 (Created) response from the RS, following the
POST request to authz-info endpoint, the client MUST extract the bstr POST request to authz-info endpoint, the client MUST extract the bstr
nonce N2 from the 'nonce2' parameter in the CBOR map in the payload nonce N2 from the 'nonce2' parameter in the CBOR map in the payload
of the response. Then, the client MUST set the Master Salt of the of the response. Then, the client MUST set the Master Salt of the
Security Context created to communicate with the RS to the Security Context created to communicate with the RS to the
concatenation of salt, N1, and N2, in this order: Master Salt = concatenation of salt, N1, and N2, in this order: Master Salt =
salt | N1 | N2, where | denotes byte string concatenation, where salt salt | N1 | N2, where | denotes byte string concatenation, where salt
skipping to change at page 21, line 12 skipping to change at page 21, line 37
accessing the resources as specified by the authorization accessing the resources as specified by the authorization
information. information.
If any of the expected parameters is missing (e.g., any of the If any of the expected parameters is missing (e.g., any of the
mandatory parameters from the AS or the RS), or if mandatory parameters from the AS or the RS), or if
ace_client_recipientid equals ace_server_recipientid, then the client ace_client_recipientid equals ace_server_recipientid, then the client
MUST stop the exchange, and MUST NOT derive the Security Context. MUST stop the exchange, and MUST NOT derive the Security Context.
The client MAY restart the exchange, to get the correct security The client MAY restart the exchange, to get the correct security
material. material.
The client then uses this Security Context to send requests to RS The client then uses this Security Context to send requests to the RS
using OSCORE. using OSCORE.
After sending the 2.01 (Created) response, the RS MUST set the Master After sending the 2.01 (Created) response, the RS MUST set the Master
Salt of the Security Context created to communicate with the client Salt of the Security Context created to communicate with the client
to the concatenation of salt, N1, and N2, in the same way described to the concatenation of salt, N1, and N2, in the same way described
above. An example of Master Salt construction using CBOR encoding is above. An example of Master Salt construction using CBOR encoding is
given in Figure 12 and using Base64 encoding is given in Figure 13. given in Figure 12 and using Base64 encoding is given in Figure 13.
The RS MUST set the Sender ID from the ace_client_recipientid The RS MUST set the Sender ID from the ace_client_recipientid
received in Section 4.1, and the Recipient ID from the received in Section 4.1, and the Recipient ID from the
ace_server_recipientid sent in Section 4.2. The RS MUST set the ace_server_recipientid sent in Section 4.2. The RS MUST set the
Master Secret from the parameter, received from the AS and forwarded Master Secret from the parameter received from the AS and forwarded
by the client in the access token in Section 4.1 after validation of by the client in the access token in Section 4.1 after validation of
the token as specified in Section 4.2. The RS MUST set the AEAD the token as specified in Section 4.2. The RS MUST set the AEAD
Algorithm, ID Context, HKDF, and OSCORE Version from the parameters Algorithm, ID Context, HKDF, and OSCORE Version from the parameters
received from the AS and forwarded by the client in the access token received from the AS and forwarded by the client in the access token
in Section 4.1 after validation of the token as specified in in Section 4.1 after validation of the token as specified in
Section 4.2, if present. In case an optional parameter is omitted, Section 4.2, if present. In case an optional parameter is omitted,
the default value SHALL be used as described in sections 3.2 and 5.4 the default value SHALL be used as described in sections 3.2 and 5.4
of [RFC8613]. After that, the RS MUST derive the complete Security of [RFC8613]. After that, the RS MUST derive the complete Security
Context following section 3.2.1 of [RFC8613], and MUST associate this Context following section 3.2.1 of [RFC8613], and MUST associate this
Security Context with the authorization information from the access Security Context with the authorization information from the access
token. token.
The RS then uses this Security Context to verify requests and send The RS then uses this Security Context to verify requests and send
responses to C using OSCORE. If OSCORE verification fails, error responses to the client using OSCORE. If OSCORE verification fails,
responses are used, as specified in section 8 of [RFC8613]. error responses are used, as specified in section 8 of [RFC8613].
Additionally, if OSCORE verification succeeds, the verification of Additionally, if OSCORE verification succeeds, the verification of
access rights is performed as described in section Section 4.4. The access rights is performed as described in section Section 4.4. The
RS MUST NOT use the Security Context after the related token has RS MUST NOT use the Security Context after the related token has
expired, and MUST respond with a unprotected 4.01 (Unauthorized) expired, and MUST respond with a unprotected 4.01 (Unauthorized)
error message to requests received that correspond to a Security error message to requests received that correspond to a Security
Context with an expired token. Context with an expired token.
Note that the ID Context can be assigned by the AS, communicated and Note that the ID Context can be assigned by the AS, communicated and
set in both the RS and client after the exchange specified in this set in both the RS and client after the exchange specified in this
profile is executed. Subsequently, client and RS can update their ID profile is executed. Subsequently, client and RS can update their ID
Context by running a mechanism such as the one defined in Context by running a mechanism such as the one defined in
Appendix B.2 of [RFC8613] if they both support it and are configured Appendix B.2 of [RFC8613] if they both support it and are configured
to do so. In that case, the ID Context in the OSCORE Security to do so. In that case, the ID Context in the OSCORE Security
Context will not match the "contextId" parameter of the corresponding Context will not match the "contextId" parameter of the corresponding
OSCORE_Input_Material. Running Appendix B.2 results in the keying OSCORE_Input_Material. Running Appendix B.2 results in the keying
material in the Security Contexts of client and RS being updated; material in the Security Contexts of client and RS being updated;
this same result can also be achieved by the client reposting the this same result can also be achieved by the client reposting the
access token as described in Section 4.1, but without updating the ID access token to the unprotected /authz-info endpoint at the RS, as
Context. described in Section 4.1, but without updating the ID Context.
4.4. Access rights verification 4.4. Access rights verification
The RS MUST follow the procedures defined in section 5.8.2 of The RS MUST follow the procedures defined in section 5.8.2 of
[I-D.ietf-ace-oauth-authz]: if an RS receives an OSCORE-protected [I-D.ietf-ace-oauth-authz]: if an RS receives an OSCORE-protected
request from a client, then the RS processes it according to request from a client, then the RS processes it according to
[RFC8613]. If OSCORE verification succeeds, and the target resource [RFC8613]. If OSCORE verification succeeds, and the target resource
requires authorization, the RS retrieves the authorization requires authorization, the RS retrieves the authorization
information using the access token associated to the Security information using the access token associated to the Security
Context. The RS then must verify that the authorization information Context. The RS then must verify that the authorization information
covers the resource and the action requested. covers the resource and the action requested.
5. Secure Communication with AS 5. Secure Communication with AS
As specified in the ACE framework (section 5.7 of As specified in the ACE framework (section 5.7 of
[I-D.ietf-ace-oauth-authz]), the requesting entity (RS and/or client) [I-D.ietf-ace-oauth-authz]), the requesting entity (RS and/or client)
and the AS communicates via the introspection or token endpoint. The and the AS communicates via the introspection or token endpoint. The
use of CoAP and OSCORE ([RFC8613]) for this communication is use of CoAP and OSCORE ([RFC8613]) for this communication is
RECOMMENDED in this profile, other protocols (such as HTTP and DTLS RECOMMENDED in this profile; other protocols (such as HTTP and DTLS
or TLS) MAY be used instead. or TLS) MAY be used instead.
If OSCORE is used, the requesting entity and the AS are expected to If OSCORE is used, the requesting entity and the AS are expected to
have pre-established security contexts in place. How these security have pre-established security contexts in place. How these security
contexts are established is out of scope for this profile. contexts are established is out of scope for this profile.
Furthermore the requesting entity and the AS communicate through the Furthermore the requesting entity and the AS communicate through the
introspection endpoint as specified in section 5.7 of introspection endpoint as specified in section 5.7 of
[I-D.ietf-ace-oauth-authz] and through the token endpoint as [I-D.ietf-ace-oauth-authz] and through the token endpoint as
specified in section 5.6 of [I-D.ietf-ace-oauth-authz]. specified in section 5.6 of [I-D.ietf-ace-oauth-authz].
6. Discarding the Security Context 6. Discarding the Security Context
There are a number of scenarios where a client or RS needs to discard There are a number of scenarios where a client or RS needs to discard
the OSCORE security context, and acquire a new one. the OSCORE security context, and acquire a new one.
The client MUST discard the current Security Context associated with The client MUST discard the current Security Context associated with
an RS when: an RS when:
o the Sequence Number space ends. o the Sequence Number space ends.
o the access token associated with the context expires. o the access token associated with the context becomes invalid, due
to e.g. expiration.
o the client receives a number of 4.01 Unauthorized responses to o the client receives a number of 4.01 Unauthorized responses to
OSCORE requests using the same Security Context. The exact number OSCORE requests using the same Security Context. The exact number
needs to be specified by the application. needs to be specified by the application.
o the client receives a new nonce in the 2.01 (Created) response o the client receives a new nonce in the 2.01 (Created) response
(see Section 4.2) to a POST request to the authz-info endpoint, (see Section 4.2) to a POST request to the authz-info endpoint,
when re-posting a (non-expired) token associated to the existing when re-posting a (non-expired) token associated to the existing
context. context.
skipping to change at page 24, line 11 skipping to change at page 24, line 35
performed by both parties verifying that they have established the performed by both parties verifying that they have established the
same Security Context, as specified in Section 4.3, which means that same Security Context, as specified in Section 4.3, which means that
both the OSCORE request and OSCORE response pass verification. RS both the OSCORE request and OSCORE response pass verification. RS
authentication requires both that the client trusts the AS and that authentication requires both that the client trusts the AS and that
the OSCORE response from the RS pass verification. the OSCORE response from the RS pass verification.
OSCORE is designed to secure point-to-point communication, providing OSCORE is designed to secure point-to-point communication, providing
a secure binding between the request and the response(s). Thus the a secure binding between the request and the response(s). Thus the
basic OSCORE protocol is not intended for use in point-to-multipoint basic OSCORE protocol is not intended for use in point-to-multipoint
communication (e.g., multicast, publish-subscribe). Implementers of communication (e.g., multicast, publish-subscribe). Implementers of
this profile should make sure that their usecase corresponds to the this profile should make sure that their use case corresponds to the
expected use of OSCORE, to prevent weakening the security assurances expected use of OSCORE, to prevent weakening the security assurances
provided by OSCORE. provided by OSCORE.
Since the use of nonces in the exchange guarantees uniqueness of AEAD Since the use of nonces in the exchange guarantees uniqueness of AEAD
keys and nonces, it is REQUIRED that nonces are not reused with the keys and nonces, it is REQUIRED that nonces are not reused with the
same input keying material even in case of re-boots. This document same input keying material even in case of re-boots. This document
RECOMMENDS the use of 64 bit random nonces. Considering the birthday RECOMMENDS the use of 64 bit random nonces. Considering the birthday
paradox, the average collision for each nonce will happen after 2^32 paradox, the average collision for each nonce will happen after 2^32
messages, which is considerably more token provisionings than messages, which is considerably more token provisionings than
expected for intended applications. If applications use something expected for intended applications. If applications use something
else, such as a counter, they need to guarantee that reboot and loss else, such as a counter, they need to guarantee that reboot and loss
of state on either node does not provoke re-use. If that is not of state on either node does not provoke re-use. If that is not
guaranteed, nodes are susceptible to re-use of AEAD (nonces, keys) guaranteed, nodes are susceptible to re-use of AEAD (nonces, keys)
pairs, especially since an on-path attacker can cause the client to pairs, especially since an on-path attacker can cause the client to
use an arbitrary nonce for Security Context establishment by use an arbitrary nonce for Security Context establishment by
replaying client-to-server messages. replaying client-to-server messages.
This profile recommends that the RS maintains a single access token This profile recommends that the RS maintains a single access token
for a client. The use of multiple access tokens for a single client for each client. The use of multiple access tokens for a single
increases the strain on the resource server as it must consider every client increases the strain on the resource server as it must
access token and calculate the actual permissions of the client. consider every access token and calculate the actual permissions of
Also, tokens indicating different or disjoint permissions from each the client. Also, tokens indicating different or disjoint
other may lead the server to enforce wrong permissions. If one of permissions from each other may lead the server to enforce wrong
the access tokens expires earlier than others, the resulting permissions. If one of the access tokens expires earlier than
permissions may offer insufficient protection. Developers should others, the resulting permissions may offer insufficient protection.
avoid using multiple access tokens for a client. Developers should avoid using multiple access tokens for a same
client.
If a single OSCORE_Input_Material is used with multiple RSs, the RSs If a single OSCORE_Input_Material is used with multiple RSs, the RSs
can impersonate C to one of the other RS, and impersonate another RS can impersonate the client to one of the other RS, and impersonate
to the client. If a master secret is used with several clients, the another RS to the client. If a master secret is used with several
Cs can impersonate RS to one of the other C. Similarly if symmetric clients, the clients can impersonate RS to one of the other clients.
keys are used to integrity protect the token between AS and RS and Similarly if symmetric keys are used to integrity protect the token
the token can be used with multiple RSs, the RSs can impersonate AS between AS and RS and the token can be used with multiple RSs, the
to one of the other RS. If the token key is used for any other RSs can impersonate AS to one of the other RS. If the token key is
communication between the RSs and AS, the RSs can impersonate each used for any other communication between the RSs and AS, the RSs can
other to the AS. impersonate each other to the AS.
8. Privacy Considerations 8. Privacy Considerations
This document specifies a profile for the Authentication and This document specifies a profile for the Authentication and
Authorization for Constrained Environments (ACE) framework Authorization for Constrained Environments (ACE) framework
[I-D.ietf-ace-oauth-authz]. Thus the general privacy considerations [I-D.ietf-ace-oauth-authz]. Thus the general privacy considerations
from the framework also apply to this profile. from the framework also apply to this profile.
As this document uses OSCORE, thus the privacy considerations from As this document uses OSCORE, thus the privacy considerations from
[RFC8613] apply here as well. [RFC8613] apply here as well.
skipping to change at page 29, line 32 skipping to change at page 30, line 9
[COSE.Algorithms] [COSE.Algorithms]
IANA, "COSE Algorithms", IANA, "COSE Algorithms",
<https://www.iana.org/assignments/cose/ <https://www.iana.org/assignments/cose/
cose.xhtml#algorithms>. cose.xhtml#algorithms>.
[I-D.ietf-ace-oauth-authz] [I-D.ietf-ace-oauth-authz]
Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and
H. Tschofenig, "Authentication and Authorization for H. Tschofenig, "Authentication and Authorization for
Constrained Environments (ACE) using the OAuth 2.0 Constrained Environments (ACE) using the OAuth 2.0
Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-35 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-36
(work in progress), June 2020. (work in progress), November 2020.
[I-D.ietf-ace-oauth-params] [I-D.ietf-ace-oauth-params]
Seitz, L., "Additional OAuth Parameters for Authorization Seitz, L., "Additional OAuth Parameters for Authorization
in Constrained Environments (ACE)", draft-ietf-ace-oauth- in Constrained Environments (ACE)", draft-ietf-ace-oauth-
params-13 (work in progress), April 2020. params-13 (work in progress), April 2020.
[I-D.ietf-cbor-7049bis] [I-D.ietf-cbor-7049bis]
Bormann, C. and P. Hoffman, "Concise Binary Object Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", draft-ietf-cbor-7049bis-16 (work Representation (CBOR)", draft-ietf-cbor-7049bis-16 (work
in progress), September 2020. in progress), September 2020.
skipping to change at page 31, line 52 skipping to change at page 32, line 29
error responses are protected: Not protected. error responses are protected: Not protected.
o Optionally define other methods of token transport than the authz- o Optionally define other methods of token transport than the authz-
info endpoint: Not defined info endpoint: Not defined
Acknowledgments Acknowledgments
The authors wish to thank Jim Schaad and Marco Tiloca for the input The authors wish to thank Jim Schaad and Marco Tiloca for the input
on this memo. Special thanks to the responsible area director on this memo. Special thanks to the responsible area director
Benjamin Kaduk for his extensive review and contributed text. Ludwig Benjamin Kaduk for his extensive review and contributed text. Ludwig
Seitz worked on this document as part of the CelticNext projects Seitz worked on this document as part of the CelticNext projects
CyberWI, and CRITISEC with funding from Vinnova. CyberWI, and CRITISEC with funding from Vinnova. The work on this
document has been partly supported also by the H2020 project SIFIS-
Home (Grant agreement 952652).
Authors' Addresses Authors' Addresses
Francesca Palombini Francesca Palombini
Ericsson AB Ericsson AB
Email: francesca.palombini@ericsson.com Email: francesca.palombini@ericsson.com
Ludwig Seitz Ludwig Seitz
Combitech Combitech
 End of changes. 60 change blocks. 
144 lines changed or deleted 168 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/