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
aad86975
Commit
aad86975
authored
Mar 30, 2020
by
Jacky Tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix get_x509_serial for long serial numbers
parent
b3f85e2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
13 deletions
+1
-13
src/shrpx_tls.cc
src/shrpx_tls.cc
+1
-13
No files found.
src/shrpx_tls.cc
View file @
aad86975
...
@@ -2030,17 +2030,6 @@ StringRef get_x509_issuer_name(BlockAllocator &balloc, X509 *x) {
...
@@ -2030,17 +2030,6 @@ StringRef get_x509_issuer_name(BlockAllocator &balloc, X509 *x) {
#endif
/* !WORDS_BIGENDIAN */
#endif
/* !WORDS_BIGENDIAN */
StringRef
get_x509_serial
(
BlockAllocator
&
balloc
,
X509
*
x
)
{
StringRef
get_x509_serial
(
BlockAllocator
&
balloc
,
X509
*
x
)
{
#if OPENSSL_1_1_API && !defined(OPENSSL_IS_BORINGSSL)
auto
sn
=
X509_get0_serialNumber
(
x
);
uint64_t
r
;
if
(
ASN1_INTEGER_get_uint64
(
&
r
,
sn
)
!=
1
)
{
return
StringRef
{};
}
r
=
bswap64
(
r
);
return
util
::
format_hex
(
balloc
,
StringRef
{
reinterpret_cast
<
uint8_t
*>
(
&
r
),
sizeof
(
r
)});
#else // !OPENSSL_1_1_API || OPENSSL_IS_BORINGSSL
auto
sn
=
X509_get_serialNumber
(
x
);
auto
sn
=
X509_get_serialNumber
(
x
);
auto
bn
=
BN_new
();
auto
bn
=
BN_new
();
auto
bn_d
=
defer
(
BN_free
,
bn
);
auto
bn_d
=
defer
(
BN_free
,
bn
);
...
@@ -2052,8 +2041,7 @@ StringRef get_x509_serial(BlockAllocator &balloc, X509 *x) {
...
@@ -2052,8 +2041,7 @@ StringRef get_x509_serial(BlockAllocator &balloc, X509 *x) {
auto
n
=
BN_bn2bin
(
bn
,
b
.
data
());
auto
n
=
BN_bn2bin
(
bn
,
b
.
data
());
assert
(
n
<=
20
);
assert
(
n
<=
20
);
return
util
::
format_hex
(
balloc
,
StringRef
{
std
::
begin
(
b
),
std
::
end
(
b
)});
return
util
::
format_hex
(
balloc
,
StringRef
{
b
.
data
(),
n
});
#endif // !OPENSSL_1_1_API
}
}
namespace
{
namespace
{
...
...
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