|
|
1d35f3 |
From e0fe31f1fc2ba13ada1d6bc35231847b75be4ee9 Mon Sep 17 00:00:00 2001
|
|
|
1d35f3 |
From: Daiki Ueno <dueno@redhat.com>
|
|
|
1d35f3 |
Date: Thu, 8 Aug 2019 18:02:08 +0200
|
|
|
1d35f3 |
Subject: [PATCH 1/2] gnutls_int.h: make DECR_LEN neutral to signedness
|
|
|
1d35f3 |
|
|
|
1d35f3 |
DECR_LEN was previously implemented in a way that it first decrements
|
|
|
1d35f3 |
the given length and then checks whether the result is negative. This
|
|
|
1d35f3 |
requires the caller to properly coerce the length argument to a signed
|
|
|
1d35f3 |
integer, before invoking the macro.
|
|
|
1d35f3 |
|
|
|
1d35f3 |
Signed-off-by: Daiki Ueno <dueno@redhat.com>
|
|
|
1d35f3 |
---
|
|
|
1d35f3 |
lib/gnutls_int.h | 11 ++++++-----
|
|
|
1d35f3 |
1 file changed, 6 insertions(+), 5 deletions(-)
|
|
|
1d35f3 |
|
|
|
1d35f3 |
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
|
|
|
1d35f3 |
index 179d71b4a..7f7b6a7c9 100644
|
|
|
1d35f3 |
--- a/lib/gnutls_int.h
|
|
|
1d35f3 |
+++ b/lib/gnutls_int.h
|
|
|
1d35f3 |
@@ -256,14 +256,15 @@ typedef enum record_send_state_t {
|
|
|
1d35f3 |
|
|
|
1d35f3 |
#define MEMSUB(x,y) ((ssize_t)((ptrdiff_t)x-(ptrdiff_t)y))
|
|
|
1d35f3 |
|
|
|
1d35f3 |
-#define DECR_LEN(len, x) do { len-=x; if (len<0) {gnutls_assert(); return GNUTLS_E_UNEXPECTED_PACKET_LENGTH;} } while (0)
|
|
|
1d35f3 |
+#define DECR_LEN(len, x) DECR_LENGTH_RET(len, x, GNUTLS_E_UNEXPECTED_PACKET_LENGTH)
|
|
|
1d35f3 |
#define DECR_LEN_FINAL(len, x) do { \
|
|
|
1d35f3 |
- len-=x; \
|
|
|
1d35f3 |
- if (len != 0) \
|
|
|
1d35f3 |
+ if (len != x) \
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH); \
|
|
|
1d35f3 |
+ else \
|
|
|
1d35f3 |
+ len = 0; \
|
|
|
1d35f3 |
} while (0)
|
|
|
1d35f3 |
-#define DECR_LENGTH_RET(len, x, RET) do { len-=x; if (len<0) {gnutls_assert(); return RET;} } while (0)
|
|
|
1d35f3 |
-#define DECR_LENGTH_COM(len, x, COM) do { len-=x; if (len<0) {gnutls_assert(); COM;} } while (0)
|
|
|
1d35f3 |
+#define DECR_LENGTH_RET(len, x, RET) DECR_LENGTH_COM(len, x, return RET)
|
|
|
1d35f3 |
+#define DECR_LENGTH_COM(len, x, COM) do { if (len
|
|
|
1d35f3 |
|
|
|
1d35f3 |
#define GNUTLS_POINTER_TO_INT(_) ((int) GNUTLS_POINTER_TO_INT_CAST (_))
|
|
|
1d35f3 |
#define GNUTLS_INT_TO_POINTER(_) ((void*) GNUTLS_POINTER_TO_INT_CAST (_))
|
|
|
1d35f3 |
--
|
|
|
1d35f3 |
2.21.0
|
|
|
1d35f3 |
|
|
|
1d35f3 |
|
|
|
1d35f3 |
From 5e9b2ec29449c76b1b938a0ebf0dc9b92cae7057 Mon Sep 17 00:00:00 2001
|
|
|
1d35f3 |
From: Daiki Ueno <dueno@redhat.com>
|
|
|
1d35f3 |
Date: Thu, 8 Aug 2019 18:04:18 +0200
|
|
|
1d35f3 |
Subject: [PATCH 2/2] lib/*: remove unnecessary cast to ssize_t
|
|
|
1d35f3 |
|
|
|
1d35f3 |
Signed-off-by: Daiki Ueno <dueno@redhat.com>
|
|
|
1d35f3 |
---
|
|
|
1d35f3 |
lib/crypto-api.c | 10 +++++-----
|
|
|
1d35f3 |
lib/ext/alpn.c | 3 +--
|
|
|
1d35f3 |
lib/ext/client_cert_type.c | 9 ++++-----
|
|
|
1d35f3 |
lib/ext/cookie.c | 5 ++---
|
|
|
1d35f3 |
lib/ext/ec_point_formats.c | 7 +++----
|
|
|
1d35f3 |
lib/ext/key_share.c | 5 ++---
|
|
|
1d35f3 |
lib/ext/max_record.c | 3 +--
|
|
|
1d35f3 |
lib/ext/psk_ke_modes.c | 3 +--
|
|
|
1d35f3 |
lib/ext/record_size_limit.c | 3 +--
|
|
|
1d35f3 |
lib/ext/safe_renegotiation.c | 3 +--
|
|
|
1d35f3 |
lib/ext/server_cert_type.c | 9 ++++-----
|
|
|
1d35f3 |
lib/ext/server_name.c | 3 +--
|
|
|
1d35f3 |
lib/ext/session_ticket.c | 5 ++---
|
|
|
1d35f3 |
lib/ext/signature.c | 3 +--
|
|
|
1d35f3 |
lib/ext/srp.c | 3 +--
|
|
|
1d35f3 |
lib/ext/srtp.c | 5 ++---
|
|
|
1d35f3 |
lib/ext/status_request.c | 3 +--
|
|
|
1d35f3 |
lib/ext/supported_groups.c | 3 +--
|
|
|
1d35f3 |
lib/ext/supported_versions.c | 5 ++---
|
|
|
1d35f3 |
lib/extv.c | 8 ++++----
|
|
|
1d35f3 |
lib/sslv2_compat.c | 3 +--
|
|
|
1d35f3 |
lib/supplemental.c | 4 ++--
|
|
|
1d35f3 |
lib/tls13/certificate.c | 21 +++++++++++----------
|
|
|
1d35f3 |
lib/tls13/psk_ext_parser.c | 4 +---
|
|
|
1d35f3 |
lib/tls13/psk_ext_parser.h | 4 ++--
|
|
|
1d35f3 |
lib/tls13/session_ticket.c | 2 +-
|
|
|
1d35f3 |
26 files changed, 58 insertions(+), 78 deletions(-)
|
|
|
1d35f3 |
|
|
|
1d35f3 |
diff --git a/lib/crypto-api.c b/lib/crypto-api.c
|
|
|
1d35f3 |
index 2834c0199..09b3d7bfc 100644
|
|
|
1d35f3 |
--- a/lib/crypto-api.c
|
|
|
1d35f3 |
+++ b/lib/crypto-api.c
|
|
|
1d35f3 |
@@ -990,9 +990,9 @@ gnutls_aead_cipher_encryptv(gnutls_aead_cipher_hd_t handle,
|
|
|
1d35f3 |
api_aead_cipher_hd_st *h = handle;
|
|
|
1d35f3 |
ssize_t ret;
|
|
|
1d35f3 |
uint8_t *dst;
|
|
|
1d35f3 |
- ssize_t dst_size, total = 0;
|
|
|
1d35f3 |
+ size_t dst_size, total = 0;
|
|
|
1d35f3 |
uint8_t *p;
|
|
|
1d35f3 |
- ssize_t blocksize = handle->ctx_enc.e->blocksize;
|
|
|
1d35f3 |
+ size_t blocksize = handle->ctx_enc.e->blocksize;
|
|
|
1d35f3 |
struct iov_iter_st iter;
|
|
|
1d35f3 |
size_t blocks;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
@@ -1071,7 +1071,7 @@ gnutls_aead_cipher_encryptv(gnutls_aead_cipher_hd_t handle,
|
|
|
1d35f3 |
if (ret == 0)
|
|
|
1d35f3 |
break;
|
|
|
1d35f3 |
blocks = ret;
|
|
|
1d35f3 |
- if (unlikely((size_t) dst_size < blocksize * blocks))
|
|
|
1d35f3 |
+ if (unlikely(dst_size < blocksize * blocks))
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_SHORT_MEMORY_BUFFER);
|
|
|
1d35f3 |
ret = _gnutls_cipher_encrypt2(&handle->ctx_enc, p,
|
|
|
1d35f3 |
blocksize * blocks,
|
|
|
1d35f3 |
@@ -1083,7 +1083,7 @@ gnutls_aead_cipher_encryptv(gnutls_aead_cipher_hd_t handle,
|
|
|
1d35f3 |
total += blocksize * blocks;
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
if (iter.block_offset > 0) {
|
|
|
1d35f3 |
- if (unlikely((size_t) dst_size < iter.block_offset))
|
|
|
1d35f3 |
+ if (unlikely(dst_size < iter.block_offset))
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_SHORT_MEMORY_BUFFER);
|
|
|
1d35f3 |
ret = _gnutls_cipher_encrypt2(&handle->ctx_enc,
|
|
|
1d35f3 |
iter.block, iter.block_offset,
|
|
|
1d35f3 |
@@ -1095,7 +1095,7 @@ gnutls_aead_cipher_encryptv(gnutls_aead_cipher_hd_t handle,
|
|
|
1d35f3 |
total += iter.block_offset;
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- if ((size_t)dst_size < tag_size)
|
|
|
1d35f3 |
+ if (dst_size < tag_size)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_SHORT_MEMORY_BUFFER);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
_gnutls_cipher_tag(&handle->ctx_enc, dst, tag_size);
|
|
|
1d35f3 |
diff --git a/lib/ext/alpn.c b/lib/ext/alpn.c
|
|
|
1d35f3 |
index 34f6ce09d..b9991f0a1 100644
|
|
|
1d35f3 |
--- a/lib/ext/alpn.c
|
|
|
1d35f3 |
+++ b/lib/ext/alpn.c
|
|
|
1d35f3 |
@@ -51,13 +51,12 @@ const hello_ext_entry_st ext_mod_alpn = {
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_alpn_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
unsigned int i;
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
const uint8_t *p = data;
|
|
|
1d35f3 |
unsigned len1, len;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
alpn_ext_st *priv;
|
|
|
1d35f3 |
gnutls_ext_priv_data_t epriv;
|
|
|
1d35f3 |
int selected_protocol_index;
|
|
|
1d35f3 |
diff --git a/lib/ext/client_cert_type.c b/lib/ext/client_cert_type.c
|
|
|
1d35f3 |
index 471d42c5f..b627b71f9 100644
|
|
|
1d35f3 |
--- a/lib/ext/client_cert_type.c
|
|
|
1d35f3 |
+++ b/lib/ext/client_cert_type.c
|
|
|
1d35f3 |
@@ -73,7 +73,6 @@ static int _gnutls_client_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
gnutls_certificate_type_t cert_type;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
uint8_t i, found = 0;
|
|
|
1d35f3 |
- ssize_t len = data_size;
|
|
|
1d35f3 |
const uint8_t* pdata = data;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
/* Only activate this extension if we have cert credentials set
|
|
|
1d35f3 |
@@ -86,7 +85,7 @@ static int _gnutls_client_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
|
|
|
1d35f3 |
/* Compare packet length with expected packet length. For the
|
|
|
1d35f3 |
* client this is a single byte. */
|
|
|
1d35f3 |
- if (len != 1) {
|
|
|
1d35f3 |
+ if (data_size != 1) {
|
|
|
1d35f3 |
return
|
|
|
1d35f3 |
gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
@@ -136,8 +135,8 @@ static int _gnutls_client_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
|
|
|
1d35f3 |
} else { // server mode
|
|
|
1d35f3 |
// Compare packet length with expected packet length.
|
|
|
1d35f3 |
- DECR_LEN(len, 1);
|
|
|
1d35f3 |
- if (data[0] != len) {
|
|
|
1d35f3 |
+ DECR_LEN(data_size, 1);
|
|
|
1d35f3 |
+ if (data[0] != data_size) {
|
|
|
1d35f3 |
return
|
|
|
1d35f3 |
gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
@@ -145,7 +144,7 @@ static int _gnutls_client_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
|
|
|
1d35f3 |
// Assign the contents of our data buffer to a gnutls_datum_t
|
|
|
1d35f3 |
cert_types.data = (uint8_t*)pdata; // Need casting to get rid of 'discards const qualifier' warning
|
|
|
1d35f3 |
- cert_types.size = len;
|
|
|
1d35f3 |
+ cert_types.size = data_size;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
// Store the client certificate types in our session
|
|
|
1d35f3 |
_gnutls_hello_ext_set_datum(session,
|
|
|
1d35f3 |
diff --git a/lib/ext/cookie.c b/lib/ext/cookie.c
|
|
|
1d35f3 |
index 1e66c3d49..0feb2f0e5 100644
|
|
|
1d35f3 |
--- a/lib/ext/cookie.c
|
|
|
1d35f3 |
+++ b/lib/ext/cookie.c
|
|
|
1d35f3 |
@@ -53,10 +53,9 @@ const hello_ext_entry_st ext_mod_cookie = {
|
|
|
1d35f3 |
/* Only client sends this extension. */
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
cookie_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
- ssize_t csize;
|
|
|
1d35f3 |
+ size_t csize;
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
gnutls_datum_t tmp;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
diff --git a/lib/ext/ec_point_formats.c b/lib/ext/ec_point_formats.c
|
|
|
1d35f3 |
index eb59ec139..c702d434c 100644
|
|
|
1d35f3 |
--- a/lib/ext/ec_point_formats.c
|
|
|
1d35f3 |
+++ b/lib/ext/ec_point_formats.c
|
|
|
1d35f3 |
@@ -57,11 +57,10 @@ const hello_ext_entry_st ext_mod_supported_ec_point_formats = {
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_supported_ec_point_formats_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
const uint8_t * data,
|
|
|
1d35f3 |
- size_t _data_size)
|
|
|
1d35f3 |
+ size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
- int len, i;
|
|
|
1d35f3 |
+ size_t len, i;
|
|
|
1d35f3 |
int uncompressed = 0;
|
|
|
1d35f3 |
- int data_size = _data_size;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
if (session->security_parameters.entity == GNUTLS_CLIENT) {
|
|
|
1d35f3 |
if (data_size < 1)
|
|
|
1d35f3 |
@@ -91,7 +90,7 @@ _gnutls_supported_ec_point_formats_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
/* only sanity check here. We only support uncompressed points
|
|
|
1d35f3 |
* and a client must support it thus nothing to check.
|
|
|
1d35f3 |
*/
|
|
|
1d35f3 |
- if (_data_size < 1)
|
|
|
1d35f3 |
+ if (data_size < 1)
|
|
|
1d35f3 |
return
|
|
|
1d35f3 |
gnutls_assert_val
|
|
|
1d35f3 |
(GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION);
|
|
|
1d35f3 |
diff --git a/lib/ext/key_share.c b/lib/ext/key_share.c
|
|
|
1d35f3 |
index 599eff8fb..8f0912e69 100644
|
|
|
1d35f3 |
--- a/lib/ext/key_share.c
|
|
|
1d35f3 |
+++ b/lib/ext/key_share.c
|
|
|
1d35f3 |
@@ -504,11 +504,10 @@ client_use_key_share(gnutls_session_t session, const gnutls_group_entry_st *grou
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
key_share_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
- ssize_t size;
|
|
|
1d35f3 |
+ size_t size;
|
|
|
1d35f3 |
unsigned gid;
|
|
|
1d35f3 |
const version_entry_st *ver;
|
|
|
1d35f3 |
const gnutls_group_entry_st *group;
|
|
|
1d35f3 |
diff --git a/lib/ext/max_record.c b/lib/ext/max_record.c
|
|
|
1d35f3 |
index dbb98cf62..3cada69be 100644
|
|
|
1d35f3 |
--- a/lib/ext/max_record.c
|
|
|
1d35f3 |
+++ b/lib/ext/max_record.c
|
|
|
1d35f3 |
@@ -65,10 +65,9 @@ const hello_ext_entry_st ext_mod_max_record_size = {
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_max_record_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
ssize_t new_size;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
if (session->internals.hsk_flags & HSK_RECORD_SIZE_LIMIT_NEGOTIATED)
|
|
|
1d35f3 |
return 0;
|
|
|
1d35f3 |
diff --git a/lib/ext/psk_ke_modes.c b/lib/ext/psk_ke_modes.c
|
|
|
1d35f3 |
index da7a55098..8d8effb43 100644
|
|
|
1d35f3 |
--- a/lib/ext/psk_ke_modes.c
|
|
|
1d35f3 |
+++ b/lib/ext/psk_ke_modes.c
|
|
|
1d35f3 |
@@ -106,10 +106,9 @@ psk_ke_modes_send_params(gnutls_session_t session,
|
|
|
1d35f3 |
*/
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
psk_ke_modes_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const unsigned char *data, size_t _len)
|
|
|
1d35f3 |
+ const unsigned char *data, size_t len)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
uint8_t ke_modes_len;
|
|
|
1d35f3 |
- ssize_t len = _len;
|
|
|
1d35f3 |
const version_entry_st *vers = get_version(session);
|
|
|
1d35f3 |
gnutls_psk_server_credentials_t cred;
|
|
|
1d35f3 |
int dhpsk_pos = MAX_POS;
|
|
|
1d35f3 |
diff --git a/lib/ext/record_size_limit.c b/lib/ext/record_size_limit.c
|
|
|
1d35f3 |
index e9fe6a1d8..0e94fece3 100644
|
|
|
1d35f3 |
--- a/lib/ext/record_size_limit.c
|
|
|
1d35f3 |
+++ b/lib/ext/record_size_limit.c
|
|
|
1d35f3 |
@@ -48,10 +48,9 @@ const hello_ext_entry_st ext_mod_record_size_limit = {
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_record_size_limit_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
ssize_t new_size;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
const version_entry_st *vers;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
DECR_LEN(data_size, 2);
|
|
|
1d35f3 |
diff --git a/lib/ext/safe_renegotiation.c b/lib/ext/safe_renegotiation.c
|
|
|
1d35f3 |
index 6424f45b5..bb4a57e45 100644
|
|
|
1d35f3 |
--- a/lib/ext/safe_renegotiation.c
|
|
|
1d35f3 |
+++ b/lib/ext/safe_renegotiation.c
|
|
|
1d35f3 |
@@ -265,10 +265,9 @@ int _gnutls_ext_sr_send_cs(gnutls_session_t session)
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_sr_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
unsigned int len;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
sr_ext_st *priv;
|
|
|
1d35f3 |
gnutls_ext_priv_data_t epriv;
|
|
|
1d35f3 |
int set = 0, ret;
|
|
|
1d35f3 |
diff --git a/lib/ext/server_cert_type.c b/lib/ext/server_cert_type.c
|
|
|
1d35f3 |
index dbcb3971b..864a44bbc 100644
|
|
|
1d35f3 |
--- a/lib/ext/server_cert_type.c
|
|
|
1d35f3 |
+++ b/lib/ext/server_cert_type.c
|
|
|
1d35f3 |
@@ -73,7 +73,6 @@ static int _gnutls_server_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
gnutls_certificate_type_t cert_type;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
uint8_t i, found = 0;
|
|
|
1d35f3 |
- ssize_t len = data_size;
|
|
|
1d35f3 |
const uint8_t* pdata = data;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
/* Only activate this extension if we have cert credentials set
|
|
|
1d35f3 |
@@ -86,7 +85,7 @@ static int _gnutls_server_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
|
|
|
1d35f3 |
/* Compare packet length with expected packet length. For the
|
|
|
1d35f3 |
* client this is a single byte. */
|
|
|
1d35f3 |
- if (len != 1) {
|
|
|
1d35f3 |
+ if (data_size != 1) {
|
|
|
1d35f3 |
return
|
|
|
1d35f3 |
gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
@@ -135,8 +134,8 @@ static int _gnutls_server_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
|
|
|
1d35f3 |
} else { // server mode
|
|
|
1d35f3 |
// Compare packet length with expected packet length.
|
|
|
1d35f3 |
- DECR_LEN(len, 1);
|
|
|
1d35f3 |
- if (data[0] != len) {
|
|
|
1d35f3 |
+ DECR_LEN(data_size, 1);
|
|
|
1d35f3 |
+ if (data[0] != data_size) {
|
|
|
1d35f3 |
return
|
|
|
1d35f3 |
gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
@@ -144,7 +143,7 @@ static int _gnutls_server_cert_type_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
|
|
|
1d35f3 |
// Assign the contents of our data buffer to a gnutls_datum_t
|
|
|
1d35f3 |
cert_types.data = (uint8_t*)pdata; // Need casting to get rid of 'discards const qualifier' warning
|
|
|
1d35f3 |
- cert_types.size = len;
|
|
|
1d35f3 |
+ cert_types.size = data_size;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
// Store the server certificate types in our session
|
|
|
1d35f3 |
_gnutls_hello_ext_set_datum(session,
|
|
|
1d35f3 |
diff --git a/lib/ext/server_name.c b/lib/ext/server_name.c
|
|
|
1d35f3 |
index 259dc998e..0c6331569 100644
|
|
|
1d35f3 |
--- a/lib/ext/server_name.c
|
|
|
1d35f3 |
+++ b/lib/ext/server_name.c
|
|
|
1d35f3 |
@@ -66,11 +66,10 @@ const hello_ext_entry_st ext_mod_server_name = {
|
|
|
1d35f3 |
*/
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_server_name_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
const unsigned char *p;
|
|
|
1d35f3 |
uint16_t len, type;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
gnutls_datum_t name;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
if (session->security_parameters.entity == GNUTLS_SERVER) {
|
|
|
1d35f3 |
diff --git a/lib/ext/session_ticket.c b/lib/ext/session_ticket.c
|
|
|
1d35f3 |
index 98db39ff8..263273fa2 100644
|
|
|
1d35f3 |
--- a/lib/ext/session_ticket.c
|
|
|
1d35f3 |
+++ b/lib/ext/session_ticket.c
|
|
|
1d35f3 |
@@ -78,7 +78,7 @@ static int
|
|
|
1d35f3 |
unpack_ticket(const gnutls_datum_t *ticket_data, struct ticket_st *ticket)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
const uint8_t * data = ticket_data->data;
|
|
|
1d35f3 |
- ssize_t data_size = ticket_data->size;
|
|
|
1d35f3 |
+ size_t data_size = ticket_data->size;
|
|
|
1d35f3 |
const uint8_t *encrypted_state;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
/* Format:
|
|
|
1d35f3 |
@@ -371,11 +371,10 @@ unpack_session(gnutls_session_t session, const gnutls_datum_t *state)
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
session_ticket_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
gnutls_datum_t ticket_data;
|
|
|
1d35f3 |
gnutls_datum_t state;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
if (session->internals.flags & GNUTLS_NO_TICKETS)
|
|
|
1d35f3 |
diff --git a/lib/ext/signature.c b/lib/ext/signature.c
|
|
|
1d35f3 |
index e734d2c7d..a90f58d53 100644
|
|
|
1d35f3 |
--- a/lib/ext/signature.c
|
|
|
1d35f3 |
+++ b/lib/ext/signature.c
|
|
|
1d35f3 |
@@ -187,9 +187,8 @@ _gnutls_sign_algorithm_parse_data(gnutls_session_t session,
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_signature_algorithm_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
const uint8_t * data,
|
|
|
1d35f3 |
- size_t _data_size)
|
|
|
1d35f3 |
+ size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
if (session->security_parameters.entity == GNUTLS_CLIENT) {
|
|
|
1d35f3 |
diff --git a/lib/ext/srp.c b/lib/ext/srp.c
|
|
|
1d35f3 |
index 8b58222e0..07f6e6883 100644
|
|
|
1d35f3 |
--- a/lib/ext/srp.c
|
|
|
1d35f3 |
+++ b/lib/ext/srp.c
|
|
|
1d35f3 |
@@ -59,10 +59,9 @@ const hello_ext_entry_st ext_mod_srp = {
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_srp_recv_params(gnutls_session_t session, const uint8_t * data,
|
|
|
1d35f3 |
- size_t _data_size)
|
|
|
1d35f3 |
+ size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
uint8_t len;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
gnutls_ext_priv_data_t epriv;
|
|
|
1d35f3 |
srp_ext_st *priv;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
diff --git a/lib/ext/srtp.c b/lib/ext/srtp.c
|
|
|
1d35f3 |
index 3fc7ed35a..412e26d45 100644
|
|
|
1d35f3 |
--- a/lib/ext/srtp.c
|
|
|
1d35f3 |
+++ b/lib/ext/srtp.c
|
|
|
1d35f3 |
@@ -162,13 +162,12 @@ const char *gnutls_srtp_get_profile_name(gnutls_srtp_profile_t profile)
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_srtp_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
unsigned int i;
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
const uint8_t *p = data;
|
|
|
1d35f3 |
- int len;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
+ size_t len;
|
|
|
1d35f3 |
srtp_ext_st *priv;
|
|
|
1d35f3 |
gnutls_ext_priv_data_t epriv;
|
|
|
1d35f3 |
uint16_t profile;
|
|
|
1d35f3 |
diff --git a/lib/ext/status_request.c b/lib/ext/status_request.c
|
|
|
1d35f3 |
index d8779e8cf..cf9d5bd03 100644
|
|
|
1d35f3 |
--- a/lib/ext/status_request.c
|
|
|
1d35f3 |
+++ b/lib/ext/status_request.c
|
|
|
1d35f3 |
@@ -86,9 +86,8 @@ client_send(gnutls_session_t session,
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
server_recv(gnutls_session_t session,
|
|
|
1d35f3 |
status_request_ext_st * priv,
|
|
|
1d35f3 |
- const uint8_t * data, size_t size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
- ssize_t data_size = size;
|
|
|
1d35f3 |
unsigned rid_bytes = 0;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
/* minimum message is type (1) + responder_id_list (2) +
|
|
|
1d35f3 |
diff --git a/lib/ext/supported_groups.c b/lib/ext/supported_groups.c
|
|
|
1d35f3 |
index 952d3bb0c..ef7859f73 100644
|
|
|
1d35f3 |
--- a/lib/ext/supported_groups.c
|
|
|
1d35f3 |
+++ b/lib/ext/supported_groups.c
|
|
|
1d35f3 |
@@ -93,10 +93,9 @@ static unsigned get_min_dh(gnutls_session_t session)
|
|
|
1d35f3 |
*/
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
_gnutls_supported_groups_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
int i;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
uint16_t len;
|
|
|
1d35f3 |
const uint8_t *p = data;
|
|
|
1d35f3 |
const gnutls_group_entry_st *group = NULL;
|
|
|
1d35f3 |
diff --git a/lib/ext/supported_versions.c b/lib/ext/supported_versions.c
|
|
|
1d35f3 |
index 52828ee37..8d52fad5c 100644
|
|
|
1d35f3 |
--- a/lib/ext/supported_versions.c
|
|
|
1d35f3 |
+++ b/lib/ext/supported_versions.c
|
|
|
1d35f3 |
@@ -54,12 +54,11 @@ const hello_ext_entry_st ext_mod_supported_versions = {
|
|
|
1d35f3 |
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
supported_versions_recv_params(gnutls_session_t session,
|
|
|
1d35f3 |
- const uint8_t * data, size_t _data_size)
|
|
|
1d35f3 |
+ const uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
const version_entry_st *vers;
|
|
|
1d35f3 |
- ssize_t data_size = _data_size;
|
|
|
1d35f3 |
uint8_t major, minor;
|
|
|
1d35f3 |
- ssize_t bytes;
|
|
|
1d35f3 |
+ size_t bytes;
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
if (session->security_parameters.entity == GNUTLS_SERVER) {
|
|
|
1d35f3 |
diff --git a/lib/extv.c b/lib/extv.c
|
|
|
1d35f3 |
index bfdfdf974..0c0c46f32 100644
|
|
|
1d35f3 |
--- a/lib/extv.c
|
|
|
1d35f3 |
+++ b/lib/extv.c
|
|
|
1d35f3 |
@@ -105,7 +105,7 @@ int gnutls_ext_raw_parse(void *ctx, gnutls_ext_raw_process_func cb,
|
|
|
1d35f3 |
const gnutls_datum_t *data, unsigned int flags)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
if (flags & GNUTLS_EXT_RAW_FLAG_TLS_CLIENT_HELLO) {
|
|
|
1d35f3 |
- ssize_t size = data->size;
|
|
|
1d35f3 |
+ size_t size = data->size;
|
|
|
1d35f3 |
size_t len;
|
|
|
1d35f3 |
uint8_t *p = data->data;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
@@ -137,12 +137,12 @@ int gnutls_ext_raw_parse(void *ctx, gnutls_ext_raw_process_func cb,
|
|
|
1d35f3 |
DECR_LEN(size, len);
|
|
|
1d35f3 |
p += len;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- if (size <= 0)
|
|
|
1d35f3 |
+ if (size == 0)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
return _gnutls_extv_parse(ctx, cb, p, size);
|
|
|
1d35f3 |
} else if (flags & GNUTLS_EXT_RAW_FLAG_DTLS_CLIENT_HELLO) {
|
|
|
1d35f3 |
- ssize_t size = data->size;
|
|
|
1d35f3 |
+ size_t size = data->size;
|
|
|
1d35f3 |
size_t len;
|
|
|
1d35f3 |
uint8_t *p = data->data;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
@@ -181,7 +181,7 @@ int gnutls_ext_raw_parse(void *ctx, gnutls_ext_raw_process_func cb,
|
|
|
1d35f3 |
DECR_LEN(size, len);
|
|
|
1d35f3 |
p += len;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- if (size <= 0)
|
|
|
1d35f3 |
+ if (size == 0)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
return _gnutls_extv_parse(ctx, cb, p, size);
|
|
|
1d35f3 |
diff --git a/lib/sslv2_compat.c b/lib/sslv2_compat.c
|
|
|
1d35f3 |
index 6122d1098..9d247ba4c 100644
|
|
|
1d35f3 |
--- a/lib/sslv2_compat.c
|
|
|
1d35f3 |
+++ b/lib/sslv2_compat.c
|
|
|
1d35f3 |
@@ -87,14 +87,13 @@ _gnutls_handshake_select_v2_suite(gnutls_session_t session,
|
|
|
1d35f3 |
*/
|
|
|
1d35f3 |
int
|
|
|
1d35f3 |
_gnutls_read_client_hello_v2(gnutls_session_t session, uint8_t * data,
|
|
|
1d35f3 |
- unsigned int datalen)
|
|
|
1d35f3 |
+ unsigned int len)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
uint16_t session_id_len = 0;
|
|
|
1d35f3 |
int pos = 0;
|
|
|
1d35f3 |
int ret = 0, sret = 0;
|
|
|
1d35f3 |
uint16_t sizeOfSuites;
|
|
|
1d35f3 |
uint8_t rnd[GNUTLS_RANDOM_SIZE], major, minor;
|
|
|
1d35f3 |
- int len = datalen;
|
|
|
1d35f3 |
int neg_version;
|
|
|
1d35f3 |
const version_entry_st *vers;
|
|
|
1d35f3 |
uint16_t challenge;
|
|
|
1d35f3 |
diff --git a/lib/supplemental.c b/lib/supplemental.c
|
|
|
1d35f3 |
index cd90fa1fb..07b38cc93 100644
|
|
|
1d35f3 |
--- a/lib/supplemental.c
|
|
|
1d35f3 |
+++ b/lib/supplemental.c
|
|
|
1d35f3 |
@@ -192,14 +192,14 @@ _gnutls_parse_supplemental(gnutls_session_t session,
|
|
|
1d35f3 |
const uint8_t * data, int datalen)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
const uint8_t *p = data;
|
|
|
1d35f3 |
- ssize_t dsize = datalen;
|
|
|
1d35f3 |
+ size_t dsize = datalen;
|
|
|
1d35f3 |
size_t total_size;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
DECR_LEN(dsize, 3);
|
|
|
1d35f3 |
total_size = _gnutls_read_uint24(p);
|
|
|
1d35f3 |
p += 3;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- if (dsize != (ssize_t) total_size) {
|
|
|
1d35f3 |
+ if (dsize != total_size) {
|
|
|
1d35f3 |
gnutls_assert();
|
|
|
1d35f3 |
return GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER;
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
diff --git a/lib/tls13/certificate.c b/lib/tls13/certificate.c
|
|
|
1d35f3 |
index bd257237f..8a1a11872 100644
|
|
|
1d35f3 |
--- a/lib/tls13/certificate.c
|
|
|
1d35f3 |
+++ b/lib/tls13/certificate.c
|
|
|
1d35f3 |
@@ -360,11 +360,12 @@ static int parse_cert_extension(void *_ctx, unsigned tls_id, const uint8_t *data
|
|
|
1d35f3 |
static int
|
|
|
1d35f3 |
parse_cert_list(gnutls_session_t session, uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
- int len, ret;
|
|
|
1d35f3 |
+ int ret;
|
|
|
1d35f3 |
+ size_t len;
|
|
|
1d35f3 |
uint8_t *p = data;
|
|
|
1d35f3 |
cert_auth_info_t info;
|
|
|
1d35f3 |
gnutls_certificate_credentials_t cred;
|
|
|
1d35f3 |
- ssize_t dsize = data_size, size;
|
|
|
1d35f3 |
+ size_t size;
|
|
|
1d35f3 |
int i;
|
|
|
1d35f3 |
unsigned npeer_certs, npeer_ocsp, j;
|
|
|
1d35f3 |
crt_cert_ctx_st ctx;
|
|
|
1d35f3 |
@@ -395,31 +396,31 @@ parse_cert_list(gnutls_session_t session, uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
if (info == NULL)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_INSUFFICIENT_CREDENTIALS);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- DECR_LEN(dsize, 3);
|
|
|
1d35f3 |
+ DECR_LEN(data_size, 3);
|
|
|
1d35f3 |
size = _gnutls_read_uint24(p);
|
|
|
1d35f3 |
p += 3;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- if (size != dsize)
|
|
|
1d35f3 |
+ if (size != data_size)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
if (size == 0)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_NO_CERTIFICATE_FOUND);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- i = dsize;
|
|
|
1d35f3 |
+ i = data_size;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
while (i > 0) {
|
|
|
1d35f3 |
- DECR_LEN(dsize, 3);
|
|
|
1d35f3 |
+ DECR_LEN(data_size, 3);
|
|
|
1d35f3 |
len = _gnutls_read_uint24(p);
|
|
|
1d35f3 |
if (len == 0)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- DECR_LEN(dsize, len);
|
|
|
1d35f3 |
+ DECR_LEN(data_size, len);
|
|
|
1d35f3 |
p += len + 3;
|
|
|
1d35f3 |
i -= len + 3;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- DECR_LEN(dsize, 2);
|
|
|
1d35f3 |
+ DECR_LEN(data_size, 2);
|
|
|
1d35f3 |
len = _gnutls_read_uint16(p);
|
|
|
1d35f3 |
- DECR_LEN(dsize, len);
|
|
|
1d35f3 |
+ DECR_LEN(data_size, len);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
i -= len + 2;
|
|
|
1d35f3 |
p += len + 2;
|
|
|
1d35f3 |
@@ -427,7 +428,7 @@ parse_cert_list(gnutls_session_t session, uint8_t * data, size_t data_size)
|
|
|
1d35f3 |
nentries++;
|
|
|
1d35f3 |
}
|
|
|
1d35f3 |
|
|
|
1d35f3 |
- if (dsize != 0)
|
|
|
1d35f3 |
+ if (data_size != 0)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
/* this is unnecessary - keeping to avoid a regression due to a re-org
|
|
|
1d35f3 |
diff --git a/lib/tls13/psk_ext_parser.c b/lib/tls13/psk_ext_parser.c
|
|
|
1d35f3 |
index 6e3a12f90..33ebc0461 100644
|
|
|
1d35f3 |
--- a/lib/tls13/psk_ext_parser.c
|
|
|
1d35f3 |
+++ b/lib/tls13/psk_ext_parser.c
|
|
|
1d35f3 |
@@ -28,10 +28,8 @@
|
|
|
1d35f3 |
* are present, or 0, on success.
|
|
|
1d35f3 |
*/
|
|
|
1d35f3 |
int _gnutls13_psk_ext_parser_init(psk_ext_parser_st *p,
|
|
|
1d35f3 |
- const unsigned char *data, size_t _len)
|
|
|
1d35f3 |
+ const unsigned char *data, size_t len)
|
|
|
1d35f3 |
{
|
|
|
1d35f3 |
- ssize_t len = _len;
|
|
|
1d35f3 |
-
|
|
|
1d35f3 |
if (!p || !data || !len)
|
|
|
1d35f3 |
return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
|
|
|
1d35f3 |
|
|
|
1d35f3 |
diff --git a/lib/tls13/psk_ext_parser.h b/lib/tls13/psk_ext_parser.h
|
|
|
1d35f3 |
index 30b47e904..f46b211e0 100644
|
|
|
1d35f3 |
--- a/lib/tls13/psk_ext_parser.h
|
|
|
1d35f3 |
+++ b/lib/tls13/psk_ext_parser.h
|
|
|
1d35f3 |
@@ -25,10 +25,10 @@
|
|
|
1d35f3 |
|
|
|
1d35f3 |
struct psk_ext_parser_st {
|
|
|
1d35f3 |
const unsigned char *identities_data;
|
|
|
1d35f3 |
- ssize_t identities_len;
|
|
|
1d35f3 |
+ size_t identities_len;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
const unsigned char *binders_data;
|
|
|
1d35f3 |
- ssize_t binders_len;
|
|
|
1d35f3 |
+ size_t binders_len;
|
|
|
1d35f3 |
};
|
|
|
1d35f3 |
|
|
|
1d35f3 |
typedef struct psk_ext_parser_st psk_ext_parser_st;
|
|
|
1d35f3 |
diff --git a/lib/tls13/session_ticket.c b/lib/tls13/session_ticket.c
|
|
|
1d35f3 |
index 146aee9b1..072a56d9c 100644
|
|
|
1d35f3 |
--- a/lib/tls13/session_ticket.c
|
|
|
1d35f3 |
+++ b/lib/tls13/session_ticket.c
|
|
|
1d35f3 |
@@ -105,7 +105,7 @@ unpack_ticket(gnutls_session_t session, gnutls_datum_t *packed, tls13_ticket_st
|
|
|
1d35f3 |
gnutls_mac_algorithm_t kdf;
|
|
|
1d35f3 |
const mac_entry_st *prf;
|
|
|
1d35f3 |
uint8_t *p;
|
|
|
1d35f3 |
- ssize_t len;
|
|
|
1d35f3 |
+ size_t len;
|
|
|
1d35f3 |
uint64_t v;
|
|
|
1d35f3 |
int ret;
|
|
|
1d35f3 |
|
|
|
1d35f3 |
--
|
|
|
1d35f3 |
2.21.0
|
|
|
1d35f3 |
|