Commit Graph

11696 Commits

Author SHA1 Message Date
Ben Wiederhake
a296020e03 LibCrypto: Implement and test CTR decryption 2020-07-28 19:10:10 +02:00
Ben Wiederhake
a51cbc2978 LibCrypto: Fix broken CTR mode, implement RFC 3686 Test Vectors 2020-07-28 19:10:10 +02:00
Ben Wiederhake
ef4ce54b02 LibCrypto: Document CTR weirdness in depth 2020-07-28 19:10:10 +02:00
Ben Wiederhake
708164b0b9 LibCrypto: Already using strong crypto
ModularFunctions::random_number calls into AK::fill_with_random calls (on
Serenity) into arc4random_buf calls into Process::sys calls into
get_good_random_bytes, which is cryptographically secure.
2020-07-28 19:10:10 +02:00
Ben Wiederhake
801058e514 LibJS: Soothe gcc about printf-%s on (non-)nullptr 2020-07-28 19:10:10 +02:00
Peter Elliott
fc425a218d Meta: Fix style of image building scripts
Oops. I didn't know there was a style guide for the scripts.
2020-07-28 19:09:44 +02:00
Andreas Kling
b5633c69d3 Base: Mount /etc as read/write
Let's be reasonable and have a writable /etc by default.
2020-07-28 19:07:01 +02:00
Andreas Kling
c46439f240 LibWeb: Move HTML classes into the Web::HTML namespace 2020-07-28 18:55:48 +02:00
Andreas Kling
ebd2e7d9f5 AK: Tweak String::is_one_of() and FlyString::is_one_of()
Switch the comparisons from "other == *this" to "*this == other".
2020-07-28 18:55:47 +02:00
Andreas Kling
8b55d3d86e LibWeb: Move MouseEvent into the UIEvents namespace
Named after the UIEvents specification that houses MouseEvent.
2020-07-28 18:55:47 +02:00
Nico Weber
c99a3efc5b LibX86: Disassemble most FPU instructions starting with D9
Some of these don't just use the REG bits of the mod/rm byte
as slashes, but also the R/M bits to have up to 9 different
instructions per opcode/slash combination (1 opcode requires
that MOD is != 11, the other 8 have MODE == 11).

This is done by making the slashes table two levels deep for
these cases.

Some of this is cosmetic (e.g "FST st0" has no effect already,
but its bit pattern gets disassembled as "FNOP"), but for
most uses it isn't.

FSTENV and FSTCW have an extraordinary 0x9b prefix. This is
not yet handled in this patch.
2020-07-28 18:55:29 +02:00
Peter Elliott
6f12ab3ced Meta: Calculate image size based on size of Build/Root and Base
This reduces the size of the default build, while allowing people to
install as many ports as they want, without having to manually specify
disk size.
2020-07-28 18:32:05 +02:00
Peter Elliott
99ddbb83e8 Userland: Make su require passwords 2020-07-28 17:07:22 +02:00
Peter Elliott
207fb054e5 Userland: Add passwd utility 2020-07-28 17:07:22 +02:00
Peter Elliott
1211a036ba LibCore: add get_password().
A serenity-style getpass that is thread-safe
2020-07-28 17:07:22 +02:00
Peter Elliott
3c1c5cc541 LibC: Add passwords to putpwent 2020-07-28 17:07:22 +02:00
Peter Elliott
e57a432118 AK: Make String::substring() return non-null for 0-length strings
This also makes String::split() give non-null strings when keep_empty is
true.
2020-07-28 17:07:22 +02:00
Peter Elliott
9dcbb263f1 LibCrypt: Add LibCrypt, crypt, and crypt_r 2020-07-28 17:07:22 +02:00
Ben Wiederhake
58dd9f2d2a SystemMenu: Add 'Themes' icon 2020-07-28 16:29:44 +02:00
Ben Wiederhake
a9d30a59d9 SystemMenu: Add icons for categories 2020-07-28 16:29:44 +02:00
Ben Wiederhake
404981a892 SystemMenu: Untangle app/category discovery and GUI building
I was a bit confused by the fact that a method named `build_system_menu()`
first enumerates a directory. Moving the app/category discovery to a dedicated
function that returns the GUI-relevant information makes this process a bit
less surprising.

As an added bonus, `g_app_category_menus` was actually only a temporary mapping,
and didn't need to be global. In theory, SystemMenu should use a handful fewer
of bytes now.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
e8ed7f829e SystemMenu: Add icon to 'Exit' menu item 2020-07-28 16:29:44 +02:00
Ben Wiederhake
70fe126d01 LibGUI: Enable icons for SubMenus
It doesn't make sense for a top-level menu to have an icon, however
we do not have dedicated classes to distinguish these.

Furthermore, the only other place to store an icon is MenuItem.
Storing it there would be highly confusing, as MenuItem-with-Action
then would have two icons: one in Action and one in MenuItem.
And because we need to be able to replace the icon during realization,
this would need to write-through to Action somehow.

