Skip to content

Commit

Permalink
Try to fix encryption channel error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickid2018 committed Jul 14, 2024
1 parent 1df7b4b commit 3500481
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 227 deletions.
35 changes: 19 additions & 16 deletions protocol/protocol_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,37 @@ typedef enum {
HANDSHAKE, PLAY, PING, LOGIN, TRANSFER, CONFIGURATION, INVALID
} je_state;

typedef struct {
guint8 *server_decrypt;
guint8 *client_decrypt;
gint server_decrypt_length;
gint client_decrypt_length;

gcry_cipher_hd_t server_cipher;
gcry_cipher_hd_t client_cipher;

gint server_last_decrypt_available;
gint client_last_decrypt_available;
gint server_required_length;
gint client_required_length;
} mcje_decryption_context;

typedef struct {
je_state client_state;
je_state server_state;

guint32 server_port;
address server_address;

guint32 protocol_version;
guint32 data_version;
protocol_je_set protocol_set;

gint32 compression_threshold;
bool encrypted;

gcry_cipher_hd_t server_cipher;
gcry_cipher_hd_t client_cipher;
gint server_last_segment_remaining;
gint client_last_segment_remaining;

void *extra;
mcje_decryption_context *decryption_context;
} mcje_protocol_context;

typedef struct {
je_state client_state;
je_state server_state;

bool encrypted;
guint8 *decrypted_data;
gint32 compression_threshold;
} mcje_frame_data;

typedef struct {
gint record_total;
gint record_latest;
Expand Down
Loading

0 comments on commit 3500481

Please sign in to comment.