Added function sc_compare_oid()

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2456 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
sth 2005-08-03 09:00:00 +00:00
parent 94d899931e
commit d0f267468e
2 changed files with 14 additions and 0 deletions

View File

@ -871,6 +871,7 @@ int sc_append_path_id(sc_path_t *dest, const u8 *id, size_t idlen);
int sc_append_file_id(sc_path_t *dest, unsigned int fid);
int sc_hex_to_bin(const char *in, u8 *out, size_t *outlen);
int sc_bin_to_hex(const u8 *, size_t, char *, size_t, char separator);
int sc_compare_oid(const struct sc_object_id *oid1, const struct sc_object_id *oid2);
int sc_get_cache_dir(sc_context_t *ctx, char *buf, size_t bufsize);
int sc_make_cache_dir(sc_context_t *ctx);

View File

@ -102,6 +102,19 @@ int sc_bin_to_hex(const u8 *in, size_t in_len, char *out, size_t out_len,
return 0;
}
int sc_compare_oid(const struct sc_object_id *oid1, const struct sc_object_id *oid2)
{
int i;
assert(oid1 != NULL && oid2 != NULL);
for (i = 0; i < SC_MAX_OBJECT_ID_OCTETS; i++) {
if (oid1->value[i] != oid2->value[i])
return 0;
if (oid1->value[i] < 0)
return 1;
}
return 1;
}
sc_slot_info_t * _sc_get_slot_info(sc_reader_t *reader, int slot_id)
{
assert(reader != NULL);