Skip to content

Commit

Permalink
Silence auth errors only, when old-auth commands were used
Browse files Browse the repository at this point in the history
Signed-off-by: Szczepan Zalega <[email protected]>
  • Loading branch information
szszszsz committed Jun 18, 2019
1 parent abaeec9 commit acfc516
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/OTP/report_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ u32 received_crc32;
u32 calculated_crc32;
u8 i;
u8 not_authorized = 0;
static u8 silence_auth_errors = 0;

static u8 oldStatus;
static u8 initOldStatus = FALSE;
Expand Down Expand Up @@ -792,6 +793,7 @@ u8 text[10];
case CMD_AUTHORIZE:
CI_StringOut ("Get CMD_AUTHORIZE\r\n");
output[OUTPUT_CMD_STATUS_OFFSET] = CMD_STATUS_OK;
silence_auth_errors = 1;
break;

case CMD_UNLOCK_USER_PASSWORD:
Expand All @@ -807,6 +809,7 @@ u8 text[10];
case CMD_USER_AUTHORIZE:
CI_StringOut ("Get CMD_USER_AUTHORIZE\r\n");
output[OUTPUT_CMD_STATUS_OFFSET] = CMD_STATUS_OK;
silence_auth_errors = 1;
break;

case CMD_GET_PASSWORD_RETRY_COUNT:
Expand Down Expand Up @@ -930,7 +933,10 @@ u8 text[10];
if (not_authorized)
{
CI_StringOut ("*** NOT AUTHORIZED ***\r\n");
output[OUTPUT_CMD_STATUS_OFFSET] = CMD_STATUS_OK;
if (silence_auth_errors == 1)
output[OUTPUT_CMD_STATUS_OFFSET] = CMD_STATUS_OK;
else
output[OUTPUT_CMD_STATUS_OFFSET] = CMD_STATUS_NOT_AUTHORIZED;
}
}
else
Expand Down

0 comments on commit acfc516

Please sign in to comment.