Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
Metrics
Library
Commits
ca37fd61
Commit
ca37fd61
authored
Nov 20, 2019
by
Karsten Loesing
Browse files
Properly parse hostname in v2 network status.
parent
9c7e1b9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
ca37fd61
...
...
@@ -3,6 +3,8 @@
*
Minor changes
-
Fix a NullPointerException when parsing an invalid crypto block
starting with "-----END " rather than "-----BEGIN ".
-
Properly parse an authority's hostname from the "dir-source" line
in a v2 network status.
# Changes in version 2.9.1 - 2019-11-09
...
...
src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java
View file @
ca37fd61
...
...
@@ -181,6 +181,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
throw
new
DescriptorParseException
(
"Illegal hostname in '"
+
line
+
"'."
);
}
this
.
hostname
=
parts
[
1
];
this
.
address
=
ParseHelper
.
parseIpv4Address
(
line
,
parts
[
2
]);
this
.
dirPort
=
ParseHelper
.
parsePort
(
line
,
parts
[
3
]);
}
...
...
src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusImplTest.java
View file @
ca37fd61
...
...
@@ -60,6 +60,7 @@ public class RelayNetworkStatusImplTest {
new
int
[]
{
0
,
statusBytes
.
length
},
null
);
assertEquals
(
rnsi
.
getContactLine
(),
"1024R/8D56913D Alex de Joode <adejoode@sabotage.org>"
);
assertEquals
(
"194.109.206.212"
,
rnsi
.
getHostname
());
}
}
Write
Preview
Supports
Markdown
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