Deprecate openssl-1.0. These days everybody should have openssl-1.1 (released in 2016) or later. So warn if configure detects openssl-1.0 or earlier.
Merge branch 'refs/heads/t/poll' This series modifies all calls to select(2) to use poll(2) instead in order to avoid the known shortcomings of the select API, in particular its limit of at most 1024 file descriptors and the fact that fds above 1023 cannot be monitored with select(2) even if fewer than 1024 fds are open. The first patches of the series prepare this switch, converting the easy cases, hiding select specific data structures such as fd sets, and adjusting function names and documentation. The crucial commit is the last one. See its rather verbose log message for details. * refs/heads/t/poll: Switch from select(2) to poll(2). Rename ->{pre,post}_select methods to ->{pre,post}_monitor. Misc documentation cleanups related to select(). stdin/stdout: Streamline documentation of {pre,post}_select(). Consolidate receiver/filter/writer {pre,post}_select() docs. Hide implementation of para_fd_set(). send: Avoid select-specific arguments in {pre,post}_select(). sched: Introduce sched_{read,write}_ok(). audiod: Rename handle_connect(). net: Drop fd_set parameter from para_accept(). fd: Drop fd_set parameter from read_nonblock() and friends. interactive: Avoid select(2) in input_available(). fd.c: Prefer poll(2) over select(2) for write_ok(). sched: Use integer value for select timeout.
sched: Use integer value for select timeout. This modifies the public struct sched so that users pass in the default timeout as an integer value in milliseconds rather than a struct timeval. This simplifies the code a little and eases the transition from select(2) to poll(2) because poll(2) also takes a plain integer for the timeout. Since para_select() of fd.c now calls ms2tv() to convert the timeout back to a struct timeval, all executables which link with fd.o must also link with time.o. This was not the case for para_mixer and para_audioc, so configure.ac needs to be adjusted accordingly.
mp4: Wire it in and make it compile cleanly. This switches to our local copy of libmp4ff. The configure script now turns on support for the aac audio format even if libmp4ff is not installed. Some changes to mp4.c were necessary to silence warnings, most of which are trivial. The single notably non-trivial change is the missing initialization of chunk_sample and chunk in mp4ff_chunk_of_sample().
Merge branch 'refs/heads/t/sha256' A couple of changes which start to eliminate the use of sha1 in favor of sha256. This series is only the first step, though, as we need to keep sha1 for the time being to provide backward compatibility. Cooking for four months. * refs/heads/t/sha256: manual: Avoid sha1. upgrade_db: Add copyright and purpose to upgrade_db.c. web: Add link to the para_upgrade_db(1) man page. afs: Switch to sha256 and change default database path. Add para_upgrade_db. Use sha256 for the challenge response. Introduce hash2 (sha256). Assume sideband and aes_ctr128 are always supported/requested.
Merge branch 'refs/heads/t/rm_v1_moods' A single commit which removes a long obsolete feature. Cooking for almost a year. * refs/heads/t/rm_v1_moods: Remove support for version 1 moods.
Add para_upgrade_db. This new executable is required to convert existing paraslash databases to the new format. Only the layout of the audio file table changes due to the switch from sha1 to sha256. The command creates and opens a new audio file table and copies over each row, using an arbitrary (incorrect) hash value for the values in hash column of the destination table. After all rows have been copied in this way, the old table is deleted and the database directory is renamed from afs-database-0.4 to afs-database-0.7, which will be the default path in paraslash-0.7. Subsequent patches will modify para_server to load the database from the new path and use sha256 instead of sha1 for the hash that identifies the audio file. The user must then start the thusly patched para_server and force-add all audio files to correct the hashes. This approach keeps para_upgrade_db minimal and shortens its running time.
New configure option: --enable-ubsan. If the new option is given, -fsanitize=undefined is passed to the compiler to enable the undefined behavior detector. We don't check whether this option is supported because the configure option is off by default.
Remove support for version 1 moods. Version 2 moods were introduced in v0.6.1 which was released more than three years ago. Since then the older version 1 moods have been deprecated. This commit gets rid of them removing quite some questionable and unmaintained code.
openssl: Fix (harmless) memory leaks at exit. Without this, valgrind --leak-check=full --show-leak-kinds=all complains about four memory blocks reachable at exit, see below. The first leak is fixed by the new call to ERR_remove_thread_state(), which frees the error queue of the current thread. To squash the other three, the call to EVP_cleanup() is needed to remove all of openssl's internal ciphers and digests. To make this work on both openssl-1.0 and for openssl-1.1, we need to add additional header checks for configure. --- ==2818== 12 bytes in 1 blocks are still reachable in loss record 1 of 4 ==2818== at 0x40355EE: malloc (vg_replace_malloc.c:309) ==2818== by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x42459B7: lh_insert (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4248542: int_thread_set_item (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4249920: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x804F2E9: apc_priv_decrypt (openssl.c:206) ==2818== by 0x804DB59: client_post_select (client_common.c:321) ==2818== by 0x804CC57: call_post_select (sched.c:80) ==2818== by 0x804CC57: sched_post_select (sched.c:106) ==2818== by 0x804CC57: schedule (sched.c:159) ==2818== ==2818== 64 bytes in 1 blocks are still reachable in loss record 2 of 4 ==2818== at 0x40355EE: malloc (vg_replace_malloc.c:309) ==2818== by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4245643: lh_new (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x424811F: int_thread_get (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4248511: int_thread_set_item (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4249920: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x804F2E9: apc_priv_decrypt (openssl.c:206) ==2818== by 0x804DB59: client_post_select (client_common.c:321) ==2818== ==2818== 96 bytes in 1 blocks are still reachable in loss record 3 of 4 ==2818== at 0x40355EE: malloc (vg_replace_malloc.c:309) ==2818== by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4245628: lh_new (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x424811F: int_thread_get (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4248511: int_thread_set_item (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4249920: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x804F2E9: apc_priv_decrypt (openssl.c:206) ==2818== by 0x804DB59: client_post_select (client_common.c:321) ==2818== ==2818== 400 bytes in 1 blocks are still reachable in loss record 4 of 4 ==2818== at 0x40355EE: malloc (vg_replace_malloc.c:309) ==2818== by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x424988C: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0) ==2818== by 0x804F2E9: apc_priv_decrypt (openssl.c:206) ==2818== by 0x804DB59: client_post_select (client_common.c:321) ==2818== by 0x804CC57: call_post_select (sched.c:80) ==2818== by 0x804CC57: sched_post_select (sched.c:106) ==2818== by 0x804CC57: schedule (sched.c:159) ==2818== by 0x804AB2D: main (client.c:656)
build: Check also for CRYPTO_cleanup_all_ex_data. FreeBSD 12 does not seem to have it. This is not fatal since omitting the call to CRYPTO_cleanup_all_ex_data() just results in a harmless memory leak at exit.
build: Detect openssl library/header mismatch. This catches the case where openssl-1.0 headers are used for compiling but openssl-1.1 libraries for linking. Without the check that is added by this commit the compilation succeeds in this case but the executable segfaults on the attempt to modify the RSA structure directly. With the new check, configure fails gracefully. This happened on a FreeBSD system where the openssl-1.0 headers were installed in /usr/local and openssl-1.1 headers in /usr.
Merge branch 'refs/heads/t/long-help' 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.
mixer: Use lsu_merge_config_file_options(). para_mixer is special in the way the config file is handled because it is the only executable which allows options for subcommands to be stored in the config file. Therefore the mixer specific parse_and_merge_config_file() is called twice. First to merge the global (supercommand) options, then to merge the subcommand options. This does not cause any problems regarding the conversion, though.
gui: Use lsu_merge_config_file_options(). para_gui supports config file reloading, so parse_config_file_or_die() needs to set MCF_DONT_FREE to keep a reference to the command line parse result and MCF_OVERRIDE in the reload case. Also, the code to check the key maps and to initialize the theme needs to be kept.
filter: Use lsu_merge_config_file_options(). Straight forward conversion. We now set the loglevel only once, after the config file options have been merged.
audioc: Use lsu_merge_config_file_options(). This gets rid of the pointless configfile_exists() and the equally pointless cmd variable.
client: Use lsu_merge_config_file_options(). The helper is a drop-in replacement for the old code. We only have to include the lsu header and link with the object.
play: Implement help --long. Also para_play benefits from the conversion to the generic lsu_com_help(). After this patch, the three help commands of server, audiod and play have the same syntax and their output is formatted in the same way.
audiod: Implement help --long. This converts the help command of para_audiod to the generic lsu_com_help(), adding --long and removing quite a few lines of duplicated code. This patch also touches audioc.c since para_audioc needs to learn to complete the new --long option. Moreover the help text of the help command is made a bit more useful.