summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/setenv.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-11-02Fix a few bizarre line wraps in x509.htb1-8/+5
2023-11-01Use X509_ALGOR_set0_by_nid() in X509_ALGOR_set_evp_md()tb1-6/+6
ok jsing
2023-11-01Add X509_ALGOR_set0_by_nid()tb2-2/+33
X509_ALGOR_set0() is annoyingly unergonomic since it takes an ASN1_OBJECT rather than a nid. This means that almost all callers call OBJ_obj2nid() and they often do this inline without error checking so that the resulting X509_ALGOR object is corrupted and may lead to incorrect encodings. Provide an internal alternative X509_ALGOR_set0_by_nid() that takes a nid instead of an ASN1_OBJECT and performs proper error checking. This will be used to convert callers of X509_ALGOR_set0() in the library. ok jsing
2023-11-01Explain the weird order of doing things in X509_ALGOR_set0()tb1-1/+2
2023-11-01Rename ptype and pval to parameter_type and parameter_valuetb1-7/+9
ok jsing
2023-11-01Unindent X509_ALGOR_set0_parameter()tb1-8/+11
ok jsing
2023-11-01Split X509_ALGOR_set0_parameter() out of X509_ALGOR_set0()tb1-6/+15
ok jsing
2023-11-01Split X509_ALGOR_set0_obj() out of X509_ALGOR_set0()tb1-3/+12
ok jsing
2023-10-31Remove 3 expected failures those got fixed in the regress code.claudio1-4/+1
2023-10-31unlink("/") just needs to error. Checking for a specific errno makesclaudio1-2/+2
little sense here since there are multiple possible errnos that could be returned. On OpenBSD this returns EISDIR and not EBUSY. OK mbuhl@ millert@
2023-10-31When creating a file in a directory the file gid is inherited fromclaudio1-2/+2
the directory and so checking against getgid() makes no sense. OK mbuhl@ millert@
2023-10-31Ignore closefrom() failure. This fails normally since fd 4 and up are allclaudio1-3/+2
closed. OK mbuhl@ millert@
2023-10-30Add support for OpenSSL 3.1 interop teststb8-11/+74
Until OpenSSL 3.1 has replaced OpenSSL 3.0 on most architectures, run both tests. Installed packages of OpenSSL 3.0 will update automatically to 3.1, so regress runners should not need to do anything.
2023-10-29Enable ISO C11 APIs when building libc, even with an older compiler.millert1-1/+9
Otherwise, the prototypes for timespec_get() and aligned_alloc() are not visible. OK guenther@
2023-10-29Fix an error exit in X509v3_addr_validate_path()tb1-3/+6
If the topmost cert is invalid, this should result in a validation failure. Do the same dance as elsewhere permitting the verify callback to intercept the error but ensuring that we throw an error. ok jsing
2023-10-27Include wait(2) status in error message, in the hopes of providing cluesanton1-2/+2
on why this occasionally fails.
2023-10-26A few micro-optimizations; ok asou@otto1-20/+15
2023-10-26Tidy includestb1-2/+2
2023-10-26Hide X509_ALGOR_set_md() for LIBRESSL_INTERNALtb1-1/+3
2023-10-26Provide prototype for X509_ALGOR_set_md()tb1-1/+3
Once we remove X509_ALGOR_set_md() we can link this test statically and use X509_ALGOR_set_evp_md() but for now make sure the documented workaround for this garbage API works.
2023-10-26Rework the MD setting in the RSA ASN.1 methodtb1-45/+95
This streamlines the code to use safer idioms, do proper error checking and be slightly less convoluted. Sprinkle a few references to RFC 8017 and explain better what we are doing and why. Clarify ownership and use more consistent style. This removes the last internal use of X509_ALGOR_set_md(). ok jsing
2023-10-24Add chacha aliases for OpenSSL compatibilitytb1-1/+3
OpenSSL has the 20 in the long and short names, so add aliases to the existing names to make things work. In particular, EVP_get_cipherbyname() will now return EVP_chacha20() for both 'ChaCha20' and 'chacha20'. Found by Facundo Tuesca when trying to add LibreSSL support for ChaCha20 in https://github.com/pyca/cryptography/pull/9209 ok jsing
2023-10-22correct Va in previous;jmc1-2/+3
2023-10-22A few more testsotto1-1/+15
2023-10-22When option D is active, store callers for all chunks; this avoidsotto2-86/+178
the 0x0 call sites for leak reports. Also display more info on detected write of free chunks: print the info about where the chunk was allocated, and for the preceding chunk as well. ok asou@
2023-10-21Remove mention of alg_section. This never worked in LibreSSL.tb1-3/+2
2023-10-21style tweak: avoid double conjunction to make it read betterschwarze1-4/+4
OK tb@
2023-10-19Rename the modulus from n into mtb1-9/+12
This matches what other pages use. Also rewrite the definition of the modular inverse to be less ugly.
2023-10-19Add a few more test cases for mod_exp aliasingtb1-33/+78
2023-10-19Garbage collect weird /* 1 */ and /* 2 */ commentstb1-7/+7
If they ever had any meaning, that's long been lost. Requested by jsing
2023-10-19The bn_mod_exp test is no longer an expected failuretb1-3/+1
2023-10-19Fix aliasing of result and exponent in the internal BN_mod_exp_recp()tb1-12/+19
This is basically the same fix as the one applied in BN_mod_exp_simple().
2023-10-19Fix aliasing of result with exponent or modulus in BN_mod_exp_simple()tb1-10/+22
Reported and reminded by Guido Vranken in OpenSSL issue #21110 ok jsing
2023-10-19Add test case checking aliasing of the result with other argumentstb2-2/+108
These are expected failures for BN_mod_exp_simple() and the internal BN_mod_exp_recp(), which will be fixed shortly.
2023-10-18Make libssl interop server/client tests less flaky by ensuring theanton1-1/+3
server has terminated before examining the outcome.
2023-10-18Remove EVP_add_alg_module() prototypetb1-3/+1
This function was the unfortunate protagonist in a series of tragic merge errors resulting in only a short stint of a year and nine months between OpenSSL 0.9.8j and 1.0.0a actually present in OpenBSD. Then it said good bye for good, but somehow a prototype came back with 1.0.1g, a famous version released when there were slightly more pressing things to be taken care of than a function supporting a config knob whose only purpose was to turn off fips mode or to error. from schwarze PS: The mechanism that it was supposed to provide is still documented in openssl.cnf(5). I am going remove the relevant bit at some point, but not today.
2023-10-18Use X509_ALGOR_set_evp_md() in CMS_add1_signer()tb1-16/+24
Contrary to X509_ALGOR_set_md() this allows for error checking. Avoid local complications by freeing in the exit path and use a const version of X509_ALGOR for walking a STACK_OF() to avoid a bad free. Clean up includes ok jsing
2023-10-18cms_DigestedData_create() use X509_ALGOR_set_evp_md()tb1-6/+8
Our internal version allows for error checking and this avoids a silent failure leading to corruption later on. Clean up includes while there. ok jsing
2023-10-13Tweak previous by using the argument name, not its typetb1-2/+2
2023-10-13Improve the description of X509_ALGOR_dup(3)tb1-5/+11
The old description was vague, but strictly speaking a lie, so make it more precise and turn the lie into a truth.
2023-10-12x509_algor: fix error messagetb1-7/+7
2023-10-12x509_algor: add a few missing includestb1-1/+4
2023-10-11Some housekeeping in x_algortb1-3/+5
Fix includes and zap an empty line. ok jsing
2023-10-11Rewrite X509_ALGOR_set0()tb1-17/+13
The current implementation is a complete mess. There are three cases: 1) ptype == V_ASN1_UNDEF: parameter must be freed and set to NULL. 2) ptype == 0: existing non-NULL parameters are left untouched, NULL parameters are replaced with ASN1_TYPE_new()'s wacky defaults. 3) otherwise allocate new parameters if needed and set them to ptype/pval. In all three cases free the algorithm and set it to aobj. The challenge now is to implement this using nine if statements and one else clause... We can do better. This preserves existing behavior. There would be cleaner implementations possible, but they would change behavior. There are many callers in the ecosystem that do not error check X509_ALGOR_set0() since OpenSSL failed to do so. So this was carefully rewritten to leave alg in a consisten state so that unchecking callers don't encounter corrupted algs. ok jsing
2023-10-11x509_algor: Turn expected failure into actual failure now that the API istb1-3/+3
fixed.
2023-10-11Ensure that out_value is initialized even if out_type is NULLtb1-1/+5
This fixes the printf in the x509_algor regress. ok jsing
2023-10-11Rewrite X509_ALGOR_get0()tb1-13/+19
Make the logic slightly less convoluted. Preserve the behavior that *ppval remains unset if pptype == NULL for now. However, ensure that *ppval is set to NULL if pptype is V_ASN1_UNDER. ok jsing
2023-10-11Add internal version of X509_ALGOR_set_md()tb2-7/+17
X509_ALGOR_set_md() is a void function that cannot easily be error checked. The caller has to jump through hoops to make sure this function doesn't fail. Prepare replacing this internally with X509_ALGOR_set_evp_md(), which allows error checking. There is one slight change of behavior: if the EVP_MD object passed in does not have an OID known to the library, then this new API fails. It is unclear what the library should do with such an object and people who use EVP_MD_meth_new() need to know what they are doing anyway and they are better off teaching the lib about the OID if they're going to be messing with certs. Oh, and the prototype is in x509_local.h because the rest of this API is in x509.h despite being implemented in asn1/. ok jsing
2023-10-11Add preallocation dance for X509_ALGOR_set_md() as documentedtb1-1/+5
2023-10-11Clean up X509_ALGOR_cmp()tb1-10/+10
This is currently written in what is likely the most stupid way possible. Rewrite this function in a more straightforward way. ok jsing