15. Error Handling

This section defines standard error codes and error-handling requirements for the PALISADE protocol.


15.1 Error Message Format

When an error response is transmitted, it uses the following structure:

ErrorResponse =
    error_code   (2 bytes)
    details_len  (2 bytes)
    details      (details_len bytes)

Where:

  • error_code is a 16-bit unsigned integer identifying the error condition.
  • details is an OPTIONAL human-readable description.
  • All multi-byte fields are encoded in big-endian byte order.

The details field is intended for diagnostics only and MUST NOT contain sensitive information.


15.2 Error Code Ranges

Error codes are divided into the following ranges:

RangeCategory
0x0000No error
0x0100–0x01FFHandshake errors
0x0200–0x02FFSession errors
0x0300–0x03FFData plane errors
0x0400–0x04FFResumption errors
0x0500–0x05FFMigration errors
0x0600–0x06FFControl frame errors
0xFF00–0xFFFFGeneric errors

15.3 Defined Error Codes

15.3.1 Handshake Errors (0x0100–0x01FF)

CodeNameDescriptionFatal
0x0100ErrorInvalidVersionUnsupported protocol versionYes
0x0101ErrorUnsupportedKEMNo mutually supported KEMYes
0x0102ErrorUnsupportedSignatureNo mutually supported signatureYes
0x0103ErrorUnsupportedAEADNo mutually supported AEADYes
0x0104ErrorInvalidClientHelloMalformed ClientHelloYes
0x0105ErrorInvalidServerHelloMalformed ServerHelloYes
0x0106ErrorSignatureVerifyFailedSignature verification failedYes
0x0107ErrorCertificateInvalidInvalid or unacceptable certificateYes
0x0108ErrorKEMDecapFailedKEM decapsulation failedYes

15.3.2 Session Errors (0x0200–0x02FF)

CodeNameDescriptionFatal
0x0200ErrorSessionNotFoundSession not foundNo
0x0201ErrorSessionExpiredSession expiredYes
0x0202ErrorSessionLimitExceededSession limit exceededNo

15.3.3 Data Plane Errors (0x0300–0x03FF)

CodeNameDescriptionFatal
0x0300ErrorAEADDecryptFailedAEAD authentication failedNo
0x0301ErrorInvalidEpochPacket epoch invalidNo
0x0302ErrorSequenceExhaustedSequence space exhaustedYes
0x0303ErrorReplayDetectedReplayed packet detectedNo
0x0304ErrorTimestampInvalidTimestamp invalidNo
0x0305ErrorPacketTooLargePacket exceeds size limitsNo

15.3.4 Resumption Errors (0x0400–0x04FF)

CodeNameDescriptionFatal
0x0400ErrorTicketInvalidTicket invalidYes
0x0401ErrorTicketExpiredTicket expiredYes
0x0402ErrorTicketAlreadyUsedTicket replay detectedYes
0x0403ErrorEarlyDataRejectedEarly data rejectedNo

15.3.5 Migration Errors (0x0500–0x05FF)

CodeNameDescriptionFatal
0x0500ErrorMigrationFailedMigration failedNo
0x0501ErrorMigrationEpochMismatchEpoch mismatchNo
0x0502ErrorMigrationStaleTimestampTimestamp too oldNo
0x0503ErrorInvalidMigrationReasonInvalid reason codeNo
0x0504ErrorMigrationNonceReusedMigration replay detectedNo
0x0505ErrorMigrationRateLimitExceededMigration rate limit exceededNo
0x0506ErrorMigrationInProgressMigration already in progressNo

15.3.6 Control Frame Errors (0x0600–0x06FF)

CodeNameDescriptionFatal
0x0600ErrorInvalidControlFrameMalformed control frameNo
0x0601ErrorUnknownControlTypeUnknown control typeNo

15.3.7 Generic Errors (0xFF00–0xFFFF)

CodeNameDescriptionFatal
0xFF00ErrorInternalErrorInternal errorYes
0xFF01ErrorResourceExhaustedResource exhaustionNo

15.4 Fatal vs. Non-Fatal Errors

Errors are classified as fatal or non-fatal.

Fatal Errors

When a fatal error occurs, the endpoint MUST:

  • Abort the current session or handshake.
  • Securely erase all derived secrets.
  • Cease further packet processing.
  • Require a new handshake to resume communication.

An error response MAY be sent if doing so does not introduce additional risk.

Non-Fatal Errors

When a non-fatal error occurs, the endpoint:

  • MAY continue processing subsequent packets.
  • MUST NOT alter cryptographic session state unless explicitly required.

15.5 Error Transmission Rules

Error responses:

  • MUST be encrypted if session keys are established.
  • MAY be sent in cleartext only during the handshake, before keys are available.
  • MUST NOT be retransmitted automatically.
  • Endpoints MUST be robust to missing or dropped error responses.

15.6 Error Disclosure Policy

Error responses MUST NOT:

  • Reveal cryptographic secrets.
  • Reveal internal state, counters, or memory addresses.
  • Enable oracle attacks through distinguishable behavior.

Implementations SHOULD minimize externally visible differences between error conditions.


15.7 Security Properties

The error framework ensures:

  • Fail-closed behavior on cryptographic errors
  • Resistance to oracle attacks
  • Bounded information disclosure
  • Clear separation between protocol and implementation policy

PALISADE Protocol Specification Draft 00

INFORMATIONAL