int EVP_add_digest(const EVP_MD *md) { int r; const char *name; OPENSSL_init(); name = OBJ_nid2sn(md->type); r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md); if (r == 0) return (0); check_defer(md->type); r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH, (const char *)md); if (r == 0) return (0); if (md->pkey_type && md->type != md->pkey_type) { r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name); if (r == 0) return (0); check_defer(md->pkey_type); r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name); } return (r); }
int EVP_add_cipher(const EVP_CIPHER *c) { int r; r=OBJ_NAME_add(OBJ_nid2sn(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); if (r == 0) return(0); r=OBJ_NAME_add(OBJ_nid2ln(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); return(r); }
int EVP_add_cipher(const EVP_CIPHER *c) { int r; #ifdef OPENSSL_FIPS OPENSSL_init(); #endif r=OBJ_NAME_add(OBJ_nid2sn(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); if (r == 0) return(0); r=OBJ_NAME_add(OBJ_nid2ln(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); return(r); }
int EVP_add_mac(const EVP_MAC *m) { int r; if (m == NULL) return 0; r = OBJ_NAME_add(OBJ_nid2sn(m->type), OBJ_NAME_TYPE_MAC_METH, (const char *)m); if (r == 0) return 0; r = OBJ_NAME_add(OBJ_nid2ln(m->type), OBJ_NAME_TYPE_MAC_METH, (const char *)m); return r; }
int EVP_add_cipher (const EVP_CIPHER * c) { int r; if (c == NULL) return 0; OPENSSL_init (); r = OBJ_NAME_add (OBJ_nid2sn (c->nid), OBJ_NAME_TYPE_CIPHER_METH, (const char *) c); if (r == 0) return (0); check_defer (c->nid); r = OBJ_NAME_add (OBJ_nid2ln (c->nid), OBJ_NAME_TYPE_CIPHER_METH, (const char *) c); return (r); }
int EVP_add_digest(const EVP_MD *md) { int r; const char *name; name = OBJ_nid2sn(md->type); r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md); if (r == 0) return 0; r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH, (const char *)md); if (r == 0) return 0; if (md->pkey_type && md->type != md->pkey_type) { r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name); if (r == 0) return 0; r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name); } return r; }