ssh: clean up flags

pull/867/head
Victor Julien 11 years ago
parent b5afe2b51f
commit b792234dd0

@ -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;
}

@ -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;

Loading…
Cancel
Save