Commits


Fix relayd reload race crash Instead of terminating with fatalx() when a private key hash cannot be found, log a warning and send an error back to the relay worker. This prevents a race condition during "reload" where a request might reach the CA process while keys are being repopulated. Reported by Nick Owens; thanks! OK tb@


relayd: replace unneeded engine.h with needed x509.h Adjust a comment. Being non-existent, the OpenSSL engine layer cannot be responsible for whatever unholy hacks this code requires.


Standardize logging with bgpd OK claudio@


imsg_composev() / imsgbuf_flush() handle return values OK claudio@


fix memory leak in rsae_send_imsg If the cookie doesn't match, we bail with a continue and totally forget to free the imsg. OK claudio@


Convert the common imsgbuf_read calls to the post EAGAIN world. OK tb@


Rename imsg_init, imsg_clear, imsg_read, imsg_write and imsg_flush to imsgbuf_init, imsgbuf_clear, imsgbuf_read, imsgbuf_write and imsgbuf_flush. This separates the imsgbuf API from the per-imsg API. OK tb@


relayd: remove ENGINE dependency What is achieved here through ENGINE can be done in a much simpler way by setting the default RSA implementation. Drop a number of indirections that only add a bit of logging. This removes a lot of boiler plate and shows where the actual magic happens more clearly. ok op tobhe


fix typo: 'hash buffer to small' -> too small


Add missing #include <openssl/err.h>


In case RSA_meth_new fails, errstr would be passed to fatalx without initialization. OK tb


catch poll() returning EINTR. ok millert@ claudio@


Convert relayd for opaque RSA_METHOD This is a mostly mechanical diff which will hopefully be superseded soon by work in libtls. ok jsing


zap a stray space


Timed out RSA key ops, may leave uncalled for responses in the imsg return path. These have to be dropped or every subsequent call will cause decrypt errors. Use a sequence number cookie to keep the systems in sync. Diff from niklas@ with some minor adjustments by myself.


Move the relay keys/certs into a separate global list and look them up by id. Moving the certs out of the relay struct will help to add multiple SNI certs. Tested by many users (thanks!) Feedback & OK rob@


Do not abort when the ca privenc runs into a timeout. OK claudio@


Log some more errors in the ca code, since there seems to be still a bug hidden somewhere. Also return after a poll timeout, there is no reason to wait longer than a second for the answer of the ca process. OK jsing@


RSA_private_{en,de}crypt() can fail and will return -1 in that case. Check for this in the ca process and return a valid answer to the relay process. This fixes rsae_send_imsg poll timeouts blocking relay processes as seen by Mischa Peters and myself. OK benno@


relay_load_fd() is no longer clobering errno in the error case so use fatal() instead of fatalx()


Make ca_launch error messages unique. OK claudio@


Use file descriptor passing to load certificates into the relays. Especially the ca file (having all the trusted certs in them) can be so big that loading via imsg fails. OK beck@


Use X509_pubkey_digest() like libtls to hash the keys for the TLS privsep code. This fixes interception mode (since there we rewrite the CERT which would alter the hash of the cert but the keys still remain the same). OK bluhm@ and jsing@


Always calculate the hash value of the x509 cert in ssl_load_pkey(). Check whether TLS server object is available before using it. With these fixes the ssl inspect regress test just fails and does not crash relayd. OK claudio@


use __func__ in log messages. fix some whitespace while here. From Hiltjo Posthuma hiltjo -AT codemadness -DOT- org, thanks! ok florian, claudio