summaryrefslogtreecommitdiffstats
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* In recvauth_common, convert a use of strcpy to strdupGreg Hudson2009-05-111-2/+2
| | | | | | | ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22343 dc483132-0cff-0310-8789-dd5450dbe970
* Refactor rule_an_to_ln, creating a new helper function to handle theGreg Hudson2009-05-112-125/+104
| | | | | | | | selection string specifier. Eliminate two (safe) uses of sscanf in the process. Add a test case including literal text in the selection string specifier. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22326 dc483132-0cff-0310-8789-dd5450dbe970
* Try decrypting using session key if subkey fails in tgs rep handlingSam Hartman2009-05-073-8/+13
| | | | | | | | | | | | | | | | | | | | | | Heimdal at least up through 1.2 incorrectly encrypts the TGS response in the session key not the subkey when a subkey is supplied. See RFC 4120 page 35. Work around this by trying decryption using the session key after the subkey fails. * decode_kdc_rep.c: rename to krb5int_decode_tgs_rep; only used for TGS and now needs to take keyusage * gc_via_tkt: pass in session key and appropriate usage if subkey fails. Note that the dead code to process AS responses in decode_kdc_rep is not removed by this commit. That will be removed as FAST TGS client support is integrated post 1.7. ticket: 6484 Tags: pullup Target_Version: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22325 dc483132-0cff-0310-8789-dd5450dbe970
* Allow more than 10 past keys to be stored by a policyGreg Hudson2009-05-073-75/+2
| | | | | | | | | | | Remove the arbitrary limit of 10 past keys in policies. We were not taking advantage of that limit in any other code. ticket: 6482 target_version: 1.7 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22323 dc483132-0cff-0310-8789-dd5450dbe970
* After consultation with kenh, remove a comment and if statement whichGreg Hudson2009-05-071-7/+0
| | | | | | should no longer apply to the pa_sam_2 code, fixing a memory leak. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22322 dc483132-0cff-0310-8789-dd5450dbe970
* Fix yet another memory leak in pa_samGreg Hudson2009-05-061-0/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22321 dc483132-0cff-0310-8789-dd5450dbe970
* Fix multiple memory leaks in obtain_sam_padataGreg Hudson2009-05-061-23/+29
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22320 dc483132-0cff-0310-8789-dd5450dbe970
* In pa_sam, use the correct function to free sam_challenge in theGreg Hudson2009-05-061-1/+1
| | | | | | | | success path. ticket: 6210 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22319 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a memory leak in pa_sam_2 where an outer data structure wasn'tGreg Hudson2009-05-061-0/+1
| | | | | | freed after the contents are coopted. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22318 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a memory leak in pa_samGreg Hudson2009-05-051-2/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22317 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a memory leak in krb5_obtain_padataGreg Hudson2009-05-051-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22316 dc483132-0cff-0310-8789-dd5450dbe970
* In pa_sam_2, free sc2 in an error-handling case where it was leakedGreg Hudson2009-05-051-1/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22315 dc483132-0cff-0310-8789-dd5450dbe970
* In pa_sam_2, free scratch in a couple of error-handling blocks whereGreg Hudson2009-05-051-0/+2
| | | | | | | | it was live and not freed. The function should be reorganized to use a cleanup handler, but (I believe) is not covered by the test suite and should not undergo such major surgery until it is. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22314 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5int_rd_setpw_rep, if we get an error result, set ap_rep.lengthGreg Hudson2009-05-051-0/+1
| | | | | | to 0 so that it is initialized for a check later in the function. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22313 dc483132-0cff-0310-8789-dd5450dbe970
* Remove some unnecessary null checks in krb5_get_in_tkt_with_passwordGreg Hudson2009-05-051-4/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22312 dc483132-0cff-0310-8789-dd5450dbe970
* Remove some unnecessary null checks in krb5_get_in_tkt_with_keytabGreg Hudson2009-05-051-4/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22311 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_get_in_tkt, free the whole encoded request (since theGreg Hudson2009-05-051-1/+1
| | | | | | | | structure was allocated by encode_krb5_as_req), not just the contents. ticket: 6401 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22310 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a case in the krb5_rd_rep error handler (introduced in the lastGreg Hudson2009-05-051-2/+3
| | | | | | | commit) where scratch.data could be indirected through even if it wasn't allocated successfully. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22309 dc483132-0cff-0310-8789-dd5450dbe970
* Simplify cleanup in obtain_sam_padata slightlyGreg Hudson2009-05-041-5/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22308 dc483132-0cff-0310-8789-dd5450dbe970
* Fix an error message memory leak in krb5_preauth_supply_preauth_dataGreg Hudson2009-05-041-0/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22307 dc483132-0cff-0310-8789-dd5450dbe970
* Fix some direct returns in krb5_get_cred_from_kdc_opt which would leakGreg Hudson2009-05-041-12/+25
| | | | | | memory. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22306 dc483132-0cff-0310-8789-dd5450dbe970
* krb5_rd_rep could leak memory through its output parameter on error.Greg Hudson2009-05-041-26/+34
| | | | | | | Adjust the flow control so that *repl is NULL on error and the memory allocated by decode_krb5_ap_rep_enc_part is freed. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22305 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a memory leak in krb5int_rd_chpw_rep in a block of code handlingGreg Hudson2009-05-021-4/+5
| | | | | | | | buggy MS KDC behavior. It's not entirely clear what should happen in the case where memory was leaked (error packet received containing e_data) so pick a conservative option. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22303 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a memory leak by reorganizing krb5_principal_internalize to useGreg Hudson2009-05-011-34/+34
| | | | | | | the recommended flow control for error handling. Also initialize the output parameter so that it is set in case of error. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22302 dc483132-0cff-0310-8789-dd5450dbe970
* Check return value of ftell() in krb5_ktfileint_find_slotGreg Hudson2009-05-011-0/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22301 dc483132-0cff-0310-8789-dd5450dbe970
* Move an error check to an earlier location in krb5_524_conv_principalGreg Hudson2009-05-011-2/+3
| | | | | | to fix a memory leak. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22300 dc483132-0cff-0310-8789-dd5450dbe970
* make dependSam Hartman2009-04-304-2/+15
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22299 dc483132-0cff-0310-8789-dd5450dbe970
* Implement DES and 3DES PRF. Patch fromKAMADA Ken'ichiSam Hartman2009-04-307-12/+88
| | | | | | | | | | | | | Currently the DES and 3DES PRF output 16-byte results. This is consistent with RFC 3961, but we need to confirm it is consistent with Heimdal and WG decisions. See IETF 74 minutes for some discussion of the concern as it applies to AES and thus possibly all simplified profile enctypes. ticket: 5587 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22298 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_kt_resolve, ensure that the output parameter is set to NULL onGreg Hudson2009-04-301-5/+9
| | | | | | failure even if the underlying resolver doesn't do that properly. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22297 dc483132-0cff-0310-8789-dd5450dbe970
* In ktfile_common_resolve, set the output pointer to NULL on error, andGreg Hudson2009-04-301-25/+29
| | | | | | | use a cleanup label instead of freeing the same resources in multiple error handling blocks. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22296 dc483132-0cff-0310-8789-dd5450dbe970
* 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
* Add DEBUG_ERROR_LOCATIONS supportGreg Hudson2009-04-292-0/+24
| | | | | | | | | | | | 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 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-271-0/+3
| | | | | | | | | | | 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-251-0/+14
| | | | | | | | | | | | 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
* 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