xref: /original-bsd/libexec/telnetd/authenc.c (revision de436421)
1 /*-
2  * Copyright (c) 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)authenc.c	8.2 (Berkeley) 05/30/95";
10 #endif /* not lint */
11 
12 #if	defined(AUTHENTICATION) || defined(ENCRYPTION)
13 #include "telnetd.h"
14 #include <libtelnet/misc.h>
15 
16 	int
net_write(str,len)17 net_write(str, len)
18 	unsigned char *str;
19 	int len;
20 {
21 	if (nfrontp + len < netobuf + BUFSIZ) {
22 		memmove((void *)nfrontp, (void *)str, len);
23 		nfrontp += len;
24 		return(len);
25 	}
26 	return(0);
27 }
28 
29 	void
net_encrypt()30 net_encrypt()
31 {
32 #ifdef	ENCRYPTION
33 	char *s = (nclearto > nbackp) ? nclearto : nbackp;
34 	if (s < nfrontp && encrypt_output) {
35 		(*encrypt_output)((unsigned char *)s, nfrontp - s);
36 	}
37 	nclearto = nfrontp;
38 #endif /* ENCRYPTION */
39 }
40 
41 	int
telnet_spin()42 telnet_spin()
43 {
44 	ttloop();
45 	return(0);
46 }
47 
48 	char *
telnet_getenv(val)49 telnet_getenv(val)
50 	char *val;
51 {
52 	extern char *getenv();
53 	return(getenv(val));
54 }
55 
56 	char *
telnet_gets(prompt,result,length,echo)57 telnet_gets(prompt, result, length, echo)
58 	char *prompt;
59 	char *result;
60 	int length;
61 	int echo;
62 {
63 	return((char *)0);
64 }
65 #endif	/* defined(AUTHENTICATION) || defined(ENCRYPTION) */
66