Skip to content

Commit

Permalink
check/assert hmac_update success (aws#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth authored Jan 5, 2024
1 parent 01dc612 commit e240d43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crypto/fipsmodule/evp/digestsign.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
#include "../digest/internal.h"
#include "internal.h"

#if defined(NDEBUG)
#define CHECK(x) (void) (x)
#else
#define CHECK(x) assert(x)
#endif

enum evp_sign_verify_t {
evp_sign,
Expand All @@ -79,7 +84,7 @@ static int uses_prehash(EVP_MD_CTX *ctx, enum evp_sign_verify_t op) {

static void hmac_update(EVP_MD_CTX *ctx, const void *data, size_t count) {
HMAC_PKEY_CTX *hctx = ctx->pctx->data;
HMAC_Update(&hctx->ctx, data, count);
CHECK(HMAC_Update(&hctx->ctx, data, count));
}

static int HMAC_DigestFinal_ex(EVP_MD_CTX *ctx, uint8_t *out_sig,
Expand Down

0 comments on commit e240d43

Please sign in to comment.