(hx509_name_copy): new function.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16959 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-02 18:12:46 +00:00
parent d9b82bea73
commit d64862d6fa

View File

@@ -319,6 +319,24 @@ hx509_der_parse_name(const void *data, size_t length, hx509_name *name)
return _hx509_name_from_Name(&n, name);
}
int
hx509_name_copy(hx509_context context, const hx509_name from, hx509_name *to)
{
int ret;
*to = calloc(1, sizeof(**to));
if (*to == NULL)
return ENOMEM;
ret = copy_Name(&(*to)->der_name, &from->der_name);
if (ret) {
free(*to);
*to = NULL;
return ENOMEM;
}
return 0;
}
void
hx509_name_free(hx509_name *name)
{