| 416 | */ |
| 417 | |
| 418 | int // O - 1 if valid, 0 otherwise |
| 419 | httpCredentialsAreValidForName( |
| 420 | cups_array_t *credentials, // I - Credentials |
| 421 | const char *common_name) // I - Name to check |
| 422 | { |
| 423 | X509 *cert; // Certificate |
| 424 | int result = 0; // Result |
| 425 | |
| 426 | |
| 427 | cert = http_create_credential((http_credential_t *)cupsArrayFirst(credentials)); |
| 428 | if (cert) |
| 429 | { |
| 430 | result = X509_check_host(cert, common_name, strlen(common_name), 0, NULL); |
| 431 | |
| 432 | X509_free(cert); |
| 433 | } |
| 434 | |
| 435 | return (result); |
| 436 | } |
| 437 | |
| 438 | |
| 439 | /* |
no test coverage detected