aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-09-25 00:34:42 +0200
committerFabiano FidĂȘncio <fidencio@redhat.com>2016-01-19 11:31:08 +0100
commit05fd0acf457f6514f4dff4d6d2d3906776a76437 (patch)
treebf60c88a30f7a7feb2026d6034f7697682c77d94 /src/pki.c
parent25707e97520c7787f0a742dea419afca4c8cad41 (diff)
downloadlibssh-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/pki.c')
-rw-r--r--src/pki.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pki.c b/src/pki.c
index c993622d..ac4a543a 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -1467,13 +1467,13 @@ int ssh_pki_export_signature_blob(const ssh_signature sig,
return SSH_ERROR;
}
- str = ssh_string_new(ssh_buffer_get_rest_len(buf));
+ str = ssh_string_new(ssh_buffer_get_len(buf));
if (str == NULL) {
ssh_buffer_free(buf);
return SSH_ERROR;
}
- ssh_string_fill(str, ssh_buffer_get(buf), ssh_buffer_get_rest_len(buf));
+ ssh_string_fill(str, ssh_buffer_get(buf), ssh_buffer_get_len(buf));
ssh_buffer_free(buf);
*sig_blob = str;
@@ -1629,7 +1629,7 @@ ssh_string ssh_pki_do_sign(ssh_session session,
}
evp_update(ctx, session_id, ssh_string_len(session_id) + 4);
- evp_update(ctx, ssh_buffer_get(sigbuf), ssh_buffer_get_rest_len(sigbuf));
+ evp_update(ctx, ssh_buffer_get(sigbuf), ssh_buffer_get_len(sigbuf));
evp_final(ctx, ehash, &elen);
#ifdef DEBUG_CRYPTO
@@ -1651,7 +1651,7 @@ ssh_string ssh_pki_do_sign(ssh_session session,
rc = ssh_buffer_pack(buf,
"SP",
session_id,
- ssh_buffer_get_rest_len(sigbuf), ssh_buffer_get(sigbuf));
+ ssh_buffer_get_len(sigbuf), ssh_buffer_get(sigbuf));
if (rc != SSH_OK) {
ssh_string_free(session_id);
ssh_buffer_free(buf);
@@ -1673,7 +1673,7 @@ ssh_string ssh_pki_do_sign(ssh_session session,
}
sha1_update(ctx, session_id, ssh_string_len(session_id) + 4);
- sha1_update(ctx, ssh_buffer_get(sigbuf), ssh_buffer_get_rest_len(sigbuf));
+ sha1_update(ctx, ssh_buffer_get(sigbuf), ssh_buffer_get_len(sigbuf));
sha1_final(hash, ctx);
#ifdef DEBUG_CRYPTO