Example #1
0
void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)
{
    int param_type;

    if (EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT)
        param_type = V_ASN1_UNDEF;
    else
        param_type = V_ASN1_NULL;

    X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL);

}
ikptr
ikrt_openssl_evp_md_flags (ikptr s_algo, ikpcb * pcb)
{
#ifdef HAVE_EVP_MD_FLAGS
  const EVP_MD *	algo = IK_EVP_MD(s_algo);
  unsigned long		rv;
  rv = EVP_MD_flags(algo);
  return ika_integer_from_ulong(pcb, rv);
#else
  feature_failure(__func__);
#endif
}
Example #3
0
static void
list_md_fn(const EVP_MD * m, const char *from, const char *to, void *arg)
{
	const char *mname;
	/* Skip aliases */
	if (!m)
		return;
	mname = OBJ_nid2ln(EVP_MD_type(m));
	/* Skip shortnames */
	if (strcmp(from, mname))
		return;
	/* Skip clones */
	if (EVP_MD_flags(m) & EVP_MD_FLAG_PKEY_DIGEST)
		return;
	if (strchr(mname, ' '))
		mname = EVP_MD_name(m);
	BIO_printf(arg, "-%-14s to use the %s message digest algorithm\n",
	    mname, mname);
}