1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-13 04:42:23 +03:00

Reformat packet_decrypt_len().

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@478 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-15 07:56:57 +00:00
parent af454c0f34
commit 576187c686

View File

@@ -38,19 +38,21 @@
#include "libssh/crypto.h" #include "libssh/crypto.h"
u32 packet_decrypt_len(SSH_SESSION *session, char *crypted){ u32 packet_decrypt_len(SSH_SESSION *session, char *crypted){
u32 decrypted; u32 decrypted;
if (session->current_crypto) {
if (packet_decrypt(session, crypted, if (session->current_crypto) {
session->current_crypto->in_cipher->blocksize) < 0) { if (packet_decrypt(session, crypted,
return 0; session->current_crypto->in_cipher->blocksize) < 0) {
} return 0;
} }
memcpy(&decrypted,crypted,sizeof(decrypted)); }
ssh_log(session, SSH_LOG_PACKET,
"Packet size decrypted: %lu (0x%lx)", memcpy(&decrypted,crypted,sizeof(decrypted));
(long unsigned int) ntohl(decrypted), ssh_log(session, SSH_LOG_PACKET,
(long unsigned int) ntohl(decrypted)); "Packet size decrypted: %lu (0x%lx)",
return ntohl(decrypted); (long unsigned int) ntohl(decrypted),
(long unsigned int) ntohl(decrypted));
return ntohl(decrypted);
} }
int packet_decrypt(SSH_SESSION *session, void *data,u32 len){ int packet_decrypt(SSH_SESSION *session, void *data,u32 len){