Coverage Report

Created: 2023-06-08 06:40

/src/openssl111/ssl/packet_local.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
3
 *
4
 * Licensed under the OpenSSL license (the "License").  You may not use
5
 * this file except in compliance with the License.  You can obtain a copy
6
 * in the file LICENSE in the source distribution or at
7
 * https://www.openssl.org/source/license.html
8
 */
9
10
#ifndef OSSL_SSL_PACKET_LOCAL_H
11
# define OSSL_SSL_PACKET_LOCAL_H
12
13
# include <string.h>
14
# include <openssl/bn.h>
15
# include <openssl/buffer.h>
16
# include <openssl/crypto.h>
17
# include <openssl/e_os2.h>
18
19
# include "internal/numbers.h"
20
21
typedef struct {
22
    /* Pointer to where we are currently reading from */
23
    const unsigned char *curr;
24
    /* Number of bytes remaining */
25
    size_t remaining;
26
} PACKET;
27
28
/* Internal unchecked shorthand; don't use outside this file. */
29
static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30
258k
{
31
258k
    pkt->curr += len;
32
258k
    pkt->remaining -= len;
33
258k
}
Unexecuted instantiation: methods.c:packet_forward
Unexecuted instantiation: rec_layer_d1.c:packet_forward
rec_layer_s3.c:packet_forward
Line
Count
Source
30
1.21k
{
31
1.21k
    pkt->curr += len;
32
1.21k
    pkt->remaining -= len;
33
1.21k
}
Unexecuted instantiation: ssl3_buffer.c:packet_forward
ssl3_record.c:packet_forward
Line
Count
Source
30
85.9k
{
31
85.9k
    pkt->curr += len;
32
85.9k
    pkt->remaining -= len;
33
85.9k
}
Unexecuted instantiation: ssl3_record_tls13.c:packet_forward
Unexecuted instantiation: s3_cbc.c:packet_forward
Unexecuted instantiation: s3_lib.c:packet_forward
Unexecuted instantiation: s3_msg.c:packet_forward
Unexecuted instantiation: ssl_cert.c:packet_forward
Unexecuted instantiation: ssl_ciph.c:packet_forward
Unexecuted instantiation: ssl_init.c:packet_forward
Unexecuted instantiation: ssl_lib.c:packet_forward
Unexecuted instantiation: ssl_mcnf.c:packet_forward
Unexecuted instantiation: ssl_sess.c:packet_forward
extensions.c:packet_forward
Line
Count
Source
30
57.1k
{
31
57.1k
    pkt->curr += len;
32
57.1k
    pkt->remaining -= len;
33
57.1k
}
extensions_clnt.c:packet_forward
Line
Count
Source
30
13.5k
{
31
13.5k
    pkt->curr += len;
32
13.5k
    pkt->remaining -= len;
33
13.5k
}
Unexecuted instantiation: extensions_cust.c:packet_forward
Unexecuted instantiation: extensions_srvr.c:packet_forward
Unexecuted instantiation: statem.c:packet_forward
statem_clnt.c:packet_forward
Line
Count
Source
30
88.2k
{
31
88.2k
    pkt->curr += len;
32
88.2k
    pkt->remaining -= len;
33
88.2k
}
Unexecuted instantiation: statem_dtls.c:packet_forward
statem_lib.c:packet_forward
Line
Count
Source
30
1.62k
{
31
1.62k
    pkt->curr += len;
32
1.62k
    pkt->remaining -= len;
33
1.62k
}
Unexecuted instantiation: statem_srvr.c:packet_forward
t1_lib.c:packet_forward
Line
Count
Source
30
10.7k
{
31
10.7k
    pkt->curr += len;
32
10.7k
    pkt->remaining -= len;
33
10.7k
}
Unexecuted instantiation: tls13_enc.c:packet_forward
Unexecuted instantiation: tls_srp.c:packet_forward
Unexecuted instantiation: d1_lib.c:packet_forward
Unexecuted instantiation: d1_msg.c:packet_forward
Unexecuted instantiation: d1_srtp.c:packet_forward
Unexecuted instantiation: packet.c:packet_forward
Unexecuted instantiation: pqueue.c:packet_forward
Unexecuted instantiation: dtls1_bitmap.c:packet_forward
Unexecuted instantiation: s3_enc.c:packet_forward
Unexecuted instantiation: ssl_asn1.c:packet_forward
Unexecuted instantiation: ssl_conf.c:packet_forward
Unexecuted instantiation: ssl_rsa.c:packet_forward
Unexecuted instantiation: t1_enc.c:packet_forward
34
35
/*
36
 * Returns the number of bytes remaining to be read in the PACKET
37
 */
38
static ossl_inline size_t PACKET_remaining(const PACKET *pkt)
39
357k
{
40
357k
    return pkt->remaining;
41
357k
}
Unexecuted instantiation: methods.c:PACKET_remaining
Unexecuted instantiation: rec_layer_d1.c:PACKET_remaining
rec_layer_s3.c:PACKET_remaining
Line
Count
Source
39
1.84k
{
40
1.84k
    return pkt->remaining;
41
1.84k
}
Unexecuted instantiation: ssl3_buffer.c:PACKET_remaining
ssl3_record.c:PACKET_remaining
Line
Count
Source
39
85.9k
{
40
85.9k
    return pkt->remaining;
41
85.9k
}
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_remaining
Unexecuted instantiation: s3_cbc.c:PACKET_remaining
Unexecuted instantiation: s3_lib.c:PACKET_remaining
Unexecuted instantiation: s3_msg.c:PACKET_remaining
Unexecuted instantiation: ssl_cert.c:PACKET_remaining
Unexecuted instantiation: ssl_ciph.c:PACKET_remaining
Unexecuted instantiation: ssl_init.c:PACKET_remaining
Unexecuted instantiation: ssl_lib.c:PACKET_remaining
Unexecuted instantiation: ssl_mcnf.c:PACKET_remaining
Unexecuted instantiation: ssl_sess.c:PACKET_remaining
extensions.c:PACKET_remaining
Line
Count
Source
39
83.2k
{
40
83.2k
    return pkt->remaining;
41
83.2k
}
extensions_clnt.c:PACKET_remaining
Line
Count
Source
39
22.6k
{
40
22.6k
    return pkt->remaining;
41
22.6k
}
Unexecuted instantiation: extensions_cust.c:PACKET_remaining
Unexecuted instantiation: extensions_srvr.c:PACKET_remaining
Unexecuted instantiation: statem.c:PACKET_remaining
statem_clnt.c:PACKET_remaining
Line
Count
Source
39
149k
{
40
149k
    return pkt->remaining;
41
149k
}
Unexecuted instantiation: statem_dtls.c:PACKET_remaining
statem_lib.c:PACKET_remaining
Line
Count
Source
39
2.86k
{
40
2.86k
    return pkt->remaining;
41
2.86k
}
Unexecuted instantiation: statem_srvr.c:PACKET_remaining
t1_lib.c:PACKET_remaining
Line
Count
Source
39
10.8k
{
40
10.8k
    return pkt->remaining;
41
10.8k
}
Unexecuted instantiation: tls13_enc.c:PACKET_remaining
Unexecuted instantiation: tls_srp.c:PACKET_remaining
Unexecuted instantiation: d1_lib.c:PACKET_remaining
Unexecuted instantiation: d1_msg.c:PACKET_remaining
Unexecuted instantiation: d1_srtp.c:PACKET_remaining
Unexecuted instantiation: packet.c:PACKET_remaining
Unexecuted instantiation: pqueue.c:PACKET_remaining
Unexecuted instantiation: dtls1_bitmap.c:PACKET_remaining
Unexecuted instantiation: s3_enc.c:PACKET_remaining
Unexecuted instantiation: ssl_asn1.c:PACKET_remaining
Unexecuted instantiation: ssl_conf.c:PACKET_remaining
Unexecuted instantiation: ssl_rsa.c:PACKET_remaining
Unexecuted instantiation: t1_enc.c:PACKET_remaining
42
43
/*
44
 * Returns a pointer to the first byte after the packet data.
45
 * Useful for integrating with non-PACKET parsing code.
46
 * Specifically, we use PACKET_end() to verify that a d2i_... call
47
 * has consumed the entire packet contents.
48
 */
49
static ossl_inline const unsigned char *PACKET_end(const PACKET *pkt)
50
0
{
51
0
    return pkt->curr + pkt->remaining;
52
0
}
Unexecuted instantiation: methods.c:PACKET_end
Unexecuted instantiation: rec_layer_d1.c:PACKET_end
Unexecuted instantiation: rec_layer_s3.c:PACKET_end
Unexecuted instantiation: ssl3_buffer.c:PACKET_end
Unexecuted instantiation: ssl3_record.c:PACKET_end
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_end
Unexecuted instantiation: s3_cbc.c:PACKET_end
Unexecuted instantiation: s3_lib.c:PACKET_end
Unexecuted instantiation: s3_msg.c:PACKET_end
Unexecuted instantiation: ssl_cert.c:PACKET_end
Unexecuted instantiation: ssl_ciph.c:PACKET_end
Unexecuted instantiation: ssl_init.c:PACKET_end
Unexecuted instantiation: ssl_lib.c:PACKET_end
Unexecuted instantiation: ssl_mcnf.c:PACKET_end
Unexecuted instantiation: ssl_sess.c:PACKET_end
Unexecuted instantiation: extensions.c:PACKET_end
Unexecuted instantiation: extensions_clnt.c:PACKET_end
Unexecuted instantiation: extensions_cust.c:PACKET_end
Unexecuted instantiation: extensions_srvr.c:PACKET_end
Unexecuted instantiation: statem.c:PACKET_end
Unexecuted instantiation: statem_clnt.c:PACKET_end
Unexecuted instantiation: statem_dtls.c:PACKET_end
Unexecuted instantiation: statem_lib.c:PACKET_end
Unexecuted instantiation: statem_srvr.c:PACKET_end
Unexecuted instantiation: t1_lib.c:PACKET_end
Unexecuted instantiation: tls13_enc.c:PACKET_end
Unexecuted instantiation: tls_srp.c:PACKET_end
Unexecuted instantiation: d1_lib.c:PACKET_end
Unexecuted instantiation: d1_msg.c:PACKET_end
Unexecuted instantiation: d1_srtp.c:PACKET_end
Unexecuted instantiation: packet.c:PACKET_end
Unexecuted instantiation: pqueue.c:PACKET_end
Unexecuted instantiation: dtls1_bitmap.c:PACKET_end
Unexecuted instantiation: s3_enc.c:PACKET_end
Unexecuted instantiation: ssl_asn1.c:PACKET_end
Unexecuted instantiation: ssl_conf.c:PACKET_end
Unexecuted instantiation: ssl_rsa.c:PACKET_end
Unexecuted instantiation: t1_enc.c:PACKET_end
53
54
/*
55
 * Returns a pointer to the PACKET's current position.
56
 * For use in non-PACKETized APIs.
57
 */
58
static ossl_inline const unsigned char *PACKET_data(const PACKET *pkt)
59
14.7k
{
60
14.7k
    return pkt->curr;
61
14.7k
}
Unexecuted instantiation: methods.c:PACKET_data
Unexecuted instantiation: rec_layer_d1.c:PACKET_data
Unexecuted instantiation: rec_layer_s3.c:PACKET_data
Unexecuted instantiation: ssl3_buffer.c:PACKET_data
Unexecuted instantiation: ssl3_record.c:PACKET_data
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_data
Unexecuted instantiation: s3_cbc.c:PACKET_data
Unexecuted instantiation: s3_lib.c:PACKET_data
Unexecuted instantiation: s3_msg.c:PACKET_data
Unexecuted instantiation: ssl_cert.c:PACKET_data
Unexecuted instantiation: ssl_ciph.c:PACKET_data
Unexecuted instantiation: ssl_init.c:PACKET_data
Unexecuted instantiation: ssl_lib.c:PACKET_data
Unexecuted instantiation: ssl_mcnf.c:PACKET_data
Unexecuted instantiation: ssl_sess.c:PACKET_data
extensions.c:PACKET_data
Line
Count
Source
59
22
{
60
22
    return pkt->curr;
61
22
}
extensions_clnt.c:PACKET_data
Line
Count
Source
59
121
{
60
121
    return pkt->curr;
61
121
}
Unexecuted instantiation: extensions_cust.c:PACKET_data
Unexecuted instantiation: extensions_srvr.c:PACKET_data
Unexecuted instantiation: statem.c:PACKET_data
statem_clnt.c:PACKET_data
Line
Count
Source
59
14.6k
{
60
14.6k
    return pkt->curr;
61
14.6k
}
Unexecuted instantiation: statem_dtls.c:PACKET_data
statem_lib.c:PACKET_data
Line
Count
Source
59
4
{
60
4
    return pkt->curr;
61
4
}
Unexecuted instantiation: statem_srvr.c:PACKET_data
Unexecuted instantiation: t1_lib.c:PACKET_data
Unexecuted instantiation: tls13_enc.c:PACKET_data
Unexecuted instantiation: tls_srp.c:PACKET_data
Unexecuted instantiation: d1_lib.c:PACKET_data
Unexecuted instantiation: d1_msg.c:PACKET_data
Unexecuted instantiation: d1_srtp.c:PACKET_data
Unexecuted instantiation: packet.c:PACKET_data
Unexecuted instantiation: pqueue.c:PACKET_data
Unexecuted instantiation: dtls1_bitmap.c:PACKET_data
Unexecuted instantiation: s3_enc.c:PACKET_data
Unexecuted instantiation: ssl_asn1.c:PACKET_data
Unexecuted instantiation: ssl_conf.c:PACKET_data
Unexecuted instantiation: ssl_rsa.c:PACKET_data
Unexecuted instantiation: t1_enc.c:PACKET_data
62
63
/*
64
 * Initialise a PACKET with |len| bytes held in |buf|. This does not make a
65
 * copy of the data so |buf| must be present for the whole time that the PACKET
66
 * is being used.
67
 */
68
__owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
69
                                              const unsigned char *buf,
70
                                              size_t len)
