mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
buffer: do not use ssh_buffer_get_rest_len()
As ssh_buffer_get_len() actually calls ssh_buffer_get_rest_len(), let's just use the first one. This is a preparatory step for removing ssh_buffer_get_rest_len(). Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
12
src/dh.c
12
src/dh.c
@@ -573,11 +573,11 @@ int ssh_make_sessionid(ssh_session session) {
|
||||
|
||||
rc = ssh_buffer_pack(buf,
|
||||
"dPdPS",
|
||||
ssh_buffer_get_rest_len(client_hash),
|
||||
ssh_buffer_get_rest_len(client_hash),
|
||||
ssh_buffer_get_len(client_hash),
|
||||
ssh_buffer_get_len(client_hash),
|
||||
ssh_buffer_get(client_hash),
|
||||
ssh_buffer_get_rest_len(server_hash),
|
||||
ssh_buffer_get_rest_len(server_hash),
|
||||
ssh_buffer_get_len(server_hash),
|
||||
ssh_buffer_get_len(server_hash),
|
||||
ssh_buffer_get(server_hash),
|
||||
session->next_crypto->server_pubkey);
|
||||
|
||||
@@ -643,7 +643,7 @@ int ssh_make_sessionid(ssh_session session) {
|
||||
ssh_set_error_oom(session);
|
||||
goto error;
|
||||
}
|
||||
sha1(ssh_buffer_get(buf), ssh_buffer_get_rest_len(buf),
|
||||
sha1(ssh_buffer_get(buf), ssh_buffer_get_len(buf),
|
||||
session->next_crypto->secret_hash);
|
||||
break;
|
||||
case SSH_KEX_ECDH_SHA2_NISTP256:
|
||||
@@ -655,7 +655,7 @@ int ssh_make_sessionid(ssh_session session) {
|
||||
ssh_set_error_oom(session);
|
||||
goto error;
|
||||
}
|
||||
sha256(ssh_buffer_get(buf), ssh_buffer_get_rest_len(buf),
|
||||
sha256(ssh_buffer_get(buf), ssh_buffer_get_len(buf),
|
||||
session->next_crypto->secret_hash);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user