2N/A/*
2N/A * Copyright (C) 1998 by the FundsXpress, INC.
2N/A *
2N/A * All rights reserved.
2N/A *
2N/A * Export of this software from the United States of America may require
2N/A * a specific license from the United States Government. It is the
2N/A * responsibility of any person or organization contemplating export to
2N/A * obtain such a license before exporting.
2N/A *
2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
2N/A * distribute this software and its documentation for any purpose and
2N/A * without fee is hereby granted, provided that the above copyright
2N/A * notice appear in all copies and that both that copyright notice and
2N/A * this permission notice appear in supporting documentation, and that
2N/A * the name of FundsXpress. not be used in advertising or publicity pertaining
2N/A * to distribution of the software without specific, written prior
2N/A * permission. FundsXpress makes no representations about the suitability of
2N/A * this software for any purpose. It is provided "as is" without express
2N/A * or implied warranty.
2N/A *
2N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
2N/A * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
2N/A * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2N/A */
2N/A
2N/A#include "k5-int.h"
2N/A#include "old.h"
2N/A#include <des_int.h>
2N/A
2N/A/* XXX */
2N/Aextern krb5_error_code mit_des_string_to_key_int
2N/A(krb5_context context,
2N/A krb5_keyblock * keyblock,
2N/A const krb5_data * data,
2N/A const krb5_data * salt);
2N/A
2N/A/*ARGSUSED*/
2N/Akrb5_error_code
2N/Akrb5int_des_string_to_key(krb5_context context,
2N/A const struct krb5_enc_provider *enc,
2N/A const krb5_data *string,
2N/A const krb5_data *salt, const krb5_data *parm,
2N/A krb5_keyblock *key)
2N/A{
2N/A int type;
2N/A if (parm ) {
2N/A if (parm->length != 1)
2N/A return KRB5_ERR_BAD_S2K_PARAMS;
2N/A type = parm->data[0];
2N/A }
2N/A else type = 0;
2N/A switch(type) {
2N/A case 0:
2N/A /* Solaris Kerberos */
2N/A return(mit_des_string_to_key_int(context, key, string, salt));
2N/A case 1:
2N/A /* Solaris Kerberos */
2N/A return mit_afs_string_to_key(context, key, string, salt);
2N/A default:
2N/A return KRB5_ERR_BAD_S2K_PARAMS;
2N/A }
2N/A}