71
36.3k
{
72
    /* Sanity check for negative values. */
73
36.3k
    if (len > (size_t)(SIZE_MAX / 2))
74
0
        return 0;
75
76
36.3k
    pkt->curr = buf;
77
36.3k
    pkt->remaining = len;
78
36.3k
    return 1;
79
36.3k
}
Unexecuted instantiation: methods.c:PACKET_buf_init
Unexecuted instantiation: rec_layer_d1.c:PACKET_buf_init
rec_layer_s3.c:PACKET_buf_init
Line
Count
Source
71
624
{
72
    /* Sanity check for negative values. */
73
624
    if (len > (size_t)(SIZE_MAX / 2))
74
0
        return 0;
75
76
624
    pkt->curr = buf;
77
624
    pkt->remaining = len;
78
624
    return 1;
79
624
}
Unexecuted instantiation: ssl3_buffer.c:PACKET_buf_init
ssl3_record.c:PACKET_buf_init
Line
Count
Source
71
17.1k
{
72
    /* Sanity check for negative values. */
73
17.1k
    if (len > (size_t)(SIZE_MAX / 2))
74
0
        return 0;
75
76
17.1k
    pkt->curr = buf;
77
17.1k
    pkt->remaining = len;
78
17.1k
    return 1;
79
17.1k
}
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_buf_init
Unexecuted instantiation: s3_cbc.c:PACKET_buf_init
Unexecuted instantiation: s3_lib.c:PACKET_buf_init
Unexecuted instantiation: s3_msg.c:PACKET_buf_init
Unexecuted instantiation: ssl_cert.c:PACKET_buf_init
Unexecuted instantiation: ssl_ciph.c:PACKET_buf_init
Unexecuted instantiation: ssl_init.c:PACKET_buf_init
Unexecuted instantiation: ssl_lib.c:PACKET_buf_init
Unexecuted instantiation: ssl_mcnf.c:PACKET_buf_init
Unexecuted instantiation: ssl_sess.c:PACKET_buf_init
Unexecuted instantiation: extensions.c:PACKET_buf_init
Unexecuted instantiation: extensions_clnt.c:PACKET_buf_init
Unexecuted instantiation: extensions_cust.c:PACKET_buf_init
Unexecuted instantiation: extensions_srvr.c:PACKET_buf_init
statem.c:PACKET_buf_init
Line
Count
Source
71
17.7k
{
72
    /* Sanity check for negative values. */
73
17.7k
    if (len > (size_t)(SIZE_MAX / 2))
74
0
        return 0;
75
76
17.7k
    pkt->curr = buf;
77
17.7k
    pkt->remaining = len;
78
17.7k
    return 1;
79
17.7k
}
statem_clnt.c:PACKET_buf_init
Line
Count
Source
71
753
{
72
    /* Sanity check for negative values. */
73
753
    if (len > (size_t)(SIZE_MAX / 2))
74
0
        return 0;
75
76
753
    pkt->curr = buf;
77
753
    pkt->remaining = len;
78
753
    return 1;
79
753
}
Unexecuted instantiation: statem_dtls.c:PACKET_buf_init
Unexecuted instantiation: statem_lib.c:PACKET_buf_init
Unexecuted instantiation: statem_srvr.c:PACKET_buf_init
Unexecuted instantiation: t1_lib.c:PACKET_buf_init
Unexecuted instantiation: tls13_enc.c:PACKET_buf_init
Unexecuted instantiation: tls_srp.c:PACKET_buf_init
Unexecuted instantiation: d1_lib.c:PACKET_buf_init
Unexecuted instantiation: d1_msg.c:PACKET_buf_init
Unexecuted instantiation: d1_srtp.c:PACKET_buf_init
Unexecuted instantiation: packet.c:PACKET_buf_init
Unexecuted instantiation: pqueue.c:PACKET_buf_init
Unexecuted instantiation: dtls1_bitmap.c:PACKET_buf_init
Unexecuted instantiation: s3_enc.c:PACKET_buf_init
Unexecuted instantiation: ssl_asn1.c:PACKET_buf_init
Unexecuted instantiation: ssl_conf.c:PACKET_buf_init
Unexecuted instantiation: ssl_rsa.c:PACKET_buf_init
Unexecuted instantiation: t1_enc.c:PACKET_buf_init
80
81
/* Initialize a PACKET to hold zero bytes. */
82
static ossl_inline void PACKET_null_init(PACKET *pkt)
83
859
{
84
859
    pkt->curr = NULL;
85
859
    pkt->remaining = 0;
86
859
}
Unexecuted instantiation: methods.c:PACKET_null_init
Unexecuted instantiation: rec_layer_d1.c:PACKET_null_init
Unexecuted instantiation: rec_layer_s3.c:PACKET_null_init
Unexecuted instantiation: ssl3_buffer.c:PACKET_null_init
Unexecuted instantiation: ssl3_record.c:PACKET_null_init
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_null_init
Unexecuted instantiation: s3_cbc.c:PACKET_null_init
Unexecuted instantiation: s3_lib.c:PACKET_null_init
Unexecuted instantiation: s3_msg.c:PACKET_null_init
Unexecuted instantiation: ssl_cert.c:PACKET_null_init
Unexecuted instantiation: ssl_ciph.c:PACKET_null_init
Unexecuted instantiation: ssl_init.c:PACKET_null_init
Unexecuted instantiation: ssl_lib.c:PACKET_null_init
Unexecuted instantiation: ssl_mcnf.c:PACKET_null_init
Unexecuted instantiation: ssl_sess.c:PACKET_null_init
Unexecuted instantiation: extensions.c:PACKET_null_init
Unexecuted instantiation: extensions_clnt.c:PACKET_null_init
Unexecuted instantiation: extensions_cust.c:PACKET_null_init
Unexecuted instantiation: extensions_srvr.c:PACKET_null_init
Unexecuted instantiation: statem.c:PACKET_null_init
statem_clnt.c:PACKET_null_init
Line
Count
Source
83
859
{
84
859
    pkt->curr = NULL;
85
859
    pkt->remaining = 0;
86
859
}
Unexecuted instantiation: statem_dtls.c:PACKET_null_init
Unexecuted instantiation: statem_lib.c:PACKET_null_init
Unexecuted instantiation: statem_srvr.c:PACKET_null_init
Unexecuted instantiation: t1_lib.c:PACKET_null_init
Unexecuted instantiation: tls13_enc.c:PACKET_null_init
Unexecuted instantiation: tls_srp.c:PACKET_null_init
Unexecuted instantiation: d1_lib.c:PACKET_null_init
Unexecuted instantiation: d1_msg.c:PACKET_null_init
Unexecuted instantiation: d1_srtp.c:PACKET_null_init
Unexecuted instantiation: packet.c:PACKET_null_init
Unexecuted instantiation: pqueue.c:PACKET_null_init
Unexecuted instantiation: dtls1_bitmap.c:PACKET_null_init
Unexecuted instantiation: s3_enc.c:PACKET_null_init
Unexecuted instantiation: ssl_asn1.c:PACKET_null_init
Unexecuted instantiation: ssl_conf.c:PACKET_null_init
Unexecuted instantiation: ssl_rsa.c:PACKET_null_init
Unexecuted instantiation: t1_enc.c:PACKET_null_init
87
88
/*
89
 * Returns 1 if the packet has length |num| and its contents equal the |num|
90
 * bytes read from |ptr|. Returns 0 otherwise (lengths or contents not equal).
91
 * If lengths are equal, performs the comparison in constant time.
92
 */
93
__owur static ossl_inline int PACKET_equal(const PACKET *pkt, const void *ptr,
94
                                           size_t num)
95
0
{
96
0
    if (PACKET_remaining(pkt) != num)
97
0
        return 0;
98
0
    return CRYPTO_memcmp(pkt->curr, ptr, num) == 0;
99
0
}
Unexecuted instantiation: methods.c:PACKET_equal
Unexecuted instantiation: rec_layer_d1.c:PACKET_equal
Unexecuted instantiation: rec_layer_s3.c:PACKET_equal
Unexecuted instantiation: ssl3_buffer.c:PACKET_equal
Unexecuted instantiation: ssl3_record.c:PACKET_equal
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_equal
Unexecuted instantiation: s3_cbc.c:PACKET_equal
Unexecuted instantiation: s3_lib.c:PACKET_equal
Unexecuted instantiation: s3_msg.c:PACKET_equal
Unexecuted instantiation: ssl_cert.c:PACKET_equal
Unexecuted instantiation: ssl_ciph.c:PACKET_equal
Unexecuted instantiation: ssl_init.c:PACKET_equal
Unexecuted instantiation: ssl_lib.c:PACKET_equal
Unexecuted instantiation: ssl_mcnf.c:PACKET_equal
Unexecuted instantiation: ssl_sess.c:PACKET_equal
Unexecuted instantiation: extensions.c:PACKET_equal
Unexecuted instantiation: extensions_clnt.c:PACKET_equal
Unexecuted instantiation: extensions_cust.c:PACKET_equal
Unexecuted instantiation: extensions_srvr.c:PACKET_equal
Unexecuted instantiation: statem.c:PACKET_equal
Unexecuted instantiation: statem_clnt.c:PACKET_equal
Unexecuted instantiation: statem_dtls.c:PACKET_equal
Unexecuted instantiation: statem_lib.c:PACKET_equal
Unexecuted instantiation: statem_srvr.c:PACKET_equal
Unexecuted instantiation: t1_lib.c:PACKET_equal
Unexecuted instantiation: tls13_enc.c:PACKET_equal
Unexecuted instantiation: tls_srp.c:PACKET_equal
Unexecuted instantiation: d1_lib.c:PACKET_equal
Unexecuted instantiation: d1_msg.c:PACKET_equal
Unexecuted instantiation: d1_srtp.c:PACKET_equal
Unexecuted instantiation: packet.c:PACKET_equal
Unexecuted instantiation: pqueue.c:PACKET_equal
Unexecuted instantiation: dtls1_bitmap.c:PACKET_equal
Unexecuted instantiation: s3_enc.c:PACKET_equal
Unexecuted instantiation: ssl_asn1.c:PACKET_equal
Unexecuted instantiation: ssl_conf.c:PACKET_equal
Unexecuted instantiation: ssl_rsa.c:PACKET_equal
Unexecuted instantiation: t1_enc.c:PACKET_equal
100
101
/*
102
 * Peek ahead and initialize |subpkt| with the next |len| bytes read from |pkt|.
103
 * Data is not copied: the |subpkt| packet will share its underlying buffer with
104
 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
105
 */
106
__owur static ossl_inline int PACKET_peek_sub_packet(const PACKET *pkt,
107
                                                     PACKET *subpkt, size_t len)
108
753
{
109
753
    if (PACKET_remaining(pkt) < len)
110
0
        return 0;
111
112
753
    return PACKET_buf_init(subpkt, pkt->curr, len);
113
753
}
Unexecuted instantiation: methods.c:PACKET_peek_sub_packet
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_sub_packet
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl3_record.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_sub_packet
Unexecuted instantiation: s3_cbc.c:PACKET_peek_sub_packet
Unexecuted instantiation: s3_lib.c:PACKET_peek_sub_packet
Unexecuted instantiation: s3_msg.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_cert.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_init.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_lib.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_sess.c:PACKET_peek_sub_packet
Unexecuted instantiation: extensions.c:PACKET_peek_sub_packet
Unexecuted instantiation: extensions_clnt.c:PACKET_peek_sub_packet
Unexecuted instantiation: extensions_cust.c:PACKET_peek_sub_packet
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_sub_packet
Unexecuted instantiation: statem.c:PACKET_peek_sub_packet
statem_clnt.c:PACKET_peek_sub_packet
Line
Count
Source
108
753
{
109
753
    if (PACKET_remaining(pkt) < len)
110
0
        return 0;
111
112
753
    return PACKET_buf_init(subpkt, pkt->curr, len);
113
753
}
Unexecuted instantiation: statem_dtls.c:PACKET_peek_sub_packet
Unexecuted instantiation: statem_lib.c:PACKET_peek_sub_packet
Unexecuted instantiation: statem_srvr.c:PACKET_peek_sub_packet
Unexecuted instantiation: t1_lib.c:PACKET_peek_sub_packet
Unexecuted instantiation: tls13_enc.c:PACKET_peek_sub_packet
Unexecuted instantiation: tls_srp.c:PACKET_peek_sub_packet
Unexecuted instantiation: d1_lib.c:PACKET_peek_sub_packet
Unexecuted instantiation: d1_msg.c:PACKET_peek_sub_packet
Unexecuted instantiation: d1_srtp.c:PACKET_peek_sub_packet
Unexecuted instantiation: packet.c:PACKET_peek_sub_packet
Unexecuted instantiation: pqueue.c:PACKET_peek_sub_packet
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_sub_packet
Unexecuted instantiation: s3_enc.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_conf.c:PACKET_peek_sub_packet
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_sub_packet
Unexecuted instantiation: t1_enc.c:PACKET_peek_sub_packet
114
115
/*
116
 * Initialize |subpkt| with the next |len| bytes read from |pkt|. Data is not
117
 * copied: the |subpkt| packet will share its underlying buffer with the
118
 * original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
119
 */
120
__owur static ossl_inline int PACKET_get_sub_packet(PACKET *pkt,
121
                                                    PACKET *subpkt, size_t len)
