From 56873fe4922870dee9f19b9a4f1e4a7e01cb82ac Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 28 Feb 2022 15:50:53 -0800 Subject: [PATCH] [test] fix `test_ecdsa` to use array of char as message string (#7446) This commit updates `kMessage` in `test_ecdsa.cpp` function which verifies the signature generation to be an array of char instead of a `char *`. This ensures that the use of `sizeof(kMessage)` correctly gives the length of the message string (which is used during hash calculation). --- tests/unit/test_ecdsa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_ecdsa.cpp b/tests/unit/test_ecdsa.cpp index 852c20bc5..533ebcce4 100644 --- a/tests/unit/test_ecdsa.cpp +++ b/tests/unit/test_ecdsa.cpp @@ -129,7 +129,7 @@ void TestEdsaKeyGenerationSignAndVerify(void) { Instance *instance = testInitInstance(); - const char *kMessage = "You are not a drop in the ocean. You are the entire ocean in a drop."; + const char kMessage[] = "You are not a drop in the ocean. You are the entire ocean in a drop."; Ecdsa::P256::KeyPair keyPair; Ecdsa::P256::PublicKey publicKey;