Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
external
mbedtls
Commits
14bf7063
Commit
14bf7063
authored
Jun 23, 2015
by
Manuel Pégourié-Gonnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SSL "assertions" to help static analyzers
scan-build was reporting NULL dereferences
parent
b9c93d0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
library/ssl_tls.c
library/ssl_tls.c
+11
-1
No files found.
library/ssl_tls.c
View file @
14bf7063
...
...
@@ -2686,6 +2686,13 @@ int mbedtls_ssl_write_record( mbedtls_ssl_context *ssl )
#endif
if
(
ssl
->
out_msgtype
==
MBEDTLS_SSL_MSG_HANDSHAKE
)
{
if
(
ssl
->
out_msg
[
0
]
!=
MBEDTLS_SSL_HS_HELLO_REQUEST
&&
ssl
->
handshake
==
NULL
)
{
MBEDTLS_SSL_DEBUG_MSG
(
1
,
(
"should never happen"
)
);
return
(
MBEDTLS_ERR_SSL_INTERNAL_ERROR
);
}
ssl
->
out_msg
[
1
]
=
(
unsigned
char
)(
(
len
-
4
)
>>
16
);
ssl
->
out_msg
[
2
]
=
(
unsigned
char
)(
(
len
-
4
)
>>
8
);
ssl
->
out_msg
[
3
]
=
(
unsigned
char
)(
(
len
-
4
)
);
...
...
@@ -3118,8 +3125,11 @@ static int ssl_prepare_handshake_record( mbedtls_ssl_context *ssl )
return
(
MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE
);
}
if
(
ssl
->
state
!=
MBEDTLS_SSL_HANDSHAKE_OVER
)
if
(
ssl
->
state
!=
MBEDTLS_SSL_HANDSHAKE_OVER
&&
ssl
->
handshake
!=
NULL
)
{
ssl
->
handshake
->
update_checksum
(
ssl
,
ssl
->
in_msg
,
ssl
->
in_hslen
);
}
/* Handshake message is complete, increment counter */
#if defined(MBEDTLS_SSL_PROTO_DTLS)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment