summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a memory leak by reorganizing krb5_ktf_keytab_internalize to useGreg Hudson2009-04-301-80/+70
| | | | | | | | | the recommended exception-handling flow control. Eliminate the check for ktdata being null after resolution because that's not possible. Add a check for the resolved keytab being of a different type, since that would result in data structure corruption. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22295 dc483132-0cff-0310-8789-dd5450dbe970
* Uninitialized variable may cause unpredictable behavior in kdc_verify_preauthZhanna Tsitkov2009-04-301-238/+239
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22294 dc483132-0cff-0310-8789-dd5450dbe970
* Do not return PREAUTH_FAILED on unknown preauthSam Hartman2009-04-301-9/+3
| | | | | | | | | | | | | | If the KDC receives unknown pre-authentication data then ignore it. Do not get into a case where PREAUTH_FAILED is returned because of unknown pre-authentication. The main AS loop will cause PREAUTH_REQUIRED to be returned if the preauth_required flag is set and no valid preauth is found. ticket: 6480 Target_Version: 1.7 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22292 dc483132-0cff-0310-8789-dd5450dbe970
* Add DEBUG_ERROR_LOCATIONS supportGreg Hudson2009-04-296-2/+84
| | | | | | | | | | | | If DEBUG_ERROR_LOCATIONS is defined, replace uses of krb5_set_error_message and krb5int_set_error with calls to the new _fl variants of those functions, and include filename and line number information in the calls. Requires C99-style variadic macros if defined. ticket: 6479 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22291 dc483132-0cff-0310-8789-dd5450dbe970
* Fix typo in error message reported by Marek Mahut (Red Hat)Tom Yu2009-04-291-1/+1
| | | | | | | | ticket: 6472 target_version: 1.7 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22290 dc483132-0cff-0310-8789-dd5450dbe970
* Fix handling of RET_SEQUENCE flag in mk_priv/mk_ncredGreg Hudson2009-04-283-13/+6
| | | | | | | | | | | | | | | | | Regularize the handling of KRB5_AUTH_CONTEXT_RET_SEQUENCE in krb5_mk_safe, krb5_mk_priv, and krb5_mk_ncred, using krb5_mk_safe as a baseline. RET_SEQUENCE now implies DO_SEQUENCE for all three functions, the sequence number is always incremented if it is used, and outdata->seq is always set if RET_SEQUENCE is passed. Note that in the corresponding rd_ functions, RET_SEQUENCE and DO_SEQUENCE are independent flags, which is not consistent with the above. This compromise is intended to preserve compatibility with any working code which might exist using the RET_SEQUENCE flag. ticket: 6478 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22288 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a couple of memory leaks in krb5int_sendto, reworking the errorGreg Hudson2009-04-281-32/+23
| | | | | | handling a bit for cleanliness in the process. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22286 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a memory leak in aname_replacer using the recommended flow controlGreg Hudson2009-04-281-87/+92
| | | | | | for exception handling. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22285 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a memory leak in module_locate_serverGreg Hudson2009-04-281-1/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22284 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a few memory leaks in krb5_mk_ncred. Also tighten up the errorGreg Hudson2009-04-271-16/+18
| | | | | | | | handling of the sequence number, only decreasing it if it was increased. The handling of DO_SEQUENCE and RET_SEQUENCE may still be flawed in some cases. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22283 dc483132-0cff-0310-8789-dd5450dbe970
* Fix an unchecked use of fwrite in krb5_ktfileint_delete_entryGreg Hudson2009-04-271-1/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22282 dc483132-0cff-0310-8789-dd5450dbe970
* Move KRB5_KDB_OK_AS_DELEGATE from kdb_ext.h to kdb.h. Add kadminGreg Hudson2009-04-276-7/+24
| | | | | | | | | | | support for the flag. In the KDC, remove the restriction on returning the flag on cross-realm TGTs since there is now a defined meaning for that (it allows ok-as-delegate to be honored on the foreign realm's service tickets). ticket: 5596 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22281 dc483132-0cff-0310-8789-dd5450dbe970
* make installed headers C++-safeKen Raeburn2009-04-254-3/+47
| | | | | | | | | | | | Now that we're installing the kadm5 headers, they should be C++-safe like the others. Wrap the content in 'extern "C"' if compiling as C++. New test program to verify. ticket: 6477 target_version: 1.7 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22280 dc483132-0cff-0310-8789-dd5450dbe970
* Simplify and shorten krb5_ktfileint_find_slot, and properly handle theGreg Hudson2009-04-241-99/+40
| | | | | | | | commit_point output parameter. ticket: 6475 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22279 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_ktfileint_find_slot, don't continue the loop when we find aGreg Hudson2009-04-241-0/+1
| | | | | | | | | | | | final zero-length buffer. This is a minimal fix intended to be pulled up to the 1.7 branch; a code cleanup commit will follow. ticket: 6475 status: open tags: pullup target_version: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22278 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_principal_compare_flags, improve clarity slightly by using aGreg Hudson2009-04-231-9/+8
| | | | | | | boolean temporary instead of an ordering temporary in the loop over the elements, since we only care about the boolean result. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22277 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_rcache_externalize, remove a pointless null check of a pointerGreg Hudson2009-04-231-32/+44
| | | | | | | | we just dereferenced. Rewrite krb5_rcache_internalize to use the recommended cleanup flow control, closing a memory leak in the process. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22276 dc483132-0cff-0310-8789-dd5450dbe970
* Close a memory leak in asn1_decode_etype_info2_entry_1_3Greg Hudson2009-04-231-1/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22275 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_fcc_read, remove an assert which could never trigger (becauseGreg Hudson2009-04-231-1/+0
| | | | | | len is unsigned and cannot be less than zero). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22274 dc483132-0cff-0310-8789-dd5450dbe970
* Fix an error-handling block in sendto_kdc.c's setup_connection() whichGreg Hudson2009-04-231-2/+0
| | | | | | would always attempt to close -1. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22273 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_get_cred_via_tkt, strip the ok-as-delegate flag fromGreg Hudson2009-04-231-0/+18
| | | | | | | | | | credentials obtained using a foreign TGT, unless the TGT also has ok-as-delegate set. ticket: 6473 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22272 dc483132-0cff-0310-8789-dd5450dbe970
* move kadmin, ktutil, k5srvutil man pages to man1Sam Hartman2009-04-222-3/+3
| | | | | | | | | | | These binaries have been moved to /usr/bin so their manpages should move from man8 to man1. Ticket: 6474 Target_Version: 1.7 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22267 dc483132-0cff-0310-8789-dd5450dbe970
* Send explicit salt for SALTTYPE_NORMAL keysGreg Hudson2009-04-162-12/+19
| | | | | | | | | | | | | | | Change the signature of _make_etype_info_entry to take the canonical client principal instead of the request structure. Also fixes the salt we compute for SALTTYPE_NOREALM keys. Sending an explicit salt for SALTTYPE_NORMAL keys is believed to be necessary for some preauth scenarios involving aliases. ticket: 6470 target_version: 1.7 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22264 dc483132-0cff-0310-8789-dd5450dbe970
* Require fast_req checksum to be keyedSam Hartman2009-04-141-1/+19
| | | | | | | | | | Since the fast_req checksum is unencrypted, a keyed checksum type needs to be used. ticket: 6461 Target_Version: 1.7 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22210 dc483132-0cff-0310-8789-dd5450dbe970
* Implement kinit option for FAST armor ccacheSam Hartman2009-04-142-4/+19
| | | | | | | | | | Implement the -T option to kinit to specify the FAST armor ccache. ticket: 6460 Target_version: 1.7 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22209 dc483132-0cff-0310-8789-dd5450dbe970
* Update kdb5_util man page with missing purge_mkeys commandWill Fiveash2009-04-131-0/+12
| | | | | | | | | | | | | | While previously updating the kdb5_util command man page to include documentation on new subcommands added as a result of the Master Key Migration project I missed the purge_mkeys command. I've added that with this commit. Ticket: 6459 Version_Reported: 1.7 Target_Version: 1.7 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22208 dc483132-0cff-0310-8789-dd5450dbe970
* krb5_fcc_generate_new was destroying a locked mutex in the err_outGreg Hudson2009-04-131-0/+1
| | | | | | label, which is used for I/O failures. Unlock the mutex first. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22200 dc483132-0cff-0310-8789-dd5450dbe970
* In pa_sam, remove a gratuitous null check for etype which wasGreg Hudson2009-04-131-1/+1
| | | | | | immediately followed by dereferencing etype. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22199 dc483132-0cff-0310-8789-dd5450dbe970
* Make krb5_mkt_resolve error handling workGreg Hudson2009-04-131-69/+77
| | | | | | | | | | | | Very little is likely to go wrong inside krb5_mkt_resolve (it just allocates memory and plays with mutexes), but if anything did, the handling was almost always wrong. Reorganize the function to handle errors properly, using a helper create_list_node function to simplify the task. ticket: 6454 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22198 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5int_dns_init, fix a malloc-returning-null check which could letGreg Hudson2009-04-131-1/+1
| | | | | | a null result slip past. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22197 dc483132-0cff-0310-8789-dd5450dbe970
* More dead code elimination. When asprintf was used the varaible namelen wasEzra Peisach2009-04-121-5/+0
| | | | | | | | | no longer necessary. ticket: 6453 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22196 dc483132-0cff-0310-8789-dd5450dbe970
* remove dead codeEzra Peisach2009-04-122-7/+1
| | | | | | | | | Remove some more dead code assignment - where the variable is immediately assigned in the next statement - or not used at all. ticket: 6453 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22195 dc483132-0cff-0310-8789-dd5450dbe970
* Remove dead assignment of variables that are never usedEzra Peisach2009-04-122-5/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22194 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_get_in_tkt, r7002 introduced an unused local variableGreg Hudson2009-04-101-4/+1
| | | | | | | | | "padata". It was accidentally used in r18641 instead of preauth_to_use when sorting the received padata sequence, causing the sort to be a no-op. Sort the correct sequence and eliminate the unused local variable. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22193 dc483132-0cff-0310-8789-dd5450dbe970
* Simplify the coupling of problem to response code in recvauth_common,Greg Hudson2009-04-101-29/+9
| | | | | | eliminating a big switch statement with a dead-code default block. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22192 dc483132-0cff-0310-8789-dd5450dbe970
* Remove an unnecessary cleanup in krb5_cc_set_default_nameGreg Hudson2009-04-101-2/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22191 dc483132-0cff-0310-8789-dd5450dbe970
* Check the return value of krb5_timeofday in krb5int_populate_gic_opt.Greg Hudson2009-04-101-1/+7
| | | | | | Also initialize krb5int_populate_gic_opt's output variable. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22190 dc483132-0cff-0310-8789-dd5450dbe970
* Check return value of krb5int_copy_data_contents in preauth2.c'sGreg Hudson2009-04-101-1/+4
| | | | | | pa_salt. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22189 dc483132-0cff-0310-8789-dd5450dbe970
* kdc: handle_referral_params does not return ENOMEM errorsEzra Peisach2009-04-091-1/+1
| | | | | | | | | retval was set but never returned. ticket: 6450 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22186 dc483132-0cff-0310-8789-dd5450dbe970
* Using a patch from Apple, add support for GSS_C_DELEG_POLICY_FLAG,Greg Hudson2009-04-082-1/+11
| | | | | | | | | | | which requests delegation only if the ok-as-delegate ticket flag is set. ticket: 6203 tags: pullup target_version: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22185 dc483132-0cff-0310-8789-dd5450dbe970
* mk_safe and mk_priv require the local address to be set in the authGreg Hudson2009-04-085-54/+60
| | | | | | | | | | context; rd_safe and rd_priv require the remote address to be set. Create error codes for both kinds of missing addresses and stop trying futilely to handle the cases where they are not set. ticket: 1165 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22184 dc483132-0cff-0310-8789-dd5450dbe970
* Fall through on error returnEzra Peisach2009-04-081-3/+4
| | | | | | | | | | | | | If decoding the encoded_req_body fails, proceed goto errout instead of falling through to fast handling. Looks like a merge error. Reindented code. ticket: 6449 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22183 dc483132-0cff-0310-8789-dd5450dbe970
* When getting initial credentials with a password, try the master ifGreg Hudson2009-04-081-2/+1
| | | | | | | | | | | | preauth fails on a slave, since preauth can fail due to an out-of-date key. This removes a snippet added in r14939 which was considering only hardware preauth. ticket: 6108 tags: pullup target_version: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22182 dc483132-0cff-0310-8789-dd5450dbe970
* Subject k5_utf8s_to_ucs2s could deref NULL pointer..Ezra Peisach2009-04-071-3/+5
| | | | | | | | | | | Based on usage of this static function, this will never happen as results are always malloced (and checked) by caller. However, the function is already coded to handle the first argument being null - so be consistent throughout. ticket: git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22177 dc483132-0cff-0310-8789-dd5450dbe970
* CVE-2009-0846 asn1_decode_generaltime can free uninitialized pointerTom Yu2009-04-072-0/+17
| | | | | | | | | | | The asn1_decode_generaltime() function can free an uninitialized pointer if asn1buf_remove_charstring() fails. ticket: 6445 tags: pullup target_version: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22176 dc483132-0cff-0310-8789-dd5450dbe970
* CVE-2009-0847 asn1buf_imbed incorrect length validationTom Yu2009-04-071-2/+4
| | | | | | | | | | | | | | | | | | asn1buf_imbed() can perform pointer arithmetic that causes the "bound" pointer of the subbuffer to be less than the "next" pointer. This can lead to malloc() failure or crash. In asn1buf_imbed(), check the length before doing arithmetic to set subbuf->bound. In asn1buf_remove_octetstring() and asn1buf_remove_charstring(), check for invalid buffer pointers before executing an unsigned length check against a (casted to size_t) negative number. ticket: 6444 tags: pullup target_version: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22175 dc483132-0cff-0310-8789-dd5450dbe970
* CVE-2009-0844 SPNEGO can read beyond buffer endTom Yu2009-04-071-27/+24
| | | | | | | | | | | | | | | SPNEGO can read beyond the end of a buffer if the claimed DER length exceeds the number of bytes in the input buffer. This can lead to crash or information disclosure. Thanks to Apple for reporting this vulnerability and providing patches. ticket: 6443 tags: pullup target_version: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22174 dc483132-0cff-0310-8789-dd5450dbe970
* Apply revised patch from Apple that ensures that a REJECT token isTom Yu2009-04-071-3/+5
| | | | | | | | sent on error. ticket: 6417 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22173 dc483132-0cff-0310-8789-dd5450dbe970
* Null pointer defref in adding infoEzra Peisach2009-04-071-1/+1
| | | | | | | | | | | Clearly the code is broken - and we either never use it - or callers never pass NULL... Detected by clang static checker. ticket: 6442 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22172 dc483132-0cff-0310-8789-dd5450dbe970
* Implement KDC side of TGS FASTSam Hartman2009-04-051-3/+10
| | | | | | | | | | | Most of the KDC side of TGS FAST was already present. This adds correct generation of the reply key. ticket: 6439 target_version: 1.7 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22171 dc483132-0cff-0310-8789-dd5450dbe970