Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
PublicAndroidApps
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
Pipeline
#5952
passed with stage
in 3 minutes and 4 seconds
Changes
1
Pipelines
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
.
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