Skip to content

Commit

Permalink
Soften the message when the stanza is not the correct one
Browse files Browse the repository at this point in the history
When there are multiple stanza and they are tried one after the other,
there should not be a log with level “warning”, but only a log with
level “info”.

Issue: #337
  • Loading branch information
Seb35 committed Dec 28, 2023
1 parent 3e9a057 commit 6a19e12
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions server/incoming_spa.c
Expand Up @@ -561,8 +561,18 @@ check_mode_ctx(spa_data_t *spadat, fko_ctx_t *ctx, int attempted_decrypt,
*/
if(res != FKO_SUCCESS)
{
log_msg(LOG_WARNING, "[%s] (stanza #%d) Error creating fko context: %s",
spadat->pkt_source_ip, stanza_num, fko_errstr(res));
if(res == FKO_ERROR_INVALID_DATA_HMAC_COMPAREFAIL)
{
log_msg(LOG_DEBUG, "[%s] (stanza #%d) Error creating fko context: %s",
spadat->pkt_source_ip, stanza_num, fko_errstr(res));
log_msg(LOG_INFO, "(stanza #%d) Non-corresponding HMAC for this stanza",
stanza_num);
}
else
{
log_msg(LOG_WARNING, "[%s] (stanza #%d) Error creating fko context: %s",
spadat->pkt_source_ip, stanza_num, fko_errstr(res));
}

if(IS_GPG_ERROR(res))
log_msg(LOG_WARNING, "[%s] (stanza #%d) - GPG ERROR: %s",
Expand Down

0 comments on commit 6a19e12

Please sign in to comment.