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

Lines Matching refs:ccache

17 	cc_ccache_t ccache = NULL;
29 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
35 check_once_cc_ccache_release(context, ccache, ccNoError, NULL);
36 ccache = NULL;
46 cc_int32 check_once_cc_ccache_release(cc_context_t context, cc_ccache_t ccache, cc_int32 expected_err, const char *description) {
56 err = cc_ccache_get_name(ccache, &name);
57 err = cc_ccache_release(ccache);
58 ccache = NULL;
69 if (!err && name) { // try opening released ccache to make sure it still exists
70 err = cc_context_open_ccache(context, name->data, &ccache);
72 check_if(err == ccErrCCacheNotFound, "released ccache was actually destroyed instead");
74 if (ccache) { cc_ccache_destroy(ccache); }
91 cc_ccache_t ccache = NULL;
103 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
109 check_once_cc_ccache_destroy(context, ccache, ccNoError, NULL);
110 ccache = NULL;
120 cc_int32 check_once_cc_ccache_destroy(cc_context_t context, cc_ccache_t ccache, cc_int32 expected_err, const char *description) {
136 err = cc_ccache_get_name(ccache, &name);
137 err = cc_ccache_destroy(ccache);
138 ccache = NULL;
143 if (!err && name) { // try opening released ccache to make sure it still exists
144 err = cc_context_open_ccache(context, name->data, &ccache);
146 check_if(err != ccErrCCacheNotFound, "destroyed ccache was actually released instead");
148 if (ccache) { cc_ccache_destroy(ccache); }
165 cc_ccache_t ccache = NULL;
176 // try when it's the only ccache (already default)
181 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
184 check_once_cc_ccache_set_default(context, ccache, ccNoError, "when it's the only ccache (already default)");
186 if (ccache) {
187 err = cc_ccache_release(ccache);
188 ccache = NULL;
191 // try when it's not the only ccache (and not default)
193 err = cc_context_create_new_ccache(context, cc_credentials_v5, "baz@BAR.ORG", &ccache);
196 check_once_cc_ccache_set_default(context, ccache, ccNoError, "when it's not the only ccache (and not default)");
198 if (ccache) {
199 err = cc_ccache_release(ccache);
200 ccache = NULL;
203 // try when it's not the only ccache (and already default)
205 err = cc_context_open_default_ccache(context, &ccache);
208 check_once_cc_ccache_set_default(context, ccache, ccNoError, "when it's not the only ccache (and already default)");
210 if (ccache) {
211 err = cc_ccache_release(ccache);
212 ccache = NULL;
226 cc_int32 check_once_cc_ccache_set_default(cc_context_t context, cc_ccache_t ccache, cc_int32 expected_err, const char *description) {
245 err = cc_ccache_set_default(ccache);
250 err = cc_ccache_get_name(ccache, &name);
266 //if (ccache) { cc_ccache_destroy(ccache); } // ccache is released by the caller
284 cc_ccache_t ccache = NULL;
297 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
300 check_once_cc_ccache_get_credentials_version(ccache, cc_credentials_v5, ccNoError, "v5 creds");
310 err = cc_ccache_set_principal(ccache, cc_credentials_v4, "foo@BAR.ORG");
313 check_once_cc_ccache_get_credentials_version(ccache, cc_credentials_v4_v5, ccNoError, "v5 with v4 creds added");
320 if (ccache) {
321 cc_ccache_destroy(ccache);
322 ccache = NULL;
330 err = cc_context_create_new_ccache(context, cc_credentials_v4, "foo@BAR.ORG", &ccache);
333 check_once_cc_ccache_get_credentials_version(ccache, cc_credentials_v4, ccNoError, "v4 creds");
342 err = cc_ccache_set_principal(ccache, cc_credentials_v5, "foo@BAR.ORG");
345 check_once_cc_ccache_get_credentials_version(ccache, cc_credentials_v4_v5, ccNoError, "v4 with v5 creds added");
352 if (ccache) {
353 cc_ccache_destroy(ccache);
354 ccache = NULL;
364 cc_int32 check_once_cc_ccache_get_credentials_version(cc_ccache_t ccache, cc_uint32 expected_cred_vers, cc_int32 expected_err, const char *description) {
382 err = cc_ccache_get_credentials_version(ccache, &stored_cred_vers);
405 cc_ccache_t ccache = NULL;
420 // try with unique ccache (which happens to be default)
422 err = cc_context_create_ccache(context, "0", cc_credentials_v5, "foo@BAR.ORG", &ccache);
425 check_once_cc_ccache_get_name(ccache, "0", ccNoError, "unique ccache (which happens to be default)");
431 if (ccache) {
432 cc_ccache_release(ccache);
433 ccache = NULL;
436 // try with unique ccache (which is not default)
438 err = cc_context_create_ccache(context, "1", cc_credentials_v5, "foo@BAR.ORG", &ccache);
441 check_once_cc_ccache_get_name(ccache, "1", ccNoError, "unique ccache (which is not default)");
450 check_once_cc_ccache_get_name(ccache, NULL, ccErrBadParam, "NULL param");
452 if (ccache) {
453 cc_ccache_release(ccache);
454 ccache = NULL;
467 cc_int32 check_once_cc_ccache_get_name(cc_ccache_t ccache, const char *expected_name, cc_int32 expected_err, const char *description) {
486 err = cc_ccache_get_name(ccache, NULL);
489 err = cc_ccache_get_name(ccache, &stored_name);
511 cc_int32 check_once_cc_ccache_get_principal(cc_ccache_t ccache,
535 err = cc_ccache_get_principal(ccache, cred_vers, NULL);
538 err = cc_ccache_get_principal(ccache, cred_vers, &stored_principal);
562 cc_ccache_t ccache = NULL;
579 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo/BAR@BAZ.ORG", &ccache);
582 check_once_cc_ccache_get_principal(ccache, cc_credentials_v5, "foo/BAR@BAZ.ORG", ccNoError, "trying to get krb5 princ for krb5 ccache");
588 if (ccache) {
589 cc_ccache_release(ccache);
590 ccache = NULL;
596 err = cc_context_create_new_ccache(context, cc_credentials_v4, "foo.BAR@BAZ.ORG", &ccache);
599 check_once_cc_ccache_get_principal(ccache, cc_credentials_v4, "foo.BAR@BAZ.ORG", ccNoError, "trying to get krb4 princ for krb4 ccache");
608 check_once_cc_ccache_get_principal(ccache, cc_credentials_v4_v5, "foo.BAR@BAZ.ORG",
611 check_once_cc_ccache_get_principal(ccache, cc_credentials_v5, NULL, ccErrBadParam, "passed null out param");
615 if (ccache) {
616 cc_ccache_release(ccache);
617 ccache = NULL;
635 cc_ccache_t ccache = NULL;
652 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAZ.ORG", &ccache);
655 check_once_cc_ccache_set_principal(ccache, cc_credentials_v4_v5, "foo/BAZ@BAR.ORG", ccErrBadCredentialsVersion, "cc_credentials_v4_v5 (not allowed)");
656 check_once_cc_ccache_set_principal(ccache, cc_credentials_v5, NULL, ccErrBadParam, "NULL principal");
662 if (ccache) {
663 cc_ccache_destroy(ccache);
664 ccache = NULL;
668 // empty ccache
670 // replace v5 only ccache's principal
672 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAZ.ORG", &ccache);
675 check_once_cc_ccache_set_principal(ccache, cc_credentials_v5, "foo/BAZ@BAR.ORG", ccNoError, "replace v5 only ccache's principal (empty ccache)");
681 if (ccache) {
682 cc_ccache_destroy(ccache);
683 ccache = NULL;
686 // add v4 principal to v5 only ccache
688 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAZ.ORG", &ccache);
692 check_once_cc_ccache_set_principal(ccache, cc_credentials_v4, "foo.BAZ@BAR.ORG", ccNoError, "add v4 principal to v5 only ccache (empty ccache)");
699 if (ccache) {
700 cc_ccache_destroy(ccache);
701 ccache = NULL;
705 // replace v4 only ccache's principal
707 err = cc_context_create_new_ccache(context, cc_credentials_v4, "foo@BAZ.ORG", &ccache);
710 check_once_cc_ccache_set_principal(ccache, cc_credentials_v4, "foo.BAZ@BAR.ORG", ccNoError, "replace v4 only ccache's principal (empty ccache)");
716 if (ccache) {
717 cc_ccache_destroy(ccache);
718 ccache = NULL;
721 // add v5 principal to v4 only ccache
723 err = cc_context_create_new_ccache(context, cc_credentials_v4, "foo@BAZ.ORG", &ccache);
726 check_once_cc_ccache_set_principal(ccache, cc_credentials_v5, "foo/BAZ@BAR.ORG", ccNoError, "add v5 principal to v4 only ccache (empty ccache)");
732 if (ccache) {
733 cc_ccache_destroy(ccache);
734 ccache = NULL;
740 // replace v5 only ccache's principal
742 // add v4 principal to v5 only ccache
744 // replace v4 only ccache's principal
746 // add v5 principal to v4 only ccache
758 cc_int32 check_once_cc_ccache_set_principal(cc_ccache_t ccache, cc_uint32 cred_vers, const char *in_principal, cc_int32 expected_err, const char *description) {
777 err = cc_ccache_set_principal(ccache, cred_vers, in_principal);
783 err = cc_ccache_get_principal(ccache, cred_vers, &stored_principal);
807 cc_ccache_t ccache = NULL;
826 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
835 check_once_cc_ccache_store_credentials(ccache, &creds_union, ccNoError, "ok creds");
841 check_once_cc_ccache_store_credentials(ccache, NULL, ccErrBadParam, "NULL creds param");
853 check_once_cc_ccache_store_credentials(ccache, &creds_union, ccErrBadParam, "invalid creds (NULL client string)");
865 check_once_cc_ccache_store_credentials(ccache, &creds_union, ccErrBadCredentialsVersion, "v4_v5 creds (invalid) into a ccache with only v5 princ");
867 check_once_cc_ccache_store_credentials(ccache, &creds_union, ccErrBadCredentialsVersion, "v4 creds into a ccache with only v5 princ");
873 // non-existent ccache
874 if (ccache) {
875 err = cc_ccache_get_name(ccache, &name);
888 check_once_cc_ccache_store_credentials(ccache, &creds_union, ccErrInvalidCCache, "invalid ccache");
892 if (ccache) { cc_ccache_release(ccache); }
903 cc_int32 check_once_cc_ccache_store_credentials(cc_ccache_t ccache, const cc_credentials_union *credentials, cc_int32 expected_err, const char *description) {
923 err = cc_ccache_store_credentials(ccache, credentials);
930 err = cc_ccache_new_credentials_iterator(ccache, &creds_iterator);
944 check_if((creds != NULL), "stored credentials not found in ccache");
963 cc_ccache_t ccache = NULL;
986 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
992 err = cc_ccache_store_credentials(ccache, &creds_union);
999 err = cc_ccache_new_credentials_iterator(ccache, &creds_iterator);
1013 check_once_cc_ccache_remove_credentials(ccache, creds_array[i], ccNoError, "10 ok creds");
1017 check_once_cc_ccache_remove_credentials(ccache, NULL, ccErrBadParam, "NULL creds in param");
1020 check_once_cc_ccache_remove_credentials(ccache, creds_array[0], ccErrCredentialsNotFound, "removed same creds twice");
1022 // non-existent ccache
1023 if (ccache) {
1024 err = cc_ccache_get_name(ccache, &name);
1037 check_once_cc_ccache_remove_credentials(ccache, creds_array[8], ccErrCredentialsNotFound, "invalid ccache");
1044 if (ccache) { cc_ccache_release(ccache); }
1055 cc_int32 check_once_cc_ccache_remove_credentials(cc_ccache_t ccache, cc_credentials_t in_creds, cc_int32 expected_err, const char *description) {
1075 err = cc_ccache_remove_credentials(ccache, in_creds);
1082 err = cc_ccache_new_credentials_iterator(ccache, &creds_iterator);
1099 check_if((creds != NULL), "credentials not removed from ccache");
1117 cc_ccache_t ccache = NULL;
1136 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
1141 check_once_cc_ccache_new_credentials_iterator(ccache, &creds_iterator, ccNoError, "valid params");
1150 check_once_cc_ccache_new_credentials_iterator(ccache, NULL, ccErrBadParam, "NULL out iterator param");
1157 // non-existent ccache
1158 if (ccache) {
1159 err = cc_ccache_get_name(ccache, &name);
1168 check_once_cc_ccache_new_credentials_iterator(ccache, &creds_iterator, ccErrInvalidCCache, "invalid ccache");
1175 if (ccache) { cc_ccache_release(ccache); }
1187 cc_int32 check_once_cc_ccache_new_credentials_iterator(cc_ccache_t ccache, cc_credentials_iterator_t *iterator, cc_int32 expected_err, const char *description) {
1204 err = cc_ccache_new_credentials_iterator(ccache, iterator);
1219 cc_int32 check_once_cc_ccache_get_change_time(cc_ccache_t ccache, cc_time_t *last_time, cc_int32 expected_err, const char *description) {
1237 err = cc_ccache_get_change_time(ccache, NULL); // passed NULL to compare against because intention is actually to pass bad param instead
1239 err = cc_ccache_get_change_time(ccache, &this_time);
1263 cc_ccache_t ccache = NULL;
1282 // create some ccaches (so that the one we keep around as 'ccache' is not default)
1284 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
1286 if (ccache) {
1287 cc_ccache_release(ccache);
1290 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAZ.ORG", &ccache);
1295 // the ccache is created
1297 check_once_cc_ccache_get_change_time(ccache, &last_time, ccNoError, "new ccache (change time should be > 0)");
1300 // the ccache is made default
1302 err = cc_ccache_set_default(ccache);
1305 check_once_cc_ccache_get_change_time(ccache, &last_time, ccNoError, "non-default ccache became default");
1308 // the ccache is made not-default
1319 check_once_cc_ccache_get_change_time(ccache, &last_time, ccNoError, "default ccache became non-default");
1326 check_once_cc_ccache_get_change_time(ccache, NULL, ccErrBadParam, "NULL out param for time");
1332 err = cc_ccache_store_credentials(ccache, &creds_union);
1335 check_once_cc_ccache_get_change_time(ccache, &last_time, ccNoError, "stored new credential");
1339 err = cc_ccache_set_principal(ccache, cc_credentials_v5, "foo@BAR.ORG");
1341 log_error("failed to change ccache's principal - %s (%d)", translate_ccapi_error(err), err);
1350 err = cc_ccache_new_credentials_iterator(ccache, &creds_iterator);
1359 err = cc_ccache_remove_credentials(ccache, credentials);
1364 // invalid ccache
1369 check_once_cc_ccache_get_change_time(ccache, &last_time, ccErrInvalidCCache, "getting change time on destroyed ccache");
1372 if (ccache) { cc_ccache_release(ccache); }
1386 cc_int32 check_once_cc_ccache_get_last_default_time(cc_ccache_t ccache, cc_time_t *last_time, cc_int32 expected_err, const char *description) {
1405 err = cc_ccache_get_last_default_time(ccache, NULL); // passed NULL to compare against because intention is actually to pass bad param instead
1407 err = cc_ccache_get_last_default_time(ccache, &this_time);
1485 // non-existent ccache
1502 check_once_cc_ccache_get_last_default_time(ccache_1, &last_time_1, ccErrInvalidCCache, "destroyed ccache");
1569 // non-existent ccache
1673 check_if(err != ccErrInvalidCCache, "source ccache was not invalidated after move");
1718 check_once_cc_ccache_compare(ccache_a, ccache_a, &equal, ccNoError, "compare ccache with same pointer");
1720 check_once_cc_ccache_compare(ccache_a, ccache_b, &equal, ccNoError, "compare different handles to same ccache");
1731 check_once_cc_ccache_compare(ccache_a, NULL, &equal, ccErrBadParam, "NULL compare_to ccache");
1747 cc_int32 check_once_cc_ccache_compare(cc_ccache_t ccache, cc_ccache_t compare_to, cc_uint32 *equal, cc_int32 expected_err, const char *description) {
1768 err = cc_ccache_compare(ccache, compare_to, equal);
1793 cc_ccache_t ccache = NULL;
1809 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
1813 check_once_cc_ccache_get_kdc_time_offset(ccache, cc_credentials_v5, &time_offset, ccErrTimeOffsetNotSet, "brand new ccache (offset not yet set)");
1817 err = cc_ccache_set_kdc_time_offset(ccache, cc_credentials_v5, time_offset);
1820 check_once_cc_ccache_get_kdc_time_offset(ccache, cc_credentials_v5, &time_offset, ccNoError, "offset set for v5 but not v4");
1824 check_once_cc_ccache_get_kdc_time_offset(ccache, cc_credentials_v4, &time_offset, ccErrTimeOffsetNotSet, "asking for v4 offset when only v5 is set");
1827 err = cc_ccache_set_kdc_time_offset(ccache, cc_credentials_v4, time_offset);
1830 check_once_cc_ccache_get_kdc_time_offset(ccache, cc_credentials_v4, &time_offset, ccNoError, "asking for v4 offset when v4 and v5 are set");
1834 check_once_cc_ccache_get_kdc_time_offset(ccache, cc_credentials_v5, NULL, ccErrBadParam, "NULL time_offset out param");
1836 check_once_cc_ccache_get_kdc_time_offset(ccache, cc_credentials_v4_v5, &time_offset, ccErrBadCredentialsVersion, "v4_v5 creds_vers in param (invalid)");
1839 if (ccache) { cc_ccache_release(ccache); }
1851 cc_int32 check_once_cc_ccache_get_kdc_time_offset(cc_ccache_t ccache, cc_int32 credentials_version, cc_time_t *time_offset, cc_int32 expected_err, const char *description) {
1875 err = cc_ccache_get_kdc_time_offset(ccache, credentials_version, time_offset);
1895 cc_ccache_t ccache = NULL;
1910 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
1913 check_once_cc_ccache_set_kdc_time_offset(ccache, cc_credentials_v5, 0, ccNoError, "first time setting offset (v5)");
1915 check_once_cc_ccache_set_kdc_time_offset(ccache, cc_credentials_v4, 0, ccNoError, "first time setting offset (v4)");
1917 check_once_cc_ccache_set_kdc_time_offset(ccache, cc_credentials_v4_v5, 0, ccErrBadCredentialsVersion, "invalid creds_vers (v4_v5)");
1920 if (ccache) { cc_ccache_release(ccache); }
1932 cc_int32 check_once_cc_ccache_set_kdc_time_offset(cc_ccache_t ccache, cc_int32 credentials_version, cc_time_t time_offset, cc_int32 expected_err, const char *description) {
1951 err = cc_ccache_set_kdc_time_offset(ccache, credentials_version, time_offset);
1957 err = cc_ccache_get_kdc_time_offset(ccache, credentials_version, &stored_offset);
1975 cc_ccache_t ccache = NULL;
1990 err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
1993 check_once_cc_ccache_clear_kdc_time_offset(ccache, cc_credentials_v5, ccNoError, "clearing an offset that was never set (v5)");
1995 check_once_cc_ccache_clear_kdc_time_offset(ccache, cc_credentials_v4, ccNoError, "clearing an offset that was never set (v4)");
1998 err = cc_ccache_set_kdc_time_offset(ccache, cc_credentials_v5, 0);
2000 err = cc_ccache_set_kdc_time_offset(ccache, cc_credentials_v4, 0);
2003 check_once_cc_ccache_clear_kdc_time_offset(ccache, cc_credentials_v5, ccNoError, "clearing v5");
2005 check_once_cc_ccache_clear_kdc_time_offset(ccache, cc_credentials_v4, ccNoError, "clearing v4");
2007 check_once_cc_ccache_clear_kdc_time_offset(ccache, cc_credentials_v4_v5, ccErrBadCredentialsVersion, "bad in param creds vers (v4_v5)");
2010 if (ccache) { cc_ccache_release(ccache); }
2022 cc_int32 check_once_cc_ccache_clear_kdc_time_offset(cc_ccache_t ccache, cc_int32 credentials_version, cc_int32 expected_err, const char *description) {
2039 err = cc_ccache_clear_kdc_time_offset(ccache, credentials_version);
2046 err = cc_ccache_get_kdc_time_offset(ccache, credentials_version, &stored_offset);