| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The optimised code path switches from processing data via unsigned long to
processing data via unsigned int, which requires type punning. This is
currently attempted via a union (for one case), however this fails since
a pointer to a union member is passed to another function (these unions
were added to "fix strict-aliasing compiler warning" - it would seem the
warnings stopped but the undefined behaviour remained). The second case
does not use a union and simply casts from one type to another.
Undefined behaviour is currently triggered when compiling with clang 14
using -03 and -fstrict-aliasing, while disabling assembly (in order to use
this C code). The resulting binary produces incorrect results.
Avoid strict aliasing violations by copying from an unsigned long array to
an unsigned int array, then copying back the result. Any sensible compiler
will omit the copies, while avoiding undefined behaviour that would result
from unsafe type punning via pointer type casting.
Thanks to Guido Vranken for reporting the issue and testing the fix.
ok tb@
|
|
|
|
| |
ok beck
|
|
|
|
|
| |
be caught by the error check of EVP_PKEY_derive_init() is a dubious
pattern.
|
| |
|
|
|
|
|
|
| |
Manual from OpenSSL 1.1.1o with minimal tweaks.
input/ok schwarze
|
|
|
|
| |
ok jsing
|
|
|
|
| |
ok jsing
|
|
|
|
|
|
| |
a piece of the embedded info array.
ok jsing
|
|
|
|
|
|
|
|
| |
Change asn1_get_length_cbs() and asn1_get_object_cbs() to handle and return
a length as a size_t rather than a uint32_t. This makes it simpler and less
error prone in the callers.
Suggested by and ok tb@
|
|
|
|
|
|
|
| |
Gotta love EVP... Instead of a single, obvious call to HKDF(), you now
need to call eight EVP functions with plenty of allocations and pointless
copying internally. If you want to suffer even more, you could consider
using the gorgeous string interface instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a NULL key is passed to HMAC_Init_ex(), it tries to reuse the
previous key. This makes no sense inside HMAC() since the HMAC_CTX
has no key set yet. This is hit by HKDF() with NULL salt() via the
EVP API and results in a few Wycheproof test failures. If key is
NULL, use a zero length dummy key.
This was not hit from wycheproof.go since we pass a []byte with a
single NUL from Go.
Matches OpenSSL if key is NULL and key_len is 0. If key_len != 0,
OpenSSL will still fail by passing a NULL key which makes no sense,
so set key_len to 0 instead.
ok beck jsing
|
| |
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
|
|
| |
some const.
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
| |
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
|
|
|
| |
ok beck jsing
|
| |
|
|
|
|
| |
ok beck jsing
|
| |
|
|
|
|
| |
variable declaration)
|
| |
|
| |
|
|
|
|
| |
commit.
|
|
|
|
|
| |
OpenSSL commits d2e9e320186f0917cc940f46bdf1a7e4120da9b0 and
b6cff313cbb1d0381b329fe4f6a8f009cdb270e4
|
| |
|
|
|
|
| |
21dcbebc6e35419f1842f39a125374ea1ba45693
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This imports verbatim copies as of the OpenSSL_1_1_1o tag of
crypto/kdf/hkdf.c
crypto/kdf/hkdf_err.c
include/openssl/kdf.h
include/openssl/kdferr.h
from https://www.github.com/openssl/openssl.git into lib/libcrypto/kdf.
We only want the EVP interface to HKDF since some ports need them. Not
yet linked to the build since it will not compile. Follow-on commits will
add KNF, clean up and make this compile.
Tests of an early draft version by abieber and Caspar Schutijser
ok jsing
|
|
|
|
|
|
| |
Use more readable variable and arguments names in the process.
ok tb@
|
|
|
|
|
|
|
|
| |
The asn1_find_end() function handles definite length ASN.1, which means
that there is no point in the only caller having code to explicitly handle
definite length - it can just call the function.
ok tb@
|
|
|
|
|
|
|
|
| |
The long vs size_t checks can be handled in the asn1_check_tag() wrapper
and this will help to avoid propagating long vs size_t issues into new
code.
ok tb@
|
|
|
|
|
|
|
|
|
|
|
| |
Test decoding of sequences with length and indefinite length into an ASN.1
string - in this case the ASN.1 is not decoded, rather the octets are
stored directly as the content of the string.
This exercises a specific path through the ASN.1 decoder.
(you know asn1complex is living up to its name when you have to import
openssl/asn1t.h directly...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than calling asn1_get_object_cbs(), call asn1_get_identifier_cbs(),
then immediately proceed with the tag number and tag class check. Only if
that succeeds (or it is not required) do we call asn1_get_length_cbs().
This avoids incurring the overhead of decoding the length in the case where
the tag number and tag class do not match.
While here rename asn1_check_tlen() to asn1_check_tag() - while we decode
the length, what we are normally checking is the tag number and tag class.
Also rename the arguments for readability. For now the argument types
and encoding remain unchanged.
ok inoguchi@ tb@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ASN1_TIME_adj_internal() does some strange dances with remembering
allocations in a boolean and using strlen(p) to deduce what happened
inside *_string_from_tm(). It also (mis)translates a NULL p to an
illegal time value error.
This can be streamlined by converting directly from a struct tm into an
ASN1_TIME and setting the errors when they occur instead of trying to
deduce them from a NULL return. This is made a bit uglier than necessary
due to the reuse-or-allocate semantics of the public API.
At the cost of a little code duplication, ASN1_TIME_adj_internal()
becomes very easy and ASN1_TIME_to_generalizedtime() is also simplified
somewhat.
ok inoguchi jsing
|
|
|
|
| |
comment from tb@
|
|
|
|
| |
ok tb@
|
| |
|
| |
|
| |
|