mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
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>
This commit is contained in:
committed by
Andreas Schneider
parent
732818ebb2
commit
58ef1e96b8
75
src/dh.c
75
src/dh.c
@@ -980,51 +980,50 @@ error:
|
|||||||
* @deprecated Use ssh_get_publickey_hash()
|
* @deprecated Use ssh_get_publickey_hash()
|
||||||
*/
|
*/
|
||||||
int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash) {
|
int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash) {
|
||||||
ssh_key pubkey = NULL;
|
ssh_key pubkey = NULL;
|
||||||
ssh_string pubkey_blob = NULL;
|
ssh_string pubkey_blob = NULL;
|
||||||
MD5CTX ctx;
|
MD5CTX ctx;
|
||||||
unsigned char *h;
|
unsigned char *h;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (session == NULL || hash == NULL) {
|
if (session == NULL || hash == NULL) {
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
*hash = NULL;
|
*hash = NULL;
|
||||||
if (session->current_crypto == NULL ||
|
if (session->current_crypto == NULL ||
|
||||||
session->current_crypto->server_pubkey == NULL){
|
session->current_crypto->server_pubkey == NULL) {
|
||||||
ssh_set_error(session,SSH_FATAL,"No current cryptographic context");
|
ssh_set_error(session,SSH_FATAL,"No current cryptographic context");
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
h = calloc(MD5_DIGEST_LEN, sizeof(unsigned char));
|
h = calloc(MD5_DIGEST_LEN, sizeof(unsigned char));
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = md5_init();
|
ctx = md5_init();
|
||||||
if (ctx == NULL) {
|
if (ctx == NULL) {
|
||||||
SAFE_FREE(h);
|
SAFE_FREE(h);
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = ssh_get_server_publickey(session, &pubkey);
|
rc = ssh_get_server_publickey(session, &pubkey);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
SAFE_FREE(h);
|
SAFE_FREE(h);
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = ssh_pki_export_pubkey_blob(pubkey,
|
rc = ssh_pki_export_pubkey_blob(pubkey, &pubkey_blob);
|
||||||
&pubkey_blob);
|
ssh_key_free(pubkey);
|
||||||
ssh_key_free(pubkey);
|
if (rc != 0) {
|
||||||
if (rc != 0) {
|
}
|
||||||
}
|
md5_update(ctx, ssh_string_data(pubkey_blob), ssh_string_len(pubkey_blob));
|
||||||
md5_update(ctx, ssh_string_data(pubkey_blob), ssh_string_len(pubkey_blob));
|
ssh_string_free(pubkey_blob);
|
||||||
ssh_string_free(pubkey_blob);
|
md5_final(h, ctx);
|
||||||
md5_final(h, ctx);
|
|
||||||
|
|
||||||
*hash = h;
|
*hash = h;
|
||||||
|
|
||||||
return MD5_DIGEST_LEN;
|
return MD5_DIGEST_LEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user