util_crypt.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright 1993 by OpenVision Technologies, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appears in all copies and
* that both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of OpenVision not be used
* in advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. OpenVision makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Copyright (C) 1998 by the FundsXpress, INC.
*
* 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 FundsXpress. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. FundsXpress makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* Solaris Kerberos: order is important here. include gssapiP_krb5.h
* before all others, otherwise we get a LINT error from MALLOC macro
* being redefined in mechglueP.h */
#include <gssapiP_krb5.h>
#include <k5-int.h>
/* Solaris Kerberos defines memory management macros in <krb5.h> */
/* #include <memory.h> */
/*
* $Id: util_crypt.c,v 1.11.6.3 2000/06/03 06:09:45 tlyu Exp $
*/
int
{
/* We special case rc4*/
return 8;
return(-1); /* XXX */
return(blocksize);
}
unsigned char *buf;
{
return(code);
}
int
int n;
{
return(-1); /* XXX */
return(enclen);
}
int usage;
int length;
{
if (iv) {
return(code);
return ENOMEM;
} else {
}
return code;
}
/* length is the length of the cleartext. */
int usage;
int length;
{
if (iv) {
return(code);
return ENOMEM;
} else {
}
return code;
}
unsigned char *output_buf)
{
unsigned char t[4];
#ifdef _KERNEL
if (code)
return (code);
#endif /* _KERNEL */
return (ENOMEM);
#ifdef _KERNEL
if (code)
return (code);
#endif /* _KERNEL */
return (ENOMEM);
}
t[0] = ms_usage &0xff;
#ifdef _KERNEL
#else
#endif /* _KERNEL */
if (code)
goto cleanup_arcfour;
#ifdef _KERNEL
#else
#endif /* _KERNEL */
if (code)
goto cleanup_arcfour;
/*
* Call the arcfour encryption method directly here, we cannot
* use the standard "krb5_c_encrypt" interface because we just
* want the arcfour algorithm applied and not the additional MD5-HMAC
* which are applied when using the standard interface.
*/
return (code);
}