From 779ebdd37abd66543858252193ee9a4ae4c03360 Mon Sep 17 00:00:00 2001 From: wangyu Date: Tue, 14 Jul 2020 12:30:20 -0400 Subject: [PATCH] change gro scheme --- connection.cpp | 22 ++++++++++++++++++---- encrypt.cpp | 14 +++++++++++++- encrypt.h | 4 ++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/connection.cpp b/connection.cpp index 62d7cdb..fdeb3a4 100644 --- a/connection.cpp +++ b/connection.cpp @@ -497,9 +497,16 @@ int send_safer(conn_info_t &conn_info,char type,const char* data,int len) //saf return -1; } write_u16(send_data_buf2,new_len); - send_data_buf2[0]^=gro_xor[0]; - send_data_buf2[1]^=gro_xor[1]; new_len+=2; + if(cipher_mode==cipher_xor) + { + send_data_buf2[0]^=gro_xor[0]; + send_data_buf2[1]^=gro_xor[1]; + } + else if(cipher_mode==cipher_aes128cbc||cipher_mode==cipher_aes128cbc) + { + aes_ecb_encrypt1(send_data_buf2); + } } @@ -662,8 +669,15 @@ int recv_safer_multi(conn_info_t &conn_info,vector &type_arr,vector