122
753
{
123
753
    if (!PACKET_peek_sub_packet(pkt, subpkt, len))
124
0
        return 0;
125
126
753
    packet_forward(pkt, len);
127
128
753
    return 1;
129
753
}
Unexecuted instantiation: methods.c:PACKET_get_sub_packet
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_sub_packet
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl3_record.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_sub_packet
Unexecuted instantiation: s3_cbc.c:PACKET_get_sub_packet
Unexecuted instantiation: s3_lib.c:PACKET_get_sub_packet
Unexecuted instantiation: s3_msg.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_cert.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_ciph.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_init.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_lib.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_sess.c:PACKET_get_sub_packet
Unexecuted instantiation: extensions.c:PACKET_get_sub_packet
Unexecuted instantiation: extensions_clnt.c:PACKET_get_sub_packet
Unexecuted instantiation: extensions_cust.c:PACKET_get_sub_packet
Unexecuted instantiation: extensions_srvr.c:PACKET_get_sub_packet
Unexecuted instantiation: statem.c:PACKET_get_sub_packet
statem_clnt.c:PACKET_get_sub_packet
Line
Count
Source
122
753
{
123
753
    if (!PACKET_peek_sub_packet(pkt, subpkt, len))
124
0
        return 0;
125
126
753
    packet_forward(pkt, len);
127
128
753
    return 1;
129
753
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_sub_packet
Unexecuted instantiation: statem_lib.c:PACKET_get_sub_packet
Unexecuted instantiation: statem_srvr.c:PACKET_get_sub_packet
Unexecuted instantiation: t1_lib.c:PACKET_get_sub_packet
Unexecuted instantiation: tls13_enc.c:PACKET_get_sub_packet
Unexecuted instantiation: tls_srp.c:PACKET_get_sub_packet
Unexecuted instantiation: d1_lib.c:PACKET_get_sub_packet
Unexecuted instantiation: d1_msg.c:PACKET_get_sub_packet
Unexecuted instantiation: d1_srtp.c:PACKET_get_sub_packet
Unexecuted instantiation: packet.c:PACKET_get_sub_packet
Unexecuted instantiation: pqueue.c:PACKET_get_sub_packet
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_sub_packet
Unexecuted instantiation: s3_enc.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_asn1.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_conf.c:PACKET_get_sub_packet
Unexecuted instantiation: ssl_rsa.c:PACKET_get_sub_packet
Unexecuted instantiation: t1_enc.c:PACKET_get_sub_packet
130
131
/*
132
 * Peek ahead at 2 bytes in network order from |pkt| and store the value in
133
 * |*data|
134
 */
135
__owur static ossl_inline int PACKET_peek_net_2(const PACKET *pkt,
136
                                                unsigned int *data)
137
123k
{
138
123k
    if (PACKET_remaining(pkt) < 2)
139
79
        return 0;
140
141
123k
    *data = ((unsigned int)(*pkt->curr)) << 8;
142
123k
    *data |= *(pkt->curr + 1);
143
144
123k
    return 1;
145
123k
}
Unexecuted instantiation: methods.c:PACKET_peek_net_2
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_net_2
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_net_2
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_net_2
ssl3_record.c:PACKET_peek_net_2
Line
Count
Source
137
51.5k
{
138
51.5k
    if (PACKET_remaining(pkt) < 2)
139
0
        return 0;
140
141
51.5k
    *data = ((unsigned int)(*pkt->curr)) << 8;
142
51.5k
    *data |= *(pkt->curr + 1);
143
144
51.5k
    return 1;
145
51.5k
}
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_net_2
Unexecuted instantiation: s3_cbc.c:PACKET_peek_net_2
Unexecuted instantiation: s3_lib.c:PACKET_peek_net_2
Unexecuted instantiation: s3_msg.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_cert.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_init.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_lib.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_sess.c:PACKET_peek_net_2
extensions.c:PACKET_peek_net_2
Line
Count
Source
137
38.1k
{
138
38.1k
    if (PACKET_remaining(pkt) < 2)
139
6
        return 0;
140
141
38.1k
    *data = ((unsigned int)(*pkt->curr)) << 8;
142
38.1k
    *data |= *(pkt->curr + 1);
143
144
38.1k
    return 1;
145
38.1k
}
extensions_clnt.c:PACKET_peek_net_2
Line
Count
Source
137
622
{
138
622
    if (PACKET_remaining(pkt) < 2)
139
23
        return 0;
140
141
599
    *data = ((unsigned int)(*pkt->curr)) << 8;
142
599
    *data |= *(pkt->curr + 1);
143
144
599
    return 1;
145
622
}
Unexecuted instantiation: extensions_cust.c:PACKET_peek_net_2
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_net_2
Unexecuted instantiation: statem.c:PACKET_peek_net_2
statem_clnt.c:PACKET_peek_net_2
Line
Count
Source
137
21.3k
{
138
21.3k
    if (PACKET_remaining(pkt) < 2)
139
26
        return 0;
140
141
21.3k
    *data = ((unsigned int)(*pkt->curr)) << 8;
142
21.3k
    *data |= *(pkt->curr + 1);
143
144
21.3k
    return 1;
145
21.3k
}
Unexecuted instantiation: statem_dtls.c:PACKET_peek_net_2
statem_lib.c:PACKET_peek_net_2
Line
Count
Source
137
872
{
138
872
    if (PACKET_remaining(pkt) < 2)
139
24
        return 0;
140
141
848
    *data = ((unsigned int)(*pkt->curr)) << 8;
142
848
    *data |= *(pkt->curr + 1);
143
144
848
    return 1;
145
872
}
Unexecuted instantiation: statem_srvr.c:PACKET_peek_net_2
t1_lib.c:PACKET_peek_net_2
Line
Count
Source
137
10.7k
{
138
10.7k
    if (PACKET_remaining(pkt) < 2)
139
0
        return 0;
140
141
10.7k
    *data = ((unsigned int)(*pkt->curr)) << 8;
142
10.7k
    *data |= *(pkt->curr + 1);
143
144
10.7k
    return 1;
145
10.7k
}
Unexecuted instantiation: tls13_enc.c:PACKET_peek_net_2
Unexecuted instantiation: tls_srp.c:PACKET_peek_net_2
Unexecuted instantiation: d1_lib.c:PACKET_peek_net_2
Unexecuted instantiation: d1_msg.c:PACKET_peek_net_2
Unexecuted instantiation: d1_srtp.c:PACKET_peek_net_2
Unexecuted instantiation: packet.c:PACKET_peek_net_2
Unexecuted instantiation: pqueue.c:PACKET_peek_net_2
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_net_2
Unexecuted instantiation: s3_enc.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_conf.c:PACKET_peek_net_2
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_net_2
Unexecuted instantiation: t1_enc.c:PACKET_peek_net_2
146
147
/* Equivalent of n2s */
148
/* Get 2 bytes in network order from |pkt| and store the value in |*data| */
149
__owur static ossl_inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)
150
123k
{
151
123k
    if (!PACKET_peek_net_2(pkt, data))
152
79
        return 0;
153
154
123k
    packet_forward(pkt, 2);
155
156
123k
    return 1;
157
123k
}
Unexecuted instantiation: methods.c:PACKET_get_net_2
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_net_2
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_net_2
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_net_2
ssl3_record.c:PACKET_get_net_2
Line
Count
Source
150
51.5k
{
151
51.5k
    if (!PACKET_peek_net_2(pkt, data))
152
0
        return 0;
153
154
51.5k
    packet_forward(pkt, 2);
155
156
51.5k
    return 1;
157
51.5k
}
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_net_2
Unexecuted instantiation: s3_cbc.c:PACKET_get_net_2
Unexecuted instantiation: s3_lib.c:PACKET_get_net_2
Unexecuted instantiation: s3_msg.c:PACKET_get_net_2
Unexecuted instantiation: ssl_cert.c:PACKET_get_net_2
Unexecuted instantiation: ssl_ciph.c:PACKET_get_net_2
Unexecuted instantiation: ssl_init.c:PACKET_get_net_2
Unexecuted instantiation: ssl_lib.c:PACKET_get_net_2
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_net_2
Unexecuted instantiation: ssl_sess.c:PACKET_get_net_2
extensions.c:PACKET_get_net_2
Line
Count
Source
150
38.1k
{
151
38.1k
    if (!PACKET_peek_net_2(pkt, data))
152
6
        return 0;
153
154
38.1k
    packet_forward(pkt, 2);
155
156
38.1k
    return 1;
157
38.1k
}
extensions_clnt.c:PACKET_get_net_2
Line
Count
Source
150
622
{
151
622
    if (!PACKET_peek_net_2(pkt, data))
152
23
        return 0;
153
154
599
    packet_forward(pkt, 2);
155
156
599
    return 1;
157
622
}
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_2
Unexecuted instantiation: extensions_srvr.c:PACKET_get_net_2
Unexecuted instantiation: statem.c:PACKET_get_net_2
statem_clnt.c:PACKET_get_net_2
Line
Count
Source
150
21.3k
{
151
21.3k
    if (!PACKET_peek_net_2(pkt, data))
152
26
        return 0;
153
154
21.3k
    packet_forward(pkt, 2);
155
156
21.3k
    return 1;
157
21.3k
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_2
statem_lib.c:PACKET_get_net_2
Line
Count
Source
150
872
{
151
872
    if (!PACKET_peek_net_2(pkt, data))
152
24
        return 0;
153
154
848
    packet_forward(pkt, 2);
155
156
848
    return 1;
157
872
}
Unexecuted instantiation: statem_srvr.c:PACKET_get_net_2
t1_lib.c:PACKET_get_net_2
Line
Count
Source
150
10.7k
{
151
10.7k
    if (!PACKET_peek_net_2(pkt, data))
152
0
        return 0;
153
154
10.7k
    packet_forward(pkt, 2);
155
156
10.7k
    return 1;
157
10.7k
}
Unexecuted instantiation: tls13_enc.c:PACKET_get_net_2
Unexecuted instantiation: tls_srp.c:PACKET_get_net_2
Unexecuted instantiation: d1_lib.c:PACKET_get_net_2
Unexecuted instantiation: d1_msg.c:PACKET_get_net_2
Unexecuted instantiation: d1_srtp.c:PACKET_get_net_2
Unexecuted instantiation: packet.c:PACKET_get_net_2
Unexecuted instantiation: pqueue.c:PACKET_get_net_2
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_net_2
Unexecuted instantiation: s3_enc.c:PACKET_get_net_2
Unexecuted instantiation: ssl_asn1.c:PACKET_get_net_2
Unexecuted instantiation: ssl_conf.c:PACKET_get_net_2
Unexecuted instantiation: ssl_rsa.c:PACKET_get_net_2
Unexecuted instantiation: t1_enc.c:PACKET_get_net_2
158
159
/* Same as PACKET_get_net_2() but for a size_t */
160
__owur static ossl_inline int PACKET_get_net_2_len(PACKET *pkt, size_t *data)
161
34.3k
{
162
34.3k
    unsigned int i;
163
34.3k
    int ret = PACKET_get_net_2(pkt, &i);
164
165
34.3k
    if (ret)
166
34.3k
        *data = (size_t)i;
167
168
34.3k
    return ret;
169
34.3k
}
Unexecuted instantiation: methods.c:PACKET_get_net_2_len
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_net_2_len
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_net_2_len
ssl3_record.c:PACKET_get_net_2_len
Line
Count
Source
161
34.3k
{
162
34.3k
    unsigned int i;
163
34.3k
    int ret = PACKET_get_net_2(pkt, &i);
164
165
34.3k
    if (ret)
166
34.3k
        *data = (size_t)i;
167
168
34.3k
    return ret;
169
34.3k
}
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_net_2_len
Unexecuted instantiation: s3_cbc.c:PACKET_get_net_2_len
Unexecuted instantiation: s3_lib.c:PACKET_get_net_2_len
Unexecuted instantiation: s3_msg.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_cert.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_ciph.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_init.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_lib.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_sess.c:PACKET_get_net_2_len
Unexecuted instantiation: extensions.c:PACKET_get_net_2_len
Unexecuted instantiation: extensions_clnt.c:PACKET_get_net_2_len
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_2_len
Unexecuted instantiation: extensions_srvr.c:PACKET_get_net_2_len
Unexecuted instantiation: statem.c:PACKET_get_net_2_len
Unexecuted instantiation: statem_clnt.c:PACKET_get_net_2_len
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_2_len
Unexecuted instantiation: statem_lib.c:PACKET_get_net_2_len
Unexecuted instantiation: statem_srvr.c:PACKET_get_net_2_len
Unexecuted instantiation: t1_lib.c:PACKET_get_net_2_len
Unexecuted instantiation: tls13_enc.c:PACKET_get_net_2_len
Unexecuted instantiation: tls_srp.c:PACKET_get_net_2_len
Unexecuted instantiation: d1_lib.c:PACKET_get_net_2_len
Unexecuted instantiation: d1_msg.c:PACKET_get_net_2_len
Unexecuted instantiation: d1_srtp.c:PACKET_get_net_2_len
Unexecuted instantiation: packet.c:PACKET_get_net_2_len
Unexecuted instantiation: pqueue.c:PACKET_get_net_2_len
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_net_2_len
Unexecuted instantiation: s3_enc.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_asn1.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_conf.c:PACKET_get_net_2_len
Unexecuted instantiation: ssl_rsa.c:PACKET_get_net_2_len
Unexecuted instantiation: t1_enc.c:PACKET_get_net_2_len
170
171
/*
172
 * Peek ahead at 3 bytes in network order from |pkt| and store the value in
173
 * |*data|
174
 */
175
__owur static ossl_inline int PACKET_peek_net_3(const PACKET *pkt,
176
                                                unsigned long *data)
177
8.79k
{
178
8.79k
    if (PACKET_remaining(pkt) < 3)
179
3
        return 0;
180
181
8.79k
    *data = ((unsigned long)(*pkt->curr)) << 16;
182
8.79k
    *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;
183
8.79k
    *data |= *(pkt->curr + 2);
184
185
8.79k
    return 1;
186
8.79k
}
Unexecuted instantiation: methods.c:PACKET_peek_net_3
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_net_3
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_net_3
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_net_3
Unexecuted instantiation: ssl3_record.c:PACKET_peek_net_3
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_net_3
Unexecuted instantiation: s3_cbc.c:PACKET_peek_net_3
Unexecuted instantiation: s3_lib.c:PACKET_peek_net_3
Unexecuted instantiation: s3_msg.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_cert.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_init.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_lib.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_sess.c:PACKET_peek_net_3
Unexecuted instantiation: extensions.c:PACKET_peek_net_3
Unexecuted instantiation: extensions_clnt.c:PACKET_peek_net_3
Unexecuted instantiation: extensions_cust.c:PACKET_peek_net_3
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_net_3
Unexecuted instantiation: statem.c:PACKET_peek_net_3
statem_clnt.c:PACKET_peek_net_3
Line
Count
Source
177
8.79k
{
178
8.79k
    if (PACKET_remaining(pkt) < 3)
179
3
        return 0;
180
181
8.79k
    *data = ((unsigned long)(*pkt->curr)) << 16;
182
8.79k
    *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;
183
8.79k
    *data |= *(pkt->curr + 2);
184
185
8.79k
    return 1;
186
8.79k
}
Unexecuted instantiation: statem_dtls.c:PACKET_peek_net_3
Unexecuted instantiation: statem_lib.c:PACKET_peek_net_3
Unexecuted instantiation: statem_srvr.c:PACKET_peek_net_3
Unexecuted instantiation: t1_lib.c:PACKET_peek_net_3
Unexecuted instantiation: tls13_enc.c:PACKET_peek_net_3
Unexecuted instantiation: tls_srp.c:PACKET_peek_net_3
Unexecuted instantiation: d1_lib.c:PACKET_peek_net_3
Unexecuted instantiation: d1_msg.c:PACKET_peek_net_3
Unexecuted instantiation: d1_srtp.c:PACKET_peek_net_3
Unexecuted instantiation: packet.c:PACKET_peek_net_3
Unexecuted instantiation: pqueue.c:PACKET_peek_net_3
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_net_3
Unexecuted instantiation: s3_enc.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_conf.c:PACKET_peek_net_3
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_net_3
Unexecuted instantiation: t1_enc.c:PACKET_peek_net_3
187
188
/* Equivalent of n2l3 */
189
/* Get 3 bytes in network order from |pkt| and store the value in |*data| */
190
__owur static ossl_inline int PACKET_get_net_3(PACKET *pkt, unsigned long *data)
191
8.79k
{
192
8.79k
    if (!PACKET_peek_net_3(pkt, data))
193
3
        return 0;
194
195
8.79k
    packet_forward(pkt, 3);
196
197
8.79k
    return 1;
198
8.79k
}
Unexecuted instantiation: methods.c:PACKET_get_net_3
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_net_3
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_net_3
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_net_3
Unexecuted instantiation: ssl3_record.c:PACKET_get_net_3
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_net_3
Unexecuted instantiation: s3_cbc.c:PACKET_get_net_3
Unexecuted instantiation: s3_lib.c:PACKET_get_net_3
Unexecuted instantiation: s3_msg.c:PACKET_get_net_3
Unexecuted instantiation: ssl_cert.c:PACKET_get_net_3
Unexecuted instantiation: ssl_ciph.c:PACKET_get_net_3
Unexecuted instantiation: ssl_init.c:PACKET_get_net_3
Unexecuted instantiation: ssl_lib.c:PACKET_get_net_3
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_net_3
Unexecuted instantiation: ssl_sess.c:PACKET_get_net_3
Unexecuted instantiation: extensions.c:PACKET_get_net_3
Unexecuted instantiation: extensions_clnt.c:PACKET_get_net_3
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_3
Unexecuted instantiation: extensions_srvr.c:PACKET_get_net_3
Unexecuted instantiation: statem.c:PACKET_get_net_3
statem_clnt.c:PACKET_get_net_3
Line
Count
Source
191
8.79k
{
192
8.79k
    if (!PACKET_peek_net_3(pkt, data))
193
3
        return 0;
194
195
8.79k
    packet_forward(pkt, 3);
196
197
8.79k
    return 1;
198
8.79k
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_3
Unexecuted instantiation: statem_lib.c:PACKET_get_net_3
Unexecuted instantiation: statem_srvr.c:PACKET_get_net_3
Unexecuted instantiation: t1_lib.c:PACKET_get_net_3
Unexecuted instantiation: tls13_enc.c:PACKET_get_net_3
Unexecuted instantiation: tls_srp.c:PACKET_get_net_3
Unexecuted instantiation: d1_lib.c:PACKET_get_net_3
Unexecuted instantiation: d1_msg.c:PACKET_get_net_3
Unexecuted instantiation: d1_srtp.c:PACKET_get_net_3
Unexecuted instantiation: packet.c:PACKET_get_net_3
Unexecuted instantiation: pqueue.c:PACKET_get_net_3
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_net_3
Unexecuted instantiation: s3_enc.c:PACKET_get_net_3
Unexecuted instantiation: ssl_asn1.c:PACKET_get_net_3
Unexecuted instantiation: ssl_conf.c:PACKET_get_net_3
Unexecuted instantiation: ssl_rsa.c:PACKET_get_net_3
Unexecuted instantiation: t1_enc.c:PACKET_get_net_3
199
200
/* Same as PACKET_get_net_3() but for a size_t */
201
__owur static ossl_inline int PACKET_get_net_3_len(PACKET *pkt, size_t *data)
202
0
{
203
0
    unsigned long i;
204
0
    int ret = PACKET_get_net_3(pkt, &i);
205
206
0
    if (ret)
207
0
        *data = (size_t)i;
208
209
0
    return ret;
210
0
}
Unexecuted instantiation: methods.c:PACKET_get_net_3_len
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_net_3_len
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl3_record.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_net_3_len
Unexecuted instantiation: s3_cbc.c:PACKET_get_net_3_len
Unexecuted instantiation: s3_lib.c:PACKET_get_net_3_len
Unexecuted instantiation: s3_msg.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_cert.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_ciph.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_init.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_lib.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_sess.c:PACKET_get_net_3_len
Unexecuted instantiation: extensions.c:PACKET_get_net_3_len
Unexecuted instantiation: extensions_clnt.c:PACKET_get_net_3_len
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_3_len
Unexecuted instantiation: extensions_srvr.c:PACKET_get_net_3_len
Unexecuted instantiation: statem.c:PACKET_get_net_3_len
Unexecuted instantiation: statem_clnt.c:PACKET_get_net_3_len
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_3_len
Unexecuted instantiation: statem_lib.c:PACKET_get_net_3_len
Unexecuted instantiation: statem_srvr.c:PACKET_get_net_3_len
Unexecuted instantiation: t1_lib.c:PACKET_get_net_3_len
Unexecuted instantiation: tls13_enc.c:PACKET_get_net_3_len
Unexecuted instantiation: tls_srp.c:PACKET_get_net_3_len
Unexecuted instantiation: d1_lib.c:PACKET_get_net_3_len
Unexecuted instantiation: d1_msg.c:PACKET_get_net_3_len
Unexecuted instantiation: d1_srtp.c:PACKET_get_net_3_len
Unexecuted instantiation: packet.c:PACKET_get_net_3_len
Unexecuted instantiation: pqueue.c:PACKET_get_net_3_len
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_net_3_len
Unexecuted instantiation: s3_enc.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_asn1.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_conf.c:PACKET_get_net_3_len
Unexecuted instantiation: ssl_rsa.c:PACKET_get_net_3_len
Unexecuted instantiation: t1_enc.c:PACKET_get_net_3_len
211
212
/*
213
 * Peek ahead at 4 bytes in network order from |pkt| and store the value in
214
 * |*data|
215
 */
216
__owur static ossl_inline int PACKET_peek_net_4(const PACKET *pkt,
217
                                                unsigned long *data)
218
88
{
219
88
    if (PACKET_remaining(pkt) < 4)
220
3
        return 0;
221
222
85
    *data = ((unsigned long)(*pkt->curr)) << 24;
223
85
    *data |= ((unsigned long)(*(pkt->curr + 1))) << 16;
224
85
    *data |= ((unsigned long)(*(pkt->curr + 2))) << 8;
225
85
    *data |= *(pkt->curr + 3);
226
227
85
    return 1;
228
88
}
Unexecuted instantiation: methods.c:PACKET_peek_net_4
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_net_4
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_net_4
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_net_4
Unexecuted instantiation: ssl3_record.c:PACKET_peek_net_4
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_net_4
Unexecuted instantiation: s3_cbc.c:PACKET_peek_net_4
Unexecuted instantiation: s3_lib.c:PACKET_peek_net_4
Unexecuted instantiation: s3_msg.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_cert.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_init.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_lib.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_sess.c:PACKET_peek_net_4
Unexecuted instantiation: extensions.c:PACKET_peek_net_4
Unexecuted instantiation: extensions_clnt.c:PACKET_peek_net_4
Unexecuted instantiation: extensions_cust.c:PACKET_peek_net_4
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_net_4
Unexecuted instantiation: statem.c:PACKET_peek_net_4
statem_clnt.c:PACKET_peek_net_4
Line
Count
Source
218
88
{
219
88
    if (PACKET_remaining(pkt) < 4)
220
3
        return 0;
221
222
85
    *data = ((unsigned long)(*pkt->curr)) << 24;
223
85
    *data |= ((unsigned long)(*(pkt->curr + 1))) << 16;
224
85
    *data |= ((unsigned long)(*(pkt->curr + 2))) << 8;
225
85
    *data |= *(pkt->curr + 3);
226
227
85
    return 1;
228
88
}
Unexecuted instantiation: statem_dtls.c:PACKET_peek_net_4
Unexecuted instantiation: statem_lib.c:PACKET_peek_net_4
Unexecuted instantiation: statem_srvr.c:PACKET_peek_net_4
Unexecuted instantiation: t1_lib.c:PACKET_peek_net_4
Unexecuted instantiation: tls13_enc.c:PACKET_peek_net_4
Unexecuted instantiation: tls_srp.c:PACKET_peek_net_4
Unexecuted instantiation: d1_lib.c:PACKET_peek_net_4
Unexecuted instantiation: d1_msg.c:PACKET_peek_net_4
Unexecuted instantiation: d1_srtp.c:PACKET_peek_net_4
Unexecuted instantiation: packet.c:PACKET_peek_net_4
Unexecuted instantiation: pqueue.c:PACKET_peek_net_4
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_net_4
Unexecuted instantiation: s3_enc.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_conf.c:PACKET_peek_net_4
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_net_4
Unexecuted instantiation: t1_enc.c:PACKET_peek_net_4
229
230
/*
231
 * Peek ahead at 8 bytes in network order from |pkt| and store the value in
232
 * |*data|
233
 */
234
__owur static ossl_inline int PACKET_peek_net_8(const PACKET *pkt,
235
                                                uint64_t *data)
236
0
{
237
0
    if (PACKET_remaining(pkt) < 8)
238
0
        return 0;
239
240
0
    *data = ((uint64_t)(*pkt->curr)) << 56;
241
0
    *data |= ((uint64_t)(*(pkt->curr + 1))) << 48;
242
0
    *data |= ((uint64_t)(*(pkt->curr + 2))) << 40;
243
0
    *data |= ((uint64_t)(*(pkt->curr + 3))) << 32;
244
0
    *data |= ((uint64_t)(*(pkt->curr + 4))) << 24;
245
0
    *data |= ((uint64_t)(*(pkt->curr + 5))) << 16;
246
0
    *data |= ((uint64_t)(*(pkt->curr + 6))) << 8;
247
0
    *data |= *(pkt->curr + 7);
248
249
0
    return 1;
250
0
}
Unexecuted instantiation: methods.c:PACKET_peek_net_8
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_net_8
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_net_8
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_net_8
Unexecuted instantiation: ssl3_record.c:PACKET_peek_net_8
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_net_8
Unexecuted instantiation: s3_cbc.c:PACKET_peek_net_8
Unexecuted instantiation: s3_lib.c:PACKET_peek_net_8
Unexecuted instantiation: s3_msg.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_cert.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_init.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_lib.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_sess.c:PACKET_peek_net_8
Unexecuted instantiation: extensions.c:PACKET_peek_net_8
Unexecuted instantiation: extensions_clnt.c:PACKET_peek_net_8
Unexecuted instantiation: extensions_cust.c:PACKET_peek_net_8
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_net_8
Unexecuted instantiation: statem.c:PACKET_peek_net_8
Unexecuted instantiation: statem_clnt.c:PACKET_peek_net_8
Unexecuted instantiation: statem_dtls.c:PACKET_peek_net_8
Unexecuted instantiation: statem_lib.c:PACKET_peek_net_8
Unexecuted instantiation: statem_srvr.c:PACKET_peek_net_8
Unexecuted instantiation: t1_lib.c:PACKET_peek_net_8
Unexecuted instantiation: tls13_enc.c:PACKET_peek_net_8
Unexecuted instantiation: tls_srp.c:PACKET_peek_net_8
Unexecuted instantiation: d1_lib.c:PACKET_peek_net_8
Unexecuted instantiation: d1_msg.c:PACKET_peek_net_8
Unexecuted instantiation: d1_srtp.c:PACKET_peek_net_8
Unexecuted instantiation: packet.c:PACKET_peek_net_8
Unexecuted instantiation: pqueue.c:PACKET_peek_net_8
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_net_8
Unexecuted instantiation: s3_enc.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_conf.c:PACKET_peek_net_8
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_net_8
Unexecuted instantiation: t1_enc.c:PACKET_peek_net_8
251
252
/* Equivalent of n2l */
253
/* Get 4 bytes in network order from |pkt| and store the value in |*data| */
254
__owur static ossl_inline int PACKET_get_net_4(PACKET *pkt, unsigned long *data)
255
88
{
256
88
    if (!PACKET_peek_net_4(pkt, data))
257
3
        return 0;
258
259
85
    packet_forward(pkt, 4);
260
261
85
    return 1;
262
88
}
Unexecuted instantiation: methods.c:PACKET_get_net_4
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_net_4
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_net_4
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_net_4
Unexecuted instantiation: ssl3_record.c:PACKET_get_net_4
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_net_4
Unexecuted instantiation: s3_cbc.c:PACKET_get_net_4
Unexecuted instantiation: s3_lib.c:PACKET_get_net_4
Unexecuted instantiation: s3_msg.c:PACKET_get_net_4
Unexecuted instantiation: ssl_cert.c:PACKET_get_net_4
Unexecuted instantiation: ssl_ciph.c:PACKET_get_net_4
Unexecuted instantiation: ssl_init.c:PACKET_get_net_4
Unexecuted instantiation: ssl_lib.c:PACKET_get_net_4
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_net_4
Unexecuted instantiation: ssl_sess.c:PACKET_get_net_4
Unexecuted instantiation: extensions.c:PACKET_get_net_4
Unexecuted instantiation: extensions_clnt.c:PACKET_get_net_4
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_4
Unexecuted instantiation: extensions_srvr.c:PACKET_get_net_4
Unexecuted instantiation: statem.c:PACKET_get_net_4
statem_clnt.c:PACKET_get_net_4
Line
Count
Source
255
88
{
256
88
    if (!PACKET_peek_net_4(pkt, data))
257
3
        return 0;
258
259
85
    packet_forward(pkt, 4);
260
261
85
    return 1;
262
88
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_4
Unexecuted instantiation: statem_lib.c:PACKET_get_net_4
Unexecuted instantiation: statem_srvr.c:PACKET_get_net_4
Unexecuted instantiation: t1_lib.c:PACKET_get_net_4
Unexecuted instantiation: tls13_enc.c:PACKET_get_net_4
Unexecuted instantiation: tls_srp.c:PACKET_get_net_4
Unexecuted instantiation: d1_lib.c:PACKET_get_net_4
Unexecuted instantiation: d1_msg.c:PACKET_get_net_4
Unexecuted instantiation: d1_srtp.c:PACKET_get_net_4
Unexecuted instantiation: packet.c:PACKET_get_net_4
Unexecuted instantiation: pqueue.c:PACKET_get_net_4
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_net_4
Unexecuted instantiation: s3_enc.c:PACKET_get_net_4
Unexecuted instantiation: ssl_asn1.c:PACKET_get_net_4
Unexecuted instantiation: ssl_conf.c:PACKET_get_net_4
Unexecuted instantiation: ssl_rsa.c:PACKET_get_net_4
Unexecuted instantiation: t1_enc.c:PACKET_get_net_4
263
264
/* Same as PACKET_get_net_4() but for a size_t */
265
__owur static ossl_inline int PACKET_get_net_4_len(PACKET *pkt, size_t *data)
266
0
{
267
0
    unsigned long i;
268
0
    int ret = PACKET_get_net_4(pkt, &i);
269
0
270
0
    if (ret)
271
0
        *data = (size_t)i;
272
0
273
0
    return ret;
274
0
}
Unexecuted instantiation: methods.c:PACKET_get_net_4_len
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_net_4_len
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl3_record.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_net_4_len
Unexecuted instantiation: s3_cbc.c:PACKET_get_net_4_len
Unexecuted instantiation: s3_lib.c:PACKET_get_net_4_len
Unexecuted instantiation: s3_msg.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_cert.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_ciph.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_init.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_lib.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_sess.c:PACKET_get_net_4_len
Unexecuted instantiation: extensions.c:PACKET_get_net_4_len
Unexecuted instantiation: extensions_clnt.c:PACKET_get_net_4_len
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_4_len
Unexecuted instantiation: extensions_srvr.c:PACKET_get_net_4_len
Unexecuted instantiation: statem.c:PACKET_get_net_4_len
Unexecuted instantiation: statem_clnt.c:PACKET_get_net_4_len
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_4_len
Unexecuted instantiation: statem_lib.c:PACKET_get_net_4_len
Unexecuted instantiation: statem_srvr.c:PACKET_get_net_4_len
Unexecuted instantiation: t1_lib.c:PACKET_get_net_4_len
Unexecuted instantiation: tls13_enc.c:PACKET_get_net_4_len
Unexecuted instantiation: tls_srp.c:PACKET_get_net_4_len
Unexecuted instantiation: d1_lib.c:PACKET_get_net_4_len
Unexecuted instantiation: d1_msg.c:PACKET_get_net_4_len
Unexecuted instantiation: d1_srtp.c:PACKET_get_net_4_len
Unexecuted instantiation: packet.c:PACKET_get_net_4_len
Unexecuted instantiation: pqueue.c:PACKET_get_net_4_len
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_net_4_len
Unexecuted instantiation: s3_enc.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_asn1.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_conf.c:PACKET_get_net_4_len
Unexecuted instantiation: ssl_rsa.c:PACKET_get_net_4_len
Unexecuted instantiation: t1_enc.c:PACKET_get_net_4_len
275
 
276
/* Get 8 bytes in network order from |pkt| and store the value in |*data| */
277
__owur static ossl_inline int PACKET_get_net_8(PACKET *pkt, uint64_t *data)
278
0
{
279
0
    if (!PACKET_peek_net_8(pkt, data))
280
0
        return 0;
281
282
0
    packet_forward(pkt, 8);
283
284
0
    return 1;
285
0
}
Unexecuted instantiation: methods.c:PACKET_get_net_8
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_net_8
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_net_8
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_net_8
Unexecuted instantiation: ssl3_record.c:PACKET_get_net_8
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_net_8
Unexecuted instantiation: s3_cbc.c:PACKET_get_net_8
Unexecuted instantiation: s3_lib.c:PACKET_get_net_8
Unexecuted instantiation: s3_msg.c:PACKET_get_net_8
Unexecuted instantiation: ssl_cert.c:PACKET_get_net_8
Unexecuted instantiation: ssl_ciph.c:PACKET_get_net_8
Unexecuted instantiation: ssl_init.c:PACKET_get_net_8
Unexecuted instantiation: ssl_lib.c:PACKET_get_net_8
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_net_8
Unexecuted instantiation: ssl_sess.c:PACKET_get_net_8
Unexecuted instantiation: extensions.c:PACKET_get_net_8
Unexecuted instantiation: extensions_clnt.c:PACKET_get_net_8
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_8
Unexecuted instantiation: extensions_srvr.c:PACKET_get_net_8
Unexecuted instantiation: statem.c:PACKET_get_net_8
Unexecuted instantiation: statem_clnt.c:PACKET_get_net_8
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_8
Unexecuted instantiation: statem_lib.c:PACKET_get_net_8
Unexecuted instantiation: statem_srvr.c:PACKET_get_net_8
Unexecuted instantiation: t1_lib.c:PACKET_get_net_8
Unexecuted instantiation: tls13_enc.c:PACKET_get_net_8
Unexecuted instantiation: tls_srp.c:PACKET_get_net_8
Unexecuted instantiation: d1_lib.c:PACKET_get_net_8
Unexecuted instantiation: d1_msg.c:PACKET_get_net_8
Unexecuted instantiation: d1_srtp.c:PACKET_get_net_8
Unexecuted instantiation: packet.c:PACKET_get_net_8
Unexecuted instantiation: pqueue.c:PACKET_get_net_8
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_net_8
Unexecuted instantiation: s3_enc.c:PACKET_get_net_8
Unexecuted instantiation: ssl_asn1.c:PACKET_get_net_8
Unexecuted instantiation: ssl_conf.c:PACKET_get_net_8
Unexecuted instantiation: ssl_rsa.c:PACKET_get_net_8
Unexecuted instantiation: t1_enc.c:PACKET_get_net_8
286
287
/* Peek ahead at 1 byte from |pkt| and store the value in |*data| */
288
__owur static ossl_inline int PACKET_peek_1(const PACKET *pkt,
289
                                            unsigned int *data)
290
57.1k
{
291
57.1k
    if (!PACKET_remaining(pkt))
292
150
        return 0;
293
294
57.0k
    *data = *pkt->curr;
295
296
57.0k
    return 1;
297
57.1k
}
Unexecuted instantiation: methods.c:PACKET_peek_1
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_1
rec_layer_s3.c:PACKET_peek_1
Line
Count
Source
290
1.23k
{
291
1.23k
    if (!PACKET_remaining(pkt))
292
20
        return 0;
293
294
1.21k
    *data = *pkt->curr;
295
296
1.21k
    return 1;
297
1.23k
}
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_1
ssl3_record.c:PACKET_peek_1
Line
Count
Source
290
34.3k
{
291
34.3k
    if (!PACKET_remaining(pkt))
292
0
        return 0;
293
294
34.3k
    *data = *pkt->curr;
295
296
34.3k
    return 1;
297
34.3k
}
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_1
Unexecuted instantiation: s3_cbc.c:PACKET_peek_1
Unexecuted instantiation: s3_lib.c:PACKET_peek_1
Unexecuted instantiation: s3_msg.c:PACKET_peek_1
Unexecuted instantiation: ssl_cert.c:PACKET_peek_1
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_1
Unexecuted instantiation: ssl_init.c:PACKET_peek_1
Unexecuted instantiation: ssl_lib.c:PACKET_peek_1
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_1
Unexecuted instantiation: ssl_sess.c:PACKET_peek_1
Unexecuted instantiation: extensions.c:PACKET_peek_1
extensions_clnt.c:PACKET_peek_1
Line
Count
Source
290
4.27k
{
291
4.27k
    if (!PACKET_remaining(pkt))
292
3
        return 0;
293
294
4.27k
    *data = *pkt->curr;
295
296
4.27k
    return 1;
297
4.27k
}
Unexecuted instantiation: extensions_cust.c:PACKET_peek_1
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_1
Unexecuted instantiation: statem.c:PACKET_peek_1
statem_clnt.c:PACKET_peek_1
Line
Count
Source
290
17.2k
{
291
17.2k
    if (!PACKET_remaining(pkt))
292
127
        return 0;
293
294
17.1k
    *data = *pkt->curr;
295
296
17.1k
    return 1;
297
17.2k
}
Unexecuted instantiation: statem_dtls.c:PACKET_peek_1
Unexecuted instantiation: statem_lib.c:PACKET_peek_1
Unexecuted instantiation: statem_srvr.c:PACKET_peek_1
Unexecuted instantiation: t1_lib.c:PACKET_peek_1
Unexecuted instantiation: tls13_enc.c:PACKET_peek_1
Unexecuted instantiation: tls_srp.c:PACKET_peek_1
Unexecuted instantiation: d1_lib.c:PACKET_peek_1
Unexecuted instantiation: d1_msg.c:PACKET_peek_1
Unexecuted instantiation: d1_srtp.c:PACKET_peek_1
Unexecuted instantiation: packet.c:PACKET_peek_1
Unexecuted instantiation: pqueue.c:PACKET_peek_1
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_1
Unexecuted instantiation: s3_enc.c:PACKET_peek_1
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_1
Unexecuted instantiation: ssl_conf.c:PACKET_peek_1
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_1
Unexecuted instantiation: t1_enc.c:PACKET_peek_1
298
299
/* Get 1 byte from |pkt| and store the value in |*data| */
300
__owur static ossl_inline int PACKET_get_1(PACKET *pkt, unsigned int *data)
301
57.1k
{
302
57.1k
    if (!PACKET_peek_1(pkt, data))
303
150
        return 0;
304
305
57.0k
    packet_forward(pkt, 1);
306
307
57.0k
    return 1;
308
57.1k
}
Unexecuted instantiation: methods.c:PACKET_get_1
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_1
rec_layer_s3.c:PACKET_get_1
Line
Count
Source
301
1.23k
{
302
1.23k
    if (!PACKET_peek_1(pkt, data))
303
20
        return 0;
304
305
1.21k
    packet_forward(pkt, 1);
306
307
1.21k
    return 1;
308
1.23k
}
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_1
ssl3_record.c:PACKET_get_1
Line
Count
Source
301
34.3k
{
302
34.3k
    if (!PACKET_peek_1(pkt, data))
303
0
        return 0;
304
305
34.3k
    packet_forward(pkt, 1);
306
307
34.3k
    return 1;
308
34.3k
}
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_1
Unexecuted instantiation: s3_cbc.c:PACKET_get_1
Unexecuted instantiation: s3_lib.c:PACKET_get_1
Unexecuted instantiation: s3_msg.c:PACKET_get_1
Unexecuted instantiation: ssl_cert.c:PACKET_get_1
Unexecuted instantiation: ssl_ciph.c:PACKET_get_1
Unexecuted instantiation: ssl_init.c:PACKET_get_1
Unexecuted instantiation: ssl_lib.c:PACKET_get_1
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_1
Unexecuted instantiation: ssl_sess.c:PACKET_get_1
Unexecuted instantiation: extensions.c:PACKET_get_1
extensions_clnt.c:PACKET_get_1
Line
Count
Source
301
4.27k
{
302
4.27k
    if (!PACKET_peek_1(pkt, data))
303
3
        return 0;
304
305
4.27k
    packet_forward(pkt, 1);
306
307
4.27k
    return 1;
308
4.27k
}
Unexecuted instantiation: extensions_cust.c:PACKET_get_1
Unexecuted instantiation: extensions_srvr.c:PACKET_get_1
Unexecuted instantiation: statem.c:PACKET_get_1
statem_clnt.c:PACKET_get_1
Line
Count
Source
301
17.2k
{
302
17.2k
    if (!PACKET_peek_1(pkt, data))
303
127
        return 0;
304
305
17.1k
    packet_forward(pkt, 1);
306
307
17.1k
    return 1;
308
17.2k
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_1
Unexecuted instantiation: statem_lib.c:PACKET_get_1
Unexecuted instantiation: statem_srvr.c:PACKET_get_1
Unexecuted instantiation: t1_lib.c:PACKET_get_1
Unexecuted instantiation: tls13_enc.c:PACKET_get_1
Unexecuted instantiation: tls_srp.c:PACKET_get_1
Unexecuted instantiation: d1_lib.c:PACKET_get_1
Unexecuted instantiation: d1_msg.c:PACKET_get_1
Unexecuted instantiation: d1_srtp.c:PACKET_get_1
Unexecuted instantiation: packet.c:PACKET_get_1
Unexecuted instantiation: pqueue.c:PACKET_get_1
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_1
Unexecuted instantiation: s3_enc.c:PACKET_get_1
Unexecuted instantiation: ssl_asn1.c:PACKET_get_1
Unexecuted instantiation: ssl_conf.c:PACKET_get_1
Unexecuted instantiation: ssl_rsa.c:PACKET_get_1
Unexecuted instantiation: t1_enc.c:PACKET_get_1
309
310
/* Same as PACKET_get_1() but for a size_t */
311
__owur static ossl_inline int PACKET_get_1_len(PACKET *pkt, size_t *data)
312
3.59k
{
313
3.59k
    unsigned int i;
314
3.59k
    int ret = PACKET_get_1(pkt, &i);
315
316
3.59k
    if (ret)
317
3.59k
        *data = (size_t)i;
318
319
3.59k
    return ret;
320
3.59k
}
Unexecuted instantiation: methods.c:PACKET_get_1_len
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_1_len
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_1_len
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_1_len
Unexecuted instantiation: ssl3_record.c:PACKET_get_1_len
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_1_len
Unexecuted instantiation: s3_cbc.c:PACKET_get_1_len
Unexecuted instantiation: s3_lib.c:PACKET_get_1_len
Unexecuted instantiation: s3_msg.c:PACKET_get_1_len
Unexecuted instantiation: ssl_cert.c:PACKET_get_1_len
Unexecuted instantiation: ssl_ciph.c:PACKET_get_1_len
Unexecuted instantiation: ssl_init.c:PACKET_get_1_len
Unexecuted instantiation: ssl_lib.c:PACKET_get_1_len
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_1_len
Unexecuted instantiation: ssl_sess.c:PACKET_get_1_len
Unexecuted instantiation: extensions.c:PACKET_get_1_len
extensions_clnt.c:PACKET_get_1_len
Line
Count
Source
312
3.59k
{
313
3.59k
    unsigned int i;
314
3.59k
    int ret = PACKET_get_1(pkt, &i);
315
316
3.59k
    if (ret)
317
3.59k
        *data = (size_t)i;
318
319
3.59k
    return ret;
320
3.59k
}
Unexecuted instantiation: extensions_cust.c:PACKET_get_1_len
Unexecuted instantiation: extensions_srvr.c:PACKET_get_1_len
Unexecuted instantiation: statem.c:PACKET_get_1_len
Unexecuted instantiation: statem_clnt.c:PACKET_get_1_len
Unexecuted instantiation: statem_dtls.c:PACKET_get_1_len
Unexecuted instantiation: statem_lib.c:PACKET_get_1_len
Unexecuted instantiation: statem_srvr.c:PACKET_get_1_len
Unexecuted instantiation: t1_lib.c:PACKET_get_1_len
Unexecuted instantiation: tls13_enc.c:PACKET_get_1_len
Unexecuted instantiation: tls_srp.c:PACKET_get_1_len
Unexecuted instantiation: d1_lib.c:PACKET_get_1_len
Unexecuted instantiation: d1_msg.c:PACKET_get_1_len
Unexecuted instantiation: d1_srtp.c:PACKET_get_1_len
Unexecuted instantiation: packet.c:PACKET_get_1_len
Unexecuted instantiation: pqueue.c:PACKET_get_1_len
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_1_len
Unexecuted instantiation: s3_enc.c:PACKET_get_1_len
Unexecuted instantiation: ssl_asn1.c:PACKET_get_1_len
Unexecuted instantiation: ssl_conf.c:PACKET_get_1_len
Unexecuted instantiation: ssl_rsa.c:PACKET_get_1_len
Unexecuted instantiation: t1_enc.c:PACKET_get_1_len
321
322
/*
323
 * Peek ahead at 4 bytes in reverse network order from |pkt| and store the value
324
 * in |*data|
325
 */
326
__owur static ossl_inline int PACKET_peek_4(const PACKET *pkt,
327
                                            unsigned long *data)
328
0
{
329
0
    if (PACKET_remaining(pkt) < 4)
330
0
        return 0;
331
0
332
0
    *data = *pkt->curr;
333
0
    *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;
334
0
    *data |= ((unsigned long)(*(pkt->curr + 2))) << 16;
335
0
    *data |= ((unsigned long)(*(pkt->curr + 3))) << 24;
336
0
337
0
    return 1;
338
0
}
Unexecuted instantiation: methods.c:PACKET_peek_4
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_4
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_4
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_4
Unexecuted instantiation: ssl3_record.c:PACKET_peek_4
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_4
Unexecuted instantiation: s3_cbc.c:PACKET_peek_4
Unexecuted instantiation: s3_lib.c:PACKET_peek_4
Unexecuted instantiation: s3_msg.c:PACKET_peek_4
Unexecuted instantiation: ssl_cert.c:PACKET_peek_4
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_4
Unexecuted instantiation: ssl_init.c:PACKET_peek_4
Unexecuted instantiation: ssl_lib.c:PACKET_peek_4
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_4
Unexecuted instantiation: ssl_sess.c:PACKET_peek_4
Unexecuted instantiation: extensions.c:PACKET_peek_4
Unexecuted instantiation: extensions_clnt.c:PACKET_peek_4
Unexecuted instantiation: extensions_cust.c:PACKET_peek_4
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_4
Unexecuted instantiation: statem.c:PACKET_peek_4
Unexecuted instantiation: statem_clnt.c:PACKET_peek_4
Unexecuted instantiation: statem_dtls.c:PACKET_peek_4
Unexecuted instantiation: statem_lib.c:PACKET_peek_4
Unexecuted instantiation: statem_srvr.c:PACKET_peek_4
Unexecuted instantiation: t1_lib.c:PACKET_peek_4
Unexecuted instantiation: tls13_enc.c:PACKET_peek_4
Unexecuted instantiation: tls_srp.c:PACKET_peek_4
Unexecuted instantiation: d1_lib.c:PACKET_peek_4
Unexecuted instantiation: d1_msg.c:PACKET_peek_4
Unexecuted instantiation: d1_srtp.c:PACKET_peek_4
Unexecuted instantiation: packet.c:PACKET_peek_4
Unexecuted instantiation: pqueue.c:PACKET_peek_4
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_4
Unexecuted instantiation: s3_enc.c:PACKET_peek_4
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_4
Unexecuted instantiation: ssl_conf.c:PACKET_peek_4
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_4
Unexecuted instantiation: t1_enc.c:PACKET_peek_4
339
340
/* Equivalent of c2l */
341
/*
342
 * Get 4 bytes in reverse network order from |pkt| and store the value in
343
 * |*data|
344
 */
345
__owur static ossl_inline int PACKET_get_4(PACKET *pkt, unsigned long *data)
346
0
{
347
0
    if (!PACKET_peek_4(pkt, data))
348
0
        return 0;
349
0
350
0
    packet_forward(pkt, 4);
351
0
352
0
    return 1;
353
0
}
Unexecuted instantiation: methods.c:PACKET_get_4
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_4
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_4
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_4
Unexecuted instantiation: ssl3_record.c:PACKET_get_4
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_4
Unexecuted instantiation: s3_cbc.c:PACKET_get_4
Unexecuted instantiation: s3_lib.c:PACKET_get_4
Unexecuted instantiation: s3_msg.c:PACKET_get_4
Unexecuted instantiation: ssl_cert.c:PACKET_get_4
Unexecuted instantiation: ssl_ciph.c:PACKET_get_4
Unexecuted instantiation: ssl_init.c:PACKET_get_4
Unexecuted instantiation: ssl_lib.c:PACKET_get_4
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_4
Unexecuted instantiation: ssl_sess.c:PACKET_get_4
Unexecuted instantiation: extensions.c:PACKET_get_4
Unexecuted instantiation: extensions_clnt.c:PACKET_get_4
Unexecuted instantiation: extensions_cust.c:PACKET_get_4
Unexecuted instantiation: extensions_srvr.c:PACKET_get_4
Unexecuted instantiation: statem.c:PACKET_get_4
Unexecuted instantiation: statem_clnt.c:PACKET_get_4
Unexecuted instantiation: statem_dtls.c:PACKET_get_4
Unexecuted instantiation: statem_lib.c:PACKET_get_4
Unexecuted instantiation: statem_srvr.c:PACKET_get_4
Unexecuted instantiation: t1_lib.c:PACKET_get_4
Unexecuted instantiation: tls13_enc.c:PACKET_get_4
Unexecuted instantiation: tls_srp.c:PACKET_get_4
Unexecuted instantiation: d1_lib.c:PACKET_get_4
Unexecuted instantiation: d1_msg.c:PACKET_get_4
Unexecuted instantiation: d1_srtp.c:PACKET_get_4
Unexecuted instantiation: packet.c:PACKET_get_4
Unexecuted instantiation: pqueue.c:PACKET_get_4
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_4
Unexecuted instantiation: s3_enc.c:PACKET_get_4
Unexecuted instantiation: ssl_asn1.c:PACKET_get_4
Unexecuted instantiation: ssl_conf.c:PACKET_get_4
Unexecuted instantiation: ssl_rsa.c:PACKET_get_4
Unexecuted instantiation: t1_enc.c:PACKET_get_4
354
355
/*
356
 * Peek ahead at |len| bytes from the |pkt| and store a pointer to them in
357
 * |*data|. This just points at the underlying buffer that |pkt| is using. The
358
 * caller should not free this data directly (it will be freed when the
359
 * underlying buffer gets freed
360
 */
361
__owur static ossl_inline int PACKET_peek_bytes(const PACKET *pkt,
362
                                                const unsigned char **data,
363
                                                size_t len)
364
60.8k
{
365
60.8k
    if (PACKET_remaining(pkt) < len)
366
284
        return 0;
367
368
60.6k
    *data = pkt->curr;
369
370
60.6k
    return 1;
371
60.8k
}
Unexecuted instantiation: methods.c:PACKET_peek_bytes
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_bytes
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_bytes
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_bytes
Unexecuted instantiation: ssl3_record.c:PACKET_peek_bytes
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_bytes
Unexecuted instantiation: s3_cbc.c:PACKET_peek_bytes
Unexecuted instantiation: s3_lib.c:PACKET_peek_bytes
Unexecuted instantiation: s3_msg.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_cert.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_init.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_lib.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_sess.c:PACKET_peek_bytes
extensions.c:PACKET_peek_bytes
Line
Count
Source
364
19.0k
{
365
19.0k
    if (PACKET_remaining(pkt) < len)
366
26
        return 0;
367
368
19.0k
    *data = pkt->curr;
369
370
19.0k
    return 1;
371
19.0k
}
extensions_clnt.c:PACKET_peek_bytes
Line
Count
Source
364
7.99k
{
365
7.99k
    if (PACKET_remaining(pkt) < len)
366
28
        return 0;
367
368
7.96k
    *data = pkt->curr;
369
370
7.96k
    return 1;
371
7.99k
}
Unexecuted instantiation: extensions_cust.c:PACKET_peek_bytes
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_bytes
Unexecuted instantiation: statem.c:PACKET_peek_bytes
statem_clnt.c:PACKET_peek_bytes
Line
Count
Source
364
32.9k
{
365
32.9k
    if (PACKET_remaining(pkt) < len)
366
162
        return 0;
367
368
32.8k
    *data = pkt->curr;
369
370
32.8k
    return 1;
371
32.9k
}
Unexecuted instantiation: statem_dtls.c:PACKET_peek_bytes
statem_lib.c:PACKET_peek_bytes
Line
Count
Source
364
848
{
365
848
    if (PACKET_remaining(pkt) < len)
366
68
        return 0;
367
368
780
    *data = pkt->curr;
369
370
780
    return 1;
371
848
}
Unexecuted instantiation: statem_srvr.c:PACKET_peek_bytes
Unexecuted instantiation: t1_lib.c:PACKET_peek_bytes
Unexecuted instantiation: tls13_enc.c:PACKET_peek_bytes
Unexecuted instantiation: tls_srp.c:PACKET_peek_bytes
Unexecuted instantiation: d1_lib.c:PACKET_peek_bytes
Unexecuted instantiation: d1_msg.c:PACKET_peek_bytes
Unexecuted instantiation: d1_srtp.c:PACKET_peek_bytes
Unexecuted instantiation: packet.c:PACKET_peek_bytes
Unexecuted instantiation: pqueue.c:PACKET_peek_bytes
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_bytes
Unexecuted instantiation: s3_enc.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_conf.c:PACKET_peek_bytes
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_bytes
Unexecuted instantiation: t1_enc.c:PACKET_peek_bytes
372
373
/*
374
 * Read |len| bytes from the |pkt| and store a pointer to them in |*data|. This
375
 * just points at the underlying buffer that |pkt| is using. The caller should
376
 * not free this data directly (it will be freed when the underlying buffer gets
377
 * freed
378
 */
379
__owur static ossl_inline int PACKET_get_bytes(PACKET *pkt,
380
                                               const unsigned char **data,
381
                                               size_t len)
382
60.8k
{
383
60.8k
    if (!PACKET_peek_bytes(pkt, data, len))
384
284
        return 0;
385
386
60.6k
    packet_forward(pkt, len);
387
388
60.6k
    return 1;
389
60.8k
}
Unexecuted instantiation: methods.c:PACKET_get_bytes
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_bytes
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_bytes
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_bytes
Unexecuted instantiation: ssl3_record.c:PACKET_get_bytes
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_bytes
Unexecuted instantiation: s3_cbc.c:PACKET_get_bytes
Unexecuted instantiation: s3_lib.c:PACKET_get_bytes
Unexecuted instantiation: s3_msg.c:PACKET_get_bytes
Unexecuted instantiation: ssl_cert.c:PACKET_get_bytes
Unexecuted instantiation: ssl_ciph.c:PACKET_get_bytes
Unexecuted instantiation: ssl_init.c:PACKET_get_bytes
Unexecuted instantiation: ssl_lib.c:PACKET_get_bytes
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_bytes
Unexecuted instantiation: ssl_sess.c:PACKET_get_bytes
extensions.c:PACKET_get_bytes
Line
Count
Source
382
19.0k
{
383
19.0k
    if (!PACKET_peek_bytes(pkt, data, len))
384
26
        return 0;
385
386
19.0k
    packet_forward(pkt, len);
387
388
19.0k
    return 1;
389
19.0k
}
extensions_clnt.c:PACKET_get_bytes
Line
Count
Source
382
7.99k
{
383
7.99k
    if (!PACKET_peek_bytes(pkt, data, len))
384
28
        return 0;
385
386
7.96k
    packet_forward(pkt, len);
387
388
7.96k
    return 1;
389
7.99k
}
Unexecuted instantiation: extensions_cust.c:PACKET_get_bytes
Unexecuted instantiation: extensions_srvr.c:PACKET_get_bytes
Unexecuted instantiation: statem.c:PACKET_get_bytes
statem_clnt.c:PACKET_get_bytes
Line
Count
Source
382
32.9k
{
383
32.9k
    if (!PACKET_peek_bytes(pkt, data, len))
384
162
        return 0;
385
386
32.8k
    packet_forward(pkt, len);
387
388
32.8k
    return 1;
389
32.9k
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_bytes
statem_lib.c:PACKET_get_bytes
Line
Count
Source
382
848
{
383
848
    if (!PACKET_peek_bytes(pkt, data, len))
384
68
        return 0;
385
386
780
    packet_forward(pkt, len);
387
388
780
    return 1;
389
848
}
Unexecuted instantiation: statem_srvr.c:PACKET_get_bytes
Unexecuted instantiation: t1_lib.c:PACKET_get_bytes
Unexecuted instantiation: tls13_enc.c:PACKET_get_bytes
Unexecuted instantiation: tls_srp.c:PACKET_get_bytes
Unexecuted instantiation: d1_lib.c:PACKET_get_bytes
Unexecuted instantiation: d1_msg.c:PACKET_get_bytes
Unexecuted instantiation: d1_srtp.c:PACKET_get_bytes
Unexecuted instantiation: packet.c:PACKET_get_bytes
Unexecuted instantiation: pqueue.c:PACKET_get_bytes
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_bytes
Unexecuted instantiation: s3_enc.c:PACKET_get_bytes
Unexecuted instantiation: ssl_asn1.c:PACKET_get_bytes
Unexecuted instantiation: ssl_conf.c:PACKET_get_bytes
Unexecuted instantiation: ssl_rsa.c:PACKET_get_bytes
Unexecuted instantiation: t1_enc.c:PACKET_get_bytes
390
391
/* Peek ahead at |len| bytes from |pkt| and copy them to |data| */
392
__owur static ossl_inline int PACKET_peek_copy_bytes(const PACKET *pkt,
393
                                                     unsigned char *data,
394
                                                     size_t len)
395
7.85k
{
396
7.85k
    if (PACKET_remaining(pkt) < len)
397
33
        return 0;
398
399
7.82k
    memcpy(data, pkt->curr, len);
400
401
7.82k
    return 1;
402
7.85k
}
Unexecuted instantiation: methods.c:PACKET_peek_copy_bytes
Unexecuted instantiation: rec_layer_d1.c:PACKET_peek_copy_bytes
Unexecuted instantiation: rec_layer_s3.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl3_record.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_peek_copy_bytes
Unexecuted instantiation: s3_cbc.c:PACKET_peek_copy_bytes
Unexecuted instantiation: s3_lib.c:PACKET_peek_copy_bytes
Unexecuted instantiation: s3_msg.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_cert.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_ciph.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_init.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_lib.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_sess.c:PACKET_peek_copy_bytes
Unexecuted instantiation: extensions.c:PACKET_peek_copy_bytes
extensions_clnt.c:PACKET_peek_copy_bytes
Line
Count
Source
395
669
{
396
669
    if (PACKET_remaining(pkt) < len)
397
0
        return 0;
398
399
669
    memcpy(data, pkt->curr, len);
400
401
669
    return 1;
402
669
}
Unexecuted instantiation: extensions_cust.c:PACKET_peek_copy_bytes
Unexecuted instantiation: extensions_srvr.c:PACKET_peek_copy_bytes
Unexecuted instantiation: statem.c:PACKET_peek_copy_bytes
statem_clnt.c:PACKET_peek_copy_bytes
Line
Count
Source
395
7.18k
{
396
7.18k
    if (PACKET_remaining(pkt) < len)
397
33
        return 0;
398
399
7.15k
    memcpy(data, pkt->curr, len);
400
401
7.15k
    return 1;
402
7.18k
}
Unexecuted instantiation: statem_dtls.c:PACKET_peek_copy_bytes
Unexecuted instantiation: statem_lib.c:PACKET_peek_copy_bytes
Unexecuted instantiation: statem_srvr.c:PACKET_peek_copy_bytes
Unexecuted instantiation: t1_lib.c:PACKET_peek_copy_bytes
Unexecuted instantiation: tls13_enc.c:PACKET_peek_copy_bytes
Unexecuted instantiation: tls_srp.c:PACKET_peek_copy_bytes
Unexecuted instantiation: d1_lib.c:PACKET_peek_copy_bytes
Unexecuted instantiation: d1_msg.c:PACKET_peek_copy_bytes
Unexecuted instantiation: d1_srtp.c:PACKET_peek_copy_bytes
Unexecuted instantiation: packet.c:PACKET_peek_copy_bytes
Unexecuted instantiation: pqueue.c:PACKET_peek_copy_bytes
Unexecuted instantiation: dtls1_bitmap.c:PACKET_peek_copy_bytes
Unexecuted instantiation: s3_enc.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_asn1.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_conf.c:PACKET_peek_copy_bytes
Unexecuted instantiation: ssl_rsa.c:PACKET_peek_copy_bytes
Unexecuted instantiation: t1_enc.c:PACKET_peek_copy_bytes
403
404
/*
405
 * Read |len| bytes from |pkt| and copy them to |data|.
406
 * The caller is responsible for ensuring that |data| can hold |len| bytes.
407
 */
408
__owur static ossl_inline int PACKET_copy_bytes(PACKET *pkt,
409
                                                unsigned char *data, size_t len)
410
7.85k
{
411
7.85k
    if (!PACKET_peek_copy_bytes(pkt, data, len))
412
33
        return 0;
413
414
7.82k
    packet_forward(pkt, len);
415
416
7.82k
    return 1;
417
7.85k
}
Unexecuted instantiation: methods.c:PACKET_copy_bytes
Unexecuted instantiation: rec_layer_d1.c:PACKET_copy_bytes
Unexecuted instantiation: rec_layer_s3.c:PACKET_copy_bytes
Unexecuted instantiation: ssl3_buffer.c:PACKET_copy_bytes
Unexecuted instantiation: ssl3_record.c:PACKET_copy_bytes
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_copy_bytes
Unexecuted instantiation: s3_cbc.c:PACKET_copy_bytes
Unexecuted instantiation: s3_lib.c:PACKET_copy_bytes
Unexecuted instantiation: s3_msg.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_cert.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_ciph.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_init.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_lib.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_mcnf.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_sess.c:PACKET_copy_bytes
Unexecuted instantiation: extensions.c:PACKET_copy_bytes
extensions_clnt.c:PACKET_copy_bytes
Line
Count
Source
410
669
{
411
669
    if (!PACKET_peek_copy_bytes(pkt, data, len))
412
0
        return 0;
413
414
669
    packet_forward(pkt, len);
415
416
669
    return 1;
417
669
}
Unexecuted instantiation: extensions_cust.c:PACKET_copy_bytes
Unexecuted instantiation: extensions_srvr.c:PACKET_copy_bytes
Unexecuted instantiation: statem.c:PACKET_copy_bytes
statem_clnt.c:PACKET_copy_bytes
Line
Count
Source
410
7.18k
{
411
7.18k
    if (!PACKET_peek_copy_bytes(pkt, data, len))
412
33
        return 0;
413
414
7.15k
    packet_forward(pkt, len);
415
416
7.15k
    return 1;
417
7.18k
}
Unexecuted instantiation: statem_dtls.c:PACKET_copy_bytes
Unexecuted instantiation: statem_lib.c:PACKET_copy_bytes
Unexecuted instantiation: statem_srvr.c:PACKET_copy_bytes
Unexecuted instantiation: t1_lib.c:PACKET_copy_bytes
Unexecuted instantiation: tls13_enc.c:PACKET_copy_bytes
Unexecuted instantiation: tls_srp.c:PACKET_copy_bytes
Unexecuted instantiation: d1_lib.c:PACKET_copy_bytes
Unexecuted instantiation: d1_msg.c:PACKET_copy_bytes
Unexecuted instantiation: d1_srtp.c:PACKET_copy_bytes
Unexecuted instantiation: packet.c:PACKET_copy_bytes
Unexecuted instantiation: pqueue.c:PACKET_copy_bytes
Unexecuted instantiation: dtls1_bitmap.c:PACKET_copy_bytes
Unexecuted instantiation: s3_enc.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_asn1.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_conf.c:PACKET_copy_bytes
Unexecuted instantiation: ssl_rsa.c:PACKET_copy_bytes
Unexecuted instantiation: t1_enc.c:PACKET_copy_bytes
418
419
/*
420
 * Copy packet data to |dest|, and set |len| to the number of copied bytes.
421
 * If the packet has more than |dest_len| bytes, nothing is copied.
422
 * Returns 1 if the packet data fits in |dest_len| bytes, 0 otherwise.
423
 * Does not forward PACKET position (because it is typically the last thing
424
 * done with a given PACKET).
425
 */
426
__owur static ossl_inline int PACKET_copy_all(const PACKET *pkt,
427
                                              unsigned char *dest,
428
                                              size_t dest_len, size_t *len)
429
0
{
430
0
    if (PACKET_remaining(pkt) > dest_len) {
431
0
        *len = 0;
432
0
        return 0;
433
0
    }
434
0
    *len = pkt->remaining;
435
0
    memcpy(dest, pkt->curr, pkt->remaining);
436
0
    return 1;
437
0
}
Unexecuted instantiation: methods.c:PACKET_copy_all
Unexecuted instantiation: rec_layer_d1.c:PACKET_copy_all
Unexecuted instantiation: rec_layer_s3.c:PACKET_copy_all
Unexecuted instantiation: ssl3_buffer.c:PACKET_copy_all
Unexecuted instantiation: ssl3_record.c:PACKET_copy_all
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_copy_all
Unexecuted instantiation: s3_cbc.c:PACKET_copy_all
Unexecuted instantiation: s3_lib.c:PACKET_copy_all
Unexecuted instantiation: s3_msg.c:PACKET_copy_all
Unexecuted instantiation: ssl_cert.c:PACKET_copy_all
Unexecuted instantiation: ssl_ciph.c:PACKET_copy_all
Unexecuted instantiation: ssl_init.c:PACKET_copy_all
Unexecuted instantiation: ssl_lib.c:PACKET_copy_all
Unexecuted instantiation: ssl_mcnf.c:PACKET_copy_all
Unexecuted instantiation: ssl_sess.c:PACKET_copy_all
Unexecuted instantiation: extensions.c:PACKET_copy_all
Unexecuted instantiation: extensions_clnt.c:PACKET_copy_all
Unexecuted instantiation: extensions_cust.c:PACKET_copy_all
Unexecuted instantiation: extensions_srvr.c:PACKET_copy_all
Unexecuted instantiation: statem.c:PACKET_copy_all
Unexecuted instantiation: statem_clnt.c:PACKET_copy_all
Unexecuted instantiation: statem_dtls.c:PACKET_copy_all
Unexecuted instantiation: statem_lib.c:PACKET_copy_all
Unexecuted instantiation: statem_srvr.c:PACKET_copy_all
Unexecuted instantiation: t1_lib.c:PACKET_copy_all
Unexecuted instantiation: tls13_enc.c:PACKET_copy_all
Unexecuted instantiation: tls_srp.c:PACKET_copy_all
Unexecuted instantiation: d1_lib.c:PACKET_copy_all
Unexecuted instantiation: d1_msg.c:PACKET_copy_all
Unexecuted instantiation: d1_srtp.c:PACKET_copy_all
Unexecuted instantiation: packet.c:PACKET_copy_all
Unexecuted instantiation: pqueue.c:PACKET_copy_all
Unexecuted instantiation: dtls1_bitmap.c:PACKET_copy_all
Unexecuted instantiation: s3_enc.c:PACKET_copy_all
Unexecuted instantiation: ssl_asn1.c:PACKET_copy_all
Unexecuted instantiation: ssl_conf.c:PACKET_copy_all
Unexecuted instantiation: ssl_rsa.c:PACKET_copy_all
Unexecuted instantiation: t1_enc.c:PACKET_copy_all
438
439
/*
440
 * Copy |pkt| bytes to a newly allocated buffer and store a pointer to the
441
 * result in |*data|, and the length in |len|.
442
 * If |*data| is not NULL, the old data is OPENSSL_free'd.
443
 * If the packet is empty, or malloc fails, |*data| will be set to NULL.
444
 * Returns 1 if the malloc succeeds and 0 otherwise.
445
 * Does not forward PACKET position (because it is typically the last thing
446
 * done with a given PACKET).
447
 */
448
__owur static ossl_inline int PACKET_memdup(const PACKET *pkt,
449
                                            unsigned char **data, size_t *len)
450
480
{
451
480
    size_t length;
452
453
480
    OPENSSL_free(*data);
454
480
    *data = NULL;
455
480
    *len = 0;
456
457
480
    length = PACKET_remaining(pkt);
458
459
480
    if (length == 0)
460
421
        return 1;
461
462
59
    *data = OPENSSL_memdup(pkt->curr, length);
463
59
    if (*data == NULL)
464
0
        return 0;
465
466
59
    *len = length;
467
59
    return 1;
468
59
}
Unexecuted instantiation: methods.c:PACKET_memdup
Unexecuted instantiation: rec_layer_d1.c:PACKET_memdup
Unexecuted instantiation: rec_layer_s3.c:PACKET_memdup
Unexecuted instantiation: ssl3_buffer.c:PACKET_memdup
Unexecuted instantiation: ssl3_record.c:PACKET_memdup
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_memdup
Unexecuted instantiation: s3_cbc.c:PACKET_memdup
Unexecuted instantiation: s3_lib.c:PACKET_memdup
Unexecuted instantiation: s3_msg.c:PACKET_memdup
Unexecuted instantiation: ssl_cert.c:PACKET_memdup
Unexecuted instantiation: ssl_ciph.c:PACKET_memdup
Unexecuted instantiation: ssl_init.c:PACKET_memdup
Unexecuted instantiation: ssl_lib.c:PACKET_memdup
Unexecuted instantiation: ssl_mcnf.c:PACKET_memdup
Unexecuted instantiation: ssl_sess.c:PACKET_memdup
Unexecuted instantiation: extensions.c:PACKET_memdup
extensions_clnt.c:PACKET_memdup
Line
Count
Source
450
7
{
451
7
    size_t length;
452
453
7
    OPENSSL_free(*data);
454
7
    *data = NULL;
455
7
    *len = 0;
456
457
7
    length = PACKET_remaining(pkt);
458
459
7
    if (length == 0)
460
1
        return 1;
461
462
6
    *data = OPENSSL_memdup(pkt->curr, length);
463
6
    if (*data == NULL)
464
0
        return 0;
465
466
6
    *len = length;
467
6
    return 1;
468
6
}
Unexecuted instantiation: extensions_cust.c:PACKET_memdup
Unexecuted instantiation: extensions_srvr.c:PACKET_memdup
Unexecuted instantiation: statem.c:PACKET_memdup
statem_clnt.c:PACKET_memdup
Line
Count
Source
450
473
{
451
473
    size_t length;
452
453
473
    OPENSSL_free(*data);
454
473
    *data = NULL;
455
473
    *len = 0;
456
457
473
    length = PACKET_remaining(pkt);
458
459
473
    if (length == 0)
460
420
        return 1;
461
462
53
    *data = OPENSSL_memdup(pkt->curr, length);
463
53
    if (*data == NULL)
464
0
        return 0;
465
466
53
    *len = length;
467
53
    return 1;
468
53
}
Unexecuted instantiation: statem_dtls.c:PACKET_memdup
Unexecuted instantiation: statem_lib.c:PACKET_memdup
Unexecuted instantiation: statem_srvr.c:PACKET_memdup
Unexecuted instantiation: t1_lib.c:PACKET_memdup
Unexecuted instantiation: tls13_enc.c:PACKET_memdup
Unexecuted instantiation: tls_srp.c:PACKET_memdup
Unexecuted instantiation: d1_lib.c:PACKET_memdup
Unexecuted instantiation: d1_msg.c:PACKET_memdup
Unexecuted instantiation: d1_srtp.c:PACKET_memdup
Unexecuted instantiation: packet.c:PACKET_memdup
Unexecuted instantiation: pqueue.c:PACKET_memdup
Unexecuted instantiation: dtls1_bitmap.c:PACKET_memdup
Unexecuted instantiation: s3_enc.c:PACKET_memdup
Unexecuted instantiation: ssl_asn1.c:PACKET_memdup
Unexecuted instantiation: ssl_conf.c:PACKET_memdup
Unexecuted instantiation: ssl_rsa.c:PACKET_memdup
Unexecuted instantiation: t1_enc.c:PACKET_memdup
469
470
/*
471
 * Read a C string from |pkt| and copy to a newly allocated, NUL-terminated
472
 * buffer. Store a pointer to the result in |*data|.
473
 * If |*data| is not NULL, the old data is OPENSSL_free'd.
474
 * If the data in |pkt| does not contain a NUL-byte, the entire data is
475
 * copied and NUL-terminated.
476
 * Returns 1 if the malloc succeeds and 0 otherwise.
477
 * Does not forward PACKET position (because it is typically the last thing done
478
 * with a given PACKET).
479
 */
480
__owur static ossl_inline int PACKET_strndup(const PACKET *pkt, char **data)
481
0
{
482
0
    OPENSSL_free(*data);
483
484
    /* This will succeed on an empty packet, unless pkt->curr == NULL. */
485
0
    *data = OPENSSL_strndup((const char *)pkt->curr, PACKET_remaining(pkt));
486
0
    return (*data != NULL);
487
0
}
Unexecuted instantiation: methods.c:PACKET_strndup
Unexecuted instantiation: rec_layer_d1.c:PACKET_strndup
Unexecuted instantiation: rec_layer_s3.c:PACKET_strndup
Unexecuted instantiation: ssl3_buffer.c:PACKET_strndup
Unexecuted instantiation: ssl3_record.c:PACKET_strndup
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_strndup
Unexecuted instantiation: s3_cbc.c:PACKET_strndup
Unexecuted instantiation: s3_lib.c:PACKET_strndup
Unexecuted instantiation: s3_msg.c:PACKET_strndup
Unexecuted instantiation: ssl_cert.c:PACKET_strndup
Unexecuted instantiation: ssl_ciph.c:PACKET_strndup
Unexecuted instantiation: ssl_init.c:PACKET_strndup
Unexecuted instantiation: ssl_lib.c:PACKET_strndup
Unexecuted instantiation: ssl_mcnf.c:PACKET_strndup
Unexecuted instantiation: ssl_sess.c:PACKET_strndup
Unexecuted instantiation: extensions.c:PACKET_strndup
Unexecuted instantiation: extensions_clnt.c:PACKET_strndup
Unexecuted instantiation: extensions_cust.c:PACKET_strndup
Unexecuted instantiation: extensions_srvr.c:PACKET_strndup
Unexecuted instantiation: statem.c:PACKET_strndup
Unexecuted instantiation: statem_clnt.c:PACKET_strndup
Unexecuted instantiation: statem_dtls.c:PACKET_strndup
Unexecuted instantiation: statem_lib.c:PACKET_strndup
Unexecuted instantiation: statem_srvr.c:PACKET_strndup
Unexecuted instantiation: t1_lib.c:PACKET_strndup
Unexecuted instantiation: tls13_enc.c:PACKET_strndup
Unexecuted instantiation: tls_srp.c:PACKET_strndup
Unexecuted instantiation: d1_lib.c:PACKET_strndup
Unexecuted instantiation: d1_msg.c:PACKET_strndup
Unexecuted instantiation: d1_srtp.c:PACKET_strndup
Unexecuted instantiation: packet.c:PACKET_strndup
Unexecuted instantiation: pqueue.c:PACKET_strndup
Unexecuted instantiation: dtls1_bitmap.c:PACKET_strndup
Unexecuted instantiation: s3_enc.c:PACKET_strndup
Unexecuted instantiation: ssl_asn1.c:PACKET_strndup
Unexecuted instantiation: ssl_conf.c:PACKET_strndup
Unexecuted instantiation: ssl_rsa.c:PACKET_strndup
Unexecuted instantiation: t1_enc.c:PACKET_strndup
488
489
/* Returns 1 if |pkt| contains at least one 0-byte, 0 otherwise. */
490
static ossl_inline int PACKET_contains_zero_byte(const PACKET *pkt)
491
0
{
492
0
    return memchr(pkt->curr, 0, pkt->remaining) != NULL;
493
0
}
Unexecuted instantiation: methods.c:PACKET_contains_zero_byte
Unexecuted instantiation: rec_layer_d1.c:PACKET_contains_zero_byte
Unexecuted instantiation: rec_layer_s3.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl3_buffer.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl3_record.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_contains_zero_byte
Unexecuted instantiation: s3_cbc.c:PACKET_contains_zero_byte
Unexecuted instantiation: s3_lib.c:PACKET_contains_zero_byte
Unexecuted instantiation: s3_msg.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_cert.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_ciph.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_init.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_lib.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_mcnf.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_sess.c:PACKET_contains_zero_byte
Unexecuted instantiation: extensions.c:PACKET_contains_zero_byte
Unexecuted instantiation: extensions_clnt.c:PACKET_contains_zero_byte
Unexecuted instantiation: extensions_cust.c:PACKET_contains_zero_byte
Unexecuted instantiation: extensions_srvr.c:PACKET_contains_zero_byte
Unexecuted instantiation: statem.c:PACKET_contains_zero_byte
Unexecuted instantiation: statem_clnt.c:PACKET_contains_zero_byte
Unexecuted instantiation: statem_dtls.c:PACKET_contains_zero_byte
Unexecuted instantiation: statem_lib.c:PACKET_contains_zero_byte
Unexecuted instantiation: statem_srvr.c:PACKET_contains_zero_byte
Unexecuted instantiation: t1_lib.c:PACKET_contains_zero_byte
Unexecuted instantiation: tls13_enc.c:PACKET_contains_zero_byte
Unexecuted instantiation: tls_srp.c:PACKET_contains_zero_byte
Unexecuted instantiation: d1_lib.c:PACKET_contains_zero_byte
Unexecuted instantiation: d1_msg.c:PACKET_contains_zero_byte
Unexecuted instantiation: d1_srtp.c:PACKET_contains_zero_byte
Unexecuted instantiation: packet.c:PACKET_contains_zero_byte
Unexecuted instantiation: pqueue.c:PACKET_contains_zero_byte
Unexecuted instantiation: dtls1_bitmap.c:PACKET_contains_zero_byte
Unexecuted instantiation: s3_enc.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_asn1.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_conf.c:PACKET_contains_zero_byte
Unexecuted instantiation: ssl_rsa.c:PACKET_contains_zero_byte
Unexecuted instantiation: t1_enc.c:PACKET_contains_zero_byte
494
495
/* Move the current reading position forward |len| bytes */
496
__owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
497
109
{
498
109
    if (PACKET_remaining(pkt) < len)
499
0
        return 0;
500
501
109
    packet_forward(pkt, len);
502
503
109
    return 1;
504
109
}
Unexecuted instantiation: methods.c:PACKET_forward
Unexecuted instantiation: rec_layer_d1.c:PACKET_forward
Unexecuted instantiation: rec_layer_s3.c:PACKET_forward
Unexecuted instantiation: ssl3_buffer.c:PACKET_forward
Unexecuted instantiation: ssl3_record.c:PACKET_forward
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_forward
Unexecuted instantiation: s3_cbc.c:PACKET_forward
Unexecuted instantiation: s3_lib.c:PACKET_forward
Unexecuted instantiation: s3_msg.c:PACKET_forward
Unexecuted instantiation: ssl_cert.c:PACKET_forward
Unexecuted instantiation: ssl_ciph.c:PACKET_forward
Unexecuted instantiation: ssl_init.c:PACKET_forward
Unexecuted instantiation: ssl_lib.c:PACKET_forward
Unexecuted instantiation: ssl_mcnf.c:PACKET_forward
Unexecuted instantiation: ssl_sess.c:PACKET_forward
Unexecuted instantiation: extensions.c:PACKET_forward
Unexecuted instantiation: extensions_clnt.c:PACKET_forward
Unexecuted instantiation: extensions_cust.c:PACKET_forward
Unexecuted instantiation: extensions_srvr.c:PACKET_forward
Unexecuted instantiation: statem.c:PACKET_forward
statem_clnt.c:PACKET_forward
Line
Count
Source
497
109
{
498
109
    if (PACKET_remaining(pkt) < len)
499
0
        return 0;
500
501
109
    packet_forward(pkt, len);
502
503
109
    return 1;
504
109
}
Unexecuted instantiation: statem_dtls.c:PACKET_forward
Unexecuted instantiation: statem_lib.c:PACKET_forward
Unexecuted instantiation: statem_srvr.c:PACKET_forward
Unexecuted instantiation: t1_lib.c:PACKET_forward
Unexecuted instantiation: tls13_enc.c:PACKET_forward
Unexecuted instantiation: tls_srp.c:PACKET_forward
Unexecuted instantiation: d1_lib.c:PACKET_forward
Unexecuted instantiation: d1_msg.c:PACKET_forward
Unexecuted instantiation: d1_srtp.c:PACKET_forward
Unexecuted instantiation: packet.c:PACKET_forward
Unexecuted instantiation: pqueue.c:PACKET_forward
Unexecuted instantiation: dtls1_bitmap.c:PACKET_forward
Unexecuted instantiation: s3_enc.c:PACKET_forward
Unexecuted instantiation: ssl_asn1.c:PACKET_forward
Unexecuted instantiation: ssl_conf.c:PACKET_forward
Unexecuted instantiation: ssl_rsa.c:PACKET_forward
Unexecuted instantiation: t1_enc.c:PACKET_forward
505
506
/*
507
 * Reads a variable-length vector prefixed with a one-byte length, and stores
508
 * the contents in |subpkt|. |pkt| can equal |subpkt|.
509
 * Data is not copied: the |subpkt| packet will share its underlying buffer with
510
 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
511
 * Upon failure, the original |pkt| and |subpkt| are not modified.
512
 */
513
__owur static ossl_inline int PACKET_get_length_prefixed_1(PACKET *pkt,
514
                                                           PACKET *subpkt)
515
8.94k
{
516
8.94k
    unsigned int length;
517
8.94k
    const unsigned char *data;
518
8.94k
    PACKET tmp = *pkt;
519
8.94k
    if (!PACKET_get_1(&tmp, &length) ||
520
8.94k
        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
521
156
        return 0;
522
156
    }
523
524
8.79k
    *pkt = tmp;
525
8.79k
    subpkt->curr = data;
526
8.79k
    subpkt->remaining = length;
527
528
8.79k
    return 1;
529
8.94k
}
Unexecuted instantiation: methods.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl3_record.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: s3_cbc.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: s3_lib.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: s3_msg.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_cert.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_ciph.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_init.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_lib.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_sess.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: extensions.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: extensions_clnt.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: extensions_cust.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: extensions_srvr.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: statem.c:PACKET_get_length_prefixed_1
statem_clnt.c:PACKET_get_length_prefixed_1
Line
Count
Source
515
8.94k
{
516
8.94k
    unsigned int length;
517
8.94k
    const unsigned char *data;
518
8.94k
    PACKET tmp = *pkt;
519
8.94k
    if (!PACKET_get_1(&tmp, &length) ||
520
8.94k
        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
521
156
        return 0;
522
156
    }
523
524
8.79k
    *pkt = tmp;
525
8.79k
    subpkt->curr = data;
526
8.79k
    subpkt->remaining = length;
527
528
8.79k
    return 1;
529
8.94k
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: statem_lib.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: statem_srvr.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: t1_lib.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: tls13_enc.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: tls_srp.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: d1_lib.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: d1_msg.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: d1_srtp.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: packet.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: pqueue.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: s3_enc.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_asn1.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_conf.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: ssl_rsa.c:PACKET_get_length_prefixed_1
Unexecuted instantiation: t1_enc.c:PACKET_get_length_prefixed_1
530
531
/*
532
 * Like PACKET_get_length_prefixed_1, but additionally, fails when there are
533
 * leftover bytes in |pkt|.
534
 */
535
__owur static ossl_inline int PACKET_as_length_prefixed_1(PACKET *pkt,
536
                                                          PACKET *subpkt)
537
682
{
538
682
    unsigned int length;
539
682
    const unsigned char *data;
540
682
    PACKET tmp = *pkt;
541
682
    if (!PACKET_get_1(&tmp, &length) ||
542
682
        !PACKET_get_bytes(&tmp, &data, (size_t)length) ||
543
682
        PACKET_remaining(&tmp) != 0) {
544
10
        return 0;
545
10
    }
546
547
672
    *pkt = tmp;
548
672
    subpkt->curr = data;
549
672
    subpkt->remaining = length;
550
551
672
    return 1;
552
682
}
Unexecuted instantiation: methods.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: rec_layer_d1.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: rec_layer_s3.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl3_buffer.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl3_record.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: s3_cbc.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: s3_lib.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: s3_msg.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_cert.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_ciph.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_init.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_lib.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_mcnf.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_sess.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: extensions.c:PACKET_as_length_prefixed_1
extensions_clnt.c:PACKET_as_length_prefixed_1
Line
Count
Source
537
682
{
538
682
    unsigned int length;
539
682
    const unsigned char *data;
540
682
    PACKET tmp = *pkt;
541
682
    if (!PACKET_get_1(&tmp, &length) ||
542
682
        !PACKET_get_bytes(&tmp, &data, (size_t)length) ||
543
682
        PACKET_remaining(&tmp) != 0) {
544
10
        return 0;
545
10
    }
546
547
672
    *pkt = tmp;
548
672
    subpkt->curr = data;
549
672
    subpkt->remaining = length;
550
551
672
    return 1;
552
682
}
Unexecuted instantiation: extensions_cust.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: extensions_srvr.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: statem.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: statem_clnt.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: statem_dtls.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: statem_lib.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: statem_srvr.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: t1_lib.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: tls13_enc.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: tls_srp.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: d1_lib.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: d1_msg.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: d1_srtp.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: packet.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: pqueue.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: dtls1_bitmap.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: s3_enc.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_asn1.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_conf.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: ssl_rsa.c:PACKET_as_length_prefixed_1
Unexecuted instantiation: t1_enc.c:PACKET_as_length_prefixed_1
553
554
/*
555
 * Reads a variable-length vector prefixed with a two-byte length, and stores
556
 * the contents in |subpkt|. |pkt| can equal |subpkt|.
557
 * Data is not copied: the |subpkt| packet will share its underlying buffer with
558
 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
559
 * Upon failure, the original |pkt| and |subpkt| are not modified.
560
 */
561
__owur static ossl_inline int PACKET_get_length_prefixed_2(PACKET *pkt,
562
                                                           PACKET *subpkt)
563
25.6k
{
564
25.6k
    unsigned int length;
565
25.6k
    const unsigned char *data;
566
25.6k
    PACKET tmp = *pkt;
567
568
25.6k
    if (!PACKET_get_net_2(&tmp, &length) ||
569
25.6k
        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
570
168
        return 0;
571
168
    }
572
573
25.4k
    *pkt = tmp;
574
25.4k
    subpkt->curr = data;
575
25.4k
    subpkt->remaining = length;
576
577
25.4k
    return 1;
578
25.6k
}
Unexecuted instantiation: methods.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl3_record.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: s3_cbc.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: s3_lib.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: s3_msg.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_cert.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_ciph.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_init.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_lib.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_sess.c:PACKET_get_length_prefixed_2
extensions.c:PACKET_get_length_prefixed_2
Line
Count
Source
563
19.0k
{
564
19.0k
    unsigned int length;
565
19.0k
    const unsigned char *data;
566
19.0k
    PACKET tmp = *pkt;
567
568
19.0k
    if (!PACKET_get_net_2(&tmp, &length) ||
569
19.0k
        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
570
31
        return 0;
571
31
    }
572
573
19.0k
    *pkt = tmp;
574
19.0k
    subpkt->curr = data;
575
19.0k
    subpkt->remaining = length;
576
577
19.0k
    return 1;
578
19.0k
}
Unexecuted instantiation: extensions_clnt.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: extensions_cust.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: extensions_srvr.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: statem.c:PACKET_get_length_prefixed_2
statem_clnt.c:PACKET_get_length_prefixed_2
Line
Count
Source
563
6.09k
{
564
6.09k
    unsigned int length;
565
6.09k
    const unsigned char *data;
566
6.09k
    PACKET tmp = *pkt;
567
568
6.09k
    if (!PACKET_get_net_2(&tmp, &length) ||
569
6.09k
        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
570
71
        return 0;
571
71
    }
572
573
6.02k
    *pkt = tmp;
574
6.02k
    subpkt->curr = data;
575
6.02k
    subpkt->remaining = length;
576
577
6.02k
    return 1;
578
6.09k
}
Unexecuted instantiation: statem_dtls.c:PACKET_get_length_prefixed_2
statem_lib.c:PACKET_get_length_prefixed_2
Line
Count
Source
563
455
{
564
455
    unsigned int length;
565
455
    const unsigned char *data;
566
455
    PACKET tmp = *pkt;
567
568
455
    if (!PACKET_get_net_2(&tmp, &length) ||
569
455
        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
570
66
        return 0;
571
66
    }
572
573
389
    *pkt = tmp;
574
389
    subpkt->curr = data;
575
389
    subpkt->remaining = length;
576
577
389
    return 1;
578
455
}
Unexecuted instantiation: statem_srvr.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: t1_lib.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: tls13_enc.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: tls_srp.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: d1_lib.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: d1_msg.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: d1_srtp.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: packet.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: pqueue.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: s3_enc.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_asn1.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_conf.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: ssl_rsa.c:PACKET_get_length_prefixed_2
Unexecuted instantiation: t1_enc.c:PACKET_get_length_prefixed_2
579
580
/*
581
 * Like PACKET_get_length_prefixed_2, but additionally, fails when there are
582
 * leftover bytes in |pkt|.
583
 */
584
__owur static ossl_inline int PACKET_as_length_prefixed_2(PACKET *pkt,
585
                                                          PACKET *subpkt)
586
6.44k
{
587
6.44k
    unsigned int length;
588
6.44k
    const unsigned char *data;
589
6.44k
    PACKET tmp = *pkt;
590
591
6.44k
    if (!PACKET_get_net_2(&tmp, &length) ||
592
6.44k
        !PACKET_get_bytes(&tmp, &data, (size_t)length) ||
593
6.44k
        PACKET_remaining(&tmp) != 0) {
594
113
        return 0;
595
113
    }
596
597
6.33k
    *pkt = tmp;
598
6.33k
    subpkt->curr = data;
599
6.33k
    subpkt->remaining = length;
600
601
6.33k
    return 1;
602
6.44k
}
Unexecuted instantiation: methods.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: rec_layer_d1.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: rec_layer_s3.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl3_buffer.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl3_record.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: s3_cbc.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: s3_lib.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: s3_msg.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_cert.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_ciph.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_init.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_lib.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_mcnf.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_sess.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: extensions.c:PACKET_as_length_prefixed_2
extensions_clnt.c:PACKET_as_length_prefixed_2
Line
Count
Source
586
164
{
587
164
    unsigned int length;
588
164
    const unsigned char *data;
589
164
    PACKET tmp = *pkt;
590
591
164
    if (!PACKET_get_net_2(&tmp, &length) ||
592
164
        !PACKET_get_bytes(&tmp, &data, (size_t)length) ||
593
164
        PACKET_remaining(&tmp) != 0) {
594
36
        return 0;
595
36
    }
596
597
128
    *pkt = tmp;
598
128
    subpkt->curr = data;
599
128
    subpkt->remaining = length;
600
601
128
    return 1;
602
164
}
Unexecuted instantiation: extensions_cust.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: extensions_srvr.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: statem.c:PACKET_as_length_prefixed_2
statem_clnt.c:PACKET_as_length_prefixed_2
Line
Count
Source
586
6.28k
{
587
6.28k
    unsigned int length;
588
6.28k
    const unsigned char *data;
589
6.28k
    PACKET tmp = *pkt;
590
591
6.28k
    if (!PACKET_get_net_2(&tmp, &length) ||
592
6.28k
        !PACKET_get_bytes(&tmp, &data, (size_t)length) ||
593
6.28k
        PACKET_remaining(&tmp) != 0) {
594
77
        return 0;
595
77
    }
596
597
6.20k
    *pkt = tmp;
598
6.20k
    subpkt->curr = data;
599
6.20k
    subpkt->remaining = length;
600
601
6.20k
    return 1;
602
6.28k
}
Unexecuted instantiation: statem_dtls.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: statem_lib.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: statem_srvr.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: t1_lib.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: tls13_enc.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: tls_srp.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: d1_lib.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: d1_msg.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: d1_srtp.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: packet.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: pqueue.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: dtls1_bitmap.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: s3_enc.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_asn1.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_conf.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: ssl_rsa.c:PACKET_as_length_prefixed_2
Unexecuted instantiation: t1_enc.c:PACKET_as_length_prefixed_2
603
604
/*
605
 * Reads a variable-length vector prefixed with a three-byte length, and stores
606
 * the contents in |subpkt|. |pkt| can equal |subpkt|.
607
 * Data is not copied: the |subpkt| packet will share its underlying buffer with
608
 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
609
 * Upon failure, the original |pkt| and |subpkt| are not modified.
610
 */
611
__owur static ossl_inline int PACKET_get_length_prefixed_3(PACKET *pkt,
612
                                                           PACKET *subpkt)
613
0
{
614
0
    unsigned long length;
615
0
    const unsigned char *data;
616
0
    PACKET tmp = *pkt;
617
0
    if (!PACKET_get_net_3(&tmp, &length) ||
618
0
        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
619
0
        return 0;
620
0
    }
621
622
0
    *pkt = tmp;
623
0
    subpkt->curr = data;
624
0
    subpkt->remaining = length;
625
626
0
    return 1;
627
0
}
Unexecuted instantiation: methods.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: rec_layer_d1.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: rec_layer_s3.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl3_record.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl3_record_tls13.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: s3_cbc.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: s3_lib.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: s3_msg.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_cert.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_ciph.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_init.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_lib.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_sess.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: extensions.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: extensions_clnt.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: extensions_cust.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: extensions_srvr.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: statem.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: statem_clnt.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: statem_dtls.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: statem_lib.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: statem_srvr.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: t1_lib.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: tls13_enc.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: tls_srp.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: d1_lib.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: d1_msg.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: d1_srtp.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: packet.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: pqueue.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: dtls1_bitmap.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: s3_enc.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_asn1.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_conf.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: ssl_rsa.c:PACKET_get_length_prefixed_3
Unexecuted instantiation: t1_enc.c:PACKET_get_length_prefixed_3
628
629
/* Writeable packets */
630
631
typedef struct wpacket_sub WPACKET_SUB;
632
struct wpacket_sub {
633
    /* The parent WPACKET_SUB if we have one or NULL otherwise */
634
    WPACKET_SUB *parent;
635
636
    /*
637
     * Offset into the buffer where the length of this WPACKET goes. We use an
638
     * offset in case the buffer grows and gets reallocated.
639
     */
640
    size_t packet_len;
641
642
    /* Number of bytes in the packet_len or 0 if we don't write the length */
643
    size_t lenbytes;
644
645
    /* Number of bytes written to the buf prior to this packet starting */
646
    size_t pwritten;
647
648
    /* Flags for this sub-packet */
649
    unsigned int flags;
650
};
651
652
typedef struct wpacket_st WPACKET;
653
struct wpacket_st {
654
    /* The buffer where we store the output data */
655
    BUF_MEM *buf;
656
657
    /* Fixed sized buffer which can be used as an alternative to buf */
658
    unsigned char *staticbuf;
659
660
    /*
661
     * Offset into the buffer where we are currently writing. We use an offset
662
     * in case the buffer grows and gets reallocated.
663
     */
664
    size_t curr;
665
666
    /* Number of bytes written so far */
667
    size_t written;
668
669
    /* Maximum number of bytes we will allow to be written to this WPACKET */
670
    size_t maxsize;
671
672
    /* Our sub-packets (always at least one if not finished) */
673
    WPACKET_SUB *subs;
674
};
675
676
/* Flags */
677
678
/* Default */
679
#define WPACKET_FLAGS_NONE                      0
680
681
/* Error on WPACKET_close() if no data written to the WPACKET */
682
8.17k
#define WPACKET_FLAGS_NON_ZERO_LENGTH           1
683
684
/*
685
 * Abandon all changes on WPACKET_close() if no data written to the WPACKET,
686
 * i.e. this does not write out a zero packet length
687
 */
688
15.9k
#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
689
690
691
/*
692
 * Initialise a WPACKET with the buffer in |buf|. The buffer must exist
693
 * for the whole time that the WPACKET is being used. Additionally |lenbytes| of
694
 * data is preallocated at the start of the buffer to store the length of the
695
 * WPACKET once we know it.
696
 */
697
int WPACKET_init_len(WPACKET *pkt, BUF_MEM *buf, size_t lenbytes);
698
699
/*
700
 * Same as WPACKET_init_len except there is no preallocation of the WPACKET
701
 * length.
702
 */
703
int WPACKET_init(WPACKET *pkt, BUF_MEM *buf);
704
705
/*
706
 * Same as WPACKET_init_len except we do not use a growable BUF_MEM structure.
707
 * A fixed buffer of memory |buf| of size |len| is used instead. A failure will
708
 * occur if you attempt to write beyond the end of the buffer
709
 */
710
int WPACKET_init_static_len(WPACKET *pkt, unsigned char *buf, size_t len,
711
                            size_t lenbytes);
712
/*
713
 * Set the flags to be applied to the current sub-packet
714
 */
715
int WPACKET_set_flags(WPACKET *pkt, unsigned int flags);
716
717
/*
718
 * Closes the most recent sub-packet. It also writes out the length of the
719
 * packet to the required location (normally the start of the WPACKET) if
720
 * appropriate. The top level WPACKET should be closed using WPACKET_finish()
721
 * instead of this function.
722
 */
723
int WPACKET_close(WPACKET *pkt);
724
725
/*
726
 * The same as WPACKET_close() but only for the top most WPACKET. Additionally
727
 * frees memory resources for this WPACKET.
728
 */
729
int WPACKET_finish(WPACKET *pkt);
730
731
/*
732
 * Iterate through all the sub-packets and write out their lengths as if they
733
 * were being closed. The lengths will be overwritten with the final lengths
734
 * when the sub-packets are eventually closed (which may be different if more
735
 * data is added to the WPACKET). This function fails if a sub-packet is of 0
736
 * length and WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH is set.
737
 */
738
int WPACKET_fill_lengths(WPACKET *pkt);
739
740
/*
741
 * Initialise a new sub-packet. Additionally |lenbytes| of data is preallocated
742
 * at the start of the sub-packet to store its length once we know it. Don't
743
 * call this directly. Use the convenience macros below instead.
744
 */
745
int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes);
746
747
/*
748
 * Convenience macros for calling WPACKET_start_sub_packet_len with different
749
 * lengths
750
 */
751
#define WPACKET_start_sub_packet_u8(pkt) \
752
48.0k
    WPACKET_start_sub_packet_len__((pkt), 1)
753
#define WPACKET_start_sub_packet_u16(pkt) \
754
220k
    WPACKET_start_sub_packet_len__((pkt), 2)
755
#define WPACKET_start_sub_packet_u24(pkt) \
756
12.1k
    WPACKET_start_sub_packet_len__((pkt), 3)
757
#define WPACKET_start_sub_packet_u32(pkt) \
758
    WPACKET_start_sub_packet_len__((pkt), 4)
759
760
/*
761
 * Same as WPACKET_start_sub_packet_len__() except no bytes are pre-allocated
762
 * for the sub-packet length.
763
 */
764
int WPACKET_start_sub_packet(WPACKET *pkt);
765
766
/*
767
 * Allocate bytes in the WPACKET for the output. This reserves the bytes
768
 * and counts them as "written", but doesn't actually do the writing. A pointer
769
 * to the allocated bytes is stored in |*allocbytes|. |allocbytes| may be NULL.
770
 * WARNING: the allocated bytes must be filled in immediately, without further
771
 * WPACKET_* calls. If not then the underlying buffer may be realloc'd and
772
 * change its location.
773
 */
774
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len,
775
                           unsigned char **allocbytes);
776
777
/*
778
 * The same as WPACKET_allocate_bytes() except additionally a new sub-packet is
779
 * started for the allocated bytes, and then closed immediately afterwards. The
780
 * number of length bytes for the sub-packet is in |lenbytes|. Don't call this
781
 * directly. Use the convenience macros below instead.
782
 */
783
int WPACKET_sub_allocate_bytes__(WPACKET *pkt, size_t len,
784
                                 unsigned char **allocbytes, size_t lenbytes);
785
786
/*
787
 * Convenience macros for calling WPACKET_sub_allocate_bytes with different
788
 * lengths
789
 */
790
#define WPACKET_sub_allocate_bytes_u8(pkt, len, bytes) \
791
0
    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 1)
792
#define WPACKET_sub_allocate_bytes_u16(pkt, len, bytes) \
793
1.00k
    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 2)
794
#define WPACKET_sub_allocate_bytes_u24(pkt, len, bytes) \
795
0
    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 3)
796
#define WPACKET_sub_allocate_bytes_u32(pkt, len, bytes) \
797
    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 4)
