diff options
author | tb <> | 2024-04-02 04:04:07 +0000 |
---|---|---|
committer | tb <> | 2024-04-02 04:04:07 +0000 |
commit | 6e4fce38635495665b3ef6675c39f0b9901e12c6 (patch) | |
tree | 594abad7255419404dff3c89c6d810fc989bcff5 /src/lib | |
parent | f8ddfacb22eaeabfcbb69833c5e7126ae3f56e42 (diff) | |
download | openbsd-6e4fce38635495665b3ef6675c39f0b9901e12c6.tar.gz openbsd-6e4fce38635495665b3ef6675c39f0b9901e12c6.tar.bz2 openbsd-6e4fce38635495665b3ef6675c39f0b9901e12c6.zip |
Simplify ecx_cms_sign_or_verify() using X509_ALGOR_set0_by_nid()
ok jsing
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/ec/ecx_methods.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ec/ecx_methods.c b/src/lib/libcrypto/ec/ecx_methods.c index ab299a8d6b..70475e8dc1 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.12 2024/03/29 06:41:58 tb Exp $ */ | 1 | /* $OpenBSD: ecx_methods.c,v 1.13 2024/04/02 04:04:07 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -536,7 +536,6 @@ static int | |||
536 | ecx_cms_sign_or_verify(EVP_PKEY *pkey, long verify, CMS_SignerInfo *si) | 536 | ecx_cms_sign_or_verify(EVP_PKEY *pkey, long verify, CMS_SignerInfo *si) |
537 | { | 537 | { |
538 | X509_ALGOR *digestAlgorithm, *signatureAlgorithm; | 538 | X509_ALGOR *digestAlgorithm, *signatureAlgorithm; |
539 | ASN1_OBJECT *aobj; | ||
540 | 539 | ||
541 | if (verify != 0 && verify != 1) | 540 | if (verify != 0 && verify != 1) |
542 | return -1; | 541 | return -1; |
@@ -575,9 +574,8 @@ ecx_cms_sign_or_verify(EVP_PKEY *pkey, long verify, CMS_SignerInfo *si) | |||
575 | return 1; | 574 | return 1; |
576 | } | 575 | } |
577 | 576 | ||
578 | if ((aobj = OBJ_nid2obj(NID_ED25519)) == NULL) | 577 | if (!X509_ALGOR_set0_by_nid(signatureAlgorithm, NID_ED25519, |
579 | return -1; | 578 | V_ASN1_UNDEF, NULL)) |
580 | if (!X509_ALGOR_set0(signatureAlgorithm, aobj, V_ASN1_UNDEF, NULL)) | ||
581 | return -1; | 579 | return -1; |
582 | 580 | ||
583 | return 1; | 581 | return 1; |