Allow encryption to be required, wait to the client to turn it on, if
failes, refuse the connection. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18111 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -59,6 +59,9 @@ int auth_level = 0;
|
|||||||
|
|
||||||
extern int utmp_len;
|
extern int utmp_len;
|
||||||
int registerd_host_only = 0;
|
int registerd_host_only = 0;
|
||||||
|
#ifdef ENCRYPTION
|
||||||
|
int require_encryption = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef NOERROR
|
#undef NOERROR
|
||||||
|
|
||||||
@@ -137,6 +140,9 @@ char valid_opts[] = "Bd:hklnS:u:UL:y"
|
|||||||
#ifdef AUTHENTICATION
|
#ifdef AUTHENTICATION
|
||||||
"a:X:z"
|
"a:X:z"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENCRYPTION
|
||||||
|
"e"
|
||||||
|
#endif
|
||||||
#ifdef DIAGNOSTICS
|
#ifdef DIAGNOSTICS
|
||||||
"D:"
|
"D:"
|
||||||
#endif
|
#endif
|
||||||
@@ -248,6 +254,11 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
#endif /* DIAGNOSTICS */
|
#endif /* DIAGNOSTICS */
|
||||||
|
|
||||||
|
#ifdef ENCRYPTION
|
||||||
|
case 'e':
|
||||||
|
require_encryption = 1;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
hostinfo = 0;
|
hostinfo = 0;
|
||||||
@@ -549,6 +560,15 @@ getterminaltype(char *name, size_t name_sz)
|
|||||||
if (his_state_is_will(TELOPT_ENCRYPT)) {
|
if (his_state_is_will(TELOPT_ENCRYPT)) {
|
||||||
encrypt_wait();
|
encrypt_wait();
|
||||||
}
|
}
|
||||||
|
if (require_encryption) {
|
||||||
|
|
||||||
|
while (encrypt_delay())
|
||||||
|
if (telnet_spin())
|
||||||
|
fatal(net, "Failed while waiting for encryption");
|
||||||
|
|
||||||
|
if (!encrypt_is_encrypting())
|
||||||
|
fatal(net, "Encryption required but not turned on by client");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (his_state_is_will(TELOPT_TSPEED)) {
|
if (his_state_is_will(TELOPT_TSPEED)) {
|
||||||
static unsigned char sb[] =
|
static unsigned char sb[] =
|
||||||
|
Reference in New Issue
Block a user