aboutsummaryrefslogtreecommitdiff
path: root/client/keytab.c
AgeCommit message (Collapse)Author
2020-05-17Reformat all C code with clang-format-10Russ Allbery
2018-06-03Add SPDX-License-Identifier headersRuss Allbery
Add SPDX-License-Identifier headers to all substantial source files. Collapse copyright years. Add some Emacs configuration for files where the copyright notice is at the end. Add a test that every file has SPDX-License-Identifier.
2014-04-13Change my email address to eagle@eyrie.orgRuss Allbery
Change-Id: I4c2b5d7c807d6c27dd18a3b92eef66d21287d21e Reviewed-on: https://gerrit.stanford.edu/1481 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-01-06Fix wallet-rekey on keytabs containing multiple principalsRuss Allbery
Fix wallet-rekey on keytabs containing multiple principals. Previous versions assumed one could concatenate keytab files together to make a valid keytab file, which doesn't work with some Kerberos libraries. This caused new keys downloaded for principals after the first to be discarded. As a side effect of this fix, wallet-rekey always appends new keys directly to the existing keytab file, and never creates a backup copy of that file. Change-Id: I5f863239ce4ebba66b35ff09454f2897367bd359 Reviewed-on: https://gerrit.stanford.edu/1369 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2013-02-27Drop use of concat in favor of xasprintfRuss Allbery
Change-Id: I6a84920b0c0dc1849af8a34ecf8f3fb70b45e17c Reviewed-on: https://gerrit.stanford.edu/843 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2013-02-27Use correct form of Stanford's copyright statementRuss Allbery
Change-Id: I06dd9ecca19315179bdd34d4b301548fe7604331 Reviewed-on: https://gerrit.stanford.edu/842 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2013-02-27Check for errors when renaming new keytabRuss Allbery
When linking the temporary keytab to its final file name, wallet wasn't checking for errors. Caught by the new gcc warnings. Change-Id: Ia75b231754bafc800e9e521345b85da256c95ed1 Reviewed-on: https://gerrit.stanford.edu/840 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2010-08-13Various minor fixes for wallet-rekeyRuss Allbery
Rekey the keytab in the same principal order as what's stored in the keytab rather than reversing it, since that makes it easier to test. Suppress the error message about no data from the server if the server sent an error. Fix some coding style and spelling errors.
2010-08-13Use die instead of sysdie for no rekeyable principalsRuss Allbery
In wallet-rekey, if the keytab we're supposed to rekey has no rekeyable principals, die rather than sysdie since there's no errno error to report.
2010-07-29Abort rekeying if we fail on the first principalRuss Allbery
If we get a failure to rekey a principal before we've succeeded with any principal, abort rather than continuing.
2010-07-29Fix wallet-rekey with foreign realm keytab entriesRuss Allbery
The loop handling finding principals to rekey was not correctly coping with principals from foreign realms.
2010-07-28Break wallet-rekey out into a separate client programRuss Allbery
Build a separate wallet-rekey client that rekeys every keytab given on the command-line. Fix some coding style issues and add internal prototypes. Build the shared source for both clients into an uninstalled library to save compilation time.
2010-07-27Finished first pass of the rekey commandJon Robertson
Cleaned up several bugs preventing the rekey command from working (bad calls to variables, matching on version of principal name already stripped of realm), and removed debugging code.
2010-07-27Adding wallet rekey capability -- work in progress, testingJon Robertson
First, testing version of wallet rekey code, committed in order to get feedback from Russ. This code will eventually take an existing keytab file, and for every principal belonging to our default realm in it, get new versions of that keytab and merge them into the file. This allows for quietly rekeying principals automatically.
2010-02-09Update util code and import Kerberos portability glueRuss Allbery
Use the Kerberos portability layer from rra-c-util 3.0 and avoid Kerberos API calls deprecated on Heimdal. Break util/util.h into separate header files and update all source files accordingly. The test suite is not yet updated. That will come in subsequent commits.
2010-02-09Remove kaserver synchronization support from the wallet clientRuss Allbery
The wallet client no longer enables kaserver synchronization when a srvtab is requested with -S. Instead, it just extracts the DES key from the keytab and writes it to a srvtab. It no longer forces the kvno of the srvtab to 0 (a Stanford-specific action) and instead preserves the kvno from the key in the keytab. This should now do the right thing for sites that use a KDC that serves both Kerberos v4 and Kerberos v5 from the same database.
2010-02-08Initial port to HeimdalRuss Allbery
Just get the client code to compile with Heimdal. This will need more work later to use my regular Kerberos portability layer.
2009-06-09Remove Subversion Id stringsRuss Allbery
2008-04-24Major coding style cleanup. Updated all shared code from my otherRuss Allbery
projects. The configure option requesting AFS kaserver support (and thus building kasetkey) is now --with-kaserver instead of --with-afs. If KRB5_CONFIG was explicitly set in the environment, don't use a different krb5-config based on --with-krb4 or --with-krb5. If krb5-config isn't executable, don't use it. This allows one to force library probing by setting KRB5_CONFIG to point to a nonexistent file. Sanity-check the results of krb5-config before proceeding and error out in configure if they don't work. Stop setting Stanford-specific compile-time defaults for the wallet server and port.
2008-02-07When creating a srvtab based on a just-downloaded keytab, extract theRuss Allbery
srvtab key before merging the keytab into an existing file. Otherwise, if the new keys had a lower kvno than the old keys (possible after deleting and recreating the object), the wrong key would be extracted for the srvtab.
2008-01-19When downloading a keytab to a file that already exists, merge the newRuss Allbery
keytab keys into that file rather than moving aside the old keytab and creating a new keytab with only the new keys. Also fix get handling in the client for all types other than keytabs. This isn't visible yet since the server doesn't yet support other types of objects.
2008-01-17When getting a keytab with the client with no -f option, correctlyRuss Allbery
write the keytab to standard output rather than dying with a cryptic error.
2008-01-05The wallet client can now get the server, port, principal, and remctlRuss Allbery
type from krb5.conf as well as from compile-time defaults and command-line options.
2007-10-05Add comprehensive license information in LICENSE and update the copyrightRuss Allbery
and license statements in all files. Make sure that some files that were missing copyright information now have them. Reference LICENSE rather than README in all notices.
2007-10-05Fix the keytab attribute handling to call getattr and setattr instead ofRuss Allbery
just attr to match the actual API.
2007-10-05The wallet client now automatically sets the sync attribute on a keytabRuss Allbery
object when get is called with the -S flag.
2007-10-05Refactor the remctl calls in the wallet client to share a common routine.Russ Allbery
2007-10-05Pull keytab handling in the client into a separate file for laterRuss Allbery
expansion. Use the fine-grained remctl API instead of the simple one since in some cases we'll be running multiple commands.