54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * Use is subject to license terms.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf#pragma ident "%Z%%M% %I% %E% SMI"
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * Copyright 1995 by the Massachusetts Institute of Technology.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * All Rights Reserved.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * Export of this software from the United States of America may
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * require a specific license from the United States Government.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * It is the responsibility of any person or organization contemplating
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * export to obtain such a license before exporting.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * distribute this software and its documentation for any purpose and
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * without fee is hereby granted, provided that the above copyright
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * notice appear in all copies and that both that copyright notice and
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * this permission notice appear in supporting documentation, and that
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * the name of M.I.T. not be used in advertising or publicity pertaining
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * to distribution of the software without specific, written prior
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * permission. Furthermore if you modify this software you must label
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * your software as modified software and not distribute it in such a
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * fashion that it might be confused with the original M.I.T. software.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * M.I.T. makes no representations about the suitability of
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * this software for any purpose. It is provided "as is" without express
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * or implied warranty.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * Given a particular enctype and optional salttype and kvno, find the
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * most appropriate krb5_key_data entry of the database entry.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * If stype or kvno is negative, it is ignored.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * If kvno is 0 get the key which is maxkvno for the princ and matches
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * the other attributes.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillfkrb5_dbe_def_search_enctype(kcontext, dbentp, start, ktype, stype, kvno, kdatap)
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf if (kvno == 0) {
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf /* Get the max key version */
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * Filter out non-permitted enctypes.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf if ((ret = krb5_c_enctype_compare(kcontext, (krb5_enctype) ktype,
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf if (kvno >= 0) {
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf * kdb default functions. Ideally, some other file should have this functions. For now, TBD.
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillfkrb5_def_store_mkey(context, keyfile, mname, key, master_pwd)
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf min(sizeof(defkeyfile)-sizeof(DEFAULT_KEYFILE_STUB)-1,
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf /* Solaris Kerberos: using F to deal with 256 open file limit */
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf min(sizeof(defkeyfile)-sizeof(DEFAULT_KEYFILE_STUB)-1,
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf /* Solaris Kerberos: using F to deal with 256 open file limit */
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf if (!(kf = fopen((db_args) ? db_args : defkeyfile, "rbF")))
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf if (!(kf = fopen((db_args) ? db_args : defkeyfile, "rF")))
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf if (!(key->contents = (krb5_octet *)malloc(key->length))) {
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf krb5_db_free_principal(context, &master_entry, nprinc);
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf } else if (more) {
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf krb5_db_free_principal(context, &master_entry, nprinc);
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf if ((retval = krb5_dbekd_decrypt_key_data(context, mkey,
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf krb5_db_free_principal(context, &master_entry, nprinc);
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf krb5_db_free_principal(context, &master_entry, nprinc);
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillfkrb5_error_code kdb_def_set_mkey ( krb5_context kcontext,
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf /* printf("default set master key\n"); */
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillfkrb5_error_code kdb_def_get_mkey ( krb5_context kcontext,
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf /* printf("default get master key\n"); */
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillfkrb5_error_code krb5_def_promote_db (krb5_context kcontext,
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf char *s, char **args)
54925bf60766fbb4f1f2d7c843721406a7b7a3fbwillf /* printf("default promote_db\n"); */