-/* $OpenBSD: names.c,v 1.25 2024/01/13 11:41:44 tb Exp $ */
+/* $OpenBSD: names.c,v 1.26 2024/01/13 11:45:03 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int
EVP_add_cipher(const EVP_CIPHER *c)
{
- int r;
-
if (c == NULL)
return 0;
- 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);
+
+ return 1;
}
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);
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);
+ if (md->pkey_type && md->type != md->pkey_type)
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);
+
+ return 1;
}
void