798
799
/*
800
 * The same as WPACKET_allocate_bytes() except the reserved bytes are not
801
 * actually counted as written. Typically this will be for when we don't know
802
 * how big arbitrary data is going to be up front, but we do know what the
803
 * maximum size will be. If this function is used, then it should be immediately
804
 * followed by a WPACKET_allocate_bytes() call before any other WPACKET
805
 * functions are called (unless the write to the allocated bytes is abandoned).
806
 *
807
 * For example: If we are generating a signature, then the size of that
808
 * signature may not be known in advance. We can use WPACKET_reserve_bytes() to
809
 * handle this:
810
 *
811
 *  if (!WPACKET_sub_reserve_bytes_u16(&pkt, EVP_PKEY_size(pkey), &sigbytes1)
812
 *          || EVP_SignFinal(md_ctx, sigbytes1, &siglen, pkey) <= 0
813
 *          || !WPACKET_sub_allocate_bytes_u16(&pkt, siglen, &sigbytes2)
814
 *          || sigbytes1 != sigbytes2)
815
 *      goto err;
816
 */
817
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes);
818
819
/*
820
 * The "reserve_bytes" equivalent of WPACKET_sub_allocate_bytes__()
821
 */
822
int WPACKET_sub_reserve_bytes__(WPACKET *pkt, size_t len,
823
                                 unsigned char **allocbytes, size_t lenbytes);
