From ce87817f4e1c21524f0383e7f7d496af5c6cb555 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 17 Aug 2012 08:33:26 +0200 Subject: [PATCH] Revert "HACK debug encryption" This reverts commit 893820bd4fadfd067015f4c49380c34cd11e3238. --- source3/smbd/smb2_server.c | 60 -------------------------------------- 1 file changed, 60 deletions(-) diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 2511c578e46d..be7997febfb9 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -173,13 +173,11 @@ static void print_req_vectors(const struct smbd_smb2_request *req) dbgtext("\treq->in.vector[%u].iov_len = %u\n", (unsigned int)i, (unsigned int)req->in.vector[i].iov_len); - dump_data(0, req->in.vector[i].iov_base, req->in.vector[i].iov_len); } for (i = 0; i < req->out.vector_count; i++) { dbgtext("\treq->out.vector[%u].iov_len = %u\n", (unsigned int)i, (unsigned int)req->out.vector[i].iov_len); - dump_data(0, req->out.vector[i].iov_base, req->out.vector[i].iov_len); } } @@ -406,9 +404,6 @@ static NTSTATUS smbd_smb2_inbuf_parse_compound(struct smbXsrv_connection *conn, TALLOC_FREE(iov); return status; } - DEBUG(0, ("%s: DECRYPT buflen[%u] taken[%u], len[%u]\n", __location__, - (unsigned)buflen, (unsigned)taken, (unsigned)len)); - dump_data(0,buf, buflen); verified_buflen = taken + enc_len; len = enc_len; @@ -431,7 +426,6 @@ static NTSTATUS smbd_smb2_inbuf_parse_compound(struct smbXsrv_connection *conn, if (SVAL(hdr, 4) != SMB2_HDR_BODY) { DEBUG(10, ("Got HDR len %d, expected %d\n", SVAL(hdr, 4), SMB2_HDR_BODY)); - DEBUG(10,(":%s: HERE INVALID\n", __location__)); goto inval; } @@ -441,27 +435,14 @@ static NTSTATUS smbd_smb2_inbuf_parse_compound(struct smbXsrv_connection *conn, if (next_command_ofs != 0) { if (next_command_ofs < (SMB2_HDR_BODY + 2)) { - DEBUG(10,(":%s: HERE INVALID\n", __location__)); goto inval; } if (next_command_ofs > full_size) { - DEBUG(10,(":%s: HERE INVALID\n", __location__)); goto inval; } - if (tf && next_command_ofs < len) { - DEBUG(0,(":%s: HERE INVALID: next_command_ofs[%u] len[%u] buflen[%u] taken[%u]\n", - __location__, - (unsigned)next_command_ofs, - (unsigned)len, - (unsigned)buflen, - (unsigned)taken)); - // dump_data(0,buf, buflen); - // goto inval; - } full_size = next_command_ofs; } if (body_size < 2) { - DEBUG(10,(":%s: HERE INVALID\n", __location__)); goto inval; } body_size &= 0xfffe; @@ -503,7 +484,6 @@ static NTSTATUS smbd_smb2_inbuf_parse_compound(struct smbXsrv_connection *conn, return NT_STATUS_OK; inval: - DEBUG(10,(":%s: HERE INVALID\n", __location__)); TALLOC_FREE(iov); return NT_STATUS_INVALID_PARAMETER; } @@ -1208,18 +1188,6 @@ static struct smbd_smb2_request *dup_smb2_req(const struct smbd_smb2_request *re smb2_setup_nbt_length(newreq->out.vector, newreq->out.vector_count); - if (DEBUGLEVEL >= 10) { - dbgtext("dup_smb2_req: req->current_idx = %u\n", - (unsigned int)req->current_idx ); - dbgtext("dup_smb2_req: returning %u vectors\n", - (unsigned int)req->out.vector_count ); - print_req_vectors(req); - dbgtext("dup_smb2_req: newreq->current_idx = %u\n", - (unsigned int)newreq->current_idx ); - dbgtext("dup_smb2_req: returning %u vectors\n", - (unsigned int)newreq->out.vector_count ); - print_req_vectors(newreq); - } return newreq; } @@ -1290,13 +1258,6 @@ static NTSTATUS smb2_send_async_interim_response(const struct smbd_smb2_request } } - if (DEBUGLEVEL >= 10) { - dbgtext("smb2_send_async_interim_response out: nreq->current_idx = %u\n", - (unsigned int)nreq->current_idx ); - dbgtext("smb2_send_async_interim_response out: returning %u vectors\n", - (unsigned int)nreq->out.vector_count ); - print_req_vectors(nreq); - } nreq->subreq = tstream_writev_queue_send(nreq, nreq->sconn->ev_ctx, nreq->sconn->smb2.stream, @@ -2344,18 +2305,6 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req) req->subreq = NULL; TALLOC_FREE(req->async_te); - if (DEBUGLEVEL >= 10) { - dbgtext("%s: smbd_smb2_request_reply[%p/%d]: " - "enc[%u] tf[%u] fk[%u] s[%p] ek[%u]\n", - __location__, req, req->current_idx, - req->do_encryption, - (unsigned)firsttf->iov_len, - (unsigned)req->first_key.length, - req->session, - (unsigned)(req->session?req->session->global->encryption_key.length:0)); - print_req_vectors(req); - } - if (req->do_encryption && (firsttf->iov_len == 0) && (req->first_key.length == 0) && @@ -2409,11 +2358,6 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req) firsttf->iov_len = SMB2_TF_HDR_SIZE; } - if (DEBUGLEVEL >= 10) { - dbgtext("%s: smbd_smb2_request_reply[%p/%d]: sending...\n", - __location__, req, req->current_idx); - print_req_vectors(req); - } if ((req->current_idx > SMBD_SMB2_NUM_IOV_PER_REQ) && (req->last_key.length > 0) && (firsttf->iov_len == 0)) @@ -2491,10 +2435,6 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req) */ if (firsttf->iov_len == SMB2_TF_HDR_SIZE) { NTSTATUS status; - if (DEBUGLEVEL >= 10) { - dbgtext("smbd_smb2_request_reply: sending...\n"); - print_req_vectors(req); - } status = smb2_signing_encrypt_pdu(req->first_key, conn->protocol, -- 2.34.1