]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ssh: clean up flags
authorVictor Julien <victor@inliniac.net>
Sat, 1 Mar 2014 16:32:27 +0000 (17:32 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Mar 2014 16:34:57 +0000 (17:34 +0100)
src/app-layer-ssh.c
src/app-layer-ssh.h

index dd58def5408f4abda1f1a2b2ec6d1c09bacffc53..291543236fbc1f4b4d506bbf01cf716cf9995cf1 100644 (file)
@@ -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;
     }
index 95ae8384a56eaf920bbe6fbbe1be16d1b4b6b74b..2bcc507117b8f1a0524da743a522d4e65571e803 100644 (file)
@@ -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;