summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_asn1.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove params argument from ec_asn1_group2parameters()tb2024-10-111-13/+8
| | | | | | | Its only caller passes NULL, so we can simplify the entry point and the exit of this function a bit. ok jsing
* Simplify ec_asn1_group2pkparameters()tb2024-10-111-15/+8
| | | | | | | The parameters argument is always NULL, so we can simplify this helper accordingly. ok jsing
* Spell NULL in a simpler fashiontb2024-10-111-3/+5
| | | | | | | | priv_key->parameters is always NULL at this point, since its corresponding entry in the ASN.1 template has ASN1_TFLG_OPTIONAL set, so there is no point in pretending to pass it to ec_asn1_group2pkparameters(). ok jsing
* Clean up i2d_ECPKParameters()tb2024-10-111-10/+13
| | | | | | | | Use better variable names and turn it into single-exit. This changes the behavior slightly in that an error is pushed onto the stack also for i2d_ECPKPARAMETERS() return values < 0. ok jsing
* Make EC{,PK}PARAMETERS_it statictb2024-10-031-3/+3
| | | | They aren't used outside of this file.
* Fix ASN1_INTEGER_to_BN() misusetb2024-10-031-16/+16
| | | | | | | Same issue/leak as for BN_to_ASN1_INTEGER(). Stop reusing the elliptic curve parameters a and b for order and cofacter. It's confusing. ok jsing
* Switch field_bits to be an inttb2024-10-031-3/+3
| | | | ok jsing
* Fix BN_to_ASN1_INTEGER() misusetb2024-10-031-7/+6
| | | | | | | You can either let this API reuse an existing ASN1_INTEGER or you can let it allocate a new one. If you try to do both at the same time, you'll leak. ok jsing
* Remove comments from captain obvious and drop useless prototypestb2024-04-171-43/+1
|
* More X9.62 stuff was never used outside of ec_asn1.ctb2024-04-151-35/+5
| | | | | | We only need the ASN.1 items. ok jsing
* EC_PRIVATEKEY becomes internal-only, tootb2024-04-151-10/+10
| | | | ok jsing
* Unexport the ECPKPARAMETERS APItb2024-04-151-11/+11
| | | | ok jsing
* Make ECPARAMETERS_{new,free,it} internal-onlytb2024-04-151-5/+5
| | | | ok jsing
* Unbreak the namespace build after a broken mk.conf and tool misfire hadbeck2023-07-071-15/+1
| | | | | | | | me aliasing symbols not in the headers I was procesing. This unbreaks the namespace build so it will pass again ok tb@
* Hide symbols in hkdf, evp, err, ecdsa, and ecbeck2023-07-071-1/+24
| | | | | | (part 2 of commit) ok jsing@
* Simplify EC_GROUP_get_basis_type()tb2023-06-271-18/+2
| | | | | | | | The remaining EC_METHODs in libcrypto all have a field type of NID_X9_62_prime_field, so this function always returns 0. Make that more obvious. ok jsing
* Fix line wrappingtb2023-05-041-3/+3
|
* Fix function name in doc commenttb2023-05-041-2/+2
|
* Fix a few KNF/whitespace issuestb2023-05-031-9/+5
|
* GF2m bites the dust. It won't be missed.tb2023-04-251-190/+4
|
* Always clear EC groups and points on free.jsing2023-03-081-5/+5
| | | | | | | | | | Rather than sometimes clearing, turn the free functions into ones that always clear (as we've done elsewhere). Turn the EC_GROUP_clear_free() and EC_POINT_clear_free() functions into wrappers that call the *_free() version. Do similar for the EC_METHOD implementations, removing the group_clear_finish() and point_clear_finish() hooks in the process. ok tb@
* Make internal header file names consistenttb2022-11-261-3/+3
| | | | | | | | | | | | | | | | Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
* Fix an annoying quirk in the EC codetb2022-11-191-14/+14
| | | | | | Dealing with elliptic curves makes some people think that it would be kind of neat to multiply types with variable names. Sometimes. Only in function definitions.
* whitespacetb2022-11-191-14/+14
|
* Simplify ec_asn1_group2curve()tb2022-05-241-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
* Simplify priv_key handling in d2i_ECPrivateKey()tb2022-03-311-8/+3
| | | | | | | | | d2i_EC_PRIVATEKEY() can handle the allocation of priv_key internally, no need to do this up front and reach it through the dangerous reuse mechanism. There's also no point in freeing a variable we know to be NULL. ok jsing
* Garbage collect the app_items field of ASN1_ADBtb2022-01-141-3/+1
| | | | | | | This is unused and was removed in OpenSSL 5b70372d when it was replaced with an ASN.1 ADB callback (which we don't support). ok inoguchi jsing
* Remove some dead code that was missed in an earlier cleanup andtb2021-08-311-4/+3
| | | | | | | | fix a stale comment. Found by mortimer with clang 13's -Wunused-but-set-variable. ok beck
* Simplify after EC_POINT_get_curve() additiontb2021-04-201-14/+4
| | | | ok jsing
* Prepare to provide EC_GROUP_{get,set}_curve(3)tb2021-04-201-4/+4
| | | | | | | | | | | | | There are numerous functions in ec/ that exist with _GF2m and _GFp variants for no good reason. The code of both variants is the same. The EC_METHODs contain a pointer to the appropriate version. This commit hides the _GF2m and _GFp variants from internal use and provides versions that work for both curve types. These will be made public in an upcoming library bump. Similar to part of OpenSSL commit 8e3cced75fb5fee5da59ebef9605d403a999391b ok jsing
* Tweak comment.tb2018-09-011-5/+2
|
* recommit label indentation part of the backout; clearly unrelated to thetb2018-07-151-8/+10
| | | | breakage.
* back out ecc constant time changesjsg2018-07-151-10/+8
| | | | | | | | after the constant time commits various regress tests started failing on sparc64 ssh t9, libcrypto ec ecdh ecdsa and trying to ssh out resulted in 'invalid elliptic curve value' ok tb@
* Indent labels by a space so they don't obliterate function names in diffs.tb2018-07-101-8/+10
|
* Add a const qualifier to the 'key' argument of i2o_ECPublicKey() andtb2018-05-191-2/+2
| | | | | | | | | one to the last argument of each one of i2s_ASN1_OCTET_STRING(), s2i_ASN1_OCTET_STRING(), i2s_ASN1_INTEGER(), i2s_ASN1_ENUMERATED(), and i2s_ASN1_ENUMERATED_TABLE(). tested in a bulk build by sthen ok jsing
* Make whitespace between functions and structs a bit more consistent.tb2018-04-231-3/+7
|
* Fix for processing of EC public keyinoguchi2018-03-121-9/+19
| | | | | | | | | | | | | | Prevents segmentation fault while reading EC private key without public key. Generates missing EC public key when reading EC private key. Refer to these OpenSSL commits: 1f2b943254ce590867717375e4f364860a9b7154 2083f7c465d07867dd9867b8742bb71c03d1f203 Reported on GitHub https://github.com/libressl-portable/portable/issues/395 by Anton Bukov (@k06a) . ok beck@
* Avoid a potential NULL pointer dereference in d2i_ECPrivateKey().jsing2017-05-261-1/+7
| | | | | | Reported by Robert Swiecki, who found the issue using honggfuzz. ok bcook@
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-117/+103
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* " the the " -> " the ", or in a couple of cases replace the superfluouskrw2016-03-201-2/+2
| | | | | | "the" with the obviously intended word. Started with a "the the" spotted by Mihal Mazurek.
* Remove pointless externs - the structs are declared in the same files ajsing2015-10-161-3/+1
| | | | few lines above.
* Expand DECLARE_ASN1_ALLOC_FUNCTIONS and DECLARE_ASN1_FUNCTIONS_constjsing2015-10-161-6/+17
| | | | macros. The only change in the generated assembly is due to line numbering.
* Remove pointless uses of DECLARE_ASN1_ENCODE_FUNCTIONS_const.jsing2015-10-161-3/+3
| | | | | DECLARE_ASN1_FUNCTIONS_const already includes this macro so using both means we end up with duplicate function prototypes and externs.
* Replace remaining M_ASN1_BIT_STRING_(new|free) macros with calls tojsing2015-09-291-2/+2
| | | | | | ASN1_BIT_STRING_(new|free). ok beck@ doug@
* Replace remaining M_ASN1_STRING_* macros with calls to ASN1_STRING_*.jsing2015-09-101-5/+5
| | | | | | | This is not the same as the macro expansion, however the ASN1_STRING_* functions do match the macro expansions. ok doug@ miod@
* Expand obsolete M_ASN1.*(cmp|dup|print|set) macros - no change in generatedjsing2015-07-291-5/+5
| | | | | | assembly. ok bcook@
* Expand ASN.1 template macros - the generated assembly only differs byjsing2015-07-251-55/+351
| | | | changes to line numbers.
* Fix a memory leak in an error path.doug2015-03-201-1/+3
| | | | | | From OpenSSL commit 5e5d53d341fd9a9b9cc0a58eb3690832ca7a511f. ok guenther@, logan@
* Fix several crash causing defects from OpenSSL.tedu2015-03-191-21/+20
| | | | | | | | | | | | | These include: CVE-2015-0209 - Use After Free following d2i_ECPrivatekey error CVE-2015-0286 - Segmentation fault in ASN1_TYPE_cmp CVE-2015-0287 - ASN.1 structure reuse memory corruption CVE-2015-0289 - PKCS7 NULL pointer dereferences Several other issues did not apply or were already fixed. Refer to https://www.openssl.org/news/secadv_20150319.txt joint work with beck, doug, guenther, jsing, miod
* Expand the IMPLEMENT_ASN1_ALLOC_FUNCTIONS macro so that the code is visiblejsing2015-02-101-4/+37
| | | | | | | | | and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@