Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-ece
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-ece
Commits
7f269ee9
Commit
7f269ee9
authored
Sep 17, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reject illegal record sizes in decryption as soon as rs is decoded.
parent
9b805d4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
vfp.c
src/vfp.c
+21
-17
No files found.
src/vfp.c
View file @
7f269ee9
...
...
@@ -448,7 +448,25 @@ decrypt_init(struct vfp_ctx *ctx, struct ece *ece)
return
(
VFP_OK
);
}
}
decode_header
(
hdr
->
hdr
,
&
rs
,
&
idlen
);
if
(
rs
<
MIN_RS
)
return
(
VERR_DEC
(
ctx
,
"invalid record size %u"
,
rs
));
/*
* XXX make max_rs configurable, 0 for unlimited
* A stat should show the rs high watermark.
*/
if
(
rs
>
DEFAULT_MAX_RS
)
return
(
VERR_DEC
(
ctx
,
"record size %u exceeds max %u"
,
rs
,
DEFAULT_MAX_RS
));
if
(
rs
>
INT_MAX
)
/*
* XXX This is because the input params to the libcrypto
* functions are typed as signed int.
*/
return
(
VERR_DEC
(
ctx
,
"record size %u may not exceed %d"
,
rs
,
INT_MAX
));
if
(
HDR_LEN
(
hdr
)
<
HDR_PFX_LEN
+
idlen
)
{
len
=
(
HDR_PFX_LEN
+
idlen
)
-
HDR_LEN
(
hdr
);
vp
=
suck_bytes
(
ctx
,
hdr
->
next_in
,
&
len
);
...
...
@@ -467,23 +485,9 @@ decrypt_init(struct vfp_ctx *ctx, struct ece *ece)
return
(
VFP_NULL
);
}
ece
->
rs
=
rs
;
if
(
ece
->
rs
<
MIN_RS
)
return
(
VERR_DEC
(
ctx
,
"invalid record size %u"
,
ece
->
rs
));
/*
* XXX make max_rs configurable, 0 for unlimited
* A stat should show the rs high watermark.
*/
if
(
ece
->
rs
>
DEFAULT_MAX_RS
)
return
(
VERR_DEC
(
ctx
,
"record size %u exceeds max %u"
,
ece
->
rs
,
DEFAULT_MAX_RS
));
if
(
ece
->
rs
>
INT_MAX
)
/*
* XXX This is because the input params to the libcrypto
* functions are typed as signed int.
*/
return
(
VERR_DEC
(
ctx
,
"record size %u may not exceed %d"
,
ece
->
rs
,
INT_MAX
));
assert
(
ece
->
rs
>=
MIN_RS
);
assert
(
ece
->
rs
<=
DEFAULT_MAX_RS
);
assert
(
ece
->
rs
<=
INT_MAX
);
if
(
crypto_init
(
ctx
,
ece
->
crypto
,
hdr
->
hdr
,
hdr
->
hdr
+
HDR_PFX_LEN
,
idlen
,
0
)
==
VFP_ERROR
)
...
...
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