openssl s_client: avoid two out of bounds writes
A NUL termination after an unchecked BIO_read() call in XMSS mode could
lead to a write one byte before the start of sbuf or one past its end.
Add an error check to avoid the former and read one byte less to avoid the
latter.
Found by Frank Denis
libssl: record extension lengths in ClientHello hashing
The ClientHello hash is intended to ensure that the second CH after an HRR
only makes the allowed changes to the TLS extensiosn by recording message
type followed by the raw extension data if it must remain unchanged.
This makes it possible (in principle) that part of free form extension
data is confused with type (and length) information of a subsequent
extension.
Recording the length after the type prevents such a confusion and fixes
the framing of the extensions.
Found by Frank Denis
ok jsing
PKCS#12: fix erroneous error check in PKCS12_newpass()
This is an error I introduced in a refactoring two years ago in r1.20.
This means that nothing uses this...
From Frank Denis via logan
Use uint32_t instead of SHA_LONG in the SHA-256 code.
This is more readable and we already have a compile time assert that they
are the same size.
ok tb@