Home | History | Annotate | Download | only in cups

Lines Matching full:credentials

352  * 'cupsSetServerCredentials()' - Set the default server credentials.
354 * Note: The server credentials are used by all threads in the running process.
423 * 'httpCopyCredentials()' - Copy the credentials associated with the peer in
432 cups_array_t **credentials) /* O - Array of credentials */
436 CFIndex count; /* Number of credentials */
442 DEBUG_printf(("httpCopyCredentials(http=%p, credentials=%p)", (void *)http, (void *)credentials));
444 if (credentials)
445 *credentials = NULL;
447 if (!http || !http->tls || !credentials)
454 if ((*credentials = cupsArrayNew(NULL, NULL)) != NULL)
477 httpAddCredential(*credentials, CFDataGetBytePtr(data), (size_t)CFDataGetLength(data));
491 * '_httpCreateCredentials()' - Create credentials in the internal format.
494 http_tls_credentials_t /* O - Internal credentials */
496 cups_array_t *credentials) /* I - Array of credentials */
498 CFMutableArrayRef peerCerts; /* Peer credentials reference */
503 if (!credentials)
507 cupsArrayCount(credentials),
511 for (credential = (http_credential_t *)cupsArrayFirst(credentials);
513 credential = (http_credential_t *)cupsArrayNext(credentials))
527 * 'httpCredentialsAreValidForName()' - Return whether the credentials are valid for the given name.
534 cups_array_t *credentials, /* I - Credentials */
544 if ((secCert = http_cdsa_create_credential((http_credential_t *)cupsArrayFirst(credentials))) == NULL)
590 * 'httpCredentialsGetTrust()' - Return the trust of credentials.
597 cups_array_t *credentials, /* I - Credentials */
603 cups_array_t *tcreds = NULL; /* Trusted credentials */
614 if ((secCert = http_cdsa_create_credential((http_credential_t *)cupsArrayFirst(credentials))) == NULL)
616 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to create credentials from array."), 1);
631 char credentials_str[1024], /* String for incoming credentials */
632 tcreds_str[1024]; /* String for saved credentials */
634 httpCredentialsString(credentials, credentials_str, sizeof(credentials_str));
640 * Credentials don't match, let's look at the expiration date of the new
641 * credentials and allow if the new ones have a later expiration...
654 else if (httpCredentialsGetExpiration(credentials) <= httpCredentialsGetExpiration(tcreds))
657 * The new credentials are not newly issued...
660 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("New credentials are older than stored credentials."), 1);
664 else if (!httpCredentialsAreValidForName(credentials, common_name))
670 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("New credentials are not valid for name."), 1);
677 * Save the renewed credentials...
682 httpSaveCredentials(NULL, credentials, common_name);
688 else if (cg->validate_certs && !httpCredentialsAreValidForName(credentials, common_name))
690 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No stored credentials, not valid for name."), 1);
701 if (cupsArrayCount(credentials) != (cupsArrayCount(tcreds) + 1))
717 for (a = (http_credential_t *)cupsArrayFirst(tcreds), b = (http_credential_t *)cupsArrayIndex(credentials, 1);
719 a = (http_credential_t *)cupsArrayNext(tcreds), b = (http_credential_t *)cupsArrayNext(credentials))
728 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Credentials do not validate against site CA certificate."), 1);
739 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Credentials have expired."), 1);
743 if (trust == HTTP_TRUST_OK && !cg->any_root && cupsArrayCount(credentials) == 1)
745 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Self-signed credentials are blocked."), 1);
756 * 'httpCredentialsGetExpiration()' - Return the expiration date of the credentials.
761 time_t /* O - Expiration date of credentials */
763 cups_array_t *credentials) /* I - Credentials */
769 if ((secCert = http_cdsa_create_credential((http_credential_t *)cupsArrayFirst(credentials))) == NULL)
781 * 'httpCredentialsString()' - Return a string representing the credentials.
786 size_t /* O - Total size of credentials string */
788 cups_array_t *credentials, /* I - Credentials */
796 DEBUG_printf(("httpCredentialsString(credentials=%p, buffer=%p, bufsize=" CUPS_LLFMT ")", (void *)credentials, (void *)buffer, CUPS_LLCAST bufsize));
804 if ((first = (http_credential_t *)cupsArrayFirst(credentials)) != NULL &&
839 * '_httpFreeCredentials()' - Free internal credentials.
844 http_tls_credentials_t credentials) /* I - Internal credentials */
846 if (!credentials)
849 CFRelease(credentials);
854 * 'httpLoadCredentials()' - Load X.509 credentials from a keychain file.
862 cups_array_t **credentials, /* IO - Credentials */
863 const char *common_name) /* I - Common name for credentials */
880 DEBUG_printf(("httpLoadCredentials(path=\"%s\", credentials=%p, common_name=\"%s\")", path, (void *)credentials, common_name));
882 if (!credentials)
885 *credentials = NULL;
943 *credentials = cupsArrayNew(NULL, NULL);
944 httpAddCredential(*credentials, CFDataGetBytePtr(data), (size_t)CFDataGetLength(data));
964 DEBUG_printf(("1httpLoadCredentials: Returning %d.", *credentials ? 0 : -1));
966 return (*credentials ? 0 : -1);
971 * 'httpSaveCredentials()' - Save X.509 credentials to a keychain file.
979 cups_array_t *credentials, /* I - Credentials */
980 const char *common_name) /* I - Common name for credentials */
993 DEBUG_printf(("httpSaveCredentials(path=\"%s\", credentials=%p, common_name=\"%s\")", path, (void *)credentials, common_name));
994 if (!credentials)
997 if (!httpCredentialsAreValidForName(credentials, common_name))
1003 if ((cert = http_cdsa_create_credential((http_credential_t *)cupsArrayFirst(credentials))) == NULL)
1161 cups_array_t *credentials; /* Credentials array */
1164 CFIndex count; /* Number of credentials */
1185 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Server credentials not set."), 1);
1374 * Client: set client-side credentials, if any...
1439 DEBUG_printf(("4_httpTLSStart: Auto-create credentials for \"%s\".", hostname[0] ? hostname : tls_common_name));
1446 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to create server credentials."), 1);
1456 DEBUG_puts("4_httpTLSStart: Unable to find server credentials.");
1459 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to find server credentials."), 1);
1528 error = httpCopyCredentials(http, &credentials);
1531 error = (cg->server_cert_cb)(http, http->tls, credentials,
1533 httpFreeCredentials(credentials);
1734 * 'http_cdsa_copy_server()' - Find and copy server credentials from the keychain.
2106 * 'http_cdsa_set_credentials()' - Set the TLS credentials.
2114 http_tls_credentials_t credentials = NULL;
2115 /* TLS credentials */
2121 * Prefer connection specific credentials...
2124 if ((credentials = http->tls_credentials) == NULL)
2125 credentials = cg->tls_credentials;
2127 if (credentials)
2129 error = SSLSetCertificate(http->tls, credentials);
2134 DEBUG_puts("4http_tls_set_credentials: No credentials to set.");