diff options
author | Fabiano FidĂȘncio <fidencio@redhat.com> | 2015-09-25 00:34:42 +0200 |
---|---|---|
committer | Fabiano FidĂȘncio <fidencio@redhat.com> | 2016-01-19 11:31:08 +0100 |
commit | 05fd0acf457f6514f4dff4d6d2d3906776a76437 (patch) | |
tree | bf60c88a30f7a7feb2026d6034f7697682c77d94 /src/dh.c | |
parent | 25707e97520c7787f0a742dea419afca4c8cad41 (diff) | |
download | libssh-05fd0acf457f6514f4dff4d6d2d3906776a76437.tar.gz libssh-05fd0acf457f6514f4dff4d6d2d3906776a76437.tar.xz libssh-05fd0acf457f6514f4dff4d6d2d3906776a76437.zip |
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>
Diffstat (limited to 'src/dh.c')
-rw-r--r-- | src/dh.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; } |