libcli/smb: maintain smbXcli_conn.smb2.server.sign_algo
authorStefan Metzmacher <metze@samba.org>
Wed, 11 Nov 2020 12:18:24 +0000 (13:18 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 17 Mar 2021 00:49:32 +0000 (00:49 +0000)
This prepares the negotiation of signing algorithms in future.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14512

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smbXcli_base.c

index 37ca414d146a42015e497519dae77d964e7b577f..5df981104c7774da21c8a1f421fbfbb45517cf14 100644 (file)
@@ -127,6 +127,7 @@ struct smbXcli_conn {
                        NTTIME system_time;
                        NTTIME start_time;
                        DATA_BLOB gss_blob;
+                       uint16_t sign_algo;
                        uint16_t cipher;
                } server;
 
@@ -4985,6 +4986,12 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq)
                return;
        }
 
+       if (conn->protocol >= PROTOCOL_SMB2_24) {
+               conn->smb2.server.sign_algo = SMB2_SIGNING_AES128_CMAC;
+       } else {
+               conn->smb2.server.sign_algo = SMB2_SIGNING_HMAC_SHA256;
+       }
+
        if (conn->protocol < PROTOCOL_SMB3_10) {
                TALLOC_FREE(subreq);