| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
Only one reference: client_open() errors out if the argument vector does
not include any subcommand. The plain EINVAL seems to be a better fit for
this particular case, so..
|
| |
|
|
|
|
|
|
| |
Generated with
sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h
followed by manually tweaking the result a bit. No license change intended.
|
| |
|
|
|
|
|
|
|
|
|
| |
Since 0.7.x the server no longer checks the client request but uses sha256
unconditionally. At the same time para_client started to no longer check
whether the sha256 feature is announced by para_server but uses sha256
unconditionally.
This commit is the next step towards the removal of the feature. We need
to wait until 0.9.0 before the server starts to reject clients requesting
the feature.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, para_audioc writes the data it received over the local socket from
audiod to stdout. This include error messages, if any. Also, para_audioc
does not know whether the subcommand passed to para_audiod was successful,
and exits successfully even if the subcommand failed.
Thanks to the sideband API, para_client is much smarter in this regard. This
patch employs the existing API also for the connection between para_audioc and
para_audiod. Besides comment updates and the new sideband_log() helper, no
changes to the sideband API are necessary. The client code stays unmodified
as well. The new helper has three callers, two in audioc.c and one in
client_common.c.
Remove a pointless NULL check and a debug log message from dispatch_sbb()
of client_common.c while at it. The message was useful for testing but is
no longer needed.
The new code is backwards compatible, i.e., an old para_audioc can still
communicate with a new para_audiod and vice versa. Thus, we have to maintain
two "protocols" for the audioc-audiod communication, named v1 and v2 in the
code and in what follows.
For example, if audioc or audiod are unpatched (so that v1 is in use), then
./para_audioc aaa > /dev/null
prints nothing because with v1 the error message goes to stdout, and the
command exits successfully (exit code 0). If both sides support v2, the same
command prints
audiod: errctx: aaa
audiod: invalid subcommand
main: audiod dispatch error
to stderr, then exits unsuccessfully (exit code 1).
Only the server reply is sideband-encoded. The way how command line arguments
are passed from audioc to audiod is also changed, though. Instead of
terminating the arguments with newlines, a v2 audioc prepends an additional
\0 byte to the argument list, and terminates each argument with \0 in the
same way the --print0 directive of GNU find(1) does.
An v1 audiod interprets the leading NUL as an empty command line and closes
the connection without sending any data. This can never happen with a v2
audiod because that always sends an empty sideband package to indicate
success/failure. So the v2 code of audioc.c retries with v1 in this case.
Conversely, a v1 client never sends an empty string, so a leading \0 identifies
a v2 client. Thus, the patched audiod only needs to check the first byte of
the received buffer to select the right "protocol" version.
The stat and grab subcommands need special treatment because these may stay
active after the command handler returns. Thus, the command handler must not
send an EXIT_SUCCESS sideband packet in this case. Moreover, the protocol
version needs to be communicated with the status/grab client tasks. This is
done by adding a flag to the existing flags bitmask of struct stat_client
and struct grab_client.
After v0.8.0 has been released, the compatibility code can be dropped.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The two callers in client_common.c don't need the check because
btr_add_output() will do the right thing when called with a zero-sized buffer
and para_log() can be taught the same by using the precision specifier for
the %s format string (i.e., "%s" becomes "%.*s").
This also fixes a potential (i.e, never seen in real life) para_client(1)
buffer overflow because dispatch_sbb() logged a buffer received from the
server process via the "%s" format string without explicitly terminating the
buffer with \0. The precision specifier limits the number of bytes printed
from the "string" to the number of bytes received, avoiding the overflow.
The old name was a misnomer because a zero-sized vector may well be valid
in the sideband context where packets with an empty buffer still carry
information in the band designator. For example the SBD_SUCCESS designator
is used with an empty buffer to indicate success.
|
| |
|
|
|
| |
The new file comment for client.c, its dedoxification, and a bunch of
miscellaneous improvements for the public functions of client_common.c.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The series first drops the para_upgrade_db executable because it is no longer
needed. This removes the penultimate user of the sha1 infrastructure. The
remaining commits deal with the last user: the handshake between para_client
and para_server. Since paraslash-0.7.0, client and server employ sha256
by default, but fall back to sha1 in order to stay compatible to old 0.6.x
versions. After this series, server and client always employ sha256 as the
hash algorithm, breaking compatibility with 0.6.x clients. As a result,
the sha1 hash algorithm is no longer used anywhere, so the corresponding
infrastructure is no longer needed. This gets rid of a fair amount of code.
* refs/heads/t/rm_sha1:
Rename hash2 -> hash.
Remove sha1.
Remove para_upgrade_db.
aft: Compare the full hash, not just the first 20 bytes.
|
| | |
| |
| |
| |
| | |
Now that sha1 is no longer supported, the hash2 naming has become meaningless.
Rename it back to "hash".
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Server and client prefer sha256 in the authentication protocol since
paraslash-0.7.0, while 0.6.x clients and servers only know about sha1. This
patch drops the compatibility code which enabled old clients to connect to
new servers and vice versa.
Now the client code no longer checks whether the sha256 feature is supported,
but requests and uses the feature unconditionally. The server still announces
the sha256 feature and accepts the corresponding feature request, but uses
sha256 unconditionally.
With this approach older 0.7.x clients are still compatible to current
server versions and current clients can still talk to servers running older
0.7.x versions.
|
| | |
| |
| |
| |
| |
| |
| | |
There are two callers, one in client_common.c and one in client.c. The
former passes NULL, hence does not need the argument. The latter passes a
non-NULL pointer to initialize the global client_loglevel integer, but this
initialization can as well be done in the caller, simplifying the code a bit.
|
| |/
|
|
| |
Both callers pass NULL.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A medium sized series for the build system which improves the way the git
version string is stored in the executables and man pages. Subsequent patches
of the series remove some warts from the makefile: we no longer use order-only
dependencies and the .PRECIOUS target.
The merge results in a conflict against the "remove regex include" commit
67388cd4fae0. This is trivial to resolve, though.
* refs/heads/t/build:
Doxify version functions.
Doxify OV_EXCLUDE_STATIC_CALLBACKS #define.
Makefile: Fix braino in tarball target.
build: Remove superfluous dependency in Makefile.real.
build: Remove the .PRECIOUS target.
build: Improve clean targets.
build: Get rid of directory order-only dependencies.
build: Compile with -Wunused -Wall also on BSD.
build: Revamp git versioning.
build: Merge version.{c,h} into string.{c,h}.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a preparatory patch for the upcoming revamp of the git
version script. The revamped script generates version.c, a file
which is currently tracked by git. We can easily get rid of it (and
of version.h) since all paraslash executables link in both string.o
and version.o. So let's move the three small functions of version.c
to string.c and their declarations from version.h to string.h.
|
| |/
|
|
| |
Every .c file includes it anyway.
|
| |
|
|
|
|
|
| |
This complements the previous commit which made the analogous
change for public encryption. Passing char ** instead of char * to
apc_priv_decrypt() allows us to get rid of the magic 1024 constant
in client_common.c.
|
| |
|
|
|
|
| |
The decoded challenge buffer contains the challenge and the two session
keys but nothing else. So we know its size up-front and should fail
the handshake if the size of the rsa-decrypted buffer differs.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This bunch of mostry trivial changes can be merged early, before the
openssl code is converted to use the EVP API. The topic was cooking
in next for six months.
* refs/heads/t/crypt-cleanups:
openssl: Assign bignums in canonical order.
openssl: Unify naming of public key structures.
openssl: Rename read_private_rsa_params() -> read_openssh_private_key().
openssl: Rename read_rsa_bignums() -> read_public_key().
openssl: Dedox crypt_init().
server: Improve "loading pubkey" log message.
gcrypt: Remove pointless state variable.
client: Reduce line length.
|
| | |
| |
| |
| | |
Trivial patch, nothing to see here.
|
| |\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A rash of patches which clean up a good part of fd.c. Nothing major
here, mostly simplifications and documentation improvements.
* refs/heads/t/fd:
fd: Simplify and move for_each_file_in_dir().
fd.c: Improve error checking of para_mkdir().
fd: Revamp para_mkdir().
fd: Improve read_pattern(), rename it to read_and_compare().
fd: Remove log message from para_munmap().
fd: Open-code para_chdir().
fd: Remove file_exists().
fd: Improve documentation of xwritev().
fd: Improve documentation of write_all().
fd: Improve documentation of write_va_buffer().
|
| | |
| |
| |
| |
| |
| | |
Open-coding this function actually improves code readability. The
function name was a misnomer anyway because any error from the stat()
call (such as EACCES) was reported as "file does not exist".
|
| |/
|
|
|
|
|
|
|
|
|
| |
The function returns bool, so a return value of zero is regarded as
false. Consequently, server feature #0 (sha256) is not detected even
if it is announced by the server, and therefore the client does not
request it. Hence both sides fall back to sha1.
This bug was introduced in paraslash-0.7.2.
Fixes: a0707daa23f8706326aa837f969c20d3e4ee02aa
|
| |
|
|
|
|
| |
Currently we have ~15 error codes which indicate an EOF condition. One
should suffice, so drop all codes except the generic E_EOF and use
that everywhere.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A moderately sized series which contains a bunch of simple cleanups
for net.c and net.h.
* refs/heads/t/net:
net: De-doxify static functions.
net: Refer to correct man page in stringify_port().
net: Pass true/false instead of 0/1 to makesock().
net: Demote log level of error message in makesock().
net: Rename para_connect_simple() -> para_connect().
net: Make is_valid_ipv{4,6}_address() local to net.c.
net: Remove IPPROTO_DCCP define.
net: Make single-use macros local.
net: Combine documentation of struct flowopts.
net: Drop extern keyword of function declarations.
|
| | |
| |
| |
| |
| | |
We used to have para_connect() at some point (hence the need for the
_simple suffix), but it was removed long ago.
|
| |/
|
|
|
| |
There is only one caller in client_common.c, so open-code the logic
there and get rid of the public function and the unused error code.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This series implements a new memory allocation API which checks
for overflows. The first part of the series just renames the main
allocation functions. Later patches in the series implement allocators
which take two size_t arguments (like calloc(3)) and check whether the
multiplication overflows by employing the __builtin_mul_overflow()
primitive supported by gcc and clang. This requires us to bump the
lowest supported gcc and clang version.
* refs/heads/t/overflow:
build: Compile with -ftrapv.
string: Introduce arr_zalloc().
string: Introduce arr_alloc().
string: Introduce arr_realloc() and check for integer overflow.
string: Rename para_calloc() -> zalloc().
string: Rename para_malloc() -> alloc().
string: Overhaul para_strdup().
|
| | |
| |
| |
| |
| | |
Reword the documentation a bit since the function has never been a
wrapper for calloc(3). No code changes.
|
| | |
| |
| |
| |
| |
| |
| | |
Just because it's shorter and matches the naming of the new allocators
we are about to introduce. The bulk of this patch was created with
sed -i 's/para_malloc/alloc/g' *.c *.h yy/mp.y
|
| | |
| |
| |
| |
| |
| |
| | |
The word "monitor" is neutral and continues to be correct after the
switch from select(2) to poll(2).
Pure rename, nothing to see here.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This preparatory patch for replacing select() renames para_fd_set()
to sched_fd_set(), moves it to sched.c and makes it static. All
users are modified to call either of the two new public functions
sched_monitor_{read,write}fd() which take a pointer to struct sched
rather than an fd set pointer.
|
| | |
| |
| |
| |
| | |
Two trivial wrappers for FD_ISSET() which hide the fact that we're
still using the select(2) API.
|
| |/
|
|
|
|
|
|
|
|
| |
This parameter is not necessary because its only purpose is to
avoid the readv(2) system call in case it would likely return EAGAIN
because we just called select(2) which reported that there is no data
to read. Since the parameter is an obstacle for the conversion of
the code base from select(2) to poll(2), get rid of it for the time
being. If needed we can add back an equivalent optimization which
checks for POLLIN after the conversion.
|
| |
|
|
|
|
|
|
| |
Two small changes which improve the error output of para_audiod. The
first makes sure we get a message when hitting ctrl+c when audiod
is running in forground mode. The second decreases the severity of
the log message which is shown when a client connection terminates,
since this is not necessarily an error.
|
| |
|
|
|
|
|
|
|
|
|
| |
sha1 is broken and should no longer be used. This commit introduces
the new server feature "sha256". It is announced during the handshake
with the client. The client code is patched to detect whether the
server supports the feature and uses sha256 if it does.
This change is backwards compatible. That is, old clients can still
connect to a new server (using sha1). Also new clients can connect
to an old server (and also use sha1 in this case).
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Sideband connections and the AES-based stream cipher have become
mandatory in paraslash-0.6.
The server no longer needs to annouce the feature as 0.6.x clients
request it, regardless of whether it was announced or not. It needs
to still accept the option, though.
On the client side, we don't need to request the features any more
as the server just ignores the request.
|
| |
|
|
|
|
|
| |
It was outdated and not worded very well. In particular, it referred
to a task pointer although the argument is named "context". Also,
client_open() does not return a "client data structure", so talk
about the effect of that function rather than its return value.
|
| |
|
|
|
|
|
| |
Some (recent) gcc versions still complain because the switch case
falls through. The new code causes a warning on old compilers which
don't know the fallthrough attribute, but this is still better than
seeing the warning on systems with a recent compiler.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This series introduces lsu.c and lsu.h which contain helpers related to
the lopsub library. These helpers are designed to be shared between
the executables. The series starts by implementing a generic help
command for lopsub suites and converts para_server. Subsequent patches
convert audiod and para_play.
The second part of the series adds another lopsub related helper which
merges command line options and config file options. Each executable
is modified to make use of the new helper, getting rid of quite some
code duplication.
The conflict resolution for server.c has been tested for a while.
Cooking for five weeks.
* refs/heads/t/long-help:
play: Use lsu_merge_config_file_options().
mixer: Use lsu_merge_config_file_options().
gui: Use lsu_merge_config_file_options().
filter: Use lsu_merge_config_file_options().
audioc: Use lsu_merge_config_file_options().
audiod: Use lsu_merge_config_file_options().
client: Use lsu_merge_config_file_options().
lsu: Add helper to merge config file options, convert server.
Trivial: Rename completion_result variables.
play: Implement help --long.
audiod: Implement help --long.
Introduce lsu.{c,h}, implement help --long for para_server.
|
| | |
| |
| |
| |
| | |
The helper is a drop-in replacement for the old code. We only have
to include the lsu header and link with the object.
|
| |\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A couple of simple patches which clean up the openssl and gcrypt crypto
backends. The non-trivial parts are the get_public_key() unification,
the memory leak fixes for openssl and the activation of the secmem
pool for gcrypt.
* refs/heads/t/crypt:
gcrypt: Allocate a secmem pool at startup.
crypt: Introduce crypt_shutdown().
crypt: Rename init_random_seed_or_die() -> crypt_init().
gcrypt: Use ROUND_DOWN() macro.
crypt: Rename RSA functions.
crypt: Deduplicate get_public_key().
crypt.h: Remove two unused constants.
Rename crypt.c -> openssl.c.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This renames the functions and constants of the public crypto API
which deal with RSA to have the common "apc" (asymmetric pubkey
cryptosystem) prefix. This hides RSA as an implementation detail
and makes it clear that the functions/constants are related to apc.
Pure renaming, no semantic change. The only other changes are a new
comment to crypt.h and a \ref statement in the doxygen comment of
apc_free_pubkey().
|
| | |
| |
| |
| |
| | |
Currently we store a copy of the config file path in the client task
structure for no reason at all. Remove it.
|
| | |
| |
| |
| |
| | |
client_parse_config() returns an error code, so the caller is responsible
for printing a suitable error message.
|
| |/
|
|
|
|
|
|
|
|
|
| |
If --loglevel is given in the config file but not at the command line,
the value from the config file should be used. However, currently we
use the default value in this case. Moreover, client_parse_config()
sets the loglevel *after* it already printed some log messages.
This commit changes client_parse_config() to initialize the loglevel
pointer right after the command line and config file options have
been merged.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The GPLv2 line does not add any additional information, so drop
it. This leaves a single line of legalese text for most files, which
is about the amount of screen real estate it deserves.
This patch was created with the following script (plus some manual
fixups):
awk '{
if (NR <= 5) {
gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g")
if (gs != $0)
year = gs
next
}
if (NR == 6 && year != "")
printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year)
print
}'
|
| |
|
|
|
|
|
|
|
|
|
| |
This version of gcc complains because a case statement in
client_pre_select() may fall through. The fallthrough is intentional,
however, and this is annotated with a comment. gcc-7 scans the comments
in a switch statement and suppresses the warning if it recognizes
a comment which says that fallthrough is intended. But for this to
happen, we must spell it correctly, and without whitespace.
After this commit, gcc-7 compiles the tree with no warnings.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The bulk of the changes in this release is the conversion of all
command line parsers from gengetopt to lopsub.
The series also contains a few cleanups that have become possible
due to the switch from gengetopt to lopsub.
The patches towards the end of the series rename para_fade to
para_mixer.
Naturally, the merge conflicted rather heavily against the other
topic branches that have been merged since the lopsub branch was
started. Conflicting files:
Makefile.real afh.c afh_recv.c configure.ac osx_write.c write.c
The resolutions for these conflicts were recorded with git rerere
and have been tested for quite some time.
Cooking for three weeks.
* refs/heads/t/lopsub: (74 commits)
audioc: Avoid double free in audioc_i9e_line_handler().
audiod: Avoid uninitialized memory access.
Simplify mixer setup.
mixer: Implement non-linear time scale for fading.
mixer: Allow arbitrary relative time for sleep subcommand.
Convert para_fade to subcommands, rename it to para_mixer.
build: Create .dep files only during compilation.
build: Simplify definition of $m4_lls_deps.
build: Rename command list variables.
build: Combine $(CFLAGS) and $(STRICT_CFLAGS).
build: Let .d files depend only on .c.
build: Don't create phony targets for dependencies.
build: Remove duplicate dependency.
build: Remove cmdline_dir and friends.
build: Remove some unused variables from Makefile.real.
build: Remove m4/gengetopt.
Remove gengetopt and help2man checks from configure.ac.
Remove man_util.bash.
Remove ggo.c and ggo.h.
manual: Do not mention gengetopt and help2man any more.
...
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This replaces the gengetopt command line parser for para_client by a
lopsub suite and links para_client against the lopsub library. The ggo
file for para_client was the last user of m4/gengetopt/complete.m4,
so this file can be removed.
The tricky part is create_merged_lpr(), which replaces
make_client_argv(). It is called from the i9e line handler and from
the completers. The new function merges the original parse result
with the arguments given at the command line to produce the parse
result stored in the client task structure.
The completers no longer duplicate the possible options each server
subcommand because the header file generated by lopsubgen exposes
an array of string literals which is suitable as the opts argument
of i9e_complete_option().
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multiple vulnerabilities have been discovered in the RC4 stream cipher,
rendering it insecure. paraslash stopped using RC4 as the default
stream cipher since version 0.5.2 (2014-04-11), but server and client
still supported the broken cipher for backward compatibility. This
commit removes the compatibility code from both the openssl and
the libgcrypt code base, leaving aes_ctr128 as the only remaining
stream cipher.
The server still announces the aes_ctr128 feature, although it is now
mandatory because the server will enable aes_ctr128 unconditionally,
no matter whether it was requested by the client or not. The client,
on the other hand, still requests this feature, regardless of whether
it was announced by the server or not. This keeps unpatched clients =>
0.5.2 working with new servers and vice versa.
Regarding the public crypto API, sc_new() loses its boolean use_aes
parameter. Otherwise the API remains the same.
The patch also rewrites the crypto section of the manual to not
mention RC4 any more.
|
| |
|
|
|
|
|
|
| |
Sideband has become mandatory in paraslash-0.5.0, and the current
para_client does not work with older server versions anyway. Hence
this change has no impact on compatibility.
The E_INCOMPAT_FEAT error code is now unused and can be removed.
|