Skip to content

feat: skip file info transfer for /dev/null placeholder#1113

Open
abakum wants to merge 1 commit into
schollz:mainfrom
abakum:feat/devnull-skip
Open

feat: skip file info transfer for /dev/null placeholder#1113
abakum wants to merge 1 commit into
schollz:mainfrom
abakum:feat/devnull-skip

Conversation

@abakum
Copy link
Copy Markdown
Contributor

@abakum abakum commented May 21, 2026

No description provided.

When the sender has exactly one file and it is /dev/null, skip the
file info transfer step. This enables reusing croc's secure tunnel
(PAKE + encryption + authentication) for WebDAV or other apps
without sending real files through the croc protocol.
@abakum
Copy link
Copy Markdown
Contributor Author

abakum commented May 21, 2026

feat: skip file info transfer for /dev/null placeholder

Problem: In WebDAV/TCP forwarding mode, real files are transferred outside of croc — through a WebDAV server or TCP forwarding. However, croc's Send() method is the single entry point that performs several critical functions simultaneously:

  1. PAKE key exchange — establishing a shared secret key
  2. Channel encryption — creating an encrypted tunnel
  3. File metadata transfer — information about files being sent
  4. Actual data transfer — binary file stream

For tunnel-only use cases, only steps 1-3 are needed — no real file data should be sent through croc.

Solution: When the sender has exactly one file and it is /dev/null, skip the file info transfer by setting Step2FileInfoTransferred = true and returning early. The /dev/null placeholder:

  • Exists in the filesystem — no errors when opening
  • Has zero size — transfer completes instantly
  • Contains no data — nothing extra is sent

Analogy: Like sending an empty envelope through a courier service so that:

  • The courier (croc) establishes a secure route (encrypted channel)
  • The recipient confirms their identity (PAKE authentication)
  • After that, the real cargo travels via a separate highway (WebDAV/TCP forwarding)

This enables reusing croc's secure connection infrastructure (PAKE + encryption + authentication) as a transport tunnel for WebDAV or any other application, without sending any real files through the croc protocol itself.

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