Commit graph

37356 commits

Author SHA1 Message Date
Thitat Auareesuksakul f4b8bae65f AK: Add Kernel namespace to KStrings in AK::IPv6Address
Currently there is no AK::IPv6Address in the kernel. But when there is,
KStrings won't resolve properly because they are in Kernel namespace.
2022-04-17 16:57:52 -07:00
Lady Gegga 3c00c1cfad Base: Add some Mathematical Alphanumeric Symbols to Katica Regular 10
1D5D4-1D607 https://www.unicode.org/charts/PDF/U1D400.pdf
2022-04-17 23:25:56 +01:00
djwisdom 5e046a1db9 Base: Update AtaraxiaLight8 add glyphs to widen coverage
Miscellaneous Symbols
2600-261F,2621,2640-2645,2647-2653,268A-2693,26A5,26A6,26A8-26Af
https://www.unicode.org/charts/PDF/U2600.pdf
2022-04-17 23:25:48 +01:00
Linus Groh 472ff7a6d4 LibJS: Don't coerce this value in %IteratorPrototype%[@@iterator]
Another day, another mistake that's been there for a long time but
would've been immediately obvious when adding spec comments. :^)
2022-04-18 00:24:02 +02:00
Linus Groh ee1379520a LibJS: Add missing whitespace around namespace curly braces 2022-04-17 23:00:35 +02:00
Lady Gegga f5fc921d84 Base: Add 125 new Bamum Supplement glyphs to font Katica Regular 10
16803, 1681D, 1682F, 16830, 16834, 16835, 16836, 16837, 16839, 1683E,
1683F, 16841, 16842, 16853, 16859, 16861, 16862, 16886, 16887, 16888,
16889, 168AE, 168C0, 168C3, 168C4, 168C7, 168C9, 168CE, 168D3, 168DF,
168E3, 168EF, 16926, 16927, 1692E, 16933, 16937, 16938, 1693A, 1693B,
1693D, 16940, 16941, 16960, 16963, 16964, 16967, 16969, 1696C, 1696D,
1696E, 1696F, 16973, 16974, 16975, 16979, 1697A, 1697B, 1697D, 1697F,
16987, 1698F, 16990, 16991, 16993, 16995, 16997, 16999, 1699B, 1699D,
169AA, 169AD, 169AE, 169B0, 169B2, 169B4, 169B5, 169B7, 169B8, 169C8,
169C9, 169CB, 169D0, 169D1, 169D6, 169DE, 169E1, 169E4, 169E5, 169E6,
169E7, 169EF, 169F1, 169F3, 169F5, 169F7, 169F8, 169F9, 169FE, 16A06,
16A07, 16A09, 16A0E, 16A0F, 16A10, 16A11, 16A12, 16A13, 16A14, 16A15,
16A16, 16A1A, 16A1F, 16A20, 16A21, 16A23, 16A26, 16A27, 16A2B, 16A2C,
16A2D, 16A33, 16A36, 16A37, 16A38
https://www.unicode.org/charts/PDF/U16800.pdf
2022-04-17 20:58:32 +01:00
djwisdom f5a87bfff7 Base: Update CsillaRegular12 add glyphs for wider coverage
Lisu Supplement
11FB0

Idiographic Symbols and Punctuation
16FF1-16FE4,16FF0,16FF1

Control Pictures
2400-2426

Supplemental Arrows-A
27F0-27FF
2022-04-17 20:48:53 +01:00
djwisdom c35a456651 Base: Update CsillaBold12 add glyphs for wider coverage
Lisu Supplement
11FB0

Idiographic Symbols and Punctuation
16FF1-16FE4,16FF0,16FF1

Control Pictures
2400-2426

Supplemental Arrows-A
27F0-27FF
2022-04-17 20:48:53 +01:00
djwisdom b673aeca74 Base: Update SatoriMonoRegular add glyphs to widen coverage
SatoriMonoRegular
Supplemental Arrows-A
27F0-27FF
2022-04-17 20:48:39 +01:00
djwisdom 30cc4a969a Base: Update SatoriMonoBold add glyphs to widen coverage
SatoriMonoBold
Supplemental Arrows-A
27F0-27FF
2022-04-17 20:48:39 +01:00
djwisdom 0502583a05 Base: Update SatoriRegular add glyphs to widen coverage
SatoriRegular
Supplemental Arrows-A
27F0-27FF
2022-04-17 20:48:39 +01:00
djwisdom 8c5289fe94 Base: Update SatoriBold add glyphs to widen coverage
SatoriBold
Supplemental Arrows-A
27F0-27FF
2022-04-17 20:48:39 +01:00
djwisdom 3ddd8f0d68 Base: Update Coffee Theme enable window-close-modified icon
Aim for consistent user-experience across all themes
2022-04-17 10:56:01 -07:00
Tim Schumacher 8c278bba43 Meta: Keep timestamps of manually copied toolchain output 2022-04-17 10:53:31 -07:00
stelar7 196dada7e2 LibWeb: Dont abort when parsing data- properties that contain dashes 2022-04-17 20:08:27 +03:00
Thitat Auareesuksakul c949a4db2d DHCPClient: Send ParameterRequestList option with DHCPRequest packet
We'll need SubnetMask and Router options to be returned with the ACK
packet. So, it's a good idea to request them explicitly in this packet.
2022-04-17 10:25:01 +04:30
Thitat Auareesuksakul 01a602cb51 DHCPClient: Send ServerIdentifier option with DHCPRequest packet
Some DHCP servers (including Mikrotik ones) will NAK the request if the
ServerIdentifier option is not sent with the DHCPRequest packet.
2022-04-17 10:25:01 +04:30
Michiel Visser fa18c283dc LibTLS: Cleanup of verify_chain and verify_certificate_pair 2022-04-17 10:10:19 +04:30
Michiel Visser be654dad8a LibCrypto: Certificate parse IP address SAN
Subject alternative name entries containing IP addresses will now be
parsed and added to the list of SANs. This should allow for certificate
verification when accessing IP addresses directly.
2022-04-17 10:10:19 +04:30
Michiel Visser 7bc3b193c0 LibTLS: Add option to allow self-signed certificates
With this option enabled self-signed certificates will be accepted,
eventhough they cannot be verified.
2022-04-17 10:10:19 +04:30
Michiel Visser 804af863b4 LibCrypto+LibTLS: Implement Key Usage and Basic Constraints extensions
Root and intermediate CA certificates should have these extensions set
to indicate that they are allowed to sign other certificates. The values
reported in these extensions is now also checked by `verify_chain` to
make sure no non-CA certificates are used to sign another certificate.

The certificate parser now also aborts when a critical extension is
detected which is unsupported, as is required by the specification.
2022-04-17 10:10:19 +04:30
Michiel Visser a6e465fba2 LibCrypto: Implement custom BitStringView for ASN.1 decoder
The ASN.1 decoder was originally using AK::BitmapView for decoded
BitStrings, however the specification requires that the bits are stored
in a byte from the most significant to the least significant.

Storing three bits '110' would result in a byte '1100 0000', i.e. 0xC0.
However, AK::BitmapView expects the bits to be stored at the bottom like
'0000 0110', i.e. 0x06. For the current uses the data was always a
multiple of eight bits, resulting in complete bytes, which could
directly be interpreted correctly.

For the implementation of the key usage extension of certificates the
correct implementation of the BitString is required.
2022-04-17 10:10:19 +04:30
Michiel Visser b16b61f6bc LibCrypto: Fix inverted boolean decoded error in ASN.1
ASN.1 encodes booleans as false is zero and true is non-zero. The
decoder currently returned true when the boolean was zero.

Since this decoder was barely used it did not cause any problems,
however for support of other certificate extensions the correct version
is required.
2022-04-17 10:10:19 +04:30
Michiel Visser 5a60bed88b LibTLS: Fix TestTLSHandshake by correctly reading the CA certificates 2022-04-17 10:10:19 +04:30
Michiel Visser 976bb715e0 LibTLS: Correct matching hostname with certificate subject
The wildcard specified in a certificates subject can only match a single
level of subdomains. Originally, this function could match multiple
levels of subdomains with a single "*.".

