Check to see if a given client name is contained in the provided set (allowlist/blocklist) * Return true if it does */
| 520 | /* Check to see if a given client name is contained in the provided set (allowlist/blocklist) |
| 521 | * Return true if it does */ |
| 522 | bool tlsCheckAgainstAllowlist(const char * client, std::set<sdsstring> set){ |
| 523 | /* Because of wildcard matching, we need to iterate over the entire set. |
| 524 | * If we were doing simply straight matching, we could just directly |
| 525 | * check to see if the client name is in the set in O(1) time */ |
| 526 | for (auto &client_pattern: set){ |
| 527 | if (stringmatchlen(client_pattern.get(), client_pattern.size(), client, strlen(client), 1)) |
| 528 | return true; |
| 529 | } |
| 530 | return false; |
| 531 | } |
| 532 | |
| 533 | /* Sets the sha256 certificate fingerprint on the connection |
| 534 | * Based on the example here https://fm4dd.com/openssl/certfprint.shtm */ |
no test coverage detected