Lines Matching refs:alg

31 int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)
33 if (alg == NULL)
36 if (ptype != V_ASN1_UNDEF && alg->parameter == NULL
37 && (alg->parameter = ASN1_TYPE_new()) == NULL)
40 ASN1_OBJECT_free(alg->algorithm);
41 alg->algorithm = aobj;
46 ASN1_TYPE_free(alg->parameter);
47 alg->parameter = NULL;
49 ASN1_TYPE_set(alg->parameter, ptype, pval);
56 X509_ALGOR *alg = NULL; in ossl_X509_ALGOR_from_nid() local
60 if ((alg = X509_ALGOR_new()) == NULL) in ossl_X509_ALGOR_from_nid()
62 if (X509_ALGOR_set0(alg, algo, ptype, pval)) in ossl_X509_ALGOR_from_nid()
63 return alg; in ossl_X509_ALGOR_from_nid()
64 alg->algorithm = NULL; /* precaution to prevent double free */ in ossl_X509_ALGOR_from_nid()
67 X509_ALGOR_free(alg); in ossl_X509_ALGOR_from_nid()
89 void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) in X509_ALGOR_set_md() argument
94 (void)X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_get_type(md)), type, NULL); in X509_ALGOR_set_md()
144 X509_ALGOR *alg; in ossl_x509_algor_new_from_md() local
149 if ((alg = X509_ALGOR_new()) == NULL) in ossl_x509_algor_new_from_md()
151 X509_ALGOR_set_md(alg, md); in ossl_x509_algor_new_from_md()
152 *palg = alg; in ossl_x509_algor_new_from_md()
157 const EVP_MD *ossl_x509_algor_get_md(X509_ALGOR *alg) in ossl_x509_algor_get_md() argument
161 if (alg == NULL) in ossl_x509_algor_get_md()
163 md = EVP_get_digestbyobj(alg->algorithm); in ossl_x509_algor_get_md()
169 X509_ALGOR *ossl_x509_algor_mgf1_decode(X509_ALGOR *alg) in ossl_x509_algor_mgf1_decode() argument
171 if (OBJ_obj2nid(alg->algorithm) != NID_mgf1) in ossl_x509_algor_mgf1_decode()
174 alg->parameter); in ossl_x509_algor_mgf1_decode()