Skip to content

Commit 993c462

Browse files
Merge branch 'encryption' into encryption
2 parents 2048bdd + a8600f2 commit 993c462

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

crates/proto/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ serde = { version = "1.0", features = ["derive"] }
3838
serde_repr = "0.1.19"
3939

4040
rak-rs = { version = "0.3", default-features = false, features = ["async_tokio", "mcpe"] }
41+
42+
p384 = "0.13.0"
43+
sha2 = "0.10.8"
44+
aes-gcm = "0.10"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use bedrockrs_macros::{gamepacket, ProtoCodec};
2+
3+
#[gamepacket(id = 1)]
4+
#[derive(ProtoCodec, Clone, Debug)]
5+
pub struct LoginPacket {
6+
#[endianness(be)]
7+
pub client_network_version: i32,
8+
pub connection_request: String,
9+
}

crates/proto_core/src/error.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ pub enum CompressionError {
7272
pub enum EncryptionError {
7373
#[error("IO Error: {0}")]
7474
IOError(IOError),
75+
76+
#[error("Encryption Error")]
77+
EncryptionFailed(),
78+
79+
#[error("Decryption Error")]
80+
DecryptionFailed(),
81+
82+
#[error("Startup Error")]
83+
StartupFailed(),
84+
85+
#[error("Missing Key")]
86+
MissingKey,
7587
}
7688

7789
#[derive(Error, Debug)]

0 commit comments

Comments
 (0)