diff options
author | Volker Lendecke <vl@samba.org> | 2019-02-11 09:03:39 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-02-25 21:07:22 +0100 |
commit | e8e9677154c4ab67e4e9a9dca499121ae63a03bd (patch) | |
tree | 19cd5dd9f6c6f99ece068f59a5d70df98617873c /source3 | |
parent | 26f18b9bd71bce7f862cda615c2ef432da5c2aa9 (diff) | |
download | samba-e8e9677154c4ab67e4e9a9dca499121ae63a03bd.tar.gz |
libcli: Pass buf/len to smb2_negotiate_context_add
Every caller did a data_blob_const() right before calling
smb2_negotiate_context_add(). Avoid that.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Feb 25 21:07:22 CET 2019 on sn-devel-144
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/smb2_negprot.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c index 835c25dea55..528d3f8cc74 100644 --- a/source3/smbd/smb2_negprot.c +++ b/source3/smbd/smb2_negprot.c @@ -388,7 +388,6 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) uint16_t selected_preauth = 0; const uint8_t *p; uint8_t buf[38]; - DATA_BLOB b; size_t i; if (in_preauth->data.length < needed) { @@ -435,9 +434,12 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) SSVAL(buf, 4, selected_preauth); generate_random_buffer(buf + 6, 32); - b = data_blob_const(buf, sizeof(buf)); - status = smb2_negotiate_context_add(req, &out_c, - SMB2_PREAUTH_INTEGRITY_CAPABILITIES, b); + status = smb2_negotiate_context_add( + req, + &out_c, + SMB2_PREAUTH_INTEGRITY_CAPABILITIES, + buf, + sizeof(buf)); if (!NT_STATUS_IS_OK(status)) { return smbd_smb2_request_error(req, status); } @@ -450,7 +452,6 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) uint16_t cipher_count; const uint8_t *p; uint8_t buf[4]; - DATA_BLOB b; size_t i; bool aes_128_ccm_supported = false; bool aes_128_gcm_supported = false; @@ -504,9 +505,12 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) SSVAL(buf, 0, 1); /* ChiperCount */ SSVAL(buf, 2, xconn->smb2.server.cipher); - b = data_blob_const(buf, sizeof(buf)); - status = smb2_negotiate_context_add(req, &out_c, - SMB2_ENCRYPTION_CAPABILITIES, b); + status = smb2_negotiate_context_add( + req, + &out_c, + SMB2_ENCRYPTION_CAPABILITIES, + buf, + sizeof(buf)); if (!NT_STATUS_IS_OK(status)) { return smbd_smb2_request_error(req, status); } |