Coverage Report

Created: 2025-03-18 06:55

/src/gnutls/lib/constate.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (C) 2000-2012 Free Software Foundation, Inc.
3
 *
4
 * Author: Nikos Mavrogiannopoulos
5
 *
6
 * This file is part of GnuTLS.
7
 *
8
 * The GnuTLS is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public License
10
 * as published by the Free Software Foundation; either version 2.1 of
11
 * the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful, but
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public License
19
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
20
 *
21
 */
22
23
#ifndef GNUTLS_LIB_CONSTATE_H
24
#define GNUTLS_LIB_CONSTATE_H
25
26
int _gnutls_set_cipher_suite2(gnutls_session_t session,
27
            const gnutls_cipher_suite_entry_st *cs);
28
29
int _gnutls_epoch_set_keys(gnutls_session_t session, uint16_t epoch,
30
         hs_stage_t stage);
31
int _gnutls_connection_state_init(gnutls_session_t session);
32
int _gnutls_read_connection_state_init(gnutls_session_t session);
33
int _gnutls_write_connection_state_init(gnutls_session_t session);
34
35
0
#define _gnutls_epoch_bump(session) (session)->security_parameters.epoch_next++
36
37
int _gnutls_epoch_dup(gnutls_session_t session, unsigned int epoch_rel);
38
39
int _gnutls_epoch_get(gnutls_session_t session, unsigned int epoch_rel,
40
          record_parameters_st **params_out);
41
int _gnutls_epoch_setup_next(gnutls_session_t session, unsigned null_epoch,
42
           record_parameters_st **newp);
43
void _gnutls_epoch_gc(gnutls_session_t session);
44
void _gnutls_epoch_free(gnutls_session_t session, record_parameters_st *state);
45
46
void _gnutls_set_resumed_parameters(gnutls_session_t session);
47
48
int _tls13_connection_state_init(gnutls_session_t session, hs_stage_t stage);
49
int _tls13_read_connection_state_init(gnutls_session_t session,
50
              hs_stage_t stage);
51
int _tls13_write_connection_state_init(gnutls_session_t session,
52
               hs_stage_t stage);
53
54
static inline int _gnutls_epoch_is_valid(gnutls_session_t session, int epoch)
55
0
{
56
0
  record_parameters_st *params;
57
0
  int ret;
58
59
0
  ret = _gnutls_epoch_get(session, epoch, &params);
60
0
  if (ret < 0)
61
0
    return 0;
62
63
0
  return 1;
64
0
}
Unexecuted instantiation: record.c:_gnutls_epoch_is_valid
Unexecuted instantiation: cipher.c:_gnutls_epoch_is_valid
Unexecuted instantiation: handshake-tls13.c:_gnutls_epoch_is_valid
Unexecuted instantiation: buffers.c:_gnutls_epoch_is_valid
Unexecuted instantiation: handshake.c:_gnutls_epoch_is_valid
Unexecuted instantiation: kx.c:_gnutls_epoch_is_valid
Unexecuted instantiation: sslv2_compat.c:_gnutls_epoch_is_valid
Unexecuted instantiation: session_pack.c:_gnutls_epoch_is_valid
Unexecuted instantiation: constate.c:_gnutls_epoch_is_valid
Unexecuted instantiation: alert.c:_gnutls_epoch_is_valid
Unexecuted instantiation: state.c:_gnutls_epoch_is_valid
Unexecuted instantiation: cert-cred-x509.c:_gnutls_epoch_is_valid
Unexecuted instantiation: dtls.c:_gnutls_epoch_is_valid
Unexecuted instantiation: system_override.c:_gnutls_epoch_is_valid
Unexecuted instantiation: prf.c:_gnutls_epoch_is_valid
Unexecuted instantiation: handshake-checks.c:_gnutls_epoch_is_valid
Unexecuted instantiation: dtls-sw.c:_gnutls_epoch_is_valid
Unexecuted instantiation: ocsp-api.c:_gnutls_epoch_is_valid
Unexecuted instantiation: encrypted_extensions.c:_gnutls_epoch_is_valid
Unexecuted instantiation: certificate_request.c:_gnutls_epoch_is_valid
Unexecuted instantiation: certificate_verify.c:_gnutls_epoch_is_valid
Unexecuted instantiation: finished.c:_gnutls_epoch_is_valid
Unexecuted instantiation: key_update.c:_gnutls_epoch_is_valid
Unexecuted instantiation: hello_retry.c:_gnutls_epoch_is_valid
Unexecuted instantiation: session_ticket.c:_gnutls_epoch_is_valid
Unexecuted instantiation: certificate.c:_gnutls_epoch_is_valid
Unexecuted instantiation: early_data.c:_gnutls_epoch_is_valid
Unexecuted instantiation: post_handshake.c:_gnutls_epoch_is_valid
Unexecuted instantiation: heartbeat.c:_gnutls_epoch_is_valid
Unexecuted instantiation: key_share.c:_gnutls_epoch_is_valid
Unexecuted instantiation: pre_shared_key.c:_gnutls_epoch_is_valid
Unexecuted instantiation: status_request.c:_gnutls_epoch_is_valid
Unexecuted instantiation: supported_versions.c:_gnutls_epoch_is_valid
Unexecuted instantiation: cert.c:_gnutls_epoch_is_valid
65
66
static inline int _gnutls_epoch_refcount_inc(gnutls_session_t session,
67
               int epoch)
