Skip to content

storage: encrypt session keys with HPKE - #4247

Merged
roman-khimov merged 2 commits into
masterfrom
proper-encryption-keys-in-session-storage
Oct 22, 2026
Merged

roman-khimov merged 2 commits into
masterfrom
proper-encryption-keys-in-session-storage

Conversation

@End-rey

@End-rey End-rey commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Closes #3426.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.34%. Comparing base (a9fb6c5) to head (ab4e5b0).

Files with missing lines Patch % Lines
pkg/util/state/token.go 80.55% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4247      +/-   ##
==========================================
+ Coverage   32.29%   32.34%   +0.04%     
==========================================
  Files         674      673       -1     
  Lines       41395    41405      +10     
==========================================
+ Hits        13370    13391      +21     
+ Misses      28025    28014      -11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@End-rey
End-rey force-pushed the proper-encryption-keys-in-session-storage branch from f686867 to 0114549 Compare October 22, 2026 15:52
Comment thread pkg/util/state/token.go Outdated
Comment thread pkg/util/state/token.go Outdated
Comment thread pkg/util/state/token.go
Comment thread pkg/util/state/migration.go Outdated
Replace direct use of the node private key as an AES key with HPKE. Atomically
migrate legacy records.

Closes #3426.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Register engine cleanup before adding shards so GC workers stop before the test
finishes, including on assertion failures.

Fix:
```
panic: Log in goroutine after TestInitializationFailure has completed: 2026-10-22T15:35:31.098Z	DEBUG	started expired objects handling	{"shard_id": "S5XQxiKfqKatUEhoHMwZ5M", "epoch": 0}
	 [recovered, repanicked]

goroutine 93 [running]:
sync.(*WaitGroup).Go.func1.1()
	/opt/hostedtoolcache/go/1.27.3/x64/src/sync/waitgroup.go:251 +0x3a
panic({0x1c15dd8?, 0xc00032cfa0?})
	/opt/hostedtoolcache/go/1.27.3/x64/src/runtime/panic.go:859 +0x125
testing.(*common).log(0xc0003ac6c8, {0xc0004bc380, 0x72}, 0x0)
	/opt/hostedtoolcache/go/1.27.3/x64/src/testing/testing.go:1123 +0x1e7
testing.(*common).Logf(0xc0003ac6c8, {0x11f600a, 0x2}, {0xc00032cf70, 0x1, 0x1})
	/opt/hostedtoolcache/go/1.27.3/x64/src/testing/testing.go:1345 +0x91
go.uber.org/zap/zaptest.TestingWriter.Write({{0x1cfa128?, 0xc0003ac6c8?}, 0x60?}, {0xc0002a2800, 0x73, 0x400})
	/home/runner/go/pkg/mod/go.uber.org/zap@v1.28.0/zaptest/logger.go:146 +0x11a
go.uber.org/zap/zapcore.(*ioCore).Write(0xc0007daea0, {0xff, {0xc2aea930c5e3f97f, 0x709cbb486, 0x1d8e720}, {0x0, 0x0}, {0x1213392, 0x20}, {0x0, ...}, ...}, ...)
	/home/runner/go/pkg/mod/go.uber.org/zap@v1.28.0/zapcore/core.go:99 +0x202
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0006e80e0, {0x0, 0x0, 0x0})
	/home/runner/go/pkg/mod/go.uber.org/zap@v1.28.0/zapcore/entry.go:276 +0x568
go.uber.org/zap.(*Logger).Debug(0xc000902900, {0x1213392, 0x20}, {0x0, 0x0, 0x0})
	/home/runner/go/pkg/mod/go.uber.org/zap@v1.28.0/logger.go:239 +0x68
github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard.(*Shard).collectExpiredObjects(0xc0000a2620)
	/home/runner/work/neofs-node/neofs-node/pkg/local_object_storage/shard/gc.go:192 +0x22b
github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard.(*Shard).removeGarbage(0xc0000a2620)
	/home/runner/work/neofs-node/neofs-node/pkg/local_object_storage/shard/gc.go:134 +0x3f
github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard.(*gc).tickRemover(0xc0000b6410)
	/home/runner/work/neofs-node/neofs-node/pkg/local_object_storage/shard/gc.go:112 +0x96
sync.(*WaitGroup).Go.func1()
	/opt/hostedtoolcache/go/1.27.3/x64/src/sync/waitgroup.go:258 +0x4a
created by sync.(*WaitGroup).Go in goroutine 71
	/opt/hostedtoolcache/go/1.27.3/x64/src/sync/waitgroup.go:238 +0x73
FAIL	github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine	30.356s
```

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
@End-rey
End-rey force-pushed the proper-encryption-keys-in-session-storage branch from 0114549 to ab4e5b0 Compare October 22, 2026 19:39
@End-rey
End-rey requested a review from roman-khimov October 22, 2026 19:40
@roman-khimov
roman-khimov merged commit 964e052 into master Oct 22, 2026
22 checks passed
@roman-khimov
roman-khimov deleted the proper-encryption-keys-in-session-storage branch October 22, 2026 20:07
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.

Make session storage use proper encryption keys

2 participants