1
1

crypt: Rename to packet_crypt.

Этот коммит содержится в:
Andreas Schneider 2011-09-17 20:05:58 +02:00
родитель acfc8ea83f
Коммит b785014a15
5 изменённых файлов: 20 добавлений и 18 удалений

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

@ -22,6 +22,8 @@
#ifndef PACKET_H_
#define PACKET_H_
struct ssh_socket_struct;
/* this structure should go someday */
typedef struct packet_struct {
int valid;
@ -58,5 +60,19 @@ int ssh_packet_send_unimplemented(ssh_session session, uint32_t seqnum);
int ssh_packet_parse_type(ssh_session session);
//int packet_flush(ssh_session session, int enforce_blocking);
int ssh_packet_socket_callback(const void *data, size_t len, void *user);
void ssh_packet_register_socket_callback(ssh_session session, struct ssh_socket_struct *s);
void ssh_packet_set_callbacks(ssh_session session, ssh_packet_callbacks callbacks);
void ssh_packet_set_default_callbacks(ssh_session session);
void ssh_packet_process(ssh_session session, uint8_t type);
/* PACKET CRYPT */
uint32_t packet_decrypt_len(ssh_session session, char *crypted);
int packet_decrypt(ssh_session session, void *packet, unsigned int len);
unsigned char *packet_encrypt(ssh_session session,
void *packet,
unsigned int len);
int packet_hmac_verify(ssh_session session,ssh_buffer buffer,
unsigned char *mac);
#endif /* PACKET_H_ */

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

@ -21,6 +21,7 @@
#ifndef POLL_H_
#define POLL_H_
#include "config.h"
#ifdef HAVE_POLL
@ -135,6 +136,7 @@ typedef struct ssh_poll_handle_struct *ssh_poll_handle;
typedef int (*ssh_poll_callback)(ssh_poll_handle p, socket_t fd, int revents,
void *userdata);
struct ssh_socket_struct;
ssh_poll_handle ssh_poll_new(socket_t fd, short events, ssh_poll_callback cb,
void *userdata);

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

@ -184,22 +184,6 @@ SSH_PACKET_CALLBACK(ssh_packet_dh_reply);
SSH_PACKET_CALLBACK(ssh_packet_newkeys);
SSH_PACKET_CALLBACK(ssh_packet_service_accept);
/* in crypt.c */
uint32_t packet_decrypt_len(ssh_session session,char *crypted);
int packet_decrypt(ssh_session session, void *packet,unsigned int len);
unsigned char *packet_encrypt(ssh_session session,void *packet,unsigned int len);
/* it returns the hmac buffer if exists*/
struct ssh_poll_handle_struct;
int packet_hmac_verify(ssh_session session,ssh_buffer buffer,unsigned char *mac);
struct ssh_socket_struct;
int ssh_packet_socket_callback(const void *data, size_t len, void *user);
void ssh_packet_register_socket_callback(ssh_session session, struct ssh_socket_struct *s);
void ssh_packet_set_callbacks(ssh_session session, ssh_packet_callbacks callbacks);
void ssh_packet_set_default_callbacks(ssh_session session);
void ssh_packet_process(ssh_session session, uint8_t type);
/* connect.c */
socket_t ssh_connect_host(ssh_session session, const char *host,const char
*bind_addr, int port, long timeout, long usec);

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

@ -82,7 +82,6 @@ set(libssh_SRCS
client.c
config.c
connect.c
crypt.c
dh.c
ecdh.c
error.c
@ -99,6 +98,7 @@ set(libssh_SRCS
misc.c
options.c
packet.c
packet_crypt.c
pcap.c
pki.c
poll.c

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

@ -111,7 +111,7 @@ unsigned char *packet_encrypt(ssh_session session, void *data, uint32_t len) {
seq = ntohl(session->send_seq);
crypto = session->current_crypto->out_cipher;
ssh_log(session, SSH_LOG_PACKET,
ssh_log(session, SSH_LOG_PACKET,
"Encrypting packet with seq num: %d, len: %d",
session->send_seq,len);