From 58ef1e96b8b28767351d33e2b7481df67c6417fa Mon Sep 17 00:00:00 2001 From: Jon Simons Date: Fri, 25 May 2018 03:52:25 -0700 Subject: [PATCH] dh: fix `ssh_get_pubkey_hash` indentation Fix `ssh_get_pubkey_hash` indentation to use softabs with 4 spaces. No change in behavior. Signed-off-by: Jon Simons Reviewed-by: Andreas Schneider --- src/dh.c | 75 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/src/dh.c b/src/dh.c index 1c76cf97..d1523442 100644 --- a/src/dh.c +++ b/src/dh.c @@ -980,51 +980,50 @@ error: * @deprecated Use ssh_get_publickey_hash() */ int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash) { - ssh_key pubkey = NULL; - ssh_string pubkey_blob = NULL; - MD5CTX ctx; - unsigned char *h; - int rc; + ssh_key pubkey = NULL; + ssh_string pubkey_blob = NULL; + MD5CTX ctx; + unsigned char *h; + int rc; - if (session == NULL || hash == NULL) { - return SSH_ERROR; - } - *hash = NULL; - if (session->current_crypto == NULL || - session->current_crypto->server_pubkey == NULL){ - ssh_set_error(session,SSH_FATAL,"No current cryptographic context"); - return SSH_ERROR; - } + if (session == NULL || hash == NULL) { + return SSH_ERROR; + } + *hash = NULL; + if (session->current_crypto == NULL || + session->current_crypto->server_pubkey == NULL) { + ssh_set_error(session,SSH_FATAL,"No current cryptographic context"); + return SSH_ERROR; + } - h = calloc(MD5_DIGEST_LEN, sizeof(unsigned char)); - if (h == NULL) { - return SSH_ERROR; - } + h = calloc(MD5_DIGEST_LEN, sizeof(unsigned char)); + if (h == NULL) { + return SSH_ERROR; + } - ctx = md5_init(); - if (ctx == NULL) { - SAFE_FREE(h); - return SSH_ERROR; - } + ctx = md5_init(); + if (ctx == NULL) { + SAFE_FREE(h); + return SSH_ERROR; + } - rc = ssh_get_server_publickey(session, &pubkey); - if (rc != 0) { - SAFE_FREE(h); - return SSH_ERROR; - } + rc = ssh_get_server_publickey(session, &pubkey); + if (rc != 0) { + SAFE_FREE(h); + return SSH_ERROR; + } - rc = ssh_pki_export_pubkey_blob(pubkey, - &pubkey_blob); - ssh_key_free(pubkey); - if (rc != 0) { - } - md5_update(ctx, ssh_string_data(pubkey_blob), ssh_string_len(pubkey_blob)); - ssh_string_free(pubkey_blob); - md5_final(h, ctx); + rc = ssh_pki_export_pubkey_blob(pubkey, &pubkey_blob); + ssh_key_free(pubkey); + if (rc != 0) { + } + md5_update(ctx, ssh_string_data(pubkey_blob), ssh_string_len(pubkey_blob)); + ssh_string_free(pubkey_blob); + md5_final(h, ctx); - *hash = h; + *hash = h; - return MD5_DIGEST_LEN; + return MD5_DIGEST_LEN; } /**