824
825
/*
826
 * Convenience macros for  WPACKET_sub_reserve_bytes with different lengths
827
 */
828
#define WPACKET_sub_reserve_bytes_u8(pkt, len, bytes) \
829
    WPACKET_reserve_bytes__((pkt), (len), (bytes), 1)
830
#define WPACKET_sub_reserve_bytes_u16(pkt, len, bytes) \
831
0
    WPACKET_sub_reserve_bytes__((pkt), (len), (bytes), 2)
832
#define WPACKET_sub_reserve_bytes_u24(pkt, len, bytes) \
833
    WPACKET_sub_reserve_bytes__((pkt), (len), (bytes), 3)
834
#define WPACKET_sub_reserve_bytes_u32(pkt, len, bytes) \
835
    WPACKET_sub_reserve_bytes__((pkt), (len), (bytes), 4)
836
837
/*
838
 * Write the value stored in |val| into the WPACKET. The value will consume
839
 * |bytes| amount of storage. An error will occur if |val| cannot be
840
 * accommodated in |bytes| storage, e.g. attempting to write the value 256 into
841
 * 1 byte will fail. Don't call this directly. Use the convenience macros below
842
 * instead.
843
 */
844
int WPACKET_put_bytes__(WPACKET *pkt, uint64_t val, size_t bytes);
845
846
/*
847
 * Convenience macros for calling WPACKET_put_bytes with different
848
 * lengths
849
 */
