summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2023-03-29Whitespace fixes.Joel Sing
Mechanically replace "a,b" with "a, b". No change to generated assembly.
2023-03-29Whitespace fixes.Joel Sing
Mechanically replace "a,b" with "a, b", followed with some manual indentation clean up. No change in generated assembly.
2023-03-29Use multiple statements instead of a statement with multiple expressions.Joel Sing
No change in generated assembly.
2023-03-29Mop up MD32_XARRAY from SHA1.Joel Sing
MD32_XARRAY (formerly SHA_XARRAY) was added as a workaround for a broken HP C compiler (circa 1999). Clean it up to simplify the code. No change in generated assembly. ok miod@ tb@
2023-03-29Inline initial hash data values for SHA1.Joel Sing
This follows what is done for other SHA implementations. ok miod@ tb@
2023-03-27Reorder functions/code.Joel Sing
No intended functional change.
2023-03-27Replace the remaining BN_copy() with bn_copy()Theo Buehler
ok jsing
2023-03-27Convert BN_copy() with missing error checks to bn_copy()Theo Buehler
ok jsing
2023-03-27Convert BN_copy() with explicit comparison against NULL to bn_copy()Theo Buehler
ok jsing
2023-03-27Use bn_copy() rather than inlining itTheo Buehler
ok jsing
2023-03-27Tidy includes.Joel Sing
2023-03-27Avoid errno is EINVAL after OpenSSL initializationJan Klemkow
ok tb@
2023-03-27Drop unnecessary parentheses.Theo Buehler
ok jsing
2023-03-27Convert bn_nist.c to BN_copy()Theo Buehler
Like everything else in this file, the use of BN_copy() needs to be ... special. Simplify using the new bn_copy(). ok jsing
2023-03-27Add bn_copy(), a sane wrapper of BN_copy() for internal useTheo Buehler
ok jsing
2023-03-26Replace HASH_BLOCK_DATA_ORDER with sha1_block_data_order.Joel Sing
The only reason to use HASH_BLOCK_DATA_ORDER in the implementation is to make the code harder to read.
2023-03-26Remove unnecessary HIDDEN_DECLS.Joel Sing
2023-03-26Removes some unwanted spaces.Joel Sing
2023-03-26Whack sha1dgst.c with the style(9) stick again.Joel Sing
2023-03-26Minor whitespace tidyingTheo Buehler
2023-03-26Tidy up includes.Joel Sing
2023-03-26Inline sha_local.h in sha1dgst.c.Joel Sing
Nothing other than sha1dst.c uses this header - pull it in to sha1dgst.c directly (sha_local.h will be removed at a later date).
2023-03-26Make several calls to BN_nnmod() unconditionalTheo Buehler
This removes a potential branch in a sensitive function and makes the code a lot simpler. It is a really bad idea optimize here for what davidben aptly calls "calculator" purposes. ok jsing
2023-03-26Correctly reduce negative inpot to BN_mod_exp2_mont()Theo Buehler
Negative bases could result in a negative modulus being returned. This is not strictly speaking incorrect but slightly surprising. This is all a consequence of the shortcut of defining BN_mod() as a macro using BN_div(). Fixes ossfuzz #55997 ok jsing
2023-03-26Add license to sha256.c/sha512.c.Joel Sing
2023-03-26Use multiple statements instead of comma separated expressions.Joel Sing
No change to generated assembly.
2023-03-26Add blank lines for readability.Joel Sing
2023-03-26Add some blank lines for readability, along with some more style(9) tweaks.Joel Sing
2023-03-26Whack sha with a style(9) stick.Joel Sing
No change in generated assembly.
2023-03-26bn_prime.pl: fix shebang and a couple more whitespace tweaksTheo Buehler
2023-03-25Last arg is also a pointer, so pass NULL instead of 0; ok deraadt@Otto Moerbeek
2023-03-25Change malloc chunk sizes to be fine grained.Otto Moerbeek
The basic idea is simple: one of the reasons the recent sshd bug is potentially exploitable is that a (erroneously) freed malloc chunk gets re-used in a different role. malloc has power of two chunk sizes and so one page of chunks holds many different types of allocations. Userland malloc has no knowledge of types, we only know about sizes. So I changed that to use finer-grained chunk sizes. This has some performance impact as we need to allocate chunk pages in more cases. Gain it back by allocation chunk_info pages in a bundle, and use less buckets is !malloc option S. The chunk sizes used are 16, 32, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 640, 768, 896, 1024, 1280, 1536, 1792, 2048 (and a few more for sparc64 with its 8k sized pages and loongson with its 16k pages). If malloc option S (or rather cache size 0) is used we use strict multiple of 16 sized chunks, to get as many buckets as possible. ssh(d) enabled malloc option S, in general security sensitive programs should. See the find_bucket() and bin_of() functions. Thanks to Tony Finch for pointing me to code to compute nice bucket sizes. ok tb@
2023-03-25Use strict and warningsTheo Buehler
2023-03-25Make an attempt at reducing the eyebleed in bn_prime.plTheo Buehler
Use a style more resembling KNF and drop lots of parentheses. Simplify a few things. No change in generated output on success.
2023-03-25Use Eric Young's usual license in the proper place rather than a weirdTheo Buehler
commented-out license stub in a HERE document.
2023-03-25Add RCSIDTheo Buehler
2023-03-25Add checks to ensure the uint16_t array isn't overflowed when thisTheo Buehler
script is run. This is more of an issue with uint16_t now than it was with prime_t aka BN_ULONG before r1.6.
2023-03-25Zap an empty lineTheo Buehler
2023-03-25Drop unnecessary casts from and to void *Theo Buehler
2023-03-25Unindent asn1_bio_get_ex()Theo Buehler
2023-03-25Pull in <openssl/rsa.h> directlyTheo Buehler
This is needed for many reasons. It is currently pulled in via x509.h but only when OPENSSL_NO_DEPRECATED is undefined. Again this should be fixed in the public header as well.
2023-03-25BN_free() is defined in <openssl/bn.h>Theo Buehler
This is currently pulled in via dsa.h and ecdsa.h, but only when OPENSSL_NO_DEPRECATED is not defined. We should fix this in the public header, too - let's wait a bit with that.
2023-03-18fixes for mandoc -TlintJonathan Gray
ok tb@
2023-03-16Consistent phrasing: function -> function pointerJob Snijders
2023-03-16Add X509_STORE_{set,get}_check_issued and X509_STORE_CTX_get_check_issued to ↵Job Snijders
manpage with and OK tb@
2023-03-16Install EVP_CIPHER_meth_new.3Theo Buehler
2023-03-16Add EVP_CIPHER_meth_* documentation from OpenSSL 1.1Theo Buehler
This is essentially the original text with a few tweaks and fixes by me, removing parts inapplicable to LibreSSL. There are dangling references to EVP_CIPHER_CTX_copy(3) and EVP_CIPHER_CTX_get_cipher_data(3). This all isn't great, but it's better than nothing. Probably good enough for these rarely used functions.
2023-03-16Update manpage for X509_CRL_get0_tbs_sigalg()Job Snijders
OK tb@
2023-03-16Bump LibreSSL version to 3.7.2Theo Buehler
2023-03-15Fix a number of out of bound reads in DNS response parsing.Todd C. Miller
Originally from djm@. OK deraadt@ florian@ bluhm@