{"record":{"id":"9b75258964fb0f3f","repo":"Pumpkin-MC/Pumpkin","slug":"encryption-is-already-enabled","errorCode":null,"errorMessage":"encryption is already enabled","messagePattern":"encryption is already enabled","errorType":"exception","errorClass":"EncryptionError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/net/mod.rs","lineNumber":428,"sourceCode":"                translation::java::MULTIPLAYER_DISCONNECT_BANNED_IP_EXPIRATION,\n                [TextComponent::text(\n                    expires.format(FORMAT_DESCRIPTION).unwrap_or_default(),\n                )],\n            )),\n            None => text,\n        });\n    }\n\n    None\n}\n\n#[derive(Error, Debug)]\npub enum EncryptionError {\n    #[error(\"failed to decrypt shared secret\")]\n    FailedDecrypt,\n    #[error(\"shared secret has the wrong length\")]\n    SharedWrongLength,\n    #[error(\"encryption is already enabled\")]\n    AlreadyEncrypted,\n    #[error(\"no encryption request is pending\")]\n    NoPendingVerifyToken,\n    #[error(\"verify token does not match\")]\n    VerifyTokenMismatch,\n}\n\nfn is_valid_player_name(name: &str) -> bool {\n    if name.len() > 16 {\n        return false;\n    }\n    !name.chars().any(|c| c.is_control() || c == ' ')\n}\n\n#[derive(Clone, Copy, Debug)]\npub enum DisconnectReason {\n    Unknown = 0,\n    CantConnectNoInternet = 1,","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/mod.rs#L410-L446","documentation":"EncryptionError guard variant: the Java login flow attempted to enable online-mode encryption on a connection that already has it enabled. It is a state guard against a duplicate encryption-start (SKeyRequest/encryption response replay), meaning the client sent a second encryption handshake for an already-encrypted connection.","triggerScenarios":"Thrown at crates/pumpkin/src/net/mod.rs:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject the duplicate encryption response and disconnect","Track encryption state per connection before processing responses","Log the replay attempt"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}