string_to_enctype.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
4623N/A#pragma ident "%Z%%M% %I% %E% SMI"
4506N/A/*
4506N/A * Copyright (C) 1998 by the FundsXpress, INC.
4506N/A *
4506N/A * All rights reserved.
4506N/A *
4506N/A * Export of this software from the United States of America may require
4506N/A * a specific license from the United States Government. It is the
4506N/A * responsibility of any person or organization contemplating export to
4506N/A * obtain such a license before exporting.
4506N/A *
4506N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
4506N/A * distribute this software and its documentation for any purpose and
4506N/A * without fee is hereby granted, provided that the above copyright
4506N/A * notice appear in all copies and that both that copyright notice and
4506N/A * this permission notice appear in supporting documentation, and that
4506N/A * the name of FundsXpress. not be used in advertising or publicity pertaining
4506N/A * to distribution of the software without specific, written prior
4506N/A * permission. FundsXpress makes no representations about the suitability of
4506N/A * this software for any purpose. It is provided "as is" without express
4506N/A * or implied warranty.
4506N/A *
4506N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
4506N/A * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
4506N/A * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4506N/A */
4506N/A
4506N/A#include <k5-int.h>
4506N/A#include <etypes.h>
4506N/A
4506N/AKRB5_DLLIMP krb5_error_code KRB5_CALLCONV
4506N/Akrb5_string_to_enctype(string, enctypep)
4506N/A char FAR * string;
4506N/A krb5_enctype FAR * enctypep;
4506N/A{
4506N/A int i;
4506N/A
4506N/A for (i=0; i<krb5_enctypes_length; i++) {
4506N/A if (strcasecmp(krb5_enctypes_list[i].in_string, string) == 0) {
4506N/A *enctypep = krb5_enctypes_list[i].etype;
4506N/A return(0);
4506N/A }
4506N/A }
4506N/A
4506N/A return(EINVAL);
4506N/A}
4506N/A