summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* KDC null deref due to referrals [CVE-2013-1417]Tom Yu2013-07-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An authenticated remote client can cause a KDC to crash by making a valid TGS-REQ to a KDC serving a realm with a single-component name. The process_tgs_req() function dereferences a null pointer because an unusual failure condition causes a helper function to return success. While attempting to provide cross-realm referrals for host-based service principals, the find_referral_tgs() function could return a TGS principal for a zero-length realm name (indicating that the hostname in the service principal has no known realm associated with it). Subsequently, the find_alternate_tgs() function would attempt to construct a path to this empty-string realm, and return success along with a null pointer in its output parameter. This happens because krb5_walk_realm_tree() returns a list of length one when it attempts to construct a transit path between a single-component realm and the empty-string realm. This list causes a loop in find_alternate_tgs() to iterate over zero elements, resulting in the unexpected output of a null pointer, which process_tgs_req() proceeds to dereference because there is no error condition. Add an error condition to find_referral_tgs() when krb5_get_host_realm() returns an empty realm name. Also add an error condition to find_alternate_tgs() to handle the length-one output from krb5_walk_realm_tree(). The vulnerable configuration is not likely to arise in practice. (Realm names that have a single component are likely to be test realms.) Releases prior to krb5-1.11 are not vulnerable. Thanks to Sol Jerome for reporting this problem. CVSSv2: AV:N/AC:M/Au:S/C:N/I:N/A:P/E:H/RL:O/RC:C ticket: 7668 (new) tags: pullup target_version: 1.11.4
* Install localauth_plugin.hGreg Hudson2013-07-011-0/+1
| | | | | The localauth pluggable interface was added on master in February, but we neglected to install its header file.
* Install ccselect_plugin.hGreg Hudson2013-07-011-0/+1
| | | | | | | | | The ccselect pluggable interface was added in release 1.10, but we neglected to install its header file. ticket: 7671 (new) target_version: 1.11.4 tags: pullup
* Update windows README for VS2012/Windows SDK 8Ben Kaduk2013-06-281-5/+15
| | | | | | | | | | | The Windows SDK 8 dropped the command-line build environment, so provide instructions for building with the Visual Studio (2012) command-line build environment. ticket: 7669 (new) queue: kfw tags: pullup target_version: 1.11.4
* Require Windows Installer 4.5 or higherBen Kaduk2013-06-281-1/+1
| | | | | | | | | | | | | | | As advised by the VC 11 merge modules. Windows Installer 4.5 requires Windows Server 2008, Windows Vista, Windows XP with Service Pack 2 (SP2) and later, or Windows Server 2003 with Service Pack 1 (SP1) and later. I believe we already enforce these restrictions manually elsewhere, so this should not restrict our set of valid target machines. ticket: 7667 (new) queue: kfw tags: pullup target_version: 1.11.4
* WiX support for building with VS 2012Ben Kaduk2013-06-283-28/+35
| | | | | | | | | | | The merge modules need to reference VC110 paths. Use a variable for VC100 versus VC110 so that we don't copy a lot of boilerplate around. ticket: 7666 (new) queue: kfw tags: pullup target_version: 1.11.4
* Fix uninitialized variable bugsGreg Hudson2013-06-272-1/+2
| | | | | The previous few commits introduced a couple of bugs where variables could be used without being initialized. Fix them.
* Add tests for pwqual modules and plugin orderingGreg Hudson2013-06-2710-4/+466
| | | | | | | | | | Create a test module for the pwqual interface, and script to exercise the built-in and test modules through kadmin.local. Also create a test harness to display the order of pwqual modules for the current configuration, and use it to test the plugin module ordering guarantees. ticket: 7665
* Rely on module ordering for localauthGreg Hudson2013-06-271-25/+6
| | | | | | | Register built-in localauth modules in the order we want them used by default, and document accordingly. ticket: 7665
* Provide plugin module ordering guaranteesGreg Hudson2013-06-272-200/+267
| | | | | | | | Rewrite the plugin internals so that modules have a well-defined order--either the order of enable_only tags, or dynamic modules followed by the built-in modules in order of registration. ticket: 7665 (new)
* Fix spin loop reading from KDC TCP socketViktor Dukhovni2013-06-261-2/+2
| | | | | | | | | | | | In the k5_sendto code for reading from a TCP socket, detect end-of-stream when reading the length. Otherwise we can get stuck in an infinite loop of poll() and read(). [ghudson@mit.edu: commit message] ticket: 7508 target_version: 1.11.4 tags: pullup
* Build with Visual Studio 2012Ben Kaduk2013-06-252-1/+12
| | | | | | | | | | | | It's more aggressive about enforcing that keywords are not macros in C++ mode, and has bumped the MFC version to 11. Keep compatibility with older versions of Visual Studio, appropriately conditionalized. ticket: 7664 (new) tags: pullup target_version: 1.11.4
* [Leash] Notify the user of password change successBen Kaduk2013-06-251-0/+2
| | | | | | ticket: 7440 tags: pullup target_version: 1.11.4
* Fix timing edge cases in t_renew.pyGreg Hudson2013-06-161-6/+6
| | | | | | | | | When we are testing maximum renewable lifetimes, the KDC might process the request at a later time than the request time (typically by no more than one second). So we need to ask for a ticket lifetime longer than the maximum renewable lifetime, not equal to it, or we risk getting a just-barely-renewable ticket instead of a non-renewable one. Also fix a couple of typos in comments.
* Fix sentinel position in sample u2u serverGreg Hudson2013-06-131-4/+4
| | | | | | Print "Server started" after calling listen(), or there wil be a race where the client tries to connect before there is a listen queue and gets ECONNREFUSED.
* Fix various warningsGreg Hudson2013-06-0754-305/+177
|
* Refactor KDC renewable ticket handlingGreg Hudson2013-06-066-64/+124
| | | | | | | | | | | | | | | | | | | | | Create a new helper to compute the renewable lifetime for AS and TGS requests. This has some minor behavior differences: * We only issue a renewable ticket if the renewable lifetime is greater than the normal ticket lifetime. * We give RENEWABLE precedence over RENEWABLE-OK in determining the requested renewable lifetime, instead of sometimes doing the reverse. * We use the client's maximum renewable life for TGS requests if we have looked up its DB entry. * Instead of rejecting requests for renewable tickets (if the client or server principal doesn't allow it, or a TGS request's TGT isn't renewable), issue non-renewable tickets. ticket: 7661 (new)
* Use KDC clock skew for AS-REQ timestampsGreg Hudson2013-06-051-5/+12
| | | | | | | | | | | | | | | | Calculate request timestamps each time we encode a request, and use the adjusted current time when calculating them, including adjustments resulting from preauth-required errors early in the AS exchange. As a side effect, this reverts one of the changes in commit 37b0e55e21926c7875b7176e24e13005920915a6 (#7063); we will once again use the time adjustment from any ccache we read before the AS exchange, if we don't have a more specific adjustment from a preauth-required error. Based on a patch from Stef Walter. ticket: 7657 (new)
* Refactor AS-REQ nonce and timestamp handlingGreg Hudson2013-06-053-67/+78
| | | | | | | | | | | | Create helper functions to set the request nonce and to set the request timestamp. Don't bother picking a nonce in restart_init_creds_loop since we will just pick a new one in init_creds_step_request. Create a library-internal function to get the current time with possible adjustment from a preauth-required error. Only set ctx->request_time in one place (just before encoding each request). Remove unused parameters from stash_as_reply. Partially based on a patch from Stef Walter.
* Untabify and reindent t_authpkinit.pyGreg Hudson2013-06-031-17/+16
|
* Fix spurious clock skew caused by preauth delayGreg Hudson2013-06-021-0/+3
| | | | | | | | | | Commit 37b0e55e21926c7875b7176e24e13005920915a6 (#7063) prevented clock skew caused by preauth delay by recording the time of the initial request. However, it failed to take into account delay between requests due to prompting during preauthentication. Fix this by recording the request time for each request. ticket: 7656 (new)
* Fix warnings in dbtest.cGilles Espinasse2013-05-311-20/+38
| | | | | | | | | Check return values of read() and write(). Avoid some unsigned comparisons. Cast a ptrdiff_t value to int for use with %d in a format string. [ghudson@mit.edu: rewrap long lines; fix one more warning; commit message]
* Link dbtest with libkrb5supportGreg Hudson2013-05-311-2/+2
| | | | | | | | In a static build, linking dbtest could fail on platforms where libdb2 depends on krb5support (platforms without a native mkstemp). Reported by Gilles Espinasse <g.esp@free.fr>. ticket: 7651
* Properly handle use_master in k5_init_creds_getGreg Hudson2013-05-311-2/+4
| | | | | | | | | | | If we make multiple requests in an initial creds exchange, the krb5_sendto_kdc call in k5_init_creds_get may flip the use_master value from 0 to 1 if it detects that the response was from a master KDC. Don't turn this into a requirement for future requests during the same exchange, or we may have trouble following AS referrals. Reported by Sumit Bose. ticket: 7650
* Change message macro for configure selectionGilles Espinasse2013-05-291-5/+5
| | | | | | | | | | AC_MSG_RESULT is to print result after AC_MSG_CHECKING. AC_MSG_NOTICE is to deliver message to user. So use AC_MSG_NOTICE for --with options. Remove overquoting too. ticket: 7648
* Fix non-builtin crypto module buildsGreg Hudson2013-05-2911-24/+39
| | | | | | | Commit 4b0985f8573840838bcfa8ec1df3dcd39a3dbf15 went a bit too far in pruning the placeholder makefiles for the openssl and nss crypto modules. We need enough boilerplate to create OBJS.SH in each directory.
* Make empty passwords work via init_creds APIsGreg Hudson2013-05-278-90/+166
| | | | | | | | | | | | | | In the gak_data value used by krb5_get_as_key_password, separate the already-known password from the storage we might have allocated to put it in, so that we no longer use an empty data buffer to determine whether we know the password. This allows empty passwords to work via the API. Remove the kadm5 test which explicitly uses an empty password. Based on a patch from Stef Walter. ticket: 7642
* Fix rc4 string-to-key on unterminated inputsGreg Hudson2013-05-271-16/+20
| | | | | | | | | | | The internal UTF-8 to UCS-2 conversion functions did not properly respect their length arguments, instead assuming that the input string is terminated with a zero bytes. As a result, krb5int_arcfour_string_to_key could fail on unterminated inputs. Fix the underlying support functions to read their inputs only up to the specified length. ticket: 7643 (new)
* Don't warn or error on variadic macrosGreg Hudson2013-05-251-1/+1
| | | | | Our portability assumptions now allow the use of variadic macros, so don't warn or error on them.
* Add AES-NI support on LinuxGreg Hudson2013-05-243-5/+171
| | | | | | | If yasm and cpuid.h are present on a Linux i686 or x64 system, compile the modified Intel AES-NI assembly sources. In the builtin AES enc provider, check at runtime whether the CPU supports AES-NI instructions and use the assembly functions if so.
* Adjust AESNI sources for krb5 treeGreg Hudson2013-05-242-2588/+17
| | | | | Remove functions we don't need. Add macros to redefine functions with an appropriate namespace prefix.
* Add Intel AESNI assembly filesGreg Hudson2013-05-242-0/+4280
| | | | | | Add assembly files from the Intel AESNI Sample Library, version 1.2, which implement AES encryption using AES-NI instructions. Trailing whitespace was removed.
* Refactor AES, Camellia builtin enc providersGreg Hudson2013-05-242-302/+309
| | | | | | | In preparation for AES-NI support, adjust the block encryption helpers in the AES enc provider so that the cache is only touched by helpers, and reframe the CTS operations in terms of CBC operations. Change the Camellia enc provider as well for consistency.
* Simplify crypto IOV helpersGreg Hudson2013-05-2415-768/+375
| | | | | | | | Expand the concept of an IOV block state into a cursor which remembers the IOV set being iterated over, the block size, and both input and output positions. Eliminate the no-copy inline block getter for now, but provide helpers to grab contiguous chains of blocks from a cursor. Also provide an inline helper to sum the total length of an iov chain.
* Fix krb5_rd_req usage in user-to-user sample appGreg Hudson2013-05-221-2/+2
| | | | | Pass the server principal to krb5_rd_req so it can do proper transited checking.
* Clarify krb5_rd_req documentationGreg Hudson2013-05-221-9/+19
| | | | | | | | | | For the user-to-user case, document that callers should pass a server principal to krb5_rd_req. For the keytab case, more accurately document which keytab keys are tried against the ticket. ticket: 7641 (new) target_version: 1.11.3 tags: pullup
* Fix transited handling for GSSAPI acceptorsGreg Hudson2013-05-212-3/+18
| | | | | | | | | | | | | | | | | | The Acceptor Names project (#6855) extended krb5_rd_req so that it can accept a "matching principal" in the server parameter. If the matching principal has an empty realm, rd_req_decoded_opt attempted to do transited checking with an empty server realm. To fix this, always reset server to req->ticket->server for future processing steps if we decrypt the ticket using a keytab. decrypt_ticket replaces req->ticket->server with the principal name from the keytab entry, so we know this name is correct. Based on a bug report and patch from nalin@redhat.com. ticket: 7639 target_version: 1.11.3 tags: pullup
* Try to use best DNS search functions in dnsglue.cGreg Hudson2013-05-191-23/+45
| | | | | | | | | | Create macros to declare a DNS search handle, initialize a handle, perform a search, and destroy a handle. On OS X, use the native dns_open, dns_search, and dns_free functions, since using the res_* interfaces may not contact the correct servers. On systems with res_ninit, use res_nclose if we don't have res_ndestroy. Based on a patch by Nate Rosenblum.
* Reduce boilerplate in makefilesGreg Hudson2013-05-16121-797/+63
| | | | | | | | | Provide default values in pre.in for PROG_LIBPATH, PROG_RPATH, SHLIB_DIRS, SHLIB_RDIRS, and STOBJLISTS so that they don't have to be specified in the common case. Rename KRB5_RUN_ENV and KRB5_RUN_VARS to RUN_SETUP (already the most commonly used name) and RUN_VARS. Make sure to use DEFINES for local defines (not DEFS). Remove some other unnecessary makefile content.
* Remove unused build system variablesGreg Hudson2013-05-163-34/+4
|
* Fix windows buildBen Kaduk2013-05-163-19/+12
| | | | | Catch a few stragglers that missed the memo that k5_mutex_lock cannot fail, and sprinkle some cc-int.h as needed.
* Fix NSS crypto back end for mutex changesGreg Hudson2013-05-161-5/+2
| | | | | Adjust a stray k5_mutex_lock invocation in the NSS crypto back end after 6350fd0c909d84c00200885e722cc902049ada05.
* Assume mutex locking cannot failGreg Hudson2013-05-1436-736/+296
| | | | | | | | | | | | Locking and unlocking a non-recursive mutex is a simple memory operation and should not fail on any reasonable platform with correct usage. A pthread mutex can return EDEADLK on lock or EPERM on unlock, or EINVAL if the mutex is uninitialized, but all of these conditions would reflect serious bugs in the calling code. Change the k5_mutex_lock and k5_mutex_unlock wrappers to return void and adjust all call sites. Propagate this change through k5_cc_mutex_lock and k5_cc_mutex_unlock as well.
* Don't use "bool" for ASN.1 boolean macrosNate Rosenblum2013-05-141-2/+2
| | | | | | | | | | | | When building for IOS targets with clang, the stdbool.h header is included by default. This header includes the following C99 definition: #define bool _Bool which wrecks havoc with the DEFBOOLTYPE macro. ticket: 7525
* Rename internal Camellia symbolsGreg Hudson2013-05-131-0/+12
| | | | | | | | | | | Symbols from the NTT Camellia sources, used in the builtin crypto provider, could conflict with symbols from other libraries such as OpenSSL's libcrypto. Rename those like we rename the Gladman AES symbols. ticket: 7626 target_version: 1.11.3 tags: pullup
* Fix kpasswd UDP ping-pong [CVE-2002-2443]Tom Yu2013-05-131-4/+4
| | | | | | | | | | | | | | | | | | | | The kpasswd service provided by kadmind was vulnerable to a UDP "ping-pong" attack [CVE-2002-2443]. Don't respond to packets unless they pass some basic validation, and don't respond to our own error packets. Some authors use CVE-1999-0103 to refer to the kpasswd UDP ping-pong attack or UDP ping-pong attacks in general, but there is discussion leading toward narrowing the definition of CVE-1999-0103 to the echo, chargen, or other similar built-in inetd services. Thanks to Vincent Danen for alerting us to this issue. CVSSv2: AV:N/AC:L/Au:N/C:N/I:N/A:P/E:P/RL:O/RC:C ticket: 7637 (new) target_version: 1.11.3 tags: pullup
* Fixes for leaking of refcounted resourcesNalin Dahyabhai2013-05-131-11/+22
| | | | | | | | | | | | | | | | Some fixes, some use of different APIs which seem to clean things up better, with the goal of being able to cleanly shut down NSS when we're done using it. * Use PK11_FreeSlot() instead of SECMOD_CloseUserDB() to close a database opened with SECMOD_OpenUserDB(). * Fix a typo and use PK11_DestroyGenericObject() instead of PK11_DestroyGenericObjects() to destroy one object. * Use SECMOD_DestroyModule() instead of SECMOD_UnloadUserModule() to close a module loaded with SECMOD_LoadUserModule(). * crypto_check_for_revocation_information(): don't leak a reference to the CRL, or to intermediate issuers. * Don't leak a reference to a PEM private key.
* In PKINIT NSS crypto, support encrypted PEM keysNalin Dahyabhai2013-05-131-0/+26
| | | | | | | | | | | | | When the PEM module is given an encrypted key, it changes its token flags to indicate that a password is required (by setting needs-login) to signal the application that we need to supply a password to decrypt it. Attempts to load any other items will fail until the flag is cleared. If we detect that the flag is set after we've attempted to load a private key, attempt to "log in" to the "token" using a password. Even if we fail, the token will reset its needs-login flag, which is necessary before we can import anything else.
* Get better at locating the just-loaded certificateNalin Dahyabhai2013-05-131-58/+35
| | | | | | When loading certificates using the PEM module, use a better method for finding the just-loaded certificate that will still work if we've already got a copy of the certificate loaded somewhere else.
* In PKINIT NSS crypto code, load certificates firstNalin Dahyabhai2013-05-131-61/+62
| | | | | | | | | | | | When using NSS's CMS API to generate signed-data messages, we identify the key that we want to use for signing by specifying a certificate. The library then looks up the corresponding private key when it needs to generate the signature. This lookup fails if a certificate and a its corresponding private key were loaded key-first, but succeeds if they were loaded certificate-first (RHBZ#859535). To work around this, switch to loading the certificate first. (We switch to using different _pkinit_identity_crypto_file pointers for each instead of reusing just one, so the diff is messier than it might have been.)