aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2020-02-12 09:46:14 +0100
committerAndreas Schneider <asn@cryptomilk.org>2020-02-12 09:46:14 +0100
commita9e39a41ffb58323b4b6c0dd73c83fb7fb4e8179 (patch)
tree9098594907a853f24d475e2be8151e2631763a75 /src
parent0ece6e52aaa6b1b5b4cc2a06f0fc52486064ecab (diff)
downloadlibssh-a9e39a41ffb58323b4b6c0dd73c83fb7fb4e8179.tar.gz
libssh-a9e39a41ffb58323b4b6c0dd73c83fb7fb4e8179.tar.xz
libssh-a9e39a41ffb58323b4b6c0dd73c83fb7fb4e8179.zip
pki: Small code cleanup in ssh_pki_signature_verify()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/pki.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pki.c b/src/pki.c
index 8bbc8673..9e28ea6e 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -2446,7 +2446,8 @@ int ssh_pki_signature_verify(ssh_session session,
unsigned char application_hash[SHA256_DIGEST_LEN] = {0};
unsigned char input_hash[SHA256_DIGEST_LEN] = {0};
- if ((ctx = sha256_init())== NULL) {
+ ctx = sha256_init();
+ if (ctx == NULL) {
SSH_LOG(SSH_LOG_WARN,
"Can not create SHA256CTX for application hash");
return SSH_ERROR;
@@ -2455,7 +2456,8 @@ int ssh_pki_signature_verify(ssh_session session,
ssh_string_len(key->sk_application));
sha256_final(application_hash, ctx);
- if ((ctx = sha256_init())== NULL) {
+ ctx = sha256_init();
+ if (ctx == NULL) {
SSH_LOG(SSH_LOG_WARN,
"Can not create SHA256CTX for input hash");
return SSH_ERROR;