summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/reallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-06-07Add a cast to SSL_SESSION_get_id() to indicate that session_id_lengthtb1-2/+2
is deliberately reduced to an unsigned int. Since the session_id is at most 32 bytes, this is not a concern. ok jsing
2022-06-07fix indenttb1-2/+2
2022-06-07Unindent and simplify remove_session_lock()tb1-21/+22
ok jsing (who informs me he had the same diff in his jungle)
2022-06-07Drop an unnecessary casttb1-2/+2
ok jsing
2022-06-07Simplify CBS_write_bytes() invocationtb1-5/+2
Now that master_key_length is a size_t, we no longer have to fiddle with data_len. We can rather pass a pointer to it to CBS_write_bytes(). ok jsing
2022-06-07The master_key_length can no longer be < 0tb1-2/+2
ok jsing
2022-06-07Switch the SSL_SESSION's master_key_length to a size_ttb1-2/+2
ok jsing
2022-06-07Add error checking to tls_session_secret_cb() callstb2-32/+49
Failure of this undocumented callback was previously silently ignored. Follow OpenSSL's behavior and throw an internal error (for lack of a better choice) if the callback failed or if it set the master_key_length to a negative number. Unindent the success path and clean up some strange idioms. ok jsing
2022-06-06Use SSL3_CK_VALUE_MASK instead of hardcoded 0xffff and remove sometb2-12/+6
SSLv2 remnants. ok jsing
2022-06-06Tweak comment describing the SSL_SESSION ASN.1tb1-4/+5
ok jsing
2022-06-06Minor style cleanup in ssl_txt.ctb1-23/+41
Wrap long lines and fix a bug where the wrong struct member was checked for NULL. ok jsing
2022-06-06Fix comment + spacing.tb1-2/+2
Apparently 60 * 5 + 4 seconds is 5 minutes. Presumably this is the case with sufficiently potent crack, which would explain a few things in here.
2022-06-06Remove incorrect and ungrammattical commenttb1-3/+2
The fallback to SHA-1 if SHA-256 is disabled fell victim to tedu many moons ago when this file was still called s3_clnt.c and had no RCS ID.
2022-06-06Fix spaces before tabstb1-12/+12
2022-06-06Minor tweaks to psk modes regresstb1-3/+3
2022-06-05move the calls to psk kex modes tests down to match order in ssl_tlsext.ctb1-4/+4
2022-06-05Add regress coverage for PSK kex modes tlsext handlers.tb1-2/+210
2022-06-04The parse stubs need to skip over the extension data.tb1-3/+3
Found by anton with tlsfuzzer ok anton
2022-06-04Tweak a comment using review feedback from jsingtb1-4/+4
2022-06-03Add stubbed out handlers for the pre_shared_key extensiontb2-2/+65
ok jsing
2022-06-03Implement handlers for the psk_key_exchange_modes extensions.tb2-3/+96
ok jsing
2022-06-03Add a use_psk_dhe_ke flag to the TLSv1.3 handshake structtb1-1/+4
This will be used to indicate client side support for DHE key establishment. ok jsing
2022-06-03Ensure that a client who sent a PSK extension has also sent a PSKtb1-4/+9
key exchange mode extension, as required by RFC 8446, 4.2.9. ok jsing
2022-06-03Provide #defines for the two currently registered PskKeyExchangeModes.tb1-1/+12
ok jsing
2022-06-02Use consistent spacing around assignmentstb1-4/+4
2022-06-02Only constraints and verify need static linking in here.tb2-5/+9
2022-05-28*** empty log message ***mbuhl4-11/+11
2022-05-25Remove an unnecessary XXX comment. The suggested check is part oftb1-5/+1
extract_min_max().
2022-05-24Clean up ASN1_item_sign_ctx() a littletb1-25/+38
Instead of inl, outl, and outll, use in_len, out_len, and buf_out_len. Use the appropriate types for them. Check return values properly, check for overflow. Remove some unnecessary casts and add some for readability. Use asn1_abs_set_unused_bits() instead of inlining it. This removes the last direct consumer of ASN1_STRING_FLAG_BITS_LEFT outside of asn1/a_bitstr.c. The flag is still mentioned in x509/x509_addr.c but that will hopefully go away soon. tweaks/ok jsing
2022-05-24Simplify ec_asn1_group2curve()tb1-18/+21
Don't try to reuse curve->seed to avoid an allocation. Free it unconditionally and copy over the group->seed if it's available. Use asn1_abs_set_unused_bits() instead of inlining it. ok jsing
2022-05-24Straightforward conversion of ecdh_cms_encrypt() totb1-3/+3
asn1_abs_set_unused_bits() ok jsing
2022-05-24Rewrite X509_PUBKEY_set0_param() to use asn1_abs_set_unused_bits()tb1-10/+8
This streamlines the logic and uses ASN1_STRING_set0() and asn1_abs_set_unused_bits() instead of inlining them. ok jsing
2022-05-24Use asn1_abs_set_unused_bits() in asn1_str2type()tb1-5/+6
ok jsing
2022-05-24Recent changes to truncate(2) swapped the ordering of some validationsanton1-2/+2
causing EACCESS as opposed of ESDIR to be returned while trying to truncate a directory as a user lacking write permissions to the same directory. As this behavior is reasonable, change the truncate directory from /etc/ to /tmp which makes the test pass both as root and non-root.
2022-05-21Remove some unhelpful comments and spell NULL correctly.jsing1-10/+4
2022-05-21Factor out ASN1_ITYPE_EXTERN handling.jsing1-15/+32
Factor out the ef->asn1_ex_d2i() callback handling - this allows us to pull out all of the related variables into a self-contained function. ok tb@
2022-05-21Use 'at' for ASN1_TEMPLATE variable names rather than 'tt'.jsing1-52/+58
Also use array indexes for it->templates, rather than trying to be extra clever in for loops (suggested by tb@ during a review). No functional change. ok tb@
2022-05-21Remove _ex_ from all of the internal function names.jsing1-35/+35
It no longer makes sense to have "extended" versions of functions internally. No functional change. ok tb@
2022-05-21system(3) should ignore SIGINT and SIGQUIT until the shell exits.millert1-4/+17
This got broken when system.c was converted from signal(3) to sigaction(2). Also add SIGINT and SIGQUIT to the set of blocked signals and unblock them in the parent after the signal handlers are installed. Based on a diff from Leon Fischer. OK deraadt@
2022-05-20Drop *out == NULL check in ASN1_STRING_to_UTF8()tb1-2/+6
Unfortunately, several things in the ecosystem depend on the existing API behavior of being able to pass in an uninitialized pointer on the stack: haproxy, grpc, mongo-tools and others show up on the first two pages of Debian codesearch. ok jsing
2022-05-20Don't pass uninitialized pointer to ASN1_STRING_to_UTF8()tb1-2/+2
Exposed by recent rewrite of ASN1_STRING_to_UTF8(). Found via grep after fixing CID 352831. ok jsing
2022-05-20Don't pass uninitialized pointer to ASN1_STRING_to_UTF8()tb1-2/+2
Exposed by recent rewrite of ASN1_STRING_to_UTF8(). CID 352831 ok jsing
2022-05-19Reorder functions within file.jsing1-624/+608
Order functions by use, moving public API to the bottom and utility functions to the top. This makes the code more logical/readable, plus we can remove all except one of the static function prototypes. No functional change.
2022-05-19Rewrite the asn1_template_*() functions with CBS.jsing1-218/+168
Rewrite the asn1_template_*() functions with CBS, readable variable names and free then alloc. This was the last caller of asn1_check_eoc() and asn1_check_tag(), hence remove them and rename the _cbs suffixed versions in their place. ok tb@
2022-05-19Add missing space between No macro and "authority".tb1-3/+3
2022-05-17Refactor asn1_d2i_ex_primitive()jsing1-98/+146
Split the object content handling off into asn1_d2i_ex_primitive_content(), move the handling ov V_ASN1_ANY into asn1_d2i_ex_any() and move the MSTRING handling into asn1_d2i_ex_mstring(). This way we parse the header once (rather than twice for ANY and MSTRING), then process the content, while also avoiding complex special cases in a single code path. ok tb@
2022-05-17Refactor ASN.1 template functions before rewriting.jsing1-133/+145
Change asn1_template_ex_d2i() so that we short circuit in the no explicit tagging case. Split out the SET OF/SEQUENCE OF handling from asn1_template_noexp_d2i() into a asn1_template_stack_of_d2i() function and simplify the remaining code. ok tb@
2022-05-17Expose asn1_abs_set_unused_bits() in asn1_locl.htb2-3/+4
Should have been part of a previous commit. ok jsing
2022-05-17Rewrite make_addressRange() using CBStb1-37/+104
Factor the trimming of the end and the counting of unused bits into helper functions and reuse an ASN.1 bit string API to set the unused bits and the ASN1_STRING_FLAG_BITS_SET. With a couple of explanatory comments it becomes much clearer what the code is actually doing and why. ok jsing
2022-05-17Simplify make_addressPrefix()tb1-21/+23
In order to set the BIT STRING containing an address prefix, use existing helper functions from the ASN.1 code instead of redoing everything by hand. Make the function single exit and rename a few variables to make it clearer what is being done. ok jsing