From: Shane Lontis Date: Tue, 2 Apr 2019 00:55:00 +0000 (+1000) Subject: doc fixups X-Git-Tag: openssl-3.0.0-alpha1~2190 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fopenssl.git;a=commitdiff_plain;h=37f03b9881a4ffa52b0059ae444be3c416cf2a5f doc fixups Reviewed-by: Nicola Tuveri Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8555) --- diff --git a/crypto/ec/ec_check.c b/crypto/ec/ec_check.c index 09e3deb048..097d7e1cc5 100644 --- a/crypto/ec/ec_check.c +++ b/crypto/ec/ec_check.c @@ -16,7 +16,7 @@ int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only) nid = ec_curve_nid_from_params(group); if (nid > 0 && nist_only && EC_curve_nid2nist(nid) == NULL) - nid = 0; + nid = NID_undef; return nid; } diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c index e7a3bd8488..6c7c9ddbc7 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c @@ -3241,8 +3241,8 @@ int ec_curve_nid_from_params(const EC_GROUP *group) BN_CTX_start(ctx); /* - * The in built curves contains data fields (p, a, b, x, y, order) that are - * all zero padded to be the same size. The size of the padding is + * The built-in curves contains data fields (p, a, b, x, y, order) that are + * all zero-padded to be the same size. The size of the padding is * determined by either the number of bytes in the field modulus (p) or the * EC group order, whichever is larger. */ @@ -3303,7 +3303,7 @@ int ec_curve_nid_from_params(const EC_GROUP *group) && (data->seed_len == 0 || seed_len == 0 || ((size_t)data->seed_len == seed_len && OPENSSL_memcmp(params_seed, seed, seed_len) == 0)) - /* Check that the groups params match the inbuilt curve params */ + /* Check that the groups params match the built-in curve params */ && OPENSSL_memcmp(param_bytes, params, param_len * NUM_BN_FIELDS) == 0) { ret = curve.nid; diff --git a/doc/man1/ecparam.pod b/doc/man1/ecparam.pod index bfed11f1bc..fac930ea41 100644 --- a/doc/man1/ecparam.pod +++ b/doc/man1/ecparam.pod @@ -83,7 +83,7 @@ Validate the elliptic curve parameters. =item B<-check_named> Validate the elliptic name curve parameters by checking if the curve parameters -match an inbuilt curves. +match any built-in curves. =item B<-name arg> diff --git a/doc/man3/EC_GROUP_copy.pod b/doc/man3/EC_GROUP_copy.pod index c25c8f0426..b62eaa959c 100644 --- a/doc/man3/EC_GROUP_copy.pod +++ b/doc/man3/EC_GROUP_copy.pod @@ -130,7 +130,7 @@ in that a parameter obtained in this way is highly unlikely to be susceptible to If the seed is present for a curve then the b parameter was generated in a verifiable fashion using that seed. The OpenSSL EC library does not use this seed value but does enable you to inspect it using EC_GROUP_get0_seed. This returns a pointer to a memory block containing the seed that was used. The length of the memory block can be obtained using EC_GROUP_get_seed_len. A number of the -builtin curves within the library provide seed values that can be obtained. It is also possible to set a custom seed using +built-in curves within the library provide seed values that can be obtained. It is also possible to set a custom seed using EC_GROUP_set_seed and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use this seed value, although it will be preserved in any ASN1 based communications. @@ -145,13 +145,13 @@ The function EC_GROUP_check performs a number of checks on a curve to verify tha verifying that the discriminant is non zero; that a generator has been defined; that the generator is on the curve and has the correct order. -EC_GROUP_check_named_curve determines if the group's domain parameters match one of the built in curves supported by the library. +The function EC_GROUP_check_named_curve determines if the group's domain parameters match one of the built-in curves supported by the library. The curve name is returned as a B if it matches. If the group's domain parameters have been modified then no match will be found. If the curve name of the given group is B (e.g. it has been created by using explicit parameters with no curve name), -then this method can be used to lookup the name of the curve that matches the group domain parameters. The built in curves contain +then this method can be used to lookup the name of the curve that matches the group domain parameters. The built-in curves contain aliases, so that multiple NID's can map to the same domain parameters. For such curves it is unspecified which of the aliases will be returned if the curve name of the given group is NID_undef. -If B is 1 it will only look for NIST approved curves, otherwise it searches all built in curves. +If B is 1 it will only look for NIST approved curves, otherwise it searches all built-in curves. EC_GROUP_cmp compares B and B to determine whether they represent the same curve or not. @@ -185,7 +185,7 @@ EC_GROUP_get_order, EC_GROUP_get_cofactor, EC_GROUP_get_curve_name, EC_GROUP_get and EC_GROUP_get_degree return the order, cofactor, curve name (NID), ASN1 flag, point_conversion_form and degree for the specified curve respectively. If there is no curve name associated with a curve then EC_GROUP_get_curve_name will return 0. -EC_GROUP_check_named_curve returns the nid of the matching named curve, otherwise it returns 0 for no match, or -1 on error. +EC_GROUP_check_named_curve() returns the nid of the matching named curve, otherwise it returns 0 for no match, or -1 on error. EC_GROUP_get0_order() returns an internal pointer to the group order. EC_GROUP_order_bits() returns the number of bits in the group order. @@ -216,7 +216,7 @@ The EC_GROUP_check_named_curve() function was added in OpenSSL 3.0. =head1 COPYRIGHT -Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2013-2019 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/test/ectest.c b/test/ectest.c index 355e912f3a..7236b43bd1 100644 --- a/test/ectest.c +++ b/test/ectest.c @@ -1602,7 +1602,7 @@ static int check_named_curve_test(int id) || !TEST_true(BN_add_word(other_cofactor, 1))) goto err; - /* Determine if the inbuilt curve has a seed field set */ + /* Determine if the built-in curve has a seed field set */ has_seed = (EC_GROUP_get_seed_len(group) > 0); field_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group)); if (field_nid == NID_X9_62_characteristic_two_field) { @@ -1649,14 +1649,14 @@ static int check_named_curve_test(int id) if (has_seed) { /* - * If the built in curve has a seed and we set the seed to another value + * If the built-in curve has a seed and we set the seed to another value * then it will fail the check. */ if (!TEST_int_eq(EC_GROUP_check_named_curve(group, 0), 0)) goto err; } else { /* - * If the built in curve does not have a seed then setting the seed will + * If the built-in curve does not have a seed then setting the seed will * pass the check (as the seed is optional). */ if (!TEST_int_eq(EC_GROUP_check_named_curve(group, 0), nid))