2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2N/A * Copyright 2007 by Secure Endpoints Inc. 2N/A * Permission is hereby granted, free of charge, to any person 2N/A * obtaining a copy of this software and associated documentation files 2N/A * (the "Software"), to deal in the Software without restriction, 2N/A * including without limitation the rights to use, copy, modify, merge, 2N/A * publish, distribute, sublicense, and/or sell copies of the Software, 2N/A * and to permit persons to whom the Software is furnished to do so, 2N/A * subject to the following conditions: 2N/A * The above copyright notice and this permission notice shall be 2N/A * included in all copies or substantial portions of the Software. 2N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 2N/A * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2N/A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 2N/A * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 2N/A * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 2N/A * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 2N/A * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 2N/A * Information needed by internal routines of the file-based ticket 2N/A * cache implementation. 2N/A * typedef struct krb5_keytab_entry_st { 2N/A * krb5_principal principal; principal of this key 2N/A * krb5_timestamp timestamp; time entry written to keytable 2N/A * krb5_kvno vno; key version number 2N/A * krb5_keyblock key; the secret key 2N/A *} krb5_keytab_entry; 2N/A/* Individual key entries within a table, in a linked list */ 2N/A/* Per-keytab data header */ 2N/A char *
name;
/* Name of the keytab */ 2N/A/* List of memory key tables */ 2N/A/* Iterator over memory key tables */ 2N/A/* routines to be included on extended version (write routines) */ 2N/A /* destroy the contents of node->keytab */ 2N/A /* free the keytab entries */ 2N/A /* the call to krb5_kt_free_entry uses a NULL in place of the 2N/A * krb5_context since we know that the context isn't used by 2N/A * krb5_kt_free_entry or krb5_free_principal. */ 2N/A /* destroy the lock */ 2N/A /* free the private data */ 2N/A /* and the keytab */ 2N/A /* and finally the node */ 2N/A /* data->lock was initialized last, so no need to destroy. */ 2N/A * This is an implementation specific resolver. It returns a keytab 2N/A * initialized with memory keytab routines. 2N/A /* First determine if a memory keytab of this name already exists */ 2N/A /* We will now create the new key table with the specified name. 2N/A * We do not drop the global lock, therefore the name will indeed 2N/A * be unique when we add it. 2N/A /* Increment the reference count on the keytab we found or created. */ 2N/A * "Close" a memory-based keytab. This is effectively a no-op. 2N/A * We check to see if the keytab exists and that is about it. 2N/A * Closing a file keytab does not destroy the contents. Closing 2N/A * a memory keytab shouldn't either. 2N/A /* First determine if a memory keytab of this name already exists */ 2N/A /* The specified keytab could not be found */ 2N/A /* reduce the refcount and return */ 2N/A /* In Heimdal if the refcount hits 0, the MEMORY keytab is 2N/A * destroyed since there is no krb5_kt_destroy function. 2N/A * There is no need to lock the entry while performing 2N/A * these operations as the refcount will be 0 and we are 2N/A * holding the global lock. 2N/A /* destroy the contents of node->keytab (aka id) */ 2N/A /* free the keytab entries */ 2N/A /* destroy the lock */ 2N/A /* free the private data */ 2N/A /* and the keytab */ 2N/A /* and finally the node */ 2N/A#
endif /* HEIMDAL_COMPATIBLE */ 2N/A * This is the get_entry routine for the memory based keytab implementation. 2N/A * It either retrieves the entry or returns an error. 2N/A /* if the principal isn't the one requested, continue to the next. */ 2N/A /* if the enctype is not ignored and doesn't match, 2N/A and continue to the next */ 2N/A /* we can't determine the enctype of the entry */ 2N/A /* if we found an entry that matches, ... */ 2N/A * Coerce the enctype of the output keyblock in case we 2N/A * got an inexact match on the enctype. 2N/A * Get the name of the memory-based keytab. 2N/A * krb5_mkt_start_seq_get() 2N/A * krb5_mkt_get_next() 2N/A * krb5_mkt_end_get() 2N/A "MEMORY",
/* Prefix -- this string should not appear anywhere else! */ 2N/A#
endif /* LEAN_CLIENT */