Commit 676ad923 authored by Nils Goroll's avatar Nils Goroll
parent 18a00b0e
...@@ -345,9 +345,9 @@ vmod_verifier_update_blob(VRT_CTX, struct vmod_crypto_verifier *vcv, ...@@ -345,9 +345,9 @@ vmod_verifier_update_blob(VRT_CTX, struct vmod_crypto_verifier *vcv,
ERR_clear_error(); ERR_clear_error();
if (blob && blob->len > 0) { if (blob && blob->len > 0) {
AN(blob->priv); AN(blob->blob);
if (EVP_DigestVerifyUpdate(evpctx, if (EVP_DigestVerifyUpdate(evpctx,
blob->priv, blob->len) != 1) { blob->blob, blob->len) != 1) {
VRT_fail(ctx, "EVP_DigestVerifyUpdate" VRT_fail(ctx, "EVP_DigestVerifyUpdate"
" failed, error 0x%lx", ERR_get_error()); " failed, error 0x%lx", ERR_get_error());
return (0); return (0);
...@@ -380,11 +380,11 @@ VCL_BOOL vmod_verifier_valid(VRT_CTX, ...@@ -380,11 +380,11 @@ VCL_BOOL vmod_verifier_valid(VRT_CTX,
if (evpctx == NULL) if (evpctx == NULL)
return (0); return (0);
if (sig == NULL || sig->len == 0 || sig->priv == NULL) if (sig == NULL || sig->len == 0 || sig->blob == NULL)
return (0); return (0);
ERR_clear_error(); ERR_clear_error();
r = !! EVP_DigestVerifyFinal(evpctx, sig->priv, sig->len); r = !! EVP_DigestVerifyFinal(evpctx, sig->blob, sig->len);
if (! r) { if (! r) {
VSLb(ctx->vsl, SLT_Debug, "%s.valid() failed", vcv->vcl_name); VSLb(ctx->vsl, SLT_Debug, "%s.valid() failed", vcv->vcl_name);
......
...@@ -4,40 +4,32 @@ ...@@ -4,40 +4,32 @@
.. Edit vmod.vcc and run make instead .. Edit vmod.vcc and run make instead
.. ..
.. role:: ref(emphasis)
.. _vmod_crypto(3): :tocdepth: 1
===========
vmod_crypto
===========
---------------------------------------- .. _vmod_crypto(3):
Public Key hash verification for Varnish
----------------------------------------
:Manual section: 3 ======================================================
vmod_crypto - Public Key hash verification for Varnish
======================================================
SYNOPSIS SYNOPSIS
======== ========
.. parsed-literal::
:: import crypto [from "path"]
import crypto [from "path"] ;
new xverifier = crypto.verifier(ENUM digest, STRING key)
BOOL xverifier.update(STRING) :ref:`obj_verifier`
BOOL xverifier.update_blob(BLOB) :ref:`func_verifier.update`
BOOL xverifier.reset() :ref:`func_verifier.update_blob`
BOOL xverifier.valid(BLOB signature) :ref:`func_verifier.reset`
:ref:`func_verifier.valid`
DESCRIPTION DESCRIPTION
=========== ===========
...@@ -66,16 +58,6 @@ Example ...@@ -66,16 +58,6 @@ Example
} }
} -start } -start
CONTENTS
========
* :ref:`obj_verifier`
* :ref:`func_verifier.reset`
* :ref:`func_verifier.update`
* :ref:`func_verifier.update_blob`
* :ref:`func_verifier.valid`
.. _obj_verifier: .. _obj_verifier:
new xverifier = crypto.verifier(ENUM digest, STRING key) new xverifier = crypto.verifier(ENUM digest, STRING key)
...@@ -104,7 +86,6 @@ BOOL xverifier.update(STRING) ...@@ -104,7 +86,6 @@ BOOL xverifier.update(STRING)
Add strings to the data to be verfied with the verifier object. Add strings to the data to be verfied with the verifier object.
.. _func_verifier.update_blob: .. _func_verifier.update_blob:
BOOL xverifier.update_blob(BLOB) BOOL xverifier.update_blob(BLOB)
...@@ -112,7 +93,6 @@ BOOL xverifier.update_blob(BLOB) ...@@ -112,7 +93,6 @@ BOOL xverifier.update_blob(BLOB)
Add a blob to the data to be verified with the verifier object. Add a blob to the data to be verified with the verifier object.
.. _func_verifier.reset: .. _func_verifier.reset:
BOOL xverifier.reset() BOOL xverifier.reset()
...@@ -121,7 +101,6 @@ BOOL xverifier.reset() ...@@ -121,7 +101,6 @@ BOOL xverifier.reset()
Reset the verfication state as if previous calls to the update methods Reset the verfication state as if previous calls to the update methods
had not happened. had not happened.
.. _func_verifier.valid: .. _func_verifier.valid:
BOOL xverifier.valid(BLOB signature) BOOL xverifier.valid(BLOB signature)
...@@ -138,10 +117,6 @@ signature using another call to .valid(). ...@@ -138,10 +117,6 @@ signature using another call to .valid().
SEE ALSO SEE ALSO
========vcl\(7),varnishd\(1) ========vcl\(7),varnishd\(1)
COPYRIGHT COPYRIGHT
========= =========
......
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