850
#define WPACKET_put_bytes_u8(pkt, val) \
851
113k
    WPACKET_put_bytes__((pkt), (val), 1)
852
#define WPACKET_put_bytes_u16(pkt, val) \
853
1.37M
    WPACKET_put_bytes__((pkt), (val), 2)
854
#define WPACKET_put_bytes_u24(pkt, val) \
855
0
    WPACKET_put_bytes__((pkt), (val), 3)
856
#define WPACKET_put_bytes_u32(pkt, val) \
857
0
    WPACKET_put_bytes__((pkt), (val), 4)
858
#define WPACKET_put_bytes_u64(pkt, val) \
859
0
    WPACKET_put_bytes__((pkt), (val), 8)
860
861
/* Set a maximum size that we will not allow the WPACKET to grow beyond */
862
int WPACKET_set_max_size(WPACKET *pkt, size_t maxsize);
863
864
/* Copy |len| bytes of data from |*src| into the WPACKET. */
865
int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len);
866
867
/* Set |len| bytes of data to |ch| into the WPACKET. */
868
int WPACKET_memset(WPACKET *pkt, int ch, size_t len);
869
870
/*
871
 * Copy |len| bytes of data from |*src| into the WPACKET and prefix with its
872
 * length (consuming |lenbytes| of data for the length). Don't call this
873
 * directly. Use the convenience macros below instead.
874
 */
