summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-12-03Call asn1_item_ex_d2i() directly from ASN1_item_d2i()jsing1-2/+5
ASN1_item_ex_d2i() is just a wrapper around the internal asn1_item_ex_d2i() function, so call asn1_item_ex_d2i() directly. ok inoguchi@ tb@
2021-12-03Convert ASN1_PCTX_new() to calloc().jsing1-10/+6
Rather than using malloc() and then initialising all struct members to zero values, use calloc(). ok schwarze@ tb@
2021-12-03Use calloc() for X509_CRL_METHOD_new() instead of malloc().jsing1-3/+4
This ensures that if any members are added to this struct, they will be initialised. ok schwarze@ tb@
2021-12-03Rewrite ASN1_STRING_cmp().jsing1-11/+8
This removes nested ifs and uses more sensible variable names. ok schwarze@ tb@
2021-12-03Convert ASN1_STRING_type_new() to calloc().jsing1-10/+7
Rather than using malloc() and then initialising all struct members, use calloc() and only initialise the single non-zero value member. ok schwarze@ tb@
2021-12-03Convert ASN1_OBJECT_new() to calloc().jsing1-11/+6
Rather than using malloc() and then initialising all struct members, use calloc() and only initialise the single non-zero value member. ok schwarze@ tb@
2021-12-03Convert {i2d,d2i}_{,EC_,DSA_,RSA_}PUBKEY{,_bio,_fp}() to templated ASN1jsing2-222/+430
These functions previously used the old ASN1_{d2i,i2d}_{bio,fp}() interfaces. ok inoguchi@ tb@
2021-12-03Use calloc() in EVP_PKEY_meth_new() instead of malloc() and settingtb1-29/+2
almost all members to 0. Just set the two things that need setting. ok jsing
2021-12-03Fix EVP_PKEY_{asn1,meth}_copy once and for alltb2-63/+23
It is very easy to forget to copy over newly added methods. Everyone working in this corner has run into this. Instead, preserve what needs preserving and use a struct copy, so all methods get copied from src to dest. tweak/ok jsing
2021-12-02bsearch(3): support arrays with more than INT_MAX elementscheloha1-2/+3
The "lim" variable needs to be a size_t to match nmemb, otherwise we get undefined behavior when nmemb exceeds INT_MAX. Prompted by a blog post by Joshua Bloch: https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html Fixed by Chris Torek a long time ago: https://svnweb.freebsd.org/csrg/lib/libc/stdlib/bsearch.c?revision=51742&view=markup ok millert@
2021-12-02Tell testers which packages to install right away (and why)kn3-3/+7
Other regress tests do it differently; just fix/thouch those that did not mention any package name at all. This helps grepping logs for SKIPPED to find instructions for the next run.
2021-12-01Remove dead code.jsing1-21/+1
2021-11-30Add missing const qualifiers in a number of BN_* manuals.tb8-52/+52
ok schwarze
2021-11-30last whitespace diff for now.tb1-57/+62
2021-11-30KNF for BF_KEYtb1-4/+3
2021-11-30Fix some annoying whitespace inconsistencies.tb1-20/+20
2021-11-30Provide EVP_CTRL_AEAD_* defines.tb1-7/+10
This commit adds generic EVP_CTRL_AEAD_{SET,GET}_TAG and _SET_IVLEN defines and aliases the GCM and CCM versions to those. This is the publicly visible part of OpenSSL's e640fa02005. ok inoguchi jsing
2021-11-30Align ssl_kex_derive_ecdhe_ecp() with ssl_kex_derive_dhe()tb1-10/+10
sk is commonly used for a STACK_OF(), so call the shared key simply key. ok jsing
2021-11-30s/ECDHE/ECDH/jsing1-3/+3
If we can provide an EC key that is used, then it is by definition non-ephemeral. ok tb@
2021-11-30Add regress for {d2i,i2d}_{,DSA_,EC_,RSA_}PUBKEY{,_bio}().jsing2-1/+570
2021-11-29Crank the number of rounds of Miller-Rabin from 50 to 64tb1-4/+7
for DSA key generation. From Kurt Roeckx, OpenSSL 74ee3796 ok bcook inoguchi jsing
2021-11-29Clean up DH_check_pub_key() and ensure that y^q (mod p) == 1.tb1-18/+53
This aligns our behavior with OpenSSL 1.1.1 which includes a mitigation for small subgroup attacks. This did not affect LibreSSL since we do not support X9.42 style parameter files or RFC 5114. The meat of this commit is from Matt Caswell, OpenSSL b128abc3 ok inoguchi jsing
2021-11-29Increase number of iterations in Miller-Rabin checks for DH.tb1-4/+9
BN_prime_checks is only to be used for random input. Here, the input isn't random, so increase the number of checks. According to https://eprint.iacr.org/2019/032, 64 rounds is suitable. From Jake Massimo, OpenSSL 1.1.1, af6ce3b4 ok inoguchi jsing
2021-11-29Synchronize DH_check() mostly with OpenSSL 1.1.1 with sometb1-32/+47
simplifications and readability tweaks. This ensures in particular that dh->q is suitable if present. Based on work by Stephen Henson and Bernd Edlinger in OpenSSL. Issues with the current implementation found via regression tests in py-cryptography. ok inoguchi jsing
2021-11-29Provide a version of DH_check_params() for internal use.tb1-1/+43
Based on the version in OpenSSL 1.1.1l with minor tweaks. ok inoguchi jsing
2021-11-29Provide a number of flags for DH_check and DH_check_pubkeytb1-1/+5
that will be used in subsequent commits. ok inoguchi jsing
2021-11-29First pass of converting ssl_kex.c to opaque DH.tb1-30/+58
Assign the result of BN_dup() and BN_bn2bin() to local BIGNUMs, then set the factors and pubkey on the dh using DH_set0_{pqg,key}(). A second pass will be done during the upcoming bump. ok jsing
2021-11-29Hide BIO_s_file_internal() from internal view.tb1-2/+4
ok jsing
2021-11-29Stop using BIO_s_file_inernal() in libssl.tb3-13/+13
BIO_s_file_internal() should never have leaked out of libcrypto, but it did. As a first step of getting rid of it, stop using it internally. ok jsing
2021-11-29Convert server serialisation of DHE parameters/public key to new functions.jsing1-24/+3
ok inoguchi@ tb@
2021-11-29Factor out/rewrite DHE key exchange.jsing3-66/+173
This follows what was done previously for ECDHE EC point key exchange and will allow for deduplication and further code improvement. Convert the TLSv1.2 client to use the new DHE key exchange functions. ok inoguchi@ tb@
2021-11-29A few sys/param.h annotations lacked ALIGNBYTESderaadt1-2/+2
2021-11-29Niels agreed to remove the advertising clause; switching thesedjm2-11/+5
to 3-term BSD license.
2021-11-28document ASN1_tag2bit(3)schwarze1-5/+66
2021-11-28Document ASN1_object_size(3).schwarze1-17/+53
While here, * call the function arguments "content_length" rather than just "length" to make it less likely that the reader confuses them with the total length returned by ASN1_object_size(3); * state that only the short form is supported for content_length <= 127; * add the missing STANDARDS section.
2021-11-28mark ASN1_check_infinite_end() and ASN1_const_check_infinite_end()schwarze1-2/+5
as intentionally undocumented
2021-11-27new manual page BIO_f_asn1(3)schwarze3-3/+233
2021-11-27Fix incomplete initialization bug: BIO_new(BIO_f_asn1()) neglectedschwarze1-23/+10
initializing five of the fields in BIO_ASN1_BUF_CTX (prefix, prefix_free, suffix, suffix_free, ex_arg), inviting a segfault in a subsequent call from the application program to BIO_write(3) because subroutines of that function assume that the function pointers are either NULL or valid. Fix this by using the less error-prone calloc(3) idiom. While here, inline asn1_bio_init() at the only call site in asn1_bio_new() to simplify the code and make it easier to read. Bug found and initial patch by me, this version (with inlining) by and OK tb@.
2021-11-26make the bn/mont test compile with opaque DH.tb1-4/+12
2021-11-26Stop reaching into EVP_PKEY in the rest of libssl.tb6-38/+55
ok inoguchi jsing
2021-11-26Simplify two weirdly formatted pieces of code in ssl_rsa.c and stoptb1-27/+25
reaching into the EVP_PKEY struct. ok inoguchi jsing
2021-11-26openssl(1): drop support for netscape certificates and server gated keys.tb5-138/+12
ok inoguchi jsing
2021-11-26spellingjsg8-25/+25
ok schwarze@
2021-11-26after the bugfix in x509_vfy.c rev. 1.100,schwarze1-16/+12
replace the BUGS section with a shorter CAVEATS section
2021-11-26Bugfix in X509_get_pubkey_parameters(3):schwarze1-3/+5
If EVP_PKEY_copy_parameters(3) fails - among other reasons, this may happen when out of memory - the pkey argument and/or the chain argument will not contain all the desired parameters after returning. Consequently, report the failure to the caller rather than silently ignoring it. OK tb@
2021-11-26Simplify the code in X509_get_pubkey_parameters(3)schwarze1-8/+4
by using X509_get0_pubkey(3) instead of X509_get_pubkey(3); no functional change. OK tb@ This is similar to the relevant part of the follwoing commit from the OpenSSL 1.1.1 branch, which is still under a free licence, but without the bug that commit introduced into this function in OpenSSL: commit c01ff880d47392b82cce2f93ac4a9bb8c68f8cc7 Author: Dr. Stephen Henson <steve@openssl.org> Date: Mon Dec 14 13:13:32 2015 +0000
2021-11-25We know how to print a size_t now. Drop a comment and a cast.tb1-6/+4
ok bluhm inoguchi
2021-11-25Rework this test to compile with opaque RSAtb1-282/+427
2021-11-25Document BIO_method_name(3).schwarze1-48/+97
While here, also improve the rest of the page: * add missing BIO_TYPE_* constants * describe BIO_TYPE_START * better function argument names * more precision in the descriptions and regarding the RETURN VALUES * lots of wording improvements * improve the coding style below EXAMPLES * delete a BUGS section describing cretaceous behaviour
2021-11-25Resolve last issue with opaque BIGNUM in this test.tb1-3/+3