As an example, https://wrong.host.badssl.com/ should fail to load, as
the certificate provided by the server only specifies "*.badssl.com".
However this was correctly matching anyway. With this change this page
now correctly fails to load.
2022-04-17 10:10:19 +04:30
Michiel Visser 331092d25a LibTLS: Add references to RFC5246 for the verify procedure 2022-04-17 10:10:19 +04:30
Michiel Visser d78813d902 LibTLS: Simplify the way verify_chain is called
The `build_rsa_pre_master_secret` function originally called
`verify_chain_and_get_matching_certificate`, which verified the chain
and returned a certificate matching the specified hostname.

Since the first certificate in the chain should always be the one
matching with the hostname, we can simply use that one instead. This
means we can completely remove this method and just use `verify_chain`.

To make sure the hostname is still verified, `verify_chain` now also
checks that the first certificate in the chain matches the specified
hostname. If the hostname is empty, we currently fail the verification,
however this basically never happen, as the server name indication
extension is always used.
2022-04-17 10:10:19 +04:30
Michiel Visser f8ce0eb648 LibTLS: ASN1 parse_utc_time handle pre 2000 years
In this format the year is specified using two digits. In the case that
these digits are 50 or more, we should assume that the year is in
1950-1999. If it is 49 or less, the year is 2000-2049.

This is specified in RFC5280 section 4.1.2.5.1.
2022-04-17 10:10:19 +04:30
Michiel Visser fea5aeda0b LibTLS: Verify the certificate chain sent by the server
With this change the certificate chain sent by the server will actually
be verified, instead of just checking the names of the certificates.

To determine if a certificate is signed by a root certificate, the list
of root certificates is now a HashMap mapping from the unique identifier
string to the certificate. This allows us to take the issuer of a
certificate and easily check if it is a root certificate. If a
certificate is not signed by a root certificate, we will check that it
is signed by the next certificate in the chain.

This also removes the ad-hoc checking of certificate validity from
multiple places, and moves all checking to the verify_chain.
2022-04-17 10:10:19 +04:30
Michiel Visser d5cef41bb6 LibTLS: Parse Certificate signature algorithm and value
This part of the certificate was originally just skipped, however it
will be needed to check the validity of the certificate.
2022-04-17 10:10:19 +04:30
Michiel Visser 2b416e5faa Base+LibTLS: Update CA Certificates list with actual certificates
The CA certificates list now contains the actual certificate data for
approximatly a hundred certificate authorities. These certificates were
generated from https://mkcert.org, which uses the Mozilla CA certificate
list.

This also updates the code for reading the CA certificates.
2022-04-17 10:10:19 +04:30
Michiel Visser 707b222913 LibTLS: Add certificate chain validation to DHE and ECDHE key exchange
The RSA key exchange was the only one actually verifying the validity of
the certificate chain supplied by the server. Now the DHE and ECDHE key
exchanges also check the certificate chain.
2022-04-17 10:10:19 +04:30
Itamar f4cca20972 LibCpp: Parse inheritance 2022-04-17 10:09:23 +04:30
Jelle Raaijmakers 8cfabbcd93 Tests: Implement reference image testing for LibGL
Each LibGL test can now be tested against a reference QOI image.
Initially, these images can be generated by setting `SAVE_OUTPUT` to
`true`, which will save a bunch of QOI images to `/home/anon`.
2022-04-17 09:58:29 +04:30
Jelle Raaijmakers 757f506fda LibGL: Implement GLContext::frontbuffer() 2022-04-17 09:58:29 +04:30
Jelle Raaijmakers dad829de50 LibGfx: Add Bitmap::visually_equals() 2022-04-17 09:58:29 +04:30
brapru 8b370f988b host: Use AK/IPv4Address to determine if argument is host/ip
It's a bit cleaner to just rely on AK/IPv4Address' ability to determine
the validity of the given input. If a valid IP address is not returned,
then input will be processed as a hostname.
2022-04-16 22:16:29 -07:00
Brian Gianforcaro 9191829a39 LibGfx: Fix bounds overflow in JPGLoader
Taotao Gu has been fuzzing serenity libs with their own custom fuzzer.
They reported some issues it found privately, this overflow was found
in the JPGLoader using that fuzzer.

