From: Victor Julien Date: Sat, 1 Mar 2014 16:32:27 +0000 (+0100) Subject: ssh: clean up flags X-Git-Tag: suricata-2.0rc2~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b792234dd008462e1027a554394aa420a47ff344;p=thirdparty%2Fsuricata.git ssh: clean up flags --- diff --git a/src/app-layer-ssh.c b/src/app-layer-ssh.c index dd58def540..291543236f 100644 --- a/src/app-layer-ssh.c +++ b/src/app-layer-ssh.c @@ -169,7 +169,7 @@ static int SSHParseRecordHeader(SshState *state, SshHeader *header, uint8_t *inp if (header->msg_code == SSH_MSG_NEWKEYS) { /* done */ SCLogDebug("done"); - state->flags |= SSH_FLAG_PARSER_DONE; + header->flags |= SSH_FLAG_PARSER_DONE; } else { /* not yet done */ SCLogDebug("not done"); @@ -192,7 +192,7 @@ static int SSHParseRecord(SshState *state, SshHeader *header, uint8_t *input, ui SCEnter(); int ret = 0; - if (state->flags & SSH_FLAG_PARSER_DONE) { + if (header->flags & SSH_FLAG_PARSER_DONE) { SCReturnInt(0); } @@ -1248,7 +1248,7 @@ static int SSHParserTest11(void) { goto end; } - if ( !(ssh_state->flags & SSH_FLAG_PARSER_DONE)) { + if ( !(ssh_state->cli_hdr.flags & SSH_FLAG_PARSER_DONE)) { printf("Didn't detect the msg code of new keys (ciphered data starts): "); goto end; } @@ -1338,7 +1338,7 @@ static int SSHParserTest12(void) { goto end; } - if ( !(ssh_state->flags & SSH_FLAG_PARSER_DONE)) { + if ( !(ssh_state->cli_hdr.flags & SSH_FLAG_PARSER_DONE)) { printf("Didn't detect the msg code of new keys (ciphered data starts): "); goto end; } @@ -1430,7 +1430,7 @@ static int SSHParserTest13(void) { goto end; } - if ( !(ssh_state->flags & SSH_FLAG_PARSER_DONE)) { + if ( !(ssh_state->cli_hdr.flags & SSH_FLAG_PARSER_DONE)) { printf("Didn't detect the msg code of new keys (ciphered data starts): "); goto end; } @@ -1541,7 +1541,7 @@ static int SSHParserTest14(void) { goto end; } - if ( !(ssh_state->flags & SSH_FLAG_PARSER_DONE)) { + if ( !(ssh_state->cli_hdr.flags & SSH_FLAG_PARSER_DONE)) { printf("Didn't detect the msg code of new keys (ciphered data starts): "); goto end; } @@ -1652,7 +1652,7 @@ static int SSHParserTest15(void) { goto end; } - if ( !(ssh_state->flags & SSH_FLAG_PARSER_DONE)) { + if ( !(ssh_state->cli_hdr.flags & SSH_FLAG_PARSER_DONE)) { printf("Didn't detect the msg code of new keys (ciphered data starts): "); goto end; } @@ -1742,7 +1742,7 @@ static int SSHParserTest16(void) { goto end; } - if ( !(ssh_state->flags & SSH_FLAG_PARSER_DONE)) { + if ( !(ssh_state->srv_hdr.flags & SSH_FLAG_PARSER_DONE)) { printf("Didn't detect the msg code of new keys (ciphered data starts): "); goto end; } @@ -1843,7 +1843,7 @@ static int SSHParserTest17(void) { goto end; } - if ( !(ssh_state->flags & SSH_FLAG_PARSER_DONE)) { + if ( !(ssh_state->srv_hdr.flags & SSH_FLAG_PARSER_DONE)) { printf("Didn't detect the msg code of new keys (ciphered data starts): "); goto end; } diff --git a/src/app-layer-ssh.h b/src/app-layer-ssh.h index 95ae8384a5..2bcc507117 100644 --- a/src/app-layer-ssh.h +++ b/src/app-layer-ssh.h @@ -30,7 +30,7 @@ /* This flags indicate that the rest of the communication * must be ciphered, so the parsing finish here */ -#define SSH_FLAG_PARSER_DONE 0x04 +#define SSH_FLAG_PARSER_DONE 0x02 /* MSG_CODE */ #define SSH_MSG_NEWKEYS 21 @@ -64,8 +64,6 @@ typedef struct SshHeader_ { /** structure to store the SSH state values */ typedef struct SshState_ { - uint8_t flags; /**< Flags to indicate the current SSH - sessoin state */ SshHeader srv_hdr; SshHeader cli_hdr; } SshState;