Commit 76453650 authored by hpi1's avatar hpi1

strutl: Remove duplicate function

parent e2229467
...@@ -572,7 +572,7 @@ int keydbcfg_parse_config(config_file *cfgfile, const char *path, const uint8_t ...@@ -572,7 +572,7 @@ int keydbcfg_parse_config(config_file *cfgfile, const char *path, const uint8_t
return 0; return 0;
if (disc_id) { if (disc_id) {
hex_array_to_hexstring(want_disc_id.b, disc_id, 20); str_print_hex(want_disc_id.b, disc_id, 20);
ps.want_disc_id = want_disc_id.u64; ps.want_disc_id = want_disc_id.u64;
} }
void *scanner; void *scanner;
......
...@@ -313,7 +313,7 @@ static char *_keycache_file(const char *type, const uint8_t *disc_id) ...@@ -313,7 +313,7 @@ static char *_keycache_file(const char *type, const uint8_t *disc_id)
return NULL; return NULL;
} }
hex_array_to_hexstring(disc_id_str, disc_id, 20); str_print_hex(disc_id_str, disc_id, 20);
result = str_printf("%s"DIR_SEP"%s"DIR_SEP"%s"DIR_SEP"%s", cache_dir, CFG_DIR, type, disc_id_str); result = str_printf("%s"DIR_SEP"%s"DIR_SEP"%s"DIR_SEP"%s", cache_dir, CFG_DIR, type, disc_id_str);
X_FREE(cache_dir); X_FREE(cache_dir);
...@@ -331,7 +331,7 @@ int keycache_save(const char *type, const uint8_t *disc_id, const uint8_t *key, ...@@ -331,7 +331,7 @@ int keycache_save(const char *type, const uint8_t *disc_id, const uint8_t *key,
AACS_FILE_H *fp = file_open(file, "w"); AACS_FILE_H *fp = file_open(file, "w");
if (fp) { if (fp) {
hex_array_to_hexstring(key_str, key, len); str_print_hex(key_str, key, len);
if (file_write(fp, key_str, len*2) == len*2) { if (file_write(fp, key_str, len*2) == len*2) {
BD_DEBUG(DBG_FILE, "Wrote %s to %s\n", type, file); BD_DEBUG(DBG_FILE, "Wrote %s to %s\n", type, file);
......
...@@ -325,7 +325,7 @@ static gcry_error_t _aacs_sexp_key(gcry_sexp_t *p_sexp_key, ...@@ -325,7 +325,7 @@ static gcry_error_t _aacs_sexp_key(gcry_sexp_t *p_sexp_key,
/* Points are currently only supported in standard format, so get a /* Points are currently only supported in standard format, so get a
* hexstring out of Q. * hexstring out of Q.
*/ */
hex_array_to_hexstring(str_Q, Q, 1 + 2*key_len); str_print_hex(str_Q, Q, 1 + 2*key_len);
char *strfmt = str_printf( char *strfmt = str_printf(
"(%s" "(%s"
......
...@@ -141,20 +141,6 @@ int hexstring_to_hex_array(uint8_t *hex_array, uint32_t size, ...@@ -141,20 +141,6 @@ int hexstring_to_hex_array(uint8_t *hex_array, uint32_t size,
return 1; return 1;
} }
/* Function to convert a hex array into a hex string.
* str must be allocated by caller
* size is the size of the hex_array
*/
void hex_array_to_hexstring(char *str, const uint8_t *hex_array, uint32_t size)
{
unsigned int i;
for (i = 0; i < size; i++)
{
sprintf(str + (i*2), "%02x", hex_array[i]);
}
}
char *str_dup(const char *str) char *str_dup(const char *str)
{ {
char *dup = NULL; char *dup = NULL;
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
BD_PRIVATE int hexstring_to_hex_array(uint8_t *hex_array, uint32_t size, BD_PRIVATE int hexstring_to_hex_array(uint8_t *hex_array, uint32_t size,
const char *hexstring); const char *hexstring);
BD_PRIVATE void hex_array_to_hexstring(char *str, const uint8_t *hex_array, uint32_t size);
BD_PRIVATE char * str_dup(const char *str) BD_ATTR_MALLOC; BD_PRIVATE char * str_dup(const char *str) BD_ATTR_MALLOC;
BD_PRIVATE char * str_printf(const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(1,2) BD_ATTR_MALLOC; BD_PRIVATE char * str_printf(const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(1,2) BD_ATTR_MALLOC;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment