summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-11-09 11:39:14 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-11-09 11:39:14 +0000
commit6c44d6d0d8327a8f07083edb64eacba43daef922 (patch)
tree1978975e144747d5b1c463427e567c0e2388ce62 /lib/libcrypto
parent9a371af472ea07f746f397d3617df3476b00b84c (diff)
Convert ecx_item_sign() to X509_ALGOR_set0_by_nid()
ok jca
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/ec/ecx_methods.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/libcrypto/ec/ecx_methods.c b/lib/libcrypto/ec/ecx_methods.c
index 4bb8b786a16..75988d99ade 100644
--- a/lib/libcrypto/ec/ecx_methods.c
+++ b/lib/libcrypto/ec/ecx_methods.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecx_methods.c,v 1.9 2023/07/22 19:33:25 tb Exp $ */
+/* $OpenBSD: ecx_methods.c,v 1.10 2023/11/09 11:39:13 tb Exp $ */
/*
* Copyright (c) 2022 Joel Sing <jsing@openbsd.org>
*
@@ -27,6 +27,7 @@
#include "bytestring.h"
#include "curve25519_internal.h"
#include "evp_local.h"
+#include "x509_local.h"
/*
* EVP PKEY and PKEY ASN.1 methods Ed25519 and X25519.
@@ -729,16 +730,12 @@ static int
ecx_item_sign(EVP_MD_CTX *md_ctx, const ASN1_ITEM *it, void *asn,
X509_ALGOR *algor1, X509_ALGOR *algor2, ASN1_BIT_STRING *abs)
{
- ASN1_OBJECT *aobj;
-
- if ((aobj = OBJ_nid2obj(NID_ED25519)) == NULL)
- return 0;
-
- if (!X509_ALGOR_set0(algor1, aobj, V_ASN1_UNDEF, NULL))
+ if (!X509_ALGOR_set0_by_nid(algor1, NID_ED25519, V_ASN1_UNDEF, NULL))
return 0;
if (algor2 != NULL) {
- if (!X509_ALGOR_set0(algor2, aobj, V_ASN1_UNDEF, NULL))
+ if (!X509_ALGOR_set0_by_nid(algor2, NID_ED25519, V_ASN1_UNDEF,
+ NULL))
return 0;
}