summaryrefslogtreecommitdiff
path: root/libexec/telnetd/state.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1998-08-21 17:12:23 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1998-08-21 17:12:23 +0000
commit95b72670d67b7a6889916ade14a20382e7384dd1 (patch)
tree98fcde3b776f8ba5b0c64cc249eaf95bfa3f656a /libexec/telnetd/state.c
parente2aea10efa5e0e0b89a19a440b85ca0050f7c370 (diff)
decrypt the input _before_ checking if it is \n, not _after_.
Diffstat (limited to 'libexec/telnetd/state.c')
-rw-r--r--libexec/telnetd/state.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libexec/telnetd/state.c b/libexec/telnetd/state.c
index 5e8174cdb39..312152ad024 100644
--- a/libexec/telnetd/state.c
+++ b/libexec/telnetd/state.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: state.c,v 1.8 1998/07/10 08:06:21 deraadt Exp $ */
+/* $OpenBSD: state.c,v 1.9 1998/08/21 17:12:22 art Exp $ */
/* $NetBSD: state.c,v 1.9 1996/02/28 20:38:19 thorpej Exp $ */
/*
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)state.c 8.5 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: state.c,v 1.9 1996/02/28 20:38:19 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: state.c,v 1.8 1998/07/10 08:06:21 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: state.c,v 1.9 1998/08/21 17:12:22 art Exp $";
#endif
#endif /* not lint */
@@ -134,6 +134,10 @@ telrcv()
*/
if ((c == '\r') && his_state_is_wont(TELOPT_BINARY)) {
int nc = *netip;
+#ifdef ENCRYPTION
+ if (decrypt_input)
+ nc = (*decrypt_input)(nc & 0xff);
+#endif
#ifdef LINEMODE
/*
* If we are operating in linemode,
@@ -145,10 +149,6 @@ telrcv()
c = '\n';
} else
#endif
-#ifdef ENCRYPTION
- if (decrypt_input)
- nc = (*decrypt_input)(nc & 0xff);
-#endif
{
#ifdef ENCRYPTION
if (decrypt_input)