Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Charles
Nebulo
Commits
9a5b16f2
Commit
9a5b16f2
authored
Nov 30, 2019
by
Daniel Wolf
Browse files
Ignore CNAME cloaking when the initial question is whitelisted anyways
parent
d80e58fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/util/proxy/DnsRuleResolver.kt
View file @
9a5b16f2
...
...
@@ -240,7 +240,10 @@ class DnsRuleResolver(context: Context) : LocalResolver(false) {
// Handle CNAME Cloaking
// Does not need to handle whitelist as the query has already been forwarded
override
suspend
fun
mapResponse
(
message
:
DnsMessage
):
DnsMessage
{
if
(
ruleCount
==
0
||
(
ruleCount
!=
null
&&
ruleCount
==
whitelistCount
))
return
message
// No rules or only whitelist rules present
if
(
ruleCount
==
0
||
(
ruleCount
!=
null
&&
ruleCount
==
whitelistCount
)
||
message
.
questions
.
size
==
0
)
return
message
// No rules or only whitelist rules present
else
if
(
whitelistCount
!=
0
&&
hashHost
(
message
.
question
.
name
.
toString
().
replace
(
wwwRegex
,
""
).
toLowerCase
(
Locale
.
ROOT
),
message
.
question
.
type
).
let
{
cachedWildcardWhitelisted
.
contains
(
it
)
||
cachedNonWildcardWhitelisted
.
contains
(
it
)
})
return
message
else
if
(!
message
.
answerSection
.
any
{
it
.
type
==
Record
.
TYPE
.
CNAME
})
return
message
...
...
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