| 499 | } |
| 500 | |
| 501 | static X509Location locationForNID(NID nid) { |
| 502 | const char* name = OBJ_nid2ln(nid); |
| 503 | if (name == nullptr) { |
| 504 | throw std::runtime_error("locationForNID"); |
| 505 | } |
| 506 | if (strncmp(name, "X509v3", 6) == 0) { |
| 507 | return X509Location::EXTENSION; |
| 508 | } else { |
| 509 | // It probably isn't true that all other NIDs live in the NAME, but it is for now... |
| 510 | return X509Location::NAME; |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | void TLSPolicy::set_verify_peers(std::vector<std::string> verify_peers) { |
| 515 | for (int i = 0; i < verify_peers.size(); i++) { |