summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/eck_prn.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use err_local.h rather than err.h in most placestb2025-05-101-2/+2
| | | | ok jsing
* Simplify ecpk_print_explicit_parameters()tb2025-01-251-4/+2
| | | | | | | | At this point the NID is always NID_X9_62_prime_field, so we can use SN_X9_62_prime_field directly rather than getting the field type from the method and then converting the nid to an sn with OBJ_nid2sn(). ok jsing
* Unify checking for the asn1_flagtb2024-11-251-2/+2
| | | | | | | | | | | There are only two flag values that libcrypto understands and the default value is 1 while, helpfully, the undesirable non-default is 0. The few existing callers set OPENSSL_EC_NAMED_CURVE or OPENSSL_EC_EXPLICIT_CURVE. Nevertheless, the flag should be checked properly as a flag. The recent upstream checks for EC_GROUP_get_asn1_flag(group) == OPENSSL_EC_NAMED_CURVE don't look right either... ok jsing
* eck_prn: some more air to breathetb2024-11-141-1/+3
|
* eck_prn: fix includestb2024-11-141-2/+4
|
* ec_prn: use pkey rather than pk for an EC_KEYtb2024-11-141-11/+11
|
* eck_prn: use group rather than x for an EC_GROUPtb2024-11-141-3/+3
|
* eck_prn: use ec_key rather than x for an EC_KEYtb2024-11-141-9/+9
|
* eck_prn: consistently use bio for a BIO rather than b and bp randomlytb2024-11-141-43/+43
|
* eck_prn: sprinkle some empty lines and drop some parens for consistencytb2024-11-141-7/+23
|
* eck_prn: shuffle printing functions into a better ordertb2024-11-141-47/+47
|
* Provide and use ec_group_get_field_type()tb2024-10-221-2/+2
| | | | | | | | | 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
* Inline a better version of print_bin() in only callertb2023-11-211-42/+27
| | | | | | | | | | Instead of printing to a temporary buffer with weird gymnastics, we can simply write things out to the BIO using proper indent. This still isn't perfect since we have a CBS version of this in ecx_buf_print(), which is basically what used to be ASN1_buf_print(). Annotate this with an XXX for future cleanup. ok beck
* Fix a <= 5-byte buffer overwrite in print_bin()tb2023-11-211-2/+3
| | | | | | | | | | | | If the offset is > 124, this function would overwrite between 1 and 5 bytes of stack space after str[128]. So for a quick fix extend the buffer by 5 bytes. Obviously this is the permanent fix chosen elswehere. The proper fix will be to rewrite this function from scratch. Reported in detail by Masaru Masuda, many thanks! Fixes https://github.com/libressl/openbsd/issues/145 begrudging ok from beck
* Hide symbols in hkdf, evp, err, ecdsa, and ecbeck2023-07-071-1/+7
| | | | | | (part 2 of commit) ok jsing@
* Convert ecpk_print_explicit_parameters() to bn_printf()tb2023-07-061-34/+8
| | | | | | | This eliminates a few stupid dances the horrible ASN1_bn_print() API required. ok jsing
* Explicit parameter printing can also use get0_order()tb2023-07-031-5/+6
| | | | ok beck jsing
* Fix typo in previoustb2023-07-021-2/+2
|
* Use asprintf() to avoid repetition in string constantstb2023-07-021-6/+13
| | | | | | ... since ASN1_bn_print() is stupid. ok jsing
* Split ECPKParameters_print()tb2023-07-021-121/+150
| | | | | | | | | This function has two entirely independent parts, so instead of a huge if/else just use two functions. In ecpk_print_explicity parameters() do some additional boring cleanup such as switching to actually using the local BN_CTX and shuffling things into a slightly more sensible order. ok jsing
* Simplify ASN1_bn_print() usage in ec/tb2023-07-011-25/+17
| | | | | | | ASN1_bn_print() doesn't print anything if the BIGNUM passed in is NULL. Also simplify the handling of the point conversion form of the generator. ok jsing
* Remove some dead code from ECPKParameters_print()tb2023-06-271-31/+6
| | | | | | | This code is unreachable since binary curve support was removed. There is a lot more to clean up in here... ok jsing
* Fix an annoying quirk in the EC codetb2022-11-191-9/+9
| | | | | | 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-9/+9
|
* Fix a few more leaks in *_print() functions.tobhe2022-11-101-9/+19
| | | | ok jsing@
* Simplify after EC_POINT_get_curve() additiontb2021-04-201-16/+4
| | | | ok jsing
* Prepare to provide EC_GROUP_{get,set}_curve(3)tb2021-04-201-3/+3
| | | | | | | | | | | | | 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
* recommit label indentation part of the backout; clearly unrelated to thetb2018-07-151-2/+2
| | | | breakage.
* back out ecc constant time changesjsg2018-07-151-2/+2
| | | | | | | | 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-2/+2
|
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-5/+5
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* Have ECPKParameters_print() include the NIST curve name, if known.jsing2015-06-201-1/+10
| | | | | | From OpenSSL. ok miod@ (a while ago).
* if (x) FOO_free(x) -> FOO_free(x).miod2014-07-121-15/+8
| | | | | | | Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-111-4/+4
| | | | | | | | Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
* Explicitly include <openssl/opensslconf.h> in every file that referencesjsing2014-07-101-1/+3
| | | | | | | | | an OPENSSL_NO_* define. This avoids relying on something else pulling it in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is never going to do anything, since OPENSSL_NO_XYZ will never defined, due to the fact that opensslconf.h has not been included. This also includes some miscellaneous sorting/tidying of headers.
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-101-1/+3
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* more: no need for null check before freederaadt2014-05-301-2/+1
| | | | ok tedu guenther
* Everything sane has stdio, and FILE *. we don't need ifdefs for this.beck2014-05-291-2/+0
| | | | ok to firebomb from tedu@
* knf approximationtedu2014-05-061-157/+133
|
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-2/+2
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* import OpenSSL-1.0.1cdjm2012-10-131-1/+2
|
* import OpenSSL-1.0.0adjm2010-10-011-0/+391