summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-10-28Rename the EC_KEY in i2d_ECPrivateKey() to ec_keytb1-14/+14
2024-10-28ec_print.c: fix includes.tb1-2/+6
It doesn't currently need ec_local.h, but it will soon, so leave it there.
2024-10-28c2sp: run test against openssl/3.4 if it is installedtb1-2/+2
2024-10-27d2i_ECParameters: clean up entry and exittb1-13/+17
2024-10-27d2i_ECParameters: rename a to out_ec_keytb1-7/+7
2024-10-27d2i_ECParameters: rename ret to ec_keytb1-9/+9
2024-10-27i2d_ECParameters: rename a to ec_keytb1-4/+4
2024-10-26{d2i,i2d}_ECParameters() also want a bit of exercisingtb1-1/+28
2024-10-26d2i_ECPrivateKey: move the version setting where it belongstb1-2/+2
2024-10-26d2i_ECPrivateKey: minor cleanup for entry and exit pathtb1-13/+13
Reduces an upcoming diff which is hard enough to review without these distractions.
2024-10-26a and ret aren't great names for EC_KEYstb1-26/+26
2024-10-26Mechanically rename priv_key to ec_privatekeytb1-27/+27
2024-10-26ec_asn1_test: play some silly games to cover a few more code pathstb1-1/+47
2024-10-26Add regress coverage for ec_print.ctb1-2/+889
Of course the four stunning beauties in there aren't printing anything. the hex family converts an elliptic curve point's X9.62 encoding into a hex string (which kind of makes sense, you can print that if you want). Much more astounding is EC_POINT_point2bn() where the X9.62 octet string is interpreted as a BIGNUM. Yes, the bignum's hex digits are the point conversion form followed by the affine coordinate(s) of the elliptic curve point, and yes you can choose between compressed, uncompressed, and hybrid encoding, why do you ask? This doesn't really make any sense whatsoever but of course you can also print that if you really want to. Of course the beloved platinum members of the "gotta try every terrible OpenSSL interface" club had to use and expose this.
2024-10-25Cosmetic tweak to make point2oct and oct2point more symmetrictb1-7/+12
This can't be perfectly symmetric, but the logic is now roughly the same in both these functions.
2024-10-25Use macros describing the intent rather than #if 0tb1-8/+38
2024-10-25ec_asn1: make two helpers statictb1-3/+3
2024-10-25Minor cosmetic tweaks for EC_GROUP_set_seed()tb1-9/+8
No need to guard free() with a NULL check, check explicitly against 0 and rename p to seed.
2024-10-25ec_asn1: fix some NULL misspellingstb1-4/+4
2024-10-25Add regress for {d2i,i2d}_ECPrivateKey() and {o2i,i2o}_ECPublicKey()tb1-1/+1003
Some test cases are disabled since they exercise an upcoming bug fix.
2024-10-24Fix argument names: des_in -> der_in and des_out -> der_outtb2-19/+19
2024-10-24Add missing error check for CBB_init_fixed()tb1-4/+5
CID 511280
2024-10-23ec_point_conversion: cosmeticstb1-4/+4
2024-10-23ec_point_conversion: extend test coverage by translating back thetb1-2/+76
point to an octet string and match with the initial octet string. would have caught the regression found by anton
2024-10-23EC_POINT_point2oct() need to special case the point at infinitytb1-4/+10
This is annoying since it undoes some polishing done before commit and reintroduces an unpleasant asymmetry. found by anton via openssl-ruby tests ok jsing
2024-10-23EC_get_builtin_curves(): the most appropriate name for a list of curves...tb1-5/+5
... is obviously r.
2024-10-23remove duplicate defines; ok tb@jsg3-13/+3
2024-10-22remove duplicate X509v3_asid_add_id_or_range.3 linejsg1-2/+1
2024-10-22Move a check for hybrid point encoding into a helper functiontb1-7/+14
2024-10-22Rewrite ec_GFp_simple_point2oct() using CBBtb1-63/+90
Factor ad-hoc inline code into helper functions. Use CBB and BN_bn2binpad() instead of batshit crazy skip loops and pointer banging. With all this done, the function becomes relatively streamlined and pretty much symmetric with the new oct2point() implementation. ok jsing
2024-10-22Rewrite ec_GFp_simple_oct2point() using CBStb1-57/+86
Transform the spaghetti in here into something more readable. Factor various inline checks into helper functions to make the logic clearer. This is a bit longer but a lot safer and simpler. It accepts exactly the same input as the original version. ok jsing
2024-10-22Start cleaning up oct2point and point2octtb1-5/+41
The SEC 1 standard defines various ways of encoding an elliptic curve point as ASN.1 octet string. It's also used for the public key, which isn't an octet string but a bit string for whatever historic reason. The public API is incomplete and inconvenient, so we need to jump through a few hoops to support it and to preserve our own sanity. Split a small helper function out of ec_GFp_simple_point2oct() that checks that a uint8_t represents a valid point conversion form. It supports exactly the four possible variants and helps translating from point_conversion_form_t at the API boundary. Reject the form for the point at infinity since the function has historically done that even for the case that the point actually is the point at infinity. ok jsing
2024-10-22Suppress warning noise from deprecated OpenSSL APItb1-1/+2
2024-10-22Revert marking EC_GROUP_method_of() and EC_METHOD_get_field_type() unusedtb1-3/+3
breaks tree as noted by krw
2024-10-22ecp_oct.c: add missing includestb1-1/+5
2024-10-22Mark EC_GROUP_method_of() and EC_METHOD_get_field_type() as unusedtb1-3/+3
ok jsing
2024-10-22Provide and use ec_group_get_field_type()tb4-8/+17
All internal uses of EC_METHOD_get_field_type() and EC_GROUP_method_of() are chained together. Implement this as a single API call that takes a group and use it throughout. Gets rid of another eyesore in this part of the tree. Not that there will be a shortage of eyesores anytime soon... ok jsing
2024-10-22Inline a use of EC_GROUP_method_of()tb1-2/+2
We can just reach into the group to obtain its EC_GROUP_METHOD. After all ec_local.h has to be in scope. This will permit marking this ugly API as unused internally after the next commit. ok jsing
2024-10-20ec_ameth.c: fix includestb1-3/+9
2024-10-20ec_asn1: add missing includestb1-2/+6
2024-10-20ec_curve: add missing includestb1-1/+5
2024-10-20zap an empty linetb1-2/+1
2024-10-19Make ec EVP_PKEY_CTRL_MD handler match dsa/rsa more closelytb1-11/+14
This makes the thing a bit easier on the eyes and improves greppability. ok joshua jsing
2024-10-19Drop a useless cast in pkey_dsa_ctrl()tb1-2/+2
ok joshua jsing
2024-10-19Remove IA32 specific code from cryptlib.c.jsing5-41/+29
Move the IA32 specific code to arch/{amd64,i386}/crypto_cpu_caps.c, rather than polluting cryptlib.c with machine dependent code. A stub version of crypto_cpu_caps_ia32() still remains for now.
2024-10-19Remove unused sparc CPU capability detection code.jsing3-204/+1
This has been unused for a long time - it can be found in the attic if someone wants to clean it up and enable it in the future. ok tb@
2024-10-19EC_GROUP_check(): zap useless commentstb1-4/+3
2024-10-19Move EC_GROUP_check() to ec_lib.ctb3-115/+57
EC_GROUP_check() is quite simple. It doesn't need to use its own file.
2024-10-18ec_asn1_test: simplify previoustb1-7/+4
2024-10-18ec_asn1_test: call EC_GROUP_check() for the builtin curvestb2-59/+13
This makes the internal curve test in ectest.c superfluous. Also fix a logic error.