[PATCH 1/2] kdf: add missing null-terminator for self-test test-vector array

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] kdf: add missing null-terminator for self-test test-vector array

Jussi Kivilinna-2
* cipher/kdf.c (selftest_pbkdf2): Add null-terminator to TV array.
--

This was causing kdf sefl-test to fail on s390x builds.

Signed-off-by: Jussi Kivilinna <[hidden email]>
---
 cipher/kdf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cipher/kdf.c b/cipher/kdf.c
index 3d707bd0..b916a3f8 100644
--- a/cipher/kdf.c
+++ b/cipher/kdf.c
@@ -452,7 +452,8 @@ selftest_pbkdf2 (int extended, selftest_report_func_t report)
       "\x34\x8c\x89\xdb\xcb\xd3\x2b\x2f\x32\xd8\x14\xb8\x11\x6e\x84\xcf"
       "\x2b\x17\x34\x7e\xbc\x18\x00\x18\x1c\x4e\x2a\x1f\xb8\xdd\x53\xe1"
       "\xc6\x35\x51\x8c\x7d\xac\x47\xe9"
-    }
+    },
+    { NULL }
   };
   const char *what;
   const char *errtxt;
--
2.27.0


_______________________________________________
Gcrypt-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] kdf: make self-test test-vector array read-only

Jussi Kivilinna-2
* cipher/kdf.c (selftest_pbkdf2): Make 'tv[]' constant.
--

Signed-off-by: Jussi Kivilinna <[hidden email]>
---
 cipher/kdf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cipher/kdf.c b/cipher/kdf.c
index b916a3f8..93c2c9f6 100644
--- a/cipher/kdf.c
+++ b/cipher/kdf.c
@@ -342,7 +342,7 @@ check_one (int algo, int hash_algo,
 static gpg_err_code_t
 selftest_pbkdf2 (int extended, selftest_report_func_t report)
 {
-  static struct {
+  static const struct {
     const char *desc;
     const char *p;   /* Passphrase.  */
     size_t plen;     /* Length of P. */
--
2.27.0


_______________________________________________
Gcrypt-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel