summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix initial call to svcraw_createNickolai Zeldovich2013-01-071-0/+1
| | | | | | | | | gssrpc raw services could not work because svcraw_create did not set svcraw_private after allocating memory for it. [ghudson@mit.edu: commit message, patch splitting] ticket: 7534
* Install pkg-config data filesGreg Hudson2013-01-0411-4/+129
| | | | | | | | | | | Add seven data files for pkg-config, corresponding to the five modules supported by krb5-config. For krb5 and krb5-gssapi, we also provide mit- versions for callers desiring to distinguish between our implementation and Heimdal's. Based on a patch from Stef Walter <stefw@gnome.org>. ticket: 7529 (new)
* Move krb5-config to new src/build-tools directoryGreg Hudson2013-01-046-20/+23
| | | | | | In preparation for adding a bunch of pkg-config data files, move krb5-config into a new source tree subdirectory containing tools we provide as outputs to other build systems.
* Fix gss_str_to_oid and gss_oid_to_str edge casesGreg Hudson2013-01-013-127/+349
| | | | | | | | | | | | | Neither function correctly handled OIDs whose second arc exceeds 47 (theoretically possible if the first arc is 2). gss_str_to_oid had additional problems: it used scanf, it didn't consistently protect against read overrun if the input buffer wasn't null-terminated, and it could get confused by + or - characters in the first two arcs. Fix gss_oid_to_str and rewrite gss_str_to_oid. Also add a test program. ticket: 7524 (new)
* Fix a small memory leak in util_errmapGreg Hudson2013-01-011-12/+9
| | | | | | | | | | | Calls to gssint_mecherrmap_map_errcode would result in calling mecherror_copy with a zero-length mech OID, which would result in an OID with 0 for length and malloc(0) for elements. On platforms which return non-null from malloc(0), gssint_mecherrmap_destroy() wouldn't free the elements pointer. Avoid calling malloc(0) and don't use the length field to decide whether to free an elements pointer.
* Fix gss_str_to_oid for OIDs with zero-valued arcsLuke Howard2013-01-011-6/+6
| | | | | | | | | | | gss_str_to_oid wasn't outputting any bytes for a zero-valued arc. It should output one byte with value 0. [ghudson@mit.edu: commit message] ticket: 7523 (new) target_version: 1.11.1 tags: pullup
* Fix DPRINT in ipropd_svc.cGuillaume Rousse2013-01-011-1/+1
| | | | | | | | | | | cea0b28045b262b1098f17f17f78b2efbf89a6c1 contained an incorrect definition of DPRINT. Fix it. [ghudson@mit.edu: commit message] ticket: 7525 (new) target_version: 1.11.1 tags: pullup
* Delete timestamp_to_sfstring sprintf fallbackTom Yu2012-12-221-9/+0
| | | | | | | | | | | The final fallback for krb5_timestamp_to_sfstring() is an explicit European date-order format string passed to sprintf(). This can be confused with a conventional US date format. Because we attempt to build a strftime() replacement anyway, and we try passing some unambiguous ISO 8601 date and time formats to strftime(), remove this final fallback. ticket: 7518 (new)
* Add more formats to krb5_timestamp_to_sfstringTom Yu2012-12-221-1/+6
| | | | | | | | | | | | | krb5_timestamp_to_string() can produce ambiguous dates. The final fallback, "%d/%m/%Y %R", contains a European order date format that can be confused with a US date format. Add some additional strftime() format strings, including locale-dependent formats and some ISO 8601 formats. Remove the hardcoded strftime() format that had an ambiguous date order. ticket: 7458 target_version: 1.11 tags: pullup
* Use krb5_init_creds_context as clpreauth rockGreg Hudson2012-12-225-234/+160
| | | | | | | | | | | | | | The clpreauth rock had become a collection of alias pointers into the init_creds context structure. Get rid of it and just pass the context (suitably casted) to clpreauth modules. Simplify the signatures of k5_preauth(), k5_preauth_tryagain(), process_pa_data(), and fill_response_items() by referencing fields from the init_creds context. Since we can't use the non-nullity of rock->selected_preauth_type to determine whether to record the selected preauth type, k5_preauth now reports it in an output parameter, and get_in_tkt.c decides whether or not to record it.
* Initialize ret in process_pa_dataGreg Hudson2012-12-211-1/+1
| | | | | | | If the for loop never consults any preauth modules and must_preauth is false, we might never set ret, so we need to initialize it. The bug was introduced in 5c23bce0e8d3328bb36bc85ee10cfac486b8ae9b and is detected by some versions of gcc with -O2.
* Fix signed overflow check in k5_ucs2s_to_utf8sGreg Hudson2012-12-201-3/+1
| | | | | | | | Signed overflow must be checked before it happens, since modern versions of gcc will optimize out checks of the result. Reported by Nickolai Zeldovich <nickolai@csail.mit.edu>. ticket: 7511
* Remove inoperative null checks in KDC codeGreg Hudson2012-12-202-7/+3
| | | | | | | | | In prepare_error_tgs, kdc_free_rstate, and kdc_fast_handle_error, remove unnecessary null checks. The callers avoid passing null states, and in each case we've already dereferenced the pointer earlier. Reported by Nickolai Zeldovich <nickolai@csail.mit.edu>. ticket: 7511
* Avoid null dereference in BDB dbtree error caseGreg Hudson2012-12-201-3/+3
| | | | | | | | | An error case in __bt_first would deference a null pointer. This is an old upstream BDB bug. Use a separate variable to hold the result of mpool_get() until it has been checked. Reported by Nickolai Zeldovich <nickolai@csail.mit.edu>. ticket: 7511
* Fix clntraw_create initializationGreg Hudson2012-12-201-8/+10
| | | | | | | | | clntraw_create has been broken since inception; on the first call, it would compute invalid values of xdrs and client and dereference them. Fix that. (This is pretty strong evidence that no one has ever used it.) Reported by Nickolai Zeldovich <nickolai@csail.mit.edu>. ticket: 7511
* Simplify k5test.py environmentsGreg Hudson2012-12-2033-658/+517
| | | | | | | | | | | | | | The initial k5test.py design, copied from the dejagnu suite, is to create config files and environments for four expected roles: client, server, master, and slave. This approach exaggerates the complexity of the common case, where the configurations don't need to vary, and limits us to having just one slave for kprop/iprop tests. Instead, create just one configuration by default, and add a special_env() method which sets up a differently configured environment for the few test cases which need one. The run_as_*() methods are collapsed into just run(), which accepts an optional argument for the environment returned by special_env().
* Get rid of KRB5_KDB_SRV_TYPE_PASSWDGreg Hudson2012-12-203-6/+1
| | | | | | Nothing was using KRB5_KDB_SRV_TYPE_PASSWD, so get rid of it. (kpasswdd is part of kadmind and interacts with the KDB using KRB5_KDB_SRV_TYPE_ADMIN.)
* Generate dependencies for kdb5_ldap_utilGreg Hudson2012-12-202-1/+105
|
* Remove LDAP realm krbTicketPolicyReference codeGreg Hudson2012-12-202-51/+1
| | | | | | ldap_realm.c had some code intended to handle a krbTicketPolicyReference from a krbRealmContainer object, but there wasn't enough of it to ever do anything. Remove it.
* Simplify LDAP KDB module container DN handlingGreg Hudson2012-12-2011-290/+87
| | | | | | | | | | | | | | | | | Outside of krb5_ldap_read_krbcontainer_params and krb5_ldap_create_krbcontainer, no fields of krb5_ldap_krbcontainer_params were used except for the DN. There was code to create a krbTicketPolicyReference attribute (which would fail because the schema doesn't allow that attribute, and was never exercised because kdb5_ldap_util would never set the parameter) and to read fields like max ticket life from the referenced ticket policy, but those fields were never used. Eliminate the structure and just store the container DN in krb5_ldap_context. Continue creating the container object when creating a realm (by calling krb5_ldap_create_krbcontainer unconditionally; it now exits successfully if the container already exists), but don't ever read it.
* Remove unneeded code in krb5_ldap_put_principalGreg Hudson2012-12-201-17/+7
| | | | | | krb5_ldap_put_principal contained some conditionals for the case where entry->princ is NULL, but only after entry->princ was dereferenced unconditionally. It's not necessary to handle this case, so don't.
* Remove unused functions in the LDAP KDB moduleGreg Hudson2012-12-205-342/+0
|
* Don't output trailing whitespace in depfix.plGreg Hudson2012-12-201-1/+1
| | | | | | | | All of our deps files have a trailing space in the first line, originating from depfix.pl. This space triggers the whitespace checker when generating a new deps file. Get rid of the trailing whitespace in the script; the change will be reflected in the deps files the next time they are regenerated.
* Pass through module errors when preauthenticatingGreg Hudson2012-12-203-18/+26
| | | | | | | | | | | | If we are responding to a KDC_ERR_PREAUTH_REQUIRED and cannot preauthenticate, report the error from the first real preauth type we tried. k5_preauth() now accepts a boolean input indicating that it must succeed on a real preauth type, instead of returning a boolean saying whether or not it did. ticket: 7517 (new)
* Rename internal preauth functionsGreg Hudson2012-12-196-130/+120
| | | | | | | | | | | | The preauth functions are internal to libkrb5, so use the k5_ prefix, don't use KRB5_CALLCONV, and prototype them in int-proto.h. Also remove krb5_do_preauth from the Unix libkrb5 export list. Reorder the k5_preauth() and k5_preauth_tryagain() arguments for more consistency with the clpreauth interface, and put the output padata arguments at the end. Rename any remaining uses of "kcontext" to "context" in preauth2.c.
* Make clpreauth flags function optionalGreg Hudson2012-12-196-31/+7
| | | | | | | | With one exception (KRB5_PADATA_PKINIT_KX), every padata type processed by a clpreauth module is now a real preauthentication type. Reduce the amount of boilerplate required for a clpreauth module by making the flags method optional if all of the preauth types advertised by the module are real.
* Use a proper consumer interface for clpreauthGreg Hudson2012-12-192-422/+365
| | | | | | | | In preauth2.c, use wrapper functions for calls to clpreauth functions. Get rid of the expanded-out module table, instead using a helper function to find the handle for a preauth type. Replace use counts with a list of previously processed pa types. Check for pa type conflicts when loading clpreauth modules.
* Separate clpreauth and kdcpreauth interfacesGreg Hudson2012-12-1969-2060/+2047
| | | | | | | Since there is no overlap between the clpreauth and kdcpreauth interface declarations, there's no particular reason to combine them into one header. For backward compatibility and convenience, leave behind a preauth_plugin.h which includes both.
* Save extended messages across fallback to masterGreg Hudson2012-12-192-33/+28
| | | | | | In krb5_get_init_creds_password and krb5_get_init_creds_keytab, save the extended error before retrying against the master KDC, and restore that state if returning the error from the original request.
* Add functions to save and restore error stateGreg Hudson2012-12-193-0/+38
|
* Simplify error message retrievalGreg Hudson2012-12-192-86/+37
| | | | | | Eliminate the scratch_buf field of struct error_info and just return a non-localized constant error message if we can't allocate a copy of the real one. Also rely on a conformant strerror().
* Style cleanup for internal error handlingGreg Hudson2012-12-1910-145/+147
| | | | | | | Fix style issues in kerrs.c and errors.c. Rename error handling functions to use shorter k5_ prefix. Eliminate an inoperable krb5int_set_error() call in gic_opte_alloc and convert the other call to use krb5_set_error_message().
* Regenerate manpagesTom Yu2012-12-171-5/+15
|
* Add copyright footer to HTML docsTom Yu2012-12-171-0/+1
| | | | | | | | | | | | | The technique we use for inserting the feedback link in the footer overrides the Sphinx basic/layout.html and agogo/layout.html footers in a way that prevents us from getting the copyright link footer. Copy the relevant part of the Sphinx basic/layout.html for now. Add a copyright.rst that links to mitK5license.rst. ticket: 7510 (new) target_version: 1.11 tags: pullup
* PKINIT (draft9) null ptr deref [CVE-2012-1016]Nalin Dahyabhai2012-12-141-2/+3
| | | | | | | | | | | | | | | | | | Don't check for an agility KDF identifier in the non-draft9 reply structure when we're building a draft9 reply, because it'll be NULL. The KDC plugin for PKINIT can dereference a null pointer when handling a draft9 request, leading to a crash of the KDC process. An attacker would need to have a valid PKINIT certificate, 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:P/E:P/RL:O/RC:C [tlyu@mit.edu: reformat comment and edit log message] ticket: 7506 (new) target_version: 1.11 tags: pullup
* Make the doc build quieterBen Kaduk2012-12-141-0/+1
| | | | | | | | | | | | | | Don't print out every node processed (or not processed) in the doxygen-Sphinx bridge, nor print out a summary of how many types or functions were processed. While here, tell doxygen to be quiet in its output as well, and not print out each file that is generated. It still outputs warnings, though. ticket: 7495 (new) tags: pullup target_version: 1.11
* Use an empty challenge for the password questionGreg Hudson2012-12-131-1/+1
| | | | | | | | | | | If a question's challenge is NULL, it is unnecessarily difficult for a responder callback to detect whether it was asked. So it's better to use an empty challenge when there is no challenge data to communicate. Do this for the "password" question. ticket: 7499 (new) target_version: 1.11 tags: pullup
* Update mkrel for SPHINX_ARGSTom Yu2012-12-121-2/+2
| | | | | | | | | Update mkrel so that it will explicitly set SPHINX_ARGS=-W to make warnings fatal and so that it will work in an unconfigured tree. ticket: 7497 (new) target_version: 1.11 tags: pullup
* Don't finalize libraries in static buildGreg Hudson2012-12-121-11/+13
| | | | | | | | | | | | In a build with static libraries, functions tagged with __attribute__((destructor)) may be executed in any order, not in a topologically sorted order as they are in shared libraries. This could result in libcom_err functions being invoked (from another library's finalizer) after libcom_err has been finalized, which would (at minimum) result in using a mutex after it is destroyed. To prevent this kind of problem, disable finalizers in the static build regardless of whether we have compiler or linker support for them. Reported by Mihai Serban <mihai.serban@gmail.com>.
* Regenerate checked-in man pagesBen Kaduk2012-12-112-7/+19
| | | | | | | | | | Pick up changes to kadmin.rst and krb5_conf.rst adding cross-references for account lockout and detailing parameter expansion for keytab and credentials cache names in krb5.conf ticket: 7494 (new) tags: pullup target_version: 1.11
* Update manpage version on masterBen Kaduk2012-12-1124-24/+24
| | | | | | Now that version.py is in place to update Sphinx's idea of the version number in accordance reality, update the version in the man pages that we check in; the master branch is currently a 1.12 prerelease.
* Make sphinx warnings fatal for doc buildBen Kaduk2012-12-111-2/+3
| | | | | | | | | | | | | | | We currently do not have any warnings. Let us keep it that way by making warnings fatal in maintainer-mode (and configurable on the buildslaves). Using sphinx-build -W also causes errors to be reported in the exit status and picked up by make, which is quite useful. In order to allow the build bot to use -W but end-users to not use it, SPHINX_ARGS must be passed on the command line; it cannot be set by the convenience target 'htmlsrc'. Document this. ticket: 7468 (new) tags: pullup target_version: 1.11
* Make building docs easier in an unconfigured treeBen Kaduk2012-12-111-3/+6
| | | | | | | | | | | | | Instead of requiring the user to specify srcdir, top_srcdir, PYTHON, and possibly more in the future, make an 'htmlsrc' target that does so for them. This also lets us do the clean in the same step, so that only one command is required of the user. ticket: 7491 (new) tags: pullup target_version: 1.11
* Update comments for RFC 3244 kpasswd extensionsBen Kaduk2012-12-111-3/+4
| | | | | | | | | Remove the inaccurate comments "unused" and replace them with more useful representations of what they mean. ticket: 7490 (new) tags: pullup target_version: 1.11
* Don't use $(RM) in src/doc/Makefile.inBen Kaduk2012-12-111-1/+1
| | | | | | | | | | We allow these rules to be used in an unconfigured tree, and some makes do not supply a value for RM by default. ticket: 7492 (new) subject: Doc build in unconfigured tree broken on some platforms tags: pullup target_version: 1.11
* Fix various integer issuesGreg Hudson2012-12-105-39/+19
| | | | | | | | | | | | | | | In kdc_util.c and spnego_mech.c, error returns from ASN.1 length functions could be ignored because they were assigned to unsigned values. In spnego_mech.c, two buffer size checks could be rewritten to reduce the likelihood of pointer overflow. In dump.c and kdc_preauth.c, calloc() could be used to simplify the code and avoid multiplication overflow. In pkinit_clnt.c, the wrong value was checked for a null result from malloc(), and the code could be simplified. Reported by Nickolai Zeldovich <nickolai@csail.mit.edu>. ticket: 7488
* Note notice.txt's dependency on version.pyBen Kaduk2012-12-101-1/+1
| | | | | | | | | | | | This dependency has been in effect since the notice build was changed to use the main conf.py, due to its unconditional execfile('version.py'). Adding another conditional in conf.py seems to add needless complication, it is easier to just note the dependency in the Makefile and carry on. ticket: 7470 (new) title: NOTICE build has unnoted dependency on version.py tags: pullup target_version: 1.11
* Don't return a host referral to the service realmGreg Hudson2012-12-063-1/+25
| | | | | | | | | | A host referral to the same realm we just looked up the principal in is useless at best and confusing to the client at worst. Don't respond with one in the KDC. ticket: 7483 target_version: 1.11 tags: pullup
* Fix typo for windows versionsBen Kaduk2012-12-051-1/+1
| | | | | | | | | | | We omit the patchlevel if it is zero, but the check whether the patchlevel was zero was checking the wrong variable, and thus always succeeding. ticket: 7481 (new) queue: kfw tags: pullup target_version: 1.10.4
* Access keys for the KfW ribbon interfaceBen Kaduk2012-12-051-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Improve accessibility by actually enabling access keys for ribbon elements (tap alt and follow the onscreen hints for keys to press), instead of just underlining a letter in the name of each element. Supply an underlined letter in the text of each element, corresponding to this access key, even if there is not a shortcut key bound to that element. While here, fix conflicting assignment to 'R' on the 'options' tab (between "Renewable Until" and "Automatic Ticket Renewal") by making "Automatic Ticket Renewal" use 'T'. Microsoft's UI recommendations seem to say that access keys should be easy to locate when searching through the menu, and thus using the first letter of the first or second word is advisable. The Ribbon XML Reference seems to indicate that these elements should be "keytip" elements, but MSVS creates "keys" elements, which seem to work, whereas "keytip" does not. Apparently 'F' is standard for the application button menu (which contains exit). Access keys work somewhat poorly for us in this menu, as they appear on top of the text of the menu items, since we have no icons here. ticket: 7441 tags: pullup target_version: 1.10.4