/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* Copyright 1995 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*/
#include "k5-int.h"
#include "kdb.h"
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <libintl.h>
/*
* Given a particular enctype and optional salttype and kvno, find the
* most appropriate krb5_key_data entry of the database entry.
*
* If stype or kvno is negative, it is ignored.
* If kvno is 0 get the key which is maxkvno for the princ and matches
* the other attributes.
*/
{
int i, idx;
int maxkvno;
ret = 0;
kvno = 0;
if (kvno == 0) {
/* Get the max key version */
for (i = 0; i < dbentp->n_key_data; i++) {
}
}
}
maxkvno = -1;
ret = 0;
} else {
}
/*
* Filter out non-permitted enctypes.
*/
continue;
}
if (ktype > 0) {
&similar)))
return(ret);
}
if (kvno >= 0) {
idx = i;
break;
}
} else {
idx = i;
}
}
}
}
if (maxkvno < 0)
return 0;
}
/*
* kdb default functions. Ideally, some other file should have this functions. For now, TBD.
*/
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
char *keyfile;
char *master_pwd;
{
#if HAVE_UMASK
#endif
if (!keyfile) {
}
#if HAVE_UMASK
#endif
#ifdef ANSI_STDIO
/* Solaris Kerberos: using F to deal with 256 open file limit */
#else
#endif
{
int e = errno;
#if HAVE_UMASK
#endif
gettext("%s accessing file '%s'"),
error_message (e), keyfile);
return e;
}
}
#if HAVE_UMASK
#endif
return retval;
}
int *kvno,
char *db_args)
{
retval = 0;
#ifdef ANSI_STDIO
/* Solaris Kerberos: using F to deal with 256 open file limit */
#else
#endif
return KRB5_KDB_CANTREAD_STORED;
goto errout;
}
goto errout;
}
goto errout;
}
goto errout;
}
goto errout;
}
} else
retval = 0;
*kvno = 0;
return retval;
}
{
int nprinc;
nprinc = 1;
return(retval);
if (nprinc != 1) {
if (nprinc)
return(KRB5_KDB_NOMASTERKEY);
} else if (more) {
return(KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE);
}
&master_entry.key_data[0],
return retval;
}
}
return retval;
}
char *pwd,
krb5_keyblock *key )
{
/* printf("default set master key\n"); */
return 0;
}
krb5_keyblock **key )
{
/* printf("default get master key\n"); */
return 0;
}
char *s, char **args)
{
/* printf("default promote_db\n"); */
return KRB5_PLUGIN_OP_NOTSUPP;
}