summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_asn1.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-12-12 01:04:25 +0000
committerDr. Stephen Henson <steve@openssl.org>2015-12-16 14:17:53 +0000
commit981bd8a2f28c17f774ecb8b60233858fe52db502 (patch)
tree2416ede4d9418b3ae878463bf5fb21a54ad1b9a3 /crypto/ec/ec_asn1.c
parent19a86b03010c111d4e05ce252247e30f0e940dad (diff)
New EC functions.
New functions EC_POINT_point2buf and EC_KEY_key2buf which encode a point and allocate a buffer in one call. New function EC_KEY_oct2key() which sets public key in an EC_KEY structure from an encoded point. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ec/ec_asn1.c')
-rw-r--r--crypto/ec/ec_asn1.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index 4206d77984..05cdfbf64b 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -578,19 +578,11 @@ static ECPARAMETERS *ec_asn1_group2parameters(const EC_GROUP *group,
form = EC_GROUP_get_point_conversion_form(group);
- len = EC_POINT_point2oct(group, point, form, NULL, len, NULL);
+ len = EC_POINT_point2buf(group, point, form, &buffer, NULL);
if (len == 0) {
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
goto err;
}
- if ((buffer = OPENSSL_malloc(len)) == NULL) {
- ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_MALLOC_FAILURE);
- goto err;
- }
- if (!EC_POINT_point2oct(group, point, form, buffer, len, NULL)) {
- ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_EC_LIB);
- goto err;
- }
if (ret->base == NULL && (ret->base = ASN1_OCTET_STRING_new()) == NULL) {
ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, ERR_R_MALLOC_FAILURE);
goto err;