diff options
author | tb <> | 2021-12-12 14:27:20 +0000 |
---|---|---|
committer | tb <> | 2021-12-12 14:27:20 +0000 |
commit | 9a4d074221a5da66d3f2315cd2728270ad598654 (patch) | |
tree | 3c143e72a161c2a39ba7d225d6c8409d0cebe83d | |
parent | 693b9af2c868379acbde502b0fdd91708ee6da6e (diff) | |
download | openbsd-9a4d074221a5da66d3f2315cd2728270ad598654.tar.gz openbsd-9a4d074221a5da66d3f2315cd2728270ad598654.tar.bz2 openbsd-9a4d074221a5da66d3f2315cd2728270ad598654.zip |
Rewrite X509_ALGOR_set_md() without reaching into EVP_MD.
ok inoguchi schwarze
-rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 2013de795d..efb0c342aa 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.22 2018/05/01 19:01:27 tb Exp $ */ | 1 | /* $OpenBSD: x_algor.c,v 1.23 2021/12/12 14:27:20 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 | */ |
@@ -197,12 +197,10 @@ X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, | |||
197 | void | 197 | void |
198 | X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) | 198 | X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) |
199 | { | 199 | { |
200 | int param_type; | 200 | int param_type = V_ASN1_NULL; |
201 | 201 | ||
202 | if (md->flags & EVP_MD_FLAG_DIGALGID_ABSENT) | 202 | if ((EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT) != 0) |
203 | param_type = V_ASN1_UNDEF; | 203 | param_type = V_ASN1_UNDEF; |
204 | else | ||
205 | param_type = V_ASN1_NULL; | ||
206 | 204 | ||
207 | X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); | 205 | X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); |
208 | } | 206 | } |