TLS/SSL connection method set incorrectly
Program calls functions that do not match role set by connection method
Since R2020a
Description
The defect occurs when you call functions that do not match the role set by the connection method that you specified for the SSL context.
The functions that you call when handling a TLS/SSL connection between client and server
entities are different, depending on the role of the entity. For instance, the connection
between a server and a client begins with a handshake. The client always initiates the
handshake. You use SSL_accept
with a server entity to wait for a client to
initiate the handshake.
Typically, you set a connection method when you initiate the SSL context. The method specifies the role of the entity.
The checker flags the use of functions that do not match the connection method specified for the SSL context. See the Event column in the Results Details pane to view connection method specified for the SSL context.
Risk
If you set the TLS/SSL connection method incorrectly, the functions you use to handle
the connection might not match the role specified by the method. For instance, you use
SSL_accept
with a client entity to wait for a client to initiate a
handshake instead of SSL_connect
to initiate the handshake with a
server.
Fix
Make sure that you use functions that match the TLS/SSL connection method to handle the connection.
Examples
Result Information
Group: Cryptography |
Language: C | C++ |
Default: Off |
Command-Line Syntax:
CRYPTO_SSL_BAD_ROLE |
Impact: Medium |
Version History
Introduced in R2020a
See Also
Find defects
(-checkers)
| Missing certification authority
list
| TLS/SSL connection method not
set
| Missing X.509
certificate
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)