summaryrefslogtreecommitdiff
path: root/Tests/LibTLS
AgeCommit message (Collapse)Author
2022-12-12LibCore: Propagate errors from `Stream::*_entire_buffer`Tim Schumacher
2022-12-12LibCore: Rename `Stream::*_or_error` to `*_entire_buffer`Tim Schumacher
All of our functions are `_or_error` (or are about to be), and maybe making it less reminiscient of AK::Stream will make people use it more.
2022-12-08LibCore: Move `Core::Stream::File::exists()` to `Core::File`Tim Schumacher
`Core::Stream::File` shouldn't hold any utility methods that are unrelated to constructing a `Core::Stream`, so let's just replace the existing `Core::File::exists` with the nicer looking implementation.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-04-17LibTLS: Fix TestTLSHandshake by correctly reading the CA certificatesMichiel Visser
2022-04-16LibCore+Everywhere: Make Core::Stream::read() return BytesSam Atkins
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-01Everywhere: Run clang-formatIdan Horowitz
2022-02-16LibCore+Everywhere: Return ErrorOr from ConfigFile factory methodsSam Atkins
I've attempted to handle the errors gracefully where it was clear how to do so, and simple, but a lot of this was just adding `release_value_but_fixme_should_propagate_errors()` in places.
2022-02-06Userland: Convert TLS::TLSv12 to a Core::Stream::SocketAli Mohammad Pur
This commit converts TLS::TLSv12 to a Core::Stream object, and in the process allows TLS to now wrap other Core::Stream::Socket objects. As a large part of LibHTTP and LibGemini depend on LibTLS's interface, this also converts those to support Core::Stream, which leads to a simplification of LibHTTP (as there's no need to care about the underlying socket type anymore). Note that RequestServer now controls the TLS socket options, which is a better place anyway, as RS is the first receiver of the user-requested options (though this is currently not particularly useful).
2021-11-10AK: Make ByteBuffer::try_* functions return ErrorOr<void>Andreas Kling
Same as Vector, ByteBuffer now also signals allocation failure by returning an ENOMEM Error instead of a bool, allowing us to use the TRY() and MUST() patterns.
2021-09-19LibTLS: Use a setter for on_tls_ready_to_write with some more smartsAli Mohammad Pur
The callback should be called as soon as the connection is established, and if we actually set the callback when it already is, we expect it to be called immediately.
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-06Everywhere: Use OOM-safe ByteBuffer APIs where possibleAli Mohammad Pur
If we can easily communicate failure, let's avoid asserting and report failure instead.
2021-09-02Tests: Remove all file(GLOB) from CMakeLists in TestsAndrew Kaster
Using a file(GLOB) to find all the test files in a directory is an easy hack to get things started, but has some drawbacks. Namely, if you add a test, it won't be found again without re-running CMake. `ninja` seems to do this automatically, but it would be nice to one day stop seeing it rechecking our globbed directories.
2021-08-06Tests: Remove unused variables for clang buildLenny Maiorani
Problem: - Clang will not build `Tests/LibTLS` due to unused variables. Solution: - Remove the unused variables.
2021-06-19LibCrypto+LibTLS: Split and move test suite into Tests directoryPeter Bocan
This change splits test-crypto.cpp from Userland into separate test suites located in Tests/ directory.