diff options
| author | tb <> | 2024-04-18 11:51:01 +0000 |
|---|---|---|
| committer | tb <> | 2024-04-18 11:51:01 +0000 |
| commit | 45650e0e51a410d1f54301ae6a26f175869dba56 (patch) | |
| tree | 286c1920fef7abd075d8b228c836427af68664ac /src | |
| parent | 6951f7a06932b31d0608ccc240cf63a714244adb (diff) | |
| download | openbsd-45650e0e51a410d1f54301ae6a26f175869dba56.tar.gz openbsd-45650e0e51a410d1f54301ae6a26f175869dba56.tar.bz2 openbsd-45650e0e51a410d1f54301ae6a26f175869dba56.zip | |
Turn ecdh_cms_set_shared_info() into single exit
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index 155c1855b4..cbc8fa929e 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_ameth.c,v 1.63 2024/04/17 14:01:33 tb Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.64 2024/04/18 11:51:01 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -826,18 +826,18 @@ ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) | |||
| 826 | int plen, keylen; | 826 | int plen, keylen; |
| 827 | const EVP_CIPHER *kekcipher; | 827 | const EVP_CIPHER *kekcipher; |
| 828 | EVP_CIPHER_CTX *kekctx; | 828 | EVP_CIPHER_CTX *kekctx; |
| 829 | int rv = 0; | 829 | int ret = 0; |
| 830 | 830 | ||
| 831 | if (!CMS_RecipientInfo_kari_get0_alg(ri, &alg, &ukm)) | 831 | if (!CMS_RecipientInfo_kari_get0_alg(ri, &alg, &ukm)) |
| 832 | return 0; | 832 | goto err; |
| 833 | 833 | ||
| 834 | if (!ecdh_cms_set_kdf_param(pctx, OBJ_obj2nid(alg->algorithm))) { | 834 | if (!ecdh_cms_set_kdf_param(pctx, OBJ_obj2nid(alg->algorithm))) { |
| 835 | ECerror(EC_R_KDF_PARAMETER_ERROR); | 835 | ECerror(EC_R_KDF_PARAMETER_ERROR); |
| 836 | return 0; | 836 | goto err; |
| 837 | } | 837 | } |
| 838 | 838 | ||
| 839 | if (alg->parameter->type != V_ASN1_SEQUENCE) | 839 | if (alg->parameter->type != V_ASN1_SEQUENCE) |
| 840 | return 0; | 840 | goto err; |
| 841 | 841 | ||
| 842 | p = alg->parameter->value.sequence->data; | 842 | p = alg->parameter->value.sequence->data; |
| 843 | plen = alg->parameter->value.sequence->length; | 843 | plen = alg->parameter->value.sequence->length; |
| @@ -867,11 +867,13 @@ ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) | |||
| 867 | goto err; | 867 | goto err; |
| 868 | der = NULL; | 868 | der = NULL; |
| 869 | 869 | ||
| 870 | rv = 1; | 870 | ret = 1; |
| 871 | |||
| 871 | err: | 872 | err: |
| 872 | X509_ALGOR_free(kekalg); | 873 | X509_ALGOR_free(kekalg); |
| 873 | free(der); | 874 | free(der); |
| 874 | return rv; | 875 | |
| 876 | return ret; | ||
| 875 | } | 877 | } |
| 876 | 878 | ||
| 877 | static int | 879 | static int |
