aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-01-24 22:43:52 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-01-24 22:43:52 +0100
commit3ac62dda514e253ae4a08d8f755895cc6aa5ecac (patch)
treef2e79945f00b3e354bc763297247ca2b635ef732 /libssh
parent3465b592e717836709544e07e3a14c13c66e8444 (diff)
downloadlibssh-3ac62dda514e253ae4a08d8f755895cc6aa5ecac.tar.gz
libssh-3ac62dda514e253ae4a08d8f755895cc6aa5ecac.tar.xz
libssh-3ac62dda514e253ae4a08d8f755895cc6aa5ecac.zip
Made packet handlers independant of session buffer
Diffstat (limited to 'libssh')
-rw-r--r--libssh/messages.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libssh/messages.c b/libssh/messages.c
index e52e3af4..bbd7e439 100644
--- a/libssh/messages.c
+++ b/libssh/messages.c
@@ -175,8 +175,8 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
msg->auth_request.method = SSH_AUTH_METHOD_PASSWORD;
SAFE_FREE(service_c);
SAFE_FREE(method_c);
- buffer_get_u8(session->in_buffer, &tmp);
- pass = buffer_get_ssh_string(session->in_buffer);
+ buffer_get_u8(packet, &tmp);
+ pass = buffer_get_ssh_string(packet);
if (pass == NULL) {
goto error;
}
@@ -197,12 +197,12 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
msg->auth_request.method = SSH_AUTH_METHOD_PUBLICKEY;
SAFE_FREE(method_c);
- buffer_get_u8(session->in_buffer, &has_sign);
- algo = buffer_get_ssh_string(session->in_buffer);
+ buffer_get_u8(packet, &has_sign);
+ algo = buffer_get_ssh_string(packet);
if (algo == NULL) {
goto error;
}
- publickey = buffer_get_ssh_string(session->in_buffer);
+ publickey = buffer_get_ssh_string(packet);
if (publickey == NULL) {
string_free(algo);
algo = NULL;
@@ -224,7 +224,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
ssh_string sign = NULL;
ssh_buffer digest = NULL;
- sign = buffer_get_ssh_string(session->in_buffer);
+ sign = buffer_get_ssh_string(packet);
if(sign == NULL) {
ssh_log(session, SSH_LOG_PACKET, "Invalid signature packet from peer");
msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_ERROR;
@@ -334,7 +334,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open){
}
if (strcmp(type_c,"direct-tcpip") == 0) {
- destination = buffer_get_ssh_string(session->in_buffer);
+ destination = buffer_get_ssh_string(packet);
if (destination == NULL) {
ssh_set_error_oom(session);
goto error;
@@ -347,10 +347,10 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open){
}
string_free(destination);
- buffer_get_u32(session->in_buffer, &destination_port);
+ buffer_get_u32(packet, &destination_port);
msg->channel_request_open.destination_port = ntohl(destination_port);
- originator = buffer_get_ssh_string(session->in_buffer);
+ originator = buffer_get_ssh_string(packet);
if (originator == NULL) {
ssh_set_error_oom(session);
goto error;