summaryrefslogtreecommitdiff
path: root/lib/libcrypto
AgeCommit message (Collapse)Author
2023-04-23Drop some extra parenthesesTheo Buehler
2023-04-23Drop a superfluous isneg check.Theo Buehler
2023-04-23Add missing NULL check for BN_new()Theo Buehler
2023-04-23Initialize ishex and isneg at the top and drop some elsesTheo Buehler
2023-04-23Align hex_to_string with OpenSSL 1.1 behaviorTheo Buehler
This is a bit of a strange one. When this function was moved and renamed, somehow checks for NULL pointers and 0 length were lost. Whether that was due to great review missing it or great review suggesting it, is unclear. Now the function can actually legitimately be called with a length of 0 (as ASN.1 OCTET STRINGS can have length 0) and "" is the appropriate representation for that, so the fix is to allocate a 0 octet. That much was correct. What was completely missed is that a long can be negative which will then still lead to an out-of-bounds access. So fix that as well. Finally, don't malloc 3 * len + 1 without overflow checking. Rather use calloc's internal checks. The + 1 isn't really needed anyway. All this is still really gross and can be done much more cleanly and safely with CBB/CBS. This will done later once we have better regress coverage. ok jsing
2023-04-23x509_utl.c: Use correct spelling of NULLTheo Buehler
2023-04-22Improve bn_montgomery_multiply_words()Joel Sing
Pull a number of invariants into variables, which avoids repeated loading from memory on architectures where sufficient registers are available. Also keep track of the per-iteration carry in a variable, rather than unnecessarily reading from and writing to memory. This gives a reasonable performance gain on some architectures (e.g. armv7)
2023-04-21cms_io: sort includesTheo Buehler
2023-04-21cms_io: reverse polarity of an if statement to unindentTheo Buehler
2023-04-21cms_io: Remove a stupid else branchTheo Buehler
If you can initialize with functions, you can also initialize with constants...
2023-04-21Rewrap some lines. No binary changeTheo Buehler
2023-04-21Unwrap a lineTheo Buehler
2023-04-21s2i_ASN1_INTEGER: make error conditions more explicit, a few more tweaksTheo Buehler
2023-04-21s2i_ASN1_INTEGER.3: minor fixesTheo Buehler
Fix botched Xr and be more precise about errors by being less precise. Add a BUGS section.
2023-04-21Uncomment and document X.509 verifier error codesTheo Buehler
These are in actual use, so their meaning should be documented. The remaining commented codes are unused outside of x509_txt.c except for X509_V_ERR_INVALID_NON_CA which looks used at first glance, but it is actually in an unreachable path of the legacy verifier.
2023-04-21Remove some (soon to be) outdated documentationTheo Buehler
The documentation of the BN_MOD_CTX has been out of sync with reality for decades. The structure is now opaque, so its members should not be documented this way. They internals aren't important for the rest of the page. BN_MOD_CTX_init() will soon be removed. It's useless unless you like leaks.
2023-04-21Remove the now unused x509_enum.cTheo Buehler
2023-04-21Move the CRL reason method into x509_bitst.cTheo Buehler
The CRL extension handler is completely misplaced in x509_enum.c. Move it to x509_bitst.c until we find a better home for it. This way it is next to the other two extension methods that have the extra usr_data contortion.
2023-04-21Move i2s_ASN1_ENUMERATED_TABLE() next to i2s_ASN1_ENUMERATED()Theo Buehler
These functions probably belong into asn1/ but they definitely don't belong into separate files.
2023-04-21Tweak whitespace gone wrongTheo Buehler
2023-04-21Stop using ENUMERATED_NAMESTheo Buehler
This is a public alias for the also public BIT_STRING_BITNAME. The ENUMERATED_NAMES type is used exactly twice, namely on two lines in this file. This is silly.
2023-04-20Fix Dt and XrTheo Buehler
2023-04-20Flip the default of explicitText to UTF8StringTheo Buehler
While it may have been reasonable to use VisibleString back when this code was written, it's an anachronism nowadays. In particular, configuring BoringSSL reports that they have seen malformed certificates with exactly the issue caused by this unfortuante default. Reported by Alex Gaynor in OpenSSL issue 20772 ok jsing
2023-04-20Link s2i_ASN1_INTEGER.3 to buildTheo Buehler
2023-04-20Add documentation for s2i_ASN1_INTEGER and related functionsTheo Buehler
These functions convert strings to internal objects and vice versa. This is a best effort, probably with a lot of room for improvement, which can happen in tree if anyone cares. It's better than nothing. Nothing in turn would be significantly better than the utter garbage a related project has managed to land as part of their efforts towards significant documentation improvements in a recent major relase. This leaves a dangling reference to the misnamed X509V3_METHOD_get_nid(3) which I may or may not fill in the future. I am unsure about the HISTORY section's precision, but that's what I got from cvs history. All these functions are about a quarter century old (and it shows), so I don't think it matters very much.
2023-04-19Fix botched line wrapTheo Buehler
2023-04-19remove duplicate includesJonathan Gray
ok tb@
2023-04-19Rename Hex array to hex_digits.Joel Sing
ok tb@
2023-04-19Move the BN_bn2bin()/BN_bin2bn() family to bn_convert.cJoel Sing
2023-04-19Reorder functions.Joel Sing
No functional change.
2023-04-19Move BN_options() from bn_convert.c to bn_lib.cJoel Sing
2023-04-19unifdef BN_RECURSIONJoel Sing
This removes a bunch of incomplete and scary code, which potentially leaks secrets and is not constant time. A performance gain is achieved on arm64 for sizes that we care about, while a minimal decrease in performance is noted for larger sizes on some other platforms. While we will potentially reimplement Karatsuba (or Toom-Cook) at a later date, it will be easier and safer to do it from a clean slate. ok tb@
2023-04-18Use NULL, not 0 for pointers and use an explicit comparison against NULL.Theo Buehler
2023-04-18Remove prototypes under OPENSSL_NO_EC_NISTP_64_GCC_128Theo Buehler
The code was deleted a while back, the prototypes remained. We had OPENSSL_NO_EC_NISTP_64_GCC_128 in opensslfeatures.h since forever. discussed with jsing
2023-04-18Move x509.h inclusion into alphabetical orderTheo Buehler
2023-04-18Bring includes into canonical orderTheo Buehler
Requested by jsing
2023-04-18Sigh cvs... Also drop OPENSSL_NO_DEPRECATED from ec.hTheo Buehler
2023-04-18Move some includes out of OPENSSL_NO_DEPRECATEDTheo Buehler
Some headers were included conditionally on OPENSSL_NO_DEPRECATED in hopes that eventually the mess of everything includes everything will magically resolve itself. Of course everyone would end up building openssl with OPENSSL_NO_DEPRECATED over time... Right. Surprisingly, the ecosystem has come to rely on these implicit inclusions, so about two dozen ports would fail to build because of this. Patching this would be easy but really not worth the effort. ok jsing
2023-04-17Drop two useless READMEsTheo Buehler
"go ahead" jsing
2023-04-17c_zlib.c needs bio_local.h with -DZLIB.Theo Buehler
Apparently nobody tried to compile libcrypto with ZLI since Jan 2022. Maybe this means that we can unifdef -U ZLIB or maybe not...
2023-04-17Tweak indent and use named registers.Joel Sing
No functional change.
2023-04-17Hook sha3 up to build.Joel Sing
ok tb@
2023-04-17Move BN_bn2mpi()/BN_mpi2bn() into bn_convert.cJoel Sing
2023-04-17Use C99 initializers for the default_pctx and mark it static constTheo Buehler
2023-04-17Add missing const qualifiers to the v3_* externsTheo Buehler
ok jsing
2023-04-17Fix whitespace in DHparam_print_fp()Theo Buehler
2023-04-17Remove now unused dh_prn.cTheo Buehler
2023-04-17Drop dh_prn.cTheo Buehler
2023-04-17Move DHparam_print_fp() next to DHparam_print()Theo Buehler
As usual with the fp suffix, the former wraps the latter with a file BIO. There is no reason for this function to be in a separate file.
2023-04-16Fix previous: add a missing andTheo Buehler