Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
c8167234
Commit
c8167234
authored
Feb 16, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shrpx: Fix bug in certificate lookup
parent
1b2315d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+2
-0
src/shrpx_ssl_test.cc
src/shrpx_ssl_test.cc
+18
-0
No files found.
src/shrpx_ssl.cc
View file @
c8167234
...
@@ -600,6 +600,8 @@ void cert_lookup_tree_add_cert(CertLookupTree *lt, CertNode *node,
...
@@ -600,6 +600,8 @@ void cert_lookup_tree_add_cert(CertLookupTree *lt, CertNode *node,
new_node
->
first
=
i
;
new_node
->
first
=
i
;
new_node
->
last
=
cn
->
last
;
new_node
->
last
=
cn
->
last
;
new_node
->
wildcard_certs
.
swap
(
cn
->
wildcard_certs
);
new_node
->
wildcard_certs
.
swap
(
cn
->
wildcard_certs
);
new_node
->
next
.
swap
(
cn
->
next
);
cn
->
next
.
push_back
(
new_node
);
cn
->
next
.
push_back
(
new_node
);
cn
->
last
=
i
;
cn
->
last
=
i
;
...
...
src/shrpx_ssl_test.cc
View file @
c8167234
...
@@ -94,6 +94,24 @@ void test_shrpx_ssl_create_lookup_tree(void)
...
@@ -94,6 +94,24 @@ void test_shrpx_ssl_create_lookup_tree(void)
for
(
int
i
=
0
;
i
<
num
;
++
i
)
{
for
(
int
i
=
0
;
i
<
num
;
++
i
)
{
SSL_CTX_free
(
ctxs
[
i
]);
SSL_CTX_free
(
ctxs
[
i
]);
}
}
SSL_CTX
*
ctxs2
[]
=
{
SSL_CTX_new
(
TLSv1_method
()),
SSL_CTX_new
(
TLSv1_method
()),
SSL_CTX_new
(
TLSv1_method
())};
const
char
*
names
[]
=
{
"rab"
,
"zab"
,
"zzub"
};
num
=
sizeof
(
ctxs2
)
/
sizeof
(
ctxs2
[
0
]);
tree
=
ssl
::
cert_lookup_tree_new
();
for
(
int
i
=
0
;
i
<
num
;
++
i
)
{
ssl
::
cert_lookup_tree_add_cert
(
tree
,
ctxs2
[
i
],
names
[
i
],
strlen
(
names
[
i
]));
}
for
(
int
i
=
0
;
i
<
num
;
++
i
)
{
CU_ASSERT
(
ctxs2
[
i
]
==
ssl
::
cert_lookup_tree_lookup
(
tree
,
names
[
i
],
strlen
(
names
[
i
])));
}
ssl
::
cert_lookup_tree_del
(
tree
);
for
(
int
i
=
0
;
i
<
num
;
++
i
)
{
SSL_CTX_free
(
ctxs2
[
i
]);
}
}
}
void
test_shrpx_ssl_cert_lookup_tree_add_cert_from_file
(
void
)
void
test_shrpx_ssl_cert_lookup_tree_add_cert_from_file
(
void
)
...
...
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