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
a7dff6eb
Unverified
Commit
a7dff6eb
authored
Mar 24, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generalize crypto_ctx_task_md_ctx signature
parent
21cd3102
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
vmod_crypto.c
src/vmod_crypto.c
+7
-9
No files found.
src/vmod_crypto.c
View file @
a7dff6eb
...
...
@@ -583,16 +583,14 @@ static const struct vmod_priv_methods verifier_priv_task_methods[1] = {{
}};
static
EVP_MD_CTX
*
crypto_ctx_task_md_ctx
(
VRT_CTX
,
const
struct
vmod_crypto_verifier
*
vcv
,
int
reset
)
crypto_ctx_task_md_ctx
(
VRT_CTX
,
const
void
*
id
,
EVP_MD_CTX
*
evpctx
,
int
reset
)
{
struct
vmod_crypto_ctx_task
*
vcvt
;
struct
vmod_priv
*
task
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vcv
,
VMOD_CRYPTO_VERIFIER_MAGIC
);
task
=
VRT_priv_task
(
ctx
,
vcv
);
task
=
VRT_priv_task
(
ctx
,
id
);
if
(
task
==
NULL
)
{
VRT_fail
(
ctx
,
"no priv_task"
);
...
...
@@ -626,7 +624,7 @@ crypto_ctx_task_md_ctx(VRT_CTX,
task
->
methods
=
verifier_priv_task_methods
;
}
if
(
EVP_MD_CTX_copy_ex
(
vcvt
->
evpctx
,
vcv
->
evpctx
)
!=
1
)
{
if
(
EVP_MD_CTX_copy_ex
(
vcvt
->
evpctx
,
evpctx
)
!=
1
)
{
VRT_fail
(
ctx
,
"vmod_crypto_ctx_task copy"
" failed, error 0x%lx"
,
ERR_get_error
());
EVP_MD_CTX_free
(
vcvt
->
evpctx
);
...
...
@@ -641,7 +639,7 @@ VCL_BOOL
vmod_verifier_update
(
VRT_CTX
,
struct
vmod_crypto_verifier
*
vcv
,
VCL_STRANDS
str
)
{
EVP_MD_CTX
*
evpctx
=
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
0
);
EVP_MD_CTX
*
evpctx
=
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
vcv
->
evpctx
,
0
);
const
char
*
s
;
int
i
;
...
...
@@ -671,7 +669,7 @@ VCL_BOOL
vmod_verifier_update_blob
(
VRT_CTX
,
struct
vmod_crypto_verifier
*
vcv
,
VCL_BLOB
blob
)
{
EVP_MD_CTX
*
evpctx
=
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
0
);
EVP_MD_CTX
*
evpctx
=
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
vcv
->
evpctx
,
0
);
if
(
evpctx
==
NULL
)
return
(
0
);
...
...
@@ -692,7 +690,7 @@ vmod_verifier_update_blob(VRT_CTX, struct vmod_crypto_verifier *vcv,
VCL_BOOL
vmod_verifier_reset
(
VRT_CTX
,
struct
vmod_crypto_verifier
*
vcv
)
{
return
(
!!
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
1
));
return
(
!!
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
vcv
->
evpctx
,
1
));
}
static
int
...
...
@@ -708,7 +706,7 @@ crypto_err_cb(const char *s, size_t l, void *u)
VCL_BOOL
vmod_verifier_valid
(
VRT_CTX
,
struct
vmod_crypto_verifier
*
vcv
,
VCL_BLOB
sig
)
{
EVP_MD_CTX
*
evpctx
=
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
0
);
EVP_MD_CTX
*
evpctx
=
crypto_ctx_task_md_ctx
(
ctx
,
vcv
,
vcv
->
evpctx
,
0
);
VCL_BOOL
r
;
if
(
evpctx
==
NULL
)
...
...
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