aboutsummaryrefslogtreecommitdiff
path: root/src/aoapplication.h
AgeCommit message (Collapse)Author
2026-03-29Handle extension packets using binary framesOsmium Sorcerer
The subprotocol shall use binary frames, and AO protocol stays separated within the text frames.
2026-03-29Add authentication dialogOsmium Sorcerer
Introduce start_auth_flow, a function invoked by typing `/auth username` in OOC. It sends an public-key authentication request to the server, starting the entire flow. The flow invoves two dialogs: to select the key, and to enter the passphrase to unlock the key. For convenience, each successful unlock also remembers the key for that username on the server, storing this in `saved_auth.json` (I chose JSON because I wanted it to stay human-editable; INI would be better, but it suffers from bad platform quirks in Qt).
2026-03-29Add the keyring for secret key managementOsmium Sorcerer
The keyring provides the system to store secret keys in an encrypted format, create and delete keys, display public keys and notes for the user, and use these keys to peform public-key authentication on servers. Keyring is serialized into `keyring.cbor` in the application directory. It's a CBOR map with keys being key IDs (fingerprints), and the values are key entries, the schema of which looks like this: key-entry { 0 => uint, ; Algorithm tag, 1 byte 1 => text, ; Comment/note for the key 2 => bytes, ; Public key (certificate), 32 bytes 3 => bytes ; Encrypted and authenticated secret key (AEAD payload) } Key fingerprint is `BLAKE2b-256(tag || public_key)`, where `||` denotes concatenation of byte strings. Encrypted payload is a fixed binary structure (field sizes in bytes): Version(1) Salt(16) Opslimit(4) Memlimit(4) Alg(1) Ciphertext(32) MAC(16) Upon key generation, a new secret key is created, sourced from a secure RNG. The wrap key is derived from the passphrase using Argon2 with the specified iterations, memory cost, variant (3 iterations, 1 GB of memory, Argon2id), and 16 bytes of randomly generated unique salt. This wrap key is used with ChaCha20-Poly1305 to encrypt the secret key, with all the prior fields as additional authenticatied data and all-zero nonce (the uniqueness is already provided by the salt). The key pairs are X25519, used specifically for key exchange. When the server sends the ephemeral public key as a challenge, the client uses `unlock_and_auth` function with the key corresponding to the right certificate. After entering the correct passphrase, the secret key is decrypted and used to derive a shared secret with the server's ephemeral key. The client then responds with: BLAKE2b-256("Einsof-Auth-DHCR" || shared_secret || challenge || certificate || username) Where the first string is provided for domain separation, shared secret proves possession of the secret key, and other parameters are hashed in to bind this authentication attempt to the current session (via random challenge), identity (via public key and username), and transcript. Note on canonicalization: all fields but last are fixed-length, concatenation here is unambiguous. The server, in turn, performs the same opeations, except the shared secret is derived from the server's ephemeral secret and the client's public key. Naturally, username and public key must be correct. If the response matches, the server authenticates the client. The client never transmits its secret. This scheme is essentially deriving a session secret and computing MAC over the transcript with that secret to prove authenticity. It serves as a simple identification protocol. Unlike digital signatures, it's interactive, valid only in the context of a single authentication attempt, and only between two participants involved. Signatures, in contrast, are valid everywhere, for everyone, and they require additional nonces and context. In fact, they're interactive identification protocols turned non-interactive, so forcing them back into this setting is unnecessary complexity. The primitives are fixed: X25519 for key exchange, Argon2 for password-based key derivation, ChaCha20-Poly1305 for encryption, BLAKE2b for hashing. Provided by libsodium. Simplicity is key. There's no flexibility, negotiation, or compatibility, and it'll hopefully stay this way. Unless you're worried about quantum computers appearing tomorrow and attacking a niche AO implementation, in which case I'll add the ML-KEM variant just for you.
2026-03-29Add the extension packetsOsmium Sorcerer
Introduce the subprotocol ("Einsof"), its prototype serialization and parsing functions, and its first set of messages. These messages are carriers of public-key authentication mechanism which involves client request, server challenge, and client response. An "ident" message is used to tell a compatible server that you support a particular version of the subprotocol. Note: the functions that handle encoding are very specialized. They're not representative of how the wire format should be generally handled, and were written this way because the first set of messages is tiny and simple enough.
2026-03-29Rewrite audio engine: replace BASS with miniaudioOsmium Sorcerer
SFX and blip players largely remain the same. For the music player, we now have to implement network streaming natively, we no longer have a convenient function that did everything for us. I introduced QNetworkRequest to download the stream in memory and signal when it's ready to be decoded and played back. The size is guarded to prevent the client from accidentally downloading terabytes of audio. Delete QFutureWatcher, we no longer need it for concurrency. miniaudio uses a separate audio thread. Network donwloads and communication with the track name display are handled by Qt signals. Also, delete an odd "music.txt" feature. Its purpose was specifying offsets for loops in a text file per track, but it remained obscure and unused in practice. Unsupported: - Large streams, including unbounded ones (radio). We'll need a ring buffer for that, and a mechanism to write to it from the network and feed it to the audio thread. - Effect flags: fade in, fade out, sync pos. Ignored. - Audio device selection.
2025-01-13Merge branch 'master' into cleanupin1tiate
2025-01-13Add the ability to "favorite" songs and pin them to the the top of the ↵in1tiate
songlist (#1066) * add song favoriting * remove incorrectly placed sort() * store as qstringlist instead of using keys
2025-01-11make range-for constin1tiate
2024-08-07change default theme variable back (#1036)in1tiate
2024-08-02change the string (#1030)stonedDiscord
2024-07-31V2.11.0 rc1 fixes (#1029)Salanto
* Use unix timestamp to transmit ban duration * Cleanup compiler warning due to narrowing conversion * Fix preanim not being visible This is apparently not a feature we want from WebAO :^) * Bump to RC2 * Use std::chrono instead * Remove random include and debug call
2024-07-21Attorney Online 2.11 Release Candidate 1 (#1026)Salanto
* Version bump and minor fixes * Remove unecessary headers Thanks QtCreator
2024-07-13Resize mode patch (#1019)Leifa
* Fix transformation mode for layers Resolve #997 * always use smooth transform resampling for stretched images * Used fixed frame size * Implemented resize mode changes Resolve #999 * Added alias to pixel resize mode * Added user option --------- Co-authored-by: in1tiate <32779090+in1tiate@users.noreply.github.com>
2024-07-12Merge pull request #1016 from AttorneyOnline/restore-window-positionLeifa
[Feature] Add support for windows position restore
2024-07-12Restore position in AOApplicationSalanto
2024-07-12Add playerlist widget element (#996)Salanto
* Commit * Boyfailure code commit * Cooking code spaghetti * Accidental overwrite recursive function call hell * Implemented player list * Add partial moderator widget Sleepy time! Hee-Hoo! * Moderator Dialog - Step 1 - WIP * Appease the clang gods * Clang appeasement policy * *sacrifices goat to clang* * Added player report, reworked implementation, ... * Added player-specific report * Reworked implementation * No longer uses JSON. * Removed preset loader. --------- Co-authored-by: TrickyLeifa <date.epoch@gmail.com> Co-authored-by: Leifa <26681464+TrickyLeifa@users.noreply.github.com>
2024-07-12Harden screen position check against missing monitorsSalanto
2024-07-11QApplication less! (#1017)Leifa
2024-06-21Fix background scaling and centering (#982)Leifa
Fix #978
2024-05-22Fixed emote synchronization, ...TrickyLeifa
* Fixed emote synchronization * Still requires identical frame count. Will still cause freeze as it syncs. * Fixed frame effects not working on idle and talk emotes. * Characters are now repositioned after background sliding is over.
2024-05-22Complete AOLayer reimplementation, ...TrickyLeifa
* Complete AOLayer reimplementation * Reimplemented sliding as well.
2024-05-20Initial slide rebase commitin1tiate
2024-05-17Changed include definitions to reflect third-party statureTrickyLeifa
2024-05-17Merge branch 'master' into kaleidoscopeTrickyLeifa
2024-05-17Lightly reworked `NetworkManager`, ...TrickyLeifa
* Lightly reworked `NetworkManager` * Added new modules to handle various connection types. * TCP * WebSocket * Added general string splitter alias based on Qt version. * Replaced `lobby_constructed` and `courtroom_constructed` * Refactored and partially reimplemented the following classes: * `AOBlipPlayer` * `AOEmotePreview` * `AOMusicPlayer` * `AOSfxPlayer` * `AOTextArea`
2024-05-16Reimplemented favorite server widget, ...TrickyLeifa
* Reworked favorite server widget * Renamed `server_type` to `ServerInfo` * Renamed `connection_type` to `ServerConnectionType` * Refactored `AOCharButton` * Reimplemented `AOButton` * Partially reimplemented `AOEmoteButton` * Refactored `AOEvidenceButton`
2024-05-15Merge branch 'master' into kaleidoscopeTrickyLeifa
2024-05-15Ported to CMake, ...TrickyLeifa
* Ported the project to CMake * Android and Mac support dropped for the time being. * Tests, BASS and Discord-RPC are now options * Restructured and reformated the project. * Merged `include` and `src` * Renamed `resource` to `data` * Renamed various files * External libraries headers are no longer included in `src` * Replaced header guards with #pragma once * Multiple refactors (keywords, headers) * Added Qt6 compatibility * Removed various unused functions and headers * Reworked AOPacket * When content is passed to AOPacket, it should be ensured that the content is already decoded. * Encoding/decoding are now static methods. * Fixed various memory leaks * Removed animation code for AOImage * AOImage is always using static images * Simplified ChatLogPiece