• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/MITKerberosShim-66/mittestcc/

Lines Matching refs:ccache

137 	cc_ccache_t ccache = NULL;
152 * a ccache is created
153 * a ccache is destroyed
156 * a ccache principal is changed
157 * the default ccache is changed
167 // make sure we have a default ccache
168 err = cc_context_open_default_ccache(context, &ccache);
170 err = cc_context_create_default_ccache(context, cc_credentials_v5, "foo/bar@BAZ.ORG", &ccache);
173 err = cc_ccache_release(ccache);
175 // either the default ccache already existed or we just created it
179 // create a ccache
180 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
181 check_once_cc_context_get_change_time(context, &last_change_time, ccNoError, "after creating a new ccache");
186 err = cc_ccache_store_credentials(ccache, &creds_union);
193 err = cc_ccache_set_principal(ccache, cc_credentials_v5, "foo@BAR.ORG");
195 log_error("failed to change ccache's principal - %s (%d)", translate_ccapi_error(err), err);
204 err = cc_ccache_new_credentials_iterator(ccache, &creds_iterator);
213 err = cc_ccache_remove_credentials(ccache, credentials);
218 // change default ccache
219 err = cc_ccache_set_default(ccache);
220 check_once_cc_context_get_change_time(context, &last_change_time, ccNoError, "after changing default ccache");
223 if (ccache) {
224 // destroy a ccache
225 err = cc_ccache_destroy(ccache);
226 check_once_cc_context_get_change_time(context, &last_change_time, ccNoError, "after destroying a ccache");
278 cc_ccache_t ccache = NULL;
295 err = cc_context_open_default_ccache(context, &ccache);
302 err = cc_context_create_default_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
303 if (ccache) { cc_ccache_release(ccache); }
354 cc_ccache_t ccache = NULL;
366 // make sure we have a default ccache
367 err = cc_context_open_default_ccache(context, &ccache);
369 err = cc_context_create_default_ccache(context, cc_credentials_v5, "foo/bar@BAZ.ORG", &ccache);
372 err = cc_ccache_release(ccache);
373 ccache = NULL;
376 // try default ccache
379 err = check_once_cc_context_open_ccache(context, name->data, &ccache, ccNoError, NULL);
383 err = check_once_cc_context_open_ccache(context, NULL, &ccache, ccErrBadParam, NULL);
386 // try a ccache that doesn't exist (create one and then destroy it)
387 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
389 err = cc_ccache_get_name(ccache, &name);
392 err = cc_ccache_destroy(ccache);
393 ccache = NULL;
396 err = check_once_cc_context_open_ccache(context, name->data, &ccache, ccErrCCacheNotFound, NULL);
406 cc_int32 check_once_cc_context_open_ccache(cc_context_t context, const char *name, cc_ccache_t *ccache, cc_int32 expected_err, const char *description) {
425 if (ccache != NULL) { // if we were passed NULL, then we're looking to pass a bad param
426 err = cc_context_open_ccache(context, name, ccache);
435 check_if(*ccache == NULL, NULL);
438 err = cc_ccache_get_name(*ccache, &stored_name);
446 if (ccache && *ccache) {
447 cc_ccache_release(*ccache);
448 *ccache = NULL;
462 cc_ccache_t ccache = NULL;
473 // make sure we have a default ccache
474 err = cc_context_create_default_ccache(context, cc_credentials_v5, "foo/bar@BAZ.ORG", &ccache);
475 if (ccache) { cc_ccache_release(ccache); }
477 // try default ccache
479 err = check_once_cc_context_open_default_ccache(context, &ccache, ccNoError, NULL);
485 // try with no default ccache (destroy all ccaches first)
488 err = check_once_cc_context_open_default_ccache(context, &ccache, ccErrCCacheNotFound, NULL);
498 cc_int32 check_once_cc_context_open_default_ccache(cc_context_t context, cc_ccache_t *ccache, cc_int32 expected_err, const char *description) {
517 if (ccache != NULL) { // if we were passed NULL, then we're looking to pass a bad param
518 err = cc_context_open_default_ccache(context, ccache);
527 check_if(*ccache == NULL, NULL);
529 // make sure this ccache is the one we were looking to get back (compare name with cc_context_get_default_ccache_name)
530 err = cc_ccache_get_name(*ccache, &given_name);
533 check_if(strcmp(given_name->data, default_name->data), "name of ccache returned by cc_context_open_default_ccache doesn't match name returned by cc_context_get_default_ccache_name");
538 if (ccache && *ccache) {
539 cc_ccache_release(*ccache);
540 *ccache = NULL;
554 cc_ccache_t ccache = NULL;
566 // try making a ccache with a non-unique name (the existing default's name)
568 err = cc_context_create_default_ccache(context, cc_credentials_v5, "foo/bar@BAZ.ORG", &ccache);
571 err = cc_ccache_get_name(ccache, &name);
573 if (ccache) { cc_ccache_release(ccache); }
575 err = check_once_cc_context_create_ccache(context, name->data, cc_credentials_v5, "foo@BAR.ORG", &ccache, ccNoError, NULL);
578 // try making a ccache with a unique name (the now destroyed default's name)
579 if (ccache) { cc_ccache_destroy(ccache); }
581 err = check_once_cc_context_create_ccache(context, name->data, cc_credentials_v5, "foo/baz@BAR.ORG", &ccache, ccNoError, NULL);
585 err = check_once_cc_context_create_ccache(context, NULL, cc_credentials_v5, "foo@BAR.ORG", &ccache, ccErrBadParam, "NULL name"); // NULL name
586 err = check_once_cc_context_create_ccache(context, "name", cc_credentials_v4_v5, "foo@BAR.ORG", &ccache, ccErrBadCredentialsVersion, "invalid creds_vers"); // invalid creds_vers
587 err = check_once_cc_context_create_ccache(context, "name", cc_credentials_v5, NULL, &ccache, ccErrBadParam, "NULL principal"); // NULL principal
588 err = check_once_cc_context_create_ccache(context, "name", cc_credentials_v5, "foo@BAR.ORG", NULL, ccErrBadParam, "NULL ccache"); // NULL ccache
592 if (ccache) { cc_ccache_destroy(ccache); }
600 cc_int32 check_once_cc_context_create_ccache(cc_context_t context, const char *name, cc_uint32 cred_vers, const char *principal, cc_ccache_t *ccache, cc_int32 expected_err, const char *description) {
620 err = cc_context_create_ccache(context, name, cred_vers, principal, ccache);
626 check_if(*ccache == NULL, NULL);
628 // make sure all of the ccache's info matches what we gave it
630 err = cc_ccache_get_name(*ccache, &stored_name);
636 err = cc_ccache_get_credentials_version(*ccache, &stored_creds_vers);
639 err = cc_ccache_get_principal(*ccache, cc_credentials_v5, &stored_principal);
643 if (ccache && *ccache) {
644 cc_ccache_destroy(*ccache);
645 *ccache = NULL;
659 cc_ccache_t ccache = NULL;
674 err = check_once_cc_context_create_default_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache, ccNoError, NULL);
676 if (ccache) { cc_ccache_release(ccache); }
680 err = check_once_cc_context_create_default_ccache(context, cc_credentials_v5, "foo/baz@BAR.ORG", &ccache, ccNoError, NULL);
684 err = check_once_cc_context_create_default_ccache(context, cc_credentials_v4_v5, "foo@BAR.ORG", &ccache, ccErrBadCredentialsVersion, "invalid creds_vers"); // invalid creds_vers
685 err = check_once_cc_context_create_default_ccache(context, cc_credentials_v5, NULL, &ccache, ccErrBadParam, "NULL principal"); // NULL principal
686 err = check_once_cc_context_create_default_ccache(context, cc_credentials_v5, "foo@BAR.ORG", NULL, ccErrBadParam, "NULL ccache"); // NULL ccache
690 if (ccache) { cc_ccache_destroy(ccache); }
698 cc_int32 check_once_cc_context_create_default_ccache(cc_context_t context, cc_uint32 cred_vers, const char *principal, cc_ccache_t *ccache, cc_int32 expected_err, const char *description) {
718 err = cc_context_create_default_ccache(context, cred_vers, principal, ccache);
724 if (ccache) { check_if(*ccache == NULL, NULL); }
725 // make sure all of the ccache's info matches what we gave it
727 err = cc_ccache_get_credentials_version(*ccache, &stored_creds_vers);
730 err = cc_ccache_get_principal(*ccache, cc_credentials_v5, &stored_principal);
734 if (ccache && *ccache) {
735 cc_ccache_release(*ccache);
736 *ccache = NULL;
750 cc_ccache_t ccache = NULL;
765 err = check_once_cc_context_create_new_ccache(context, 1, cc_credentials_v5, "foo@BAR.ORG", &ccache, ccNoError, NULL);
767 if (ccache) { cc_ccache_release(ccache); }
769 // try making a new ccache when one already exists (should not have name of default)
771 err = check_once_cc_context_create_new_ccache(context, 0, cc_credentials_v5, "foo/baz@BAR.ORG", &ccache, ccNoError, NULL);
773 if (ccache) { cc_ccache_release(ccache); }
776 err = check_once_cc_context_create_new_ccache(context, 1, cc_credentials_v4_v5, "foo@BAR.ORG", &ccache, ccErrBadCredentialsVersion, "invalid creds_vers"); // invalid creds_vers
777 err = check_once_cc_context_create_new_ccache(context, 1, cc_credentials_v5, NULL, &ccache, ccErrBadParam, "NULL principal"); // NULL principal
778 err = check_once_cc_context_create_new_ccache(context, 1, cc_credentials_v5, "foo@BAR.ORG", NULL, ccErrBadParam, "NULL ccache"); // NULL ccache
782 if (ccache) { cc_ccache_destroy(ccache); }
790 cc_int32 check_once_cc_context_create_new_ccache(cc_context_t context, cc_int32 should_be_default, cc_uint32 cred_vers, const char *principal, cc_ccache_t *ccache, cc_int32 expected_err, const char *description) {
812 err = cc_context_create_new_ccache(context, cred_vers, principal, ccache);
818 if (ccache) { check_if(*ccache == NULL, NULL); }
819 // make sure all of the ccache's info matches what we gave it
824 err = cc_ccache_get_name(*ccache, &stored_name);
828 check_if(strcmp(stored_name->data, name->data), "new ccache does not have name of default");
838 err = cc_ccache_get_credentials_version(*ccache, &stored_creds_vers);
841 err = cc_ccache_get_principal(*ccache, cc_credentials_v5, &stored_principal);
845 if (ccache && *ccache) {
846 cc_ccache_release(*ccache);
847 *ccache = NULL;
861 cc_ccache_t ccache = NULL;
880 err = cc_context_create_default_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
883 // try making when at least one ccache already exists (just to cover all our bases)
884 check_once_cc_context_new_ccache_iterator(context, &iterator, ccNoError, "when at least one ccache already exists");
892 if (ccache) { cc_ccache_destroy(ccache); }