commit 0927012cb2e545e54ed80a5ac29d377e80813c73 from: Stefan Sperling via: Thomas Adam date: Wed Sep 04 19:32:33 2024 UTC fix hmac error logging; suggestions by op@ commit - 7131669ca5516991c728286f3ff04e829aaed754 commit + 0927012cb2e545e54ed80a5ac29d377e80813c73 blob - eebd2a4e6afc6e940d7c7491668d0378e83154e2 blob + e100344e77d2e37963d0fc58732e8b298127b4a6 --- gotd/libexec/got-notify-http/got-notify-http.c +++ gotd/libexec/got-notify-http/got-notify-http.c @@ -861,12 +861,12 @@ compute_hmac_sha256(FILE *payload, off_t paylen, const ctx = HMAC_CTX_new(); if (ctx == NULL) { - log_warn("HMAC_CTX_new"); + log_warnx("HMAC_CTX_new failed"); return NULL; } if (!HMAC_Init_ex(ctx, hmac_secret, secret_len, EVP_sha256(), NULL)) { - log_warn("HMAC_Init_ex"); + log_warnx("HMAC_Init_ex failed"); goto fail; } @@ -878,8 +878,7 @@ compute_hmac_sha256(FILE *payload, off_t paylen, const log_warnx("HMAC payload truncated"); goto fail; } - log_warnx("reading HMAC payload: %s", - strerror(ferror(payload))); + log_warn("failed to read HMAC payload"); goto fail; } if (!HMAC_Update(ctx, buf, r)) { @@ -890,7 +889,7 @@ compute_hmac_sha256(FILE *payload, off_t paylen, const } if (!HMAC_Final(ctx, hmac_sig_buf, hmac_siglen)) { - log_warn("HMAC_Final"); + log_warnx("HMAC_Final failed"); goto fail; }