[Openvpn-devel,v2] Avoid warning about missing braces when initialising key struct

Message ID 20230308133743.5059-1-a@unstable.cc
State Accepted
Headers show
Series [Openvpn-devel,v2] Avoid warning about missing braces when initialising key struct | expand

Commit Message

Antonio Quartulli March 8, 2023, 1:37 p.m. UTC
Signed-off-by: Antonio Quartulli <a@unstable.cc>
---

As concluded on IRC, this version does what we want it to do.
We also quickly tested with some sample program to make sure we weren't
making this up.


 src/openvpn/tls_crypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gert Doering March 8, 2023, 1:56 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Confirmed that it pacifies github, and tests still pass.

Your patch has been applied to the master and release/2.6 branch.

commit 5a14a5ea572ec88e2a9e7bfdad9d5fe31025c021 (master)
commit 26417824ff81ba1dd18b03a40822da533018a892 (release/2.6)
Author: Antonio Quartulli
Date:   Wed Mar 8 14:37:43 2023 +0100

     Avoid warning about missing braces when initialising key struct

     Signed-off-by: Antonio Quartulli <a@unstable.cc>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20230308133743.5059-1-a@unstable.cc>
     URL: https://www.mail-archive.com/search?l=mid&q=20230308133743.5059-1-a@unstable.cc
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c
index 81098355..3b68d186 100644
--- a/src/openvpn/tls_crypt.c
+++ b/src/openvpn/tls_crypt.c
@@ -348,7 +348,7 @@  tls_crypt_v2_init_client_key(struct key_ctx_bi *key, struct key2 *original_key,
         msg(M_FATAL, "ERROR: invalid tls-crypt-v2 client key format");
     }
 
-    struct key2 key2 = { .n = 2, .keys = { 0 } };
+    struct key2 key2 = { .n = 2 };
     if (!buf_read(&client_key, &key2.keys, sizeof(key2.keys)))
     {
         msg(M_FATAL, "ERROR: not enough data in tls-crypt-v2 client key");