1
1

kex,packet,packet_cb: Reformat

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
Jakub Jelen 2018-11-07 10:34:38 +01:00 коммит произвёл Andreas Schneider
родитель bf2c7128ab
Коммит e639c9d0d8
4 изменённых файлов: 12 добавлений и 10 удалений

Просмотреть файл

@ -428,9 +428,10 @@ out:
return is_wrong;
}
SSH_PACKET_CALLBACK(ssh_packet_kexinit){
SSH_PACKET_CALLBACK(ssh_packet_kexinit)
{
int i, ok;
int server_kex=session->server;
int server_kex = session->server;
ssh_string str = NULL;
char *strings[KEX_METHODS_SIZE] = {0};
int rc = SSH_ERROR;
@ -441,9 +442,9 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
(void)type;
(void)user;
if (session->session_state == SSH_SESSION_STATE_AUTHENTICATED){
if (session->session_state == SSH_SESSION_STATE_AUTHENTICATED) {
SSH_LOG(SSH_LOG_WARNING, "Other side initiating key re-exchange");
} else if(session->session_state != SSH_SESSION_STATE_INITIAL_KEX){
} else if (session->session_state != SSH_SESSION_STATE_INITIAL_KEX) {
ssh_set_error(session,SSH_FATAL,"SSH_KEXINIT received in wrong state");
goto error;
}

Просмотреть файл

@ -953,8 +953,8 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
size_t processed = 0; /* number of byte processed from the callback */
enum ssh_packet_filter_result_e filter_result;
if(session->current_crypto != NULL) {
current_macsize = hmac_digest_len(session->current_crypto->in_hmac);
if (session->current_crypto != NULL) {
current_macsize = hmac_digest_len(session->current_crypto->in_hmac);
}
if (lenfield_blocksize == 0) {
lenfield_blocksize = blocksize;

Просмотреть файл

@ -250,10 +250,10 @@ SSH_PACKET_CALLBACK(ssh_packet_newkeys){
}
session->dh_handshake_state = DH_STATE_FINISHED;
session->ssh_connection_callback(session);
return SSH_PACKET_USED;
return SSH_PACKET_USED;
error:
session->session_state=SSH_SESSION_STATE_ERROR;
return SSH_PACKET_USED;
session->session_state = SSH_SESSION_STATE_ERROR;
return SSH_PACKET_USED;
}
/**

Просмотреть файл

@ -2206,8 +2206,9 @@ ssh_string ssh_srv_pki_do_sign_sessionid(ssh_session session,
if (session == NULL || privkey == NULL || !ssh_key_is_private(privkey)) {
return NULL;
}
crypto = session->next_crypto ? session->next_crypto :
session->current_crypto;
session->current_crypto;
if (crypto->secret_hash == NULL){
ssh_set_error(session,SSH_FATAL,"Missing secret_hash");