• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:http

88 static gss_name_t cups_gss_getname(http_t *http, const char *service_name);
96 static int cups_local_auth(http_t *http);
110 http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */ in cupsDoAuthentication() argument
123 …DEBUG_printf(("cupsDoAuthentication(http=%p, method=\"%s\", resource=\"%s\")", (void *)http, metho… in cupsDoAuthentication()
125 if (!http) in cupsDoAuthentication()
126 http = _cupsConnect(); in cupsDoAuthentication()
128 if (!http || !method || !resource) in cupsDoAuthentication()
132 http->digest_tries, http->userpass)); in cupsDoAuthentication()
134 httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE))); in cupsDoAuthentication()
140 httpSetAuthString(http, NULL, NULL); in cupsDoAuthentication()
146 if (http->digest_tries < 3) in cupsDoAuthentication()
148 if ((localauth = cups_local_auth(http)) == 0) in cupsDoAuthentication()
151 http->authstring)); in cupsDoAuthentication()
153 if (http->status == HTTP_STATUS_UNAUTHORIZED) in cupsDoAuthentication()
154 http->digest_tries ++; in cupsDoAuthentication()
160 http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED; in cupsDoAuthentication()
169 www_auth = http->fields[HTTP_FIELD_WWW_AUTHENTICATE]; in cupsDoAuthentication()
171 if ((http->digest_tries > 1 || !http->userpass[0]) && in cupsDoAuthentication()
187 if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username", in cupsDoAuthentication()
194 http->hostname[0] == '/' ? "localhost" : http->hostname); in cupsDoAuthentication()
196 http->digest_tries = _cups_strncasecmp(www_auth, "Digest", 6) != 0; in cupsDoAuthentication()
197 http->userpass[0] = '\0'; in cupsDoAuthentication()
199 if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL) in cupsDoAuthentication()
201 http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED; in cupsDoAuthentication()
205 snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(), in cupsDoAuthentication()
208 else if (http->status == HTTP_STATUS_UNAUTHORIZED) in cupsDoAuthentication()
209 http->digest_tries ++; in cupsDoAuthentication()
211 if (http->status == HTTP_STATUS_UNAUTHORIZED && http->digest_tries >= 3) in cupsDoAuthentication()
214 http->digest_tries)); in cupsDoAuthentication()
216 http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED; in cupsDoAuthentication()
231 if (_cupsSetNegotiateAuthString(http, method, resource)) in cupsDoAuthentication()
233 http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED; in cupsDoAuthentication()
248 httpEncode64_2(encode, sizeof(encode), http->userpass, in cupsDoAuthentication()
249 (int)strlen(http->userpass)); in cupsDoAuthentication()
250 httpSetAuthString(http, "Basic", encode); in cupsDoAuthentication()
261 httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm); in cupsDoAuthentication()
262 httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce); in cupsDoAuthentication()
264 httpMD5(cupsUser(), realm, strchr(http->userpass, ':') + 1, encode); in cupsDoAuthentication()
269 httpSetAuthString(http, "Digest", digest); in cupsDoAuthentication()
275 http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED; in cupsDoAuthentication()
279 DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\"", http->authstring)); in cupsDoAuthentication()
292 http_t *http, /* I - Connection to server */ in _cupsSetNegotiateAuthString() argument
319 if (http->gssname == GSS_C_NO_NAME) in _cupsSetNegotiateAuthString()
321 http->gssname = cups_gss_getname(http, _cupsGSSServiceName()); in _cupsSetNegotiateAuthString()
324 if (http->gssctx != GSS_C_NO_CONTEXT) in _cupsSetNegotiateAuthString()
326 gss_delete_sec_context(&minor_status, &http->gssctx, GSS_C_NO_BUFFER); in _cupsSetNegotiateAuthString()
327 http->gssctx = GSS_C_NO_CONTEXT; in _cupsSetNegotiateAuthString()
331 &http->gssctx, in _cupsSetNegotiateAuthString()
332 http->gssname, http->gssmech, in _cupsSetNegotiateAuthString()
336 GSS_C_NO_BUFFER, &http->gssmech, in _cupsSetNegotiateAuthString()
360 cupsUser(), http->gsshost); in _cupsSetNegotiateAuthString()
362 if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL) in _cupsSetNegotiateAuthString()
372 snprintf(userbuf, sizeof(userbuf), "%s@%s", username, http->gsshost); in _cupsSetNegotiateAuthString()
404 &http->gssctx, in _cupsSetNegotiateAuthString()
405 http->gssname, http->gssmech, in _cupsSetNegotiateAuthString()
409 GSS_C_NO_BUFFER, &http->gssmech, in _cupsSetNegotiateAuthString()
442 httpSetAuthString(http, NULL, NULL); in _cupsSetNegotiateAuthString()
444 if ((http->authstring = malloc((size_t)authsize)) == NULL) in _cupsSetNegotiateAuthString()
446 http->authstring = http->_authstring; in _cupsSetNegotiateAuthString()
447 authsize = sizeof(http->_authstring); in _cupsSetNegotiateAuthString()
450 strlcpy(http->authstring, "Negotiate ", (size_t)authsize); in _cupsSetNegotiateAuthString()
451 httpEncode64_2(http->authstring + 10, authsize - 10, output_token.value, in _cupsSetNegotiateAuthString()
505 http_t *http, /* I - Connection to server */ in cups_gss_getname() argument
516 DEBUG_printf(("7cups_gss_getname(http=%p, service_name=\"%s\")", http, in cups_gss_getname()
524 if (!http->gsshost[0]) in cups_gss_getname()
526 httpGetHostname(http, http->gsshost, sizeof(http->gsshost)); in cups_gss_getname()
528 if (!strcmp(http->gsshost, "localhost")) in cups_gss_getname()
530 if (gethostname(http->gsshost, sizeof(http->gsshost)) < 0) in cups_gss_getname()
534 http->gsshost[0] = '\0'; in cups_gss_getname()
538 if (!strchr(http->gsshost, '.')) in cups_gss_getname()
546 if ((host = gethostbyname(http->gsshost)) != NULL && host->h_name) in cups_gss_getname()
552 strlcpy(http->gsshost, host->h_name, sizeof(http->gsshost)); in cups_gss_getname()
557 http->gsshost)); in cups_gss_getname()
558 http->gsshost[0] = '\0'; in cups_gss_getname()
569 snprintf(buf, sizeof(buf), "%s@%s", service_name, http->gsshost); in cups_gss_getname()
640 cups_local_auth(http_t *http) /* I - HTTP connection to server */ in cups_local_auth() argument
665 …) hostaddr=%s, hostname=\"%s\"", (void *)http, httpAddrString(http->hostaddr, filename, sizeof(fil… in cups_local_auth()
671 if (!httpAddrLocalhost(http->hostaddr) && in cups_local_auth()
672 _cups_strcasecmp(http->hostname, "localhost") != 0) in cups_local_auth()
683 if (http->auth_ref) in cups_local_auth()
685 AuthorizationFree(http->auth_ref, kAuthorizationFlagDefaults); in cups_local_auth()
686 http->auth_ref = NULL; in cups_local_auth()
690 httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey", in cups_local_auth()
694 kAuthorizationFlagDefaults, &http->auth_ref); in cups_local_auth()
715 status = AuthorizationCopyRights(http->auth_ref, &auth_rights, in cups_local_auth()
719 status = AuthorizationMakeExternalForm(http->auth_ref, &auth_extrn); in cups_local_auth()
730 httpSetAuthString(http, "AuthRef", buffer); in cups_local_auth()
733 http->authstring)); in cups_local_auth()
757 _cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) && in cups_local_auth()
760 !httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey", in cups_local_auth()
763 http->hostaddr->addr.sa_family == AF_LOCAL && in cups_local_auth()
777 httpSetAuthString(http, "PeerCred", username); in cups_local_auth()
780 http->authstring)); in cups_local_auth()
804 if (!_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9)) in cups_local_auth()
815 if (httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey", in cups_local_auth()
825 if (!httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "trc", trc, in cups_local_auth()
857 httpSetAuthString(http, "Local", certificate); in cups_local_auth()
860 http->authstring)); in cups_local_auth()