summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
AgeCommit message (Collapse)Author
2015-05-18Fix a crash reported and analyzed by Bertrand PROVOST. When a HTTPAlexander Bluhm
client or server writes multiple requests or chunks in a single transfer, relayd invokes the libevent callback manually for the next data. If the callback closes the session, this resulted in an use after free. Instead of the more complicated fix suggested by Bertrand PROVOST, just move the invocation of the callback to the end of the function. So in case the callback frees any structures, they are not accessed. OK benno@ reyk@
2015-05-18The first line of a HTTP request is the method-url-version. TheAlexander Bluhm
second line is a key-value header. So you cannot append to the previous key-value before line three. Also reset the last header when all headers are purged to avoid a use after free. OK benno@ reyk@
2015-05-15Fix kill'n'yank error: the port is mandatory in relay listen on statements.Reyk Floeter
Pointed out by Alex Greif OK jmc@
2015-05-15client/server mox ip;Jason McIntyre
from trondd
2015-05-02Fix obvious problems with relayd config reload.Claudio Jeker
- fix a TAILQ corruption because of a use after free - do not reinit the SSL engine since that fails OK sthen, benno
2015-04-29When the HTTP client did close the connection while relayd was stillAlexander Bluhm
parsig the HTTP header, the session was never destroyed. This resulted in a file descriptor leak. Add a check wether the protocol knows how much data to expect. If relayd is reading unlimited data or is expecting nothing to read, ignore the end-of-file. Otherwise it is a protocol violation, so close the session immediately. While there, make relayd compile with DEBUG defined. Based on a diff from claudio@; tested by claudio@; OK claudio@ benno@
2015-04-23We cannot log errors with relay_close() before allocatingFlorian Obser
se_log evbuffer. (Same problem as the one just fixed in httpd(8)) OK benno
2015-04-21fix a memory leak. ok blambert@Jonathan Gray
2015-03-24Missing free(3) in error pathGiovanni Bechis
ok benno@
2015-03-09Make relayd TLSv1.2-only by default.Reyk Floeter
OK krw@ benno@ Based on revision 1.66 of usr.sbin/httpd/parse.y: Make httpd TLSv1.2-only by default. Some older browsers, like IE 10, will be incompatible with this change. We do this early in the release cycle, so there is a good chance to get more experience with the impact of it and the upcoming restricted cipher modes. OK jsing@ deraadt@ benno@ bmercer@ krw@ florian@
2015-02-08Use AI_ADDRCONFIG when resolv hosts on startup.Reyk Floeter
OK henning@
2015-02-08move a log_warnx() to a DPRINTF, as it's information intendedBret Lambert
for developers, not sysadmins original diff from yasuoka@
2015-02-06Rename SSL_CTX_use_certificate_chain() to SSL_CTX_use_certificate_chain_mem().Reyk Floeter
As discussed with beck@ jsing@ and others OK beck@
2015-01-22Clean up the relayd headers with help of include-what-you-use and someReyk Floeter
manual review. Based on common practice, relayd.h now includes the necessary headers for itself. OK benno@
2015-01-22spacingReyk Floeter
2015-01-22wrap long lines; spacing.Reyk Floeter
Repeat after me: "Lines are not longer than 80 characters long" and "mg(1) is the only true editor, I'll use ESC-q to wrap the lines".
2015-01-22LibreSSL now supports loading of CA certificates from memory, replaceReyk Floeter
the internal and long-serving ssl_ctx_load_verify_memory() function with a call to the SSL_CTX_load_verify_mem() API function. The ssl_privsep.c file with hacks for using OpenSSL in privsep'ed processes can now go away; portable versions of smtpd and relayd should start depending on LibreSSL or they have to carry ssl_privsep.c in openbsd-compat to work with legacy OpenSSL. No functional change. Based on previous discussions with gilles@ bluhm@ and many others OK bluhm@ (as part of the libcrypto/libssl/libtls diff)
2015-01-21Include <netinet/in.h> before <net/pfvar.h>. In a future change whenTheo de Raadt
ports is ready, <net/pfvar.h> will stop including a pile of balony.
2015-01-16SSL_CTX_use_certificate_chain() has been added to LibreSSL and thereReyk Floeter
is no need to keep a local copy in ssl_privsep.c. This adds a little burden on OpenSMTPD-portable because it will have to put it in openbsd-compat for compatibility with legacy OpenSSL. OK gilles@
2015-01-16Adapt to <limits.h> universe.Theo de Raadt
ok millert
2015-01-16The SSL/TLS session Id context is limited to 32 bytes. Instead ofReyk Floeter
using the name of relayd relay or smtpd pki, use a 32 byte arc4random buffer that should be unique for the context. This fixes an issue in OpenSMTPD when a long pki name could break the configuration. OK gilles@ benno@
2015-01-13bump copyright yearReyk Floeter
2015-01-02PFS stands for Perfect Forward Secrecy.Igor Sobrado
ok reyk@
2015-01-01Merge error page changes from httpd: send Content-Length:, changeReyk Floeter
Date: from asctime to the preferred HTTP/1.1 format, and use the popular "Comic Sans" style (can be changed in the configuration).
2015-01-01Use the recommended HTML5 doctype in error pages.Reyk Floeter
OK validator.w3.org (This document was successfully checked as HTML5!)
2014-12-27zap trailing whitespace;Jason McIntyre
2014-12-26Document forward to in protocols.Sebastian Benoit
2014-12-23pf now supports source-hash and random with tables so we can allow itReyk Floeter
in redirections. Thanks for help and input from jsg and yasuoka who reminded me to dig out and update these old diffs for pf and relayd. ok jsg@
2014-12-21Stop pulling in <arpa/inet.h> or <arpa/nameser.h> when unnecessary.Philip Guenther
*Do* pull it in when in_{port,addr}_h is needed and <netinet/in.h> isn't. ok reyk@
2014-12-18an hex -> a hex;Jason McIntyre
2014-12-18Update relayd to use siphash instead of sys/hash. The source-hash,Reyk Floeter
loadbalance and hash modes use a random key by default that can be forced to be a static key with a new configuration argument. With input from Max Fillinger. ok tedu@
2014-12-17Add missing flag in the description field.Reyk Floeter
2014-12-16Replace setpgrp(0, getpid()) with setpgid(0, 0). OK deraadt@ tedu@Todd C. Miller
2014-12-12Change the keyword "ssl" to "tls" to reflect reality since weReyk Floeter
effectively disabled support for the SSL protocols. SSL remains a common term describing SSL/TLS, there is some controvery about this change, and the name really doesn't matter, but I feel confident about it now. (btw., sthen@ pointed out some historical context: http://tim.dierks.org/2014/05/security-standards-and-name-changes-in.html) OK benno@, with input from tedu@
2014-11-25use correct divisor when converting microseconds to 100ths of a secondBret Lambert
found by yasuoka@
2014-11-24remove a surplus break statementJonathan Gray
2014-11-22use size_t where appropriate. ok deraadt reykTed Unangst
2014-11-20Don't allow embedded nul characters in strings.Jonathan Gray
Fixes a pfctl crash with an anchor name containing an embedded nul found with the afl fuzzer. pfctl parse.y patch from and ok deraadt@
2014-11-19Support exporting relayd statistics via AgentX/snmpdBret Lambert
This should be equivalent to the statistics available via the various relaydctl show commands okay benno@ reyk@
2014-11-14Shorten the AgentX header debug messages (only compiled with -DDEBUG)Reyk Floeter
to a single line and print to stderr instead of stdout. This makes it easier to follow the debug output again. Also, as a rule of thumb, it is OK to exceed 80 chars for these kinds of developer debug messages. OK blambert@
2014-11-07Remove the sslv2 option since LibreSSL has no SSLv2 support (however retainJoel Sing
SSL_OP_NO_SSLv2 in case you happen to be running relayd on another platform with another SSL library). Also fix the SSLv3 handling so that 'no sslv3' actually works as intended. ok reyk@
2014-11-02Convert the logic in yyerror(). Instead of creating a temporaryAlexander Bluhm
format string, create a temporary message. OK deraadt@
2014-10-25Remove unnecessary netinet/in_systm.h include.Lawrence Teo
ok millert@
2014-10-21Remove SSLv2 and SSLv3 references from the example relayd.conf and theLawrence Teo
relevant example snippet in the relayd.conf(5) man page. Change the default SSL protocols in the example file/man page to "no tlsv1.0" (suggested by sthen@), which will enable the TLSv1.1 and TLSv1.2 protocols only. feedback/ok jsing@ reyk@ sthen@
2014-10-20Remove the "interface" option from the "transparent forward" directive.Reyk Floeter
It was mandatory in the grammar but never used in the code. A fully transparent relay can now be specified with the following directive in a relay block: "transparent forward to destination". OK sthen@
2014-10-15Disable SSLv3 by default.Reyk Floeter
OK sthen@ jsing@
2014-10-12Remove possibility of mutiplicative integer overflow by not multiplying.Bret Lambert
Instead of the widespread-but-overflow-prone while (newlen < wanted) { newlen *= 2; } idiom, just realloc() for the space requested by the caller and check for additive overflow. Also change type of 'newlen' variable from int to size_t to avoid overflows there. Pointed out by deraadt@ ok reyk@
2014-10-02no need to set the same field NULL twice ;-)Gilles Chehade
ok reyk@
2014-09-15Make the HTTP version mandatory and abort if it is missing in the request.Reyk Floeter
2014-09-05revert previous; was based on a work-in-progress, as wellBret Lambert
as being an incomplete and therefore incorrect adaptation apologies to anybody who got bitten by this mistake ok reyk@