# Evaluation and Improvement of Internet Printing Protocol Based on HCPN Model Detection Method
## 3 Establishment of HCPN Model for IPP Authentication Process
### 0-RTT Authentication Model
#### 3.2.3 Middle-Level Model
After the verification was passed, the client generated its own message authentication code \"CFinished\" and sent it to the server. As shown in Figure 4, the model of the network included 16 message places and 8 transitions, which described the process of receiving and sending data packets from the client and server through the network channel. From top to bottom, the three phases of parameters exchange, identity authentication, and session resumption occurred in sequence, and a total of eight messages were delivered. As shown in Figure 5, the model of the entity layer Server included 34 message places and 16 transitions. This model described the server receiving the messages from the network channel and processing them. It completed the whole process from establishing the initial session to session resumption. Figure 4: Network channel. Step 1: Received the message MSG1, obtained the client identity (CID), random number (nc), and cipher suite (offer). Selected the cipher suite mode supported by itself from the offer. For simplicity, in this model, the client only provided a set of commonly used suites (x25519, AES128 GCM, SHA256), and it was assumed that the server supported this suite. Step 2: The server generated its own identity (SID) and random number (ns), and organized it together with the (mode) to be sent as MSG2. Step 3: The server completed part of the ECDHE exchange, used HKDF to derive temporary keys (ksh, ksm, kch, kcm), assigned values (4, 5, 6, 7), and passed them into the transition genSCiphers. The transition generated MSG3 and sends it out. Step 4: Received MSG4 (c5, c6, c7) to authenticate the client identity (among them, the three ciphertexts c5, c6, and c7 were encrypted by the client messages certificate, certificate-verify, and finished through the temporary symmetric key TempKey). After the verification was passed, the server obtained the client public key, and the ECDHE key exchange was completed. The server generated an initial session key and encrypted and transmitted MSG5. MSG5 contained the session resumption credential ticket, whose main component was the client identity marked by the server and bound to the current initial session. This value was obtained by encrypting the pre-shared key PSK with the server private key  
Figure 5: Server entity. S_prk, which avoided the transmission of the PSK plaintext in the network channel and could ensure that PSK was not leaked even if the initial session key was leaked. Step 5: The server received MSG6 and restored the session in a simple way. The hash value binder was bound to the initial session and the ticket. After verifying that the ticket was legitimate with the private key S_prk, the server queried the pre-shared key PSK corresponding to the ticket and exclusive to client A in its own database. Then, it derived EDK to decrypt the early data and generate subsequent session keys. Finally, the generated message authentication code SFinished was encapsulated as MSG7 and sent to the client. Step 6: Received the client message authentication code CFinished. If the verification passed, the subsequent session would be completely restored.