| 1278 | } |
| 1279 | |
| 1280 | static ssl_mode ssl_string_to_mode(const char *s, int *nid_dbname) |
| 1281 | { |
| 1282 | if (strcasecmp(SSL_MODE_PREFER, s) == 0) |
| 1283 | return SSL_PREFER; |
| 1284 | if (strcasecmp(SSL_MODE_PREFER_VERIFY_CA, s) == 0) |
| 1285 | return SSL_PREFER_VERIFY_CA; |
| 1286 | if (strcasecmp(SSL_MODE_PREFER_VERIFY_HOST, s) == 0) |
| 1287 | return SSL_PREFER_VERIFY_HOSTNAME; |
| 1288 | if (strcasecmp(SSL_MODE_PREFER_VERIFY_DBNAME, s) == 0) |
| 1289 | return SSL_PREFER_VERIFY_DBNAME; |
| 1290 | if (strcasecmp(SSL_MODE_REQUIRE, s) == 0) |
| 1291 | return SSL_REQUIRE; |
| 1292 | if (strcasecmp(SSL_MODE_VERIFY_CA, s) == 0) |
| 1293 | return SSL_VERIFY_CA; |
| 1294 | if (strcasecmp(SSL_MODE_VERIFY_HOST, s) == 0) |
| 1295 | return SSL_VERIFY_HOSTNAME; |
| 1296 | if (strncasecmp(SSL_MODE_VERIFY_DBNAME, s, |
| 1297 | sizeof(SSL_MODE_VERIFY_DBNAME) - 1) == 0) { |
| 1298 | s += sizeof(SSL_MODE_VERIFY_DBNAME); |
| 1299 | if (nid_dbname != NULL) { |
| 1300 | s = cdb2_skipws(s); |
| 1301 | *nid_dbname = (*s != '\0') ? OBJ_txt2nid(s) : cdb2_nid_dbname; |
| 1302 | } |
| 1303 | return SSL_VERIFY_DBNAME; |
| 1304 | } |
| 1305 | return SSL_ALLOW; |
| 1306 | } |
| 1307 | |
| 1308 | static void only_read_config(cdb2_hndl_tp *, int, int); /* FORWARD */ |
| 1309 |
no outgoing calls
no test coverage detected