1 /* 2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 3 * Use is subject to license terms. 4 */ 5 6 /* 7 * Copyright (C) 2003 by the Massachusetts Institute of Technology. 8 * All rights reserved. 9 * 10 * Export of this software from the United States of America may 11 * require a specific license from the United States Government. 12 * It is the responsibility of any person or organization contemplating 13 * export to obtain such a license before exporting. 14 * 15 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 16 * distribute this software and its documentation for any purpose and 17 * without fee is hereby granted, provided that the above copyright 18 * notice appear in all copies and that both that copyright notice and 19 * this permission notice appear in supporting documentation, and that 20 * the name of M.I.T. not be used in advertising or publicity pertaining 21 * to distribution of the software without specific, written prior 22 * permission. Furthermore if you modify this software you must label 23 * your software as modified software and not distribute it in such a 24 * fashion that it might be confused with the original M.I.T. software. 25 * M.I.T. makes no representations about the suitability of 26 * this software for any purpose. It is provided "as is" without express 27 * or implied warranty. 28 */ 29 30 #include "k5-int.h" 31 #include "etypes.h" 32 33 /*ARGSUSED*/ 34 krb5_error_code 35 krb5int_c_mandatory_cksumtype (krb5_context ctx, krb5_enctype etype, 36 krb5_cksumtype *cksumtype) 37 { 38 int i; 39 40 for (i = 0; i < krb5_enctypes_length; i++) 41 if (krb5_enctypes_list[i].etype == etype) { 42 *cksumtype = krb5_enctypes_list[i].required_ctype; 43 return 0; 44 } 45 46 return KRB5_BAD_ENCTYPE; 47 } 48