reauthorize: Fix a number of bugs caught by Coverity

Closes #555

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
test: Don't polute user's known hosts file

If you run ./VERIFY as a local user, it will use that known hosts
file and add all sorts of entries for 10.111.111.X to it.

Closes #554

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
- Removed stray t from git log
Ignore .a and .so files, and cockpit-polkit
Use strings as channel identifiers instead of numbers

This is done for three reasons:

 * Much much more flexible going forward, since this is an integral
   part of our protocol, it can never be changed.
 * We can allow routing multiple WebSockets to one agent, without
   trying to coordinate the channel number space of those WebSockets.
   This is not implemented in this patch.
 * We can implement internal channels that don't get routed to a
   WebSocket (necessary for implementing resource loading).

This is an alternative to the signed channel number patch that was
floating around.

Closes #546
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Signed-off-by: Marius Vollmer <marius.vollmer@redhat.com>
* Cosmetic fixes to protocol.md
ws: Clear login passwords from memory when freeing

Try to defeat compiler optimizations here too by having
side effects of our password clearing.

Closes #559

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Made comment a gtk-doc style function comment
ws: Implement CockpitWebServer without threads

The main difference here is that things are no longer threaded
when serving HTTP requests.

This is necessary because we'll have some HTTP requests accessing
WebSocket channels in the future and locking everything will be
a major pain.

In addition the following fixes and benefits:

 * Don't waste a whole thread on unauthenticated requests.
 * Enforce a default 30 second timeout for reading HTTP requests.
 * Hard 4096 byte size limit for HTTP request input.
 * Don't leak so much internal state into error messages.
 * Better setup for queuing and returning responses and guaranteeing
   that they're correct.
 * Simpler to read POST input.
 * Simpler handlers.
 * No memory leak of per request signal detail (ie: the path).
 * No expensive GIO for serving files, just use mmap.
 * Use proper HTTP status codes for invalid requests
 * Fix various races and multi-threading issues due to
   main context usage.
 * Fix breaking out of the HTTP document root with double dots.

Although not implemented yet, set the ground work for:

 * Chunked Encoding
 * Correct HTTP version responses
 * Persistent connections (with multiple requests)

Fixes #551
Fixes #550