Pumpkin-MC/Pumpkin · error · EncryptionError

encryption is already enabled

Error message

encryption is already enabled

What it means

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.

Solutions

  1. Reject the duplicate encryption response and disconnect
  2. Track encryption state per connection before processing responses
  3. Log the replay attempt
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/pumpkin/src/net/mod.rs:428 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09). Data as JSON: /api/errors/9b75258964fb0f3f. Report an issue: GitHub.

Appendix: source

Thrown at crates/pumpkin/src/net/mod.rs:428

                translation::java::MULTIPLAYER_DISCONNECT_BANNED_IP_EXPIRATION,
                [TextComponent::text(
                    expires.format(FORMAT_DESCRIPTION).unwrap_or_default(),
                )],
            )),
            None => text,
        });
    }

    None
}

#[derive(Error, Debug)]
pub enum EncryptionError {
    #[error("failed to decrypt shared secret")]
    FailedDecrypt,
    #[error("shared secret has the wrong length")]
    SharedWrongLength,
    #[error("encryption is already enabled")]
    AlreadyEncrypted,
    #[error("no encryption request is pending")]
    NoPendingVerifyToken,
    #[error("verify token does not match")]
    VerifyTokenMismatch,
}

fn is_valid_player_name(name: &str) -> bool {
    if name.len() > 16 {
        return false;
    }
    !name.chars().any(|c| c.is_control() || c == ' ')
}

#[derive(Clone, Copy, Debug)]
pub enum DisconnectReason {
    Unknown = 0,
    CantConnectNoInternet = 1,

View on GitHub (pinned to 8d4639e25a)