diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-10-12 20:59:22 +0200 |
---|---|---|
committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-10-15 14:51:43 +0200 |
commit | e3584fbf2a9760238c3279275e963cf121b3ed0b (patch) | |
tree | 958f3c86ee71b66482d4fb8b5c5519ec414875c8 /lib | |
parent | d6ee45fe1cf6715bb728e21bd7ac6c0e9d33d2a8 (diff) | |
download | gnutls-e3584fbf2a9760238c3279275e963cf121b3ed0b.tar.gz |
Add const to several read-only packet sequence paramstmp-fix-coverity
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/buffers.c | 2 | ||||
-rw-r--r-- | lib/buffers.h | 2 | ||||
-rw-r--r-- | lib/cipher-cbc.c | 2 | ||||
-rw-r--r-- | lib/cipher.c | 12 | ||||
-rw-r--r-- | lib/cipher.h | 6 | ||||
-rw-r--r-- | lib/dtls-sw.c | 2 | ||||
-rw-r--r-- | lib/dtls.h | 2 | ||||
-rw-r--r-- | lib/record.c | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/lib/buffers.c b/lib/buffers.c index c1e6195cb8..1ca8b3705a 100644 --- a/lib/buffers.c +++ b/lib/buffers.c @@ -67,7 +67,7 @@ */ void _gnutls_record_buffer_put(gnutls_session_t session, - content_type_t type, gnutls_uint64 * seq, + content_type_t type, const gnutls_uint64 * seq, mbuffer_st * bufel) { diff --git a/lib/buffers.h b/lib/buffers.h index 7f30b0ade1..ef5171a0ce 100644 --- a/lib/buffers.h +++ b/lib/buffers.h @@ -29,7 +29,7 @@ void _gnutls_record_buffer_put(gnutls_session_t session, - content_type_t type, gnutls_uint64 * seq, + content_type_t type, const gnutls_uint64 * seq, mbuffer_st * bufel); inline static int _gnutls_record_buffer_get_size(gnutls_session_t session) diff --git a/lib/cipher-cbc.c b/lib/cipher-cbc.c index 5f6868587c..26f72d7ea4 100644 --- a/lib/cipher-cbc.c +++ b/lib/cipher-cbc.c @@ -72,7 +72,7 @@ static void dummy_wait(record_parameters_st *params, int cbc_mac_verify(gnutls_session_t session, record_parameters_st *params, uint8_t preamble[MAX_PREAMBLE_SIZE], content_type_t type, - gnutls_uint64 *sequence, + const gnutls_uint64 *sequence, const uint8_t *data, size_t data_size, size_t tag_size) { diff --git a/lib/cipher.c b/lib/cipher.c index 908304ac7d..679a5807c1 100644 --- a/lib/cipher.c +++ b/lib/cipher.c @@ -54,14 +54,14 @@ static int decrypt_packet(gnutls_session_t session, gnutls_datum_t * plain, content_type_t type, record_parameters_st * params, - gnutls_uint64 * sequence); + const gnutls_uint64 * sequence); static int decrypt_packet_tls13(gnutls_session_t session, gnutls_datum_t * ciphertext, gnutls_datum_t * plain, content_type_t *type, record_parameters_st * params, - gnutls_uint64 * sequence); + const gnutls_uint64 * sequence); static int encrypt_packet_tls13(gnutls_session_t session, @@ -138,7 +138,7 @@ _gnutls_decrypt(gnutls_session_t session, gnutls_datum_t *output, content_type_t *type, record_parameters_st *params, - gnutls_uint64 *sequence) + const gnutls_uint64 *sequence) { int ret; const version_entry_st *vers = get_version(session); @@ -213,7 +213,7 @@ calc_enc_length_stream(gnutls_session_t session, int data_size, * and are not to be sent). Returns their size. */ int -_gnutls_make_preamble(uint8_t * uint64_data, uint8_t type, unsigned int length, +_gnutls_make_preamble(const uint8_t * uint64_data, uint8_t type, unsigned int length, const version_entry_st * ver, uint8_t preamble[MAX_PREAMBLE_SIZE]) { uint8_t *p = preamble; @@ -526,7 +526,7 @@ decrypt_packet(gnutls_session_t session, gnutls_datum_t * ciphertext, gnutls_datum_t * plain, content_type_t type, record_parameters_st * params, - gnutls_uint64 * sequence) + const gnutls_uint64 * sequence) { uint8_t tag[MAX_HASH_SIZE]; uint8_t nonce[MAX_CIPHER_IV_SIZE]; @@ -808,7 +808,7 @@ decrypt_packet_tls13(gnutls_session_t session, gnutls_datum_t *ciphertext, gnutls_datum_t *plain, content_type_t *type, record_parameters_st *params, - gnutls_uint64 *sequence) + const gnutls_uint64 *sequence) { uint8_t nonce[MAX_CIPHER_IV_SIZE]; size_t length, length_to_decrypt; diff --git a/lib/cipher.h b/lib/cipher.h index 4b32eef9fa..ada9929369 100644 --- a/lib/cipher.h +++ b/lib/cipher.h @@ -32,18 +32,18 @@ int _gnutls_encrypt(gnutls_session_t session, int _gnutls_decrypt(gnutls_session_t session, gnutls_datum_t * ciphertext, gnutls_datum_t * output, content_type_t *type, record_parameters_st * params, - gnutls_uint64 * sequence); + const gnutls_uint64 * sequence); #define MAX_PREAMBLE_SIZE 16 int -_gnutls_make_preamble(uint8_t * uint64_data, uint8_t type, unsigned int length, +_gnutls_make_preamble(const uint8_t * uint64_data, uint8_t type, unsigned int length, const version_entry_st * ver, uint8_t preamble[MAX_PREAMBLE_SIZE]); int cbc_mac_verify(gnutls_session_t session, record_parameters_st *params, uint8_t preamble[MAX_PREAMBLE_SIZE], content_type_t type, - gnutls_uint64 *sequence, + const gnutls_uint64 *sequence, const uint8_t *data, size_t data_size, size_t tag_size); diff --git a/lib/dtls-sw.c b/lib/dtls-sw.c index 1e46e299e2..f0fc5a6ef5 100644 --- a/lib/dtls-sw.c +++ b/lib/dtls-sw.c @@ -63,7 +63,7 @@ void _dtls_reset_window(struct record_parameters_st *rp) * packet is detected it returns a negative value (but no sensible error code). * Otherwise zero. */ -int _dtls_record_check(struct record_parameters_st *rp, gnutls_uint64 * _seq) +int _dtls_record_check(struct record_parameters_st *rp, const gnutls_uint64 * _seq) { uint64_t seq_num = 0; diff --git a/lib/dtls.h b/lib/dtls.h index 26df8b9831..53de44621a 100644 --- a/lib/dtls.h +++ b/lib/dtls.h @@ -30,7 +30,7 @@ #include <constate.h> int _dtls_transmit(gnutls_session_t session); -int _dtls_record_check(struct record_parameters_st *rp, gnutls_uint64 * _seq); +int _dtls_record_check(struct record_parameters_st *rp, const gnutls_uint64 * _seq); void _dtls_reset_hsk_state(gnutls_session_t session); void _dtls_reset_window(struct record_parameters_st *rp); diff --git a/lib/record.c b/lib/record.c index 033011b6b2..5105c13fdd 100644 --- a/lib/record.c +++ b/lib/record.c @@ -798,7 +798,7 @@ static int record_add_to_buffers(gnutls_session_t session, struct tls_record_st *recv, content_type_t type, gnutls_handshake_description_t htype, - gnutls_uint64 * seq, mbuffer_st * bufel) + const gnutls_uint64 * seq, mbuffer_st * bufel) { int ret; @@ -1260,7 +1260,7 @@ _gnutls_recv_in_buffers(gnutls_session_t session, content_type_t type, gnutls_handshake_description_t htype, unsigned int ms) { - gnutls_uint64 *packet_sequence; + const gnutls_uint64 *packet_sequence; gnutls_datum_t ciphertext; mbuffer_st *bufel = NULL, *decrypted = NULL; gnutls_datum_t t; |