Commit 5658f3cf authored by Geoff Simmons's avatar Geoff Simmons

fail faster in the hmac constructor when the key is NULL

parent 65e5af40
Pipeline #102 skipped
...@@ -470,15 +470,15 @@ vmod_hmac__init(VRT_CTX, struct vmod_blobdigest_hmac **hmacp, ...@@ -470,15 +470,15 @@ vmod_hmac__init(VRT_CTX, struct vmod_blobdigest_hmac **hmacp,
enum algorithm hash = parse_algorithm(hashs); enum algorithm hash = parse_algorithm(hashs);
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
if (key == NULL || key->priv == NULL) {
VERR(ctx, "key is NULL in %s constructor", vcl_name);
return;
}
AN(hmacp); AN(hmacp);
AZ(*hmacp); AZ(*hmacp);
AN(vcl_name); AN(vcl_name);
ALLOC_OBJ(hmac, VMOD_BLOBDIGEST_HMAC_MAGIC); ALLOC_OBJ(hmac, VMOD_BLOBDIGEST_HMAC_MAGIC);
AN(hmac); AN(hmac);
if (key == NULL || key->priv == NULL) {
VERR(ctx, "key is NULL in %s constructor", vcl_name);
return;
}
*hmacp = hmac; *hmacp = hmac;
hmac->hash = hash; hmac->hash = hash;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment