| Commit message (Collapse) | Author | Age |
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902019 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
thread_local variables are not (always?) reset on fork(), so APR (and the
user) needs a way to set the current_thread to NULL.
Use apr_thread_current_after_fork() in apr_proc_fork()'s child process.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897470 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make cprng_stream_ctx_bytes() rekey in any case, this is exactly what we need
both when generating pooled random bytes and when handling fork() the parent
and child key should not leak to each other.
There is no use case for a keystream without setting the key first and burning
it afterward, and there shouldn't be.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834600 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rework apr_crypto_prng_after_fork() which now handles rekeying of all the
CPRNGs created within apr_crypto, by maintaining them in a global APR_RING,
with the notable exception of per-thread ones (never forked).
For each maintained CPRNG, apr_crypto_prng_after_fork() will now first rekey
both the parent and child processes (determined by the 'in_child' argument
provided by the caller), and for the parent only rekey a second time so that
the initial states finally differ for both processes. Once these new keys are
committed to their respective CPRNGs, thanks to and in continuity with the
forward secrecy construct of apr_crypto_prng, there will be no in memory key
material or stream that one process can inherit or infer from the other.
The user can also rekey a CPRNG explicitely by calling the new function
apr_crypto_prng_rekey(), and this is done by apr_fork() implicitely before
forking any child, thus for the parent process. This safe guard ensures both
the clearing of the pooled random bytes (buffered keystream) and the renewal
of key material (cheap and preventive against _atfork() handlers or alike).
Rekeying is done by using each CPRNG's keystream directly, there isn't anymore
the use of a PID (or SHA256 thereof) for children processes nor any extra reads
from the system RNG. All the apr_crypto_prng API is now self contained and can
work entirely with a single stream cipher as primitive (Chacha20 or AES256-CTR,
in that order of availability) and the initial entropy of 32 bytes gathered
from the system. IOW, there is only one call issued to the system RNG for the
global CPRNG's initial key, and if more CPRNGs are created their own initial
key is produced by the global CPRNG.
The KAT arrays in the tests suite needed adjustment too because the initial
seed (if provided, like the zeros-input for the KAT) is no more used directly
as the first key. Instead the first 32 bytes of the keystream generated from
the seed are, and the seed (like any just used key) is then cleared immediatly
from internal memory.
Finally some private APR_CRYPTO_PRNG_* macros (in .c file only) are renamed to
CPRNG_* to shorten colomns and avoid multilines in several cases.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834551 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833382 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New apr_crypto_prng API and apr_crypto[_thread]_random_bytes() functions.
Allows to generate cryptographically secure random bytes indefinitely
given an initial seed of APR_CRYPTO_PRNG_SEED_SIZE bytes (32), which
is either provided by the caller or automatically gathered from the system.
The CPRNG can also be re-seeded at any time, or after a process is fork()ed.
The internal key is renewed every APR_CRYPTO_PRNG_SEED_SIZE random
bytes produced and those data once returned to the caller are cleared from
the internal state, which ensures forward secrecy.
This CPRNG is fast, based on a stream cipher, and will never block besides
the initial seed or any reseed if it depends on the system entropy.
Finally, it can be used either globally (locked in multithread environment),
per-thread (a lock free instance is automatically created for each thread on
first use), or created as standalone instance (manageable independently).
For now it's only implemented with the OpenSSL library as underlying crypto,
that is --with-crypto --with-openssl needs to be configured, and the latter
links libcrypto with APR.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833359 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Set the proc->pid field to the pid of the newly created child.
Note that a mere pid value provides little entropy to mix into
the child random pool.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1198860 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
already has the correct FD.
PR: 51995
Submitted by: Dan Ports <drkp csail mit edu>]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183685 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078655 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
- error handling issues
- use of uninitialized data
- null pointer dereference
- unused variables
- memory/fd leaks
- broken code in threadproc/beos/proc.c
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979891 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
cases for stdout and stdin.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@783398 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@747357 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
On posix make unique tmp name and add that to child environment.
The env var name made of child making it almost unique for that process instance
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@747042 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746589 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@741867 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@741862 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the pipe to uninherited. Let it be closed upon cleanup_for_exec.
The later dup2() for the parent pipe does not automagically become inherited
again, and later dup()'s are never inherited by default.
There's no longer an explicit need to close the parent-end in proc_create
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584570 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inherited. Solve this by setting the duplicated handle to inherit.
once finished with the fork(), now that we don't waste pipe creation
resources on a single handle, watch out for closing the parent handle
inside the child.
in fact I believe that toggling parent_* handles apr_file_inherit_unset
way back in apr_procattr_io_set / apr_procattr_child_*_set would be
more efficient; comments?
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584569 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First; we absolutely do NOT want to waste our time creating a pipe,
when the caller has their own file descriptors all set up to give to
the child process (and use itself). We can also presume a single
ended pipe is about as interesting as the sound of one hand clapping.
Create the pipe only when we don't already have any child/parent pipes
set up, and when the caller passes no files for us to use. Otherwise,
we simply dup for our own use rather than dup2.
Second; we absolutely cannot dup2 into the static 'no_file' special fd,
so we'll guard against this and also dup, instead, for this case.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584500 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
(we aren't trying to close our child_fd's here).
Submitted by: David Glasser <glasser@davidglasser.net>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581089 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
for pointing this out to me on #irc.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581042 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
These can be reduced further and still remain legible.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580632 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580591 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
if we use apr_procattr_stderr_set() it will not close out the
previous handle parked there by _io_set(). But it also does
not attempt to touch the _io_set() no_file STATIC apr_file_t's
so there is nothing to otherwise fix here immediately.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580515 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
to cause the specified streams to be closed to the child process,
when the caller has chosen that flag via apr_procattr_io_set().
ALSO; solve a serious flaw where we attempted to dup2 to a non existant
file if the user had not already called apr_procattr_io_set()!
The Unix implementation.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580486 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
executable-but-unreadable programs to be executed even if the errchk
mode is active.
PR: 32498
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@454787 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
resolving a theoretical problem with standards compliance
and an actual problem with Purify.
Reviewed by: Joe Orton
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@312607 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
prevent atexit-registered functions from being run in a failing child,
and e.g. flushing stdio buffers.
PR: 30913
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239687 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
apr_procattr_child_out_set, apr_procattr_child_err_set): Add error
checking: fixes segfaults in applications when pipe() or dup2() fail
(e.g. due to ulimit settings).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170395 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125405 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
uid/gid for newly created processes using apr_proc_create.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125349 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
access to the working directory of the child process.
PR: 30137
Submitted by: Jeremy Chadwick <apache jdc.parodius.com>
Reviewed by: jorton, trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65285 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which is started by the shell and which inherits the parent's
environment variables.
The immediate use for this is with Apache httpd's piped loggers,
correcting a regression since 1.3.
In general, applications starting child processes often want
the child to run with the same environment variables, so this
plugs a hole in the API.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65213 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
(NetWare ONLY).
Replaced changes that added APR_PROGRAM_ADDRSPACE committed 6/11/04.
Reviewed by Brad Nicholes
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65196 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64733 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64728 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64722 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64716 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
it repeatedly until it succeeds or fails with errno other than
EINTR. This hides this UNIX-specific behavior from APR clients.
Submitted by: Eric Gillespie <epg@pretzelnet.org>
Reviewed by: Thom May
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64501 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when there is more than one program argument passed in.
It worked before (and still does) if the app somehow knows to
pass in a single arg which is a string containing the program
name and all args, such as when calling system().
Now it works if the app passes the program arguments normally,
such as when using other modes of apr_proc_create().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64490 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
try to anticipate any errors that might occur after fork()
(no-op everywhere but Unix)
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64341 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
function when apr_proc_create() fails in the new child process
after fork(). The app-provided error reporting function will only
be called on platforms where apr_proc_create() first calls
fork() to create the new process.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64330 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
to run the parent's code if setrlimit() fails.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64328 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
aix/dso.h -> -> aix/apr_arch_dso.h
beos/dso.h -> beos/apr_arch_dso.h
beos/proc_mutex.h -> beos/apr_arch_proc_mutex.h
beos/thread_cond.h -> beos/apr_arch_thread_cond.h
beos/thread_mutex.h -> beos/apr_arch_thread_mutex.h
beos/threadproc.h -> beos/apr_arch_threadproc.h
beos/thread_rwlock.h -> beos/apr_arch_thread_rwlock.h
netware/dso.h -> -> netware/apr_arch_dso.h
netware/fileio.h -> -> netware/apr_arch_fileio.h
netware/global_mutex.h -> netware/apr_arch_global_mutex.h
netware/internal_time.h -> netware/apr_arch_internal_time.h
netware/networkio.h -> netware/apr_arch_networkio.h
netware/pre_nw.h -> netware/apr_arch_pre_nw.h
netware/proc_mutex.h -> netware/apr_arch_proc_mutex.h
netware/thread_cond.h -> netware/apr_arch_thread_cond.h
netware/thread_mutex.h -> netware/apr_arch_thread_mutex.h
netware/threadproc.h -> netware/apr_arch_threadproc.h
netware/thread_rwlock.h -> netware/apr_arch_thread_rwlock.h
os2/dso.h -> os2/apr_arch_dso.h
os2/fileio.h -> os2/apr_arch_fileio.h
os2/networkio.h -> os2/apr_arch_networkio.h
os2/os2calls.h -> os2/apr_arch_os2calls.h
os2/proc_mutex.h -> os2/apr_arch_proc_mutex.h
os2/thread_cond.h -> os2/apr_arch_thread_cond.h
os2/thread_mutex.h -> os2/apr_arch_thread_mutex.h
os2/threadproc.h -> os2/apr_arch_threadproc.h
os2/thread_rwlock.h -> os2/apr_arch_thread_rwlock.h
os390/dso.h -> os390/apr_arch_dso.h
unix/dso.h -> unix/apr_arch_dso.h
unix/fileio.h -> unix/apr_arch_fileio.h
unix/global_mutex.h -> unix/apr_arch_global_mutex.h
unix/inherit.h -> unix/apr_arch_inherit.h
unix/internal_time.h -> unix/apr_arch_internal_time.h
unix/misc.h -> unix/apr_arch_misc.h
unix/networkio.h -> unix/apr_arch_networkio.h
unix/proc_mutex.h -> unix/apr_arch_proc_mutex.h
unix/shm.h -> unix/apr_arch_shm.h
unix/thread_cond.h -> unix/apr_arch_thread_cond.h
unix/thread_mutex.h -> unix/apr_arch_thread_mutex.h
unix/threadproc.h -> unix/apr_arch_threadproc.h
unix/thread_rwlock.h -> unix/apr_arch_thread_rwlock.h
win32/atime.h -> win32/apr_arch_atime.h
win32/dso.h -> win32/apr_arch_dso.h
win32/fileio.h -> win32/apr_arch_fileio.h
win32/inherit.h -> win32/apr_arch_inherit.h
win32/misc.h -> win32/apr_arch_misc.h
win32/networkio.h -> win32/apr_arch_networkio.h
win32/proc_mutex.h -> win32/apr_arch_proc_mutex.h
win32/thread_cond.h -> win32/apr_arch_thread_cond.h
win32/thread_mutex.h -> win32/apr_arch_thread_mutex.h
win32/threadproc.h -> win32/apr_arch_threadproc.h
win32/thread_rwlock.h -> win32/apr_arch_thread_rwlock.h
win32/utf8.h -> win32/apr_arch_utf8.h
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64271 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
No functional changes
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
|