1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 02:55:07 +00:00
Commit graph

15 commits

Author SHA1 Message Date
Shannon Booth
5dc5b8a2b6 LibCore: Rename Udp classes to UDP
The kernel was already using the UDP prefix, and the TCP LibCore classes
are also uppercased. Let's rename for consistency.

Also order the LibCore Makefile alphabetically, because everywhere else
seems to be doing that :)
2020-03-14 23:56:12 +01:00
Andreas Kling
8bb361889c AK: Remove Optional::operator bool()
This was causing some obvious-in-hindsight but hard to spot bugs where
we'd implicitly convert the bool to an integer type and carry on with
the number 1 instead of the actual value().
2020-03-06 10:32:58 +01:00
Andreas Kling
d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Andreas Kling
2d39da5405 LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
2020-02-02 15:15:30 +01:00
Andreas Kling
d1721c761e LookupServer: Don't cache already-expired DNS answers 2020-01-26 16:25:12 +01:00
Andreas Kling
5e47508672 LookupServer: Cache DNS answers for TTL seconds
We now keep DNS answers around in a cache for TTL seconds after getting
them the first time. The cache is capped at 256 responses for now.

Suggested by @zecke in #10.
2020-01-26 15:44:51 +01:00
Andreas Kling
90a5907b44 LookupServer: Rename "custom_hosts" => "etc_hosts"
This makes it more obvious that these mappings come from /etc/hosts.
2020-01-26 15:44:51 +01:00
Andreas Kling
c26560ec26 LookupServer: Rename setting "DNS/IPAddress" => "DNS/Nameserver" 2020-01-26 15:44:51 +01:00
Andreas Kling
e335d730d6 LookupServer: Use CUdpSocket instead of the POSIX API
LibCore's UDP socket is a bit more comfortable to work with. :^)
2020-01-26 14:47:03 +01:00
Andreas Kling
a9ec2225a5 LookupServer: Retry with 0x20 randomization turned off on EREFUSED
Apparently some authoritative servers don't handle 0x20 randomization
well and may send EREFUSED. Retry with randomization turned off then.

Reference: https://github.com/dns-violations/dns-violations/blob/master/2017/DVE-2017-0006.md

More work towards #10.
2020-01-26 13:49:46 +01:00
Andreas Kling
00be9b33b1 LookupServer: Verify that DNS response questions match the request
To protect against DNS spoof attacks, we now check that the questions
in incoming responses match the questions in the request we sent out.

Suggested by @zecke in #10.
2020-01-26 13:07:43 +01:00
Andreas Kling
871b6b4e1a LookupServer: Minor overhaul
- Break out request building into a DNSRequest class.
- Break out response parsing into a DNSResponse class.

A DNSRequest contains one or more DNSQuestion objects.
A DNSResponse contains all the DNSQuestions asked, and a DNSAnswer
object for each answer.
2020-01-26 12:37:08 +01:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
Sergey Bugaev
ab98969403 LookupServer: Port to socket takeover 2019-11-26 19:58:25 +01:00
Sergey Bugaev
821ed8367b LookupServer: Port to LibCore 2019-11-26 19:58:25 +01:00