summaryrefslogtreecommitdiffstats
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Pull out EOC error checks into separate functionsKen Raeburn2008-08-072-12/+34
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20629 dc483132-0cff-0310-8789-dd5450dbe970
* Use bitfields for class and construction typeKen Raeburn2008-08-071-0/+7
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20628 dc483132-0cff-0310-8789-dd5450dbe970
* Rewrite tagnum-checking code to streamline normal path and push refinedKen Raeburn2008-08-075-33/+40
| | | | | | | | | | | error code selection into error path. Don't expand asn1buf_insert_octet inline or define asn1buf_ensure_space macro if CONFIG_SMALL. Remove some null-before-free checks. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20626 dc483132-0cff-0310-8789-dd5450dbe970
* Check fstat result. Close fd on errorKen Raeburn2008-08-061-1/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20624 dc483132-0cff-0310-8789-dd5450dbe970
* Remove some 'register' declarationsKen Raeburn2008-08-061-3/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20621 dc483132-0cff-0310-8789-dd5450dbe970
* Rewrite conditional test for update log processing to make static analysis ↵Ken Raeburn2008-08-061-4/+4
| | | | | | simpler git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20620 dc483132-0cff-0310-8789-dd5450dbe970
* After freeing dbprinc, reset it to nullKen Raeburn2008-08-061-1/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20619 dc483132-0cff-0310-8789-dd5450dbe970
* In loop over entries, make local vars local to each iterationKen Raeburn2008-08-061-11/+11
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20618 dc483132-0cff-0310-8789-dd5450dbe970
* Fully initialize handle data on allocationKen Raeburn2008-08-061-0/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20617 dc483132-0cff-0310-8789-dd5450dbe970
* Don't coerce fgetc value to char before EOF checkKen Raeburn2008-08-061-2/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20616 dc483132-0cff-0310-8789-dd5450dbe970
* fix cleanup code in allocating preauth infoKen Raeburn2008-08-061-2/+2
| | | | | | | | | | | | After an allocation failure, free up the previously allocated array elements by counting back down to zero, not continuing to count up until we hit zero. ticket: new target_version: 1.6.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20608 dc483132-0cff-0310-8789-dd5450dbe970
* specify return type of 'harmless'Ken Raeburn2008-08-051-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20605 dc483132-0cff-0310-8789-dd5450dbe970
* Use load/store_32/16_be/le functionsKen Raeburn2008-08-023-23/+9
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20603 dc483132-0cff-0310-8789-dd5450dbe970
* Pull out two copies of errno mapping into a common functionKen Raeburn2008-08-021-60/+42
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20602 dc483132-0cff-0310-8789-dd5450dbe970
* Use load_store_16/32_beKen Raeburn2008-08-022-10/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20601 dc483132-0cff-0310-8789-dd5450dbe970
* Make more uses of load/store_32_be/le, which on x86 at least expandsKen Raeburn2008-08-027-67/+22
| | | | | | | to a single unaligned load/store instruction, instead of open-coding the shifts and masks. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20599 dc483132-0cff-0310-8789-dd5450dbe970
* Use GET_HALF_BLOCK to fetch new values instead of open-codingKen Raeburn2008-08-022-16/+10
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20598 dc483132-0cff-0310-8789-dd5450dbe970
* Use krb5int_random_string, load_32_be, load_16_be, store_32_be, andKen Raeburn2008-08-021-66/+6
| | | | | | | store_16_be. Change krb5_krcc_unparse_int32 to call krb5_krc_unparse_ui_4 and reduce duplicated code. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20597 dc483132-0cff-0310-8789-dd5450dbe970
* Rename and export random_string from cc_memory.cKen Raeburn2008-08-021-5/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20596 dc483132-0cff-0310-8789-dd5450dbe970
* Reduce code duplication: krb5_fcc_store_int32 vs krb5_fcc_store_ui_4Ken Raeburn2008-08-021-18/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20595 dc483132-0cff-0310-8789-dd5450dbe970
* Two versions of resolver code were almost identical, so unify them and ↵Ken Raeburn2008-08-021-37/+11
| | | | | | reduce duplication. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20594 dc483132-0cff-0310-8789-dd5450dbe970
* Pull out code to compute length of quoted name component and copy withKen Raeburn2008-08-021-78/+68
| | | | | | quoting into separate functions, to reduce code duplication. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20593 dc483132-0cff-0310-8789-dd5450dbe970
* Delete decls for nonexistent functions, and an unused typedefKen Raeburn2008-07-301-15/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20589 dc483132-0cff-0310-8789-dd5450dbe970
* fix possible uninit variable use in error pathKen Raeburn2008-07-251-0/+1
| | | | | | | | | | | Clear gss_client and gss_target before any possible branch to 'error', where they can be used. ticket: new target_version: 1.6.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20580 dc483132-0cff-0310-8789-dd5450dbe970
* In the gss rpc package, replace the type used for a Jeffrey Altman2008-07-236-29/+32
| | | | | | | | | | | | | | socket on Windows with SOCKET (instead of int) and replace all calls to close() that are used to close sockets with closesocket(). src/include/port-sockets.h includes the definitions of SOCKET and closesocket() for non-Windows systems. ticket: 6041 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20578 dc483132-0cff-0310-8789-dd5450dbe970
* Fix one missed rename of "exit" label to "done"Tom Yu2008-07-231-1/+1
| | | | | | ticket: 5442 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20575 dc483132-0cff-0310-8789-dd5450dbe970
* replace "exit" label with "done"Jeffrey Altman2008-07-231-4/+4
| | | | | | ticket: 5442 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20574 dc483132-0cff-0310-8789-dd5450dbe970
* Catch a few more cases of unchecked k5_mutex_lock callsKen Raeburn2008-07-221-1/+3
| | | | | | ticket: 5962 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20567 dc483132-0cff-0310-8789-dd5450dbe970
* Another check for null return from krb5_cc_default_nameKen Raeburn2008-07-211-11/+19
| | | | | | ticket: 5980 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20561 dc483132-0cff-0310-8789-dd5450dbe970
* Check for null name to krb5_cc_resolve, and return an errorKen Raeburn2008-07-211-1/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20560 dc483132-0cff-0310-8789-dd5450dbe970
* This patch addresses the issues raised in this ticket and ticket 5936Jeffrey Altman2008-07-211-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (a) In the case where 'cred_handle' != 'verifier_cred_handle'[1] krb5_gss_accept_sec_context() leaks the 'cred_handle' in the success case and the failure cases that result in returning from the function prior to reaching the end of the function. (b) The meaningful 'minor_status' return value is destroyed during the cleanup operations. The approach taken is to add a new 'exit:' label prior to the end of the function through which all function returns after reaching the 'fail:' label will goto. After 'exit:', the 'cred_handle' will be released and if there is a krb5_context 'context' to be freed, the error info will be saved and krb5_free_context() will be called. In the success case, the krb5_context is saved in the gss context and we now set 'context' to NULL to prevent it from being freed. In order to preserve the minor_status return code, a 'tmp_minor_status' variable is added that is used after the 'fail:' label in calls to krb5_gss_delete_sec_context() and krb5_gss_release_cred(). [1] If 'verifier_cred_handle' is non-NULL, then 'cred_handle' is set to the value of 'verifier_cred_handle'. ticket: 5442 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20559 dc483132-0cff-0310-8789-dd5450dbe970
* kadm5_decrypt_key(). This patch prevents the returned keyblock's Jeffrey Altman2008-07-211-1/+2
| | | | | | | | | | enctype from being coerced to the requested 'ktype' if the requested 'ktype' == -1. A ktype of -1 is documented as meaning "to be ignored". ticket: 5840 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20558 dc483132-0cff-0310-8789-dd5450dbe970
* krb5_string_to_keysalts()Jeffrey Altman2008-07-211-1/+1
| | | | | | | | | Fix an infinite loop in the parsing of 'kp' ticket: 5839 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20557 dc483132-0cff-0310-8789-dd5450dbe970
* There are two mutex locking issues that Roland Dowdeswell noticed in Jeffrey Altman2008-07-211-0/+13
| | | | | | | | | | | | | the memory ccache. The first one is in cc_memory.c:krb5_mcc_initialize(). When it is free(3)ing the existing credentials it does not lock the data structures and hence two separate threads can run into issues. The same problem exists in cc_memory.c:krb5_mcc_destroy(). ticket: 5895 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20555 dc483132-0cff-0310-8789-dd5450dbe970
* Assign fixed ordinals to comerr32.dll exportsJeffrey Altman2008-07-211-7/+7
| | | | | | | | | | | | | | All of the other libraries on Windows have fixed assignments of ordinals to the exported functions. Assign the ordinals that were in use in the last public release, kfw 3.2.2, so that they will remain constant into the future in case additional exports are added to the library. ticket: new component: krb5-libs tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20553 dc483132-0cff-0310-8789-dd5450dbe970
* ccdefault.c:Jeffrey Altman2008-07-211-2/+4
| | | | | | | | | | | | | | | | | krb5_cc_default_name() is permitted to return a NULL pointer as a valid output. Passing a NULL pointer to strcmp() will result in an exception as NULL is not a valid input parameter to strcmp(). Save the output of krb5_cc_default_name() to a variable and modify the conditional to set the new default ccache name in the case where there is no existing default ccache name. ticket: 5080 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20551 dc483132-0cff-0310-8789-dd5450dbe970
* Don't set LOCAL_SUBDIRS in many places and SUBDIRS in a few andKen Raeburn2008-07-206-6/+6
| | | | | | | default SUBDIRS to LOCAL_SUBDIRS via pre.in. Instead, just set SUBDIRS in each directory, and don't do anything in pre.in. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20546 dc483132-0cff-0310-8789-dd5450dbe970
* Use mkstemp(), and fstat() the file to make sure that the mkstemp()Tom Yu2008-07-181-19/+60
| | | | | | | | implementation is setting sane file modes. ticket: 6002 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20543 dc483132-0cff-0310-8789-dd5450dbe970
* Revert due to potential file modes race conditionTom Yu2008-07-181-18/+14
| | | | | | | ticket: 6002 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20538 dc483132-0cff-0310-8789-dd5450dbe970
* Make krb5_rc_io_creat() use mkstempTom Yu2008-07-181-14/+18
| | | | | | ticket: 6002 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20537 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_rc_io_creat(), unlink any existing rcache file before tryingTom Yu2008-07-171-1/+2
| | | | | | | | | | | to create a new rcache. This allows better recovery from corrupt rcache files. ticket: 6018 target_version: 1.6.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20536 dc483132-0cff-0310-8789-dd5450dbe970
* Fix indirection on assignment to minor statusTom Yu2008-07-161-4/+4
| | | | | | ticket: 5962 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20530 dc483132-0cff-0310-8789-dd5450dbe970
* Check return value from k5_mutex_lock() to partially mitigate someTom Yu2008-07-162-10/+23
| | | | | | | | assertion failures when mutexes get destroyed out from under us. ticket: 5962 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20529 dc483132-0cff-0310-8789-dd5450dbe970
* r1926@ken-wireless: raeburn | 2008-07-15 16:49:17 -0400Ken Raeburn2008-07-152-0/+72
| | | | | | | | | | | | ticket: 5947 status: open Add a test script for the walk_rtree code, and run some test cases that exercise the problem reported in RT ticket 5947. r1927@ken-wireless: raeburn | 2008-07-15 19:55:10 -0400 Some more test cases. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20528 dc483132-0cff-0310-8789-dd5450dbe970
* krb5_get_cred_via_tkt() should null out_cred on errorsTom Yu2008-07-151-0/+1
| | | | | | | | | | | | | Helper function krb5_kdcrep2creds(), called from krb5_get_cred_via_tkt(), should null its output pointer after freeing allocated memory, to avoid returning an invalid pointer. ticket: new tags: pullup target_version: 1.6.4 component: krb5-libs git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20527 dc483132-0cff-0310-8789-dd5450dbe970
* Use all local addresses except loopback addresses, even if a non-loopbackKen Raeburn2008-07-121-17/+26
| | | | | | | | | | | | address appears on a loopback interface. This might happen if that's how your VPN code makes your local address visible. Use a variant of Apple's patch, extended to handle the other variations of local address determination. ticket: 6017 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20513 dc483132-0cff-0310-8789-dd5450dbe970
* Use autogenerated darwin.exports files for server frameworksAlexandra Ellwood2008-07-094-2/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20506 dc483132-0cff-0310-8789-dd5450dbe970
* add copyright to lib/crypto/enc_provider/aes.cTom Yu2008-07-091-0/+26
| | | | | | | | | | | | lib/crypto/enc_provider/aes.c was missing a copyright statement. Added. ticket: new tags: pullup component: krb5-libs target_version: 1.6.4 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20503 dc483132-0cff-0310-8789-dd5450dbe970
* Changes to krb5_kt_default_name changed the krb5 ABI. RevertedAlexandra Ellwood2008-07-081-1/+2
| | | | | | | | | API prototype change and added a temporary variable to avoid casting problems. ticket: 5432 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20502 dc483132-0cff-0310-8789-dd5450dbe970
* krb5int_gic_opte_copy should copy elements individuallyAlexandra Ellwood2008-07-071-2/+13
| | | | | | | | | | Since we are copying from one structure to another, copy elements. Using memcpy is fragile. ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20499 dc483132-0cff-0310-8789-dd5450dbe970