#include <NVT.h>
Inheritance diagram for TelnetEncryptOption:


Public Member Functions | |
| TelnetEncryptOption (TCP_NVT *arg_endp) | |
| void | RecvSubOption (u_char *data, int len) |
| int | DidRequest () const |
| int | DoingEncryption () const |
Protected Attributes | |
| int | did_encrypt_request |
| int | doing_encryption |
Friends | |
| class | TCP_NVT |
|
|
Definition at line 90 of file NVT.h. References did_encrypt_request, doing_encryption, and TELNET_OPTION_ENCRYPT.
00091 : TelnetOption(arg_endp, TELNET_OPTION_ENCRYPT) 00092 { did_encrypt_request = doing_encryption = 0; } |
|
|
Definition at line 96 of file NVT.h. References did_encrypt_request.
00096 { return did_encrypt_request; }
|
|
|
Definition at line 97 of file NVT.h. References doing_encryption.
00097 { return doing_encryption; }
|
|
||||||||||||
|
Reimplemented from TelnetOption. Definition at line 157 of file NVT.cc. References TelnetOption::BadOption(), did_encrypt_request, doing_encryption, ENCRYPT_REQUEST_START_TO_ENCRYPT, ENCRYPT_STARTING_TO_ENCRYPT, TCP_NVT::FindPeerOption(), TelnetOption::InconsistentOption(), internal_error(), len, peer, and TCP_NVT::SetEncrypting().
00158 {
00159 if ( ! active )
00160 {
00161 InconsistentOption(0);
00162 return;
00163 }
00164
00165 if ( len <= 0 )
00166 {
00167 BadOption();
00168 return;
00169 }
00170
00171 unsigned int opt = data[0];
00172
00173 if ( opt == ENCRYPT_REQUEST_START_TO_ENCRYPT )
00174 ++did_encrypt_request;
00175
00176 else if ( opt == ENCRYPT_STARTING_TO_ENCRYPT )
00177 {
00178 TelnetEncryptOption* peer =
00179 (TelnetEncryptOption*) endp->FindPeerOption(code);
00180
00181 if ( ! peer )
00182 internal_error("option peer missing in TelnetEncryptOption::RecvSubOption");
00183
00184 if ( peer->DidRequest() || peer->DoingEncryption() ||
00185 peer->Endpoint()->AuthenticationHasBeenAccepted() )
00186 {
00187 endp->SetEncrypting(1);
00188 ++doing_encryption;
00189 }
00190 else
00191 InconsistentOption(0);
00192 }
00193 }
|
|
|
Reimplemented from TelnetOption. |
|
|
Definition at line 101 of file NVT.h. Referenced by DidRequest(), RecvSubOption(), and TelnetEncryptOption(). |
|
|
Definition at line 101 of file NVT.h. Referenced by DoingEncryption(), RecvSubOption(), and TelnetEncryptOption(). |
1.3.5