* Check if the SSL protocol value given in input is valid or not. * This is used as a sanity check routine for the connection parameters * ssl_min_protocol_version and ssl_max_protocol_version. */
| 7402 | * ssl_min_protocol_version and ssl_max_protocol_version. |
| 7403 | */ |
| 7404 | static bool |
| 7405 | sslVerifyProtocolVersion(const char *version) |
| 7406 | { |
| 7407 | /* |
| 7408 | * An empty string and a NULL value are considered valid as it is |
| 7409 | * equivalent to ignoring the parameter. |
| 7410 | */ |
| 7411 | if (!version || strlen(version) == 0) |
| 7412 | return true; |
| 7413 | |
| 7414 | if (pg_strcasecmp(version, "TLSv1") == 0 || |
| 7415 | pg_strcasecmp(version, "TLSv1.1") == 0 || |
| 7416 | pg_strcasecmp(version, "TLSv1.2") == 0 || |
| 7417 | pg_strcasecmp(version, "TLSv1.3") == 0) |
| 7418 | return true; |
| 7419 | |
| 7420 | /* anything else is wrong */ |
| 7421 | return false; |
| 7422 | } |
| 7423 | |
| 7424 | |
| 7425 | /* |
no test coverage detected