875
int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len,
876
                       size_t lenbytes);
877
878
/* Convenience macros for calling WPACKET_sub_memcpy with different lengths */
879
#define WPACKET_sub_memcpy_u8(pkt, src, len) \
880
17.0k
    WPACKET_sub_memcpy__((pkt), (src), (len), 1)
881
#define WPACKET_sub_memcpy_u16(pkt, src, len) \
882
31.3k
    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
883
#define WPACKET_sub_memcpy_u24(pkt, src, len) \
884
0
    WPACKET_sub_memcpy__((pkt), (src), (len), 3)
885
#define WPACKET_sub_memcpy_u32(pkt, src, len) \
886
    WPACKET_sub_memcpy__((pkt), (src), (len), 4)
887
888
/*
889
 * Return the total number of bytes written so far to the underlying buffer
890
 * including any storage allocated for length bytes
891
 */
892
int WPACKET_get_total_written(WPACKET *pkt, size_t *written);
893
894
/*
895
 * Returns the length of the current sub-packet. This excludes any bytes
896
 * allocated for the length itself.
897
 */
898
int WPACKET_get_length(WPACKET *pkt, size_t *len);
899
900
/*
901
 * Returns a pointer to the current write location, but does not allocate any
902
 * bytes.
903
 */
904
unsigned char *WPACKET_get_curr(WPACKET *pkt);
905
906
/* Release resources in a WPACKET if a failure has occurred. */
907
void WPACKET_cleanup(WPACKET *pkt);
908
909
#endif                          /* OSSL_SSL_PACKET_LOCAL_H */