summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util_str.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c
index 2be8b7eb64c..e4b07a4b731 100644
--- a/source/lib/util_str.c
+++ b/source/lib/util_str.c
@@ -794,6 +794,17 @@ size_t strhex_to_str(char *p, size_t len, const char *strhex)
return num_chars;
}
+DATA_BLOB strhex_to_data_blob(const char *strhex)
+{
+ DATA_BLOB ret_blob = data_blob(NULL, strlen(strhex)/2+1);
+
+ ret_blob.length = strhex_to_str(ret_blob.data,
+ strlen(strhex),
+ strhex);
+
+ return ret_blob;
+}
+
/**
* Routine to print a buffer as HEX digits, into an allocated string.
*/