diff options
author | Jon Simons <jon@jonsimons.org> | 2018-05-25 03:52:25 -0700 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-06-27 21:25:32 +0200 |
commit | 58ef1e96b8b28767351d33e2b7481df67c6417fa (patch) | |
tree | 480497cbb648ed320b936b0682c91c4dd07f6b63 | |
parent | 732818ebb28e3c9d0323e9b26d9c2de04db2b062 (diff) | |
download | libssh-58ef1e96b8b28767351d33e2b7481df67c6417fa.tar.gz libssh-58ef1e96b8b28767351d33e2b7481df67c6417fa.tar.xz libssh-58ef1e96b8b28767351d33e2b7481df67c6417fa.zip |
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 <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | src/dh.c | 75 |
1 files changed, 37 insertions, 38 deletions
@@ -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; } /** |