TLS/SSL connection method not set
Description
The defect occurs when you call one of these functions without explicitly setting the connection method of the TLS/SSL context.
SSL_read
SSL_write
SSL_do_handshake
The communication between server and client entities that use a TLS/SSL connection begins with a handshake. During the handshake, the parties exchange information and establish the encryption algorithm and session keys the parties use during the session. The connection methods for the server and client use different routines for the handshake.
The checker raises no defect if:
You use
SSL_connect
(client) andSSL_accept
(server) functions. These functions set the correct handshake routines automatically.You pass the SSL context as an argument to the function that calls
SSL_new
.You declare the SSL context outside the scope of the function handling the connection.
Risk
You cannot begin a handshake if the SSL engine does not know which connection method routines to call.
Fix
For client handshake routines, call
SSL_set_connect_state
before you begin the handshake.For server handshake routines, call
SSL_set_accept_state
before you begin the handshake.
Examples
Result Information
Group: Cryptography |
Language: C | C++ |
Default: Off |
Command-Line Syntax:
CRYPTO_SSL_NO_ROLE |
Impact: Medium |
Version History
Introduced in R2020a
See Also
Find defects
(-checkers)
| Missing X.509
certificate
| Missing certification authority
list
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)