68
0
{
69
0
  record_parameters_st *params;
70
0
  int ret;
71
72
0
  ret = _gnutls_epoch_get(session, epoch, &params);
73
0
  if (ret < 0)
74
0
    return ret;
75
76
0
  params->usage_cnt++;
77
78
0
  return params->epoch;
79
0
}
Unexecuted instantiation: record.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: cipher.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: handshake-tls13.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: buffers.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: handshake.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: kx.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: sslv2_compat.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: session_pack.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: constate.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: alert.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: state.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: cert-cred-x509.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: dtls.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: system_override.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: prf.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: handshake-checks.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: dtls-sw.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: ocsp-api.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: encrypted_extensions.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: certificate_request.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: certificate_verify.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: finished.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: key_update.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: hello_retry.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: session_ticket.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: certificate.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: early_data.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: post_handshake.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: heartbeat.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: key_share.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: pre_shared_key.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: status_request.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: supported_versions.c:_gnutls_epoch_refcount_inc
Unexecuted instantiation: cert.c:_gnutls_epoch_refcount_inc
80
81
static inline int _gnutls_epoch_refcount_dec(gnutls_session_t session,
82
               uint16_t epoch)
83
0
{
84
0
  record_parameters_st *params;
85
0
  int ret;
86
87
0
  ret = _gnutls_epoch_get(session, epoch, &params);
88
0
  if (ret < 0)
89
0
    return ret;
90
91
0
  params->usage_cnt--;
92
0
  if (params->usage_cnt < 0)
93
0
    return GNUTLS_E_INTERNAL_ERROR;
94
95
0
  return 0;
96
0
}
Unexecuted instantiation: record.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: cipher.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: handshake-tls13.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: buffers.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: handshake.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: kx.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: sslv2_compat.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: session_pack.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: constate.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: alert.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: state.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: cert-cred-x509.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: dtls.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: system_override.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: prf.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: handshake-checks.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: dtls-sw.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: ocsp-api.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: encrypted_extensions.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: certificate_request.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: certificate_verify.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: finished.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: key_update.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: hello_retry.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: session_ticket.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: certificate.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: early_data.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: post_handshake.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: heartbeat.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: key_share.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: pre_shared_key.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: status_request.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: supported_versions.c:_gnutls_epoch_refcount_dec
Unexecuted instantiation: cert.c:_gnutls_epoch_refcount_dec
97
98
#endif /* GNUTLS_LIB_CONSTATE_H */