MCPcopy Create free account
hub / github.com/OpenPrinting/cups / if

Function if

cups/auth.c:494–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492
493# ifdef DEBUG
494 else if (major_status == GSS_S_CONTINUE_NEEDED)
495 cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: Continuation needed");
496# endif /* DEBUG */
497
498 if (output_token.length > 0 && output_token.length <= 65536)
499 {
500 /*
501 * Allocate the authorization string since Windows KDCs can have
502 * arbitrarily large credentials...
503 */
504
505 int authsize = 10 + /* "Negotiate " */
506 (((int)output_token.length * 4 / 3 + 3) & ~3) + 1;
507 /* Base64 + nul */
508
509 httpSetAuthString(http, NULL, NULL);
510
511 if ((http->authstring = malloc((size_t)authsize)) == NULL)
512 {
513 http->authstring = http->_authstring;
514 authsize = sizeof(http->_authstring);
515 }
516
517 strlcpy(http->authstring, "Negotiate ", (size_t)authsize);
518 httpEncode64_2(http->authstring + 10, authsize - 10, output_token.value,
519 (int)output_token.length);
520
521 gss_release_buffer(&minor_status, &output_token);
522 }
523 else
524 {
525 DEBUG_printf(("1_cupsSetNegotiateAuthString: Kerberos credentials too "

Callers 2

run_as_userFunction · 0.50

Calls 3

cups_gss_printfFunction · 0.85
httpSetAuthStringFunction · 0.85
httpEncode64_2Function · 0.85

Tested by

no test coverage detected