libcli:smb: Avoid explicit ZERO_STRUCT
authorAndreas Schneider <asn@samba.org>
Thu, 18 Oct 2018 09:26:44 +0000 (11:26 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 20 Dec 2018 11:16:40 +0000 (12:16 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/smb/smb2_signing.c

index 90d80cc..614a2b3 100644 (file)
@@ -65,9 +65,8 @@ NTSTATUS smb2_signing_sign_pdu(DATA_BLOB signing_key,
 
        if (protocol >= PROTOCOL_SMB2_24) {
                struct aes_cmac_128_context ctx;
-               uint8_t key[AES_BLOCK_SIZE];
+               uint8_t key[AES_BLOCK_SIZE] = {0};
 
-               ZERO_STRUCT(key);
                memcpy(key, signing_key.data, MIN(signing_key.length, 16));
 
                aes_cmac_128_init(&ctx, key);
@@ -137,9 +136,8 @@ NTSTATUS smb2_signing_check_pdu(DATA_BLOB signing_key,
 
        if (protocol >= PROTOCOL_SMB2_24) {
                struct aes_cmac_128_context ctx;
-               uint8_t key[AES_BLOCK_SIZE];
+               uint8_t key[AES_BLOCK_SIZE] = {0};
 
-               ZERO_STRUCT(key);
                memcpy(key, signing_key.data, MIN(signing_key.length, 16));
 
                aes_cmac_128_init(&ctx, key);