xref: /csrg-svn/libexec/telnetd/authenc.c (revision 69786)
146813Sdab /*-
261451Sbostic  * Copyright (c) 1991, 1993
361451Sbostic  *	The Regents of the University of California.  All rights reserved.
446813Sdab  *
546813Sdab  * %sccs.include.redist.c%
646813Sdab  */
746813Sdab 
846813Sdab #ifndef lint
9*69786Sdab static char sccsid[] = "@(#)authenc.c	8.2 (Berkeley) 05/30/95";
1046813Sdab #endif /* not lint */
1146813Sdab 
1260151Sdab #if	defined(AUTHENTICATION) || defined(ENCRYPTION)
1346813Sdab #include "telnetd.h"
1446813Sdab #include <libtelnet/misc.h>
1546813Sdab 
1646813Sdab 	int
net_write(str,len)1746813Sdab net_write(str, len)
1846813Sdab 	unsigned char *str;
1946813Sdab 	int len;
2046813Sdab {
2146813Sdab 	if (nfrontp + len < netobuf + BUFSIZ) {
22*69786Sdab 		memmove((void *)nfrontp, (void *)str, len);
2346813Sdab 		nfrontp += len;
2446813Sdab 		return(len);
2546813Sdab 	}
2646813Sdab 	return(0);
2746813Sdab }
2846813Sdab 
2946813Sdab 	void
net_encrypt()3046813Sdab net_encrypt()
3146813Sdab {
3260151Sdab #ifdef	ENCRYPTION
3346813Sdab 	char *s = (nclearto > nbackp) ? nclearto : nbackp;
3446813Sdab 	if (s < nfrontp && encrypt_output) {
3546813Sdab 		(*encrypt_output)((unsigned char *)s, nfrontp - s);
3646813Sdab 	}
3746813Sdab 	nclearto = nfrontp;
3860151Sdab #endif /* ENCRYPTION */
3946813Sdab }
4046813Sdab 
4146813Sdab 	int
telnet_spin()4246813Sdab telnet_spin()
4346813Sdab {
4446813Sdab 	ttloop();
4546813Sdab 	return(0);
4646813Sdab }
4746813Sdab 
4846813Sdab 	char *
telnet_getenv(val)4946813Sdab telnet_getenv(val)
5046813Sdab 	char *val;
5146813Sdab {
5246813Sdab 	extern char *getenv();
5346813Sdab 	return(getenv(val));
5446813Sdab }
5546813Sdab 
5646813Sdab 	char *
telnet_gets(prompt,result,length,echo)5746813Sdab telnet_gets(prompt, result, length, echo)
5846813Sdab 	char *prompt;
5946813Sdab 	char *result;
6046813Sdab 	int length;
6146813Sdab 	int echo;
6246813Sdab {
6346813Sdab 	return((char *)0);
6446813Sdab }
6560151Sdab #endif	/* defined(AUTHENTICATION) || defined(ENCRYPTION) */
66