asn1: now sc_der_copy() returns int value

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5379 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
vtarasov 2011-04-21 13:46:28 +00:00
parent df7d560c35
commit 669a10572a
2 changed files with 4 additions and 3 deletions

View File

@ -1645,16 +1645,17 @@ _sc_asn1_decode(sc_context_t *ctx, struct sc_asn1_entry *asn1,
return asn1_decode(ctx, asn1, in, len, newp, left, choice, depth);
}
void
int
sc_der_copy(sc_pkcs15_der_t *dst, const sc_pkcs15_der_t *src)
{
memset(dst, 0, sizeof(*dst));
if (src->len) {
dst->value = malloc(src->len);
if (!dst->value)
return;
return SC_ERROR_OUT_OF_MEMORY;
dst->len = src->len;
memcpy(dst->value, src->value, src->len);
}
return SC_SUCCESS;
}

View File

@ -773,7 +773,7 @@ int sc_pkcs15_compare_id(const struct sc_pkcs15_id *id1,
const char *sc_pkcs15_print_id(const struct sc_pkcs15_id *id);
void sc_pkcs15_format_id(const char *id_in, struct sc_pkcs15_id *id_out);
int sc_pkcs15_hex_string_to_id(const char *in, struct sc_pkcs15_id *out);
void sc_der_copy(sc_pkcs15_der_t *, const sc_pkcs15_der_t *);
int sc_der_copy(sc_pkcs15_der_t *, const sc_pkcs15_der_t *);
int sc_pkcs15_get_object_id(const struct sc_pkcs15_object *, struct sc_pkcs15_id *);
int sc_pkcs15_get_guid(struct sc_pkcs15_card *, const struct sc_pkcs15_object *,
char *, size_t);