diff --git a/appl/telnet/libtelnet/enc-proto.h b/appl/telnet/libtelnet/enc-proto.h index 086f4f988..eafae79e9 100644 --- a/appl/telnet/libtelnet/enc-proto.h +++ b/appl/telnet/libtelnet/enc-proto.h @@ -69,6 +69,7 @@ Encryptions *findencryption P((int)); void encrypt_send_supprt P((void)); void encrypt_auto P((int)); void decrypt_auto P((int)); +void encrypt_not P((void)); void encrypt_is P((unsigned char *, int)); void encrypt_reply P((unsigned char *, int)); void encrypt_start_input P((int)); diff --git a/appl/telnet/libtelnet/encrypt.c b/appl/telnet/libtelnet/encrypt.c index 43f75855a..c71c0396b 100644 --- a/appl/telnet/libtelnet/encrypt.c +++ b/appl/telnet/libtelnet/encrypt.c @@ -498,6 +498,15 @@ EncryptAutoDec(on) return(1); } +/* Called when we receive a WONT or a DONT ENCRYPT after we sent a DO + encrypt */ +void +encrypt_not(void) +{ + if(encrypt_verbose) + printf("[ Connection is NOT encrypted ]\r\n"); +} + /* * Called when ENCRYPT SUPPORT is received. */ diff --git a/appl/telnet/telnet/telnet.c b/appl/telnet/telnet/telnet.c index 0a6fc9f03..7a5c92893 100644 --- a/appl/telnet/telnet/telnet.c +++ b/appl/telnet/telnet/telnet.c @@ -376,9 +376,8 @@ willoption(option) #endif } - void -wontoption(option) - int option; +void +wontoption(int option) { if (do_dont_resp[option]) { --do_dont_resp[option]; @@ -407,6 +406,11 @@ wontoption(option) set_my_state_dont(option); return; /* Never reply to TM will's/wont's */ +#ifdef ENCRYPTION + case TELOPT_ENCRYPT: + encrypt_not(); + break; +#endif default: break; } @@ -535,9 +539,8 @@ dooption(option) set_my_state_will(option); } - static void -dontoption(option) - int option; +static void +dontoption(int option) { if (will_wont_resp[option]) { @@ -560,6 +563,11 @@ dontoption(option) send_will(TELOPT_OLD_ENVIRON, 1); telopt_environ = TELOPT_OLD_ENVIRON; break; +#endif +#ifdef ENCRYPTION + case TELOPT_ENCRYPT: + encrypt_not(); + break; #endif } /* we always accept a DONT */