summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add localauth pluggable interfaceGreg Hudson2013-03-0914-1069/+1426
| | | | | | | | Add a new pluggable interface for local authorization, and replace the existing krb5_aname_to_localname and krb5_kuserok implementations with implementations based on the pluggable interface. ticket: 7583 (new)
* Fix dependencies in tests/gssapiNickolai Zeldovich2013-03-031-3/+3
| | | | | | | | | Use $(COMMON_DEPS) instead of $(COMMON_DEPLIBS) for dependencies; the latter appears to be a typo. Fixes build when using "make -j". ticket: 7587 (new) target_version: 1.11.2 tags: pullup
* Simplify and clarify lookup_etypes_for_keytabGreg Hudson2013-03-011-27/+21
|
* Fix a memory leak in krb5_get_init_creds_keytabGreg Hudson2013-02-281-3/+11
| | | | | | | | | lookup_etypes_for_keytab was not freeing the keytab entries it iterated over. Reported by nalin@redhat.com. ticket: 7586 target_version: 1.11.2 tags: pullup
* Add krb5_free_enctypes APIGreg Hudson2013-02-276-8/+21
| | | | | | | Rename krb5_free_ktypes to krb5_free_enctypes and add it to the public API. ticket: 7584
* Add missing .gitignore entries and clean rulesGreg Hudson2013-02-277-7/+11
| | | | ticket: 7585
* Fix windows buildBen Kaduk2013-02-252-2/+2
| | | | | | | | | | Catch up to the split of preauth_plugin.h into client and kdc specific portions. While here, use copy's /y flag to suppress an override-confirmation prompt (though we do not list any dependencies for this target at the moment, so no such prompt will be generated). Do not disable library finalizers for windows, erroneously disabled in 4538146e1452e0966164119cefb0804993ce6bbb.
* Fix fd leak in DIR ccache cursor functionGreg Hudson2013-02-211-1/+1
| | | | | | | | | | If dcc_ptcursor_next reached the end of a directory, it called free() on the directory handle instead of closedir(), causing the directory fd to be leaked. Call closedir() instead. ticket: 7573 target_version: 1.11.1 tags: pullup
* Fix memory leak closing DIR ccachesGreg Hudson2013-02-201-0/+1
| | | | | | | | | | | A ccache type's close function is supposed to free the cache container as well as the type-specific data. dcc_close was not doing so, causing a small memory leak each time a ccache is created or destroyed. ticket: 7574 (new) target_version: 1.11.1 tags: pullup
* Allow multi-hop SAM-2 exchangesGreg Hudson2013-02-191-0/+5
| | | | | | | | | | | | Prior to 1.11, it was possible to do SAM-2 preauth exchanges with multiple hops by sending repeated preauth-required errors with different challenges (which is not the way multi-hop exchanges are described in RFC 6113, but it can still work). This stopped working when SAM-2 was converted to a built-in module. Make it work again. ticket: 7571 (new) target_version: 1.11.1 tags: pullup
* Cleaner fix for #7570Ben Kaduk2013-02-151-4/+2
| | | | Remove variables and labels which are no longer needed.
* PKINIT null pointer deref [CVE-2013-1415]Xi Wang2013-02-151-2/+1
| | | | | | | | | | | | | | | | | | | | Don't dereference a null pointer when cleaning up. The KDC plugin for PKINIT can dereference a null pointer when a malformed packet causes processing to terminate early, leading to a crash of the KDC process. An attacker would need to have a valid PKINIT certificate or have observed a successful PKINIT authentication, or an unauthenticated attacker could execute the attack if anonymous PKINIT is enabled. CVSSv2 vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:P/RL:O/RC:C This is a minimal commit for pullup; style fixes in a followup. [kaduk@mit.edu: reformat and edit commit message] ticket: 7570 (new) target_version: 1.11.1 tags: pullup
* Convert success in krb5_chpw_result_code_stringJonathan Reams2013-02-151-0/+3
| | | | | | | | | | | | | | | Result code 0 used to be converted properly by krb5_set_password, though not krb5_change_password; this changed in 1.10 when krb5int_setpw_result_code_string was folded into krb5_chpw_result_code_string. Restore the old behavior, and make it apply to krb5_change_password as well, by making krb5_chpw_result_code_string convert result code 0. [ghudson@mit.edu: commit message] ticket: 7569 (new) target_version: 1.11.1 tags: pullup
* Modernize k5bufGreg Hudson2013-02-1430-439/+443
| | | | | | Rename the krb5int_buf_ family of functions to use the k5_ prefix for brevity. Reformat some k5buf implementation code to match current practices.
* Add k5_json_array_fmt and use it in export_cred.cGreg Hudson2013-02-135-261/+412
| | | | | | Add a template-based array constructor for convenient marshalling of structured values as JSON array values. Use it to simplify export_cred.c.
* Make internal JSON functions return error codesGreg Hudson2013-02-139-464/+546
| | | | | | | | | Return error codes (0, ENOMEM, or EINVAL) from JSON support functions instead of returning results directly. This makes error handling simpler for functions which assemble JSON objects and then return a krb5_error_code values. Adjust all callers. Use shims in export_cred.c to minimize changes there; it will be redesigned internally in a subsequent commit.
* Fix RFC 5587 const pointer typedefsGreg Hudson2013-02-111-3/+3
| | | | | | | | | | | | gss_const_ctx_id_t, gss_const_cred_id_t, and gss_const_name_t are supposed to be const pointers to the appropriate structures, not the structures themselves. These are not used by any prototypes yet, and no application would have any reason to use them as they are, so it should be safe to change them within the public header. ticket: 7567 (new) target_version: 1.11.1 tags: pullup
* Add and use k5memdup, k5memdup0 helpersGreg Hudson2013-02-0938-211/+125
| | | | | | Add k5-int.h static functions to duplicate byte ranges, optionally with a trailing zero byte, and set an error code like k5alloc does. Use them where they would shorten existing code.
* Simplify TGS request constructionGreg Hudson2013-02-084-171/+60
| | | | | | | Move krb5int_make_tgs_request from gc_via_tkt.c into send_tgs.c, combine it with krb5int_make_tgs_request_ext (which nothing else called), and rename the combined function to k5_make_tgs_req. Also use a typedef for the pacb callback.
* Modernize send_tgs.cGreg Hudson2013-02-081-245/+190
| | | | | Bring send_tgs.c up to date with current coding practices. No functional changes.
* Replace i_vector with cstate in auth contextGreg Hudson2013-02-076-95/+50
| | | | | Use a proper cipher state in the auth context structure, and free it when the auth context is freed. Simplify mk_priv/rd_priv accordingly.
* Desupport krb5_auth_con_setivectorGreg Hudson2013-02-071-2/+6
| | | | ticket: 7565 (new)
* Add kprop Python testsGreg Hudson2013-02-073-3/+54
| | | | | | Create a K5Realm.kprop_port method so test scripts can invoke kprop usefully, and create a simple Python test script exercising the same kprop functionality as the dejagnu suite's kprop.exp.
* Make kprop/kpropd work with RC4 session keyGreg Hudson2013-02-073-20/+19
| | | | | | | | | | In krb5_auth_con_initivector and mk_priv/rd_priv, stop assuming that the enctype's block size is the size of the cipher state. Instead, make and discard a cipher state to get the size. ticket: 7561 target_version: 1.11.1 tags: pullup
* Modernize dump.cGreg Hudson2013-02-063-1313/+697
| | | | | Reformat and simplify dump.c code according to current coding standards. No functional changes except for some error messages.
* Refactor dump.cGreg Hudson2013-02-061-175/+124
| | | | | | | When dumping, use a common iterator function to unpack the dump_args structure, unparse and filter the principal name, and convert master keys. Add helper functions to dump and load the "octets or -1" format used for optional binary fields in the current dump format.
* Reorder dump.cGreg Hudson2013-02-061-467/+439
| | | | | | Without changing anything (except to make a few internal functions static), reorder dump.c to bottom-up order so that forward function declarations aren't needed.
* Remove -b6 and -old dump formatsGreg Hudson2013-02-041-590/+8
| | | | | | | Get rid of the code to dump and load -b6 and -old format dump files. Loading these versions hasn't worked since at least 1.3. ticket: 7564 (new)
* Add more tests for dump and loadGreg Hudson2013-02-048-26/+151
| | | | | | | | Move the existing dump/load tests from t_general.py to a new script t_dump.py. Add additional tests using pre-created dumpfiles, to exercise the -r18, -r13, -b7, and -ov formats. bigredbutton: whitespace
* Simplify kdb5_util create using a null passwordGreg Hudson2013-02-041-30/+7
| | | | | | kadm5_create_principal now uses a random key if passed a null password, so we don't need a multi-step process to create admin principals when creating a database any more.
* Fix kdb5_util dump.c uninitialized warningsGreg Hudson2013-02-011-1/+1
| | | | | | | | | | | | | Some versions of clang report an uninitialized variable warning (which we treat as an error) in process_k5beta_record. Due to the if-ladder style of the function, uninitialized tmpint values can be copied around in certain error cases, although the garbage values would be ultimately ignored. As a minimal fix, initialize the tmpint variables. ticket: 7560 (new) target_version: 1.11.1 tags: pullup
* Simplify LDAP password decodingGreg Hudson2013-02-012-113/+45
| | | | | | Make dec_password a static function in ldap_service_stash.c and remove some impedance mismatch with krb5_ldap_readpassword() by making it operate on C strings and return a krb5_error_code.
* Remove partial LDAP client cert supportGreg Hudson2013-01-314-138/+40
| | | | | | | | The LDAP KDB module has some code to interpret {FILE} values in stash files, and set the service_cert_path/pass fields in the ldap context. But there was no code to actually use those values to do client cert authentication, so it wasn't useful. Remove the partial implementation.
* Fix COPY_FIRST_CANONNAME hostent searchViktor Dukhovni2013-01-311-11/+11
| | | | | | | | | | | In fake-addrinfo.c, the COPY_FIRST_CANONNAME logic erroneously assumes that h_name is the same as h_aliases[0]. Look at h_name before h_aliases for an FQDN, since h_name is normally the forward-canonicalized name and h_aliases are not. [ghudson@mit.edu: rewrote commit message] ticket: 7556 (new)
* Revert previous change to process_tgs_reqGreg Hudson2013-01-311-1/+1
| | | | | | | | | Commit c072b059ecff257e7600be0e86869decd135d422 did not have the intended effect because, at the point where is_referral is set, request->server has already been modified to contain server->princ. ticket: 7555 status: open
* Fix is_referral flag in KDC TGS codeGreg Hudson2013-01-311-1/+1
| | | | | | | | | A server response which is a cross-realm TGT is not a referral if it was directly requested by the client. Misclassifying such a response as a referral means we don't mirror the request's name type, which has been observed to break older Java clients. ticket: 7555 (new)
* Fix prepend_err_str in LDAP KDB moduleGreg Hudson2013-01-291-3/+4
| | | | | | Use the oerr parameter to fetch the existing message. Stop handling oerr == 0, since no call sites were using it. Free the old error message before returning.
* Add LDAP debug DB optionGreg Hudson2013-01-283-0/+4
| | | | | | | Add a DB option in the LDAP KDB module to turn on debugging messages. Adapted from a patch by Zoran Pericic <zpericic@inet.hr>. ticket: 7551 (new)
* Refactor LDAP DB option parsing codeGreg Hudson2013-01-287-381/+169
| | | | | | | | | | krb5_ldap_open and krb5_ldap_create contain two large, almost identical blocks of DB option processing code. Factor it out into a new function krb5_ldap_parse_db_params in ldap_misc.c, and simplify the factored-out code. Create a helper function to add server entries and use it to simplify krb5_ldap_read_server_params as well as DB option parsing. Since the new DB option helper uses isspace instead of isblank, we no longer require portability goop for isblank.
* Make kproplog handle underfull iprop logsGreg Hudson2013-01-251-3/+4
| | | | | | | | | kproplog currently assumes that an iprop log is full once it has circled--which is true right now but will need to change for hierarchical slaves. Avoid this assumption by using the correct index modulus in print_update whether or not the log is full. Based on a patch from Richard Basch <basch@alum.mit.edu>.
* Check for negative poll timeout in k5_sendto_kdcGreg Hudson2013-01-251-0/+4
| | | | | | ticket: 7553 target_version: 1.11.1 tags: pullup
* Quiet kpropd.c signed/unsigned comparison warningsNicolas Williams2013-01-241-3/+3
| | | | [ghudson@mit.edu: simplify slightly]
* Adjust kdb5.c check for ulog being mappedGreg Hudson2013-01-241-1/+1
| | | | | | Check the ulog pointer, which is a little more direct, rather than the ulogfd field. (ulogfd is currently initialized to 0 prior to ulog_map; we could fix that instead, but this feels simpler.)
* Remove ulog_check(); the ulog is not a DB journalNicolas Williams2013-01-231-114/+6
| | | | | | | | | | | | | | | The db2 DB is not power-fail safe. There's no point trying to replay an incompletely committed entry from the ulog at kadmind startup time. For that matter, even if the db2 DB was power-fail safe there'd be no point replaying an uncommitted entry from the ulog as the libkadm5srv app (nor any client of it, as in the case of kadmind) will not have received any notice of success -- it'd be wrong to complete that operation later when the user thought it'd failed. [ghudson@mit.edu: merge with master, adjust comment] ticket: 7552 (new)
* Propagate policy changes over iprop via full dumpGreg Hudson2013-01-222-3/+81
| | | | | | | | Since iprop cannot carry policy changes, force a full resync to happen each time a policy change occurs. Based on a patch from Richard Basch <basch@alum.mit.edu>. ticket: 7522
* Verify iprop test results more thoroughlyGreg Hudson2013-01-222-47/+37
| | | | | | | In k5test.py, allow run_kadminl to take an environment argument. In t_iprop.py, perform some queries on the slaves after each propagation to spot-check that it got modifications from master. Use a helper function to check serial numbers for conciseness.
* Fix iprop log reinitializationGreg Hudson2013-01-228-42/+50
| | | | | | | | | | | | | | | | If the master iprop log is reinitialized to serial number 0, slaves will need to take a full dump--but after that happens, we need to know whether the slave has taken that full dump, we we don't offering full dumps indefinitely. So, record a timestamp in kdb_last_time when we reinitialize the log header, and compare the slave timestamp to kdb_last_time whenever it has the current serial number, even if it's 0. Test this by performing a propagation with sno 0 in t_iprop.py and detecting whether kpropd gets a second UPDATE_FULL_RESYNC_NEEDED response from kadmind. ticket: 7550 (new)
* Modernize style of kdb_log.cGreg Hudson2013-01-221-460/+292
| | | | | ulog_get_entries had an unreachable branch which was removed during de-indentation.
* Clean up iprop flow control in kdb5.cGreg Hudson2013-01-181-53/+42
| | | | | | | | | | | Add a helper predicate to determine whether to log operations. In the predicate, check if the ulog is actually mapped. Use a single cleanup label in krb5_db_put_principal. Use a cleanup label in krb5_db_delete_principal instead of releasing resources individually at each exit point. Avoid locking and unlocking the ulog if we're not logging (although it would be a no-op). Based on a patch from Nico Williams <nico@cryptonector.com>.
* Fix iprop safety net in kdb5_util loadGreg Hudson2013-01-171-2/+4
| | | | | | | | | The error message was missing a newline, and the exit behavior causes the database to be destroyed. ticket: 7370 target_version: 1.11.1 tags: pullup