From d733924df8c63c89c2dbc0c2709e6d8a1aeb771e Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 31 Jan 2012 13:34:26 +0100 Subject: [PATCH] Use stream API instead of accessing stream fields directly. This include use of stream_attach(), so 'size' is properly set. --- libfreerdp-core/credssp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libfreerdp-core/credssp.c b/libfreerdp-core/credssp.c index 095b4ad54..c57b78fff 100644 --- a/libfreerdp-core/credssp.c +++ b/libfreerdp-core/credssp.c @@ -164,28 +164,28 @@ int credssp_authenticate(rdpCredssp* credssp) return 0; /* NTLMSSP NEGOTIATE MESSAGE */ - s->p = s->data = negoTokenBuffer; + stream_attach(s, negoTokenBuffer, 2048); ntlmssp_send(ntlmssp, s); - credssp->negoToken.data = s->data; - credssp->negoToken.length = s->p - s->data; + credssp->negoToken.data = stream_get_head(s); + credssp->negoToken.length = stream_get_length(s); credssp_send(credssp, &credssp->negoToken, NULL, NULL); /* NTLMSSP CHALLENGE MESSAGE */ if (credssp_recv(credssp, &credssp->negoToken, NULL, NULL) < 0) return -1; - s->p = s->data = credssp->negoToken.data; + stream_attach(s, credssp->negoToken.data, credssp->negoToken.length); ntlmssp_recv(ntlmssp, s); freerdp_blob_free(&credssp->negoToken); /* NTLMSSP AUTHENTICATE MESSAGE */ - s->p = s->data = negoTokenBuffer; + stream_attach(s, negoTokenBuffer, 2048); ntlmssp_send(ntlmssp, s); /* The last NTLMSSP message is sent with the encrypted public key */ - credssp->negoToken.data = s->data; - credssp->negoToken.length = s->p - s->data; + credssp->negoToken.data = stream_get_head(s); + credssp->negoToken.length = stream_get_length(s); credssp_encrypt_public_key(credssp, &credssp->pubKeyAuth); credssp_send(credssp, &credssp->negoToken, NULL, &credssp->pubKeyAuth);