Skip to content

caldav: handle shared calendar signature verification gracefully#8

Open
haurucknde wants to merge 1 commit intoacheong08:mainfrom
haurucknde:fix/shared-calendar-signature
Open

caldav: handle shared calendar signature verification gracefully#8
haurucknde wants to merge 1 commit intoacheong08:mainfrom
haurucknde:fix/shared-calendar-signature

Conversation

@haurucknde
Copy link

Summary

When accessing shared calendars via CalDAV, event signature verification fails because the signer's key (the calendar owner) isn't available in the reader's keyring. This causes two problems:

  1. readEventCard returns a fatal error on md.SignatureError, crashing the entire request
  2. QueryCalendarObjects aborts on the first event that fails to decode, blocking access to all events

This PR makes both paths resilient:

  • readEventCard: SignatureError is now non-fatal — logged as a warning but execution continues. The event data is still readable via E2E decryption; only the authorship signature can't be verified.
  • QueryCalendarObjects: Individual events that fail to decode are skipped (with a log message) instead of aborting the entire query. This matches the resilient error-handling pattern and prevents one problematic event from blocking access to all others.

Reproduction

  1. User A shares a Proton Calendar with User B
  2. User B connects via ferroxide CalDAV
  3. Querying the shared calendar fails with: signature made by unknown entity

Testing

Tested with a real shared Proton Calendar (owner ≠ reader). All 13 events from the shared calendar now load correctly where they previously caused fatal errors. Read and write operations (PUT/DELETE) on the shared calendar also work as expected.

Changes

  • caldav/caldav.go: Add log import
  • caldav/caldav.go readEventCard(): Make SignatureError non-fatal (log + continue)
  • caldav/caldav.go QueryCalendarObjects(): Skip failed events instead of returning error

When accessing shared calendars, event signature verification fails
because the signer's key (the calendar owner) isn't always available
in the reader's keyring. Previously this caused a fatal error that
crashed the entire calendar query.

Changes:
- readEventCard: make SignatureError non-fatal (log warning, continue).
  The event data is still readable via E2E decryption; only the
  authorship signature can't be verified.
- QueryCalendarObjects: skip individual events that fail to decode
  instead of aborting the entire query. This matches the resilient
  pattern already used elsewhere and prevents one bad event from
  blocking access to all others.

Tested with a shared Proton Calendar (owner ≠ reader) — all events
now load correctly where they previously caused "signature made by
unknown entity" errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant