Age | Commit message (Collapse) | Author |
|
Also, as deraadt suggested, switched realloc to recallocarray to at least
prevent uninitialized memory to be used as pointers in case of other
programming errors. A proper solution (not using an array) needs more work.
This change occured in sync with upstream libevent 2.2.
with input by and ok bluhm, jca, tedu
|
|
(same fix as in a_int.c rev 1.34)
Fixes oss-fuzz issue #13809
ok beck, jsing
|
|
Fixes oss-fuzz issue #13804
ok beck, jsing
|
|
Doing the fchown call causes pledge("tmppath") to be insufficient and the
the umask dance may cause race-conditions in multithreaded applications.
Also POSIX states the following nowadays:
implementations may restrict the permissions, either by clearing the file
mode bits or setting them to the value S_IRUSR | S_IWUSR.
Encouraging words from tedu@
Standards verification and OK millert@
|
|
The decrypted session ticket contains key material.
ok tb@
|
|
allocating on stack.
While here also check the return values from EVP_DecryptInit_ex() and
HMAC_Init_ex().
ok tb@
|
|
Rename mlen to hlen since it is a hmac (and this matches hctx and hmac).
Rename ctx to cctx since it is a cipher context and ctx is usually used to
mean SSL_CTX in this code.
ok tb@
|
|
reported by Fabio Scotoni <fabio at esse dot ch>;
also garbage collect one .Tn while here
|
|
This removes various pointer arithmetic and manual length checks.
ok tb@
|
|
ok jsing
|
|
ok jsing
|
|
ok jsing
|
|
ok jsing
|
|
ok jsing
|
|
an ugly strlen + malloc + strcat/strcpy dance by a simple asprintf().
ok jsing
|
|
and i2v_GENERAL_NAMES() by taking ownership of the extlist only if we
were passed NULL. Otherwise it remains the caller's responsibility to
free it. To do so, we allocate the extlist explicitly instead of using
X509V3_add_value()'s implicit allocation feature. Preserve behavior in
i2v_AUTHORITY_KEYID() by adding an explicit check that something was
pushed onto the stack.
The other i2v_* functions will receive a similar treatment in upcoming
commits.
ok jsing
|
|
This handles the ret = 2 case and makes the code more readable.
ok tb@
|
|
Convert ssl_get_prev_session(), tls1_process_ticket() and
tls1_decrypt_ticket() to handle the session ID from the client hello
as a CBS. While here also swap the order of arguments for
tls1_decrypt_ticket() so that it is consistent with the other functions.
ok tb@
|
|
There is not much point having a tlsext_tick_md macro that replaces
EVP_sha256() in two places, when the cipher is just hardcoded.
ok tb@
|
|
and i2v_GENERAL_NAMES(). This fixes a couple of leaks and other
ugliness.
tweaks & ok jsing
|
|
imported OpenSSL 0.9.4 in 1999. It won't ever be used.
|
|
|
|
|
|
|
|
We only have to find one extension, so do that first then proceed with
processing and decryption. This makes the code more readable and drops
two levels of indent.
ok tb@
|
|
Separate the malloc() check and EVP_DecryptUpdate() - the malloc() failure
is fatal while a EVP_DecryptUpdate() is a decryption failure.
Also ensure that we clear the error stack in all cases where we are
indicating a failure to decrypt or decode the ticket - otherwise
SSL_error() while later return failure when it should not.
ok tb@
|
|
Rather than returning from multiple places and trying to clean up as we go,
move to a single exit point and clean/free in one place. Also invert the
logic that handles NULL sessions - fail early, rather than having an
indented if test for success.
ok tb@
|
|
|
|
|
|
|
|
minimum value.
Fixes oss-fuzz #14354.
ok beck@ bcook@ tb@
|
|
Found by Guido Vranken when fuzzing and trying to use GOST with HMAC.
Fix confirmed by Guido; ok tb@
|
|
|
|
The assembler does not handle undeclared local symbols properly
and generates R_MIPS_CALL16 relocations where it should generate
local GOT references. For now, get along with the problem by
declaring local symbols where necessary.
OK kettenis@ guenther@
|
|
on mips64. They need relocation and consequently cannot be used
in that function.
OK kettenis@
|
|
|
|
|
|
X509V3_add_value() helpfully allocates a STACK_OF(CONF_VALUE) if it
receives a pointer to a NULL pointer. If anything fails along the way,
it is however the caller's responsibility to free it. This can easily
be fixed by freeing *extlist in the error path and zeroing it to avoid
a double free if there happens to be a caller out there that avoids
the leak.
Polish a few things so the function conforms a bit better to our usual
style.
tweak & ok jsing
|
|
|
|
|
|
|
|
Fixes oss-fuzz issue #13843.
ok tb@
|
|
Some bread/bwrite functions implement this themselves, while others do not.
This makes it consistent across all BIO implementations.
Addresses an issue that Guido Vranken found with his fuzzer.
ok tb@
|
|
ok tb@
|
|
This reverts part of OpenSSL c2fd5d79, which added the same code to AES
CCM, GCM and XTS. In the case of CCM and GCM nothing assigns {ccm,gcm}.key
so there is never going to be anything to update (unlike XTS).
ok tb@
|
|
Avoids use of uninitialised memory.
ok tb@
|
|
|
|
In the case of a cipher with a custom copy control, if that control fails
we may still have pointers that we do not own in the previously copied
cipher data. Avoid potential double-frees by zeroing and freeing the
copied cipher data in this case.
Issue reported by Guido Vranken.
ok tb@
|
|
|
|
These pointers will be passed to free. According to asprintf(3), "on
OpenBSD, ret will be set to the null pointer, but this behavior should
not be relied upon."
ok jsing
|