by comparing values, using reference measures, and
producing the Attestation Results. This is done in step
5 of Figure 1.
3.2 Passport Model Steps
After producing the attestation, the Verifier signs it
with its private key and sends it, through a secure
channel, to the Attester, as illustrated in step 6 of Fig-
ure 1. The Attester must immediately send the re-
ceived certificate to be evaluated by the Relying Party,
as per step 7 in Figure 1. The Attester cannot process,
verify or change the received certificate. At most, it
can keep until it expires.
The Attestation results can contain a Boolean
value indicating compliance or non-compliance with
a verifier’s assessment policy, dispensing with the use
of a Relying Party Owner to provide an additional
evaluation policy (Birkholz et al., 2022b). The Re-
lying Party confers greater confidence in the model,
as it is responsible for verifying whether the attesta-
tion result is reliable and valid, deciding the level of
access it will give (or not) to the system.
When the relying party receives the certificate, it
starts evaluating the information, verifying the signa-
ture and the value(s) received. At this time, and de-
pending on the policy, it will give privileges to the
Attester according to the results of the attestation, as
per step 8 in Figure 1.
In the stages where information is exchanged be-
tween parties, it is carried out through a secure com-
munication channel.
3.3 Implementation Details
The implementation of CHARRA-PM was based on
CHARRA. For instance, we reused CHARRA code,
such as calling connection and cryptographic func-
tions. CHARRA-PM introduced new functions, de-
veloped to handle the Passport Model functionality. It
should be noted that it was not a development from
scratch but an improvement to the existing code with
the endorsement of developer Michael Eckel (Eckel
and Riemann, 2021). The CHARRA-PM was coded
as Proof of Concept (PoC) to the Passport Model as
described in RATS documentation (Birkholz et al.,
2022b) and the code is available on GitHub as Open-
Source (Marques, 2022).
3.3.1 Establishing a CoAP Session with DTLS
This section will present and explain the piece of code
functions that handle CoAP sessions using DTLS
PSK and RPK.
c o a p s e s s i o n = c h a r r a c o a p n e w c l i e n t s e s s i o n p s k ( c t x ,
LISTEN RP , p o r t r p , COAP PROTO DTLS , t l s p s k i d e n t i t y ,
( u i n t 8 t
*
) d t l s p s k k e y , s t r l e n ( d t l s p s k k e y )
Listing 1: Function to set up PSK CoAP connection.
charra coap new client session() function
listed in List 1, is responsible for establishing a
channel through the CoAP protocol using DTLS-
PSK with Pre-Shared key. The shared key is known
to all parties involved (dtls psk key). The other
fields identify the Relying Party, the DTLS protocol
(COAP PROTO DTLS), the shared key, and its size.
c h a r r a c o a p s e t u p d t l s p k i f o r r p k (& d t l s p k i ,
d t l s r p k p r i v a t e k e y p a t h , d t l s r p k p u b l i c k e y p a t h ,
d t l s r p k p e e r p u b l i c k e y p a t h ,
d t l s r p k v e r i f y p e e r p u b l i c k e y ) ;
Listing 2: Function to set up RPK CoAP connection.
Function charra coap setup dtls pki for rpk()
listed in List 2, is responsible for establishing a chan-
nel through the CoAP protocol using DTLS-RPK
with Raw Public Keys. Here the public key of the
target device must be known. That is, the Attester
knows the public key of the Verifier and the Relying
Party; Verifier knows the Attester’s public key; the
Relying Party knows the public key of the Attester
and the Verifier. The advantage of this approach is
related with the fact of sharing a pre-shared key be-
tween the involved entities.
3.3.2 Receipt of the Certificate by the Relying
Party
This is where the Relying Party call functions
responsible to appraise the Attestation Result -
attestetionResult.
0 1 : /
*
Re a d i n g CoAP d a t a
*
/
c o a p g e t d a t a l a r g e ( i n , &d a t a l e n , &d a t a ,
&d a t a o f f s e t , &d a t a t o t a l l e n ) ;
0 2 : /
*
c o n v e r t f ro m CBOR t o d a t a
*
/
c h a r r a u n m a r s h a l a t t e s t a t i o n p a s s p o r t ( d a t a l e n , d a t a , &
a t t r e s u l t ) ;
0 3 : /
*
V a l i d a t i n g s i g n a t u r e
*
/
c h a r r a v e r i f y a t t r e s u l t ( v e r i f i e r p u b l i c k e y p a t h ,
a t t r e s u l t . a t t e s t a t i o n r e s u l t d a t a ,
a t t r e s u l t . a t t e s t a t i o n s i g n a t u r e ,
a t t r e s u l t . a t t e s t a t i o n s i g n a t u r e l e n ) ;
0 4 : /
*
m b e d t l s f u n c t i o n r e l a t e d t o s i g n a t u r e v e r i f y
*
/
m b e d t l s p k p a r s e p u b l i c k e y f i l e (& p e e r p u b l i c k e y ,
p e e r p u b l i c k e y p a t h ) ;
c h a r r a c r y p t o h a s h (MBEDTLS MD SHA256 , a t t r e s u l t ,
a t t r e s u l t l e n , h a s h ) ;
m b e d t l s p k v e r i f y ( &p e e r p u b l i c k e y , MBEDTLS MD SHA256 ,
ha sh , 0 , s i g n a t u r e , s i g s i z e ) ;
Listing 3: Receive and appraise Attestation Results.
Listing 3 shows excerpt of code with several steps:
Step 01. Reading the data received via CoAP.
Step 02. Reverting the CBOR encoding in data that
can be processed.
CHARRA-PM: An Attestation Approach Relying on the Passport Model
353