diff options
Diffstat (limited to 'src/lib/libcrypto/ec')
| -rw-r--r-- | src/lib/libcrypto/ec/ecx_methods.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ecx_methods.c b/src/lib/libcrypto/ec/ecx_methods.c index 70475e8dc1..6b5759d4fa 100644 --- a/src/lib/libcrypto/ec/ecx_methods.c +++ b/src/lib/libcrypto/ec/ecx_methods.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecx_methods.c,v 1.13 2024/04/02 04:04:07 tb Exp $ */ | 1 | /* $OpenBSD: ecx_methods.c,v 1.14 2024/08/28 07:15:04 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -510,6 +510,24 @@ ecx_security_bits(const EVP_PKEY *pkey) | |||
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | static int | 512 | static int |
| 513 | ecx_signature_info(const X509_ALGOR *algor, int *md_nid, int *pkey_nid, | ||
| 514 | int *security_bits, uint32_t *flags) | ||
| 515 | { | ||
| 516 | const ASN1_OBJECT *aobj; | ||
| 517 | |||
| 518 | X509_ALGOR_get0(&aobj, NULL, NULL, algor); | ||
| 519 | if (OBJ_obj2nid(aobj) != EVP_PKEY_ED25519) | ||
| 520 | return 0; | ||
| 521 | |||
| 522 | *md_nid = NID_undef; | ||
| 523 | *pkey_nid = NID_ED25519; | ||
| 524 | *security_bits = ED25519_SECURITY_BITS; | ||
| 525 | *flags = X509_SIG_INFO_TLS | X509_SIG_INFO_VALID; | ||
| 526 | |||
| 527 | return 1; | ||
| 528 | } | ||
| 529 | |||
| 530 | static int | ||
| 513 | ecx_param_cmp(const EVP_PKEY *pkey1, const EVP_PKEY *pkey2) | 531 | ecx_param_cmp(const EVP_PKEY *pkey1, const EVP_PKEY *pkey2) |
| 514 | { | 532 | { |
| 515 | /* No parameters, so always equivalent. */ | 533 | /* No parameters, so always equivalent. */ |
| @@ -929,6 +947,8 @@ const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = { | |||
| 929 | .pkey_bits = ecx_bits, | 947 | .pkey_bits = ecx_bits, |
| 930 | .pkey_security_bits = ecx_security_bits, | 948 | .pkey_security_bits = ecx_security_bits, |
| 931 | 949 | ||
| 950 | .signature_info = ecx_signature_info, | ||
| 951 | |||
| 932 | .param_cmp = ecx_param_cmp, | 952 | .param_cmp = ecx_param_cmp, |
| 933 | 953 | ||
| 934 | .pkey_free = ecx_free, | 954 | .pkey_free = ecx_free, |
