Path: blob/main/crypto/heimdal/appl/telnet/libtelnet/encrypt.h
34889 views
/*-1* Copyright (c) 1991, 19932* The Regents of the University of California. All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12* 3. All advertising materials mentioning features or use of this software13* must display the following acknowledgement:14* This product includes software developed by the University of15* California, Berkeley and its contributors.16* 4. Neither the name of the University nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*32* @(#)encrypt.h 8.1 (Berkeley) 6/4/9333*34* @(#)encrypt.h 5.2 (Berkeley) 3/22/9135*/3637/*38* Copyright (C) 1990 by the Massachusetts Institute of Technology39*40* Export of this software from the United States of America is assumed41* to require a specific license from the United States Government.42* It is the responsibility of any person or organization contemplating43* export to obtain such a license before exporting.44*45* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and46* distribute this software and its documentation for any purpose and47* without fee is hereby granted, provided that the above copyright48* notice appear in all copies and that both that copyright notice and49* this permission notice appear in supporting documentation, and that50* the name of M.I.T. not be used in advertising or publicity pertaining51* to distribution of the software without specific, written prior52* permission. M.I.T. makes no representations about the suitability of53* this software for any purpose. It is provided "as is" without express54* or implied warranty.55*/5657/* $Id$ */5859#ifndef __ENCRYPT__60#define __ENCRYPT__6162#define DIR_DECRYPT 163#define DIR_ENCRYPT 26465#define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \66key[4] | key[5] | key[6] | key[7])6768#define SAMEKEY(k1, k2) (!memcmp(k1, k2, sizeof(des_cblock)))6970typedef struct {71short type;72int length;73unsigned char *data;74} Session_Key;7576typedef struct {77char *name;78int type;79void (*output) (unsigned char *, int);80int (*input) (int);81void (*init) (int);82int (*start) (int, int);83int (*is) (unsigned char *, int);84int (*reply) (unsigned char *, int);85void (*session) (Session_Key *, int);86int (*keyid) (int, unsigned char *, int *);87void (*printsub) (unsigned char *, size_t, unsigned char *, size_t);88} Encryptions;8990#define SK_DES 1 /* Matched Kerberos v5 KEYTYPE_DES */9192#include "crypto-headers.h"93#ifdef HAVE_OPENSSL94#define des_new_random_key des_random_key95#endif9697#include "enc-proto.h"9899extern int encrypt_debug_mode;100extern int (*decrypt_input) (int);101extern void (*encrypt_output) (unsigned char *, int);102#endif103104105