xref: /original-bsd/libexec/telnetd/authenc.c (revision b1e4af66)
1 /*-
2  * Copyright (c) 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)authenc.c	5.2 (Berkeley) 12/18/92";
10 #endif /* not lint */
11 
12 #if	defined(ENCRYPTION) || defined(AUTHENTICATION)
13 #include "telnetd.h"
14 #include <libtelnet/misc.h>
15 
16 	int
17 net_write(str, len)
18 	unsigned char *str;
19 	int len;
20 {
21 	if (nfrontp + len < netobuf + BUFSIZ) {
22 		bcopy((void *)str, (void *)nfrontp, len);
23 		nfrontp += len;
24 		return(len);
25 	}
26 	return(0);
27 }
28 
29 	void
30 net_encrypt()
31 {
32 #if	defined(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
39 }
40 
41 	int
42 telnet_spin()
43 {
44 	ttloop();
45 	return(0);
46 }
47 
48 	char *
49 telnet_getenv(val)
50 	char *val;
51 {
52 	extern char *getenv();
53 	return(getenv(val));
54 }
55 
56 	char *
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
66