summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/stack/stack.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-04-23Link c2sp test to buildtb1-1/+2
2023-04-23Import C2SP/CCTV testtb2-0/+247
This currently only covers Ed25519 using the c2sp-testvectors package and checks that our Ed25519 implementation behaves as expected from a "ref10" implementation. This test has Go and c2sp-testvectors as a hard dependency. It will optionally pick up any OpenSSL package installed on the system and test that as well. https://github.com/C2SP/CCTV https://github.com/C2SP/CCTV/tree/main/ed25519
2023-04-23Drop some extra parenthesestb1-2/+2
2023-04-23Drop a superfluous isneg check.tb1-2/+2
2023-04-23Add missing NULL check for BN_new()tb1-2/+5
2023-04-23Initialize ishex and isneg at the top and drop some elsestb1-6/+4
2023-04-23Align hex_to_string with OpenSSL 1.1 behaviortb1-3/+5
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 NULLtb1-4/+4
2023-04-22Document the change in default to comma plus space but leave out thetb1-2/+5
compat nonsense
2023-04-22Fix UTF-8 issuer printingtb1-2/+6
If no field separator is specified, default to using the comma plus space separation, unless the compat flag is set. Fixes an a bug with printing issuers and other things that contain UTF-8 Reported by Jean-Luc Duprat The very simple fix ix is a joint effort by Henson and Levitte Fixes libressl/portable issue #845 ok jsing
2023-04-22Improve bn_montgomery_multiply_words()jsing1-9/+16
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-22Provide initial regress for BN_{asc,dec,hex}2bn()/BN_bn2{dec,hex}()jsing2-1/+592
2023-04-21cms_io: sort includestb1-3/+4
2023-04-21cms_io: reverse polarity of an if statement to unindenttb1-10/+12
2023-04-21cms_io: Remove a stupid else branchtb1-4/+2
If you can initialize with functions, you can also initialize with constants...
2023-04-21Rewrap some lines. No binary changetb1-10/+10
2023-04-21Unwrap a linetb1-3/+2
2023-04-21s2i_ASN1_INTEGER: make error conditions more explicit, a few more tweakstb1-10/+18
2023-04-21s2i_ASN1_INTEGER.3: minor fixestb1-4/+8
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 codestb1-10/+20
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 documentationtb1-48/+3
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 duplicate includejsg1-2/+1
ok otto@
2023-04-21Remove the now unused x509_enum.ctb2-65/+1
2023-04-21Move the CRL reason method into x509_bitst.ctb2-33/+33
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()tb2-17/+18
These functions probably belong into asn1/ but they definitely don't belong into separate files.
2023-04-21Tweak whitespace gone wrongtb1-5/+4
2023-04-21Stop using ENUMERATED_NAMEStb1-3/+5
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 Xrtb1-3/+3
2023-04-20Flip the default of explicitText to UTF8Stringtb1-2/+2
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 buildtb1-1/+2