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
4e8a19a4
Commit
4e8a19a4
authored
Sep 18, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the decrypt_init() params.
parent
e2f0680a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
vfp_decrypt.c
src/vfp_decrypt.c
+14
-14
No files found.
src/vfp_decrypt.c
View file @
4e8a19a4
...
...
@@ -48,15 +48,16 @@
#define HDR_LEN(hdr) ((hdr)->next_in - (hdr)->hdr)
static
enum
vfp_status
decrypt_init
(
struct
vfp_ctx
*
ctx
,
struct
ece
*
ece
,
const
struct
vfp_cfg
*
cfg
,
const
char
*
vfp_name
)
decrypt_init
(
struct
vfp_ctx
*
ctx
,
struct
ece
*
ece
,
struct
vfp_entry
*
ent
)
{
struct
vfp_settings
*
settings
;
const
struct
vfp_cfg
*
cfg
;
struct
ece_hdrbuf
*
hdr
;
enum
vfp_status
vp
;
size_t
len
;
uint32_t
rs
;
uint8_t
idlen
;
const
char
*
name
;
CHECK_OBJ_NOTNULL
(
ctx
,
VFP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
wrk
,
WORKER_MAGIC
);
...
...
@@ -64,9 +65,14 @@ decrypt_init(struct vfp_ctx *ctx, struct ece *ece, const struct vfp_cfg *cfg,
CHECK_OBJ_NOTNULL
(
ece
,
ECE_MAGIC
);
CHECK_OBJ_NOTNULL
(
ece
->
crypto
,
ECE_CRYPTO_MAGIC
);
CHECK_OBJ_NOTNULL
(
ece
->
hdr
,
ECE_HDRBUF_MAGIC
);
CHECK_OBJ_NOTNULL
(
cfg
,
VFP_CFG_MAGIC
);
CHECK_OBJ_NOTNULL
(
ent
,
VFP_ENTRY_MAGIC
);
AN
(
ent
->
vfp
);
CAST_OBJ_NOTNULL
(
cfg
,
ent
->
vfp
->
priv1
,
VFP_CFG_MAGIC
);
CHECK_OBJ_NOTNULL
(
cfg
->
settings
,
VFP_SETTINGS_MAGIC
);
AN
(
vfp_name
);
AN
(
ent
->
vfp
->
name
);
settings
=
cfg
->
settings
;
name
=
ent
->
vfp
->
name
;
AZ
(
ece
->
rs
);
AZ
(
ece
->
chunksz
);
AZ
(
ece
->
buf
);
...
...
@@ -74,7 +80,6 @@ decrypt_init(struct vfp_ctx *ctx, struct ece *ece, const struct vfp_cfg *cfg,
AN
(
hdr
->
hdr
);
AN
(
hdr
->
next_in
);
AN
(
hdr
->
avail_in
);
settings
=
cfg
->
settings
;
if
(
HDR_LEN
(
hdr
)
<
HDR_PFX_LEN
)
{
len
=
HDR_PFX_LEN
-
HDR_LEN
(
hdr
);
...
...
@@ -149,10 +154,10 @@ decrypt_init(struct vfp_ctx *ctx, struct ece *ece, const struct vfp_cfg *cfg,
ece
->
stream
->
rec_next
=
ece
->
stream
->
rec_buf
;
AZ
(
ece
->
stream
->
rec_avail
);
VSLb
(
ctx
->
wrk
->
vsl
,
SLT_Debug
,
"%s: id
\"
%.*s
\"
"
,
vfp_
name
,
idlen
,
VSLb
(
ctx
->
wrk
->
vsl
,
SLT_Debug
,
"%s: id
\"
%.*s
\"
"
,
name
,
idlen
,
hdr
->
hdr
+
HDR_PFX_LEN
);
VSLb
(
ctx
->
wrk
->
vsl
,
SLT_Debug
,
"%s: record size %u"
,
vfp_
name
,
ece
->
rs
);
VSLb
(
ctx
->
wrk
->
vsl
,
SLT_Debug
,
"%s: chunk size %zu"
,
vfp_
name
,
VSLb
(
ctx
->
wrk
->
vsl
,
SLT_Debug
,
"%s: record size %u"
,
name
,
ece
->
rs
);
VSLb
(
ctx
->
wrk
->
vsl
,
SLT_Debug
,
"%s: chunk size %zu"
,
name
,
ece
->
chunksz
);
return
(
VFP_END
);
...
...
@@ -282,7 +287,6 @@ vfp_decrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
{
struct
ece
*
ece
;
struct
ece_stream
*
stream
;
const
struct
vfp_cfg
*
cfg
;
unsigned
char
*
p
=
ptr
;
enum
vfp_status
vp
=
VFP_OK
;
...
...
@@ -296,11 +300,7 @@ vfp_decrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
stream
=
ece
->
stream
;
if
(
ece
->
rs
==
0
)
{
CHECK_OBJ_NOTNULL
(
ent
,
VFP_ENTRY_MAGIC
);
AN
(
ent
->
vfp
);
AN
(
ent
->
vfp
->
name
);
CAST_OBJ_NOTNULL
(
cfg
,
ent
->
vfp
->
priv1
,
VFP_CFG_MAGIC
);
vp
=
decrypt_init
(
ctx
,
ece
,
cfg
,
ent
->
vfp
->
name
);
vp
=
decrypt_init
(
ctx
,
ece
,
ent
);
if
(
vp
==
VFP_ERROR
)
return
(
vp
);
if
(
vp
==
VFP_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