diff options
author | tb <> | 2023-11-01 20:41:12 +0000 |
---|---|---|
committer | tb <> | 2023-11-01 20:41:12 +0000 |
commit | 5d92b319c4fe7c18022f1a0aca4942ec8162b064 (patch) | |
tree | d00c0780bbd4d1ed16a6b2b71f0c31e6de270419 /src | |
parent | 9502a579475daabba44f561af5927b9423bfd082 (diff) | |
download | openbsd-5d92b319c4fe7c18022f1a0aca4942ec8162b064.tar.gz openbsd-5d92b319c4fe7c18022f1a0aca4942ec8162b064.tar.bz2 openbsd-5d92b319c4fe7c18022f1a0aca4942ec8162b064.zip |
Use X509_ALGOR_set0_by_nid() in X509_ALGOR_set_evp_md()
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 5ad1263b27..d9a6cf9d8e 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x_algor.c,v 1.37 2023/11/01 20:37:42 tb Exp $ */ | 1 | /* $OpenBSD: x_algor.c,v 1.38 2023/11/01 20:41:12 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 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -256,16 +256,16 @@ X509_ALGOR_get0(const ASN1_OBJECT **out_aobj, int *out_type, | |||
256 | int | 256 | int |
257 | X509_ALGOR_set_evp_md(X509_ALGOR *alg, const EVP_MD *md) | 257 | X509_ALGOR_set_evp_md(X509_ALGOR *alg, const EVP_MD *md) |
258 | { | 258 | { |
259 | ASN1_OBJECT *aobj; | 259 | int parameter_type = V_ASN1_NULL; |
260 | int param_type = V_ASN1_NULL; | 260 | int nid = EVP_MD_type(md); |
261 | 261 | ||
262 | if ((EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT) != 0) | 262 | if ((EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT) != 0) |
263 | param_type = V_ASN1_UNDEF; | 263 | parameter_type = V_ASN1_UNDEF; |
264 | 264 | ||
265 | if ((aobj = OBJ_nid2obj(EVP_MD_type(md))) == NULL) | 265 | if (!X509_ALGOR_set0_by_nid(alg, nid, parameter_type, NULL)) |
266 | return 0; | 266 | return 0; |
267 | 267 | ||
268 | return X509_ALGOR_set0(alg, aobj, param_type, NULL); | 268 | return 1; |
269 | } | 269 | } |
270 | 270 | ||
271 | void | 271 | void |