Age | Commit message (Collapse) | Author |
|
Avoids repeated use of ternary operator on globals.
|
|
This simply moves a chunk of code in this spaghetti mess into its own
function with minimal changes.
idea from a diff by mpf
|
|
requested by jsing
|
|
We don't do PEM or random in here, but we use BN, EC, ECDSA, so include
the relevant headers. errno.h was also missing.
|
|
Make sure the size_t containing EC signature length is not truncated
when passing it to d2i_ECDSA_SIG() as a long. This won't happen, but
documents API quirks...
requested by jsing
|
|
We can get the correct size of the signature using EVP_PKEY_bits() which
uses the order instead of the (strictly speaking incorrect) degree. Grab
the (r, s) out of the ECDSA signature with ECDSA_SIG_get0_{r,s}(), which
is a saner interface than EVP_SIG_get0(). Finally, do the zero padding
using BN_bn2binpad() which is simpler than the currently rather fiddly
solution.
ok jsing
|
|
EVP_DigestSign() is a bit more ergonomic than the old EVP_Sign* family,
it takes size_t instead of int and and it also allows allocating the
memory needed instead of relying on some weird estimate. This again gets
rid of a few stupid else if.
ok jsing
|
|
We can EVP_Digest() into an array on the stack rather than doing a long
dance and song with lots of ugly else if.
ok jsing
|
|
|
|
If a SAN isn't configured, it could be anything, so make printing it safe
using strvisx(). If it is configured but duplicate, printing it should be
fine, so don't bother. This removes two XXX added in the previous commit.
ok florian
|
|
|
|
ok jsg@
|
|
resulting interrupt storm. It's causing bad system performance, and breaks
the installer.
|
|
vifscreate() always creates all virtual interfaces up-front.
To check whether a given interface exists, ifstart() uses ifcreate()
which tries to create nonexistent ones.
Virtual ones are guaranteed to be present and physical ones cannot be
created, so replace the ifcreate() call with a simpler ifconfig test and
clarify the comment.
OK martijn afresh1
|
|
|
|
|
|
|
|
|
|
jsing doesn't like it, but it's better than nothing.
ok jsing
|
|
and BIO_get_flags(3).
|
|
|
|
xmlsec needs this, nothing else. Our linkers link libxmlsec1-openssl,
only warns and since nothing uses this library in ports, this wasn't
noticed for a long time.
Reported by Thomas Mitterfellner
ok jsing
|
|
|
|
Provide regress coverage for BN_lshift1(), BN_rshift1(), BN_lshift() and
BN_rshift(), along with basic benchmarking functionality (run via
'make benchmark').
|
|
A SSL_set_security_level() call was added to the cipher list regress, which
expects a failure - however, it should succeed and fails for a completely
unrelated reason. Rework this regress so that it actually passes and tests
for the expected behaviour.
|
|
BN_zero() is currently implemented using BN_set_word(), which means it can
fail, however almost nothing ever checks the return value. A long time
ago OpenSSL changed BN_zero() to always succeed and return void, however
kept BN_zero as a macro that calls a new BN_zero_ex() function, so that
it can be switched back to the "can fail" version.
Take a simpler approach - change BN_zero()/BN_one() to functions and make
BN_zero() always succeed. This will be exposed in the next bump, at which
point we can hopefully also remove the BN_zero_ex() function.
ok tb@
|
|
|
|
The revoke process, which does a lot more than revoking a cert, wants to
know the SANs in the cert to be revoked or renewed and check them against
the ones configured in the config file.
To find out which ones are, it prints the SAN extension to a BIO using
X509V3_EXT_print(), slurps that into a buffer, tokenizes the undocumented
output string and plucks out the "DNS:" names. This is reminiscent of
node's hilarious CVE-2021-44532 and on about the same level of crazy, but
fortunately not security relevant.
Get the SAN extension as a GENERAL_NAMES from libcrypto, then we have an
actual data structure to work with, which allows us to access the DNS names
without problems. This simplifies things quite a bit, but the actual logic
in this file remains unmodified. Be careful about ASN1_IA5STRINGs and do
not assume they are C strings.
Tested by florian, millert, Renaud Allard, thanks!
ok florian jsing
|
|
|
|
struct uvm_map's .addr is protected by the map's lock and .{min,max}_offset
are immutable.
uvm_map_inherit() locks the VM map upon entry, sets the desired inheritance
mode for the given address range (validated outside the lock) and unlocks
the map itself.
fork(2), i.e. uvm_mapent_forkcopy(), first locks both old and new maps and
then copies entries over as per the inheritance type.
futex(2), another user of struct vm_map_entry's .inheritance member, also
locks the map accordingly.
OK mpi
|
|
|
|
|
|
ok patrick@
|
|
requires word-sized access.
ok patrick@
|
|
BIO_set_callback_ex(3), BIO_get_callback_ex(3), and BIO_callback_fn(3).
Document them, in part by merging from the OpenSSL 1.1.1 branch,
which is still under a free license,
but heavily tweaked by me, in particular:
* mention that BIO_set_callback_arg(3) is misnamed;
* keep our more detailed explanation of the "ret" argument;
* make the list of callback invocations more readable;
* and update the HISTORY section.
|
|
cookie it received from establishing the interrupt.
|
|
The overwhelming majority of callers of X509_check_purpose() in our tree
pass a purpose of -1. In this case X509_check_purpose() acts as a wrapper
of x509v3_cache_extensions() which makes sanity checks like non-negativity
of ASN.1 integers or canonicity of RFC 3779 extensions as well as checking
uniqueness of extensions.
from schwarze who beat an initial diff of mine into shape
|
|
|
|
|
|
OK tb@
|
|
If hw.smt is toggled while top(1) is running in "combined" mode the
CPU count on the CPU state line is incorrect.
We always need to recount the number of online CPUs.
|
|
Same fix as for iwx(4) in CVS commit YakAvDYHWiUF3c4m, r1.113 if_iwx.c.
ok deraadt, mpi
|
|
jsing@ worries that cycle prevention might increase risk because
software that is not checking return values (and indeed, not checking
is likely common in practice) might silently behave incorrectly
with cycle prevention whereas without, it will likely either crash
right away through infinite recursion or at least hang in an infinite
loop when trying to use the cyclic chain, in both cases making it
likely that the bug will be found and fixed.
Besides, tb@ points out that BIO_set_next(3) ought to behave as
similarly as possible to BIO_push(3), but adding cycle prevention
to BIO_set_next(3) would be even less convincing because that
function does not provide a return value, encouraging users to
expect that it will always succeed. While a safe idiom for checking
the success of BIO_set_next(3) could easily be designed, let's be
realistic: application software would be highly unlikely to pick up
such an idiom.
|
|
Error happens when mixing some PIC and non-PIC code in an LTO build/link
ld: error: linking module flags 'SmallDataLimit': IDs have conflicting values in '<REDACTED>.o' and 'ld-temp.o'
and affects a few ports now. Issue reported upstream where the proposed
fix uses llvm::Module::Min, which we don't have and would require
a backport. For now, work around this issue by downgrading to
a warning, which should have the intended effect in most cases (use the
value of the first module, which is smaller than the defaults value used
by ld-temp.o).
ok kettenis@
|
|
|
|
ok hackroom
tested by plenty
|
|
issue 3409.
|
|
table). GitHub issue 3361.
|
|
legacy flag. Spotted by, feedback and ok jmc@
|
|
one or more signals masked (sigprocmask(2) is not cleared on fork/exec)
and this could interfere with various things, e.g. the login grace timer.
Execution environments that fail to clear the signal mask before running
sshd are clearly broken, but apparently they do exist.
Reported by Sreedhar Balasubramanian; ok dtucker@
|