aboutsummaryrefslogtreecommitdiff
path: root/internal/crypt/headers.go
diff options
context:
space:
mode:
authorishaan <contact@ishaan.cc>2026-07-14 19:26:55 +0530
committerishaan <contact@ishaan.cc>2026-07-14 19:26:55 +0530
commit6c6c4a05267e93597bb009c7d6c36383b6af7bf7 (patch)
tree4c2c85b78b07e877ca18e833d07e8624712e8a4c /internal/crypt/headers.go
parent9eb2b774e9f0522a3547644453bf929dd560f05f (diff)
ssh
Diffstat (limited to 'internal/crypt/headers.go')
-rw-r--r--internal/crypt/headers.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/internal/crypt/headers.go b/internal/crypt/headers.go
index b5addb2..8f9dac2 100644
--- a/internal/crypt/headers.go
+++ b/internal/crypt/headers.go
@@ -18,15 +18,24 @@ const (
)
type FileHeaders struct {
- Salt [16]byte
- Nonce [12]byte
- Type DataType
- Auth AuthMode
- Parts int
+ Salt [16]byte
+ Nonce [12]byte
+ Type DataType
+ Auth AuthMode // "Pass" or "SSH"
+ Parts int
+ Recipients []WrappedKey
// TODO: Version (string) for the version of .eno file.
}
+type WrappedKey struct {
+ PKType string // "ssh-ed25519"
+ PubKeyBytes []byte
+ EphemeralPub []byte // of X25519, for ECDH on decrypt (also can replace salt)
+ Nonce [12]byte // for decrypting EncNoteKey
+ EncNoteKey []byte // encrypted note key (ciphertext + 16B tag)
+}
+
func GetFileHeaders(b []byte) (FileHeaders, error) {
dec := gob.NewDecoder(bytes.NewReader(b))
var headers FileHeaders