17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * Copyright (C) 1998 by the FundsXpress, INC.
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * All rights reserved.
57c478bdstevel@tonic-gate *
67c478bdstevel@tonic-gate * Export of this software from the United States of America may require
77c478bdstevel@tonic-gate * a specific license from the United States Government.  It is the
87c478bdstevel@tonic-gate * responsibility of any person or organization contemplating export to
97c478bdstevel@tonic-gate * obtain such a license before exporting.
107c478bdstevel@tonic-gate *
117c478bdstevel@tonic-gate * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
127c478bdstevel@tonic-gate * distribute this software and its documentation for any purpose and
137c478bdstevel@tonic-gate * without fee is hereby granted, provided that the above copyright
147c478bdstevel@tonic-gate * notice appear in all copies and that both that copyright notice and
157c478bdstevel@tonic-gate * this permission notice appear in supporting documentation, and that
167c478bdstevel@tonic-gate * the name of FundsXpress. not be used in advertising or publicity pertaining
177c478bdstevel@tonic-gate * to distribution of the software without specific, written prior
187c478bdstevel@tonic-gate * permission.  FundsXpress makes no representations about the suitability of
197c478bdstevel@tonic-gate * this software for any purpose.  It is provided "as is" without express
207c478bdstevel@tonic-gate * or implied warranty.
217c478bdstevel@tonic-gate *
227c478bdstevel@tonic-gate * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
237c478bdstevel@tonic-gate * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
247c478bdstevel@tonic-gate * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
27159d09aMark Phalan#include "k5-int.h"
28159d09aMark Phalan#include "etypes.h"
297c478bdstevel@tonic-gate
307c478bdstevel@tonic-gate/*ARGSUSED*/
31505d05cgtbkrb5_error_code KRB5_CALLCONV
32505d05cgtbkrb5_c_encrypt_length(krb5_context context, krb5_enctype enctype,
33159d09aMark Phalan		      size_t inputlen, size_t *length)
347c478bdstevel@tonic-gate{
357c478bdstevel@tonic-gate    int i;
367c478bdstevel@tonic-gate
377c478bdstevel@tonic-gate    for (i=0; i<krb5_enctypes_length; i++) {
387c478bdstevel@tonic-gate	if (krb5_enctypes_list[i].etype == enctype)
397c478bdstevel@tonic-gate	    break;
407c478bdstevel@tonic-gate    }
417c478bdstevel@tonic-gate
427c478bdstevel@tonic-gate    if (i == krb5_enctypes_length)
437c478bdstevel@tonic-gate	return(KRB5_BAD_ENCTYPE);
447c478bdstevel@tonic-gate
457c478bdstevel@tonic-gate    (*(krb5_enctypes_list[i].encrypt_len))
467c478bdstevel@tonic-gate	(krb5_enctypes_list[i].enc, krb5_enctypes_list[i].hash,
477c478bdstevel@tonic-gate	 inputlen, length);
487c478bdstevel@tonic-gate
497c478bdstevel@tonic-gate    return(0);
507c478bdstevel@tonic-gate}
51