That's why I went with Menu, not MenuItem.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
048f149f51 LibGUI: Refactor icon realization in Menu
This factors out icon realization into its own function, making it possible to
use the same code with other classes that have icon() and set_icon() methods.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
082b7d6b0c LibGUI: Set correct default value during menu destruction 2020-07-28 16:29:44 +02:00
thankyouverycool
8248c74d88 DevTools: Let Inspector use ProcessChooser and new icons.
Inspector now opens ProcessChooser when no PID is supplied.
2020-07-28 16:29:36 +02:00
thankyouverycool
6448f94372 DevTools+LibGUI: Make ProcessChooser a general Dialog in LibGUI
Moves ProcessChooser and RunningProcessesModel to LibGUI and
generalizes their construction for use by other apps. Updates
Profiler to reflect the change and use its new icons.
2020-07-28 16:29:36 +02:00
thankyouverycool
5cfbf88b4d Base: Add icons and af files for Profiler and Inspector 2020-07-28 16:29:36 +02:00
Linus Groh
090c031c1a Userland: Fix nc by not memset()'ing the input address char*
We were accidentally calling memset() on "addr" (the input char*), not
"dst_addr" (the target struct sockaddr_in), which was causing a simple
"nc localhost 8000" to crash.

Fixes #2908.
2020-07-28 13:19:22 +02:00
Andreas Kling
08c05fbbd1 LibC: Fix strtol() not setting endptr correctly for "0"
"0" was interpreted as a base-8 prefix, and the parse pointer was then
unconditionally advanced, causing us to consume zero characters.

This unbreaks the git port. :^)

(We should really have tests for LibC..)
2020-07-28 02:26:49 +02:00
Andreas Kling
b8d3dbcf2d UserspaceEmulator: Add syscalls: stat(), realpath(), gethostname()
This is enough to run /bin/ls :^)
2020-07-28 00:03:25 +02:00
Andreas Kling
9def88e08d UserspaceEmulator: Don't just return "EMULATED" in get_process_name()
Now that emulated processes have their real name (with a "(UE)" prefix)
we can actually let them know their name.
2020-07-28 00:03:25 +02:00
Andreas Kling
308d3b764f LibC: Move getpagesize() out-of-line
This being inline somehow broke the binutils autoconf scripts. It used
to work, so I suspect that some other change to LibC has caused those
autoconf scripts to go down a new path.

Regardless, this seems perfectly sensible.
2020-07-28 00:03:25 +02:00
Andreas Kling
2ac5c2278d UserspaceEmulator: Support ioctl(TIOCGWINSZ)
This is very commonly used by terminal programs, and easy to support.
2020-07-28 00:03:25 +02:00
Andreas Kling
33d2ecdd79 WebServer: Show icons in directory listings :^)
Just adding some basic folder/file icon makes a big difference here.
2020-07-27 22:39:01 +02:00
Andreas Kling
96dce6893f Lagom: Build with -std=c++2a -Wno-deprecated-copy 2020-07-27 21:54:22 +02:00
Nico Weber
815a660aed .gitignore: Add .swo
Makes `git status` less noisy for vim users.
2020-07-27 21:53:46 +02:00
asynts
ed327e7feb LibCrypto: Change the signatures of RSA::import_[XXX]_key to use Span. 2020-07-27 19:58:09 +02:00
asynts
3de4e08b46 LibCrypto: Change the signature of decode_pem to use Span. 2020-07-27 19:58:09 +02:00
asynts
0d782e1dfb LibCrypto: Change the signature of RSA::parse_rsa_key to use Span. 2020-07-27 19:58:09 +02:00
asynts
21de20825a LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
asynts
4709b700bd LibCrypto: Change [XXX]BigInteger::export_data() to use Span. 2020-07-27 19:58:09 +02:00
asynts
abe925e4b0 AK: Change the signature of AK::encode_base64() to use Span. 2020-07-27 19:58:09 +02:00
asynts
5fa0fdb219 AK: Rename Span::subspan() to Span::slice(). 2020-07-27 19:58:09 +02:00
asynts
8d2dba022e AK: Add offset() method to Span. 2020-07-27 19:58:09 +02:00
asynts
a922abd9d7 AK: Add span() / bytes() methods to container types. 2020-07-27 19:58:09 +02:00
asynts
c42450786c AK: Add implicit conversion from nullptr to Span. 2020-07-27 19:58:09 +02:00
asynts
2b57891e07 AK: Add constructors to Bytes and ReadonlyBytes that take void pointers. 2020-07-27 19:58:09 +02:00
asynts
7036a9b6f7 AK: Define conversion from Span<T> to Span<const T> correctly.
I accidently wrote `Span<RemoveConst<T>>` when I meant
`Span<RemoveConst<T>::Type>`.

Changing that wouldn't be enough though, this constructor can only be
defined if T is not const, otherwise it would redefine the copy
constructor.  This can be avoided by overloading the cast operator.
2020-07-27 19:58:09 +02:00
asynts
68cf22d580 LibCrypto: This method wrote to a const pointer. 2020-07-27 19:58:09 +02:00