diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 99e53429b7..274e456c73 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c | |||
@@ -128,3 +128,17 @@ void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, | |||
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | /* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ | ||
132 | |||
133 | void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) | ||
134 | { | ||
135 | int param_type; | ||
136 | |||
137 | if (md->flags & EVP_MD_FLAG_DIGALGID_ABSENT) | ||
138 | param_type = V_ASN1_UNDEF; | ||
139 | else | ||
140 | param_type = V_ASN1_NULL; | ||
141 | |||
142 | X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); | ||
143 | |||
144 | } | ||