| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.
Should address the remaining issues reported by Coverity.
ok tb@
|
|
|
|
| |
ok jmc@ miod@
|
|
|
|
| |
ok ok miod@ ack ack jmc@
|
|
|
|
| |
ok miod@ jmc@
|
|
|
|
|
| |
Noticed by jsg
Feedback OK jsg
|
|
|
|
| |
Only change in generated assembly is due to line numbers.
|
|
|
|
|
|
|
|
|
| |
These cipher implementations take a size_t length argument, so stop
casting it to a long.
Found by Coverity.
ok tb@
|
|
|
|
| |
No change in generated assembly.
|
|
|
|
|
|
|
|
|
|
| |
The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.
Found by Coverity, hiding under a large pile of macros.
ok tb@
|
|
|
|
| |
Only change to generated assembly is due to line numbers.
|
|
|
|
| |
Only change in generated assembly is due to line numbers.
|
|
|
|
|
|
|
| |
Pull the init_key and ctrl (if present) functions up to the top. This
improves readability and allows for the removal of function prototypes.
No functional change.
|
| |
|
| |
|
|
|
|
| |
No change in generated assembly.
|
|
|
|
| |
No change in generated assembly.
|
|
|
|
|
|
| |
This includes the wonderful BLOCK_CIPHER_ecb_loop - a for loop in a macro.
No change in generated assembly.
|
| |
|
|
|
|
| |
Only change to generated assembly is due to the use of EVPerror().
|
|
|
|
|
|
| |
Also remove various comments noting that it cannot be used for certain
block ciphers (which kinda defeats the purpose of having a generic
implementation in the first place).
|
|
|
|
|
| |
Only change to generated assembly is due to EVPerror()'s use of line
numbers.
|
|
|
|
| |
No change in generated assembly.
|
|
|
|
|
|
| |
Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------
|
|
|
|
| |
No change to generated assembly.
|
|
|
|
|
|
|
|
|
| |
These macros make the ASN.1 macros seem sane - there are layers and layers
and layers here, which are hiding bugs.
No change to generated assembly.
Discussed with tb@
|
| |
|
|
|
|
|
|
| |
Rename some variables and consistently goto error.
ok tb@
|
|
|
|
|
|
|
|
| |
Rather than recycling an existing ASN1_STRING and changing its type, free
it and allocate a replacement. This simplifies the code and potentially
avoids bugs resulting from reuse.
ok tb@
|
| |
|
|
|
|
|
|
|
|
| |
Per X.690, some ASN.1 types must be primitive encoded, some must be
constructed and some may be either. Add this data to our types table
and check the encoding against this information when decoding.
ok tb@
|
|
|
|
|
|
|
| |
This avoids asn1_c2i_primitive() from needing knowledge about the internals
of ASN1_INTEGER and ASN1_ENUMERATED.
ok tb@
|
|
|
|
|
|
|
|
|
|
| |
OPENSSL_cleanup() cleans up and deallocates memory in use by the library.
There are a couple of use cases for this, primarily related to memory
leak testing. This will not be called automatically in LibreSSL, which
means that OpenSSL's OPENSSL_NO_INIT_ATEXIT is implied. If code wants to
clean up then they need to explicitly call this themselves.
ok tb@
|
|
|
|
|
|
|
|
|
| |
CBIGNUM_it is supposed to be the "clear bignum" or "secure" bignum - that
is one which zeros its memory after use and ensures that the constant time
flags are set... in LibreSSL we always do both of these things for BIGNUMs,
so just use BIGNUM_it instead.
ok tb@
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DSA_size() and ECDSA_size() have a very special hack. They fudge up an
ASN1_INTEGER with a size which is typically > 100 bytes, backed by a
buffer of size 4. This was "fine", however, since they set buf[0] = 0xff,
where the craziness that was i2c_ASN1_INTEGER() only looks at the first
octet (one may then ask why a buffer of size 4 was necessary...).
This changed with the rewrite of i2c_ASN1_INTEGER(), which doesn't
respect this particular hack and rightly assumes that it is fed an
actual ASN1_INTEGER...
Instead, create an appropriate signature and use i2d to determine its
size.
Fixes an out-of-bounds read flagged by ASAN and oss-fuzz.
ok jsing
|
|
|
|
|
|
|
|
|
| |
sk_num() can return a negative value, in which case the upper bound is
SIZE_MAX, which results in a very long for loop.
CID 153997
ok jsing
|
|
|
|
|
|
| |
Otherwise EVP_CIPHER_CTX_cleanup() leaks, as spotted by the ASAN CI.
ok jsing
|
|
|
|
|
|
| |
CID 356353
ok jsing
|
| |
|
|
|
|
|
|
| |
Needed for an upcoming change.
ok tb@
|
|
|
|
|
|
| |
Needed for an upcoming change.
ok tb@
|
|
|
|
|
|
|
|
|
| |
c99 6.11.5:
"The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature."
ok miod@ tb@
|
|
|
|
|
|
| |
ASN1_INTEGER_set() fails.
ok jsing
|
|
|
|
|
|
|
|
|
|
|
| |
When an ASN1_INTEGER is created it has NULL data until a value is set -
previously, an ASN1_INTEGER in this state encoded to an ASN.1 INTEGER with
a value of 0, rather than being treated as an error. While code should
really set values, the historical behaviour has not required this.
Found the hard way by sthen@ with acme-client.
ok tb@
|
|
|
|
|
|
|
| |
While these will not be used by LibreSSL, they are used by some QUIC
implementations (such as ngtcp2).
ok tb@
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
EVP_chacha20_poly1305() is an EVP_CIPHER implementation of the
ChaCha20-Poly1305 AEAD. This is potentially used to provide encryption for
the QUIC transport layer.
Where possible, this should be avoided in favour of the significantly saner
EVP_AEAD interface.
ok tb@
|
|
|
|
|
|
|
|
|
| |
The length checks for EVP_aead_chacha20_poly1305() seal/open were incorrect
and are no longer necessary (not to mention that the comment failed to
match the code). Remove these since the underlying ChaCha implementation
will now handle the same sized inputs at these functions can.
Issue flagged by and ok tb@
|