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
935128b7
Commit
935128b7
authored
Sep 19, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in & out stats for encryption VFPs, and bugfix in for decryption.
parent
dbd9d1bb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
26 deletions
+25
-26
decrypt.vtc
src/tests/decrypt.vtc
+0
-20
encrypt.vtc
src/tests/encrypt.vtc
+2
-0
roundtrip.vtc
src/tests/roundtrip.vtc
+4
-0
vfp_decrypt.c
src/vfp_decrypt.c
+2
-5
vfp_encrypt.c
src/vfp_encrypt.c
+17
-1
No files found.
src/tests/decrypt.vtc
View file @
935128b7
...
...
@@ -132,8 +132,6 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 3
varnish v1 -expect ECE.vfp.ece_decrypt.in == 147
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
## Errors
...
...
@@ -178,8 +176,6 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 4
varnish v1 -expect ECE.vfp.ece_decrypt.in == 150
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 {
...
...
@@ -197,8 +193,6 @@ client c1 {
} -run
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 5
varnish v1 -expect ECE.vfp.ece_decrypt.in == 150
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 {
...
...
@@ -226,8 +220,6 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 6
varnish v1 -expect ECE.vfp.ece_decrypt.in == 172
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 {
...
...
@@ -247,8 +239,6 @@ client c1 {
} -run
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 7
varnish v1 -expect ECE.vfp.ece_decrypt.in == 193
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 {
...
...
@@ -276,8 +266,6 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 8
varnish v1 -expect ECE.vfp.ece_decrypt.in == 214
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 {
...
...
@@ -305,8 +293,6 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 9
varnish v1 -expect ECE.vfp.ece_decrypt.in == 235
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 {
...
...
@@ -334,8 +320,6 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 10
varnish v1 -expect ECE.vfp.ece_decrypt.in == 258
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 {
...
...
@@ -365,8 +349,6 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 11
varnish v1 -expect ECE.vfp.ece_decrypt.in == 279
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
server s1 -wait
server s1 -start
...
...
@@ -403,5 +385,3 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 12
varnish v1 -expect ECE.vfp.ece_decrypt.in == 300
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
src/tests/encrypt.vtc
View file @
935128b7
...
...
@@ -61,6 +61,8 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
} -run
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 1
varnish v1 -expect ECE.vfp.ece_encrypt.in == 15
varnish v1 -expect ECE.vfp.ece_encrypt.out == 53
# set-salt error
varnish v1 -vcl+backend {
...
...
src/tests/roundtrip.vtc
View file @
935128b7
...
...
@@ -149,7 +149,11 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
expect * = End
} -run
# encrypt.out == decrypt.in, confirm in the log
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 6
varnish v1 -expect ECE.vfp.ece_encrypt.in == 199975
varnish v1 -expect ECE.vfp.ece_encrypt.out > 199975
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 6
varnish v1 -expect ECE.vfp.ece_decrypt.in > 199975
varnish v1 -expect ECE.vfp.ece_decrypt.out == 199975
...
...
src/vfp_decrypt.c
View file @
935128b7
...
...
@@ -333,8 +333,6 @@ vfp_decrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
setOutputBuf
(
stream
,
ptr
,
*
lenp
);
inb4
=
recBufIn
(
stream
);
flushRecBuf
(
stream
);
if
(
stats
!=
NULL
)
stats
->
in
+=
recBufIn
(
stream
)
-
inb4
;
if
(
isOutputBufFull
(
stream
))
{
*
lenp
=
outputLen
(
stream
,
p
);
if
(
stats
!=
NULL
)
...
...
@@ -346,15 +344,14 @@ vfp_decrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
size_t
len
=
ece
->
chunksz
;
vp
=
suck_bytes
(
ctx
,
ece
->
buf
,
&
len
);
assert
(
len
<=
ece
->
chunksz
);
if
(
stats
!=
NULL
)
stats
->
in
+=
len
;
if
(
vp
==
VFP_ERROR
)
return
(
vp
);
setInputBuf
(
stream
,
ece
->
buf
,
len
);
}
if
(
!
isInputBufEmpty
(
stream
))
{
inb4
=
streamIn
(
stream
);
vp
=
decrypt
(
ctx
,
ece
,
vp
);
if
(
stats
!=
NULL
)
stats
->
in
+=
streamIn
(
stream
)
-
inb4
;
if
(
vp
==
VFP_ERROR
)
return
(
vp
);
}
...
...
src/vfp_encrypt.c
View file @
935128b7
...
...
@@ -208,7 +208,9 @@ vfp_encrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
struct
ece
*
ece
;
struct
ece_stream
*
stream
;
struct
ece_hdrbuf
*
hdrbuf
;
unsigned
char
*
p
=
ptr
;
const
struct
vfp_cfg
*
cfg
;
struct
VSC_ece
*
stats
;
unsigned
char
*
p
=
ptr
,
*
inb4
;
enum
vfp_status
vp
=
VFP_OK
;
CHECK_OBJ_NOTNULL
(
ctx
,
VFP_CTX_MAGIC
);
...
...
@@ -216,18 +218,23 @@ vfp_encrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
CAST_OBJ_NOTNULL
(
ece
,
ent
->
priv1
,
ECE_MAGIC
);
CHECK_OBJ_NOTNULL
(
ece
->
stream
,
ECE_STREAM_MAGIC
);
CHECK_OBJ_NOTNULL
(
ece
->
hdr
,
ECE_HDRBUF_MAGIC
);
AN
(
ent
->
vfp
);
CAST_OBJ_NOTNULL
(
cfg
,
ent
->
vfp
->
priv1
,
VFP_CFG_MAGIC
);
AN
(
ptr
);
AN
(
lenp
);
assert
(
ece
->
rs
>
TAG_LEN
+
1
);
stream
=
ece
->
stream
;
hdrbuf
=
ece
->
hdr
;
stats
=
cfg
->
stats
;
setOutputBuf
(
stream
,
ptr
,
*
lenp
);
if
(
!
isHdrBufEmpty
(
hdrbuf
))
{
flushHdrBuf
(
stream
,
hdrbuf
);
if
(
isOutputBufFull
(
stream
))
{
*
lenp
=
outputLen
(
stream
,
p
);
if
(
stats
!=
NULL
)
stats
->
out
+=
*
lenp
;
return
(
VFP_OK
);
}
}
...
...
@@ -239,12 +246,17 @@ vfp_encrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
memset
(
ece
->
buf
,
0
,
len
);
vp
=
suck_bytes
(
ctx
,
ece
->
buf
,
&
len
);
assert
(
len
<=
ece
->
chunksz
);
if
(
stats
!=
NULL
)
stats
->
in
+=
len
;
if
(
vp
==
VFP_ERROR
)
return
(
vp
);
setInputBuf
(
stream
,
ece
->
buf
,
len
);
}
else
{
inb4
=
streamIn
(
stream
);
vp
=
fillInputBuf
(
ctx
,
stream
,
ece
->
chunksz
,
vp
);
if
(
stats
!=
NULL
)
stats
->
in
+=
streamIn
(
stream
)
-
inb4
;
if
(
vp
==
VFP_ERROR
)
return
(
vp
);
}
...
...
@@ -255,6 +267,8 @@ vfp_encrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
if
(
encrypt_status
==
VFP_NULL
)
{
/* Output record was buffered */
*
lenp
=
outputLen
(
stream
,
p
);
if
(
stats
!=
NULL
)
stats
->
out
+=
*
lenp
;
return
(
VFP_OK
);
}
}
...
...
@@ -263,6 +277,8 @@ vfp_encrypt_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
}
*
lenp
=
outputLen
(
stream
,
p
);
if
(
stats
!=
NULL
)
stats
->
out
+=
*
lenp
;
return
(
vp
);
}
...
...
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