summaryrefslogtreecommitdiff
path: root/lib/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/hmacmd5test.c21
-rw-r--r--lib/crypto/md4test.c2
-rw-r--r--lib/crypto/md5test.c2
3 files changed, 14 insertions, 11 deletions
diff --git a/lib/crypto/hmacmd5test.c b/lib/crypto/hmacmd5test.c
index 0a98404eda..77f305a5d3 100644
--- a/lib/crypto/hmacmd5test.c
+++ b/lib/crypto/hmacmd5test.c
@@ -41,34 +41,37 @@ bool torture_local_crypto_hmacmd5(struct torture_context *torture)
DATA_BLOB md5;
} testarray[8];
+ TALLOC_CTX *tctx = talloc_new(torture);
+ if (!tctx) { return false; };
+
testarray[0].key = data_blob_repeat_byte(0x0b, 16);
testarray[0].data = data_blob_string_const("Hi There");
- testarray[0].md5 = strhex_to_data_blob("9294727a3638bb1c13f48ef8158bfc9d");
+ testarray[0].md5 = strhex_to_data_blob(tctx, "9294727a3638bb1c13f48ef8158bfc9d");
testarray[1].key = data_blob_string_const("Jefe");
testarray[1].data = data_blob_string_const("what do ya want for nothing?");
- testarray[1].md5 = strhex_to_data_blob("750c783e6ab0b503eaa86e310a5db738");
+ testarray[1].md5 = strhex_to_data_blob(tctx, "750c783e6ab0b503eaa86e310a5db738");
testarray[2].key = data_blob_repeat_byte(0xaa, 16);
testarray[2].data = data_blob_repeat_byte(0xdd, 50);
- testarray[2].md5 = strhex_to_data_blob("56be34521d144c88dbb8c733f0e8b3f6");
+ testarray[2].md5 = strhex_to_data_blob(tctx, "56be34521d144c88dbb8c733f0e8b3f6");
- testarray[3].key = strhex_to_data_blob("0102030405060708090a0b0c0d0e0f10111213141516171819");
+ testarray[3].key = strhex_to_data_blob(tctx, "0102030405060708090a0b0c0d0e0f10111213141516171819");
testarray[3].data = data_blob_repeat_byte(0xcd, 50);
- testarray[3].md5 = strhex_to_data_blob("697eaf0aca3a3aea3a75164746ffaa79");
+ testarray[3].md5 = strhex_to_data_blob(tctx, "697eaf0aca3a3aea3a75164746ffaa79");
testarray[4].key = data_blob_repeat_byte(0x0c, 16);
testarray[4].data = data_blob_string_const("Test With Truncation");
- testarray[4].md5 = strhex_to_data_blob("56461ef2342edc00f9bab995690efd4c");
+ testarray[4].md5 = strhex_to_data_blob(tctx, "56461ef2342edc00f9bab995690efd4c");
testarray[5].key = data_blob_repeat_byte(0xaa, 80);
testarray[5].data = data_blob_string_const("Test Using Larger Than Block-Size Key - Hash Key First");
- testarray[5].md5 = strhex_to_data_blob("6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd");
+ testarray[5].md5 = strhex_to_data_blob(tctx, "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd");
testarray[6].key = data_blob_repeat_byte(0xaa, 80);
testarray[6].data = data_blob_string_const("Test Using Larger Than Block-Size Key "
"and Larger Than One Block-Size Data");
- testarray[6].md5 = strhex_to_data_blob("6f630fad67cda0ee1fb1f562db3aa53e");
+ testarray[6].md5 = strhex_to_data_blob(tctx, "6f630fad67cda0ee1fb1f562db3aa53e");
testarray[7].key = data_blob(NULL, 0);
@@ -93,6 +96,6 @@ bool torture_local_crypto_hmacmd5(struct torture_context *torture)
ret = false;
}
}
-
+ talloc_free(tctx);
return ret;
}
diff --git a/lib/crypto/md4test.c b/lib/crypto/md4test.c
index dddf9e61a0..a6080cff82 100644
--- a/lib/crypto/md4test.c
+++ b/lib/crypto/md4test.c
@@ -64,7 +64,7 @@ bool torture_local_crypto_md4(struct torture_context *torture)
DATA_BLOB md4blob;
data = data_blob_string_const(testarray[i].data);
- md4blob = strhex_to_data_blob(testarray[i].md4);
+ md4blob = strhex_to_data_blob(NULL, testarray[i].md4);
mdfour(md4, data.data, data.length);
diff --git a/lib/crypto/md5test.c b/lib/crypto/md5test.c
index 1244dca753..7223af2114 100644
--- a/lib/crypto/md5test.c
+++ b/lib/crypto/md5test.c
@@ -70,7 +70,7 @@ bool torture_local_crypto_md5(struct torture_context *torture)
DATA_BLOB md5blob;
data = data_blob_string_const(testarray[i].data);
- md5blob = strhex_to_data_blob(testarray[i].md5);
+ md5blob = strhex_to_data_blob(NULL, testarray[i].md5);
MD5Init(&ctx);
MD5Update(&ctx, data.data, data.length);