Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-crypto
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-crypto
Commits
6977024a
Commit
6977024a
authored
Aug 28, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log details about verification failures
parent
65f26e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
vmod_crypto.c
src/vmod_crypto.c
+17
-1
No files found.
src/vmod_crypto.c
View file @
6977024a
...
...
@@ -287,10 +287,20 @@ VCL_BOOL vmod_verifier_reset(VRT_CTX,
return
(
!!
crypto_verifier_task_md_ctx
(
ctx
,
vcv
,
1
));
}
static
int
crypto_err_cb
(
const
char
*
s
,
size_t
l
,
void
*
u
)
{
VRT_CTX
;
CAST_OBJ_NOTNULL
(
ctx
,
u
,
VRT_CTX_MAGIC
);
VSLb
(
ctx
->
vsl
,
SLT_Debug
,
"crypto %.*s"
,
l
,
s
);
}
VCL_BOOL
vmod_verifier_valid
(
VRT_CTX
,
struct
vmod_crypto_verifier
*
vcv
,
VCL_BLOB
sig
)
{
EVP_MD_CTX
*
evpctx
=
crypto_verifier_task_md_ctx
(
ctx
,
vcv
,
0
);
VCL_BOOL
r
;
if
(
evpctx
==
NULL
)
return
(
0
);
...
...
@@ -299,5 +309,11 @@ VCL_BOOL vmod_verifier_valid(VRT_CTX,
return
(
0
);
ERR_clear_error
();
return
(
!!
EVP_DigestVerifyFinal
(
evpctx
,
sig
->
priv
,
sig
->
len
));
r
=
!!
EVP_DigestVerifyFinal
(
evpctx
,
sig
->
priv
,
sig
->
len
);
if
(
!
r
)
{
VSLb
(
ctx
->
vsl
,
SLT_Debug
,
"%s.valid() failed"
,
vcv
->
vcl_name
);
ERR_print_errors_cb
(
crypto_err_cb
,
(
void
*
)
ctx
);
}
return
(
r
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment