diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec_pmeth.c')
-rw-r--r-- | src/lib/libcrypto/ec/ec_pmeth.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ec_pmeth.c b/src/lib/libcrypto/ec/ec_pmeth.c index 16fc07642a..d422765b00 100644 --- a/src/lib/libcrypto/ec/ec_pmeth.c +++ b/src/lib/libcrypto/ec/ec_pmeth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_pmeth.c,v 1.21 2023/12/28 22:12:37 tb Exp $ */ | 1 | /* $OpenBSD: ec_pmeth.c,v 1.22 2024/08/26 22:01:28 op 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 | */ |
@@ -57,6 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <stdlib.h> | ||
60 | #include <string.h> | 61 | #include <string.h> |
61 | 62 | ||
62 | #include <openssl/asn1t.h> | 63 | #include <openssl/asn1t.h> |
@@ -445,10 +446,15 @@ pkey_ec_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, const char *value) | |||
445 | } | 446 | } |
446 | return EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md); | 447 | return EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md); |
447 | } else if (strcmp(type, "ecdh_cofactor_mode") == 0) { | 448 | } else if (strcmp(type, "ecdh_cofactor_mode") == 0) { |
448 | int co_mode; | 449 | int cofactor_mode; |
449 | co_mode = atoi(value); | 450 | const char *errstr; |
450 | return EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, co_mode); | 451 | |
452 | cofactor_mode = strtonum(value, -1, 1, &errstr); | ||
453 | if (errstr != NULL) | ||
454 | return -2; | ||
455 | return EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, cofactor_mode); | ||
451 | } | 456 | } |
457 | |||
452 | return -2; | 458 | return -2; |
453 | } | 459 | } |
454 | 460 | ||