summary refs log tree commit diff
path: root/client.c (follow)
Commit message (Collapse)AuthorAge
* Refactor hasTag to be usable in more placesJune McEnroe2021-01-24
|
* Support echo-message capabilityJune McEnroe2021-01-24
| | | | | | | Only request it with labeled-response, since it is impossible to correlate messages to clients without. For clients without echo-message, synthesize a label on PRIVMSG/NOTICE/TAGMSG, then filter out received messages with that label.
* Add lazy client registration timeoutJune McEnroe2020-11-20
| | | | | | I don't think this is worth adding a configuration option for since real clients will definitely accomplish registration faster than 10s and it's long enough to even type out manually for testing.
* Only allow clients to AUTHENTICATE if using a certJune McEnroe2020-11-16
| | | | | | Otherwise the successful authentication message can leak information to unauthenticated clients when both certificate and password authentication are enabled.
* Set client sockets non-blockingJune McEnroe2020-11-16
| | | | | | | | | | | | | | | | | | | | | Except for during writes. This prevents pounce getting blocked on a client sending only a partial TLS record, for example. Writes still need to block because pounce doesn't have a way to resume them. (And it would do so by having a buffer, but sockets already have a send buffer, so what would be the point of that?) I don't think it should be a problem since outside of stateSync, writes only happen when poll returns POLLOUT. I feel like ideally SO_SNDLOWAT would be set to guarantee a full IRC message can always be written on POLLOUT, but since it's actually TLS records being sent, it's not obvious what the size would be. I'm also making an assumption here that tls_read returning TLS_WANT_POLLOUT is unlikely to happen, since I don't actually set pollfd.events based on that. I'm not sure how wanting to resume a tls_read after a POLLOUT could be cleanly handled. I'm just going to hope that if it does happen, the regular poll loop will eventually sort it out...
* Make struct Client publicJune McEnroe2020-11-14
|
* Wait for POLLIN to do client tls_handshakeJune McEnroe2020-11-13
| | | | | | | | | | | Otherwise a client could cause pounce to hang (since the sockets are left blocking) by opening a connection without handshaking! Oops, that's pretty bad. Since the sockets are still blocking, a hang can still be caused by a client sending a partial handshake then waiting. More fixes to follow. pounce is slightly protected from this when used with calico, as it applies a timeout to waiting for the ClientHello.
* Refactor reserialization and client self-producingJune McEnroe2020-08-31
|
* Add support for OpenBSDJune McEnroe2020-08-27
|
* Fix unintended interception of NICK after registrationJune McEnroe2020-08-13
| | | | Another bug caused by trying to support broken clients. I'm annoyed.
* Implement stub of palaverapp.com capabilityJune McEnroe2020-08-11
| | | | | | This needs to be documented! But the documentation won't make any sense until there's something that can implement the actual functionality of the capability.
* Refactor intercept to use Handlers and fix QUIT w/o message 1.4p1June McEnroe2020-08-10
| | | | | | The change to support broken clients with bad line endings broke the interception of QUIT with no message parameter, because the CR is part of the length passed to intercept.
* Refactor clientCA and clientSTS as clientCapsJune McEnroe2020-08-10
|
* Say "OpenSSL" in additional permission noticesJune McEnroe2020-08-06
| | | | LibreSSL is "a modified version of that library".
* Handle broken clients sending only \nJune McEnroe2020-08-06
| | | | | Sigh. The robustness principle enables the proliferation of worse quality software.
* Use snprintf instead of strlcpyJune McEnroe2020-07-31
|
* Add additional permission for linking with LibreSSLJune McEnroe2020-06-08
| | | | https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs
* Add server send queueing with time intervalJune McEnroe2020-05-11
| | | | | | | | | This addresses pounce getting killed with "Excess flood" when it sends NAMES commands for too many channels when a client connects. These commands, as well as automatic AWAY commands, are by default throttled to 5 per second. Tested on freenode with 36 channels and 200ms interval.
* Advertise STS policyJune McEnroe2020-02-27
| | | | | Duration is set to INT_MAX since pounce will never accept cleartext connections.
* Set consumer pos with CAP REQ causal.agency/consumer=nJune McEnroe2020-02-27
| | | | | So the spec doesn't say I can use cap values in CAP REQ. But it also doesn't explicitly say I can't.
* Rename causal.agency/consumer tag causal.agency/posJune McEnroe2020-02-27
|
* Add 1 to consumer ID tagsJune McEnroe2020-02-27
| | | | It should indicate the position after having seen the tagged message.
* Add causal.agency/consumer capabilityJune McEnroe2020-02-27
|
* Send CAP LS 302 to the serverJune McEnroe2020-02-27
|
* Properly treat CAP LS version as a numberJune McEnroe2020-02-27
|
* Support CAP LS 302 from clientsJune McEnroe2020-02-27
|
* Support cap-notifyJune McEnroe2020-02-27
|
* Support setnameJune McEnroe2020-02-26
|
* Support labeled-responseJune McEnroe2020-02-26
|
* Support batchJune McEnroe2020-02-26
|
* Clean up intercept tag skipJune McEnroe2020-02-26
| | | | "Tag skip" like it's a speedrun :3
* Also skip the origin in wordcmpJune McEnroe2020-02-26
| | | | I think for some caps we need to filter messages without origins.
* Use %n for tags when formatting intercepted PRIVMSG/NOTICEJune McEnroe2020-02-26
|
* Tweak buffer sizesJune McEnroe2020-02-26
| | | | | | Filter functions are dealing with lines not including CRLF, so they already have extra space. serverFormat is using snprintf which wants to always write a NUL at the end of the string.
* Add time tag to lines missing itJune McEnroe2020-02-25
| | | | | If a line was produced by another client, it won't have one from the server.
* Support message-tagsJune McEnroe2020-02-25
|
* Request server-time from the server and filter tags for clientsJune McEnroe2020-02-25
| | | | | | | | This doesn't yet, but it will break the "robustness principle" according to which a server "SHOULD NOT" assume that a client capable of parsing one tag is capable of parsing all tags. In future, TagCaps will have all other caps that use tags ORed into it, and only if the client supports none of them will tags be filtered out.
* Bump buffer sizes to allow for tagsJune McEnroe2020-02-25
| | | | | I still think this limit is unreasonably large in comparison to 512 for the actual message.
* Remove bad assertJune McEnroe2020-02-18
| | | | | If there's no room left in the buffer, tls_read will return 0 (since we gave it zero length to read into) and cause client->error to be set.
* Add option to set local client CAJune McEnroe2020-01-12
| | | | | | | | | This is a little bit messy. Allows setting either -A or -W or both. Implements SASL EXTERNAL for clients that expect that when connecting with a client certificate. Need to test that reloading still works inside capsicum, since I suspect that rewind call may be blocked.
* Add a vendor capability for passive clientsJune McEnroe2020-01-10
| | | | | | This way things like litterbox can do it automatically without having to be configured with a hyphen-prefixed username, which is usually invalid anywhere else.
* Intercept client QUIT with no parameter 1.0p3June McEnroe2019-12-28
| | | | Oops! Clients could get pounce to quit if they didn't send a message.
* Don't send self-PMs to the server 1.0p2June McEnroe2019-12-08
|
* Fix wordcmp return value when the words have differing lengthsMichael Forney2019-11-21
| | | | | | | | | | Otherwise, the result of strncmp gets converted size_t, since size_t has greater rank than int. Since wordcmp is only ever used as a boolean condition, this poses no real issue, but presumably, it is meant to behave like the other *cmp function and return a value less than, equal to, or greater than 0 depending on the result of the comparison.
* Declare globals as extern in headers, and define in source fileMichael Forney2019-11-21
| | | | | | | | | | | | | | | Otherwise, each source file that includes the header gets its own definition, and according to the C standard (C99 6.9p5): > If an identifier declared with external linkage is used in an > expression (other than as part of the operand of a sizeof operator > whose result is an integer constant), somewhere in the entire > program there shall be exactly one external definition for the > identifier Most compilers use the .bss section for zero data, but if it uses .data instead, or if -Wl,--warn-common is used, this will cause a linking error.
* client: Include time.h for gmtime and strftimeMichael Forney2019-11-20
|
* Format milliseconds as intJune McEnroe2019-11-20
| | | | | I don't know what I was thinking. I'm expecting a number less than 1000 of course that fits in int.
* Add concept of passive clientsJune McEnroe2019-11-14
|
* Use struct timeval for sub-second precisionJune McEnroe2019-11-14
|
* Remove server-time filter TODOJune McEnroe2019-11-14
| | | | | I think it's fine to keep it separate since it's a core function of the bouncer.