Andre Noll [Fri, 2 Oct 2015 02:34:53 +0000 (02:34 +0000)]
afs.c: Remove compatibility code in action_if_pattern_matches().
This is no longer needed as there are no more non-lopsub
commands left. Now pmd->lpr is non-NULL for all commands which
call action_if_pattern_matches(), which allows to simplify the
function. Moreover, ->patterns of struct pattern_match_data is unused
and can be dropped.
Andre Noll [Sun, 22 May 2016 11:37:48 +0000 (13:37 +0200)]
server: Remove ->argc, ->argv from struct command_context.
Command handlers should not look at the argv[] vector directly
but only use the lopsub library functions to access the parsed
command line.
In fact, the only function which accesses the argv vector is
run_command(). Defining argc and argv as local variables in this
function allows to drop the two members from the command context
structure.
Andre Noll [Sun, 31 Jul 2016 08:32:57 +0000 (10:32 +0200)]
server: Remove support for non-lopsub commands.
Now that all commands have been converted to lopsub, struct
server_command is no longer needed and can be removed, along with
the helper functions for lookup and permission checking.
Andre Noll [Sun, 6 Sep 2015 19:01:41 +0000 (21:01 +0200)]
afs: Remove unused call_callback helpers.
send_option_arg_callback_request() and send_standard_callback_request()
have both become unused now that all server commands have been
converted to lopsub. This patch gets rid of these functions and
removes their declarations from afs.h.
Andre Noll [Mon, 5 Sep 2016 15:34:53 +0000 (17:34 +0200)]
Enable partial matching for server commands.
The feature was deactivated in an earlier commit which converted the
lsatt command to lopsub. The problem was that "ls" would have been
interpreted as lsatt because lsatt was the only converted command
that started with ls.
Now that all server commands are converted, the lopsub library function
lls_lookup_subcmd() does the right thing, so this patch removes the
additional test for an exact match.
Andre Noll [Sun, 27 Dec 2015 22:04:29 +0000 (22:04 +0000)]
server: Convert com_ls() to lopsub.
This is the final server command to be converted to the lopsub API.
Besides the conversion to lopsub, the patch changes the semantics
of the ls command in two ways: The deprecated -p option is removed,
and the -F option is made the default so that full paths are printed
if -b is not given.
Regarding the conversion, the patch removes enum ls_flags which used to
contain the various flags of the ls command. This information can now
be extracted in the callback from the deserialized parse result. Also
write_score() is kind of pointless and is replaced by inlining it.
Note that make_status_items() is also affected by this patch because
it makes use of the infrastructure of the ls command. This function
is called from the event handler of the audio file table for events
of type AFSI_CHANGE and AFHI_CHANGE.
Since no more non-lopsub server commands are left after this patch,
several cleanups are possible. These are dealt with in subsequent
patches.
Andre Noll [Sun, 20 Mar 2016 18:41:25 +0000 (18:41 +0000)]
server: Convert blob commands to lopsub.
This converts all blob commands (ls, cat rm, mv) in one go to lopsub,
making the patch rather large.
The addblob commands are special in that we must pass not only the
blob name given at the command line to the callback but also the
blob data which was read from stdin. The command handler does not
serialize the parse result like most other commands do, but constructs
a query object containing name and data for the callback. Therefore
the command handler does not call send_lls_callback_request() but
send_callback_request(). We continue to follow this scheme.
blob.c contains a few macros which expand to a set of functions,
one for each type of bloc (mood, playlist, image, lyrics). These
macros have to be adjusted to take another argument because we need
the prefixes (e.g., lyr for lyrics) in both upper and lower case and
there is no preprocessor toupper().
Andre Noll [Fri, 2 Oct 2015 21:13:33 +0000 (21:13 +0000)]
server: Convert com_addatt() to lopsub.
Another simple command without options which is easy to convert. The
only thing worth noting is that we now fail the command early if more
than 64 arguments are given when previously we only checked that at
least one argument is given.
Andre Noll [Fri, 2 Oct 2015 21:10:36 +0000 (21:10 +0000)]
server: Convert com_touch() to lopsub.
Another open-coded option parser bites the dust.
This also gets rid of struct com_touch_options, along with the ugly
convention of passing -1 to the action handler to indicate that the
option was not given.
The documentation was enhanced slightly and now explains in the
[description] section the general concept of the touch command.
Andre Noll [Fri, 2 Oct 2015 21:15:06 +0000 (21:15 +0000)]
server: Convert com_select() to lopsub.
Pretty straight-forward conversion since the command does not have
any arguments. In the callback handler, we we can't return directly
any more since we need to free the serialized parse result.
Andre Noll [Sun, 11 Oct 2015 00:17:55 +0000 (00:17 +0000)]
server: Convert com_rm() to lopsub.
This gets rid of the open-coded command line parser in com_rm() and
of enum rm_flags. Patterns are now passed to for_each_matching_row()
and from there to the action handler remove_audio_file() via ->lpr
of struct pattern_match_data.
Andre Noll [Fri, 2 Oct 2015 21:17:09 +0000 (21:17 +0000)]
server: Convert com_cpsi() to lopsub.
Allows to get rid of enum cpsi_flags as we pass the flags via the
serialized parse result to the callback and the action handler
(copy_selector_info()).
Also the open-coded command line parser in com_cpsi() can be removed.
Andre Noll [Fri, 2 Oct 2015 21:21:11 +0000 (21:21 +0000)]
server: Convert com_mvatt() to lopsub.
We need to cast the obj->data pointer to a non-constant type because
the osl library functions expect void *, which results in a warning
without the cast.
Andre Noll [Fri, 2 Oct 2015 21:22:01 +0000 (21:22 +0000)]
server: Convert com_setatt() to lopsub.
Introduces ->input_skip for struct pattern_match data. The setatt
command uses this to strip the attribute modifies off the unnamed
arguments in the lopsub parse result. The remaining arguments are
the patterns which are to be matched against each file in the audio
file table.
Andre Noll [Sun, 20 Mar 2016 18:40:19 +0000 (18:40 +0000)]
server: Convert com_lsatt() to lopsub.
This is the first afs subcommand which needs to pass a pattern list
to its callback. The new send_lls_callback_request() provides this
functionality. It serializes the parse result into a buffer and passes
this buffer to the callback.
Since there are non-lopsub commands which also pass a pattern list,
action_if_pattern_matches() is patched to receive the pattern
list either from the serialized parse result or in the old way via
pmd->data. To achieve this, a parse result pointer is added to struct
pattern_match_data. If this pointer is not NULL, we are dealing with
a subcommand that has been converted.
Since the ls subcommand has not been converted yet, lopsub will
regard "ls" as a uniqe abbreviation of the lsatt command, which
breaks t0004. To work around this, we deactivate prefix matching by
only accepting exact matches in run_command(). This workaround can
be removed after com_ls() has been converted.
Andre Noll [Fri, 2 Oct 2015 21:23:54 +0000 (21:23 +0000)]
server: Convert com_init() to lopsub.
No change necessary for the callback as the init command does
not have any options. The only information that must travel from the
command handler to the callback is the set of tables to create. The
corresponding bitmask is passed without serializing the parse result.
Andre Noll [Sun, 15 May 2016 16:53:50 +0000 (18:53 +0200)]
server: Convert com_add() to lopsub.
In the callback structure for the add command, replace the flags
field by the serialized callback result. This way the callback
has access to the full parse result structure.
Andre Noll [Sun, 12 Jun 2016 13:36:21 +0000 (15:36 +0200)]
server: Convert non-afs commands to lopsub.
Currently the server commands are divided into two group: those
commands which are handled by the server process and those which
communicate with the afs process. This commit converts the commands of
the former group and the corresponding completers for para_client to
the lopsub suite format while the afs commands will be converted in
subsequent commits. After this change para_server needs to be linked
with -llopsub.
To this aim the options and help texts of of the server commands are
transferred from server.cmd to the new server_cmd.suite.m4, enabling
long-style options in the progress. Moreover, an introduction is added
at the beginning of the list of server commands which describes how
server commands are executed.
Command permissions are now handled by making use of the aux_info
feature of lopsub. To keep those commands working which do not
have any permission bit set, we need to add a new identifier
NO_PERMISSION_REQUIRED to enum server_command_permissions of
user_list.h. The value of this identifier is zero of course.
Naturally the bulk of the change takes place in command.c where all
server commands are implemented. The command handlers are modified
to take a pointer to a struct lls_parse result as an additional
argument. A new helper, send_errctx(), is introduced to avoid code
duplication.
Since command.h now refers to a lopsub parse result, all files which
include command.h, including those which implement only afs commands,
need to include the system header lopsub.h.
To keep afs commands working, some compatibility code in run_command()
is added. This will go away after all commands have been converted.
A couple of macros in command.h ease the handling of the long symbolic
constants exposed by the generated lopsub header file.
Although only the non-afs commands are converted, the change allows
for a couple of cleanups:
* The E_BAD_COMMAND error code is no longer needed and has been
removed.
* cmd_perms_itohuman() has become unused and is removed.
* The server_cmds[] array is empty and can be removed, along
with the loop in send_list_of_commands() which iterated over
the array.
The patch also adjusts tests t0004 and t0005 since the help output
format changed slightly, breaking the expectations of these tests.
Andre Noll [Sat, 7 May 2016 08:59:01 +0000 (10:59 +0200)]
Convert audiod commands to lopsub.
The four command lists (server, afs, audiod, play) and all executables
will be converted to the long option parser library (lopsub). This
first patch converts the audiod commands (on, off, cycle...) and adds
the necessary infrastructure to the build system. The option parser
for para_audiod is still generated by gengetopt and will be converted
in a subsequent patch.
The build system is updated to include an autoconf test which
checks for the lopsub library and the lopsubgen executable. If the
check fails, it prints instructions on how to download the lopsub
package. Moreover, a section on lopsub is added to the INSTALL file
and the library is listed as a required tool in the manual.
The options and help texts of all audiod commands are moved from
audiod.cmd to the new file audiod_cmd.suite.m4. Until all command
lists are converted, man_util.bash needs an ugly hack to deal with
the two kinds of files.
The help texts have been reworked slightly, but no syntactical
changes were performed. However, one side effect of the change is
that options to audiod commands now accept short and long options,
and that short options may be combined in the usual way.
The error subsystem of paraslash is extended to treat lopsub errors
analogous to errors from the osl libary: we reserve a new bit for
error codes returned from lopsub library functions and a lls() wrapper
function that must be used for all lopsub functions which return a
lopsub error code on failure. The E_INVALID_AUDIOD_CMD error code
can be removed since invalid commands are now detected by the lopsub
library, which returns its own error code in this case.
As a result of the conversion, struct audiod_command can be removed.
Command handlers now take a pointer to a lopsub parse result instead
of the (argc, argv) pair.
The patch also changes the completers for audiod commands in
audioc.c. to use the information in the generated audioc_cmd.lsg.h
header file instead of duplicating this information.
With the patch applied, para_audiod and para_audioc need to be linked
with -llopsub.
We still need to include ggo.h from audiod_command.c until receivers,
filters and writers have been converted as well.
Andre Noll [Sat, 28 Jan 2017 17:02:33 +0000 (18:02 +0100)]
wmadec: Use read_u32_be().
The shift operation in show_bits() was buggy because p[0] is promoted
to int, and the shift p[0] << 24 results in undefined behavior,
causing the sanitizer of gcc to complain:
bitstream.h:40:21: runtime error: left shift of 230 by 24 places cannot be represented in type 'int'
Andre Noll [Sat, 7 Jan 2017 15:12:05 +0000 (16:12 +0100)]
imdct.c: Replace pointless macro PASS.
The macro defines pass(), a function with only a single caller. We
may as well define the function directly, improving readability and
enabling proper syntax colors.
Andre Noll [Fri, 18 Apr 2014 00:12:40 +0000 (00:12 +0000)]
aacdec: Combine aac_open() and aacdec_open().
Both functions are short, and they are only called once at
startup. Thus, there is no reason to spread out the initialization
over two functions, so let's combine them.
Andre Noll [Sat, 24 Dec 2016 16:41:00 +0000 (17:41 +0100)]
aacdec: Improve and silence error message.
Most errors from NeAACDecDecode() can be handled gracefully. This
patch downgrades the severity level of the corresponding log messages
from ERROR to NOTICE and explains the meaning of the three numbers
of the second log message.
Andre Noll [Sat, 31 Dec 2016 01:39:16 +0000 (02:39 +0100)]
aacdec: Prefer NeAACDecInit() over NeAACDecInit2().
The aac decoder tries to parse the length of the decoder configuration
from the esds atom and passes this information to NeAACDecInit2(). If
we can not figure out the length, we fall back to NeAACDecInit(),
which does not receive the decoder length as a parameter. This is
unnecessary because NeAACDecInit2() is only necessary for decoding
mp4 files, while both para_afh and para_server feed demultiplexed
aac frames to the decoder.
Calling NeAACDecInit() unconditionally allows to get rid of the
code which detects and parses the esds atom.
Andre Noll [Sun, 6 Apr 2014 10:13:10 +0000 (12:13 +0200)]
aacdec: Don't eat full buffer on errors.
On decoding errors, if the call to NeAACDecDecode() did not consume
anything from the input buffer, we currently throw away the full
buffer. This does not necessarily improve matters, so let's just eat
one byte and hope that subsequent calls succeed.
Andre Noll [Thu, 17 Mar 2016 20:59:52 +0000 (21:59 +0100)]
Combine aacdec and aac_common.
With the server side switched to libmp4ff, only the aac decoder needs
the public functions in aac_common. This patch moves this file into
aacdec_filter.c, makes the functions static and removes the aac.h
header file which only contained the prototypes of the previously
public functions.
Makefile.real, configure.ac and error.h need small adjustments due
to the removal of aac_common.c.
Andre Noll [Sat, 24 Dec 2016 15:02:44 +0000 (16:02 +0100)]
Convert the aac audio format handler to libmp4ff.
This changes the aac audio format handler to call the primitives
provided by the mp4ff library. This allows to remove the atom parsing
code from aac_afh.c.
After this change para_server, para_afh, and para_recv no longer
depend on aac_common.c and on the mp4v2 library. The autoconf tests
for libmp4v2 are removed from configure.ac. A subsequent commit will
deal with aac_common.c.
Andre Noll [Sat, 24 Dec 2016 15:02:36 +0000 (16:02 +0100)]
aac_afh: Don't create chunk tables any more.
A previous commit activated dynamic chunks for the aac audio format
handler, so the virtual streaming system no longer consults the chunk
table stored in the audio file table of the osl database.
However, the code to open or add an audio file still assumes that
there is a chunk table and bails out if it can't find it. This patch
changes aft.c to do without a chunk table if the audio format handler
supports dynamic chunks. The afh_supports_dynamic_chunks() helper
needs to be made public because of this.
With chunk tables being optional, the ->get_file_info method of the
audio format handler can safely set ->chunk_table to NULL. It still
needs to compute the maximum chunk size though.
Andre Noll [Wed, 21 Dec 2016 23:57:15 +0000 (00:57 +0100)]
afh: Dynamic chunks.
paraslash chunk tables were designed long ago with the idea that the
full audio file, with the exception of a potential header, is going
to be sent to the client. This allows to store a sequence of offsets
as the chunk table. Each chunk is defined as the contiguous region
of the file given by two consecutive offsets.
For most audio formats, however, not every part of the file corresponds
to encoded audio. We work around this on the client side by letting
the filters detect and skip those parts which can not be fed to
the decoder.
This works generally well, but for the aac decoder we have a rather
ugly hack that skips over any non aac decoded data of its input. This
hack was never very reliable, and the concept of dynamic chunks
finally allows to get rid of it.
Dynamic chunks work as follows. Each audio format handler signifies
support by defining the new ->get_chunk method. In this case
afh_get_chunk() no longer consults the chunk table at all but calls
the new method instead in order to obtain a reference to the chunk.
This comes with a certain overhead at runtime because we need to call
into the functions of the mp4ff library (ships together with faad)
rather looking up the offset in the chunk table.
Only the aac audio format handler supports dynamic chunks per this
commit. To keep the patch size relatively small, this commit does not
touch ->get_file_info() of the aac audio format handler. Therefore,
when a new m4a file is added to the database, the aac audio format
handler still creates the chunk table. A subsequent commit will turn
off this unnecessary operation.
The documentation is updated to mention that mp4ff is now required
for the aac audio format handler. The configure script now checks
for the mp4ff header and the library and deactivates aac support if
it was not found.
Andre Noll [Fri, 23 Dec 2016 16:18:21 +0000 (17:18 +0100)]
server: Store max chunk size in database.
This number is needed up-front for the initialization of the fec data
structures. Currently we recompute it from the chunk table each time
the file is opened for streaming.
We can only get rid of the chunk table concept if we tell the VSS by
other means how to obtain this information.
Fortunately there is an unused 4-byte field in the on-disk afhi
structure, which is always zero at the moment. This patch starts to
use this field to store the maximal chunk size.
For backwards compatibility, when the afhi structure is loaded from
disk at stream time, we check if the field is zero and recompute the
max chunk size as before in this case.
Although the maximal chunk size is generally only needed on the
server side, for consistence we expose it though a new status item
along with chunk_tv and friends.
Andre Noll [Wed, 21 Dec 2016 12:58:28 +0000 (13:58 +0100)]
server: Move ->size from mmd to struct vss_task.
This field stores the size of the memory mapping of the current audio
file, if any. No command handler ever changes the value, and the
value is not read from com_stat(), so there is no reason for ->size
to be part of the mmd shared memory area.
Unlike ->size, the pointer to the mapping is stored in struct vss_task.
Given that vss.c is the only file which reads ->map or ->size, it
makes sense to store both values together in the vss task struct.
Both callers pass a buffer to load_chunk_table() to initialize
afhi->chunk_table. The function does not check the size of the passed
buffer but relies on afhi->chunks_total to tell how many values to
copy from the buffer.
In other words, the buffer size gives an upper bound for the number of
chunks in the chunk table, but this bould is not checked. This patch
makes the code more robust by adding a suitable check. To this aim,
load_chunk_table() is changed to receive a pointer to an osl object
(which contains the buffer size) rather than only the buffer.
One caller, load_afd(), initializes the chunk table from a shared
memory area buffer. It does not know or care about the buffer size
so far. We introduce the the new IPC helper shm_size() to let it tell
the size of the area and pass it to load_chunk_table().
Andre Noll [Thu, 22 Dec 2016 01:38:05 +0000 (02:38 +0100)]
para_server: Never read past the end of the chunk table.
If the server command "ls" is executed with the -c option to print
the chunk table, we assume that afhi->chunks_total many chunks are
stored in the osl disk object that represents the chunk table.
This should be true in general, but since we also know the size of
the osl object, it does not hurt to check this bound as well and
break out of the loop if the next read would access memory beyond
the end of the object.
Andre Noll [Sat, 28 Jan 2017 18:33:26 +0000 (19:33 +0100)]
i9e: Restore file status flags on exit.
The i9e subsystem sets the stdin and stdout fds passed to i9e_open()
to nonblocking mode but misses to restore the original flags in
i9e_close(). This causes terminal applications like dialog to fail
if they are started in the same terminal after e.g. para_play was
executed.
This commit modifies i9e_open() to fetch and save the file status
flags before setting the O_NONBLOCK flag, and i9e_close() to restore
the original value. STDERR is not affected.
Andre Noll [Mon, 18 Jul 2016 21:35:48 +0000 (23:35 +0200)]
Remove compatibility code for abstract unix domain sockets.
Abstract sockets were introduced in paraslash-0.5.5 (2015-09-20). For
backwards compatibility, create_local_socket() was modified to create
an abtract socket *and* an ordinary pathname socket so that old audiod
clients (which connect to the pathname socket) would still work.
This patch breaks compatibility by going back to a single socket,
either abstract (Linux) or pathname (all other systems), as determined
in the first call to create_local_socket(). This allows to drop the
"abstract" argument of init_unix_addr() and the "mode" argument of
create_local_socket().
The code in net.c and the callers get quite a bit shorter since it
has to deal with only a single file descriptor and one type of socket.
Andre Noll [Mon, 22 Aug 2016 15:36:05 +0000 (17:36 +0200)]
build: Add target "check" as a synonym for "test".
make check seems to be more common than make test, and "check" is the
recommended name according to the GNU standards. This patch teaches
the build system to support both targets. It also marks the test-clean,
check and test targets as phony.
Andre Noll [Mon, 18 Jul 2016 16:49:31 +0000 (18:49 +0200)]
build: Do not strip installed executables by default.
The "install" target currently strips all executables while installing
them, which is not recommended according to GNU conventions. Instead,
there should exist the "install-strip" target for this purpose.
Moreover, the current install target assumes the GNU variant of
the install utility because we call install with --strip-program,
an option which is not available on *BSD.
This patch addresses both issues. It removes the autoconf check and
lets the user directly define the path to the install executable by
setting INSTALL, INSTALL_PROGRAM, INSTALL_DATA, as recommended by the
GNU project. These variables are used in the commands to be executed
when the install target is made. They have reasonable and portable
defaults, so not setting them at all should be fine on all supported
platforms, addressing the issue with --strip-program.
The new phony target install-strip runs install -s but does not try
to be smart about how to tell the install implementation which strip
program to use.
The cross compiling example can be simplified to reflect the fact
that CROSS_COMPILE is no longer used in the Makefile.
Andre Noll [Sun, 17 Jul 2016 19:27:12 +0000 (21:27 +0200)]
build: Support $(DESTDIR).
The DESTDIR feature is orthogonal to the existing --prefix option
to configure, and the GNU make manual strongly recommends to support
the feature, so this patch implements it.
The feature works as follows. The content of the DESTDIR make variable
is prepended to each installed target file. It is not set at all in
the Makefile, so files are installed into their expected locations by
default. For example, with the patch applied, one may say
make DESTDIR=/tmp/stage install
to install in /tmp/stage/usr/local.
Other than that, specifying DESTDIR has no effect and the value is
not included in any file contents.
Andre Noll [Tue, 12 Jul 2016 19:56:13 +0000 (21:56 +0200)]
build: Rename clean targets.
The documentation of gnu make recommends to have targets called
mostlyclean, clean, distclean and maintainer-clean while we have clean,
clean2, distclean and maintainer clean.
This patch adds mostlyclean and removes clean2. The former target
removes the executables and all object files, clean additionally
removes the whole build directory and distclean removes, on top of
that, all files created by autoconf. Finally, maintainer-clean removes
the tarball and the files created by doxygen and global.
Andre Noll [Wed, 24 Aug 2016 13:12:53 +0000 (15:12 +0200)]
crypt: Remove RC4 support.
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.
Andre Noll [Sun, 10 Jul 2016 14:15:37 +0000 (16:15 +0200)]
gcrypt: Remove open-coded OAEP padding.
The open-coded OAEP padding implementaton of gcrypt.c was necessary to
support old libgcrypt versions which do not have the oaep flag. These
days, everybody ought to have moved on to 1.5.0 (released 2011)
or later, so lets require this version from now on.
decode_rsa() used its key_size parameter only for old gcrypt versions,
so the parameter can be removed. Also, the E_MPI_PRINT error code
has become unused and can be removed from error.h.
Since rsa_decrypt_sexp is now constant, there is no need to have a
variable for this, so we can make it a preprocessor definition instead.
Andre Noll [Tue, 12 Jul 2016 17:54:19 +0000 (19:54 +0200)]
crypto: Remove support for ASN public keys.
These have been deprecated for some years in favor of ssh keys
generated with ssh-keygen(1). Removing support for the deprecated
format allows to get rid of quite some ugly ASN parsing code.
Private ASN keys, however, still need to be parsed in case
libgcrypt is employed as the crypto API. So the parser in
find_privkey_bignum_offset() needs to stay.
Andre Noll [Sun, 10 Jul 2016 20:23:45 +0000 (22:23 +0200)]
crypto: Simplify asymetric key handling.
get_asymmetric_key() and free_asymmetric_key() are public because
para_server maintains a copy to the public key of each user so that
the keys need to be loaded only once. On the other hand, for private
keys (used in para_client) key allocation and freeing is performed
implicitly in priv_decrypt(), and no reference to the key is ever
returned. So the crypto API can be simplified by exposing the interface
only for public keys.
Hence this patch renames get_asymmetric_key() to get_public_key()
and drops the "private" argument. Similarly, free_asymmetric_key()
is renamed to free_public_key().
For public keys the function only called stat(2), which is unnecessary
because only an error from the subsequent open(2) call requires to
fail the operation.
The stat() call is needed for loading private keys though, to make
sure permissions are restrictive enough.
This commit renames the function as indicated in the subject and
drops the second parameter. In crypt.c we now call this function for
private keys only.
Andre Noll [Sun, 10 Jul 2016 20:20:03 +0000 (22:20 +0200)]
gcrypt.c: Always initialize result pointer in get_private_key().
This should not matter since the only caller, priv_decrypt(), returns
without investigating the result pointer on errors, but let's be
conservative here.
Andre Noll [Mon, 26 Dec 2016 15:16:36 +0000 (16:16 +0100)]
build: Remove compatibility check for clock_gettime().
Only Mac OS (which is no longer supported) did not have it. Moreover,
on Linux we used to check whether one needs to link with -lrt to
obtain clock_gettime(), which is necessary for glibc versions 2.16
and earlier (released in 2012). All distributions should have moved
on to newer glibc versions by now, so let's get rid of the check.
Andre Noll [Mon, 18 Jul 2016 18:50:41 +0000 (20:50 +0200)]
Drop support for Mac OS.
This software hasn't been tested on Mac OS for years, so Mac OS
support is most likely already broken.
This commit removes the osx writer and the autoconf tests for core
audio, and adjusts the documentation to not mention Mac OS anymore. It
also effectively reverts commit be1074b4 which introduced an ugly
workaround in interactive.c that was only needed on Mac OS.
Andre Noll [Sat, 31 Dec 2016 20:12:33 +0000 (21:12 +0100)]
Merge branch 'maint'
A trivial conflict in configure.ac and remove/modify conflicts in
web/index.in.html and NEWS. The last file has been renamed to NEWS.md
in master. The conflict was resolved by copying the new text of the
NEWS file from maint (the release notes for v0.4.14) to NEWS.md and
to adjust the formatting to markdown syntax.
Andre Noll [Sat, 31 Dec 2016 15:50:02 +0000 (16:50 +0100)]
Merge branch 'refs/heads/t/simple_error_codes'
Two patches which get rid of the concept of per-subsystem error
codes. The host-compiled error2.c program can be removed, configure.ac
and error.h simplified.
The merge conflicted because both sides modified error.h, but this
was easy to resolve.
* refs/heads/t/simple_error_codes:
Sort errors alphabetically.
Simplify the error subsystem, get rid of error2.[ch].
Andre Noll [Fri, 30 Dec 2016 14:58:41 +0000 (15:58 +0100)]
Merge branch 'refs/heads/t/invalid-ids'
A single patch that was in misc for a while, and two follow up fixups
that were detected after the branch was merged into next.
* refs/heads/t/invalid-ids (cooking for two weeks):
Makefile: Don't compile with -Wformat-signedness unconditionally.
aft.c: Use correct format string for error output.
touch: Refuse to set an invalid image or lyrics ID.
Andre Noll [Wed, 28 Dec 2016 20:40:42 +0000 (21:40 +0100)]
t0004: Specify proper options for ls commands.
The -p option is deprecated, and the default behaviour (if none of -p,
-F and -b is given) will change in v0.6.0. Although the tests succeed
at the moment, it seems prudent to switch to the modern syntax to
make sure the tests won't break when -p is removed and the default
behaviour is changed.
Andre Noll [Wed, 28 Dec 2016 19:38:34 +0000 (20:38 +0100)]
Merge branch 'refs/heads/t/format-signedness'
This series fixes all warnings produced by compiling with
-Wformat-signedness and adds the flag to CFLAGS if the compiler
supports it.
* refs/heads/t/format-signedness (cooking for ~2 weeks):
gcrypt: Fix a few format-signedness issues.
Compile with -Wformat-signedness if possible.
Fix signedness issues in format strings.
Andre Noll [Tue, 27 Dec 2016 18:29:38 +0000 (19:29 +0100)]
resample: Simplify initialization().
In resample_init(), the first check removed in this commit was bogus
because in case there is no parent buffer tree node, we must only
abort if there is no input pending either.
In resample_post_select(), we move up the check of the node status
so that we now call resample_init() only after we know that there
is input available. This makes the second check in resample_init()
pointless as the condition can never be true.
Andre Noll [Wed, 28 Dec 2016 01:08:54 +0000 (02:08 +0100)]
fade: Add documentation for main() and include it in doxygen.
The two mixer implementations for OSS and ALSA are also included,
both of which are only used by para_fade. So it makes sense to include
para_fade as well. main() is the only a non-static function, so let's
doxify that.
Andre Noll [Wed, 28 Dec 2016 12:05:34 +0000 (13:05 +0100)]
Merge branch 'refs/heads/t/wma_fixes'
The series also contains a fix for a silly bug which causes the decoder
to abort on empty output sizes, and a couple of cosmetic cleanups.
* refs/heads/t/wma_fixes (cooking for two weeks):
wmadec: Remove two pointless variables.
wmadec: Remove a pointless cast.
wmadec: Set data size to 0 if nothing was decoded.
wma: Fix packet size calculation.
wmadec: Properly handle empty outputs.
wma_common: Fix typo in log message.
Andre Noll [Tue, 27 Dec 2016 15:29:29 +0000 (16:29 +0100)]
Merge branch 'refs/heads/t/openssl-1.1'
In openssl-1.1 several structures have been made opaque, breaking both
the stream cipher and the public key functions in crypt.c. This series
deals with these issues, trying to minimize the ifdeffery.
* refs/heads/t/openssl-1.1 (cooking for three months):
openssl: RSA fixes for openssl-1.1.
openssl: Use EVP API for AES.