Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-esiextra
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-esiextra
Commits
87ec239b
Commit
87ec239b
authored
Nov 05, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reflect master SHA256->VSHA256 rename
parent
f8980595
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
vfp_bodyhash.c
src/vfp_bodyhash.c
+8
-8
No files found.
src/vfp_bodyhash.c
View file @
87ec239b
...
@@ -20,9 +20,9 @@ struct bodyhash {
...
@@ -20,9 +20,9 @@ struct bodyhash {
unsigned
magic
;
unsigned
magic
;
#define BODYHASH_MAGIC 0xb0d16a56
#define BODYHASH_MAGIC 0xb0d16a56
struct
SHA256Context
sha256ctx
;
struct
V
SHA256Context
sha256ctx
;
char
*
hdr
;
char
*
hdr
;
// unsigned char hash[SHA256_LEN];
// unsigned char hash[
V
SHA256_LEN];
};
};
const
char
placeholder
[]
=
"
\"
vmod-esiextra magic placeholder "
\
const
char
placeholder
[]
=
"
\"
vmod-esiextra magic placeholder "
\
...
@@ -39,13 +39,13 @@ vfp_bodyhash_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
...
@@ -39,13 +39,13 @@ vfp_bodyhash_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
AN
(
vfe
->
priv1
);
AN
(
vfe
->
priv1
);
assert
(
vfe
->
vfp
==
&
VFP_bodyhash
);
assert
(
vfe
->
vfp
==
&
VFP_bodyhash
);
assert
(
placeholder_l
==
SHA256_LEN
*
2
+
2
);
assert
(
placeholder_l
==
V
SHA256_LEN
*
2
+
2
);
// XXX workspace
// XXX workspace
ALLOC_OBJ
(
bh
,
BODYHASH_MAGIC
);
ALLOC_OBJ
(
bh
,
BODYHASH_MAGIC
);
if
(
bh
==
NULL
)
if
(
bh
==
NULL
)
return
(
VFP_ERROR
);
return
(
VFP_ERROR
);
SHA256_Init
(
&
bh
->
sha256ctx
);
V
SHA256_Init
(
&
bh
->
sha256ctx
);
bh
->
hdr
=
vfe
->
priv1
;
bh
->
hdr
=
vfe
->
priv1
;
vfe
->
priv1
=
bh
;
vfe
->
priv1
=
bh
;
...
@@ -69,7 +69,7 @@ vfp_bodyhash_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
...
@@ -69,7 +69,7 @@ vfp_bodyhash_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
CHECK_OBJ_NOTNULL
(
vfe
,
VFP_ENTRY_MAGIC
);
CHECK_OBJ_NOTNULL
(
vfe
,
VFP_ENTRY_MAGIC
);
CAST_OBJ_NOTNULL
(
bh
,
vfe
->
priv1
,
BODYHASH_MAGIC
);
CAST_OBJ_NOTNULL
(
bh
,
vfe
->
priv1
,
BODYHASH_MAGIC
);
SHA256_Update
(
&
bh
->
sha256ctx
,
p
,
*
lp
);
V
SHA256_Update
(
&
bh
->
sha256ctx
,
p
,
*
lp
);
return
(
vp
);
return
(
vp
);
}
}
...
@@ -82,7 +82,7 @@ static void __match_proto__(vfp_fini_f)
...
@@ -82,7 +82,7 @@ static void __match_proto__(vfp_fini_f)
vfp_bodyhash_fini
(
struct
vfp_ctx
*
vc
,
struct
vfp_entry
*
vfe
)
vfp_bodyhash_fini
(
struct
vfp_ctx
*
vc
,
struct
vfp_entry
*
vfe
)
{
{
struct
bodyhash
*
bh
;
struct
bodyhash
*
bh
;
unsigned
char
sha
[
SHA256_LEN
];
unsigned
char
sha
[
V
SHA256_LEN
];
char
*
etag
,
*
p
;
char
*
etag
,
*
p
;
int
i
;
int
i
;
ssize_t
l
;
ssize_t
l
;
...
@@ -123,12 +123,12 @@ vfp_bodyhash_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
...
@@ -123,12 +123,12 @@ vfp_bodyhash_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
goto
out
;
goto
out
;
}
}
SHA256_Final
(
sha
,
&
bh
->
sha256ctx
);
V
SHA256_Final
(
sha
,
&
bh
->
sha256ctx
);
assert
(
*
etag
==
'"'
);
assert
(
*
etag
==
'"'
);
p
=
etag
;
p
=
etag
;
p
++
;
p
++
;
for
(
i
=
0
;
i
<
SHA256_LEN
;
i
++
)
{
for
(
i
=
0
;
i
<
V
SHA256_LEN
;
i
++
)
{
*
p
++
=
hexe
[(
sha
[
i
]
&
0xf0
)
>>
4
];
*
p
++
=
hexe
[(
sha
[
i
]
&
0xf0
)
>>
4
];
*
p
++
=
hexe
[
sha
[
i
]
&
0x0f
];
*
p
++
=
hexe
[
sha
[
i
]
&
0x0f
];
}
}
...
...
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