Reported-by: Taotao Gu <gutaotao1995@qq.com>
2022-04-17 09:39:48 +04:30
djwisdom 4ea910d129 Base: Update CsillaRegular12 add Miscellaneous Symbols
CsillaRegular12
Miscellaneous Symbols
2600-261F,2621,2640-2645,2647-2653,
268A-2693,26A5,26A6,26A8-26AF
2022-04-16 23:50:53 +01:00
djwisdom 38928ca2e4 Base: Update CsillaBold12 add Miscellaneous Symbols
CsillaBold12
Miscellaneous Symbols
2600-261F,2621,2640-2645,2647-2653,
268A-2693,26A5,26A6,26A8-26AF
2022-04-16 23:50:53 +01:00
Sam Atkins fe5fdb200b LibCore+LibIPC: Make Core::Stream read_without_waiting() return Bytes
For the reasoning, see the earlier commit about Core::Stream::read().
2022-04-16 13:27:51 -04:00
Sam Atkins d564cf1e89 LibCore+Everywhere: Make Core::Stream read_line() return StringView
Similar reasoning to making Core::Stream::read() return Bytes, except
that every user of read_line() creates a StringView from the result, so
let's just return one right away.
2022-04-16 13:27:51 -04:00
Sam Atkins c4134e9794 LibCore+Everywhere: Make Core::Stream read_until() return Bytes
This affects BufferedSeekable::read_until() and ::read_until_any_of().
For the reasoning, see the previous commit about Core::Stream::read().
2022-04-16 13:27:51 -04:00
Sam Atkins 3b1e063d30 LibCore+Everywhere: Make Core::Stream::read() return Bytes
A mistake I've repeatedly made is along these lines:
```c++
auto nread = TRY(source_file->read(buffer));
TRY(destination_file->write(buffer));
```

It's a little clunky to have to create a Bytes or StringView from the
buffer's data pointer and the nread, and easy to forget and just use
the buffer. So, this patch changes the read() function to return a
Bytes of the data that were just read.

The other read_foo() methods will be modified in the same way in
subsequent commits.

Fixes #13687
2022-04-16 13:27:51 -04:00
Timothy Flynn 6654efcd82 LibJS: Remove cloneConstructor parameter from CloneArrayBuffer
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/e7979fd

Note that this implements a FIXME in InitializeTypedArrayFromTypedArray,
now that shared array buffers are no longer a concern there. We already
have test coverage for the now-handled case.
2022-04-16 16:49:52 +01:00
Timothy Flynn 39b308ba52 LibJS: Factor out TypedArrayElement{Size,Type} abstract operations
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/a90670d5

This also adds missing spec comments to the following prototypes which
were affected by this change:
    Atomics.load
    Atomics.store
    %TypedArray%.prototype.slice
    %TypedArray%.prototype.subarray
2022-04-16 16:49:52 +01:00
Timothy Flynn 0174993bea LibJS: Add explicit ErrorType values for TypedArray prototype exceptions 2022-04-16 16:49:52 +01:00
Timothy Flynn c20e8cea19 LibJS: Define AllocateTypedArrayBuffer AO out of line
Not only is it easier to compare to the spec when defined out of line,
but this AO was implemented inside other AOs twice.
2022-04-16 16:49:52 +01:00
Timothy Flynn c076b363ce LibJS: Define SetTypedArrayFrom{TypedArray,ArrayLike} AOs out of line
%TypedArray%.prototype.set was a bit hard to read / compare to the spec
with these AOs defined inside it.
2022-04-16 16:49:52 +01:00
Maciej 1c80b377b2 Base: Add various Miscellaneous Symbols and Pictograms glyphs
1f5c0,1f5c1,1f5cb,1f5cc,1f5cd,1f5ce,1f5cf,1f5e4,1f5e5,1f5e6,1f5e7,
1f5f6,1f5f7
2022-04-15 22:01:31 +01:00