rsa_eay: Replace handrolled BN_bn2binpad with the real thing
Just a tiny little bit of lipstick on this entelodont. This is simpler
and does not change behavior as BN_bn2binpad() returns -1 on failure and
num on success.
jsing points out that BN_bn2binpad() is constant time.
ok jsing kenjiro
PS: henning, you owe me a significant amount of quality beverages for
making me look at this particular tire fire (and corresponding XS files).
libcrypto: harden cms_kek_cipher() a bit
When AES key unwrap with padding is in use, the EVP interface breaks its
contract and writes more than the outlen it initially reports to the output
buffer. This is an old, sneaky trap that the muppet set eons ago and many
victims walked right into it, including the muppet himself.
If inlen is larger than outlen, allocate inlen bytes to unwrap with padding
to avoid a buffer overwrite. This is a variant of OpenSSL's fix. Since we
do not support AES keywrap with padding no actual bufer overwrite occurs
here at the moment, but if we ever chose to do so (unlikely) this trap
would be avoided. There's plenty more traps that the next round of scas
will surely find in this absolute trashfire of CMS support code.
ok kenjiro
Do not try to configure 0.0.0.0 (INADDR_ANY) on an interface.
If we indicate a preference for IPv6-only (DHCP option 108), the
server does not offer an IP address (indicated by INADDR_ANY), so we
must first check if the server supported option 108 before checking if
we received an IPv4 offer.
Logic error pointed out and diff provided by acts1631 at proton.me,
thanks!
Don't drop X509_V_ERR_HOSTNAME_MISMATCH when verify callback returns 1
While not the advised way of using the verify callback (either by OpenSSL
or by us) in production, sometimes folks like to return 1 from everything
in the callback and then check the error return and make decicions about
things.
This fix ensures that such callbacks will see the hostname mismatch and
be able to act upon them.
Reported by Alexander Aleksandrovic Klimov
ok tb@
Fix crash when trying to access the /admin/ page
Apparently checking passwords goes through checks for hash algorithms
supported by crypt(3). But since none of the algorithms checked are
supported by the OpenBSD libc, the code ends up dereferencing a NULL
pointer. I'm not sure yet why the code checks for algorithms supported
by crypt(3), as the code wasn't present in icecast-2.4.4.
To fix this, avoid dereferencing said NULL pointer. While here, add
DEBUG_PACKAGES.
Problem reported by Olivier Cherrier.
Do not hardcode /usr/src/ in one of the files containing desired output.
This is expected to fix a test failure that anton@ reported with BSDSRCDIR set.