version 1.2, 1996/03/27 19:32:57 |
version 1.3, 1998/03/12 04:57:27 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
#ifndef lint |
#include "telnet_locl.h" |
#if 0 |
|
static char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/6/93"; |
|
static char rcsid[] = "$NetBSD: authenc.c,v 1.5 1996/02/28 21:03:52 thorpej Exp $"; |
|
#else |
|
static char rcsid[] = "$OpenBSD$"; |
|
#endif |
|
#endif /* not lint */ |
|
|
|
#if defined(AUTHENTICATION) |
#if defined(AUTHENTICATION) || defined(ENCRYPTION) |
#include <sys/types.h> |
|
#include <arpa/telnet.h> |
|
#include <libtelnet/encrypt.h> |
|
#include <libtelnet/misc.h> |
|
|
|
#include "general.h" |
|
#include "ring.h" |
|
#include "externs.h" |
|
#include "defines.h" |
|
#include "types.h" |
|
|
|
int |
int |
net_write(str, len) |
net_write(str, len) |
unsigned char *str; |
unsigned char *str; |
|
|
void |
void |
net_encrypt() |
net_encrypt() |
{ |
{ |
|
#if defined(ENCRYPTION) |
|
if (encrypt_output) |
|
ring_encrypt(&netoring, encrypt_output); |
|
else |
|
ring_clearto(&netoring); |
|
#endif |
} |
} |
|
|
int |
int |
|
|
if (echo) { |
if (echo) { |
printf("%s", prompt); |
printf("%s", prompt); |
res = fgets(result, length, stdin); |
res = fgets(result, length, stdin); |
} else if (res = getpass(prompt)) { |
} else if ((res = getpass(prompt))) { |
strncpy(result, res, length); |
strncpy(result, res, length); |
res = result; |
res = result; |
} |
} |