diff options
| author | tb <> | 2024-10-30 06:40:41 +0000 |
|---|---|---|
| committer | tb <> | 2024-10-30 06:40:41 +0000 |
| commit | d8ca706c38ae77374ea2b2f0b6dfb671995f7b85 (patch) | |
| tree | 664c0dcc62c8c114a8f0e1314d72fe126f6bdfbd /src | |
| parent | fa9d25519948c3bde6618189431ae19d466f004c (diff) | |
| download | openbsd-d8ca706c38ae77374ea2b2f0b6dfb671995f7b85.tar.gz openbsd-d8ca706c38ae77374ea2b2f0b6dfb671995f7b85.tar.bz2 openbsd-d8ca706c38ae77374ea2b2f0b6dfb671995f7b85.zip | |
ec_asn1_group2parameters: mechanically replace ret with parameters
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_asn1.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c index 5881580b0d..7ec098963e 100644 --- a/src/lib/libcrypto/ec/ec_asn1.c +++ b/src/lib/libcrypto/ec/ec_asn1.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_asn1.c,v 1.96 2024/10/30 06:12:47 tb Exp $ */ | 1 | /* $OpenBSD: ec_asn1.c,v 1.97 2024/10/30 06:40:41 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -774,26 +774,26 @@ static ECPARAMETERS * | |||
| 774 | ec_asn1_group2parameters(const EC_GROUP *group) | 774 | ec_asn1_group2parameters(const EC_GROUP *group) |
| 775 | { | 775 | { |
| 776 | int ok = 0; | 776 | int ok = 0; |
| 777 | ECPARAMETERS *ret = NULL; | 777 | ECPARAMETERS *parameters = NULL; |
| 778 | const BIGNUM *order, *cofactor; | 778 | const BIGNUM *order, *cofactor; |
| 779 | const EC_POINT *point = NULL; | 779 | const EC_POINT *point = NULL; |
| 780 | uint8_t form; | 780 | uint8_t form; |
| 781 | 781 | ||
| 782 | if ((ret = ECPARAMETERS_new()) == NULL) { | 782 | if ((parameters = ECPARAMETERS_new()) == NULL) { |
| 783 | ECerror(ERR_R_MALLOC_FAILURE); | 783 | ECerror(ERR_R_MALLOC_FAILURE); |
| 784 | goto err; | 784 | goto err; |
| 785 | } | 785 | } |
| 786 | 786 | ||
| 787 | /* set the version (always one) */ | 787 | /* set the version (always one) */ |
| 788 | ret->version = (long) 0x1; | 788 | parameters->version = (long) 0x1; |
| 789 | 789 | ||
| 790 | /* set the fieldID */ | 790 | /* set the fieldID */ |
| 791 | if (!ec_asn1_group2fieldid(group, ret->fieldID)) { | 791 | if (!ec_asn1_group2fieldid(group, parameters->fieldID)) { |
| 792 | ECerror(ERR_R_EC_LIB); | 792 | ECerror(ERR_R_EC_LIB); |
| 793 | goto err; | 793 | goto err; |
| 794 | } | 794 | } |
| 795 | /* set the curve */ | 795 | /* set the curve */ |
| 796 | if (!ec_asn1_group2curve(group, ret->curve)) { | 796 | if (!ec_asn1_group2curve(group, parameters->curve)) { |
| 797 | ECerror(ERR_R_EC_LIB); | 797 | ECerror(ERR_R_EC_LIB); |
| 798 | goto err; | 798 | goto err; |
| 799 | } | 799 | } |
| @@ -804,7 +804,7 @@ ec_asn1_group2parameters(const EC_GROUP *group) | |||
| 804 | } | 804 | } |
| 805 | 805 | ||
| 806 | form = EC_GROUP_get_point_conversion_form(group); | 806 | form = EC_GROUP_get_point_conversion_form(group); |
| 807 | if (!ec_point_to_asn1_octet_string(group, point, form, &ret->base)) | 807 | if (!ec_point_to_asn1_octet_string(group, point, form, ¶meters->base)) |
| 808 | goto err; | 808 | goto err; |
| 809 | 809 | ||
| 810 | if ((order = EC_GROUP_get0_order(group)) == NULL) { | 810 | if ((order = EC_GROUP_get0_order(group)) == NULL) { |
| @@ -815,19 +815,19 @@ ec_asn1_group2parameters(const EC_GROUP *group) | |||
| 815 | ECerror(ERR_R_EC_LIB); | 815 | ECerror(ERR_R_EC_LIB); |
| 816 | goto err; | 816 | goto err; |
| 817 | } | 817 | } |
| 818 | ASN1_INTEGER_free(ret->order); | 818 | ASN1_INTEGER_free(parameters->order); |
| 819 | if ((ret->order = BN_to_ASN1_INTEGER(order, NULL)) == NULL) { | 819 | if ((parameters->order = BN_to_ASN1_INTEGER(order, NULL)) == NULL) { |
| 820 | ECerror(ERR_R_ASN1_LIB); | 820 | ECerror(ERR_R_ASN1_LIB); |
| 821 | goto err; | 821 | goto err; |
| 822 | } | 822 | } |
| 823 | ASN1_INTEGER_free(ret->cofactor); | 823 | ASN1_INTEGER_free(parameters->cofactor); |
| 824 | ret->cofactor = NULL; | 824 | parameters->cofactor = NULL; |
| 825 | if ((cofactor = EC_GROUP_get0_cofactor(group)) == NULL) { | 825 | if ((cofactor = EC_GROUP_get0_cofactor(group)) == NULL) { |
| 826 | ECerror(ERR_R_EC_LIB); | 826 | ECerror(ERR_R_EC_LIB); |
| 827 | goto err; | 827 | goto err; |
| 828 | } | 828 | } |
| 829 | if (!BN_is_zero(cofactor)) { | 829 | if (!BN_is_zero(cofactor)) { |
| 830 | if ((ret->cofactor = BN_to_ASN1_INTEGER(cofactor, NULL)) == NULL) { | 830 | if ((parameters->cofactor = BN_to_ASN1_INTEGER(cofactor, NULL)) == NULL) { |
| 831 | ECerror(ERR_R_ASN1_LIB); | 831 | ECerror(ERR_R_ASN1_LIB); |
| 832 | goto err; | 832 | goto err; |
| 833 | } | 833 | } |
| @@ -836,10 +836,10 @@ ec_asn1_group2parameters(const EC_GROUP *group) | |||
| 836 | 836 | ||
| 837 | err: | 837 | err: |
| 838 | if (!ok) { | 838 | if (!ok) { |
| 839 | ECPARAMETERS_free(ret); | 839 | ECPARAMETERS_free(parameters); |
| 840 | ret = NULL; | 840 | parameters = NULL; |
| 841 | } | 841 | } |
| 842 | return (ret); | 842 | return (parameters); |
| 843 | } | 843 | } |
| 844 | 844 | ||
| 845 | static ECPKPARAMETERS * | 845 | static ECPKPARAMETERS * |
