/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 | 1.90M | { |
31 | 1.90M | pkt->curr += len; |
32 | 1.90M | pkt->remaining -= len; |
33 | 1.90M | } Unexecuted instantiation: methods.c:packet_forward Unexecuted instantiation: rec_layer_d1.c:packet_forward rec_layer_s3.c:packet_forward Line | Count | Source | 30 | 3.77k | { | 31 | 3.77k | pkt->curr += len; | 32 | 3.77k | pkt->remaining -= len; | 33 | 3.77k | } |
Unexecuted instantiation: ssl3_buffer.c:packet_forward ssl3_record.c:packet_forward Line | Count | Source | 30 | 533k | { | 31 | 533k | pkt->curr += len; | 32 | 533k | pkt->remaining -= len; | 33 | 533k | } |
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 Line | Count | Source | 30 | 351k | { | 31 | 351k | pkt->curr += len; | 32 | 351k | pkt->remaining -= len; | 33 | 351k | } |
Unexecuted instantiation: ssl_mcnf.c:packet_forward Unexecuted instantiation: ssl_rsa.c:packet_forward Unexecuted instantiation: ssl_sess.c:packet_forward extensions.c:packet_forward Line | Count | Source | 30 | 340k | { | 31 | 340k | pkt->curr += len; | 32 | 340k | pkt->remaining -= len; | 33 | 340k | } |
extensions_clnt.c:packet_forward Line | Count | Source | 30 | 53.4k | { | 31 | 53.4k | pkt->curr += len; | 32 | 53.4k | pkt->remaining -= len; | 33 | 53.4k | } |
Unexecuted instantiation: extensions_cust.c:packet_forward extensions_srvr.c:packet_forward Line | Count | Source | 30 | 74.6k | { | 31 | 74.6k | pkt->curr += len; | 32 | 74.6k | pkt->remaining -= len; | 33 | 74.6k | } |
Unexecuted instantiation: statem.c:packet_forward statem_clnt.c:packet_forward Line | Count | Source | 30 | 251k | { | 31 | 251k | pkt->curr += len; | 32 | 251k | pkt->remaining -= len; | 33 | 251k | } |
Unexecuted instantiation: statem_dtls.c:packet_forward statem_lib.c:packet_forward Line | Count | Source | 30 | 30.3k | { | 31 | 30.3k | pkt->curr += len; | 32 | 30.3k | pkt->remaining -= len; | 33 | 30.3k | } |
statem_srvr.c:packet_forward Line | Count | Source | 30 | 148k | { | 31 | 148k | pkt->curr += len; | 32 | 148k | pkt->remaining -= len; | 33 | 148k | } |
Line | Count | Source | 30 | 117k | { | 31 | 117k | pkt->curr += len; | 32 | 117k | pkt->remaining -= len; | 33 | 117k | } |
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: t1_enc.c:packet_forward Unexecuted instantiation: ssl_txt.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 | 2.59M | { |
40 | 2.59M | return pkt->remaining; |
41 | 2.59M | } Unexecuted instantiation: methods.c:PACKET_remaining Unexecuted instantiation: rec_layer_d1.c:PACKET_remaining rec_layer_s3.c:PACKET_remaining Line | Count | Source | 39 | 5.71k | { | 40 | 5.71k | return pkt->remaining; | 41 | 5.71k | } |
Unexecuted instantiation: ssl3_buffer.c:PACKET_remaining ssl3_record.c:PACKET_remaining Line | Count | Source | 39 | 533k | { | 40 | 533k | return pkt->remaining; | 41 | 533k | } |
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 ssl_lib.c:PACKET_remaining Line | Count | Source | 39 | 524k | { | 40 | 524k | return pkt->remaining; | 41 | 524k | } |
Unexecuted instantiation: ssl_mcnf.c:PACKET_remaining Unexecuted instantiation: ssl_rsa.c:PACKET_remaining Unexecuted instantiation: ssl_sess.c:PACKET_remaining extensions.c:PACKET_remaining Line | Count | Source | 39 | 489k | { | 40 | 489k | return pkt->remaining; | 41 | 489k | } |
extensions_clnt.c:PACKET_remaining Line | Count | Source | 39 | 83.8k | { | 40 | 83.8k | return pkt->remaining; | 41 | 83.8k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_remaining extensions_srvr.c:PACKET_remaining Line | Count | Source | 39 | 148k | { | 40 | 148k | return pkt->remaining; | 41 | 148k | } |
Unexecuted instantiation: statem.c:PACKET_remaining statem_clnt.c:PACKET_remaining Line | Count | Source | 39 | 424k | { | 40 | 424k | return pkt->remaining; | 41 | 424k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_remaining statem_lib.c:PACKET_remaining Line | Count | Source | 39 | 46.8k | { | 40 | 46.8k | return pkt->remaining; | 41 | 46.8k | } |
statem_srvr.c:PACKET_remaining Line | Count | Source | 39 | 207k | { | 40 | 207k | return pkt->remaining; | 41 | 207k | } |
t1_lib.c:PACKET_remaining Line | Count | Source | 39 | 128k | { | 40 | 128k | return pkt->remaining; | 41 | 128k | } |
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: t1_enc.c:PACKET_remaining Unexecuted instantiation: ssl_txt.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 | 86 | { |
51 | 86 | return pkt->curr + pkt->remaining; |
52 | 86 | } 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_rsa.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 extensions_srvr.c:PACKET_end Line | Count | Source | 50 | 86 | { | 51 | 86 | return pkt->curr + pkt->remaining; | 52 | 86 | } |
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: t1_enc.c:PACKET_end Unexecuted instantiation: ssl_txt.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 | 52.5k | { |
60 | 52.5k | return pkt->curr; |
61 | 52.5k | } 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_rsa.c:PACKET_data Unexecuted instantiation: ssl_sess.c:PACKET_data Line | Count | Source | 59 | 1.66k | { | 60 | 1.66k | return pkt->curr; | 61 | 1.66k | } |
extensions_clnt.c:PACKET_data Line | Count | Source | 59 | 331 | { | 60 | 331 | return pkt->curr; | 61 | 331 | } |
Unexecuted instantiation: extensions_cust.c:PACKET_data extensions_srvr.c:PACKET_data Line | Count | Source | 59 | 4.21k | { | 60 | 4.21k | return pkt->curr; | 61 | 4.21k | } |
Unexecuted instantiation: statem.c:PACKET_data statem_clnt.c:PACKET_data Line | Count | Source | 59 | 40.4k | { | 60 | 40.4k | return pkt->curr; | 61 | 40.4k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_data Line | Count | Source | 59 | 1.09k | { | 60 | 1.09k | return pkt->curr; | 61 | 1.09k | } |
statem_srvr.c:PACKET_data Line | Count | Source | 59 | 3.52k | { | 60 | 3.52k | return pkt->curr; | 61 | 3.52k | } |
Line | Count | Source | 59 | 1.23k | { | 60 | 1.23k | return pkt->curr; | 61 | 1.23k | } |
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: t1_enc.c:PACKET_data Unexecuted instantiation: ssl_txt.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 | 198k | { |
72 | | /* Sanity check for negative values. */ |
73 | 198k | if (len > (size_t)(SIZE_MAX / 2)) |
74 | 0 | return 0; |
75 | | |
76 | 198k | pkt->curr = buf; |
77 | 198k | pkt->remaining = len; |
78 | 198k | return 1; |
79 | 198k | } 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 | 1.94k | { | 72 | | /* Sanity check for negative values. */ | 73 | 1.94k | if (len > (size_t)(SIZE_MAX / 2)) | 74 | 0 | return 0; | 75 | | | 76 | 1.94k | pkt->curr = buf; | 77 | 1.94k | pkt->remaining = len; | 78 | 1.94k | return 1; | 79 | 1.94k | } |
Unexecuted instantiation: ssl3_buffer.c:PACKET_buf_init ssl3_record.c:PACKET_buf_init Line | Count | Source | 71 | 108k | { | 72 | | /* Sanity check for negative values. */ | 73 | 108k | if (len > (size_t)(SIZE_MAX / 2)) | 74 | 0 | return 0; | 75 | | | 76 | 108k | pkt->curr = buf; | 77 | 108k | pkt->remaining = len; | 78 | 108k | return 1; | 79 | 108k | } |
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_rsa.c:PACKET_buf_init Unexecuted instantiation: ssl_sess.c:PACKET_buf_init extensions.c:PACKET_buf_init Line | Count | Source | 71 | 6 | { | 72 | | /* Sanity check for negative values. */ | 73 | 6 | if (len > (size_t)(SIZE_MAX / 2)) | 74 | 0 | return 0; | 75 | | | 76 | 6 | pkt->curr = buf; | 77 | 6 | pkt->remaining = len; | 78 | 6 | return 1; | 79 | 6 | } |
Unexecuted instantiation: extensions_clnt.c:PACKET_buf_init Unexecuted instantiation: extensions_cust.c:PACKET_buf_init Unexecuted instantiation: extensions_srvr.c:PACKET_buf_init Line | Count | Source | 71 | 73.5k | { | 72 | | /* Sanity check for negative values. */ | 73 | 73.5k | if (len > (size_t)(SIZE_MAX / 2)) | 74 | 0 | return 0; | 75 | | | 76 | 73.5k | pkt->curr = buf; | 77 | 73.5k | pkt->remaining = len; | 78 | 73.5k | return 1; | 79 | 73.5k | } |
statem_clnt.c:PACKET_buf_init Line | Count | Source | 71 | 2.29k | { | 72 | | /* Sanity check for negative values. */ | 73 | 2.29k | if (len > (size_t)(SIZE_MAX / 2)) | 74 | 0 | return 0; | 75 | | | 76 | 2.29k | pkt->curr = buf; | 77 | 2.29k | pkt->remaining = len; | 78 | 2.29k | return 1; | 79 | 2.29k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_buf_init Unexecuted instantiation: statem_lib.c:PACKET_buf_init statem_srvr.c:PACKET_buf_init Line | Count | Source | 71 | 12.6k | { | 72 | | /* Sanity check for negative values. */ | 73 | 12.6k | if (len > (size_t)(SIZE_MAX / 2)) | 74 | 0 | return 0; | 75 | | | 76 | 12.6k | pkt->curr = buf; | 77 | 12.6k | pkt->remaining = len; | 78 | 12.6k | return 1; | 79 | 12.6k | } |
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: t1_enc.c:PACKET_buf_init Unexecuted instantiation: ssl_txt.c:PACKET_buf_init |
80 | | |
81 | | /* Initialize a PACKET to hold zero bytes. */ |
82 | | static ossl_inline void PACKET_null_init(PACKET *pkt) |
83 | 20.7k | { |
84 | 20.7k | pkt->curr = NULL; |
85 | 20.7k | pkt->remaining = 0; |
86 | 20.7k | } 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_rsa.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 | 1.08k | { | 84 | 1.08k | pkt->curr = NULL; | 85 | 1.08k | pkt->remaining = 0; | 86 | 1.08k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_null_init Unexecuted instantiation: statem_lib.c:PACKET_null_init statem_srvr.c:PACKET_null_init Line | Count | Source | 83 | 19.6k | { | 84 | 19.6k | pkt->curr = NULL; | 85 | 19.6k | pkt->remaining = 0; | 86 | 19.6k | } |
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: t1_enc.c:PACKET_null_init Unexecuted instantiation: ssl_txt.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 | 3 | { |
96 | 3 | if (PACKET_remaining(pkt) != num) |
97 | 3 | return 0; |
98 | 0 | return CRYPTO_memcmp(pkt->curr, ptr, num) == 0; |
99 | 3 | } 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_rsa.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 extensions_srvr.c:PACKET_equal Line | Count | Source | 95 | 3 | { | 96 | 3 | if (PACKET_remaining(pkt) != num) | 97 | 3 | return 0; | 98 | 0 | return CRYPTO_memcmp(pkt->curr, ptr, num) == 0; | 99 | 3 | } |
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: t1_enc.c:PACKET_equal Unexecuted instantiation: ssl_txt.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 | 10.9k | { |
109 | 10.9k | if (PACKET_remaining(pkt) < len) |
110 | 92 | return 0; |
111 | | |
112 | 10.8k | return PACKET_buf_init(subpkt, pkt->curr, len); |
113 | 10.9k | } 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_rsa.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 | 2.29k | { | 109 | 2.29k | if (PACKET_remaining(pkt) < len) | 110 | 0 | return 0; | 111 | | | 112 | 2.29k | return PACKET_buf_init(subpkt, pkt->curr, len); | 113 | 2.29k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_peek_sub_packet Unexecuted instantiation: statem_lib.c:PACKET_peek_sub_packet statem_srvr.c:PACKET_peek_sub_packet Line | Count | Source | 108 | 8.62k | { | 109 | 8.62k | if (PACKET_remaining(pkt) < len) | 110 | 92 | return 0; | 111 | | | 112 | 8.53k | return PACKET_buf_init(subpkt, pkt->curr, len); | 113 | 8.62k | } |
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: t1_enc.c:PACKET_peek_sub_packet Unexecuted instantiation: ssl_txt.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 | 10.9k | { |
123 | 10.9k | if (!PACKET_peek_sub_packet(pkt, subpkt, len)) |
124 | 92 | return 0; |
125 | | |
126 | 10.8k | packet_forward(pkt, len); |
127 | | |
128 | 10.8k | return 1; |
129 | 10.9k | } 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_rsa.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 | 2.29k | { | 123 | 2.29k | if (!PACKET_peek_sub_packet(pkt, subpkt, len)) | 124 | 0 | return 0; | 125 | | | 126 | 2.29k | packet_forward(pkt, len); | 127 | | | 128 | 2.29k | return 1; | 129 | 2.29k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_get_sub_packet Unexecuted instantiation: statem_lib.c:PACKET_get_sub_packet statem_srvr.c:PACKET_get_sub_packet Line | Count | Source | 122 | 8.62k | { | 123 | 8.62k | if (!PACKET_peek_sub_packet(pkt, subpkt, len)) | 124 | 92 | return 0; | 125 | | | 126 | 8.53k | packet_forward(pkt, len); | 127 | | | 128 | 8.53k | return 1; | 129 | 8.62k | } |
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: t1_enc.c:PACKET_get_sub_packet Unexecuted instantiation: ssl_txt.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 | 829k | { |
138 | 829k | if (PACKET_remaining(pkt) < 2) |
139 | 3.53k | return 0; |
140 | | |
141 | 825k | *data = ((unsigned int)(*pkt->curr)) << 8; |
142 | 825k | *data |= *(pkt->curr + 1); |
143 | | |
144 | 825k | return 1; |
145 | 829k | } 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 | 319k | { | 138 | 319k | if (PACKET_remaining(pkt) < 2) | 139 | 0 | return 0; | 140 | | | 141 | 319k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 319k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 319k | return 1; | 145 | 319k | } |
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_rsa.c:PACKET_peek_net_2 Unexecuted instantiation: ssl_sess.c:PACKET_peek_net_2 extensions.c:PACKET_peek_net_2 Line | Count | Source | 137 | 227k | { | 138 | 227k | if (PACKET_remaining(pkt) < 2) | 139 | 39 | return 0; | 140 | | | 141 | 226k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 226k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 226k | return 1; | 145 | 227k | } |
extensions_clnt.c:PACKET_peek_net_2 Line | Count | Source | 137 | 1.81k | { | 138 | 1.81k | if (PACKET_remaining(pkt) < 2) | 139 | 66 | return 0; | 140 | | | 141 | 1.75k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 1.75k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 1.75k | return 1; | 145 | 1.81k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_peek_net_2 extensions_srvr.c:PACKET_peek_net_2 Line | Count | Source | 137 | 28.6k | { | 138 | 28.6k | if (PACKET_remaining(pkt) < 2) | 139 | 85 | return 0; | 140 | | | 141 | 28.5k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 28.5k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 28.5k | return 1; | 145 | 28.6k | } |
Unexecuted instantiation: statem.c:PACKET_peek_net_2 statem_clnt.c:PACKET_peek_net_2 Line | Count | Source | 137 | 61.0k | { | 138 | 61.0k | if (PACKET_remaining(pkt) < 2) | 139 | 65 | return 0; | 140 | | | 141 | 60.9k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 60.9k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 60.9k | return 1; | 145 | 61.0k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_peek_net_2 statem_lib.c:PACKET_peek_net_2 Line | Count | Source | 137 | 24.3k | { | 138 | 24.3k | if (PACKET_remaining(pkt) < 2) | 139 | 3.24k | return 0; | 140 | | | 141 | 21.1k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 21.1k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 21.1k | return 1; | 145 | 24.3k | } |
statem_srvr.c:PACKET_peek_net_2 Line | Count | Source | 137 | 49.4k | { | 138 | 49.4k | if (PACKET_remaining(pkt) < 2) | 139 | 29 | return 0; | 140 | | | 141 | 49.4k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 49.4k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 49.4k | return 1; | 145 | 49.4k | } |
t1_lib.c:PACKET_peek_net_2 Line | Count | Source | 137 | 117k | { | 138 | 117k | if (PACKET_remaining(pkt) < 2) | 139 | 0 | return 0; | 140 | | | 141 | 117k | *data = ((unsigned int)(*pkt->curr)) << 8; | 142 | 117k | *data |= *(pkt->curr + 1); | 143 | | | 144 | 117k | return 1; | 145 | 117k | } |
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: t1_enc.c:PACKET_peek_net_2 Unexecuted instantiation: ssl_txt.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 | 829k | { |
151 | 829k | if (!PACKET_peek_net_2(pkt, data)) |
152 | 3.53k | return 0; |
153 | | |
154 | 825k | packet_forward(pkt, 2); |
155 | | |
156 | 825k | return 1; |
157 | 829k | } 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 | 319k | { | 151 | 319k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 0 | return 0; | 153 | | | 154 | 319k | packet_forward(pkt, 2); | 155 | | | 156 | 319k | return 1; | 157 | 319k | } |
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_rsa.c:PACKET_get_net_2 Unexecuted instantiation: ssl_sess.c:PACKET_get_net_2 extensions.c:PACKET_get_net_2 Line | Count | Source | 150 | 227k | { | 151 | 227k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 39 | return 0; | 153 | | | 154 | 226k | packet_forward(pkt, 2); | 155 | | | 156 | 226k | return 1; | 157 | 227k | } |
extensions_clnt.c:PACKET_get_net_2 Line | Count | Source | 150 | 1.81k | { | 151 | 1.81k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 66 | return 0; | 153 | | | 154 | 1.75k | packet_forward(pkt, 2); | 155 | | | 156 | 1.75k | return 1; | 157 | 1.81k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_get_net_2 extensions_srvr.c:PACKET_get_net_2 Line | Count | Source | 150 | 28.6k | { | 151 | 28.6k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 85 | return 0; | 153 | | | 154 | 28.5k | packet_forward(pkt, 2); | 155 | | | 156 | 28.5k | return 1; | 157 | 28.6k | } |
Unexecuted instantiation: statem.c:PACKET_get_net_2 statem_clnt.c:PACKET_get_net_2 Line | Count | Source | 150 | 61.0k | { | 151 | 61.0k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 65 | return 0; | 153 | | | 154 | 60.9k | packet_forward(pkt, 2); | 155 | | | 156 | 60.9k | return 1; | 157 | 61.0k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_get_net_2 statem_lib.c:PACKET_get_net_2 Line | Count | Source | 150 | 24.3k | { | 151 | 24.3k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 3.24k | return 0; | 153 | | | 154 | 21.1k | packet_forward(pkt, 2); | 155 | | | 156 | 21.1k | return 1; | 157 | 24.3k | } |
statem_srvr.c:PACKET_get_net_2 Line | Count | Source | 150 | 49.4k | { | 151 | 49.4k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 29 | return 0; | 153 | | | 154 | 49.4k | packet_forward(pkt, 2); | 155 | | | 156 | 49.4k | return 1; | 157 | 49.4k | } |
t1_lib.c:PACKET_get_net_2 Line | Count | Source | 150 | 117k | { | 151 | 117k | if (!PACKET_peek_net_2(pkt, data)) | 152 | 0 | return 0; | 153 | | | 154 | 117k | packet_forward(pkt, 2); | 155 | | | 156 | 117k | return 1; | 157 | 117k | } |
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: t1_enc.c:PACKET_get_net_2 Unexecuted instantiation: ssl_txt.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 | 213k | { |
162 | 213k | unsigned int i; |
163 | 213k | int ret = PACKET_get_net_2(pkt, &i); |
164 | | |
165 | 213k | if (ret) |
166 | 213k | *data = (size_t)i; |
167 | | |
168 | 213k | return ret; |
169 | 213k | } 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 | 213k | { | 162 | 213k | unsigned int i; | 163 | 213k | int ret = PACKET_get_net_2(pkt, &i); | 164 | | | 165 | 213k | if (ret) | 166 | 213k | *data = (size_t)i; | 167 | | | 168 | 213k | return ret; | 169 | 213k | } |
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_rsa.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: t1_enc.c:PACKET_get_net_2_len Unexecuted instantiation: ssl_txt.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 | 25.0k | { |
178 | 25.0k | if (PACKET_remaining(pkt) < 3) |
179 | 8 | return 0; |
180 | | |
181 | 25.0k | *data = ((unsigned long)(*pkt->curr)) << 16; |
182 | 25.0k | *data |= ((unsigned long)(*(pkt->curr + 1))) << 8; |
183 | 25.0k | *data |= *(pkt->curr + 2); |
184 | | |
185 | 25.0k | return 1; |
186 | 25.0k | } 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_rsa.c:PACKET_peek_net_3 Unexecuted instantiation: ssl_sess.c:PACKET_peek_net_3 extensions.c:PACKET_peek_net_3 Line | Count | Source | 177 | 12 | { | 178 | 12 | if (PACKET_remaining(pkt) < 3) | 179 | 0 | return 0; | 180 | | | 181 | 12 | *data = ((unsigned long)(*pkt->curr)) << 16; | 182 | 12 | *data |= ((unsigned long)(*(pkt->curr + 1))) << 8; | 183 | 12 | *data |= *(pkt->curr + 2); | 184 | | | 185 | 12 | return 1; | 186 | 12 | } |
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 | 25.0k | { | 178 | 25.0k | if (PACKET_remaining(pkt) < 3) | 179 | 8 | return 0; | 180 | | | 181 | 25.0k | *data = ((unsigned long)(*pkt->curr)) << 16; | 182 | 25.0k | *data |= ((unsigned long)(*(pkt->curr + 1))) << 8; | 183 | 25.0k | *data |= *(pkt->curr + 2); | 184 | | | 185 | 25.0k | return 1; | 186 | 25.0k | } |
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: t1_enc.c:PACKET_peek_net_3 Unexecuted instantiation: ssl_txt.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 | 25.0k | { |
192 | 25.0k | if (!PACKET_peek_net_3(pkt, data)) |
193 | 8 | return 0; |
194 | | |
195 | 25.0k | packet_forward(pkt, 3); |
196 | | |
197 | 25.0k | return 1; |
198 | 25.0k | } 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_rsa.c:PACKET_get_net_3 Unexecuted instantiation: ssl_sess.c:PACKET_get_net_3 extensions.c:PACKET_get_net_3 Line | Count | Source | 191 | 12 | { | 192 | 12 | if (!PACKET_peek_net_3(pkt, data)) | 193 | 0 | return 0; | 194 | | | 195 | 12 | packet_forward(pkt, 3); | 196 | | | 197 | 12 | return 1; | 198 | 12 | } |
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 | 25.0k | { | 192 | 25.0k | if (!PACKET_peek_net_3(pkt, data)) | 193 | 8 | return 0; | 194 | | | 195 | 25.0k | packet_forward(pkt, 3); | 196 | | | 197 | 25.0k | return 1; | 198 | 25.0k | } |
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: t1_enc.c:PACKET_get_net_3 Unexecuted instantiation: ssl_txt.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_rsa.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: t1_enc.c:PACKET_get_net_3_len Unexecuted instantiation: ssl_txt.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 | 690 | { |
219 | 690 | if (PACKET_remaining(pkt) < 4) |
220 | 20 | return 0; |
221 | | |
222 | 670 | *data = ((unsigned long)(*pkt->curr)) << 24; |
223 | 670 | *data |= ((unsigned long)(*(pkt->curr + 1))) << 16; |
224 | 670 | *data |= ((unsigned long)(*(pkt->curr + 2))) << 8; |
225 | 670 | *data |= *(pkt->curr + 3); |
226 | | |
227 | 670 | return 1; |
228 | 690 | } 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_rsa.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 extensions_srvr.c:PACKET_peek_net_4 Line | Count | Source | 218 | 481 | { | 219 | 481 | if (PACKET_remaining(pkt) < 4) | 220 | 9 | return 0; | 221 | | | 222 | 472 | *data = ((unsigned long)(*pkt->curr)) << 24; | 223 | 472 | *data |= ((unsigned long)(*(pkt->curr + 1))) << 16; | 224 | 472 | *data |= ((unsigned long)(*(pkt->curr + 2))) << 8; | 225 | 472 | *data |= *(pkt->curr + 3); | 226 | | | 227 | 472 | return 1; | 228 | 481 | } |
Unexecuted instantiation: statem.c:PACKET_peek_net_4 statem_clnt.c:PACKET_peek_net_4 Line | Count | Source | 218 | 209 | { | 219 | 209 | if (PACKET_remaining(pkt) < 4) | 220 | 11 | return 0; | 221 | | | 222 | 198 | *data = ((unsigned long)(*pkt->curr)) << 24; | 223 | 198 | *data |= ((unsigned long)(*(pkt->curr + 1))) << 16; | 224 | 198 | *data |= ((unsigned long)(*(pkt->curr + 2))) << 8; | 225 | 198 | *data |= *(pkt->curr + 3); | 226 | | | 227 | 198 | return 1; | 228 | 209 | } |
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: t1_enc.c:PACKET_peek_net_4 Unexecuted instantiation: ssl_txt.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_rsa.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: t1_enc.c:PACKET_peek_net_8 Unexecuted instantiation: ssl_txt.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 | 690 | { |
256 | 690 | if (!PACKET_peek_net_4(pkt, data)) |
257 | 20 | return 0; |
258 | | |
259 | 670 | packet_forward(pkt, 4); |
260 | | |
261 | 670 | return 1; |
262 | 690 | } 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_rsa.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 extensions_srvr.c:PACKET_get_net_4 Line | Count | Source | 255 | 481 | { | 256 | 481 | if (!PACKET_peek_net_4(pkt, data)) | 257 | 9 | return 0; | 258 | | | 259 | 472 | packet_forward(pkt, 4); | 260 | | | 261 | 472 | return 1; | 262 | 481 | } |
Unexecuted instantiation: statem.c:PACKET_get_net_4 statem_clnt.c:PACKET_get_net_4 Line | Count | Source | 255 | 209 | { | 256 | 209 | if (!PACKET_peek_net_4(pkt, data)) | 257 | 11 | return 0; | 258 | | | 259 | 198 | packet_forward(pkt, 4); | 260 | | | 261 | 198 | return 1; | 262 | 209 | } |
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: t1_enc.c:PACKET_get_net_4 Unexecuted instantiation: ssl_txt.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_rsa.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: t1_enc.c:PACKET_get_net_4_len Unexecuted instantiation: ssl_txt.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_rsa.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: t1_enc.c:PACKET_get_net_8 Unexecuted instantiation: ssl_txt.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 | 402k | { |
291 | 402k | if (!PACKET_remaining(pkt)) |
292 | 1.72k | return 0; |
293 | | |
294 | 400k | *data = *pkt->curr; |
295 | | |
296 | 400k | return 1; |
297 | 402k | } 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 | 3.84k | { | 291 | 3.84k | if (!PACKET_remaining(pkt)) | 292 | 73 | return 0; | 293 | | | 294 | 3.77k | *data = *pkt->curr; | 295 | | | 296 | 3.77k | return 1; | 297 | 3.84k | } |
Unexecuted instantiation: ssl3_buffer.c:PACKET_peek_1 ssl3_record.c:PACKET_peek_1 Line | Count | Source | 290 | 213k | { | 291 | 213k | if (!PACKET_remaining(pkt)) | 292 | 0 | return 0; | 293 | | | 294 | 213k | *data = *pkt->curr; | 295 | | | 296 | 213k | return 1; | 297 | 213k | } |
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 Line | Count | Source | 290 | 70.8k | { | 291 | 70.8k | if (!PACKET_remaining(pkt)) | 292 | 0 | return 0; | 293 | | | 294 | 70.8k | *data = *pkt->curr; | 295 | | | 296 | 70.8k | return 1; | 297 | 70.8k | } |
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_1 Unexecuted instantiation: ssl_rsa.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 | 17.1k | { | 291 | 17.1k | if (!PACKET_remaining(pkt)) | 292 | 11 | return 0; | 293 | | | 294 | 17.1k | *data = *pkt->curr; | 295 | | | 296 | 17.1k | return 1; | 297 | 17.1k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_peek_1 extensions_srvr.c:PACKET_peek_1 Line | Count | Source | 290 | 16.6k | { | 291 | 16.6k | if (!PACKET_remaining(pkt)) | 292 | 1.33k | return 0; | 293 | | | 294 | 15.3k | *data = *pkt->curr; | 295 | | | 296 | 15.3k | return 1; | 297 | 16.6k | } |
Unexecuted instantiation: statem.c:PACKET_peek_1 statem_clnt.c:PACKET_peek_1 Line | Count | Source | 290 | 49.5k | { | 291 | 49.5k | if (!PACKET_remaining(pkt)) | 292 | 291 | return 0; | 293 | | | 294 | 49.2k | *data = *pkt->curr; | 295 | | | 296 | 49.2k | return 1; | 297 | 49.5k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_peek_1 statem_lib.c:PACKET_peek_1 Line | Count | Source | 290 | 3.22k | { | 291 | 3.22k | if (!PACKET_remaining(pkt)) | 292 | 9 | return 0; | 293 | | | 294 | 3.21k | *data = *pkt->curr; | 295 | | | 296 | 3.21k | return 1; | 297 | 3.22k | } |
statem_srvr.c:PACKET_peek_1 Line | Count | Source | 290 | 27.5k | { | 291 | 27.5k | if (!PACKET_remaining(pkt)) | 292 | 8 | return 0; | 293 | | | 294 | 27.5k | *data = *pkt->curr; | 295 | | | 296 | 27.5k | return 1; | 297 | 27.5k | } |
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: t1_enc.c:PACKET_peek_1 Unexecuted instantiation: ssl_txt.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 | 402k | { |
302 | 402k | if (!PACKET_peek_1(pkt, data)) |
303 | 1.72k | return 0; |
304 | | |
305 | 400k | packet_forward(pkt, 1); |
306 | | |
307 | 400k | return 1; |
308 | 402k | } 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 | 3.84k | { | 302 | 3.84k | if (!PACKET_peek_1(pkt, data)) | 303 | 73 | return 0; | 304 | | | 305 | 3.77k | packet_forward(pkt, 1); | 306 | | | 307 | 3.77k | return 1; | 308 | 3.84k | } |
Unexecuted instantiation: ssl3_buffer.c:PACKET_get_1 ssl3_record.c:PACKET_get_1 Line | Count | Source | 301 | 213k | { | 302 | 213k | if (!PACKET_peek_1(pkt, data)) | 303 | 0 | return 0; | 304 | | | 305 | 213k | packet_forward(pkt, 1); | 306 | | | 307 | 213k | return 1; | 308 | 213k | } |
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 Line | Count | Source | 301 | 70.8k | { | 302 | 70.8k | if (!PACKET_peek_1(pkt, data)) | 303 | 0 | return 0; | 304 | | | 305 | 70.8k | packet_forward(pkt, 1); | 306 | | | 307 | 70.8k | return 1; | 308 | 70.8k | } |
Unexecuted instantiation: ssl_mcnf.c:PACKET_get_1 Unexecuted instantiation: ssl_rsa.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 | 17.1k | { | 302 | 17.1k | if (!PACKET_peek_1(pkt, data)) | 303 | 11 | return 0; | 304 | | | 305 | 17.1k | packet_forward(pkt, 1); | 306 | | | 307 | 17.1k | return 1; | 308 | 17.1k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_get_1 extensions_srvr.c:PACKET_get_1 Line | Count | Source | 301 | 16.6k | { | 302 | 16.6k | if (!PACKET_peek_1(pkt, data)) | 303 | 1.33k | return 0; | 304 | | | 305 | 15.3k | packet_forward(pkt, 1); | 306 | | | 307 | 15.3k | return 1; | 308 | 16.6k | } |
Unexecuted instantiation: statem.c:PACKET_get_1 statem_clnt.c:PACKET_get_1 Line | Count | Source | 301 | 49.5k | { | 302 | 49.5k | if (!PACKET_peek_1(pkt, data)) | 303 | 291 | return 0; | 304 | | | 305 | 49.2k | packet_forward(pkt, 1); | 306 | | | 307 | 49.2k | return 1; | 308 | 49.5k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_get_1 statem_lib.c:PACKET_get_1 Line | Count | Source | 301 | 3.22k | { | 302 | 3.22k | if (!PACKET_peek_1(pkt, data)) | 303 | 9 | return 0; | 304 | | | 305 | 3.21k | packet_forward(pkt, 1); | 306 | | | 307 | 3.21k | return 1; | 308 | 3.22k | } |
statem_srvr.c:PACKET_get_1 Line | Count | Source | 301 | 27.5k | { | 302 | 27.5k | if (!PACKET_peek_1(pkt, data)) | 303 | 8 | return 0; | 304 | | | 305 | 27.5k | packet_forward(pkt, 1); | 306 | | | 307 | 27.5k | return 1; | 308 | 27.5k | } |
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: t1_enc.c:PACKET_get_1 Unexecuted instantiation: ssl_txt.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 | 15.1k | { |
313 | 15.1k | unsigned int i; |
314 | 15.1k | int ret = PACKET_get_1(pkt, &i); |
315 | | |
316 | 15.1k | if (ret) |
317 | 15.1k | *data = (size_t)i; |
318 | | |
319 | 15.1k | return ret; |
320 | 15.1k | } 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_rsa.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 | 15.1k | { | 313 | 15.1k | unsigned int i; | 314 | 15.1k | int ret = PACKET_get_1(pkt, &i); | 315 | | | 316 | 15.1k | if (ret) | 317 | 15.1k | *data = (size_t)i; | 318 | | | 319 | 15.1k | return ret; | 320 | 15.1k | } |
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: t1_enc.c:PACKET_get_1_len Unexecuted instantiation: ssl_txt.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_rsa.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: t1_enc.c:PACKET_peek_4 Unexecuted instantiation: ssl_txt.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_rsa.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: t1_enc.c:PACKET_get_4 Unexecuted instantiation: ssl_txt.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 | 321k | { |
365 | 321k | if (PACKET_remaining(pkt) < len) |
366 | 1.68k | return 0; |
367 | | |
368 | 320k | *data = pkt->curr; |
369 | | |
370 | 320k | return 1; |
371 | 321k | } 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_rsa.c:PACKET_peek_bytes Unexecuted instantiation: ssl_sess.c:PACKET_peek_bytes extensions.c:PACKET_peek_bytes Line | Count | Source | 364 | 113k | { | 365 | 113k | if (PACKET_remaining(pkt) < len) | 366 | 108 | return 0; | 367 | | | 368 | 113k | *data = pkt->curr; | 369 | | | 370 | 113k | return 1; | 371 | 113k | } |
extensions_clnt.c:PACKET_peek_bytes Line | Count | Source | 364 | 32.6k | { | 365 | 32.6k | if (PACKET_remaining(pkt) < len) | 366 | 75 | return 0; | 367 | | | 368 | 32.5k | *data = pkt->curr; | 369 | | | 370 | 32.5k | return 1; | 371 | 32.6k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_peek_bytes extensions_srvr.c:PACKET_peek_bytes Line | Count | Source | 364 | 30.9k | { | 365 | 30.9k | if (PACKET_remaining(pkt) < len) | 366 | 659 | return 0; | 367 | | | 368 | 30.3k | *data = pkt->curr; | 369 | | | 370 | 30.3k | return 1; | 371 | 30.9k | } |
Unexecuted instantiation: statem.c:PACKET_peek_bytes statem_clnt.c:PACKET_peek_bytes Line | Count | Source | 364 | 94.0k | { | 365 | 94.0k | if (PACKET_remaining(pkt) < len) | 366 | 411 | return 0; | 367 | | | 368 | 93.6k | *data = pkt->curr; | 369 | | | 370 | 93.6k | return 1; | 371 | 94.0k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_peek_bytes statem_lib.c:PACKET_peek_bytes Line | Count | Source | 364 | 6.30k | { | 365 | 6.30k | if (PACKET_remaining(pkt) < len) | 366 | 282 | return 0; | 367 | | | 368 | 6.02k | *data = pkt->curr; | 369 | | | 370 | 6.02k | return 1; | 371 | 6.30k | } |
statem_srvr.c:PACKET_peek_bytes Line | Count | Source | 364 | 44.3k | { | 365 | 44.3k | if (PACKET_remaining(pkt) < len) | 366 | 150 | return 0; | 367 | | | 368 | 44.2k | *data = pkt->curr; | 369 | | | 370 | 44.2k | return 1; | 371 | 44.3k | } |
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: t1_enc.c:PACKET_peek_bytes Unexecuted instantiation: ssl_txt.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 | 321k | { |
383 | 321k | if (!PACKET_peek_bytes(pkt, data, len)) |
384 | 1.68k | return 0; |
385 | | |
386 | 320k | packet_forward(pkt, len); |
387 | | |
388 | 320k | return 1; |
389 | 321k | } 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_rsa.c:PACKET_get_bytes Unexecuted instantiation: ssl_sess.c:PACKET_get_bytes extensions.c:PACKET_get_bytes Line | Count | Source | 382 | 113k | { | 383 | 113k | if (!PACKET_peek_bytes(pkt, data, len)) | 384 | 108 | return 0; | 385 | | | 386 | 113k | packet_forward(pkt, len); | 387 | | | 388 | 113k | return 1; | 389 | 113k | } |
extensions_clnt.c:PACKET_get_bytes Line | Count | Source | 382 | 32.6k | { | 383 | 32.6k | if (!PACKET_peek_bytes(pkt, data, len)) | 384 | 75 | return 0; | 385 | | | 386 | 32.5k | packet_forward(pkt, len); | 387 | | | 388 | 32.5k | return 1; | 389 | 32.6k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_get_bytes extensions_srvr.c:PACKET_get_bytes Line | Count | Source | 382 | 30.9k | { | 383 | 30.9k | if (!PACKET_peek_bytes(pkt, data, len)) | 384 | 659 | return 0; | 385 | | | 386 | 30.3k | packet_forward(pkt, len); | 387 | | | 388 | 30.3k | return 1; | 389 | 30.9k | } |
Unexecuted instantiation: statem.c:PACKET_get_bytes statem_clnt.c:PACKET_get_bytes Line | Count | Source | 382 | 94.0k | { | 383 | 94.0k | if (!PACKET_peek_bytes(pkt, data, len)) | 384 | 411 | return 0; | 385 | | | 386 | 93.6k | packet_forward(pkt, len); | 387 | | | 388 | 93.6k | return 1; | 389 | 94.0k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_get_bytes statem_lib.c:PACKET_get_bytes Line | Count | Source | 382 | 6.30k | { | 383 | 6.30k | if (!PACKET_peek_bytes(pkt, data, len)) | 384 | 282 | return 0; | 385 | | | 386 | 6.02k | packet_forward(pkt, len); | 387 | | | 388 | 6.02k | return 1; | 389 | 6.30k | } |
statem_srvr.c:PACKET_get_bytes Line | Count | Source | 382 | 44.3k | { | 383 | 44.3k | if (!PACKET_peek_bytes(pkt, data, len)) | 384 | 150 | return 0; | 385 | | | 386 | 44.2k | packet_forward(pkt, len); | 387 | | | 388 | 44.2k | return 1; | 389 | 44.3k | } |
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: t1_enc.c:PACKET_get_bytes Unexecuted instantiation: ssl_txt.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 | 306k | { |
396 | 306k | if (PACKET_remaining(pkt) < len) |
397 | 14.1k | return 0; |
398 | | |
399 | 291k | memcpy(data, pkt->curr, len); |
400 | | |
401 | 291k | return 1; |
402 | 306k | } 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 ssl_lib.c:PACKET_peek_copy_bytes Line | Count | Source | 395 | 265k | { | 396 | 265k | if (PACKET_remaining(pkt) < len) | 397 | 14.0k | return 0; | 398 | | | 399 | 251k | memcpy(data, pkt->curr, len); | 400 | | | 401 | 251k | return 1; | 402 | 265k | } |
Unexecuted instantiation: ssl_mcnf.c:PACKET_peek_copy_bytes Unexecuted instantiation: ssl_rsa.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 | 1.96k | { | 396 | 1.96k | if (PACKET_remaining(pkt) < len) | 397 | 0 | return 0; | 398 | | | 399 | 1.96k | memcpy(data, pkt->curr, len); | 400 | | | 401 | 1.96k | return 1; | 402 | 1.96k | } |
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 | 19.7k | { | 396 | 19.7k | if (PACKET_remaining(pkt) < len) | 397 | 74 | return 0; | 398 | | | 399 | 19.6k | memcpy(data, pkt->curr, len); | 400 | | | 401 | 19.6k | return 1; | 402 | 19.7k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_peek_copy_bytes Unexecuted instantiation: statem_lib.c:PACKET_peek_copy_bytes statem_srvr.c:PACKET_peek_copy_bytes Line | Count | Source | 395 | 18.9k | { | 396 | 18.9k | if (PACKET_remaining(pkt) < len) | 397 | 25 | return 0; | 398 | | | 399 | 18.9k | memcpy(data, pkt->curr, len); | 400 | | | 401 | 18.9k | return 1; | 402 | 18.9k | } |
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: t1_enc.c:PACKET_peek_copy_bytes Unexecuted instantiation: ssl_txt.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 | 306k | { |
411 | 306k | if (!PACKET_peek_copy_bytes(pkt, data, len)) |
412 | 14.1k | return 0; |
413 | | |
414 | 291k | packet_forward(pkt, len); |
415 | | |
416 | 291k | return 1; |
417 | 306k | } 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 ssl_lib.c:PACKET_copy_bytes Line | Count | Source | 410 | 265k | { | 411 | 265k | if (!PACKET_peek_copy_bytes(pkt, data, len)) | 412 | 14.0k | return 0; | 413 | | | 414 | 251k | packet_forward(pkt, len); | 415 | | | 416 | 251k | return 1; | 417 | 265k | } |
Unexecuted instantiation: ssl_mcnf.c:PACKET_copy_bytes Unexecuted instantiation: ssl_rsa.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 | 1.96k | { | 411 | 1.96k | if (!PACKET_peek_copy_bytes(pkt, data, len)) | 412 | 0 | return 0; | 413 | | | 414 | 1.96k | packet_forward(pkt, len); | 415 | | | 416 | 1.96k | return 1; | 417 | 1.96k | } |
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 | 19.7k | { | 411 | 19.7k | if (!PACKET_peek_copy_bytes(pkt, data, len)) | 412 | 74 | return 0; | 413 | | | 414 | 19.6k | packet_forward(pkt, len); | 415 | | | 416 | 19.6k | return 1; | 417 | 19.7k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_copy_bytes Unexecuted instantiation: statem_lib.c:PACKET_copy_bytes statem_srvr.c:PACKET_copy_bytes Line | Count | Source | 410 | 18.9k | { | 411 | 18.9k | if (!PACKET_peek_copy_bytes(pkt, data, len)) | 412 | 25 | return 0; | 413 | | | 414 | 18.9k | packet_forward(pkt, len); | 415 | | | 416 | 18.9k | return 1; | 417 | 18.9k | } |
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: t1_enc.c:PACKET_copy_bytes Unexecuted instantiation: ssl_txt.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 | 25.0k | { |
430 | 25.0k | if (PACKET_remaining(pkt) > dest_len) { |
431 | 12 | *len = 0; |
432 | 12 | return 0; |
433 | 12 | } |
434 | 25.0k | *len = pkt->remaining; |
435 | 25.0k | memcpy(dest, pkt->curr, pkt->remaining); |
436 | 25.0k | return 1; |
437 | 25.0k | } 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_rsa.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 statem_srvr.c:PACKET_copy_all Line | Count | Source | 429 | 25.0k | { | 430 | 25.0k | if (PACKET_remaining(pkt) > dest_len) { | 431 | 12 | *len = 0; | 432 | 12 | return 0; | 433 | 12 | } | 434 | 25.0k | *len = pkt->remaining; | 435 | 25.0k | memcpy(dest, pkt->curr, pkt->remaining); | 436 | 25.0k | return 1; | 437 | 25.0k | } |
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: t1_enc.c:PACKET_copy_all Unexecuted instantiation: ssl_txt.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 | 13.0k | { |
451 | 13.0k | size_t length; |
452 | | |
453 | 13.0k | OPENSSL_free(*data); |
454 | 13.0k | *data = NULL; |
455 | 13.0k | *len = 0; |
456 | | |
457 | 13.0k | length = PACKET_remaining(pkt); |
458 | | |
459 | 13.0k | if (length == 0) |
460 | 1.34k | return 1; |
461 | | |
462 | 11.6k | *data = OPENSSL_memdup(pkt->curr, length); |
463 | 11.6k | if (*data == NULL) |
464 | 0 | return 0; |
465 | | |
466 | 11.6k | *len = length; |
467 | 11.6k | return 1; |
468 | 11.6k | } 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 Line | Count | Source | 450 | 9.96k | { | 451 | 9.96k | size_t length; | 452 | | | 453 | 9.96k | OPENSSL_free(*data); | 454 | 9.96k | *data = NULL; | 455 | 9.96k | *len = 0; | 456 | | | 457 | 9.96k | length = PACKET_remaining(pkt); | 458 | | | 459 | 9.96k | if (length == 0) | 460 | 0 | return 1; | 461 | | | 462 | 9.96k | *data = OPENSSL_memdup(pkt->curr, length); | 463 | 9.96k | if (*data == NULL) | 464 | 0 | return 0; | 465 | | | 466 | 9.96k | *len = length; | 467 | 9.96k | return 1; | 468 | 9.96k | } |
Unexecuted instantiation: ssl_mcnf.c:PACKET_memdup Unexecuted instantiation: ssl_rsa.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 | 18 | { | 451 | 18 | size_t length; | 452 | | | 453 | 18 | OPENSSL_free(*data); | 454 | 18 | *data = NULL; | 455 | 18 | *len = 0; | 456 | | | 457 | 18 | length = PACKET_remaining(pkt); | 458 | | | 459 | 18 | if (length == 0) | 460 | 3 | return 1; | 461 | | | 462 | 15 | *data = OPENSSL_memdup(pkt->curr, length); | 463 | 15 | if (*data == NULL) | 464 | 0 | return 0; | 465 | | | 466 | 15 | *len = length; | 467 | 15 | return 1; | 468 | 15 | } |
Unexecuted instantiation: extensions_cust.c:PACKET_memdup extensions_srvr.c:PACKET_memdup Line | Count | Source | 450 | 1.50k | { | 451 | 1.50k | size_t length; | 452 | | | 453 | 1.50k | OPENSSL_free(*data); | 454 | 1.50k | *data = NULL; | 455 | 1.50k | *len = 0; | 456 | | | 457 | 1.50k | length = PACKET_remaining(pkt); | 458 | | | 459 | 1.50k | if (length == 0) | 460 | 0 | return 1; | 461 | | | 462 | 1.50k | *data = OPENSSL_memdup(pkt->curr, length); | 463 | 1.50k | if (*data == NULL) | 464 | 0 | return 0; | 465 | | | 466 | 1.50k | *len = length; | 467 | 1.50k | return 1; | 468 | 1.50k | } |
Unexecuted instantiation: statem.c:PACKET_memdup statem_clnt.c:PACKET_memdup Line | Count | Source | 450 | 1.53k | { | 451 | 1.53k | size_t length; | 452 | | | 453 | 1.53k | OPENSSL_free(*data); | 454 | 1.53k | *data = NULL; | 455 | 1.53k | *len = 0; | 456 | | | 457 | 1.53k | length = PACKET_remaining(pkt); | 458 | | | 459 | 1.53k | if (length == 0) | 460 | 1.33k | return 1; | 461 | | | 462 | 193 | *data = OPENSSL_memdup(pkt->curr, length); | 463 | 193 | if (*data == NULL) | 464 | 0 | return 0; | 465 | | | 466 | 193 | *len = length; | 467 | 193 | return 1; | 468 | 193 | } |
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: t1_enc.c:PACKET_memdup Unexecuted instantiation: ssl_txt.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 | 1.63k | { |
482 | 1.63k | OPENSSL_free(*data); |
483 | | |
484 | | /* This will succeed on an empty packet, unless pkt->curr == NULL. */ |
485 | 1.63k | *data = OPENSSL_strndup((const char *)pkt->curr, PACKET_remaining(pkt)); |
486 | 1.63k | return (*data != NULL); |
487 | 1.63k | } 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_rsa.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 extensions_srvr.c:PACKET_strndup Line | Count | Source | 481 | 1.63k | { | 482 | 1.63k | OPENSSL_free(*data); | 483 | | | 484 | | /* This will succeed on an empty packet, unless pkt->curr == NULL. */ | 485 | 1.63k | *data = OPENSSL_strndup((const char *)pkt->curr, PACKET_remaining(pkt)); | 486 | 1.63k | return (*data != NULL); | 487 | 1.63k | } |
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: t1_enc.c:PACKET_strndup Unexecuted instantiation: ssl_txt.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 | 1.64k | { |
492 | 1.64k | return memchr(pkt->curr, 0, pkt->remaining) != NULL; |
493 | 1.64k | } 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_rsa.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 extensions_srvr.c:PACKET_contains_zero_byte Line | Count | Source | 491 | 1.64k | { | 492 | 1.64k | return memchr(pkt->curr, 0, pkt->remaining) != NULL; | 493 | 1.64k | } |
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: t1_enc.c:PACKET_contains_zero_byte Unexecuted instantiation: ssl_txt.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 | 29.8k | { |
498 | 29.8k | if (PACKET_remaining(pkt) < len) |
499 | 0 | return 0; |
500 | | |
501 | 29.8k | packet_forward(pkt, len); |
502 | | |
503 | 29.8k | return 1; |
504 | 29.8k | } 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 Line | Count | Source | 497 | 29.4k | { | 498 | 29.4k | if (PACKET_remaining(pkt) < len) | 499 | 0 | return 0; | 500 | | | 501 | 29.4k | packet_forward(pkt, len); | 502 | | | 503 | 29.4k | return 1; | 504 | 29.4k | } |
Unexecuted instantiation: ssl_mcnf.c:PACKET_forward Unexecuted instantiation: ssl_rsa.c:PACKET_forward Unexecuted instantiation: ssl_sess.c:PACKET_forward extensions.c:PACKET_forward Line | Count | Source | 497 | 12 | { | 498 | 12 | if (PACKET_remaining(pkt) < len) | 499 | 0 | return 0; | 500 | | | 501 | 12 | packet_forward(pkt, len); | 502 | | | 503 | 12 | return 1; | 504 | 12 | } |
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 | 354 | { | 498 | 354 | if (PACKET_remaining(pkt) < len) | 499 | 0 | return 0; | 500 | | | 501 | 354 | packet_forward(pkt, len); | 502 | | | 503 | 354 | return 1; | 504 | 354 | } |
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: t1_enc.c:PACKET_forward Unexecuted instantiation: ssl_txt.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 | 48.4k | { |
516 | 48.4k | unsigned int length; |
517 | 48.4k | const unsigned char *data; |
518 | 48.4k | PACKET tmp = *pkt; |
519 | 48.4k | if (!PACKET_get_1(&tmp, &length) || |
520 | 48.4k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { |
521 | 441 | return 0; |
522 | 441 | } |
523 | | |
524 | 47.9k | *pkt = tmp; |
525 | 47.9k | subpkt->curr = data; |
526 | 47.9k | subpkt->remaining = length; |
527 | | |
528 | 47.9k | return 1; |
529 | 48.4k | } 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_rsa.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 extensions_srvr.c:PACKET_get_length_prefixed_1 Line | Count | Source | 515 | 1.68k | { | 516 | 1.68k | unsigned int length; | 517 | 1.68k | const unsigned char *data; | 518 | 1.68k | PACKET tmp = *pkt; | 519 | 1.68k | if (!PACKET_get_1(&tmp, &length) || | 520 | 1.68k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 521 | 40 | return 0; | 522 | 40 | } | 523 | | | 524 | 1.64k | *pkt = tmp; | 525 | 1.64k | subpkt->curr = data; | 526 | 1.64k | subpkt->remaining = length; | 527 | | | 528 | 1.64k | return 1; | 529 | 1.68k | } |
Unexecuted instantiation: statem.c:PACKET_get_length_prefixed_1 statem_clnt.c:PACKET_get_length_prefixed_1 Line | Count | Source | 515 | 25.7k | { | 516 | 25.7k | unsigned int length; | 517 | 25.7k | const unsigned char *data; | 518 | 25.7k | PACKET tmp = *pkt; | 519 | 25.7k | if (!PACKET_get_1(&tmp, &length) || | 520 | 25.7k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 521 | 368 | return 0; | 522 | 368 | } | 523 | | | 524 | 25.3k | *pkt = tmp; | 525 | 25.3k | subpkt->curr = data; | 526 | 25.3k | subpkt->remaining = length; | 527 | | | 528 | 25.3k | return 1; | 529 | 25.7k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_get_length_prefixed_1 Unexecuted instantiation: statem_lib.c:PACKET_get_length_prefixed_1 statem_srvr.c:PACKET_get_length_prefixed_1 Line | Count | Source | 515 | 21.0k | { | 516 | 21.0k | unsigned int length; | 517 | 21.0k | const unsigned char *data; | 518 | 21.0k | PACKET tmp = *pkt; | 519 | 21.0k | if (!PACKET_get_1(&tmp, &length) || | 520 | 21.0k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 521 | 33 | return 0; | 522 | 33 | } | 523 | | | 524 | 20.9k | *pkt = tmp; | 525 | 20.9k | subpkt->curr = data; | 526 | 20.9k | subpkt->remaining = length; | 527 | | | 528 | 20.9k | return 1; | 529 | 21.0k | } |
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: t1_enc.c:PACKET_get_length_prefixed_1 Unexecuted instantiation: ssl_txt.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 | 7.93k | { |
538 | 7.93k | unsigned int length; |
539 | 7.93k | const unsigned char *data; |
540 | 7.93k | PACKET tmp = *pkt; |
541 | 7.93k | if (!PACKET_get_1(&tmp, &length) || |
542 | 7.93k | !PACKET_get_bytes(&tmp, &data, (size_t)length) || |
543 | 7.93k | PACKET_remaining(&tmp) != 0) { |
544 | 171 | return 0; |
545 | 171 | } |
546 | | |
547 | 7.76k | *pkt = tmp; |
548 | 7.76k | subpkt->curr = data; |
549 | 7.76k | subpkt->remaining = length; |
550 | | |
551 | 7.76k | return 1; |
552 | 7.93k | } 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_rsa.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 | 1.99k | { | 538 | 1.99k | unsigned int length; | 539 | 1.99k | const unsigned char *data; | 540 | 1.99k | PACKET tmp = *pkt; | 541 | 1.99k | if (!PACKET_get_1(&tmp, &length) || | 542 | 1.99k | !PACKET_get_bytes(&tmp, &data, (size_t)length) || | 543 | 1.99k | PACKET_remaining(&tmp) != 0) { | 544 | 31 | return 0; | 545 | 31 | } | 546 | | | 547 | 1.96k | *pkt = tmp; | 548 | 1.96k | subpkt->curr = data; | 549 | 1.96k | subpkt->remaining = length; | 550 | | | 551 | 1.96k | return 1; | 552 | 1.99k | } |
Unexecuted instantiation: extensions_cust.c:PACKET_as_length_prefixed_1 extensions_srvr.c:PACKET_as_length_prefixed_1 Line | Count | Source | 537 | 2.71k | { | 538 | 2.71k | unsigned int length; | 539 | 2.71k | const unsigned char *data; | 540 | 2.71k | PACKET tmp = *pkt; | 541 | 2.71k | if (!PACKET_get_1(&tmp, &length) || | 542 | 2.71k | !PACKET_get_bytes(&tmp, &data, (size_t)length) || | 543 | 2.71k | PACKET_remaining(&tmp) != 0) { | 544 | 101 | return 0; | 545 | 101 | } | 546 | | | 547 | 2.61k | *pkt = tmp; | 548 | 2.61k | subpkt->curr = data; | 549 | 2.61k | subpkt->remaining = length; | 550 | | | 551 | 2.61k | return 1; | 552 | 2.71k | } |
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 statem_lib.c:PACKET_as_length_prefixed_1 Line | Count | Source | 537 | 3.22k | { | 538 | 3.22k | unsigned int length; | 539 | 3.22k | const unsigned char *data; | 540 | 3.22k | PACKET tmp = *pkt; | 541 | 3.22k | if (!PACKET_get_1(&tmp, &length) || | 542 | 3.22k | !PACKET_get_bytes(&tmp, &data, (size_t)length) || | 543 | 3.22k | PACKET_remaining(&tmp) != 0) { | 544 | 39 | return 0; | 545 | 39 | } | 546 | | | 547 | 3.18k | *pkt = tmp; | 548 | 3.18k | subpkt->curr = data; | 549 | 3.18k | subpkt->remaining = length; | 550 | | | 551 | 3.18k | return 1; | 552 | 3.22k | } |
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: t1_enc.c:PACKET_as_length_prefixed_1 Unexecuted instantiation: ssl_txt.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 | 161k | { |
564 | 161k | unsigned int length; |
565 | 161k | const unsigned char *data; |
566 | 161k | PACKET tmp = *pkt; |
567 | | |
568 | 161k | if (!PACKET_get_net_2(&tmp, &length) || |
569 | 161k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { |
570 | 1.03k | return 0; |
571 | 1.03k | } |
572 | | |
573 | 160k | *pkt = tmp; |
574 | 160k | subpkt->curr = data; |
575 | 160k | subpkt->remaining = length; |
576 | | |
577 | 160k | return 1; |
578 | 161k | } 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_rsa.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 | 113k | { | 564 | 113k | unsigned int length; | 565 | 113k | const unsigned char *data; | 566 | 113k | PACKET tmp = *pkt; | 567 | | | 568 | 113k | if (!PACKET_get_net_2(&tmp, &length) || | 569 | 113k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 570 | 129 | return 0; | 571 | 129 | } | 572 | | | 573 | 113k | *pkt = tmp; | 574 | 113k | subpkt->curr = data; | 575 | 113k | subpkt->remaining = length; | 576 | | | 577 | 113k | return 1; | 578 | 113k | } |
Unexecuted instantiation: extensions_clnt.c:PACKET_get_length_prefixed_2 Unexecuted instantiation: extensions_cust.c:PACKET_get_length_prefixed_2 extensions_srvr.c:PACKET_get_length_prefixed_2 Line | Count | Source | 563 | 8.46k | { | 564 | 8.46k | unsigned int length; | 565 | 8.46k | const unsigned char *data; | 566 | 8.46k | PACKET tmp = *pkt; | 567 | | | 568 | 8.46k | if (!PACKET_get_net_2(&tmp, &length) || | 569 | 8.46k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 570 | 329 | return 0; | 571 | 329 | } | 572 | | | 573 | 8.13k | *pkt = tmp; | 574 | 8.13k | subpkt->curr = data; | 575 | 8.13k | subpkt->remaining = length; | 576 | | | 577 | 8.13k | return 1; | 578 | 8.46k | } |
Unexecuted instantiation: statem.c:PACKET_get_length_prefixed_2 statem_clnt.c:PACKET_get_length_prefixed_2 Line | Count | Source | 563 | 16.2k | { | 564 | 16.2k | unsigned int length; | 565 | 16.2k | const unsigned char *data; | 566 | 16.2k | PACKET tmp = *pkt; | 567 | | | 568 | 16.2k | if (!PACKET_get_net_2(&tmp, &length) || | 569 | 16.2k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 570 | 194 | return 0; | 571 | 194 | } | 572 | | | 573 | 16.0k | *pkt = tmp; | 574 | 16.0k | subpkt->curr = data; | 575 | 16.0k | subpkt->remaining = length; | 576 | | | 577 | 16.0k | return 1; | 578 | 16.2k | } |
Unexecuted instantiation: statem_dtls.c:PACKET_get_length_prefixed_2 statem_lib.c:PACKET_get_length_prefixed_2 Line | Count | Source | 563 | 1.61k | { | 564 | 1.61k | unsigned int length; | 565 | 1.61k | const unsigned char *data; | 566 | 1.61k | PACKET tmp = *pkt; | 567 | | | 568 | 1.61k | if (!PACKET_get_net_2(&tmp, &length) || | 569 | 1.61k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 570 | 252 | return 0; | 571 | 252 | } | 572 | | | 573 | 1.35k | *pkt = tmp; | 574 | 1.35k | subpkt->curr = data; | 575 | 1.35k | subpkt->remaining = length; | 576 | | | 577 | 1.35k | return 1; | 578 | 1.61k | } |
statem_srvr.c:PACKET_get_length_prefixed_2 Line | Count | Source | 563 | 21.2k | { | 564 | 21.2k | unsigned int length; | 565 | 21.2k | const unsigned char *data; | 566 | 21.2k | PACKET tmp = *pkt; | 567 | | | 568 | 21.2k | if (!PACKET_get_net_2(&tmp, &length) || | 569 | 21.2k | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 570 | 126 | return 0; | 571 | 126 | } | 572 | | | 573 | 21.1k | *pkt = tmp; | 574 | 21.1k | subpkt->curr = data; | 575 | 21.1k | subpkt->remaining = length; | 576 | | | 577 | 21.1k | return 1; | 578 | 21.2k | } |
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: t1_enc.c:PACKET_get_length_prefixed_2 Unexecuted instantiation: ssl_txt.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 | 36.3k | { |
587 | 36.3k | unsigned int length; |
588 | 36.3k | const unsigned char *data; |
589 | 36.3k | PACKET tmp = *pkt; |
590 | | |
591 | 36.3k | if (!PACKET_get_net_2(&tmp, &length) || |
592 | 36.3k | !PACKET_get_bytes(&tmp, &data, (size_t)length) || |
593 | 36.3k | PACKET_remaining(&tmp) != 0) { |
594 | 751 | return 0; |
595 | 751 | } |
596 | | |
597 | 35.5k | *pkt = tmp; |
598 | 35.5k | subpkt->curr = data; |
599 | 35.5k | subpkt->remaining = length; |
600 | | |
601 | 35.5k | return 1; |
602 | 36.3k | } 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_rsa.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 | 434 | { | 587 | 434 | unsigned int length; | 588 | 434 | const unsigned char *data; | 589 | 434 | PACKET tmp = *pkt; | 590 | | | 591 | 434 | if (!PACKET_get_net_2(&tmp, &length) || | 592 | 434 | !PACKET_get_bytes(&tmp, &data, (size_t)length) || | 593 | 434 | PACKET_remaining(&tmp) != 0) { | 594 | 85 | return 0; | 595 | 85 | } | 596 | | | 597 | 349 | *pkt = tmp; | 598 | 349 | subpkt->curr = data; | 599 | 349 | subpkt->remaining = length; | 600 | | | 601 | 349 | return 1; | 602 | 434 | } |
Unexecuted instantiation: extensions_cust.c:PACKET_as_length_prefixed_2 extensions_srvr.c:PACKET_as_length_prefixed_2 Line | Count | Source | 586 | 17.2k | { | 587 | 17.2k | unsigned int length; | 588 | 17.2k | const unsigned char *data; | 589 | 17.2k | PACKET tmp = *pkt; | 590 | | | 591 | 17.2k | if (!PACKET_get_net_2(&tmp, &length) || | 592 | 17.2k | !PACKET_get_bytes(&tmp, &data, (size_t)length) || | 593 | 17.2k | PACKET_remaining(&tmp) != 0) { | 594 | 490 | return 0; | 595 | 490 | } | 596 | | | 597 | 16.7k | *pkt = tmp; | 598 | 16.7k | subpkt->curr = data; | 599 | 16.7k | subpkt->remaining = length; | 600 | | | 601 | 16.7k | return 1; | 602 | 17.2k | } |
Unexecuted instantiation: statem.c:PACKET_as_length_prefixed_2 statem_clnt.c:PACKET_as_length_prefixed_2 Line | Count | Source | 586 | 18.6k | { | 587 | 18.6k | unsigned int length; | 588 | 18.6k | const unsigned char *data; | 589 | 18.6k | PACKET tmp = *pkt; | 590 | | | 591 | 18.6k | if (!PACKET_get_net_2(&tmp, &length) || | 592 | 18.6k | !PACKET_get_bytes(&tmp, &data, (size_t)length) || | 593 | 18.6k | PACKET_remaining(&tmp) != 0) { | 594 | 176 | return 0; | 595 | 176 | } | 596 | | | 597 | 18.4k | *pkt = tmp; | 598 | 18.4k | subpkt->curr = data; | 599 | 18.4k | subpkt->remaining = length; | 600 | | | 601 | 18.4k | return 1; | 602 | 18.6k | } |
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: t1_enc.c:PACKET_as_length_prefixed_2 Unexecuted instantiation: ssl_txt.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 | 12 | { |
614 | 12 | unsigned long length; |
615 | 12 | const unsigned char *data; |
616 | 12 | PACKET tmp = *pkt; |
617 | 12 | if (!PACKET_get_net_3(&tmp, &length) || |
618 | 12 | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { |
619 | 0 | return 0; |
620 | 0 | } |
621 | | |
622 | 12 | *pkt = tmp; |
623 | 12 | subpkt->curr = data; |
624 | 12 | subpkt->remaining = length; |
625 | | |
626 | 12 | return 1; |
627 | 12 | } 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_rsa.c:PACKET_get_length_prefixed_3 Unexecuted instantiation: ssl_sess.c:PACKET_get_length_prefixed_3 extensions.c:PACKET_get_length_prefixed_3 Line | Count | Source | 613 | 12 | { | 614 | 12 | unsigned long length; | 615 | 12 | const unsigned char *data; | 616 | 12 | PACKET tmp = *pkt; | 617 | 12 | if (!PACKET_get_net_3(&tmp, &length) || | 618 | 12 | !PACKET_get_bytes(&tmp, &data, (size_t)length)) { | 619 | 0 | return 0; | 620 | 0 | } | 621 | | | 622 | 12 | *pkt = tmp; | 623 | 12 | subpkt->curr = data; | 624 | 12 | subpkt->remaining = length; | 625 | | | 626 | 12 | return 1; | 627 | 12 | } |
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: t1_enc.c:PACKET_get_length_prefixed_3 Unexecuted instantiation: ssl_txt.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 | 19.2k | #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 | 38.7k | #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 | 150k | WPACKET_start_sub_packet_len__((pkt), 1) |
753 | | #define WPACKET_start_sub_packet_u16(pkt) \ |
754 | 472k | WPACKET_start_sub_packet_len__((pkt), 2) |
755 | | #define WPACKET_start_sub_packet_u24(pkt) \ |
756 | 70.5k | 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 | 2.51k | WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 2) |
794 | | #define WPACKET_sub_allocate_bytes_u24(pkt, len, bytes) \ |
795 | 11.3k | 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 | 1.60k | 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 | 386k | WPACKET_put_bytes__((pkt), (val), 1) |
852 | | #define WPACKET_put_bytes_u16(pkt, val) \ |
853 | 3.22M | 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 | 6 | 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 | 54.4k | WPACKET_sub_memcpy__((pkt), (src), (len), 1) |
881 | | #define WPACKET_sub_memcpy_u16(pkt, src, len) \ |
882 | 89.2k | 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 */ |