• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is part of the openHiTLS project.
3  *
4  * openHiTLS is licensed under the Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *
8  *     http://license.coscl.org.cn/MulanPSL2
9  *
10  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13  * See the Mulan PSL v2 for more details.
14  */
15 #include "hitls_build.h"
16 #include "recv_process.h"
17 #ifdef HITLS_TLS_HOST_CLIENT
18 #if defined(HITLS_TLS_PROTO_TLS_BASIC) || defined(HITLS_TLS_PROTO_DTLS12)
19 #include "rec.h"
20 #include "hs_ctx.h"
21 #include "hs_common.h"
22 
ClientRecvServerHelloDoneProcess(TLS_Ctx * ctx)23 int32_t ClientRecvServerHelloDoneProcess(TLS_Ctx *ctx)
24 {
25     /** get client infomation */
26     HS_Ctx *hsCtx = (HS_Ctx *)ctx->hsCtx;
27 
28 #if defined(HITLS_TLS_PROTO_DTLS12) && defined(HITLS_BSL_UIO_UDP)
29     /* clear the retransmission queue */
30     REC_RetransmitListClean(ctx->recCtx);
31 #endif
32 
33     /** Certificate messages are sent whenever a server certificate request is received,
34         regardless of whether the client has a proper certificate. */
35     if (hsCtx->isNeedClientCert) {
36         return HS_ChangeState(ctx, TRY_SEND_CERTIFICATE);
37     }
38     return HS_ChangeState(ctx, TRY_SEND_CLIENT_KEY_EXCHANGE);
39 }
40 #endif /* HITLS_TLS_PROTO_TLS_BASIC || HITLS_TLS_PROTO_DTLS12 */
41 #endif /* HITLS_TLS_HOST_CLIENT */