Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.

Commit e5bd26b

Browse files
committed
Fix a bug with the CacheKey deserialization
It was only using 32 bits.
1 parent dfc0a65 commit e5bd26b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/keys.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ impl CacheKey {
6969
}
7070

7171
/// Create a [CacheKey] from an existing ed25519 key.
72-
pub fn with_signing_key(name: &str, signing_key: SigningKey) -> Self {
73-
Self {
72+
pub fn with_signing_key(name: &str, keypair_bytes: &[u8; 64]) -> anyhow::Result<Self> {
73+
Ok(Self {
7474
name: name.into(),
75-
signing_key,
76-
}
75+
signing_key: ed25519_dalek::SigningKey::from_keypair_bytes(keypair_bytes)?,
76+
})
7777
}
7878

7979
/// Return the key for signing NARs in the store.

src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub mod persistence {
4343
let cache_key = CacheKey::with_signing_key(
4444
&db_state.name,
4545
db_state.cache_key_bytes.as_slice().try_into()?,
46-
);
46+
)?;
4747
Ok(ServerState {
4848
paseto_key,
4949
cache_key,

0 commit comments

Comments
 (0)