Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
332c520c
Commit
332c520c
authored
Jun 06, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move CLI_AUTH_RESPONSE_LEN define to cli.h, exclude terminating NUL.
parent
a39be7ab
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
varnishadm.c
bin/varnishadm/varnishadm.c
+1
-1
mgt_cli.c
bin/varnishd/mgt_cli.c
+1
-1
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+1
-1
cli.h
include/cli.h
+2
-0
cli_common.h
include/cli_common.h
+1
-3
cli_auth.c
lib/libvarnish/cli_auth.c
+2
-2
No files found.
bin/varnishadm/varnishadm.c
View file @
332c520c
...
...
@@ -88,7 +88,7 @@ cli_sock(const char *T_arg, const char *S_arg)
int
sock
;
unsigned
status
;
char
*
answer
=
NULL
;
char
buf
[
CLI_AUTH_RESPONSE_LEN
];
char
buf
[
CLI_AUTH_RESPONSE_LEN
+
1
];
sock
=
VSS_open
(
T_arg
,
timeout
);
if
(
sock
<
0
)
{
...
...
bin/varnishd/mgt_cli.c
View file @
332c520c
...
...
@@ -275,7 +275,7 @@ static void
mcf_auth
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
{
int
fd
;
char
buf
[
CLI_AUTH_RESPONSE_LEN
];
char
buf
[
CLI_AUTH_RESPONSE_LEN
+
1
];
AN
(
av
[
2
]);
(
void
)
priv
;
...
...
bin/varnishtest/vtc_varnish.c
View file @
332c520c
...
...
@@ -339,7 +339,7 @@ varnish_launch(struct varnish *v)
nfd
=
open
(
abuf
,
O_RDONLY
);
assert
(
nfd
>=
0
);
assert
(
sizeof
abuf
>=
CLI_AUTH_RESPONSE_LEN
+
6
);
assert
(
sizeof
abuf
>=
CLI_AUTH_RESPONSE_LEN
+
7
);
strcpy
(
abuf
,
"auth "
);
VCLI_AuthResponse
(
nfd
,
r
,
abuf
+
5
);
AZ
(
close
(
nfd
));
...
...
include/cli.h
View file @
332c520c
...
...
@@ -206,3 +206,5 @@ enum VCLI_status_e {
/* Length of first line of response */
#define CLI_LINE0_LEN 13
#define CLI_AUTH_RESPONSE_LEN 64
/* 64 hex + NUL */
include/cli_common.h
View file @
332c520c
...
...
@@ -47,7 +47,5 @@ struct cli {
int
VCLI_WriteResult
(
int
fd
,
const
struct
cli
*
cli
);
int
VCLI_ReadResult
(
int
fd
,
unsigned
*
status
,
char
**
ptr
,
double
tmo
);
#define CLI_AUTH_RESPONSE_LEN 65
/* 64 hex + NUL */
void
VCLI_AuthResponse
(
int
S_fd
,
const
char
*
challenge
,
char
reponse
[
CLI_AUTH_RESPONSE_LEN
]);
char
reponse
[
CLI_AUTH_RESPONSE_LEN
+
1
]);
lib/libvarnish/cli_auth.c
View file @
332c520c
...
...
@@ -40,13 +40,13 @@
void
VCLI_AuthResponse
(
int
S_fd
,
const
char
*
challenge
,
char
response
[
CLI_AUTH_RESPONSE_LEN
])
char
response
[
CLI_AUTH_RESPONSE_LEN
+
1
])
{
SHA256_CTX
ctx
;
uint8_t
buf
[
BUFSIZ
];
int
i
;
assert
(
CLI_AUTH_RESPONSE_LEN
==
(
SHA256_LEN
*
2
+
1
));
assert
(
CLI_AUTH_RESPONSE_LEN
==
(
SHA256_LEN
*
2
));
SHA256_Init
(
&
ctx
);
SHA256_Update
(
&
ctx
,
challenge
,
32
);
...
...
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